/* MiAula — iOS prototype
   World: warm paper, Figtree + Inter, highlighter marks (Refero / Evernote style, pinned by the user). */

:root {
  --scale: 1;
}

.device {
  /* paper world — light */
  --paper: #f9f6f2;
  --cream: #f4eee5;
  --card: #ffffff;
  --ink: #141414;
  --body: #262626;
  --muted: #4e4d4c;
  --fine: #686765;
  --control-edge: #a1a1a1;
  --rule: #d9d9d9;
  --edge: #e7e7e7;
  --sep: #ece8e2;
  --cutout: #f9f6f2;
  --bar: rgba(249, 246, 242, 0.86);
  --scrim: rgba(20, 20, 20, 0.32);
  --fill: rgba(20, 20, 20, 0.06);
  --fill-strong: rgba(20, 20, 20, 0.1);
  --action-bg: #141414;
  --action-fg: #ffffff;
  --action-hover: #00a82d;
  --tint: #141414;
  --danger: #c4321f;
  --danger-fill: #fbe3de;
  --success: #00a82d;
  --lime: #94e130;
  --yellow: #ffd919;
  --orange: #ffa24d;
  --pink: #fad0f6;
  --lavender: #d9b6fd;
  --on-hl: #141414;
  --switch-off: #e3ded6;
  --focus-ring: #141414;

  --f-head: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --f-text: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Dynamic Type multiplier (Ajustes › Apariencia › Tamaño del texto) */
  --dt: 1;
  --t-large: calc(34px * var(--dt));
  --t-title1: calc(28px * var(--dt));
  --t-title2: calc(22px * var(--dt));
  --t-title3: calc(20px * var(--dt));
  --t-headline: calc(17px * var(--dt));
  --t-body: calc(17px * var(--dt));
  --t-callout: calc(16px * var(--dt));
  --t-sub: calc(15px * var(--dt));
  --t-foot: calc(13px * var(--dt));
  --t-cap: calc(12px * var(--dt));
  --t-cap2: calc(11px * var(--dt));

  --r-btn: 5px;
  --r-card: 10px;
  --r-panel: 16px;
  --r-pill: 52px;

  --safe-top: 54px;
  --safe-bottom: 34px;
  --tabbar-h: 50px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.15s;
  --push: 0.34s;
}

.device[data-theme="dark"] {
  --paper: #141414;
  --cream: #262626;
  --card: #262626;
  --raised: #353433;
  --ink: #ffffff;
  --body: #f3f2f1;
  --muted: #c4c2bf;
  --fine: #9a9895;
  --control-edge: #6b6a68;
  --rule: rgba(255, 255, 255, 0.14);
  --edge: rgba(255, 255, 255, 0.2);
  --sep: rgba(255, 255, 255, 0.1);
  --cutout: #323231;
  --bar: rgba(20, 20, 20, 0.84);
  --scrim: rgba(0, 0, 0, 0.55);
  --fill: rgba(255, 255, 255, 0.08);
  --fill-strong: rgba(255, 255, 255, 0.14);
  --action-bg: #94e130;
  --action-fg: #141414;
  --action-hover: #a6ec46;
  --tint: #ffffff;
  --danger: #ff7a66;
  --danger-fill: rgba(255, 122, 102, 0.16);
  --success: #94e130;
  --switch-off: #3a3938;
  --focus-ring: #94e130;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #f9f6f2;
  color: #141414;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; flex-shrink: 0; }
::selection { background: #94e130; color: #141414; }

/* ---------- Stage (desktop presentation) ---------- */
.stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.device {
  width: calc(393px + 24px);
  height: calc(852px + 24px);
  padding: 12px;
  border-radius: 64px;
  background: #1b1b1b;
  box-shadow: 0 0 0 1.5px #3a3a3a inset, 0 30px 60px -20px rgba(20, 20, 20, 0.35), 0 2px 6px rgba(20, 20, 20, 0.12);
  transform: scale(var(--scale));
  transform-origin: center center;
  flex-shrink: 0;
  margin: calc((var(--scale) - 1) * 438px) 0;
}
.device-screen {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 52px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  isolation: isolate;
}
.stage-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Figtree", Arial, sans-serif;
}
.stage-name { font-weight: 600; font-size: 15px; margin-right: 8px; color: #141414; }
.stage-btn {
  font-family: "Figtree", Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 7px 14px;
  border: 1px solid #a1a1a1;
  border-radius: 5px;
  color: #141414;
  transition: background var(--dur, .15s), color var(--dur, .15s);
}
.stage-btn:hover { background: #141414; color: #fff; }
.stage-btn:focus-visible { outline: 2px solid #141414; outline-offset: 2px; }

/* status bar & home indicator */
.status-bar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 54px;
  z-index: 88;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 30px 0 46px;
  pointer-events: none;
  color: var(--ink);
}
.sb-time { font-family: var(--f-head); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; width: 54px; }
.sb-island {
  position: absolute; left: 50%; top: 11px; transform: translateX(-50%);
  width: 124px; height: 36px; border-radius: 20px; background: #000;
}
.sb-icons { display: flex; align-items: center; gap: 6px; fill: currentColor; }
.sb-battery {
  width: 26px; height: 12.5px; border-radius: 4px; border: 1.2px solid currentColor; opacity: .95; padding: 1.5px; position: relative;
}
.sb-battery::after { content: ""; position: absolute; right: -3.5px; top: 3.5px; width: 2px; height: 4px; border-radius: 0 2px 2px 0; background: currentColor; opacity: .5; }
.sb-battery span { display: block; height: 100%; width: 78%; border-radius: 2px; background: currentColor; }
.home-indicator {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 5px; border-radius: 3px; background: var(--ink); z-index: 90; pointer-events: none; opacity: .9;
}
.device.cover-dark .status-bar, .device.cover-dark .home-indicator { color: #fff; }
.device.cover-dark .home-indicator { background: #fff; }

/* ---------- App shell ---------- */
.app {
  position: absolute;
  inset: 0;
  background: var(--paper);
  transition: transform 0.38s var(--ease-out), border-radius 0.38s var(--ease-out), filter 0.38s var(--ease-out);
  transform-origin: 50% 0%;
}
.device.sheet-open .app {
  transform: translateY(10px) scale(0.92);
  border-radius: 16px;
  overflow: hidden;
  filter: brightness(0.86);
}
.device[data-theme="dark"].sheet-open .app { filter: brightness(0.6); }
.tabviews { position: absolute; inset: 0; }
.tabview { position: absolute; inset: 0; display: none; overflow: hidden; }
.tabview.active { display: block; }

.page {
  position: absolute;
  inset: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.page.is-under { transform: translateX(-28%); }
.page.anim-in { animation: push-in var(--push) var(--ease-out) both; }
.page.anim-under { animation: push-under var(--push) var(--ease-out) both; }
.page.anim-out { animation: pop-out var(--push) var(--ease-out) both; }
.page.anim-back { animation: pop-back var(--push) var(--ease-out) both; }
@keyframes push-in { from { transform: translateX(100%); box-shadow: -12px 0 30px rgba(0,0,0,0); } to { transform: translateX(0); box-shadow: -12px 0 30px rgba(0,0,0,.08); } }
@keyframes push-under { from { transform: translateX(0); } to { transform: translateX(-28%); } }
@keyframes pop-out { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes pop-back { from { transform: translateX(-28%); } to { transform: translateX(0); } }
.page.dragging { animation: none; box-shadow: -12px 0 30px rgba(0,0,0,.1); }

/* nav bar */
.navbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  height: calc(var(--safe-top) + 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  padding-left: 8px;
  padding-right: 8px;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.page.scrolled .navbar, .page.inline-nav .navbar {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--rule);
}
.nav-left, .nav-right { display: flex; align-items: center; min-width: 0; }
.nav-right { justify-content: flex-end; gap: 2px; }
.nav-title {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-headline);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  text-align: center;
}
.page.scrolled .nav-title, .page.inline-nav .nav-title { opacity: 1; transform: none; }
.nav-btn, .back-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  border-radius: 8px;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: var(--t-body);
  color: var(--tint);
  transition: opacity var(--dur);
}
.nav-btn.strong { font-weight: 600; }
.nav-btn:active, .back-btn:active { opacity: .45; }
.back-btn { padding-left: 0; max-width: 150px; }
.back-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-circle {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fill);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--lavender); color: var(--on-hl);
  font-family: var(--f-head); font-weight: 600; font-size: 14px;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: calc(var(--safe-top) + 44px);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
  overscroll-behavior: contain;
}
.page-scroll::-webkit-scrollbar { display: none; }
.page.no-tabbar .page-scroll { padding-bottom: calc(var(--safe-bottom) + 24px); }

.large-title {
  padding: 2px 20px 10px;
}
.large-title h1 {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-large);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.large-title p {
  margin: 4px 0 0;
  font-family: var(--f-text);
  font-size: var(--t-sub);
  color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* tab bar */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--rule);
  transition: transform 0.3s var(--ease-out);
}
.app.hide-tabbar .tabbar { transform: translateY(110%); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding-top: 6px;
  color: var(--fine);
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  position: relative;
}
.tab[aria-selected="true"] { color: var(--ink); }
.tab .badge {
  position: absolute; top: 3px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--danger); color: #fff; font-family: var(--f-text); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -4px; border-radius: 10px; }

/* ---------- Content primitives ---------- */
.section { padding: 0 16px; margin-top: 26px; }
.section:first-child { margin-top: 8px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 4px 10px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-title3);
  letter-spacing: -0.02em;
}
.section-head .link {
  font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub); color: var(--ink);
  min-height: 32px; display: inline-flex; align-items: center; gap: 2px;
}

.group-title {
  margin: 22px 20px 7px;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-foot);
  color: var(--muted);
  letter-spacing: 0.01em;
}
.group-footer {
  margin: 7px 20px 0;
  font-size: var(--t-foot);
  line-height: 1.4;
  color: var(--fine);
}
.group {
  margin: 0 16px;
  background: var(--card);
  border-radius: var(--r-card);
  overflow: hidden;
}
.device[data-theme="dark"] .group { box-shadow: 0 0 0 1px var(--sep) inset; }
.group + .group { margin-top: 18px; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 16px;
  width: 100%;
  text-align: left;
  background: var(--card);
  transition: background var(--dur);
}
button.row:active, a.row:active, .row.tappable:active { background: var(--fill); }
.row:not(:last-child)::after {
  content: ""; position: absolute; left: var(--sep-left, 16px); right: 0; bottom: 0; height: 1px; background: var(--sep);
}
.row.has-icon { --sep-left: 58px; }
.row-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fill); color: var(--ink);
}
.row-icon.hl { color: var(--on-hl); }
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-family: var(--f-head);
  font-weight: 500;
  font-size: var(--t-body);
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.row-title.strong { font-weight: 600; }
.row-sub {
  margin-top: 2px;
  font-family: var(--f-text);
  font-size: var(--t-foot);
  line-height: 1.35;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.row-value {
  font-family: var(--f-text);
  font-size: var(--t-sub);
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.row .chev { color: var(--control-edge); }
.row.destructive .row-title { color: var(--danger); }
.row.center { justify-content: center; }
.row.center .row-title { font-weight: 600; }
.row.disabled { opacity: .45; pointer-events: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(20,20,20,.12) inset; }
.sep-dot::before { content: "·"; margin-right: 6px; color: var(--fine); }

/* highlighter pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-cap);
  line-height: 1;
  color: var(--on-hl);
  background: var(--lime);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill.outline { background: transparent; color: var(--muted); box-shadow: 0 0 0 1px var(--control-edge) inset; }
.pill.ink { background: var(--ink); color: var(--paper); }
.pill.danger { background: var(--danger-fill); color: var(--danger); }
.pill.lg { height: 28px; padding: 0 12px; font-size: var(--t-foot); }
.pill svg { width: 12px; height: 12px; }
.lock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  background: var(--lavender); color: var(--on-hl);
  font-family: var(--f-head); font-weight: 600; font-size: 11.5px;
}
.lock-badge svg { width: 11px; height: 11px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--r-btn);
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-body);
  letter-spacing: -0.005em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), opacity var(--dur);
  user-select: none;
}
.btn:focus-visible, .row:focus-visible, .icon-btn:focus-visible, .nav-btn:focus-visible, .back-btn:focus-visible, .chip:focus-visible, .seg button:focus-visible, .check:focus-visible, .link:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.btn-primary { background: var(--action-bg); color: var(--action-fg); }
.btn-primary:hover { background: var(--action-hover); }
.btn-primary:active { opacity: .82; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: 0 0 0 1px var(--control-edge) inset; }
.btn-outline:hover { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn-lime { background: var(--lime); color: #141414; }
.btn-lime:hover { background: #a6ec46; }
.btn-plain { background: transparent; color: var(--ink); min-height: 44px; padding: 0 12px; }
.btn-plain:active { opacity: .5; }
.btn-danger { background: var(--danger-fill); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--t-sub); }
.btn[disabled], .btn.is-loading { opacity: .45; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.icon-btn:active { background: var(--fill); }

/* white paper card & cream stage */
.card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 16px;
}
.device[data-theme="dark"] .card { box-shadow: 0 0 0 1px var(--sep) inset; }
.panel {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--edge);
  border-radius: var(--r-panel);
  overflow: hidden;
  isolation: isolate;
}
.geo {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  fill: var(--cutout);
}

/* ---------- Inicio ---------- */
.now-stage { margin: 4px 16px 0; padding: 18px 16px 16px; min-height: 236px; }
.now-label {
  font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); color: var(--muted);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(0,168,45,.18); }
.now-card {
  position: relative;
  background: var(--card);
  border-radius: var(--r-card);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20,20,20,.05), 0 8px 24px -12px rgba(20,20,20,.18);
  width: 88%;
}
.now-card h3 {
  margin: 10px 0 0;
  font-family: var(--f-head); font-weight: 600; font-size: calc(24px * var(--dt)); line-height: 1.1; letter-spacing: -0.03em;
}
.now-meta { margin-top: 10px; display: grid; gap: 6px; font-size: var(--t-foot); color: var(--muted); }
.now-meta div { display: flex; align-items: center; gap: 7px; }
.now-meta svg { width: 15px; height: 15px; color: var(--fine); }
.now-time {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--sep);
}
.now-time strong { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.now-time span { font-size: var(--t-foot); color: var(--muted); font-variant-numeric: tabular-nums; }
.class-track { height: 4px; border-radius: 2px; background: var(--fill-strong); margin-top: 10px; overflow: hidden; }
.class-track i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.now-fragment {
  position: relative;
  margin: -18px 0 0 auto;
  width: 66%;
  background: var(--card);
  border-radius: var(--r-card);
  padding: 11px 13px;
  box-shadow: 0 1px 2px rgba(20,20,20,.05), 0 10px 22px -12px rgba(20,20,20,.22);
  z-index: 2;
  display: block;
  text-align: left;
}
.now-fragment .k { font-family: var(--f-head); font-weight: 600; font-size: var(--t-cap); color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.now-fragment .t { font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub); margin-top: 3px; letter-spacing: -0.01em; line-height: 1.25; }
.now-empty h3 { font-size: calc(22px * var(--dt)); }

.tip {
  margin: 14px 16px 0;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 14px 14px 16px;
}
.tip p { margin: 2px 0 0; font-size: var(--t-foot); color: var(--muted); line-height: 1.4; }
.tip strong { font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub); }

.task-row .row-title { font-weight: 500; }
.check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.6px solid var(--control-edge);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform .2s var(--ease-out);
  position: relative;
}
.check::before { content: ""; position: absolute; inset: -9px; }
.check svg { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: opacity var(--dur), transform .2s var(--ease-out); }
.check.on { background: var(--success); border-color: var(--success); }
.device[data-theme="dark"] .check.on { color: #141414; }
.check.on svg { opacity: 1; transform: none; }
.check:active { transform: scale(.88); }
.task-row.done .row-title { color: var(--fine); text-decoration: line-through; text-decoration-color: var(--control-edge); }

.meter { display: flex; align-items: center; gap: 8px; }
.meter-track { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-strong); overflow: hidden; min-width: 40px; }
.meter-track i { display: block; height: 100%; border-radius: 2px; background: var(--ink); }
.meter-val { font-family: var(--f-head); font-weight: 600; font-size: var(--t-cap); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.due { font-family: var(--f-text); font-size: var(--t-foot); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.late { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--ink); font-weight: 600; }

.rail {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 16px 4px; margin: 0 -16px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.exam-tile {
  scroll-snap-align: start;
  flex: 0 0 176px;
  background: var(--card);
  border-radius: var(--r-card);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  min-height: 150px;
}
.device[data-theme="dark"] .exam-tile { box-shadow: 0 0 0 1px var(--sep) inset; }
.exam-tile .count {
  font-family: var(--f-head); font-weight: 600; font-size: calc(30px * var(--dt)); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.exam-tile .count small { font-size: var(--t-sub); letter-spacing: -0.01em; margin-left: 3px; color: var(--muted); }
.exam-tile .t { font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub); line-height: 1.25; letter-spacing: -0.01em; }
.exam-tile .m { font-size: var(--t-cap); color: var(--muted); margin-top: auto; }

.focus-strip {
  display: flex; align-items: center; gap: 14px;
  background: #262626; color: #fff;
  border-radius: var(--r-panel);
  padding: 16px;
  position: relative; overflow: hidden; isolation: isolate;
}
.device[data-theme="dark"] .focus-strip { background: #262626; box-shadow: 0 0 0 1px var(--edge) inset; }
.focus-strip .txt { flex: 1; min-width: 0; }
.focus-strip strong { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); display: block; letter-spacing: -0.01em; }
.focus-strip span { font-size: var(--t-foot); color: #d7d5d2; }
.focus-strip .btn { min-height: 40px; padding: 0 16px; font-size: var(--t-sub); }

/* ---------- Segmented control & chips ---------- */
.seg {
  display: flex;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--fill);
  gap: 2px;
}
.seg button {
  flex: 1;
  min-height: 34px;
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-foot);
  color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
  padding: 0 8px;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,20,20,.12), 0 0 0 .5px rgba(20,20,20,.04); }
.device[data-theme="dark"] .seg button[aria-pressed="true"] { background: #3a3938; box-shadow: none; }
.seg-wrap { padding: 4px 16px 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--t-foot);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--control-edge) inset;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip.sq { min-width: 38px; min-height: 40px; justify-content: center; padding: 0 6px; }
.chip svg { width: 13px; height: 13px; }

/* ---------- Forms (inside grouped lists) ---------- */
.field { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 3px 12px 3px 16px; position: relative; background: var(--card); }
.field:not(:last-child)::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: 1px; background: var(--sep); }
.field label, .field .lbl {
  font-family: var(--f-head); font-weight: 500; font-size: var(--t-body); color: var(--ink); flex-shrink: 0;
}
.field .ctl { flex: 1; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.field input[type="text"], .field input[type="url"], .field input[type="number"], .field input[type="email"], .field input:not([type]) {
  width: 100%; border: 0; background: transparent; outline: none;
  font-family: var(--f-text); font-size: var(--t-body); color: var(--ink); text-align: right; min-height: 36px;
  caret-color: var(--ink);
}
.field.stack { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.field.stack .ctl { justify-content: flex-start; }
.field.full input { text-align: left; font-family: var(--f-head); font-weight: 500; }
.field input::placeholder, .field textarea::placeholder { color: var(--fine); opacity: 1; }
.field textarea {
  width: 100%; min-height: 92px; border: 0; background: transparent; outline: none; resize: none;
  font-family: var(--f-text); font-size: var(--t-callout); line-height: 1.45; color: var(--ink); caret-color: var(--ink); padding: 0;
}
.field select {
  outline: none;
  border: 4px solid transparent;
  background-color: var(--fill);
  background-clip: padding-box;
  border-radius: 11px;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--f-text); font-size: var(--t-sub); color: var(--ink);
  max-width: 100%;
  -webkit-appearance: none; appearance: none;
  text-align: right;
}
.field select { padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; text-overflow: ellipsis; }
.field select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -3px; }
.device[data-theme="dark"] .field select, .device[data-theme="dark"] .dpill input { color-scheme: dark; }
.field .err { color: var(--danger); font-size: var(--t-foot); }
.field.invalid { box-shadow: 0 0 0 1.5px var(--danger) inset; border-radius: 8px; }
.form-error { margin: 8px 20px 0; color: var(--danger); font-size: var(--t-foot); display: flex; gap: 6px; align-items: center; }

.switch {
  position: relative; width: 51px; height: 31px; flex-shrink: 0;
}
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch span {
  position: absolute; inset: 0; border-radius: 16px; background: var(--switch-off);
  transition: background .2s var(--ease);
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.04);
  transition: transform .22s var(--ease-out);
}
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

.slider-wrap { display: flex; align-items: center; gap: 12px; width: 100%; }
input[type="range"].slider {
  -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; margin: 0;
}
input[type="range"].slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink) var(--v, 0%), var(--fill-strong) var(--v, 0%)); }
input[type="range"].slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill-strong); }
input[type="range"].slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; margin-top: -12px; box-shadow: 0 2px 7px rgba(0,0,0,.2), 0 0 0 .5px rgba(0,0,0,.06); }
input[type="range"].slider::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 7px rgba(0,0,0,.2); }
input[type="range"].slider:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; border-radius: 4px; }
.slider-val { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }

.stepper { display: inline-flex; border-radius: 8px; background: var(--fill); overflow: hidden; }
.stepper button { width: 46px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.stepper button + button { box-shadow: -1px 0 0 var(--sep); }
.stepper button:active { background: var(--fill-strong); }
.stepper-val { font-family: var(--f-head); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 10px; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch {
  aspect-ratio: 1; border-radius: 50%; position: relative;
  box-shadow: 0 0 0 1px rgba(20,20,20,.1) inset;
  display: flex; align-items: center; justify-content: center; color: #141414;
}
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
.swatch svg { width: 16px; height: 16px; opacity: 0; }
.swatch[aria-pressed="true"] svg { opacity: 1; }

.search {
  display: flex; align-items: center; gap: 6px;
  margin: 2px 16px 10px;
  height: 38px; padding: 0 10px;
  border-radius: 10px; background: var(--fill);
  color: var(--fine);
}
.search input { flex: 1; border: 0; background: transparent; outline: none; font-family: var(--f-text); font-size: var(--t-body); color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--fine); }

/* ---------- Swipe rows ---------- */
.swipe { position: relative; overflow: hidden; background: var(--card); }
.swipe:not(:last-child)::after { content: ""; position: absolute; left: 54px; right: 0; bottom: 0; height: 1px; background: var(--sep); z-index: 3; }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; z-index: 0; }
.swipe-actions button {
  width: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: var(--f-head); font-weight: 600; font-size: 12.5px;
}
.swipe-actions .sa-done { background: var(--success); color: #fff; }
.device[data-theme="dark"] .swipe-actions .sa-done { color: #141414; }
.swipe-actions .sa-del { background: var(--danger); color: #fff; }
.swipe-actions .sa-more { background: #737373; color: #fff; }
.swipe-content { position: relative; z-index: 1; background: var(--card); transition: transform .28s var(--ease-out); touch-action: pan-y; }
.swipe.dragging .swipe-content { transition: none; }
.swipe .row:not(:last-child)::after { display: none; }

/* ---------- Sheets / overlays ---------- */
.overlay-root { position: absolute; inset: 0; pointer-events: none; z-index: 70; }
.overlay-root > * { pointer-events: auto; }
.backdrop {
  position: absolute; inset: 0; background: var(--scrim);
  animation: fade-in .3s var(--ease) both;
}
.backdrop.out { animation: fade-out .25s var(--ease) both; }
.backdrop.clear { background: transparent; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  top: calc(var(--safe-top) + 10px);
  background: var(--paper);
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0,0,0,.12);
  animation: sheet-up .42s var(--ease-out) both;
  overflow: hidden;
}
.sheet.medium { top: auto; height: 62%; }
.sheet.stacked { top: calc(var(--safe-top) + 22px); }
.sheet.out { animation: sheet-down .3s var(--ease) both; }
.sheet.dragging { animation: none; transition: none; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheet-down { from { transform: translateY(var(--drag, 0px)); } to { transform: translateY(100%); } }
.sheet-grabber { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 36px; height: 5px; border-radius: 3px; background: var(--control-edge); opacity: .55; z-index: 3; }
.sheet-header {
  flex-shrink: 0;
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center;
  min-height: 56px; padding: 8px 8px 0;
  touch-action: none;
  position: relative;
}
.sheet-header .nav-right { justify-content: flex-end; }
.sheet-title { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); letter-spacing: -0.01em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sheet-body { flex: 1; overflow-y: auto; padding-bottom: calc(var(--safe-bottom) + 24px); scrollbar-width: none; overscroll-behavior: contain; }
.sheet-body::-webkit-scrollbar { display: none; }
.sheet-body > .group:first-child, .sheet-body > .group-title:first-child { margin-top: 10px; }
.sheet.bare .sheet-header { position: absolute; top: 0; left: 0; right: 0; z-index: 5; background: transparent; }

.actionsheet {
  position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-bottom) + 0px);
  display: flex; flex-direction: column; gap: 8px;
  animation: sheet-up .38s var(--ease-out) both;
}
.actionsheet.out { animation: sheet-down .26s var(--ease) both; }
.as-group { background: var(--card); border-radius: 14px; overflow: hidden; }
.device[data-theme="dark"] .as-group { background: #2c2c2c; }
.as-head { padding: 14px 16px 12px; text-align: center; border-bottom: 1px solid var(--sep); }
.as-head strong { display: block; font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); color: var(--muted); }
.as-head span { display: block; font-size: var(--t-foot); color: var(--fine); margin-top: 3px; line-height: 1.35; }
.as-btn {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  font-family: var(--f-head); font-weight: 500; font-size: calc(18px * var(--dt)); color: var(--ink);
  position: relative;
}
.as-btn:not(:last-child)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--sep); }
.as-btn:active { background: var(--fill); }
.as-btn:focus-visible, .alert-actions button:focus-visible, .plan-opt:focus-visible, .choice:focus-visible, .billing button:focus-visible, .day-cell:focus-visible, .mcell:focus-visible, .exam-tile:focus-visible, .tg-block:focus-visible, .wg-block:focus-visible, .now-card:focus-visible, .now-fragment:focus-visible, .swatch:focus-visible, .focus-mode button:focus-visible, .row-main:focus-visible, .tab:focus-visible, .banner:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.row-main { outline: none; }
.as-btn .as-ico { width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #141414; flex-shrink: 0; }
.as-btn .as-sub { margin-left: auto; }
.as-btn.destructive { color: var(--danger); }
.as-btn.cancel { justify-content: center; font-weight: 600; }
.as-btn.locked { color: var(--muted); }

.alert {
  position: absolute; top: 50%; left: 50%; width: 280px;
  transform: translate(-50%, -50%);
  background: var(--card); border-radius: 14px; overflow: hidden; text-align: center;
  animation: alert-in .28s var(--ease-out) both;
}
.device[data-theme="dark"] .alert { background: #2c2c2c; }
.alert.out { animation: fade-out .18s var(--ease) both; }
@keyframes alert-in { from { opacity: 0; transform: translate(-50%, -50%) scale(1.12); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.alert-body { padding: 20px 18px 16px; }
.alert-body strong { display: block; font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); letter-spacing: -0.01em; }
.alert-body p { margin: 6px 0 0; font-size: var(--t-foot); line-height: 1.4; color: var(--muted); }
.alert-actions { display: flex; border-top: 1px solid var(--sep); }
.alert-actions.vertical { flex-direction: column; }
.alert-actions button { flex: 1; min-height: 46px; font-family: var(--f-head); font-weight: 500; font-size: var(--t-body); color: var(--ink); }
.alert-actions:not(.vertical) button + button { border-left: 1px solid var(--sep); }
.alert-actions.vertical button + button { border-top: 1px solid var(--sep); }
.alert-actions button.strong { font-weight: 600; }
.alert-actions button.destructive { color: var(--danger); }
.alert-actions button:active { background: var(--fill); }

.banner {
  position: absolute; left: 8px; right: 8px; top: 52px;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(244, 238, 229, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  animation: banner-in .45s var(--ease-out) both;
  z-index: 80;
  text-align: left;
  width: auto;
}
.device[data-theme="dark"] .banner { background: rgba(44, 44, 44, 0.9); }
.banner.out { animation: banner-out .3s var(--ease) both; }
@keyframes banner-in { from { transform: translateY(-140%); } to { transform: none; } }
@keyframes banner-out { to { transform: translateY(-140%); opacity: 0; } }
.banner .app-ico { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; }
.banner .b-main { flex: 1; min-width: 0; }
.banner .b-top { display: flex; justify-content: space-between; font-size: var(--t-cap); color: var(--muted); }
.banner .b-title { font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub); margin-top: 1px; }
.banner .b-text { font-size: var(--t-foot); line-height: 1.35; color: var(--body); margin-top: 1px; }

.hud {
  position: absolute; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: hud-in .32s var(--ease-out) both;
  white-space: nowrap;
  z-index: 85;
}
.hud.out { animation: fade-out .25s var(--ease) both; }
.hud button { color: var(--lime); font-weight: 600; margin-left: 6px; min-height: 28px; }
.device[data-theme="dark"] .hud button { color: #2f7a00; }
@keyframes hud-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Calendar ---------- */
.cal-head { padding: 0 16px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px 8px 6px; }
.day-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0 7px; border-radius: 12px; min-height: 64px;
}
.day-cell .dn { font-family: var(--f-head); font-weight: 600; font-size: 11.5px; color: var(--fine); text-transform: lowercase; }
.day-cell .dd {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-head); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums;
}
.day-cell.today .dd { box-shadow: 0 0 0 1.5px var(--ink) inset; }
.day-cell[aria-pressed="true"] .dd { background: var(--ink); color: var(--paper); box-shadow: none; }
.day-cell.holiday .dd { color: var(--fine); }
.day-cell .dots { display: flex; gap: 3px; height: 5px; }
.day-cell .dots i { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 0 .5px rgba(20,20,20,.25) inset; }
.cal-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 20px 8px;
  font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub);
}
.cal-sub .muted { font-family: var(--f-text); font-weight: 400; color: var(--muted); font-size: var(--t-foot); }

.holiday-band {
  margin: 4px 16px 10px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
}
.holiday-band strong { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); display: block; }
.holiday-band span { font-size: var(--t-foot); color: var(--muted); }

.due-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; }
.due-strip::-webkit-scrollbar { display: none; }
.due-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 10px; border-radius: 8px;
  background: var(--card); box-shadow: 0 0 0 1px var(--edge) inset;
  font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot);
  max-width: 260px;
}
.due-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.timegrid { position: relative; margin: 0 16px 0 0; }
.tg-hour { position: relative; height: 64px; display: flex; }
.tg-hour .lab {
  width: 54px; flex-shrink: 0; text-align: right; padding-right: 10px;
  font-family: var(--f-text); font-size: 11px; color: var(--fine); transform: translateY(-7px); font-variant-numeric: tabular-nums;
}
.tg-hour .line { flex: 1; border-top: 1px solid var(--sep); }
.tg-events { position: absolute; top: 0; left: 58px; right: 0; bottom: 0; }
.tg-block {
  position: absolute; left: 0; right: 0;
  border-radius: 8px;
  padding: 6px 10px;
  overflow: hidden;
  text-align: left;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--edge) inset;
}
.tg-block .bt { font-family: var(--f-head); font-weight: 600; font-size: var(--t-sub); line-height: 1.2; letter-spacing: -0.01em; display: flex; align-items: center; gap: 6px; min-width: 0; }
.tg-block .bt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-block .bm { font-size: var(--t-cap); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-block .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(20,20,20,.15) inset; }
.tg-block.exam { box-shadow: 0 0 0 1.5px var(--ink) inset; }
.tg-block.activity { background: var(--cream); }
.tg-block.short .bm { display: none; }
.tg-block.half { right: auto; width: calc(50% - 2px); }
.tg-block.half.second { left: calc(50% + 2px); }
.now-line { position: absolute; left: 50px; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.week-grid { display: grid; grid-template-columns: 34px repeat(var(--cols, 5), 1fr); margin: 0 10px 0 0; position: relative; }
.wg-head { position: sticky; top: calc(var(--safe-top) + 44px); z-index: 5; display: contents; }
.wg-col-head { text-align: center; padding: 6px 0; font-family: var(--f-head); font-weight: 600; font-size: 12px; color: var(--muted); }
.wg-col-head b { display: block; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wg-col-head.today b { color: var(--paper); background: var(--ink); border-radius: 50%; width: 26px; height: 26px; line-height: 26px; margin: 2px auto 0; font-size: 14px; }
.wg-times { position: relative; }
.wg-times span { position: absolute; right: 6px; font-size: 11px; color: var(--fine); transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.wg-col { position: relative; border-left: 1px solid var(--sep); }
.wg-col .hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--sep); }
.wg-block {
  position: absolute; left: 2px; right: 2px;
  border-radius: 6px; padding: 4px 5px;
  overflow: hidden;
  font-family: var(--f-head); font-weight: 600; font-size: 11px; line-height: 1.2; color: var(--ink);
  text-align: left;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--edge) inset;
}
.wg-block .wt { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.wg-block .wt span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wg-block .wt i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 .5px rgba(20,20,20,.25) inset; }
.wg-block small { display: block; font-family: var(--f-text); font-weight: 400; font-size: 11px; margin-top: 1px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-block.exam { background: var(--card) !important; box-shadow: 0 0 0 1.5px var(--ink) inset; }
.wg-col.holiday { background: var(--fill); }
.wg-hol { position: absolute; top: 6px; left: 2px; right: 2px; text-align: center; font-family: var(--f-head); font-weight: 600; font-size: 11px; color: var(--muted); line-height: 1.2; }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 10px; row-gap: 2px; }
.month-grid .mh { text-align: center; font-family: var(--f-head); font-weight: 600; font-size: 11.5px; color: var(--fine); padding: 4px 0 6px; }
.mcell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; min-height: 52px; border-radius: 10px; }
.mcell .dd { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.mcell.other .dd { color: var(--control-edge); }
.mcell.today .dd { box-shadow: 0 0 0 1.5px var(--ink) inset; }
.mcell[aria-pressed="true"] .dd { background: var(--ink); color: var(--paper); box-shadow: none; }
.mcell.holiday .dd { text-decoration: line-through; text-decoration-color: var(--control-edge); color: var(--fine); }
.mcell .dots { display: flex; gap: 2px; height: 5px; }
.mcell .dots i { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 0 .5px rgba(20,20,20,.25) inset; }

.agenda-row .when { width: 52px; flex-shrink: 0; font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); font-variant-numeric: tabular-nums; }
.agenda-row .when small { display: block; font-family: var(--f-text); font-weight: 400; color: var(--fine); font-size: var(--t-cap); }

/* ---------- Detail headers ---------- */
.page.inline-nav .page-body { padding-top: 12px; }
.detail-head { padding: 6px 20px 6px; }
.detail-head h1 { margin: 10px 0 0; font-family: var(--f-head); font-weight: 600; font-size: var(--t-title1); line-height: 1.12; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.detail-head p { margin: 8px 0 0; color: var(--muted); font-size: var(--t-sub); line-height: 1.45; }
.detail-head .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); border-radius: var(--r-card); overflow: hidden; margin: 0 16px; }
.kv > div { background: var(--card); padding: 12px 14px; }
.kv dt { font-family: var(--f-head); font-weight: 600; font-size: var(--t-cap); color: var(--muted); margin: 0; }
.kv dd { margin: 3px 0 0; font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.callout {
  margin: 14px 16px 0; padding: 12px 14px; border-radius: var(--r-card);
  display: flex; gap: 10px; align-items: flex-start;
  font-size: var(--t-foot); line-height: 1.4;
}
.callout.warn { background: #fff1d6; color: #4a3200; }
.device[data-theme="dark"] .callout.warn { background: rgba(255, 162, 77, .16); color: #ffd7ae; }
.callout.info { background: var(--cream); color: var(--body); box-shadow: 0 0 0 1px var(--edge) inset; }
.callout strong { font-family: var(--f-head); font-weight: 600; }
.callout svg { width: 18px; height: 18px; margin-top: 1px; }
.actions-bar { display: flex; gap: 10px; padding: 18px 16px 0; }
.actions-bar .btn { flex: 1; }

/* ---------- Grades ---------- */
.avg-panel { margin: 4px 16px 0; padding: 20px 18px 18px; }
.avg-row { display: flex; align-items: flex-end; gap: 16px; }
.avg-num { font-family: var(--f-head); font-weight: 600; font-size: calc(56px * var(--dt)); line-height: .9; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.avg-note { font-size: var(--t-foot); color: var(--muted); line-height: 1.4; padding-bottom: 4px; }
.avg-note strong { color: var(--ink); font-family: var(--f-head); font-weight: 600; }
.target-track { position: relative; height: 10px; border-radius: 5px; background: var(--card); margin-top: 18px; box-shadow: 0 0 0 1px var(--edge) inset; }
.target-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--ink); }
.target-track b { position: absolute; top: -5px; width: 2px; height: 20px; background: var(--ink); border-radius: 1px; }
.target-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: var(--t-cap); color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row { display: grid; grid-template-columns: 136px 1fr 34px; align-items: center; gap: 10px; padding: 9px 16px; }
.bar-row .nm { font-family: var(--f-head); font-weight: 500; font-size: var(--t-foot); display: flex; align-items: center; gap: 7px; min-width: 0; }
.bar-row .nm .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-row .tr { height: 14px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar-row .tr i { display: block; height: 100%; border-radius: 4px; box-shadow: 0 0 0 1px rgba(20,20,20,.1) inset; }
.bar-row .v { font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); text-align: right; font-variant-numeric: tabular-nums; }
.grade-badge { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); font-variant-numeric: tabular-nums; }

/* ---------- Focus (near-black interlude) ---------- */
.cover {
  position: absolute; inset: 0; z-index: 75;
  display: flex; flex-direction: column;
  animation: sheet-up .45s var(--ease-out) both;
}
.cover.out { animation: sheet-down .32s var(--ease) both; }
.focus { background: #141414; color: #fff; overflow: hidden; isolation: isolate; }
.focus-stats .geo { fill: #2d2d2c; }
.focus-top { padding: calc(var(--safe-top) + 4px) 8px 0; display: flex; justify-content: space-between; align-items: center; }
.focus-top .nav-btn { color: #fff; }
.focus-body { flex: 1; display: flex; flex-direction: column; padding: 8px 24px 0; overflow-y: auto; scrollbar-width: none; }
.focus-body::-webkit-scrollbar { display: none; }
.focus-mode { display: flex; gap: 6px; }
.focus-mode button {
  height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  font-family: var(--f-head); font-weight: 600; font-size: 13px; color: #d7d5d2;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset;
}
.focus-mode button[aria-pressed="true"] { background: var(--lime); color: #141414; box-shadow: none; }
.focus-clock {
  margin-top: 34px;
  font-family: var(--f-head); font-weight: 600;
  font-size: calc(96px * var(--dt)); line-height: .9; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.focus-what { margin-top: 16px; display: flex; align-items: center; gap: 8px; font-size: var(--t-sub); color: #d7d5d2; }
.focus-what button { color: #fff; font-family: var(--f-head); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.cycle-track { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 6px; margin-top: 28px; }
.cycle-track span { height: 8px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.cycle-track span i { display: block; height: 100%; background: var(--lime); border-radius: 4px; }
.cycle-label { margin-top: 10px; font-size: var(--t-foot); color: #b9b7b4; display: flex; justify-content: space-between; }
.focus-actions { display: flex; gap: 10px; margin-top: 30px; }
.focus-actions .btn { flex: 1; }
.focus-actions .btn-ghost { background: rgba(255,255,255,.1); color: #fff; }
.focus-actions .btn-ghost:hover { background: rgba(255,255,255,.18); }
.focus-stats { position: relative; overflow: hidden; isolation: isolate; margin-top: 30px; padding: 16px; border-radius: var(--r-panel); background: #262626; box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset; }
.focus-stats .fs-row { display: flex; justify-content: space-between; gap: 12px; }
.focus-stats .fs-row div strong { display: block; font-family: var(--f-head); font-weight: 600; font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.focus-stats .fs-row div span { font-size: 12px; color: #b9b7b4; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 76px; margin-top: 16px; }
.week-bars div { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.week-bars i { width: 100%; border-radius: 4px; background: rgba(255,255,255,.18); min-height: 3px; }
.week-bars i.on { background: var(--lime); }
.week-bars span { font-size: 10.5px; color: #b9b7b4; font-family: var(--f-head); font-weight: 600; }
.focus .focus-sel { color: #fff; }

/* ---------- Coach chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 6px 14px 12px; }
.msg { max-width: 84%; padding: 10px 13px; border-radius: 18px; font-size: var(--t-callout); line-height: 1.42; overflow-wrap: anywhere; }
.msg p { margin: 0; }
.msg p + p, .msg ul { margin-top: 6px; }
.msg ul { padding-left: 18px; margin-bottom: 0; }
.msg-user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 6px; }
.msg-coach { align-self: flex-start; background: var(--card); color: var(--body); border-bottom-left-radius: 6px; box-shadow: 0 0 0 1px var(--edge) inset; }
.msg-coach .msg-name { font-family: var(--f-head); font-weight: 600; font-size: var(--t-cap); color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.msg-card { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--cream); box-shadow: 0 0 0 1px var(--edge) inset; display: grid; gap: 6px; }
.msg-card .mc-row { display: flex; gap: 8px; align-items: center; font-size: var(--t-foot); }
.msg-card .btn { min-height: 40px; font-size: var(--t-sub); margin-top: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--fine); animation: blink 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 10px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest .chip { flex-shrink: 0; background: var(--card); }
.chat-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 8px 12px calc(var(--safe-bottom) + 6px);
  background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--rule);
}
.chat-input { display: flex; align-items: center; gap: 8px; }
.chat-input input {
  flex: 1; min-height: 40px; border-radius: 20px; border: 1px solid var(--edge); background: var(--card);
  padding: 0 14px; outline: none; font-family: var(--f-text); font-size: var(--t-callout); color: var(--ink); caret-color: var(--ink);
}
.chat-input input:focus-visible { border-color: var(--ink); }
.send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--action-bg); color: var(--action-fg); display: inline-flex; align-items: center; justify-content: center; }
.send-btn[disabled] { opacity: .35; }
.quota { text-align: center; font-size: var(--t-cap); color: var(--fine); padding-top: 6px; }

/* scan */
.viewfinder {
  margin: 8px 16px 0; height: 330px; border-radius: var(--r-panel); background: #1d1d1d; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.viewfinder .paper-sheet {
  width: 74%; height: 76%; background: #fbf8f3; border-radius: 6px; transform: rotate(-4deg);
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: 18px repeat(6, 1fr); gap: 3px; padding: 10px;
}
.viewfinder .paper-sheet i { border-radius: 3px; background: #ebe4d8; }
.viewfinder .paper-sheet i.h { background: transparent; border-bottom: 1.5px solid #c9c0b2; border-radius: 0; }
.viewfinder .corner { position: absolute; width: 34px; height: 34px; border: 3px solid var(--lime); }
.viewfinder .c1 { top: 24px; left: 34px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.viewfinder .c2 { top: 24px; right: 34px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.viewfinder .c3 { bottom: 24px; left: 34px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.viewfinder .c4 { bottom: 24px; right: 34px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.viewfinder .scanline { position: absolute; left: 12%; right: 12%; height: 3px; border-radius: 2px; background: var(--lime); top: 20%; animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { to { top: 78%; } }

/* ---------- Onboarding / paywall ---------- */
.ob { background: var(--paper); }
.ob-top { padding: calc(var(--safe-top) + 2px) 8px 0; display: flex; align-items: center; justify-content: space-between; min-height: calc(var(--safe-top) + 46px); }
.ob-progress { flex: 1; display: flex; gap: 5px; padding: 0 12px; }
.ob-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-strong); }
.ob-progress i.on { background: var(--ink); }
.ob-body { flex: 1; overflow-y: auto; padding: 8px 24px 16px; scrollbar-width: none; display: flex; flex-direction: column; }
.ob-body::-webkit-scrollbar { display: none; }
.ob-body h1 { margin: 10px 0 0; font-family: var(--f-head); font-weight: 600; font-size: calc(34px * var(--dt)); line-height: 1.04; letter-spacing: -0.045em; }
.ob-body > p { margin: 12px 0 0; font-size: var(--t-callout); line-height: 1.5; color: var(--muted); }
.ob-foot { padding: 12px 24px calc(var(--safe-bottom) + 12px); display: grid; gap: 8px; }
.ob-hero { margin: 14px -8px 0; height: 330px; padding: 0; }
.collage { position: absolute; inset: 0; }
.collage .c-card {
  position: absolute; background: var(--card); border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgba(20,20,20,.05), 0 14px 30px -14px rgba(20,20,20,.28);
  padding: 12px 13px;
}
.collage .c-card h4 { margin: 8px 0 0; font-family: var(--f-head); font-weight: 600; font-size: 18px; letter-spacing: -0.03em; line-height: 1.1; }
.collage .c-card p { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.collage .c-chip { position: absolute; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--r-card); background: var(--card);
  box-shadow: 0 0 0 1px var(--edge) inset;
  transition: box-shadow var(--dur), background var(--dur);
  min-height: 64px;
}
.choice + .choice { margin-top: 10px; }
.choice[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink) inset; }
.choice .c-ico { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #141414; flex-shrink: 0; }
.choice strong { display: block; font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); letter-spacing: -0.01em; }
.choice span { display: block; font-size: var(--t-foot); color: var(--muted); margin-top: 2px; line-height: 1.35; }
.choice .tick { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--control-edge) inset; display: inline-flex; align-items: center; justify-content: center; color: var(--paper); flex-shrink: 0; }
.choice[aria-pressed="true"] .tick { background: var(--ink); box-shadow: none; }
.choice .tick svg { width: 13px; height: 13px; }
.mini-rot { display: flex; gap: 3px; margin-top: 8px; }
.mini-rot i { width: 22px; height: 14px; border-radius: 3px; background: var(--fill-strong); display: flex; align-items: center; justify-content: center; font-style: normal; font-family: var(--f-head); font-weight: 600; font-size: 9px; color: var(--muted); }
.sso { display: grid; gap: 10px; margin-top: 22px; }
.sso .btn { justify-content: center; }
.legal { font-size: var(--t-cap); color: var(--fine); line-height: 1.45; text-align: center; margin: 12px 0 0; }

.paywall-stage { margin: 0; padding: calc(var(--safe-top) + 46px) 22px 22px; border-radius: 0 0 var(--r-panel) var(--r-panel); border-top: 0; border-left: 0; border-right: 0; }
.paywall-stage h1 { margin: 12px 0 0; font-family: var(--f-head); font-weight: 600; font-size: calc(32px * var(--dt)); line-height: 1.04; letter-spacing: -0.045em; }
.paywall-stage p { margin: 10px 0 0; color: var(--muted); font-size: var(--t-callout); line-height: 1.45; }
.feat-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.feat-list li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sub); line-height: 1.35; }
.feat-list li svg { width: 18px; height: 18px; color: var(--success); margin-top: 1px; }
.billing { display: inline-flex; padding: 3px; border-radius: 100px; background: var(--fill); margin: 18px auto 0; }
.billing button { min-height: 36px; padding: 0 16px; border-radius: 100px; font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.billing button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.billing .save { background: var(--lime); color: #141414; border-radius: 52px; padding: 2px 6px; font-size: 10.5px; }
.plan-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--r-card); background: var(--card); box-shadow: 0 0 0 1px var(--edge) inset;
}
.plan-opt + .plan-opt { margin-top: 10px; }
.plan-opt[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink) inset; }
.plan-opt strong { font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); display: block; }
.plan-opt span { font-size: var(--t-foot); color: var(--muted); }
.plan-opt .price { margin-left: auto; text-align: right; font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-opt .price small { display: block; font-family: var(--f-text); font-weight: 400; font-size: var(--t-cap); color: var(--muted); }

/* ---------- Widgets preview ---------- */
.homescreen {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 16px; padding: 18px; border-radius: 26px;
  background: var(--cream); border: 1px solid var(--edge);
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.widget { background: var(--card); border-radius: 22px; padding: 14px; box-shadow: 0 6px 18px rgba(20,20,20,.12); min-height: 150px; display: flex; flex-direction: column; overflow: hidden; }
.widget.wide { grid-column: span 2; }
.widget .w-k { font-family: var(--f-head); font-weight: 600; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.widget .w-t { font-family: var(--f-head); font-weight: 600; font-size: 18px; letter-spacing: -0.03em; line-height: 1.1; margin-top: 8px; }
.widget .w-m { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.widget .w-foot { margin-top: auto; font-family: var(--f-head); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.widget .w-list { display: grid; gap: 7px; margin-top: 8px; }
.widget .w-list div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-family: var(--f-head); font-weight: 500; }
.widget .w-list div span:last-child { margin-left: auto; color: var(--muted); font-family: var(--f-text); font-weight: 400; font-size: 11px; white-space: nowrap; }
.widget .w-list .dot { width: 8px; height: 8px; }

/* ---------- Empty states ---------- */
.empty { margin: 8px 16px 0; padding: 28px 20px 22px; text-align: center; }
.empty h3 { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: var(--t-title3); letter-spacing: -0.02em; }
.empty p { margin: 8px auto 0; max-width: 270px; font-size: var(--t-foot); color: var(--muted); line-height: 1.45; }
.empty .btn { margin-top: 16px; }

/* profile card */
.profile { margin: 4px 16px 0; padding: 16px; display: flex; gap: 14px; align-items: center; }
.profile strong { display: block; font-family: var(--f-head); font-weight: 600; font-size: var(--t-title3); letter-spacing: -0.02em; }
.profile span { font-size: var(--t-foot); color: var(--muted); }
.profile .avatar { width: 56px; height: 56px; font-size: 22px; color: var(--on-hl); }
.profile .pill { color: var(--on-hl); font-size: var(--t-cap); }
.profile .pill.outline { color: var(--muted); }
.upsell { margin: 14px 16px 0; padding: 16px; background: #262626; color: #fff; border-radius: var(--r-panel); display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; isolation: isolate; }
.upsell strong { display: block; font-family: var(--f-head); font-weight: 600; font-size: var(--t-headline); }
.upsell span { display: block; font-size: var(--t-foot); color: #d7d5d2; margin-top: 2px; line-height: 1.35; }
.upsell .btn { min-height: 40px; padding: 0 14px; font-size: var(--t-sub); flex-shrink: 0; }
.device[data-theme="dark"] .upsell { box-shadow: 0 0 0 1px var(--edge) inset; }

.limit-bar { margin: 0 16px 12px; padding: 10px 12px; border-radius: var(--r-card); background: var(--cream); box-shadow: 0 0 0 1px var(--edge) inset; display: flex; align-items: center; gap: 10px; }
.limit-bar .lb-main { flex: 1; min-width: 0; }
.limit-bar strong { font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); }
.limit-bar .segs { display: flex; gap: 3px; margin-top: 6px; }
.limit-bar .segs i { flex: 1; height: 5px; border-radius: 3px; background: var(--fill-strong); }
.limit-bar .segs i.on { background: var(--ink); }
.limit-bar .link { font-family: var(--f-head); font-weight: 600; font-size: var(--t-foot); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; display: inline-flex; align-items: center; }

.code-box { font-family: var(--f-head); font-weight: 600; font-size: 30px; letter-spacing: .08em; text-align: center; padding: 18px; border-radius: var(--r-card); background: var(--card); box-shadow: 0 0 0 1px var(--edge) inset; font-variant-numeric: tabular-nums; }

.subtask-row { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 16px; position: relative; background: var(--card); }
.subtask-row:not(:last-child)::after { content: ""; position: absolute; left: 54px; right: 0; bottom: 0; height: 1px; background: var(--sep); }
.subtask-row .check { width: 22px; height: 22px; }
.subtask-row input { flex: 1; border: 0; outline: none; background: transparent; font-family: var(--f-text); font-size: var(--t-callout); color: var(--ink); min-height: 34px; }
.subtask-row .st-text { flex: 1; font-size: var(--t-callout); }
.subtask-row.done .st-text { color: var(--fine); text-decoration: line-through; }

/* dark: light interface objects sit raised on the #262626 charcoal panels */
.device[data-theme="dark"] .panel .now-card, .device[data-theme="dark"] .panel .now-fragment, .device[data-theme="dark"] .collage .c-card,
.device[data-theme="dark"] .homescreen .widget, .device[data-theme="dark"] .panel .target-track, .device[data-theme="dark"] .msg-card,
.device[data-theme="dark"] .panel .btn-outline { background: var(--raised); }
.device[data-theme="dark"] .panel .btn-outline:hover { background: var(--ink); }
/* 44pt hit areas around compact controls (visual size unchanged) */
.btn-sm, .billing button, .limit-bar .link, .focus-what button, .chip, .seg button, .section-head .link { position: relative; }
.btn-sm::before, .billing button::before, .limit-bar .link::before, .focus-what button::before, .chip::before, .seg button::before, .section-head .link::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%);
}
/* iOS compact date/time pill: formatted value over a transparent native input */
.dpill {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 64px; padding: 0 10px;
  border: 4px solid transparent; background: var(--fill); background-clip: padding-box; border-radius: 11px;
  font-family: var(--f-text); font-size: var(--t-sub); color: var(--ink); white-space: nowrap; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dpill input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; font-size: 16px; }
.dpill input::-webkit-calendar-picker-indicator { display: none; }
.dpill:focus-within { outline: 2px solid var(--focus-ring); outline-offset: -3px; }
.dpill.empty .dval { color: var(--fine); }
.row.disabled-look { opacity: .5; }
.btn-apple { background: #141414; color: #fff; }
.device[data-theme="dark"] .btn-apple { background: #fff; color: #141414; }
.sheet .paywall-stage { padding-top: 62px; }
.sheet.bare .sheet-header .nav-btn { color: var(--ink); }
.muted { color: var(--muted); }
.fine { color: var(--fine); }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.pad16 { padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .page.anim-in, .page.anim-under, .page.anim-out, .page.anim-back { animation-name: fade-in; animation-duration: .2s; }
  .page.anim-out { animation-name: fade-out; }
  .page.is-under { transform: none; }
  .sheet, .actionsheet, .cover { animation-name: fade-in !important; animation-duration: .2s !important; }
  .sheet.out, .actionsheet.out, .cover.out { animation-name: fade-out !important; }
  .viewfinder .scanline, .typing i { animation: none; }
  .device.sheet-open .app { transform: none; border-radius: 0; }
}
.device.static *, .device.static *::before, .device.static *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }
.device.reduce-motion .page.anim-in, .device.reduce-motion .page.anim-back { animation-name: fade-in; animation-duration: .2s; }
.device.reduce-motion .page.anim-under, .device.reduce-motion .page.anim-out { animation-name: fade-out; animation-duration: .2s; }

/* ---------- Real phone: drop the frame ---------- */
@media (max-width: 520px) {
  body { background: var(--paper, #f9f6f2); }
  .stage { display: block; height: 100%; }
  .device {
    width: 100%; height: 100%; padding: 0; border-radius: 0; box-shadow: none; transform: none; margin: 0;
    --safe-top: max(env(safe-area-inset-top), 20px);
    --safe-bottom: env(safe-area-inset-bottom);
  }
  .device-screen { width: 100%; height: 100%; border-radius: 0; }
  .status-bar, .home-indicator, .stage-controls { display: none; }
}
