:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fbfbfd;
  --surface-2: #f5f5f7;
  --surface-3: #ececee;
  --border: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-strong: #0077ed;
  --accent-wash: #e8f2fd;
  --danger: #d70015;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", system-ui, Arial, sans-serif;
  --radius: 18px;
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --line: var(--border);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1d1d1f;
    --surface-2: #161617;
    --surface-3: #232325;
    --border: #38383c;
    --text: #f5f5f7;
    --muted: #86868b;
    --accent: #2997ff;
    --accent-strong: #0a84ff;
    --accent-wash: #0f2942;
    --danger: #ff453a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; font-family: var(--sans); }
a { color: var(--accent); }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar, .section-title, .user-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.push-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(142, 142, 147, 0.10);
  border: 1.5px solid rgba(142, 142, 147, 0.38);
  color: #8e8e93;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.push-help-link {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(142, 142, 147, 0.10);
  border: 1.5px solid rgba(142, 142, 147, 0.38);
  color: #8e8e93;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.push-help-link:hover {
  background: rgba(142, 142, 147, 0.18);
  color: var(--text);
}

.push-help-link:active {
  transform: scale(0.94);
}

.push-toggle-btn svg {
  width: 19px;
  height: 19px;
}

.push-toggle-btn:hover {
  background: rgba(142, 142, 147, 0.18);
}

.push-toggle-btn:active {
  transform: scale(0.94);
}

.push-toggle-btn.active {
  color: #fff;
  background: #0a84ff;
  border-color: #64b5ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28), 0 3px 10px rgba(10, 132, 255, 0.32);
}

.push-toggle-btn.is-playing {
  color: #fff;
  background: #ff375f;
  border-color: #ff7a93;
  box-shadow: 0 0 0 3px rgba(255, 55, 95, 0.28), 0 3px 10px rgba(255, 55, 95, 0.32);
}

.push-status-toast {
  position: fixed;
  z-index: 1200;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  padding: 11px 16px;
  border: 1px solid rgba(100, 181, 255, 0.45);
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.push-status-toast.error { border-color: rgba(255, 69, 58, 0.65); }

@media (prefers-color-scheme: dark) {
  .push-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }
  .push-toggle-btn.active {
    background: #0a84ff;
  }
  .push-help-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f5f5f7;
  }
}

h1, h2, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(32px, 8vw, 56px); line-height: 1.02; }
h2 { font-size: 22px; }

.brand-title {
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.home-link:hover {
  text-decoration: underline;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.compact { padding: 18px 20px; }

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 32px;
  margin-top: 28px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 0%, var(--accent-wash), transparent 38%),
    var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.07);
}

.hero-copy {
  max-width: 760px;
}

.hero-copy h1 {
  margin-top: 8px;
  font-size: clamp(30px, 6vw, 62px);
  line-height: 1.04;
  max-width: 860px;
}

.hero-text {
  max-width: 680px;
  margin-top: 16px;
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.55;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 10px;
  margin-top: 24px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  text-decoration: none;
  white-space: nowrap;
}

.secondary {
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-spinner-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.feature-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-top: 18px;
}

.feature-panel-reverse .feature-copy { order: 2; }
.feature-panel-reverse .feature-visual { order: 1; }

.feature-copy h3 {
  margin-top: 8px;
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.25;
}

.feature-copy p {
  margin-top: 12px;
  line-height: 1.55;
}

.feature-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.founder-panel {
  margin-top: 18px;
}

.founder-quote {
  max-width: 780px;
  margin-top: 14px;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
}

.founder-signature {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.disclaimer-line {
  margin-top: 18px;
  padding: 0 4px;
  font-size: 12.5px;
  line-height: 1.5;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.landing-card {
  min-height: 260px;
}

.clean-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.45;
}

.compact-list {
  margin-top: 0;
}

.price-panel,
.warning-panel,
.faq-panel {
  margin-top: 18px;
}

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
  margin-top: 10px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.admin-totals {
  margin-top: 28px;
}

.admin-table-panel {
  margin-top: 18px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.price-value {
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

.price-value-sub {
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.promo-badge {
  display: inline-block;
  margin: 10px 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.microcopy {
  margin-top: 10px;
  font-size: 12px;
}

.bridge-title {
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.25;
  margin: 8px 0 14px;
}

.warning-panel {
  border-color: var(--border);
}

.faq-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 13px 14px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  line-height: 1.35;
}

details p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 20px;
}

.main-column, .side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.about {
  width: min(720px, 100%);
  margin: 32px auto 0;
}

.about h2 {
  margin-top: 6px;
}

.about > .muted {
  margin-top: 10px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.about-grid a {
  color: var(--accent);
  text-decoration: none;
}

.about-grid a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero-panel {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .hero-visual {
    order: -1;
    max-width: 380px;
    margin: 0 auto;
  }

  .feature-panel {
    grid-template-columns: 1fr;
  }

  .feature-panel-reverse .feature-copy,
  .feature-panel-reverse .feature-visual {
    order: initial;
  }

  .feature-visual {
    max-width: 380px;
    margin: 0 auto;
  }
}

.month-goal-card {
  background: var(--accent-wash);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0.5rem 0 1.25rem;
}

.month-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.month-goal-value-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.month-goal-value-btn:active {
  border-color: var(--accent);
  color: var(--accent);
}

.month-goal-edit-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
  flex-shrink: 0;
}

.month-goal-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  margin: 10px 0 8px;
  overflow: hidden;
}

.month-goal-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.month-goal-compare {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.month-goal-edit-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.65rem;
}

.month-goal-edit-row input {
  width: 90px;
  font-size: 16px;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.month-goal-edit-row button {
  padding: 0.45rem 0.9rem;
}

.toggles-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.toolbar-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
}

.toolbar-ghost-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.toolbar-ghost-btn:active {
  color: var(--accent);
}

.ai-recalc-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.ai-recalc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 980px;
  border: none;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
}

.ai-recalc-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-recalc-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ai-recalc-btn:active {
  transform: scale(0.97);
}

@media (max-width: 380px) {
  .ai-recalc-btn span {
    font-size: 0.88rem;
  }
}

#authView {
  width: min(430px, 100%);
  margin: 44px auto 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-alt-methods {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.auth-alt-method {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
}

.oauth-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 980px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

#passkeyLoginBtn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

#passkeyLoginBtn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.oauth-yandex {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.oauth-yandex:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.oauth-google {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.oauth-google:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.oauth-note {
  margin-top: 12px;
  font-size: 12px;
}

.tab, .icon-button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  min-height: 42px;
  border-radius: 980px;
  cursor: pointer;
}

.tab.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

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

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent);
}

.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.two input {
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
  /* Must stay >= 16px on iPhone: labels are 13px and inputs use `font:
     inherit` (see line ~50), so without this every labeled field inherits
     13px and iOS Safari zooms the whole page on focus — it never zooms back
     out cleanly after blur/save, leaving the layout stuck zoomed in. See
     skill prevent-ios-input-zoom. Do not shrink this to compact the UI —
     use padding/height instead. */
  font-size: 16px;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* 2026-07-18: replaced the native type="date" as the VISIBLE control —
   iOS Safari renders its value text with its own internal (often
   centered/right-leaning) layout that text-align/CSS can't override, so it
   never matched the other form fields (see project journal t-0006). The
   native input still exists (see .date-native-hidden below) purely as the
   real form value store — FormData/submit/change-listeners all still work
   against it unchanged, display:none inputs still participate in forms. */
input[type="date"] {
  cursor: pointer;
}

/* 2026-09-06 (AgentChat reminders, ported to PULSE 2026-09-07): a *visible*
   type="date"/type="time" input (unlike the hidden one above, used only as
   a form value store behind a custom button) needs appearance reset before
   iOS Safari will honor background/border/border-radius/padding — without
   this it renders as bare underlined text with no box, mismatched against
   sibling text inputs in the same form. Also: never place date+time
   side-by-side in a narrow modal — the native control's intrinsic width
   ignores width:100%/min-width:0 and overflows; always stack them as full
   rows (see feedback_ios_datetime_row_overflow memory). */
input[type="date"]:not(.date-native-hidden),
input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.date-native-hidden {
  display: none;
}

.date-field {
  position: relative;
}

.date-display-btn {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 13px;
  text-align: left;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

.date-display-btn:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.date-calendar {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 12px;
}

.date-calendar[hidden] {
  display: none;
}

.date-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.date-calendar-head span {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  text-transform: capitalize;
}

.date-calendar-nav {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
}

.date-calendar-nav:hover {
  background: var(--surface-2);
}

.date-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.date-calendar-weekday {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}

.date-calendar-day {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.date-calendar-day:hover {
  background: var(--surface-2);
}

.date-calendar-day.is-muted {
  color: var(--muted);
  opacity: 0.5;
}

.date-calendar-day.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.date-calendar-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.sleep-auto-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px 13px;
  display: grid;
  gap: 6px;
}

.sleep-auto-title {
  color: var(--muted);
  font-size: 13px;
}

.sleep-auto-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--text);
  font-size: 14px;
}

.sleep-auto-values strong {
  font-weight: 700;
}

.sleep-auto-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sleep-auto-block.has-data .sleep-auto-hint {
  display: none;
}

.time-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-select select {
  width: auto;
  flex: 1;
}

.primary {
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  min-height: 46px;
  padding: 0 16px;
  cursor: pointer;
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.inline-button {
  margin-top: 14px;
}

.terms-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.terms-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.terms-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

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

.toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px 12px;
  color: var(--text);
}

.toggle-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.toggle-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toggle-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.toggle-add-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.toggle-add-btn {
  margin-top: 0;
}

.toggle-add-btn--positive {
  border-color: rgba(52, 199, 89, 0.45);
  color: #248a3d;
}

.toggle-add-btn--negative {
  border-color: rgba(255, 69, 58, 0.45);
  color: #d70015;
}

.toggle-create-kind-hint {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #248a3d;
}

.toggle-create-kind-hint--negative {
  color: #d70015;
}

@media (prefers-color-scheme: dark) {
  .toggle-add-btn--positive {
    border-color: rgba(48, 209, 88, 0.5);
    color: #30d158;
  }

  .toggle-add-btn--negative {
    border-color: rgba(255, 69, 58, 0.5);
    color: #ff453a;
  }

  .toggle-create-kind-hint {
    color: #30d158;
  }

  .toggle-create-kind-hint--negative {
    color: #ff453a;
  }
}

.toggle-main input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.switch {
  width: 44px;
  height: 26px;
  border-radius: 980px;
  background: var(--border);
  padding: 3px;
  flex: 0 0 auto;
}

.switch::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.16s ease, background 0.16s ease;
}

.toggle:has(.toggle-main input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.toggle:has(.toggle-main input:checked) .switch::before {
  transform: translateX(18px);
  background: var(--accent);
}

.toggle.toggle--negative {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface-2));
  color: var(--muted);
}

.toggle.toggle--negative:has(.toggle-main input:checked) {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
}

.toggle.toggle--negative:has(.toggle-main input:checked) .switch::before {
  background: var(--danger);
}

/* "Cause" negatives (ate/drank/did something) — distinct from "consequence"
   negatives (symptoms) below, per Oleg's 3-tier order: positive, cause,
   consequence. Amber/orange, not red — red is reserved for the actual
   bodily symptom the cause led to. */
.toggle.toggle--negative-cause {
  background: color-mix(in srgb, #ff9500 8%, var(--surface-2));
  color: var(--muted);
}

.toggle.toggle--negative-cause:has(.toggle-main input:checked) {
  border-color: #ff9500;
  background: color-mix(in srgb, #ff9500 18%, var(--surface));
}

.toggle.toggle--negative-cause:has(.toggle-main input:checked) .switch::before {
  background: #ff9500;
}

.toggle-subgroup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.toggle-subgroup-btn {
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.toggle-subgroup-btn.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  .toggle.toggle--negative-cause {
    background: color-mix(in srgb, #ff9f0a 10%, var(--surface-2));
  }

  .toggle.toggle--negative-cause:has(.toggle-main input:checked) {
    border-color: #ff9f0a;
    background: color-mix(in srgb, #ff9f0a 20%, var(--surface));
  }

  .toggle.toggle--negative-cause:has(.toggle-main input:checked) .switch::before {
    background: #ff9f0a;
  }
}

.ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--surface-2) 0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  position: relative;
  flex: 0 0 auto;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--panel);
}

.ring span {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 600;
}

.account-card {
  display: grid;
  gap: 14px;
}

.account-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.account-identity > div {
  min-width: 0;
}

.account-edit-btn {
  width: 100%;
  justify-content: center;
}

.account-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.account-email {
  margin: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.avatar-circle:hover {
  border-color: var(--accent);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#avatarInitial {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.badge {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 980px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.muted, .message {
  color: var(--muted);
  line-height: 1.45;
}

.message.error { color: var(--danger); }

.history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.checkin-history-block {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s;
}

.history-item:hover,
.history-item:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.history-score {
  color: var(--accent);
  font-size: 24px;
  font-weight: 600;
}

.history-more-wrap {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.history-more-wrap > .secondary {
  width: 100%;
}
.history-calendar {
  position: relative;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 12px;
}
.history-calendar.hidden,
.history-calendar[hidden] {
  display: none !important;
}
.history-calendar .date-calendar-day.has-checkin {
  background: var(--accent-wash, rgba(72, 196, 120, 0.16));
  font-weight: 700;
  color: var(--accent);
}
.history-calendar-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
}

.slim { align-items: end; }
.hidden { display: none !important; }

.document {
  width: min(840px, 100%);
  margin: 36px auto 0;
}

.document-date {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}

.document section {
  display: grid;
  gap: 10px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.document section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.document h2 {
  font-size: 20px;
}

.document p,
.document li {
  color: var(--text);
  line-height: 1.65;
}

.document ul,
.document ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.site-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-top: 36px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.site-footer a,
.site-footer a:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.profile-docs-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.profile-docs-links a,
.profile-docs-links a:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.profile-docs-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
/* Footer lives inside #landingView — when landing is hidden, legal links
   cannot appear under dating/chats/dynamics. */
body.is-authed #landingFooter { display: none !important; }

.seo-resources,
.seo-related {
  margin-top: 18px;
}

.seo-resources h2,
.seo-related h2 {
  margin-top: 8px;
}

.seo-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.seo-resource-grid a {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: inherit;
  text-decoration: none;
}

.seo-resource-grid a:hover {
  border-color: var(--accent);
}

.seo-resource-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.seo-shell {
  max-width: 920px;
  padding-bottom: 56px;
}

.seo-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seo-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.seo-brand {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
}

.seo-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 12px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
}

.seo-breadcrumbs a { color: var(--accent); }
.seo-breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seo-article h1 {
  max-width: 800px;
  margin-top: 10px;
}

.seo-article h2 {
  margin: 30px 0 10px;
}

.seo-article p,
.seo-article li {
  font-size: 17px;
  line-height: 1.7;
}

.seo-lead {
  margin-top: 20px;
  color: var(--muted);
  font-size: 20px !important;
}

.seo-note,
.seo-cta {
  margin-top: 28px;
  padding: 20px;
  border-radius: 18px;
  background: var(--accent-wash);
  line-height: 1.6;
}

.seo-cta h2 { margin-top: 0; }
.seo-cta .link-button { margin-top: 14px; }

@media (max-width: 860px) {
  .app-grid { grid-template-columns: minmax(0, 1fr); }
  .toggle-grid, .two { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
  .section-title { align-items: flex-start; }
  .landing-grid,
  .price-row {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .hero-copy h1 {
    font-size: 30px;
    line-height: 1.08;
  }
  .hero-text {
    font-size: 16px;
  }
  .hero-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hero-actions .link-button {
    width: 100%;
  }
  .landing-grid {
    gap: 14px;
    margin-top: 28px;
  }
  .panel {
    padding: 24px 30px;
  }
  .landing-card {
    min-height: auto;
  }
  .clean-list {
    font-size: 16px;
    gap: 7px;
  }
  .price-panel,
  .warning-panel,
  .faq-panel {
    margin-top: 14px;
  }
  .price-value {
    font-size: 46px;
  }
  #authView {
    margin-top: 42px;
  }
  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 26px;
  }
  .seo-resource-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .shell {
    width: min(100% - 28px, 1180px);
    padding-top: 22px;
  }
  .topbar {
    align-items: flex-start;
  }
  h1 {
    font-size: 38px;
  }
  .hero-copy h1 {
    font-size: 28px;
  }
  .panel {
    padding: 22px 24px;
  }
  .clean-list {
    padding-left: 20px;
  }
  .password-toggle {
    font-size: 14px;
  }
  .site-footer {
    gap: 8px;
  }
}

.passkey-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.passkey-modal {
  max-width: 380px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  text-align: left;
  margin: auto;
}

.passkey-modal h3 {
  margin-top: 0;
}

.formula-modal {
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.reminders-panel {
  display: grid;
  gap: 20px;
}

.reminders-section {
  display: grid;
  gap: 10px;
}

.reminders-create-card {
  display: grid;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.reminders-create-card #reminderCreateBtn {
  width: 100%;
}

.reminders-create-card input,
.reminders-create-card textarea,
.reminders-create-card select,
.reminders-create-card .reminder-quick-chip {
  background: var(--surface);
}

.reminder-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reminder-quick-chip {
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
}

.reminder-quick-chip:active {
  border-color: var(--accent);
  color: var(--accent);
}

.reminders-list {
  display: grid;
  gap: 8px;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.reminder-item.is-paused {
  opacity: 0.55;
}

.reminder-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.reminder-item-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-item-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.reminder-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.reminder-item-toggle {
  width: 44px;
  height: 26px;
  border-radius: 980px;
  border: none;
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.reminder-item-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  transition: left 0.15s ease;
}

.reminder-item-toggle.is-on {
  background: var(--accent);
}

.reminder-item-toggle.is-on::after {
  left: 21px;
}

.reminder-item-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.reminders-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
}

.formula-weights-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.formula-weight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
}

.formula-weight-row--penalty {
  background: var(--surface-3);
  color: var(--muted);
  border-color: var(--line);
}

.formula-weight-row strong {
  font-variant-numeric: tabular-nums;
}

.formula-weight-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-rename-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 2px 4px;
  line-height: 1;
}

.formula-rename-btn:hover {
  color: var(--text);
}

.formula-up { color: #1c8a4a; }
.formula-down { color: var(--danger); }

.toggle-help-list {
  display: grid;
  gap: 16px;
  margin-top: 10px;
}

.toggle-help-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  margin-bottom: 6px;
}

.toggle-help-item span {
  color: var(--muted);
}

.energy-breakdown-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.energy-breakdown-row {
  display: grid;
  gap: 6px;
}

.energy-breakdown-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.energy-breakdown-label {
  font-weight: 600;
}

.energy-breakdown-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.energy-breakdown-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.energy-breakdown-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .formula-up { color: #34c759; }
  .formula-weight-row--penalty {
    background: var(--surface-3);
    color: var(--muted);
    border-color: var(--border);
  }
}

.share-modal {
  max-width: 340px;
  width: 100%;
  text-align: left;
}

.share-preview-frame {
  width: auto;
  height: 34vh;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  margin: 8px auto;
}

.share-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.share-identity-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 2px 2px 0;
}

.share-identity-toggle input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--accent);
}

.share-primary-btn {
  width: 100%;
  margin-top: 8px;
}

.share-referral-block {
  margin: 6px 2px 0;
}

.share-referral-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 4px;
}

.share-referral-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-referral-row input {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  box-sizing: border-box;
}

.share-referral-row .share-referral-copy-btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.share-modal-secondary-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 8px;
}

.share-text-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 4px;
}

.share-text-btn:hover {
  color: var(--accent);
}

/* App dock: one navigation model for mobile PWA and desktop web.
   Active tab is mirrored on #appView[data-active-section] so column
   visibility does not depend only on :has() (more reliable in iOS PWA). */
[data-app-section]:not(.app-section-active) { display: none !important; }
#accountSection:not(.app-section-active) { display: none !important; }

.app-grid[data-active-section="today"],
.app-grid[data-active-section="timer"],
.app-grid[data-active-section="dating"],
.app-grid[data-active-section="chats"],
.app-grid[data-active-section="profile"] { grid-template-columns: minmax(0, 1fr); }

.app-grid[data-active-section="today"] .side-column,
.app-grid[data-active-section="timer"] .side-column { display: none !important; }
.app-grid[data-active-section="dating"] .main-column,
.app-grid[data-active-section="chats"] .main-column,
.app-grid[data-active-section="profile"] .main-column { display: none !important; }

.app-grid[data-active-section="dating"] .side-column,
.app-grid[data-active-section="chats"] .side-column,
.app-grid[data-active-section="profile"] .side-column {
  max-width: 760px; width: 100%; margin: 0 auto;
}

/* Insta-style floating glass capsule (Mentor/Snipe canon, 5 tabs, dark PULSE).
   #appDock is deliberately portalled to <body> in index.html: never move it
   back under .shell/app content, otherwise iOS can make fixed viewport UI
   scroll with a composited application wrapper. */
.app-dock {
  --insta-tabs-count: 6;
  position: fixed;
  z-index: 90;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: none;
  display: grid;
  grid-template-columns: repeat(var(--insta-tabs-count), 1fr);
  align-items: center;
  gap: 0;
  width: auto;
  height: 56px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: rgba(18, 18, 20, 0.68);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.app-dock.hidden { display: none; }

.app-dock-item {
  min-width: 0;
  min-height: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 23px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-dock-item.active,
.app-dock-item[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.app-dock-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-dock-icon-wrap { position: relative; display: grid; place-items: center; }
.app-dock-notice {
  position: absolute;
  top: -5px;
  right: -7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff453a;
  border: 2px solid var(--surface, #1d1d1f);
  box-sizing: content-box;
}
.checkin-attention-hint { margin: 6px 0 0; color: #ff453a; font-size: 13px; font-weight: 700; }

.app-dock-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
}

.app-dock-avatar {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 800;
  color: inherit;
}

.app-dock-avatar img { width: 100%; height: 100%; object-fit: cover; }

.app-dock-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff453a;
  border: 1.5px solid var(--bg, #0b0b0c);
}

.checkin-paywall {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 149, 0, 0.4);
  border-radius: var(--radius, 14px);
  background: rgba(255, 149, 0, 0.08);
}

.checkin-paywall-text {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

body.is-authed .shell {
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}
.app-coming-soon { min-height: 210px; }
.streak-progress { height: 8px; margin: 18px 0; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.streak-progress span { display: block; width: var(--progress); height: 100%; background: var(--accent); }
.dating-missing-list { margin: 0.75rem 0 1rem; }
.dating-actions-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }
.dating-feed-state {
  display: grid;
  gap: 0.85rem;
}
.dating-disable-btn {
  width: 100%;
  justify-content: center;
}
.dating-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
}
.dating-card-photo { aspect-ratio: 1 / 1.05; background: var(--surface-3); }
.dating-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dating-card-body { padding: 1rem 1rem 0.35rem; }
.dating-card-body h3 { margin: 0 0 0.25rem; font-size: 1.35rem; }
.dating-energy { margin: 0.55rem 0 0.35rem; font-weight: 700; color: var(--accent); }
.dating-habits { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.7rem; }
.dating-habit-chip {
  font-size: 0.75rem; font-weight: 650; padding: 0.28rem 0.55rem;
  border-radius: 999px; background: rgba(255,255,255,.08); color: #e8eee9;
}
.dating-bio { white-space: pre-wrap; margin: 0 0 0.75rem; }
.dating-card-actions {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
}
.dating-card-actions .dating-report { min-width: 44px; padding-inline: 0.7rem; }
.dating-match-toast {
  margin-top: 0.85rem; padding: 0.75rem 0.9rem; border-radius: 12px;
  background: rgba(72, 196, 120, 0.16); border: 1px solid rgba(72, 196, 120, 0.35);
  font-weight: 650;
}
.dating-matches-list { display: grid; gap: 0.7rem; margin-top: 0.85rem; }
.dating-match-item {
  display: grid; grid-template-columns: 56px 1fr; gap: 0.75rem; align-items: center;
  padding: 0.65rem; border-radius: 14px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.dating-match-item img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface-3);
}
.dating-match-item h3 { margin: 0 0 0.15rem; font-size: 1rem; }
.pwa-ptr {
  position: fixed; top: 10px; left: 50%; z-index: 2147483647;
  width: 36px; height: 36px; border-radius: 50%; opacity: 0;
  transform: translate(-50%,-50px); display: grid; place-items: center;
  background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.2); pointer-events: none;
}
.pwa-ptr span { width: 16px; height: 16px; border: 2px solid #d1d5db; border-top-color: #1683ef; border-radius: 50%; }
.pwa-ptr.loading span { animation: ptr-spin .6s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

@media (max-width: 350px) {
  .app-dock { left: 8px; right: 8px; }
}

@media (min-width: 761px) {
  .app-dock {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(620px, 94vw);
  }
  .app-dock-item.active .app-dock-label {
    display: inline;
    margin-left: 6px;
  }
}

/* Time tracking timers — match provided card design */
.timer-section {
  display: grid;
  gap: 18px;
  padding: 8px 0 12px;
}

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

/* On the timer screen everything above the first compact timer ("Сон" by
   default) remains available while the list scrolls underneath it. */
.timer-sticky-active .topbar,
.timer-sticky-active .timer-card--featured,
.timer-sticky-active .timer-cycle-banner.is-visible,
.timer-sticky-active .timer-search {
  position: sticky;
  isolation: isolate;
}

/* See the "focus"/"blur" handlers in initTimerUi() (app.js): while the
   keyboard is open for the search field, sticky positioning is suspended so
   a matched result can never end up hidden behind the search bar. */
body.timer-search-focused.timer-sticky-active .topbar,
body.timer-search-focused.timer-sticky-active .timer-card--featured,
body.timer-search-focused.timer-sticky-active .timer-cycle-banner.is-visible,
body.timer-search-focused.timer-sticky-active .timer-search {
  position: static;
  box-shadow: none;
}

body.timer-search-focused.timer-sticky-active .timer-card--featured::before,
body.timer-search-focused.timer-sticky-active .timer-cycle-banner.is-visible::before,
body.timer-search-focused.timer-sticky-active .timer-search::before {
  display: none;
}

.timer-sticky-active .timer-card--featured::before,
.timer-sticky-active .timer-cycle-banner.is-visible::before,
.timer-sticky-active .timer-search::before {
  content: "";
  position: absolute;
  inset: -18px 0;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    var(--bg) 0 18px,
    transparent 18px calc(100% - 18px),
    var(--bg) calc(100% - 18px)
  );
  pointer-events: none;
}

.timer-sticky-active .timer-card--featured > *,
.timer-sticky-active .timer-cycle-banner.is-visible > *,
.timer-sticky-active .timer-search > * {
  position: relative;
  z-index: 1;
}

/* The search field's own trailing mask fades into the scrolling list
   instead of ending on a hard solid-color edge, so it reads as one
   continuous surface while scrolling. Capped at the .timer-stack grid gap
   (14px) — anything larger paints over the real next card (not just the
   empty gap) since this box sits at z-index 41, which fully hid a filtered
   search result that landed directly underneath it with only one match. */
.timer-sticky-active .timer-search::before {
  inset: -18px 0 -14px;
  background: linear-gradient(
    to bottom,
    var(--bg) 0 18px,
    transparent 18px calc(100% - 14px),
    var(--bg) calc(100% - 14px)
  );
}

.timer-sticky-active .topbar {
  top: 0;
  z-index: 45;
  padding: 8px 0;
  background: var(--bg);
  box-shadow: 0 14px 0 var(--bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.timer-sticky-active .timer-card--featured {
  top: calc(var(--timer-sticky-topbar, 86px) + 8px);
  z-index: 43;
  box-shadow: 0 -14px 0 var(--bg), 0 18px 0 var(--bg), 0 10px 24px rgba(0, 0, 0, 0.06);
}

.timer-sticky-active .timer-cycle-banner.is-visible {
  top: calc(var(--timer-sticky-topbar, 86px) + var(--timer-sticky-featured, 76px) + 16px);
  z-index: 42;
  box-shadow: 0 -16px 0 var(--bg), 0 16px 0 var(--bg);
}

.timer-sticky-active .timer-search {
  top: calc(var(--timer-sticky-topbar, 86px) + var(--timer-sticky-featured, 76px) + var(--timer-sticky-banner, 0px) + 24px);
  z-index: 41;
}

.timer-sticky-condensed .topbar {
  align-items: center;
  padding: 5px 0;
}

.timer-sticky-condensed .topbar .home-link { display: none; }
.timer-sticky-condensed .topbar .brand-title { font-size: 25px; }
.timer-sticky-condensed .timer-card--featured {
  min-height: 62px;
  padding: 8px 12px;
}
.timer-sticky-condensed .timer-card--featured .timer-target,
.timer-sticky-condensed .timer-card--featured .timer-notify-count { display: none; }
.timer-sticky-condensed .timer-card--featured .timer-copy { gap: 1px; }
.timer-sticky-condensed .timer-card--featured .timer-display { font-size: 27px; }
.timer-sticky-condensed .timer-card--featured .timer-move-btn[data-timer-move="down"] { display: none; }

@supports not (background: color-mix(in srgb, white 50%, transparent)) {
  .timer-sticky-active .topbar { background: var(--bg); }
}

@media (prefers-color-scheme: dark) {
  .timer-sticky-active .timer-card--featured {
    box-shadow: 0 -14px 0 var(--bg), 0 18px 0 var(--bg), 0 12px 30px rgba(0, 0, 0, 0.45);
  }
}

.timer-search {
  order: -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
}

.timer-search svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.timer-search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.timer-search input::-webkit-search-cancel-button { display: none; }

.timer-search button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(60, 60, 67, 0.13);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.timer-search-empty {
  order: -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .timer-search {
    border-color: rgba(255, 255, 255, 0.08);
  }
  .timer-search button {
    background: rgba(255, 255, 255, 0.12);
  }
}

.timer-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid rgba(60, 60, 67, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.timer-card[hidden] { display: none !important; }

.timer-card--featured {
  order: -3;
  gap: 14px;
  min-height: 76px;
  padding: 13px 18px 13px 13px;
}

.timer-card--compact {
  gap: 10px;
  min-height: 50px;
  padding: 7px 12px;
  border-radius: 16px;
}

@media (prefers-color-scheme: dark) {
  .timer-card {
    background: #0b0b0c;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  }
}

.timer-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
  justify-items: start;
}

.timer-label {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.timer-label--compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

.timer-label--compact span[data-timer-label-text] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

.timer-rename-btn {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: #3a3a3c;
}

.timer-move-btn--sm.timer-rename-btn {
  font-size: 12px;
}

@media (prefers-color-scheme: dark) {
  .timer-rename-btn {
    color: rgba(245, 245, 247, 0.92);
  }
}

.timer-label[data-timer-settings] { cursor: pointer; }

.timer-settings-modal {
  width: min(92vw, 460px);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  display: grid;
  gap: 16px;
}

.timer-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.timer-settings-heading h3,
.timer-settings-heading .eyebrow { margin: 0; }

.timer-settings-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.timer-settings-switch-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text) !important;
}

.timer-settings-switch-row span { display: grid; gap: 3px; }
.timer-settings-switch-row small { color: var(--muted); font-weight: 500; }

.timer-settings-checkbox {
  appearance: none;
  width: 50px;
  height: 30px;
  margin: 0;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition: background .2s ease;
}

.timer-settings-checkbox::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .22);
  transition: transform .2s ease;
}

.timer-settings-checkbox:checked { background: #34c759; }
.timer-settings-checkbox:checked::after { transform: translateX(20px); }

.timer-settings-notification-fields { display: grid; gap: 14px; }
.timer-settings-notification-fields.is-disabled { display: none; }

.timer-settings-notification-fields fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.timer-settings-notification-fields legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.timer-settings-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-settings-duration label { position: relative; }
.timer-settings-duration select {
  width: 100%;
  padding-right: 66px;
  font-variant-numeric: tabular-nums;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}
.timer-settings-duration span {
  position: absolute;
  right: 13px;
  bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.timer-settings-preview {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border-radius: 16px;
  background: var(--surface-2);
}

.timer-settings-preview-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #111113;
  color: #69cb69;
  font-size: 14px;
  font-weight: 800;
}

.timer-settings-preview strong { color: var(--text); font-size: 13px; }
.timer-settings-preview p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.timer-settings-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

@media (prefers-color-scheme: dark) {
  .timer-settings-checkbox { background: #3a3a3c; }
  .timer-settings-checkbox:checked { background: #34c759; }
  .timer-settings-preview-icon { background: #000; }
}

.timer-display {
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(20px, 5.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-card.is-running .timer-display {
  color: #3fae46;
}

.timer-display--compact {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.timer-card--compact.is-running .timer-display--compact {
  color: #3fae46;
}

.timer-target {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.timer-notify-count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
}

.timer-cycle-banner {
  display: none;
  order: -2;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #eaf8ea;
  background: color-mix(in srgb, var(--bg) 86%, #69cb69);
  border: 1px solid rgba(105, 203, 105, 0.35);
  color: var(--text);
}

.timer-sticky-condensed .timer-cycle-banner.is-visible {
  gap: 8px;
  padding: 11px 14px;
}

.timer-sticky-condensed .timer-cycle-banner p {
  font-size: 13px;
  line-height: 1.3;
}

.timer-sticky-condensed .timer-cycle-banner button {
  padding: 9px 12px;
}

@media (prefers-color-scheme: dark) {
  .timer-cycle-banner {
    background: #102a12;
    background: color-mix(in srgb, var(--bg) 82%, #69cb69);
  }
}

.timer-cycle-banner.is-visible {
  display: flex;
}

.timer-cycle-banner p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.timer-cycle-banner button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #69cb69;
  color: #0b0b0c;
  font-weight: 700;
  cursor: pointer;
}

.timer-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 30% 22%, #92e295 0%, #55c15b 55%, #359140 100%);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 6px 14px rgba(63, 174, 70, 0.32);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timer-toggle:active {
  transform: scale(0.94);
}

.timer-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.timer-toggle--sm {
  width: 26px;
  height: 26px;
}

.timer-toggle--sm svg {
  width: 11px;
  height: 11px;
}

.timer-toggle .timer-icon-pause { display: none; }
.timer-card.is-running .timer-toggle .timer-icon-play { display: none; }
.timer-card.is-running .timer-toggle .timer-icon-pause { display: block; }

.timer-message { min-height: 1.2em; }

.timer-history-wrap {
  padding: 4px 4px 0;
}

.timer-history-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.timer-history-heading .eyebrow { margin:0; }
.timer-history-segments { display:grid; gap:12px; max-height:52vh; overflow:auto; margin:14px 0; }
.timer-history-segment { gap:10px; }
.timer-history-segment-head { display:flex; align-items:center; justify-content:space-between; }
.timer-history-segment-head button { border:0; background:transparent; color:var(--muted); font-size:24px; cursor:pointer; }
.timer-history-last { margin:0; padding:12px; border-radius:12px; background:var(--surface-2, rgba(128,128,128,.12)); }
.timer-history-last small { color:var(--muted); }
.timer-history-remainder { font-weight:700; color:var(--accent); }
.timer-history-remainder.is-error { color:var(--danger, #ff453a); }
#timerHistoryManualFields, #timerHistoryManualFields label { min-width:0; }
#timerHistoryManualFields input, #timerHistoryManualFields select { width:100%; min-width:0; max-width:100%; box-sizing:border-box; }

@media (max-width: 560px) {
  .timer-history-heading { align-items:flex-start; flex-direction:column; }
  .timer-history-heading .toolbar-ghost-btn { width:100%; justify-content:center; }
}

.timer-history {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.timer-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.timer-history-item strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.timer-history-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-history-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.timer-add-btn {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed rgba(60, 60, 67, 0.28);
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.timer-add-btn span:first-child {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(105, 203, 105, 0.18);
  color: #248a3d;
  font-size: 22px;
  line-height: 1;
}

.ownership-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ownership-mode-btn {
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.15;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.ownership-mode-btn:active { transform: scale(.98); }

.ownership-mode-btn.active {
  color: #0b2710;
  background: linear-gradient(145deg, #8ae28d 0%, #62ce68 55%, #50b958 100%);
  box-shadow: 0 6px 16px rgba(63, 174, 70, .22), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.ownership-mode-btn:disabled { cursor: default; }

@media (prefers-color-scheme: dark) {
  .ownership-mode {
    border-color: rgba(255, 255, 255, 0.08);
    background: #111113;
  }
  .ownership-mode-btn.active { color: #071b0a; }
}

@media (prefers-color-scheme: dark) {
  .timer-add-btn {
    border-color: rgba(255, 255, 255, 0.18);
  }
  .timer-add-btn span:first-child {
    color: #69cb69;
  }
}

.timer-create-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid rgba(60, 60, 67, 0.08);
  min-width: 0;
}

.timer-create-form.hidden { display: none; }

.timer-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}

.timer-create-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(60, 60, 67, 0.18);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* keep >= 16px on iPhone — see prevent-ios-input-zoom */
}

.timer-create-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.timer-create-actions .primary,
.timer-create-actions .secondary {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-card {
  position: relative;
  will-change: transform;
}

.timer-move {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  align-content: center;
}

.timer-move--compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.timer-move-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 247, 0.88));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 6px 14px rgba(0, 0, 0, 0.08);
  color: #3a3a3c;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.timer-move-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.timer-move-btn--sm {
  width: 24px;
  height: 24px;
}

.timer-move-btn--sm svg {
  width: 11px;
  height: 11px;
}

.timer-move-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.timer-move-btn:disabled {
  opacity: 0.28;
  cursor: default;
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .timer-move-btn {
    border-color: rgba(255, 255, 255, 0.1);
    background:
      linear-gradient(180deg, rgba(58, 58, 60, 0.95), rgba(28, 28, 30, 0.92));
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 8px 18px rgba(0, 0, 0, 0.35);
    color: rgba(245, 245, 247, 0.92);
  }
}

.timer-delete-btn {
  margin-top: 2px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 245, 247, 0.82));
}

.timer-delete-btn:hover {
  color: var(--danger, #ff453a);
}

@media (prefers-color-scheme: dark) {
  .timer-delete-btn {
    background:
      linear-gradient(180deg, rgba(58, 58, 60, 0.9), rgba(28, 28, 30, 0.88));
    color: rgba(245, 245, 247, 0.72);
  }
  .timer-delete-btn:hover {
    color: #ff453a;
  }
}

.notification-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .85rem;
}

.notification-setting-row .muted {
  margin: .35rem 0 0;
  font-size: .84rem;
}

.notification-setting-toggle {
  flex: 0 0 auto;
  border: 1px solid rgba(35, 194, 107, .35);
  border-radius: 999px;
  padding: .55rem .8rem;
  background: rgba(35, 194, 107, .12);
  color: var(--accent, #23c26b);
  font-weight: 700;
}

.notification-setting-toggle[aria-checked="false"] {
  border-color: var(--border, rgba(128, 128, 128, .25));
  background: var(--surface-soft, rgba(128, 128, 128, .08));
  color: var(--muted, #8d9991);
}

.channel-post-fields { display: grid; gap: .85rem; margin-top: 1rem; min-width: 0; }
.channel-post-fields label { display: grid; gap: .4rem; min-width: 0; color: var(--muted); font-size: .86rem; }
.channel-post-fields input,
.channel-post-fields textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.channel-post-status { margin-top: 1rem; }
.channel-post-status p { margin: .3rem 0; }
.channel-post-preview { white-space: pre-wrap; margin-top: 1rem; padding: .9rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-soft); line-height: 1.45; }
.channel-post-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .85rem; }

.subscription-consent {
  margin: 1rem 0;
  align-items: flex-start;
  font-size: .9rem;
  line-height: 1.4;
}

.subscription-consent input {
  margin-top: .2rem;
  flex: 0 0 auto;
}

.subscription-manage {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, rgba(128, 128, 128, .25));
}

.subscription-manage p { margin: .35rem 0; }
.subscription-manage .secondary { margin-top: .7rem; }
.subscription-origin { font-size: .78rem; color: var(--muted); }
