/* Palette, type, radii and shadows come from the journal app (../journal/replica/design/tokens.json). */
@font-face { font-family: Rubik; src: url(fonts/rubik-hebrew.woff2) format('woff2'); font-weight: 300 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Rubik; src: url(fonts/rubik-latin.woff2) format('woff2'); font-weight: 300 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  color-scheme: light;
  --bg: #f4f2ee; --surface: #fff; --sunken: #ebe8e2; --border: #e6e2db; --border-input: #857f75;
  --text: #1c1a17; --muted: #5c574f; --accent: #2d6a64; --on-accent: #fff; --accent-soft: #e1efed;
  --danger: #b42318; --danger-soft: #fdecea; --success: #1f7a4d; --success-soft: #e3f4ea; --warning: #8a5a00; --warning-soft: #fcefd3;
  --bar: rgb(255 255 255 / .86); --lift: 0%;
  --teal-a: #245a54; --teal-b: #33786e; --blue-a: #1f5f99; --blue-b: #2f74ab;
  --card: 0 .5px 0 rgb(28 26 23 / .04), 0 2px 8px rgb(28 26 23 / .05);
  --raised: 0 2px 6px rgb(28 26 23 / .12), 0 8px 24px rgb(28 26 23 / .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-s: max(16px, env(safe-area-inset-right)); --side-e: max(16px, env(safe-area-inset-left));
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121110; --surface: #1d1b19; --sunken: #0d0c0b; --border: #34302b; --border-input: #8a8377;
    --text: #f2efea; --muted: #b2aba0; --accent: #7fc8bf; --on-accent: #0c2321; --accent-soft: #1e3633;
    --danger: #ff8a80; --danger-soft: #3a1a17; --success: #6fd3a0; --success-soft: #13301f; --warning: #f2c46d; --warning-soft: #3a2c10;
    --bar: rgb(29 27 25 / .88); --lift: 45%;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 Rubik, system-ui, sans-serif; overflow-x: hidden; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
h1 { font-size: 34px; line-height: 42px; font-weight: 600; }
h2 { font-size: 22px; line-height: 30px; font-weight: 600; }
h3 { font-size: 18px; line-height: 25px; font-weight: 600; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: var(--accent); }
svg.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#view:focus { outline: none; }
button:active, .press:active { transform: scale(.97); }
button, .press { transition: transform .12s var(--ease), background-color .12s; }

#view { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) var(--side-s) calc(env(safe-area-inset-bottom) + 120px) var(--side-e); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-height: 100dvh; }
.top { display: flex; align-items: center; gap: 4px; min-height: 52px; }
.top h1 { flex: 1; min-width: 0; }
.top h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 18px; }
.icon-btn:active { background: var(--sunken); }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 10px; border-radius: 99px; font-size: 13px; color: var(--muted); background: var(--surface); box-shadow: var(--card); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.section { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.tiny { font-size: 13px; line-height: 18px; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* Horizontal rows bleed to the screen edge */
.scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--side-s) * -1) calc(var(--side-e) * -1); padding: 2px var(--side-e) 2px var(--side-s); padding-inline: var(--side-s) var(--side-e); overscroll-behavior-x: contain; }
.scroll::-webkit-scrollbar { display: none; }

.avatar { --s: 32px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--m); color: #fff; font-size: calc(var(--s) * .44); font-weight: 600; line-height: 1; }
.avatar.xs { --s: 22px; } .avatar.lg { --s: 48px; }
.scroll:has(.person) { gap: 2px; }
.person { flex: 1 0 56px; min-width: 0; display: grid; justify-items: center; gap: 4px; text-align: center; align-content: start; }
.person .wrap { position: relative; }
.person .mark { position: absolute; inset-block-end: -3px; inset-inline-end: -5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); font-size: 11px; box-shadow: 0 0 0 2px var(--bg); }
.person.arrived .mark { background: var(--success-soft); color: var(--success); }
.person.old .mark, .person.old .state { opacity: .72; }
.person b { max-width: 100%; overflow-wrap: anywhere; font-weight: 500; font-size: 14px; line-height: 18px; }
.person .state { font-size: 12px; line-height: 15px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 8px 16px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-weight: 500; font-size: 15px; white-space: nowrap; flex: none; }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip.solid { background: var(--accent); color: var(--on-accent); box-shadow: none; }

.card { background: var(--surface); border-radius: 20px; box-shadow: var(--card); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rows { padding: 0; gap: 0; overflow: hidden; }
.rows > * { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 60px; width: 100%; text-align: start; border-top: .5px solid var(--border); }
.rows > *:first-child { border-top: 0; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line > svg { font-size: 13px; }

.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 20px; min-height: 150px; color: #fff; background: linear-gradient(225deg, var(--teal-b), var(--teal-a)); box-shadow: var(--card); display: flex; flex-direction: column; gap: 4px; text-align: start; width: 100%; text-decoration: none; }
.hero.blue { background: linear-gradient(225deg, var(--blue-b), var(--blue-a)); }
.hero > svg.art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero > :not(.art) { position: relative; }
.hero .label { font-size: 14px; font-weight: 500; }
.hero .big { font-size: 30px; line-height: 38px; font-weight: 600; margin-top: auto; overflow-wrap: anywhere; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.hero .facts span { display: inline-flex; align-items: center; gap: 6px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 99px; background: var(--sunken); }
.seg button { min-height: 44px; border-radius: 99px; font-size: 15px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: var(--card); }

/* Calendar */
.cal { padding: 8px 8px 12px; gap: 4px; }
.cal-head { display: flex; align-items: center; }
.cal-head h2 { flex: 1; text-align: center; font-size: 19px; }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.grid7 .wd { font-size: 12px; color: var(--muted); padding: 4px 0; }
.day { min-height: 50px; display: grid; justify-items: center; align-content: start; gap: 3px; padding-top: 3px; border-radius: 12px; }
.day b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-weight: 400; font-variant-numeric: tabular-nums; }
.day.out { color: var(--muted); }
.day.today b { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 600; }
.day[aria-pressed="true"] b { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--m), white var(--lift)); }

/* Events */
.ev-head { display: flex; gap: 12px; align-items: flex-start; }
.tile { width: 52px; flex: none; border-radius: 14px; padding: 6px 0; text-align: center; background: var(--m); color: #fff; line-height: 1.15; }
.tile b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; }
.ev-head .icon-btn { margin: -10px; margin-inline-start: 0; }
.rsvp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsvp button { min-height: 48px; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); font-size: 15px; font-weight: 500; }
.rsvp .num { font-weight: 400; color: var(--muted); }
.rsvp [aria-pressed="true"].yes { background: var(--success-soft); color: var(--success); box-shadow: inset 0 0 0 1.5px; }
.rsvp [aria-pressed="true"].no { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1.5px; }
.rsvp [aria-pressed="true"].maybe { background: var(--warning-soft); color: var(--warning); box-shadow: inset 0 0 0 1.5px; }
.rsvp [aria-pressed="true"] .num { color: inherit; }
.who { display: grid; gap: 8px; font-size: 14px; line-height: 20px; }
.who li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; }
.who .names { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.who .names > span { display: inline-flex; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px; border-radius: 99px; font-weight: 500; font-size: 15px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); font-size: 16px; min-height: 54px; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.plain { background: none; padding-inline: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; }
.check { width: 48px; height: 48px; margin: -8px; display: grid; place-items: center; flex: none; }
.check i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--border-input); color: transparent; font-size: 13px; }
.check[aria-checked="true"] i { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.done .grow > span:first-child { text-decoration: line-through; color: var(--muted); }
.progress { height: 6px; border-radius: 9px; background: var(--sunken); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.kind { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.empty { text-align: center; justify-items: center; padding: 32px 20px; }
.empty .kind { width: 64px; height: 64px; border-radius: 50%; font-size: 22px; }

/* Album */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.folder { background: var(--surface); border-radius: 20px; padding: 8px; box-shadow: var(--card); display: grid; gap: 8px; text-align: start; align-content: start; }
.folder .grow { padding: 0 6px 6px; }
.folder h3 { font-size: 16px; line-height: 22px; }
.photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--sunken); border-radius: 12px; }
.cover { aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.cover .photo { height: 100%; border-radius: 0; aspect-ratio: auto; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.photos button { position: relative; }
.photos .wait { position: absolute; inset-block-end: 6px; inset-inline-end: 6px; background: rgb(0 0 0 / .62); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-size: 12px; }
.moment .photo { aspect-ratio: 4/3; }
.react { display: flex; flex-wrap: wrap; gap: 6px; }
.react button { min-width: 52px; min-height: 48px; padding: 0 10px; border-radius: 99px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); font-size: 18px; }
.react button span { font-size: 14px; margin-inline-start: 4px; }
.react [aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.full { width: 100%; max-height: 62dvh; object-fit: contain; border-radius: 12px; background: var(--sunken); min-height: 160px; }
.secret { display: flex; align-items: center; gap: 4px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
dl { margin: 0; }

/* Bottom navigation */
#tabs { position: fixed; inset: auto 0 0; z-index: 5; padding: 6px var(--side-s) calc(env(safe-area-inset-bottom) + 6px) var(--side-e); background: var(--bar); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: .5px solid var(--border); }
#tabs > div { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: center; }
#tabs a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 52px; font-size: 12px; line-height: 16px; color: var(--muted); text-decoration: none; border-radius: 14px; }
#tabs a svg { font-size: 18px; }
#tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }
#fab { width: 64px; height: 64px; margin: -26px auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 22px; box-shadow: var(--raised); }

/* Sheets */
dialog { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh; border-radius: 28px 28px 0 0; background: var(--bg); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / .42); }
dialog[open] { animation: up .28s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 8px var(--side-s) calc(env(safe-area-inset-bottom) + 20px) var(--side-e); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; background: var(--bg); padding-top: 4px; margin-inline: -8px; }
.sheet-head h2 { flex: 1; font-size: 19px; padding-inline-start: 8px; min-width: 0; overflow-wrap: anywhere; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 14px; color: var(--muted); padding: 0; }
.field legend { margin-bottom: 6px; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select { width: 100%; min-width: 0; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-input); background: var(--surface); font-size: 16px; -webkit-appearance: none; appearance: none; text-align: start; }
.field input[type=color] { padding: 6px; }
.field input.ltr { text-align: left; }
.field textarea { min-height: 84px; resize: vertical; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { position: relative; }
.choices input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.choices input:checked + .chip { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.choices input:focus-visible + .chip, .switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch { position: relative; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; }
.switch i { width: 54px; height: 32px; border-radius: 99px; background: var(--border-input); flex: none; position: relative; transition: background .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s var(--ease); }
.switch input:checked + i { background: var(--success); }
.switch input:checked + i::after { inset-inline-start: 25px; }
.error { color: var(--danger); font-size: 14px; }
.code { font: 600 22px/1.4 ui-monospace, Consolas, monospace; letter-spacing: 1px; text-align: center; padding: 16px 8px; background: var(--surface); border-radius: 14px; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }

#toast { position: fixed; inset: auto 16px auto 16px; width: auto; height: auto; overflow: visible; color: inherit; bottom: calc(env(safe-area-inset-bottom) + 104px); z-index: 20; max-width: 520px; margin: 0 auto; display: grid; gap: 8px; pointer-events: none; border: 0; padding: 0; background: none; }
#toast > div { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px; border-radius: 18px; background: var(--text); color: var(--bg); box-shadow: var(--raised); font-size: 15px; }
#toast button { min-height: 44px; padding: 0 8px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; flex: none; color: inherit; }

#view.login { align-content: center; gap: 20px; padding-bottom: 40px; }
.login .mark { width: 88px; height: 88px; border-radius: 24px; box-shadow: var(--raised); }
.swatch { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--m); color: transparent; font-size: 18px; }
.choices input:checked + .swatch { color: #fff; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.choices input:focus-visible + .swatch { outline: 2px solid var(--accent); outline-offset: 7px; }
.swatches { display: grid; grid-template-columns: repeat(5, 48px); gap: 14px; justify-content: space-between; padding: 5px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } button:active, .press:active { transform: none; } }
