/* =====================================================================
   Home Command Center — design system
   Mobile-first · light/dark · safe-area aware · 48px touch targets
   ===================================================================== */

:root {
  --bg: #F6F3EE;
  --bg-2: #EFEAE2;
  --card: #FFFFFF;
  --card-2: #FBF9F6;
  --ink: #14213D;
  --ink-2: #4A5468;
  --ink-3: #8A90A0;
  --line: #E6E0D6;
  --line-2: #D9D1C4;

  --primary: #1E4E79;
  --primary-2: #2C6AA0;
  --primary-ink: #FFFFFF;
  --primary-soft: #E3ECF5;
  --accent: #E07A5F;
  --accent-soft: #FBE7E1;
  --olive: #5E8B5A;
  --olive-soft: #E5EFE2;
  --sun: #E9A23B;
  --sun-soft: #FCF0DC;
  --plum: #7C5BA6;
  --plum-soft: #EEE7F7;
  --danger: #C2362B;
  --danger-soft: #FBE4E1;
  --ok: #2F8F4E;
  --ok-soft: #E1F2E6;
  --warn: #B86E0E;
  --warn-soft: #FCEFD9;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 4px 14px rgba(20, 33, 61, .06);
  --shadow-lg: 0 10px 40px rgba(20, 33, 61, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --header-h: 60px;
  --nav-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Rounded", ui-rounded, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0F1522;
  --bg-2: #151C2C;
  --card: #18202F;
  --card-2: #1C2536;
  --ink: #EEF1F7;
  --ink-2: #B4BCCB;
  --ink-3: #7D8698;
  --line: #273145;
  --line-2: #334058;
  --primary: #5C9BD6;
  --primary-2: #7BB2E6;
  --primary-ink: #0B1220;
  --primary-soft: #1B2D45;
  --accent: #F08F74;
  --accent-soft: #3A2520;
  --olive: #86B781;
  --olive-soft: #1E2E21;
  --sun: #F2B65C;
  --sun-soft: #3A2E18;
  --plum: #A98AD4;
  --plum-soft: #2A2238;
  --danger: #F06A5E;
  --danger-soft: #3B1D1B;
  --ok: #5CC17E;
  --ok-soft: #173023;
  --warn: #F0A848;
  --warn-soft: #36290F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1522; --bg-2: #151C2C; --card: #18202F; --card-2: #1C2536;
    --ink: #EEF1F7; --ink-2: #B4BCCB; --ink-3: #7D8698; --line: #273145; --line-2: #334058;
    --primary: #5C9BD6; --primary-2: #7BB2E6; --primary-ink: #0B1220; --primary-soft: #1B2D45;
    --accent: #F08F74; --accent-soft: #3A2520; --olive: #86B781; --olive-soft: #1E2E21;
    --sun: #F2B65C; --sun-soft: #3A2E18; --plum: #A98AD4; --plum-soft: #2A2238;
    --danger: #F06A5E; --danger-soft: #3B1D1B; --ok: #5CC17E; --ok-soft: #173023; --warn: #F0A848; --warn-soft: #36290F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-display); letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.no-scroll { overflow: hidden; }

/* ------------------------------------------------------------- app shell */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 16px) 8px calc(var(--sal) + 16px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  display: flex; align-items: center; gap: 8px; min-height: calc(var(--header-h) + var(--sat));
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.app-header.scrolled { border-bottom-color: var(--line); }
.app-header .title { flex: 1; min-width: 0; }
.app-header .title small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.app-header .title strong { display: block; font: 800 20px/1.15 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-main {
  flex: 1; width: 100%; max-width: 980px; margin: 0 auto;
  padding: 8px calc(var(--sar) + 16px) calc(var(--nav-h) + var(--sab) + 96px) calc(var(--sal) + 16px);
}
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 6px calc(var(--sar) + 8px) calc(var(--sab) + 6px) calc(var(--sal) + 8px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line); display: flex; justify-content: space-around;
}
.bottom-nav a {
  flex: 1; max-width: 110px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 11px; font-weight: 650; border-radius: 14px; position: relative; transition: color .2s;
}
.bottom-nav a .ico { font-size: 22px; line-height: 1; transition: transform .25s var(--ease-spring); filter: grayscale(.7) opacity(.75); }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active .ico { transform: translateY(-2px) scale(1.12); filter: none; }
.bottom-nav a.active::before {
  content: ""; position: absolute; top: 4px; width: 42px; height: 30px; border-radius: 12px; background: var(--primary-soft); z-index: -1;
  animation: pop .3s var(--ease-spring);
}
@media (min-width: 900px) {
  .bottom-nav { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 6px 10px; gap: 4px; }
  .bottom-nav a { min-width: 92px; }
}

/* view transitions */
.view { animation: viewIn .32s var(--ease) backwards; }
.view.leaving { animation: viewOut .14s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewOut { to { opacity: 0; transform: translateY(-4px); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(194, 54, 43, .55); } 50% { box-shadow: 0 0 0 14px rgba(194, 54, 43, 0); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes checkPop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ------------------------------------------------------------- buttons */
.btn {
  --b: var(--card); --c: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--bd);
  background: var(--b); color: var(--c); font-weight: 650; font-size: 15px; white-space: nowrap;
  transition: transform .12s var(--ease), background .2s, box-shadow .2s, opacity .2s; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { --b: var(--primary); --c: var(--primary-ink); --bd: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn.accent { --b: var(--accent); --c: #fff; --bd: transparent; }
.btn.danger { --b: var(--danger); --c: #fff; --bd: transparent; }
.btn.ok { --b: var(--ok); --c: #fff; --bd: transparent; }
.btn.soft { --b: var(--primary-soft); --c: var(--primary); --bd: transparent; }
.btn.ghost { --b: transparent; --bd: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.lg { min-height: 56px; font-size: 16px; border-radius: 16px; }
.btn .spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 0; background: transparent; color: var(--ink-2);
  display: inline-grid; place-items: center; font-size: 20px; position: relative; flex: none; transition: background .2s, transform .12s;
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; animation: pop .3s var(--ease-spring);
}
.sos-btn {
  min-height: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: var(--danger); color: #fff;
  font-weight: 850; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 4px 14px rgba(194, 54, 43, .35);
}
.sos-btn:active { transform: scale(.95); }
.fab {
  position: fixed; z-index: 35; right: calc(var(--sar) + 18px); bottom: calc(var(--nav-h) + var(--sab) + 18px);
  width: 60px; height: 60px; border-radius: 20px; border: 0; background: var(--primary); color: var(--primary-ink);
  font-size: 28px; display: grid; place-items: center; box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 45%, transparent);
  animation: pop .35s var(--ease-spring); transition: transform .15s var(--ease);
}
.fab:active { transform: scale(.9) rotate(90deg); }
.fab.secondary { bottom: calc(var(--nav-h) + var(--sab) + 92px); width: 52px; height: 52px; border-radius: 18px; font-size: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.fab.secondary.listening { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@media (min-width: 900px) { .fab { bottom: 32px; right: max(32px, calc(50% - 490px)); } .fab.secondary { bottom: 104px; } }

/* ------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.field.invalid .input { border-color: var(--danger); animation: shake .4s; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 13px; border: 1.5px solid var(--line);
  background: var(--card-2); color: var(--ink); font-size: 16px; transition: border-color .2s, box-shadow .2s, background .2s; -webkit-appearance: none; appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238A90A0' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); background: var(--card); }
.input::placeholder { color: var(--ink-3); }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-weight: 600; }
.input-wrap .input.has-prefix { padding-left: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 380px) { .form-grid { grid-template-columns: 1fr; } }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 52px; height: 32px; border-radius: 16px; background: var(--line-2); position: relative; transition: background .25s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--ease-spring); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.emoji-picker button { width: 40px; height: 40px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--card-2); font-size: 20px; }
.emoji-picker button.on { border-color: var(--primary); background: var(--primary-soft); }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-row button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--line-2); }
.color-row button.on { box-shadow: 0 0 0 3px var(--ink); }

/* ------------------------------------------------------------- surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.section { margin: 20px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section h2, .section h3 { display: flex; align-items: center; gap: 8px; }
.section .more { font-size: 14px; font-weight: 650; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.sm { gap: 6px; }
.gap-lg { gap: 16px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; word-break: break-word; }
.mt { margin-top: 12px; } .mt-lg { margin-top: 20px; } .mb { margin-bottom: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3.md-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cards.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* list item card */
.item {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 64px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; position: relative;
  transition: transform .14s var(--ease), box-shadow .2s, border-color .2s, opacity .3s; animation: zoomIn .28s var(--ease) both;
  text-align: left; width: 100%; color: inherit;
}
button.item:active, .item.tap:active { transform: scale(.985); }
.item:hover { border-color: var(--line-2); }
.item .lead {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none;
  background: var(--bg-2); overflow: hidden;
}
.item .lead img { width: 100%; height: 100%; object-fit: cover; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.item .s { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.item .meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.item .trail { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.item .amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.item.done { opacity: .55; }
.item.done .t { text-decoration: line-through; }
.item .stripe { position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; }

/* chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--bg-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--primary-soft); color: var(--primary); }
.chip.plum { background: var(--plum-soft); color: var(--plum); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 650; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: all .2s var(--ease);
}
.fchip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fchip:active { transform: scale(.95); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 18px; flex: none;
  background: var(--bg-2); border: 2px solid var(--card); box-shadow: 0 0 0 1.5px var(--av, var(--line-2));
}
.avatar.sm { width: 26px; height: 26px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 28px; }
.avatar.xl { width: 84px; height: 84px; font-size: 42px; }

/* segmented tabs */
.tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--bg-2); margin: 4px 0 14px; overflow-x: auto; scrollbar-width: none;
  position: sticky; top: calc(var(--header-h) + var(--sat)); z-index: 20;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent;
  font-weight: 700; font-size: 14px; color: var(--ink-3); transition: all .25s var(--ease); white-space: nowrap;
}
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(20,33,61,.08); }

/* toolbar */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.search { position: relative; flex: 1; }
.search .input { padding-left: 42px; border-radius: 14px; background: var(--card); }
.search::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .55; pointer-events: none; }
.filter-btn { position: relative; }
.filter-btn .count { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* stats */
.stat {
  padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
  min-height: 96px; position: relative; overflow: hidden; text-align: left; color: inherit; transition: transform .14s var(--ease);
}
.stat:active { transform: scale(.97); }
.stat .ic { font-size: 22px; }
.stat .v { font: 800 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--ink-3); font-weight: 650; }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--tint, var(--primary-soft)); opacity: .8; }
.stat > * { position: relative; z-index: 1; }

/* progress */
.progress { height: 10px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--pc, var(--ok)); transition: width .8s var(--ease); }
.ring { --p: 0; --c: var(--ok); width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-2) 0); display: grid; place-items: center; flex: none; }
.ring > span { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 12px; font-weight: 800; }

/* empty + skeleton */
.empty { text-align: center; padding: 42px 20px; color: var(--ink-3); animation: fadeIn .4s both; }
.empty .big { font-size: 48px; margin-bottom: 8px; filter: saturate(.8); }
.empty p { max-width: 280px; margin: 0 auto 14px; }
.skel { position: relative; overflow: hidden; background: var(--bg-2); border-radius: 16px; height: 68px; margin-bottom: 10px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 60%, transparent), transparent); animation: shimmer 1.2s infinite; }

/* ------------------------------------------------------------- modal / sheet */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 16, 28, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .22s ease both;
}
.overlay.closing { animation: fadeIn .18s ease reverse both; }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100dvh - var(--sat) - 24px); display: flex; flex-direction: column;
  background: var(--card); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); animation: slideUp .34s var(--ease) both; overflow: hidden;
}
.overlay.closing .modal { animation: slideUp .2s ease reverse both; }
.modal .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; flex: none; }
.modal header { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 20px; flex: none; }
.modal header h2 { flex: 1; font-size: 19px; }
.modal .content { padding: 4px 20px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; }
.modal footer {
  display: flex; gap: 10px; padding: 12px 20px calc(12px + var(--sab)); border-top: 1px solid var(--line); flex: none; background: var(--card);
}
.modal footer .btn { flex: 1; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .modal { border-radius: 26px; animation: zoomIn .26s var(--ease) both; }
  .overlay.closing .modal { animation: zoomIn .16s ease reverse both; }
  .modal .grip { display: none; }
  .modal.wide { max-width: 760px; }
}

/* detail sheet bits */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kv > div { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; min-width: 0; word-break: break-word; }
.kv > div:nth-child(odd) { color: var(--ink-3); font-weight: 650; font-size: 13px; background: var(--card-2); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.action-tile {
  min-height: 56px; padding: 10px 12px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: var(--card-2);
  display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14px; color: var(--ink); text-align: left; transition: all .15s var(--ease);
}
.action-tile:active { transform: scale(.96); background: var(--primary-soft); }
.action-tile .e { font-size: 20px; }

/* media gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.gallery .g {
  aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); position: relative; padding: 0;
  display: grid; place-items: center; font-size: 30px; transition: transform .15s var(--ease);
}
.gallery .g:active { transform: scale(.95); }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g .nm { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; padding: 3px 6px; background: rgba(0,0,0,.55); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery .add { border-style: dashed; color: var(--ink-3); font-size: 26px; background: transparent; }
.upload-progress { height: 4px; border-radius: 2px; background: var(--bg-2); overflow: hidden; margin-top: 8px; }
.upload-progress i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }

/* ------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(4, 7, 12, .94); display: flex; flex-direction: column;
  animation: fadeIn .25s ease both; touch-action: none; user-select: none; -webkit-user-select: none;
}
.lightbox.closing { animation: fadeIn .2s ease reverse both; }
.lightbox .lb-top {
  display: flex; align-items: center; gap: 8px; padding: calc(var(--sat) + 8px) calc(var(--sar) + 10px) 8px calc(var(--sal) + 16px); color: #fff; z-index: 2;
}
.lightbox .lb-top .cap { flex: 1; min-width: 0; font-size: 14px; }
.lightbox .lb-top .cap b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox .lb-top .cap span { opacity: .65; font-size: 12px; }
.lightbox .icon-btn { color: #fff; background: rgba(255,255,255,.1); }
.lightbox .icon-btn:hover { background: rgba(255,255,255,.2); }
.lightbox .stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lightbox .track { display: flex; height: 100%; width: 100%; transition: transform .35s var(--ease); will-change: transform; }
.lightbox .slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 8px; }
.lightbox .slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transform-origin: 0 0; will-change: transform; animation: zoomIn .3s var(--ease) both; }
.lightbox .slide iframe { width: min(100%, 900px); height: 100%; border: 0; border-radius: 8px; background: #fff; }
.lightbox .slide .doc { color: #fff; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.lightbox .slide .doc .big { font-size: 72px; }
.lightbox .nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 26px; display: grid; place-items: center; backdrop-filter: blur(6px);
}
.lightbox .nav.prev { left: calc(var(--sal) + 12px); }
.lightbox .nav.next { right: calc(var(--sar) + 12px); }
.lightbox .nav:disabled { opacity: 0; pointer-events: none; }
.lightbox .dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0 calc(var(--sab) + 14px); }
.lightbox .dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.35); transition: all .25s; }
.lightbox .dots i.on { width: 22px; background: #fff; }
.lightbox .thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 6px; justify-content: center; scrollbar-width: none; }
.lightbox .thumbs button { width: 48px; height: 48px; flex: none; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #222; opacity: .6; }
.lightbox .thumbs button.on { border-color: #fff; opacity: 1; }
.lightbox .thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------- toast */
.toasts { position: fixed; z-index: 300; left: 0; right: 0; top: calc(var(--sat) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 440px; width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14.5px; animation: toastIn .35s var(--ease-spring) both;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast .btn { min-height: 34px; padding: 0 12px; --b: rgba(255,255,255,.18); --c: inherit; --bd: transparent; }
.toast.out { animation: toastIn .25s ease reverse both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- accordion */
.acc { border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; }
.acc + .acc { margin-top: 8px; }
.acc > button { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; background: transparent; text-align: left; font-weight: 700; font-size: 15.5px; }
.acc > button .chev { margin-left: auto; transition: transform .3s var(--ease); color: var(--ink-3); }
.acc.open > button .chev { transform: rotate(180deg); }
.acc .acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc .acc-body > div { overflow: hidden; }
.acc .acc-inner { padding: 0 16px 16px; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; min-height: 30px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: grid; place-items: center; font-size: 14px; }

/* ------------------------------------------------------------- shopping */
.aisle-head { display: flex; align-items: center; gap: 8px; margin: 18px 4px 8px; font-weight: 800; font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.aisle-head .n { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.check {
  width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none;
  background: var(--card); transition: all .2s var(--ease); font-size: 16px; color: #fff;
}
.done .check, .check.on { background: var(--ok); border-color: var(--ok); }
.done .check::after, .check.on::after { content: "✓"; font-weight: 900; animation: checkPop .3s var(--ease-spring); }
.shop-item { min-height: 60px; cursor: pointer; }
.shop-item .qty { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.suggest .sg { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--sun-soft); border: 1px solid color-mix(in srgb, var(--sun) 35%, transparent); font-weight: 650; font-size: 14px; animation: zoomIn .3s both; }
.suggest .sg button { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--card); font-size: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card-2); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 18px; font-weight: 800; color: var(--primary); }
.stepper span { min-width: 44px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- calendar */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal-head h2 { flex: 1; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1 / 1.08; border-radius: 12px; border: 1px solid transparent; background: var(--card); padding: 4px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; font-weight: 700; font-size: 14px; position: relative; transition: all .15s var(--ease); min-width: 0;
}
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--primary); color: var(--primary); }
.cal-day.sel { background: var(--primary); color: var(--primary-ink); }
.cal-day .dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.cal-day .dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--dc, var(--ink-3)); }
.cal-day.sel .dots i { background: var(--primary-ink); }
.agenda-day { font-weight: 800; font-size: 13px; color: var(--ink-3); margin: 16px 2px 8px; text-transform: uppercase; letter-spacing: .05em; }
.ev-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 13px; min-width: 48px; color: var(--ink-2); }

/* meal planner */
.week { display: flex; flex-direction: column; gap: 10px; }
.day-col { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.day-col.today { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.day-col h3 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; text-transform: capitalize; }
.slot-row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; min-height: 46px; border-top: 1px dashed var(--line); padding: 4px 0; }
.slot-row:first-of-type { border-top: 0; }
.slot-row .sl { font-size: 12px; font-weight: 750; color: var(--ink-3); }
.meal-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--sun-soft); font-weight: 650; font-size: 14px; border: 0; text-align: left; width: 100%; min-height: 40px; }
.meal-add { border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink-3); border-radius: 12px; min-height: 40px; width: 100%; font-size: 13px; font-weight: 650; }
@media (min-width: 900px) { .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); } .slot-row { grid-template-columns: 1fr; } }

/* timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--primary), var(--accent)); border-radius: 2px; opacity: .4; }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before { content: attr(data-emoji); position: absolute; left: -28px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 2px solid var(--primary); display: grid; place-items: center; font-size: 12px; }
.tl-year { font: 800 22px var(--font-display); color: var(--ink-3); margin: 18px 0 10px -28px; }
.tl-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.tl-photos button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.tl-photos img { width: 100%; height: 100%; object-fit: cover; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 80px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; animation: zoomIn .25s both; }
.msg.me { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-color: transparent; border-bottom-right-radius: 6px; }
.msg:not(.me) { border-bottom-left-radius: 6px; }
.msg .who { font-size: 12px; font-weight: 800; margin-bottom: 2px; }
.msg .when { font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.msg img { border-radius: 12px; margin-top: 6px; max-height: 240px; }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--sab)); z-index: 34; padding: 8px calc(var(--sar) + 12px) 8px calc(var(--sal) + 12px);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line);
}
.composer textarea { min-height: 48px; max-height: 140px; resize: none; }
@media (min-width: 900px) { .composer { bottom: 0; max-width: 980px; margin: 0 auto; padding-bottom: 96px; } }
.note-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.note {
  min-height: 120px; padding: 12px; border-radius: 6px 6px 18px 6px; font-size: 14.5px; position: relative; box-shadow: 0 6px 16px rgba(20,33,61,.1);
  transform: rotate(var(--r, -.8deg)); transition: transform .2s var(--ease); text-align: left; border: 0; color: #2A2410;
}
.note:active { transform: scale(.97) rotate(0); }
.note.yellow { background: #FFF1A8; } .note.blue { background: #CDE6FF; } .note.green { background: #D4F2CF; } .note.pink { background: #FFD6E5; } .note.orange { background: #FFDDB8; }
.note .by { position: absolute; bottom: 8px; right: 10px; font-size: 11px; opacity: .6; }

/* emergency */
.panic-big {
  width: 220px; height: 220px; border-radius: 50%; border: 0; margin: 10px auto 6px; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #F2665B, #C2362B 60%, #8F2219); color: #fff; font: 900 28px var(--font-display);
  box-shadow: 0 16px 40px rgba(194,54,43,.45), inset 0 -8px 20px rgba(0,0,0,.2); animation: pulse 2s infinite; position: relative; touch-action: none;
}
.panic-big small { display: block; font-size: 13px; font-weight: 700; opacity: .85; margin-top: 4px; }
.panic-big .hold { position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(#fff calc(var(--h, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 109px, #000 110px); mask: radial-gradient(circle, transparent 109px, #000 110px); }
.call-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .call-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.call {
  display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 72px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); transition: transform .12s var(--ease);
}
.call:active { transform: scale(.96); }
.call .e { font-size: 26px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); flex: none; }
.call.emergency .e { background: var(--danger); }
.call b { display: block; font-size: 14.5px; line-height: 1.2; }
.call span { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.panic-overlay {
  position: fixed; inset: 0; z-index: 250; background: linear-gradient(160deg, #C2362B, #7E1A13); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: calc(var(--sat) + 24px) 24px calc(var(--sab) + 24px); gap: 14px; animation: fadeIn .3s both;
}
.panic-overlay .big { font-size: 80px; animation: pulse 1.4s infinite; border-radius: 50%; }
.panic-overlay h1 { font-size: 30px; }
.panic-overlay .btn { --b: #fff; --c: #8F2219; min-width: 240px; }
.panic-overlay .btn.ghost { --b: rgba(255,255,255,.15); --c: #fff; }
.alert-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--danger); color: #fff; font-weight: 700; margin-bottom: 12px; animation: pulse 2s infinite; }

/* hero + home */
.hero {
  border-radius: 24px; padding: 18px; color: #fff; position: relative; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(135deg, #1E4E79 0%, #2C6AA0 55%, #E07A5F 140%);
}
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .greet { font: 800 24px/1.15 var(--font-display); }
.hero .sub { opacity: .85; font-size: 14px; margin-top: 4px; text-transform: capitalize; }
.hero .quick { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 1; }
.hero .quick button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: rgba(255,255,255,.16); color: #fff; font-weight: 700; font-size: 13.5px; backdrop-filter: blur(6px); }
.pet-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.ptog {
  min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card-2); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; transition: all .2s var(--ease);
}
.ptog.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.ptog.on::before { content: "✓"; font-weight: 900; animation: checkPop .3s var(--ease-spring); }

/* more menu */
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.menu-tile {
  aspect-ratio: 1 / .92; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--ink); text-align: center; padding: 8px;
  transition: transform .14s var(--ease); animation: zoomIn .3s var(--ease) both;
}
.menu-tile:active { transform: scale(.94); }
.menu-tile .e { font-size: 30px; width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--tint, var(--bg-2)); }

/* kids */
.kid-switch { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.kid-chip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; font-weight: 700; font-size: 13px; color: var(--ink-3); min-width: 64px; }
.kid-chip .avatar { width: 56px; height: 56px; font-size: 28px; transition: transform .25s var(--ease-spring); }
.kid-chip.on { color: var(--ink); }
.kid-chip.on .avatar { transform: scale(1.08); box-shadow: 0 0 0 3px var(--av, var(--primary)); }
.health-card { border-radius: 20px; padding: 16px; background: linear-gradient(135deg, var(--danger-soft), var(--card)); border: 1px solid var(--line); }
.health-card .big { font: 900 30px var(--font-display); color: var(--danger); }
.sizes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.size-tile { padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.size-tile .e { font-size: 24px; }
.size-tile .v { font: 900 22px var(--font-display); }
.size-tile .l { font-size: 12px; color: var(--ink-3); font-weight: 650; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart text { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.timetable { display: grid; gap: 8px; }
.slot { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sc, var(--primary)); }
.slot .tm { font-weight: 800; font-size: 13px; min-width: 52px; font-variant-numeric: tabular-nums; }
.reward-hero { text-align: center; padding: 22px 16px; border-radius: 24px; background: linear-gradient(135deg, var(--sun-soft), var(--plum-soft)); border: 1px solid var(--line); }
.reward-hero .pts { font: 900 46px/1 var(--font-display); color: var(--sun); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.badge { text-align: center; padding: 12px 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.badge .e { font-size: 32px; display: block; margin-bottom: 4px; }
.badge.locked { opacity: .35; filter: grayscale(1); }

/* login / pin */
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--sat) + 24px) 20px calc(var(--sab) + 24px); background: radial-gradient(circle at 20% 0%, var(--primary-soft), var(--bg) 60%); }
.auth-card { width: 100%; max-width: 400px; animation: zoomIn .4s var(--ease) both; }
.auth-logo { font-size: 54px; text-align: center; margin-bottom: 6px; }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 16px 0; }
.profiles button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--ink-2); min-width: 72px; }
.profiles .avatar { width: 64px; height: 64px; font-size: 32px; transition: transform .2s var(--ease-spring); }
.profiles button:active .avatar { transform: scale(.9); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); transition: all .2s var(--ease-spring); }
.pin-dots i.on { background: var(--primary); border-color: var(--primary); transform: scale(1.15); }
.pin-dots.bad { animation: shake .4s; }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; }
.pinpad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--card); font: 600 26px var(--font-display); box-shadow: var(--shadow); transition: transform .1s, background .15s; }
.pinpad button:active { transform: scale(.9); background: var(--primary-soft); }
.pinpad button.fn { background: transparent; box-shadow: none; font-size: 15px; color: var(--ink-3); }

/* install prompt / banners */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--primary-soft); color: var(--ink); margin-bottom: 12px; animation: zoomIn .3s both; }
.banner .e { font-size: 24px; }
.offline-pill { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 64px); padding: 6px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; animation: toastIn .3s both; }

/* search overlay results */
.results .item { margin-bottom: 8px; }

/* printing */
@media print { .bottom-nav, .app-header, .fab, .composer { display: none !important; } .app-main { padding: 0; } }
