/* FamilyNest - warm, friendly, readable. Mobile first; works in light and dark. */

@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin-wght-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --surface-2: #f5eee3;
  --surface-3: #ece3d4;
  --ink: #2b2440;
  --ink-2: #5d5672;
  --ink-3: #8d879e;
  --line: #e8dfd1;
  --brand: #ee5f43;
  --brand-strong: #d94c31;
  --brand-ink: #ffffff;
  --good: #3f9b4b;
  --warn: #c98a12;
  --bad: #d5433a;
  --shadow: 0 1px 2px rgba(43, 36, 64, 0.05), 0 10px 28px -14px rgba(43, 36, 64, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(43, 36, 64, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Nunito', ui-rounded, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tint: 14%;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #19152a;
  --surface: #241f38;
  --surface-2: #2d2745;
  --surface-3: #393253;
  --ink: #f4f0fb;
  --ink-2: #bcb5d0;
  --ink-3: #8b84a1;
  --line: #3a3354;
  --brand: #ff7b5e;
  --brand-strong: #ff9279;
  --brand-ink: #2a1109;
  --good: #6cc777;
  --warn: #e9b44c;
  --bad: #ff7a70;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  --tint: 24%;
  color-scheme: dark;
}

/* The eight family colours. Any element with c-<name> gets --c (solid) and --c-soft (tint). */
.c-coral { --c: #ee5f43; }
.c-teal { --c: #0e9c97; }
.c-sun { --c: #e9a21b; }
.c-violet { --c: #7a5be0; }
.c-leaf { --c: #3f9a45; }
.c-rose { --c: #e0559a; }
.c-sky { --c: #2f80d9; }
.c-slate { --c: #6b7489; }
:root[data-theme='dark'] .c-sun { --c: #c98500; }
:root[data-theme='dark'] .c-slate { --c: #8f98ad; }
[class*='c-'] { --c-soft: color-mix(in srgb, var(--c) var(--tint), var(--surface)); --c-ink: color-mix(in srgb, var(--c) 72%, var(--ink)); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: var(--brand-strong); text-decoration: none; font-weight: 700; }
@media (hover: hover) { a:hover { text-decoration: underline; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------- helpers */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.grow { flex: 1 1 0; min-width: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; }
.bold { font-weight: 800; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.eyebrow { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.strike { text-decoration: line-through; color: var(--ink-3); }

/* --------------------------------------------------------------- shell */
.app { min-height: 100dvh; }
.sidebar { display: none; }
.main { width: 100%; min-width: 0; padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1180px; margin: 0 auto; }
.main.wide { max-width: none; }

.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px;
  margin: 0 -16px; padding: 12px 16px 10px; min-height: 60px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 1.5rem; }
.topbar .sub { font-size: 0.86rem; color: var(--ink-2); font-weight: 600; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* Longer languages: when the title and the buttons do not fit side by side, the buttons move
   to a line of their own instead of squeezing the title to "Tareas del…". */
.topbar { flex-wrap: wrap; row-gap: 8px; }
.topbar > .grow { flex: 1 1 auto; min-width: min(100%, 11rem); }
.topbar .actions:empty { display: none; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: var(--ink-3); font-size: 0.66rem; font-weight: 800; text-decoration: none; padding: 0; min-width: 0;
}
.bottomnav .on { color: var(--brand-strong); }
.bottomnav .on .navicon { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.navicon { display: grid; place-items: center; width: 46px; height: 30px; border-radius: 999px; transition: background 0.15s; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 20px 14px 14px;
    background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
  }
  .sidebar .brand { padding: 2px 8px 16px; }
  .sidebar a.navlink {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
    color: var(--ink-2); font-weight: 700; text-decoration: none;
  }
  @media (hover: hover) { .sidebar a.navlink:hover { background: var(--surface-2); color: var(--ink); } }
  .sidebar a.navlink.on { background: color-mix(in srgb, var(--brand) 13%, transparent); color: var(--brand-strong); }
  .sidebar .navsep { height: 1px; background: var(--line); margin: 8px 8px; }
  .sidebar .me { margin-top: auto; padding: 10px; border-radius: 14px; background: var(--surface-2); }
  .bottomnav { display: none; }
  .main { padding: 0 32px 48px; }
  .topbar { margin: 0 -32px; padding: 24px 32px 14px; }
  .topbar h1 { font-size: 1.9rem; }
}

/* --------------------------------------------------------------- basics */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.tint { background: var(--c-soft); border-color: transparent; }
.card > .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card > .head h3 { flex: 1; }
.card .head .more { font-size: 0.84rem; }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) and (max-width: 1100px) { .grid.three { grid-template-columns: 1fr 1fr; } }
.span-2 { grid-column: 1 / -1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1.5px solid transparent; border-radius: 13px; background: var(--surface-2); color: var(--ink);
  font-weight: 800; white-space: nowrap; text-decoration: none; transition: transform 0.08s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .btn:hover { background: var(--surface-3); text-decoration: none; } }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
@media (hover: hover) { .btn.primary:hover { background: var(--brand-strong); } }
.btn.ghost { background: transparent; }
@media (hover: hover) { .btn.ghost:hover { background: var(--surface-2); } }
.btn.outline { background: transparent; border-color: var(--line); }
.btn.danger { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.btn.sm { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 0.88rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-2); -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .iconbtn:hover { background: var(--surface-2); color: var(--ink); } }
.iconbtn.sm { width: 32px; height: 32px; border-radius: 9px; }
.iconbtn.solid { background: var(--surface-2); }
.icon { flex: none; display: block; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 0.82rem; font-weight: 800; color: var(--ink-2); }
.field .hint { font-size: 0.8rem; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 88px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.input::placeholder { color: var(--ink-3); }
.input.bare { border-color: transparent; background: transparent; padding-left: 6px; }
@media (hover: hover) { .input.bare:hover { background: var(--surface-2); } }
.input.bare:focus { background: var(--surface); border-color: var(--brand); }
.input.title { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.formgrid { display: grid; gap: 12px; }
@media (min-width: 560px) { .formgrid.two { grid-template-columns: 1fr 1fr; } .formgrid.three { grid-template-columns: 1fr 1fr 1fr; } }
.error-text { color: var(--bad); font-weight: 700; font-size: 0.9rem; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 800;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.chip.c { background: var(--c-soft); color: var(--c-ink); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.chip.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
button.chip { border: 0; min-height: 32px; padding: 4px 12px; font-size: 0.86rem; }
button.chip.on { background: var(--ink); color: var(--bg); }
button.chip.c.on { background: var(--c); color: #fff; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-soft); box-shadow: inset 0 0 0 2px var(--c); font-size: 18px; line-height: 1; user-select: none;
}
.avatar.sm { width: 24px; height: 24px; font-size: 13px; box-shadow: inset 0 0 0 1.5px var(--c); }
.avatar.lg { width: 56px; height: 56px; font-size: 30px; }
.avatar.xl { width: 76px; height: 76px; font-size: 42px; box-shadow: inset 0 0 0 3px var(--c); }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }

.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--surface-2); gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(43, 36, 64, 0.15); }

.check {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 2px solid var(--ink-3); background: transparent; color: transparent; transition: all 0.15s;
}
@media (hover: hover) { .check:hover { border-color: var(--good); } }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check.sq { border-radius: 8px; }

.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--brand)); transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); min-height: 52px; }
.item:last-child { border-bottom: 0; }
.item.tap { cursor: pointer; border-radius: 12px; border-bottom: 0; padding: 10px 8px; margin: 0 -8px; }
@media (hover: hover) { .item.tap:hover { background: var(--surface-2); } }
.item .emoji { font-size: 1.5rem; width: 34px; text-align: center; flex: none; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty .big { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; color: var(--ink); }
.empty p { max-width: 420px; margin: 0 auto 14px; }

.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-weight: 700; font-size: 0.9rem; }
.banner.offline { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--ink); margin-top: 8px; }
.banner.err { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); }

/* ------------------------------------------------------- modal & toast */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(27, 22, 44, 0.5); animation: fade 0.15s ease-out;
}
.modal {
  display: flex; flex-direction: column; width: 100%; max-height: 94dvh; background: var(--surface);
  border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal > header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.modal > header h2 { flex: 1; min-width: 0; }
.modal > .body { padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; }
.modal > footer {
  display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.modal > footer .spacer { flex: 1; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .modal { max-width: 540px; border-radius: 26px; max-height: 88dvh; animation-name: pop; }
  .modal.wide { max-width: 760px; }
  .modal > footer { padding-bottom: 14px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }

.toasts {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 11px 16px; border-radius: 16px;
  background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: var(--shadow-lg); animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.bad { background: var(--bad); color: #fff; }
.toast.cheer { background: linear-gradient(120deg, #ee5f43, #e9a21b); color: #fff; }
.toast button { border: 0; background: rgba(255, 255, 255, 0.2); color: inherit; border-radius: 9px; padding: 4px 10px; font-weight: 800; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; }

.menu { position: relative; display: inline-block; }
.menu .pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.menu .pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none;
  text-align: left; font-weight: 700;
}
@media (hover: hover) { .menu .pop button:hover { background: var(--surface-2); } }
.menu .pop button.danger { color: var(--bad); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 2px transparent; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--c); }
.emojigrid { display: flex; flex-wrap: wrap; gap: 4px; }
.emojigrid button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; font-size: 1.35rem; padding: 0; }
@media (hover: hover) { .emojigrid button:hover { background: var(--surface-2); } }
.emojigrid button.on { background: color-mix(in srgb, var(--brand) 18%, transparent); box-shadow: inset 0 0 0 2px var(--brand); }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 0.9rem;
}
.person.on { border-color: var(--c); background: var(--c-soft); }

/* ----------------------------------------------------------------- auth */
.authpage { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, #e9a21b 22%, transparent), transparent),
  radial-gradient(800px 500px at 110% 10%, color-mix(in srgb, #ee5f43 20%, transparent), transparent), var(--bg); }
.authcard { width: 100%; max-width: 440px; }
.authcard .brand { justify-content: center; font-size: 1.7rem; margin-bottom: 6px; }
.authcard .brand img { width: 52px; height: 52px; border-radius: 15px; }
.authcard .tagline { text-align: center; color: var(--ink-2); margin-bottom: 18px; }
.authquote { margin-top: 18px; text-align: center; font-family: var(--display); font-style: italic; color: var(--ink-2); }

/* ---------------------------------------------------------------- today */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px; color: #fff;
  background: linear-gradient(125deg, #e8553a 0%, #ee7a3e 55%, #eba126 100%); box-shadow: var(--shadow);
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.13); pointer-events: none;
}
.hero .hello { font-family: var(--display); font-size: 1.7rem; font-weight: 600; }
.hero .date { opacity: 0.92; font-weight: 700; }
.hero blockquote { position: relative; margin: 16px 0 0; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.16); }
.hero blockquote p { font-family: var(--display); font-style: italic; font-size: 1.16rem; line-height: 1.35; }
.hero blockquote footer { margin-top: 8px; font-size: 0.86rem; font-weight: 700; opacity: 0.95; display: flex; align-items: center; gap: 8px; }
.hero blockquote button { margin-left: auto; border: 0; background: rgba(255, 255, 255, 0.22); color: #fff; border-radius: 10px; padding: 5px 10px; font-weight: 800; font-size: 0.8rem; display: inline-flex; gap: 6px; align-items: center; }
@media (min-width: 720px) { .hero { padding: 28px; } .hero .hello { font-size: 2.1rem; } .hero blockquote p { font-size: 1.3rem; } }

.quick { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: 0 -2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.joke .punch { font-weight: 800; color: var(--c-ink); }
.agenda-time { width: 54px; flex: none; font-weight: 800; font-size: 0.86rem; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex: none; }
.starline { display: flex; align-items: center; gap: 10px; }
.starline .n { font-weight: 900; min-width: 44px; text-align: right; }
.kudo { padding: 12px 14px; border-radius: 16px; background: var(--c-soft); }
.kudo .msg { font-family: var(--display); font-size: 1.05rem; }

/* --------------------------------------------------------------- boards */
.boardgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.boardtile {
  display: flex; flex-direction: column; gap: 10px; min-height: 124px; padding: 16px; border-radius: var(--radius); text-decoration: none;
  background: var(--c-soft); color: var(--ink); border: 1.5px solid transparent; transition: transform 0.12s, border-color 0.12s;
}
@media (hover: hover) { .boardtile:hover { transform: translateY(-2px); border-color: var(--c); text-decoration: none; } }
.boardtile .emoji { font-size: 2rem; line-height: 1; }
.boardtile h3 { font-size: 1.15rem; }
.boardtile.new { background: transparent; border: 2px dashed var(--line); align-items: center; justify-content: center; color: var(--ink-2); font-weight: 800; cursor: pointer; }

.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 4px 16px 20px; margin: 0 -16px; min-height: calc(100dvh - 190px); scroll-snap-type: x proximity; }
@media (min-width: 900px) { .board { padding: 4px 32px 24px; margin: 0 -32px; min-height: calc(100dvh - 150px); } }
.lane { flex: none; width: min(84vw, 300px); display: flex; flex-direction: column; max-height: calc(100dvh - 200px); border-radius: 18px; background: var(--surface-2); scroll-snap-align: center; }
@media (min-width: 900px) { .lane { max-height: calc(100dvh - 150px); } }
.lane > header { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px 14px; cursor: grab; }
.lane > header h3 { flex: 1; font-family: var(--font); font-weight: 800; font-size: 1rem; }
.lane > header .count { font-size: 0.8rem; font-weight: 800; color: var(--ink-3); }
.lane .cards { flex: 1; overflow-y: auto; padding: 4px 8px; min-height: 24px; display: flex; flex-direction: column; gap: 8px; }
.lane > footer { padding: 6px 8px 8px; }
.lane.add { background: transparent; border: 2px dashed var(--line); padding: 8px; }
.kcard {
  display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 13px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(43, 36, 64, 0.1); border: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none;
}
@media (hover: hover) { .kcard:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); } }
.kcard .t { font-weight: 700; overflow-wrap: anywhere; }
.kcard.done .t { color: var(--ink-3); text-decoration: line-through; }
.kcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-2); font-weight: 700; }
.kcard .meta .sp { flex: 1; }
.kcard .meta span { display: inline-flex; align-items: center; gap: 3px; }
.labels { display: flex; flex-wrap: wrap; gap: 4px; }
.labels .chip { font-size: 0.7rem; padding: 1px 8px; }
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { box-shadow: var(--shadow-lg); }
.sortable-drag { transform: rotate(2.5deg); }
.checkrow { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .bubble { flex: 1; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); }

/* ------------------------------------------------------------- calendar */
.calbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.calbar h2 { min-width: 0; margin-right: auto; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .dow span { padding: 7px 0; text-align: center; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.cal .weeks { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day {
  position: relative; min-height: 58px; padding: 5px 3px 4px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: none; text-align: left; display: flex; flex-direction: column; gap: 2px; align-items: stretch; min-width: 0;
}
.day:nth-child(7n) { border-right: 0; }
.day.out { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.day.out .num { color: var(--ink-3); }
.day.sel { box-shadow: inset 0 0 0 2px var(--brand); border-radius: 6px; }
.day .num { align-self: center; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 0.84rem; font-weight: 800; }
.day.today .num { background: var(--brand); color: var(--brand-ink); }
.day .dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; padding: 0 2px; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.day .evs { display: none; }
.ev { display: block; padding: 1px 6px; border-radius: 6px; font-size: 0.74rem; font-weight: 700; background: var(--c-soft); color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--c); }
.ev.more { background: none; border-left-color: transparent; color: var(--ink-3); }
@media (min-width: 720px) {
  .day { min-height: 112px; padding: 6px; }
  .day .num { align-self: flex-start; }
  .day .dots { display: none; }
  .day .evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
}
.callayout { display: grid; gap: 16px; }
@media (min-width: 1100px) { .callayout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .callayout .side { position: sticky; top: 96px; } }
.evrow { display: flex; gap: 10px; align-items: stretch; padding: 9px 8px; border-radius: 12px; margin: 0 -8px; cursor: pointer; }
@media (hover: hover) { .evrow:hover { background: var(--surface-2); } }
.evrow .when { width: 84px; flex: none; font-size: 0.82rem; font-weight: 800; color: var(--ink-2); padding-top: 1px; }
.weeklist .daygroup { padding: 12px 0; border-bottom: 1px solid var(--line); }
.weeklist .daygroup:last-child { border-bottom: 0; }
.weeklist .daygroup.today h4 { color: var(--brand-strong); }
.weeklist h4 { font-family: var(--font); font-weight: 800; font-size: 0.92rem; margin-bottom: 4px; }
.calitem { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.calitem .sw { width: 14px; height: 14px; border-radius: 5px; background: var(--c); flex: none; }

/* ---------------------------------------------------------------- meals */
.weeknav { display: flex; align-items: center; gap: 6px; }
.weeknav .label { flex: 1; text-align: center; font-family: var(--display); font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.mealday { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; }
@media (hover: hover) { .mealday:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); } }
.mealday.today { box-shadow: inset 0 0 0 2px var(--brand); border-color: transparent; }
.mealday.past { opacity: 0.6; }
.mealday .d { width: 46px; flex: none; text-align: center; }
.mealday .d b { display: block; font-family: var(--display); font-size: 1.35rem; line-height: 1.05; }
.mealday .d span { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.mealday .emoji { font-size: 1.9rem; width: 40px; text-align: center; flex: none; }
.mealday.none .what { color: var(--ink-3); font-weight: 700; }
.recipegrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.recipe { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; position: relative; }
@media (hover: hover) { .recipe:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); } }
.recipe .emoji { font-size: 2.2rem; line-height: 1.1; }
.recipe h3 { font-size: 1.05rem; }
.recipe .fav { position: absolute; top: 10px; right: 10px; color: var(--brand); }
.ingrow { display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px 34px; gap: 6px; align-items: center; }
.ingrow .input { min-height: 40px; padding: 6px 9px; }
.groc-cat { display: flex; align-items: center; gap: 8px; margin: 16px 0 4px; font-weight: 800; font-size: 0.86rem; color: var(--ink-2); }
.groc { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.groc:last-child { border-bottom: 0; }
.groc .name { font-weight: 700; }
.groc.on .name { text-decoration: line-through; color: var(--ink-3); }
.groc .qty { font-weight: 800; color: var(--ink-2); font-size: 0.9rem; white-space: nowrap; }
.addbar { display: flex; gap: 8px; position: sticky; top: 60px; z-index: 5; padding: 8px 0; margin-top: 4px; background: var(--bg); }
@media (min-width: 900px) { .addbar { top: 92px; } }

/* ------------------------------------------------------------- workouts */
.statgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .statgrid { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.stat .v { font-family: var(--display); font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.stat .v small { font-family: var(--font); font-size: 0.9rem; font-weight: 800; color: var(--ink-3); }
.stat .k { font-size: 0.8rem; font-weight: 800; color: var(--ink-2); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c, var(--brand)) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring > span { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 900; font-size: 0.9rem; }
.wo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); cursor: pointer; }
.wo.done { background: color-mix(in srgb, var(--good) 9%, var(--surface)); }
.wo.skipped { opacity: 0.55; }
.wo .emoji { font-size: 1.7rem; width: 36px; text-align: center; flex: none; }
.dayhead { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 6px; }
.dayhead b { font-family: var(--display); font-size: 1.08rem; }
.dayhead.today b { color: var(--brand-strong); }
.feedback { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 16px; background: var(--surface-2); }
.feedback.cheer { background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.feedback.care { background: color-mix(in srgb, #8466e2 13%, var(--surface)); }
.feedback .e { font-size: 1.5rem; line-height: 1.2; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale button { width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; padding: 0; }
.scale button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.scale.faces button { width: 48px; height: 48px; font-size: 1.6rem; }
.scale.faces button.on { background: color-mix(in srgb, var(--brand) 18%, transparent); color: inherit; }
.chartwrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; font-weight: 700; fill: var(--ink-3); }
.chart text.val { fill: var(--ink); font-weight: 800; }
.chart text.now { fill: var(--ink); font-weight: 800; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { stroke: var(--brand); stroke-width: 2; }
.chart .b { fill: var(--c); transition: opacity 0.12s; }
.chart.hovering .b { opacity: 0.45; }
.chart.hovering .b.hot { opacity: 1; }
.charttip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 8px)); pointer-events: none; white-space: nowrap;
  padding: 7px 11px; border-radius: 11px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); text-align: center;
}
.charttip b { display: block; font-size: 1rem; }
.charttip span { font-size: 0.76rem; font-weight: 700; opacity: 0.85; }
.datatable { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
.datatable th, .datatable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.datatable th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.datatable td.num, .datatable th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------- chores & family */
.chore { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.chore.on { background: color-mix(in srgb, var(--good) 9%, var(--surface)); }
.chore.on .t { text-decoration: line-through; color: var(--ink-3); }
.chore .emoji { font-size: 1.5rem; }
.chore .t { font-weight: 700; }
.partlabel { margin: 16px 0 6px; font-weight: 800; color: var(--ink-2); font-size: 0.88rem; display: flex; gap: 6px; align-items: center; }
.days7 { display: flex; gap: 5px; flex-wrap: wrap; }
.days7 button { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 0.82rem; padding: 0; }
.days7 button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.membercard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border-radius: var(--radius); background: var(--c-soft); text-align: center; }
.membercard .n { font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.goal .big { font-size: 2.6rem; line-height: 1; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.step.on { background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.step .num { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 900; flex: none; }
.section-title { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.section-title h2 { flex: 1; }
.settings-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; border: 0; background: var(--surface-3); flex: none; padding: 0; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(18px); }
.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.82rem; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); overflow-wrap: anywhere; user-select: all; }

/* ----------------------------------------------------------------- chat */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 0.72rem; font-weight: 900; line-height: 1; }
.navlink .badge { margin-left: auto; }
.navicon { position: relative; }
.navicon .badge { position: absolute; top: -4px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; font-size: 0.64rem; }

.main.chatmain { max-width: none; height: 100dvh; padding-bottom: 0; display: flex; flex-direction: column; }
.chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; padding: 20px 0; }
.chatlist { overflow-y: auto; padding: 12px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.chatlist .eyebrow { margin: 14px 8px 4px; }
.chanrow { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; color: inherit; text-decoration: none; font-weight: 600; }
.chanrow .name { font-weight: 700; }
.chanrow.unread .name { font-weight: 900; }
.chanrow.on { background: color-mix(in srgb, var(--brand) 13%, transparent); }
@media (hover: hover) { .chanrow:hover { background: var(--surface-2); text-decoration: none; } }
.chanicon { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--c-soft, var(--surface-2)); font-size: 1.3rem; }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.thread > header { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); min-height: 60px; }
.thread > header h2 { font-size: 1.1rem; }
.thread > header .back { display: none; }
.thread .scroller { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 2px; }
.thread .empty { margin: auto; }

.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.own { flex-direction: row-reverse; }
.msg.head { margin-top: 8px; }
.msg .slot { width: 26px; flex: none; }
.msg.own .slot { display: none; }
.msg .stack { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(80%, 560px); position: relative; }
.msg.own .stack { align-items: flex-end; }
.msg .who { margin: 0 6px 2px; font-size: 0.76rem; font-weight: 800; color: var(--c-ink); }
.msg .who .when { font-weight: 700; color: var(--ink-3); }
.bubble { padding: 8px 13px; border-radius: 18px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.msg:not(.own) .bubble { border-bottom-left-radius: 6px; }
.msg.own .bubble { background: color-mix(in srgb, var(--brand) 17%, var(--surface)); border-bottom-right-radius: 6px; }
.bubble a { font-weight: 700; text-decoration: underline; }
.bubble.jumbo { background: none !important; padding: 0 4px; font-size: 2.7rem; line-height: 1.15; }
.bubble.media { padding: 4px; }
.bubble.media img { display: block; max-width: min(220px, 100%); max-height: 220px; height: auto; border-radius: 15px; background: var(--surface-3); object-fit: cover; }
.bubble .caption { padding: 4px 8px 2px; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 2px 2px; }
.react { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: 0.84rem; font-weight: 800; color: var(--ink-2); }
.react.mine { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--ink); }
.msgactions { display: none; align-items: center; gap: 2px; margin: 3px 0; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.msg.active .msgactions { display: flex; }
.msgactions button, .msgactions a { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 1.15rem; color: var(--ink-2); }
@media (hover: hover) { .msgactions button:hover, .msgactions a:hover { background: var(--surface-2); } }
.daysep, .newsep { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.daysep::before, .daysep::after, .newsep::before, .newsep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.newsep { color: var(--brand-strong); }
.newsep::before, .newsep::after { background: color-mix(in srgb, var(--brand) 45%, transparent); }
.sysmsg { align-self: center; max-width: 90%; margin: 6px 0; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 0.82rem; color: var(--ink-2); text-align: center; }

.composer { position: relative; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea.input { min-height: 44px; max-height: 132px; resize: none; padding: 10px 14px; border-radius: 22px; line-height: 1.35; }
.composer .gifbtn { font-size: 0.74rem; font-weight: 900; letter-spacing: 0.04em; }
.composer .sendbtn { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex: none; }
.pickerpanel { display: flex; flex-direction: column; margin-bottom: 8px; max-height: min(330px, 46dvh); position: relative; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal .pickerpanel { box-shadow: none; max-height: 52dvh; margin: 0; }
.pickertabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.pickertabs button { flex: none; width: 40px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: none; font-size: 1.25rem; }
.pickertabs button.on { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.pickertabs .input { min-height: 38px; }
.pickerbody { flex: 1; overflow-y: auto; padding: 8px 10px 10px; overscroll-behavior: contain; }
.pickerbody .eyebrow { margin: 4px 2px; }
.pickerfoot { padding: 5px 10px; border-top: 1px solid var(--line); font-size: 0.72rem; font-weight: 800; color: var(--ink-3); text-align: right; flex: none; }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; margin-bottom: 6px; }
.emojis button { height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; font-size: 1.45rem; line-height: 1; }
@media (hover: hover) { .emojis button:hover, .pickertabs button:hover { background: var(--surface-2); } }
/* Above the message box the panel has the height the person chose by dragging its top edge. */
.pickerpanel.sized { max-height: 70dvh; min-height: 150px; }
.pickergrip { flex: none; height: 18px; display: flex; align-items: center; justify-content: center; cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.pickergrip span { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.pickergrip:focus-visible span, .pickergrip:active span { background: var(--brand); }
@media (hover: hover) { .pickergrip:hover span { background: var(--ink-3); } }
.pickergrip + .pickertabs { padding-top: 0; }
.gifgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 5px; }
.zoomable { cursor: zoom-in; }
/* Small, even thumbnails: many fit in the panel, and the panel itself can be dragged taller. */
.gifgrid button { display: block; width: 100%; height: 74px; margin: 0; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.gifgrid img { display: block; width: 100%; height: 100%; object-fit: cover; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100vw); display: flex; padding: 12px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(6px); animation: slidein 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.drawer .thread { flex: 1; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }

@media (max-width: 899px) {
  .main.chatmain { height: calc(100dvh - var(--nav-h) - var(--safe-b)); }
  .app.immersive .bottomnav { display: none; }
  .app.immersive .main.chatmain { height: 100dvh; }
  .chat { display: block; height: 100%; padding: 0; margin: 0 -16px; min-height: 0; }
  .chatlist { height: 100%; border: 0; border-radius: 0; box-shadow: none; background: none; padding: 12px 12px 24px; }
  .chat.has-thread .chatlist { display: none; }
  .chat:not(.has-thread) .thread { display: none; }
  .chat .thread { height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .thread > header .back { display: inline-grid; }
  .drawer { width: 100vw; padding: 0; }
  .drawer .thread { border: 0; border-radius: 0; }
  .msg .stack { max-width: 84%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------------ photos */
.kcard .cover { display: block; width: calc(100% + 24px); margin: -10px -12px 2px; height: 110px; object-fit: cover; border-radius: 13px 13px 0 0; background: var(--surface-2); pointer-events: none; }
.photostrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photothumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); padding: 0; cursor: pointer; }
.photothumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photothumb.cover { outline: 2px solid var(--brand); outline-offset: -2px; }
.photothumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-style: dashed; color: var(--ink-2); font-size: 1.4rem; }
.photothumb.add .tiny { font-size: 0.72rem; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(12, 14, 20, 0.94); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.lightbar .iconbtn, .lightnav { color: #fff; background: rgba(255, 255, 255, 0.14); }
.lightnav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightnav.prev { left: 10px; }
.lightnav.next { right: 10px; }
.recipe.pictured { padding-top: 0; overflow: hidden; }
.recipe .pic { width: calc(100% + 28px); margin: 0 -14px 4px; height: 120px; object-fit: cover; display: block; background: var(--surface-2); }
.recipephoto { display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in; background: var(--surface-2); margin-bottom: 12px; }
.recipephoto img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.recipethumb { width: 72px; height: 72px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.dinnerpic { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; flex: none; }
.dinnerpic.lg { width: 64px; height: 64px; border-radius: 16px; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; margin: 0; display: inline-block; }
.block { display: block; }

/* ------------------------------------------------------ connected calendars */
.servicegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.service { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; min-height: 96px; }
.service .logo { font-size: 1.6rem; line-height: 1; }
.service:disabled { opacity: 0.55; cursor: not-allowed; }
@media (hover: hover) { .service:not(:disabled):hover { border-color: var(--brand); } }
.usercode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.9rem; font-weight: 800; letter-spacing: 0.12em; padding: 14px 18px; border-radius: 16px; background: var(--surface-2); text-align: center; user-select: all; }
.calpick { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.calpick:last-child { border-bottom: 0; }
.caldot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; display: inline-block; }
.steps { padding-left: 20px; margin: 6px 0; display: grid; gap: 6px; }
.copyline { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }

/* --------------------------------------------------------------- photobook */
.albumgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.album { display: flex; flex-direction: column; gap: 3px; text-align: left; text-decoration: none; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.album .cover { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 5px; box-shadow: var(--shadow); }
.album .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album .cover .big { font-size: 2.8rem; }
.album.newalbum .cover { border-style: dashed; box-shadow: none; color: var(--ink-3); background: none; }
.album.chatalbum .cover { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
@media (hover: hover) { .album:hover .cover { border-color: var(--brand); } }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; margin-top: 10px; }
.photocell { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.photocell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photocell .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; font-size: 0.74rem; font-weight: 700; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); }
.photocell .kept { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.9); color: #2b2440; }
.albumthumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.albumthumb.empty { display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 1.3rem; }
.list button.item { width: 100%; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.lightcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px calc(14px + env(safe-area-inset-bottom)); color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); pointer-events: none; }
.lightbar .lightbtn { color: #fff; background: rgba(255, 255, 255, 0.16); border: 0; }
.lightbar .menu .iconbtn { color: #fff; background: rgba(255, 255, 255, 0.14); }
.lightbar .menu .pop { color: var(--ink); }
.wide-only { display: none; }
@media (min-width: 700px) { .wide-only { display: inline; } }

/* ------------------------------------------------------------------ fridge */
.c-ink { --c: #2b2440; }
.main.fridgemain { max-width: none; height: 100dvh; padding-bottom: 0; display: flex; flex-direction: column; }
.fridge { position: relative; flex: 1; min-height: 240px; margin-bottom: 12px; }
.fridgeview {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  border-radius: var(--radius); border: 1px solid var(--line);
  /* the kitchen wall behind the fridge */
  background-color: var(--surface-2);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
}
.fridgeview:active { cursor: grabbing; }
.fridgeview.tool-pen { cursor: crosshair; }
.fridgeview.tool-eraser { cursor: cell; }
.tool-pen .fitem, .tool-eraser .fitem { pointer-events: none; }
.door {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 54px;
  background: linear-gradient(155deg, #ffffff 0%, #f5f7f9 45%, #e7ebef 100%);
  border: 3px solid #d3d9df;
  box-shadow: 0 30px 70px -30px rgba(43, 36, 64, 0.45), inset 0 0 0 10px rgba(255, 255, 255, 0.55), inset 0 -40px 80px -40px rgba(120, 130, 145, 0.25);
}
.doorhandle { position: absolute; left: 38px; top: 150px; width: 30px; height: 460px; border-radius: 15px; background: linear-gradient(90deg, #b9c0c9, #f6f8fa 42%, #a4acb7); box-shadow: 6px 8px 14px rgba(60, 70, 85, 0.25); }
.doorhint { position: absolute; left: 50%; top: 42%; width: 760px; transform: translate(-50%, -50%); text-align: center; color: #6b7489; font-size: 34px; line-height: 1.35; pointer-events: none; }
.doorhint .big { font-size: 110px; line-height: 1.1; }
.doorhint .bold { font-size: 46px; color: #2b2440; }
svg.ink { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
svg.ink path { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
svg.ink path.hit { stroke: transparent; pointer-events: stroke; }
.fitem { position: absolute; transform-origin: 50% 14px; cursor: grab; touch-action: none; color: #2b2440; }
.fitem.lifted { cursor: grabbing; filter: drop-shadow(0 22px 20px rgba(43, 36, 64, 0.3)); }
.fitem.sel { outline: 4px dashed var(--brand); outline-offset: 8px; }
.fmagnet {
  position: absolute; top: -12px; left: 50%; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 45%, #fff), var(--c) 58%, color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.32);
}
.fnote {
  padding: 36px 18px 14px; border-radius: 3px 3px 18px 3px;
  background: color-mix(in srgb, var(--c) 32%, #fffdf2);
  box-shadow: 0 10px 18px -6px rgba(43, 36, 64, 0.35), inset 0 -18px 22px -18px rgba(43, 36, 64, 0.12);
}
.fnotetext { display: block; width: 100%; height: 100%; overflow: hidden; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 27px; line-height: 1.22; white-space: pre-wrap; overflow-wrap: anywhere; color: #2b2440; }
.fnotetext.placeholder { color: rgba(43, 36, 64, 0.4); font-style: italic; }
textarea.fnotetext { border: 0; padding: 0; margin: 0; background: transparent; resize: none; outline: none; user-select: text; -webkit-user-select: text; touch-action: auto; cursor: text; }
.fphoto { padding: 14px 14px 48px; background: #fff; border-radius: 3px; box-shadow: 0 10px 20px -6px rgba(43, 36, 64, 0.4); }
.fphoto img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; background: #eef0f3; }
.fcaption { position: absolute; left: 14px; right: 14px; bottom: 9px; text-align: center; font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 600; font-size: 22px; color: #2b2440; }
.fsticker { display: flex; align-items: center; justify-content: center; line-height: 1; filter: drop-shadow(0 5px 5px rgba(43, 36, 64, 0.3)); }
.fsticker.letter span { font-family: 'Nunito', system-ui, sans-serif; font-weight: 900; color: var(--c); text-shadow: 0 3px 0 color-mix(in srgb, var(--c) 62%, #000); }
.fgrip { position: absolute; right: -18px; bottom: -18px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); cursor: nwse-resize; touch-action: none; }
.fridgebar { position: absolute; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); cursor: default; max-width: calc(100% - 16px); }
.fridgebar.tools { left: 50%; bottom: 12px; transform: translateX(-50%); }
.fridgebar.selection, .fridgebar.penbar { left: 50%; bottom: 72px; transform: translateX(-50%); }
.fridgebar.zoom { right: 10px; top: 10px; }
.fridgebar .sep { width: 1px; height: 24px; background: var(--line); flex: none; }
.fridgebar .swatch { width: 28px; height: 28px; flex: none; cursor: pointer; }
.fridgebar .dot { display: block; border-radius: 50%; background: var(--ink); }
.fridgebar .iconbtn.danger { color: var(--bad, #c0392b); }
.fridgebar .btn.sm { border-radius: 999px; }
@media (max-width: 899px) {
  .main.fridgemain { height: calc(100dvh - var(--nav-h) - var(--safe-b)); }
  .fridge { margin-bottom: 8px; }
}
:root[data-theme='dark'] .door { background: linear-gradient(155deg, #565b66 0%, #454954 50%, #383b45 100%); border-color: #2c2f37; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 10px rgba(255, 255, 255, 0.05); }
:root[data-theme='dark'] .doorhandle { background: linear-gradient(90deg, #6d7480, #aab1bb 42%, #5b616c); }
:root[data-theme='dark'] .doorhint { color: #c5cad3; }
:root[data-theme='dark'] .doorhint .bold { color: #fff; }
:root[data-theme='dark'] .c-ink { --c: #f4f0fb; }
:root[data-theme='dark'] .fnote .fnotetext, :root[data-theme='dark'] .fcaption { color: #2b2440; }

.album .cover { position: relative; }
.album .cover .badge { position: absolute; left: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.92); font-size: 1.05rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.fridgepeek { display: flex; gap: 10px; flex-wrap: wrap; }
.peeknote { flex: 1 1 130px; max-width: 220px; min-height: 74px; max-height: 110px; overflow: hidden; padding: 12px 12px 10px; border-radius: 3px 3px 12px 3px; background: color-mix(in srgb, var(--c) 32%, #fffdf2); color: #2b2440; text-decoration: none; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 0.95rem; line-height: 1.25; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 6px 10px -6px rgba(43, 36, 64, 0.35); transform: rotate(-1deg); }
.peeknote:nth-child(2n) { transform: rotate(1.2deg); }

/* ---------------------------------------------------------- own emoticons */
.emoticon { display: inline-block; width: 1.5em; height: 1.5em; object-fit: contain; vertical-align: -0.38em; margin: 0 0.06em; }
.bubble.jumbo .emoticon { width: 72px; height: 72px; vertical-align: middle; }
.react .emoticon { vertical-align: -4px; }
.emojis button .emoticon { margin: 0; vertical-align: middle; }
.emojis .addemoticon { border: 1.5px dashed var(--line); color: var(--ink-3); font-size: 1.1rem; }
.emoticonpick { width: 84px; height: 84px; flex: none; border-radius: 18px; border: 2px dashed var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--ink-3); padding: 6px; cursor: pointer; }
.emoticonpick img { width: 100%; height: 100%; object-fit: contain; }
.emoticongrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.emoticoncard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.emoticoncard .tiny { max-width: 100%; }
.emoticoncard .iconbtn { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; font-size: 0.7rem; }
.fstickerimg { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

/* ------------------------------------------------------------ family goals */
.goalgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.goalcard { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-top: 5px solid var(--c); }
.goalcard.close { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.goalemoji { font-size: 2.3rem; line-height: 1; }
.goaltitle { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.goalcard .chip.c { background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--ink); }
.chip.preset { cursor: pointer; border: 1.5px solid transparent; }
.chip.preset.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.rewards { display: grid; gap: 10px; margin-bottom: 14px; }
.reward { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(120deg, color-mix(in srgb, #e9a21b 26%, var(--surface)), color-mix(in srgb, #ee5f43 16%, var(--surface))); border: 1px solid color-mix(in srgb, #e9a21b 45%, var(--line)); }
.reward .big, .rewardbanner .big { font-size: 2.4rem; line-height: 1; }
.linklike { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.86rem; text-align: left; }
.rewardbanner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px 16px; border-radius: var(--radius); color: var(--ink); text-decoration: none; background: linear-gradient(120deg, color-mix(in srgb, #e9a21b 30%, var(--surface)), color-mix(in srgb, #ee5f43 18%, var(--surface))); border: 1px solid color-mix(in srgb, #e9a21b 45%, var(--line)); animation: pop 0.35s ease-out; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.trophies { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.trophies > .row { justify-content: space-between; }
.shelf { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-bottom: 8px; border-bottom: 6px solid color-mix(in srgb, #b98a4a 55%, var(--line)); border-radius: 0 0 6px 6px; }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 112px; padding: 6px 4px 2px; border: 0; background: none; cursor: pointer; border-radius: 12px; color: inherit; }
.trophy .big { font-size: 2rem; line-height: 1.1; filter: drop-shadow(0 3px 3px rgba(43, 36, 64, 0.22)); }
.trophy .tiny { max-width: 100%; }
.trophy .tiny.bold { white-space: normal; text-align: center; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) { .trophy:hover { background: var(--surface-2); } }
.sysmsg.goalmsg { display: flex; align-items: center; gap: 12px; text-align: left; align-self: center; max-width: 520px; padding: 12px 16px; margin: 8px auto; border-radius: 18px; color: var(--ink); background: linear-gradient(120deg, color-mix(in srgb, #e9a21b 26%, var(--surface)), color-mix(in srgb, #ee5f43 14%, var(--surface))); border: 1px solid color-mix(in srgb, #e9a21b 45%, var(--line)); }
.sysmsg.goalmsg .big { font-size: 2.2rem; line-height: 1; }
