.avatar-mini {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--primary);
  background: linear-gradient(135deg, #ffffff, #dcefe9);
  border: 1px solid rgba(72, 95, 119, 0.14);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  box-shadow: var(--shadow-tight);
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 28px;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 430px);
  padding: 28px;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(195, 199, 205, 0.2);
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease;
}

@media (min-width: 560px) {
  .icon-button {
    width: 38px;
    height: 38px;
  }
}

.icon-button:active,
.primary-button:active,
.ghost-button:active {
  transform: scale(0.96);
}

.hero-title {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-head);
  font-size: clamp(48px, 12vw, 80px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: clamp(44px, 10vw, 70px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.subcopy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(195, 199, 205, 0.26);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.soft-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(195, 199, 205, 0.2);
  border-radius: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  color: var(--primary);
  background: rgba(207, 229, 255, 0.38);
  border: 1px solid rgba(72, 95, 119, 0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip.tan {
  color: var(--tan);
  background: rgba(250, 219, 180, 0.46);
}

.chip.neutral {
  color: var(--muted);
  background: rgba(227, 226, 224, 0.42);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  color: #ffffff;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(37, 52, 79, 0.18);
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(195, 199, 205, 0.32);
  border-radius: 999px;
  font-weight: 800;
}

.segmented {
  display: flex;
  gap: 8px;
  padding: 5px;
  overflow-x: auto;
  background: rgba(239, 238, 235, 0.72);
  border-radius: 13px;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button {
  min-height: 42px;
  padding: 0 22px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.segmented button.active {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-tight);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(195, 199, 205, 0.38);
  border-radius: 10px;
  outline: none;
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 13px;
}

.field textarea {
  min-height: 116px;
  padding: 12px 13px;
  resize: vertical;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(195, 199, 205, 0.22);
}

.is-done {
  color: rgba(67, 71, 77, 0.52);
  text-decoration: line-through;
  text-decoration-color: rgba(67, 71, 77, 0.42);
}

.round-check {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  color: transparent;
  background: transparent;
  border: 2px solid var(--outline);
  border-radius: 999px;
}

.round-check.done {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  background: var(--primary);
  border-radius: 999px;
  vertical-align: 1px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(47, 49, 47, 0.16);
  backdrop-filter: blur(8px);
}

.bottom-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 400;
  max-height: min(82dvh, 680px);
  padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
  overflow: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(195, 199, 205, 0.26);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -24px 70px rgba(37, 52, 79, 0.14);
  backdrop-filter: blur(22px);
  animation: sheet-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sheet-title {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 400;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.settings-panel {
  display: grid;
  gap: 18px;
}

.settings-logo {
  display: grid;
  gap: 4px;
  padding: 6px 2px 12px;
}

.settings-logo span {
  color: var(--primary);
  font-family: var(--font-head);
  font-size: 42px;
  line-height: 1;
}

.settings-logo small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-list {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(195, 199, 205, 0.26);
  border-radius: 16px;
}

.settings-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(195, 199, 205, 0.2);
  font-weight: 800;
  text-align: left;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--primary);
  background: rgba(207, 229, 255, 0.38);
  border-radius: 999px;
}

.settings-row.danger {
  color: #9f1d1d;
  background: rgba(255, 218, 214, 0.35);
  border: 1px solid rgba(159, 29, 29, 0.12);
  border-radius: 16px;
}

.settings-row.danger .settings-row-icon {
  color: #9f1d1d;
  background: rgba(255, 218, 214, 0.85);
}

@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 920px) {
  .bottom-sheet {
    inset: 50% auto auto 50%;
    width: min(520px, calc(100vw - 48px));
    max-height: min(760px, calc(100dvh - 48px));
    padding: 24px;
    border-radius: 22px;
    transform: translate(-50%, -50%);
    animation: modal-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  @keyframes modal-in {
    from {
      transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
      opacity: 0;
    }
    to {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
    }
  }
}

.tweak-mode * {
  cursor: crosshair;
}

.tweak-mode .tweak-toolbar,
.tweak-mode .tweak-toolbar * {
  cursor: default;
}

.tweak-selection-box {
  position: fixed;
  left: var(--x);
  top: var(--y);
  z-index: 500;
  width: var(--w);
  height: var(--h);
  border: 2px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(47, 49, 47, 0.08), 0 14px 40px rgba(72, 95, 119, 0.18);
  pointer-events: none;
}

.tweak-selection-box::after {
  position: absolute;
  left: 10px;
  top: -32px;
  content: "Ausgewaehlt";
  padding: 5px 10px;
  color: #ffffff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tweak-toolbar {
  position: fixed;
  inset: auto 10px calc(82px + env(safe-area-inset-bottom)) 10px;
  z-index: 510;
  display: grid;
  gap: 9px;
  max-height: min(62dvh, 520px);
  padding: 12px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(195, 199, 205, 0.34);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(37, 52, 79, 0.18);
  backdrop-filter: blur(22px);
}

.tweak-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tweak-head-actions {
  display: flex;
  gap: 6px;
}

.tweak-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tweak-selected {
  padding: 10px 12px;
  color: var(--primary);
  background: rgba(207, 229, 255, 0.3);
  border: 1px solid rgba(72, 95, 119, 0.12);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.tweak-controls {
  display: grid;
  gap: 9px;
}

.tweak-control-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tweak-control-row .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.tweak-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tweak-range-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tweak-range-grid input {
  width: 100%;
  accent-color: var(--primary);
}

.tweak-select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tweak-select-label select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(195, 199, 205, 0.5);
  border-radius: 12px;
  font: 800 14px/1 var(--font-ui);
}

.tweak-preview-target {
  outline: 2px dashed rgba(72, 95, 119, 0.72);
  outline-offset: 4px;
  touch-action: none;
  will-change: transform;
}

.tweak-toolbar.collapsed {
  max-height: none;
}

.tweak-toolbar.collapsed > :not(.tweak-toolbar-head):not(.tweak-selected):not(.tweak-count) {
  display: none;
}

.tweak-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

@media (min-width: 920px) {
  .tweak-toolbar {
    inset: 24px 24px auto auto;
    width: 420px;
    max-height: calc(100dvh - 48px);
  }
}
