/* Тёмная тема под iPhone: системный шрифт, сгруппированные карточки, тёплый акцент. У каждого из двоих свой цвет (--c). */
:root {
  --bg: #000; --bg2: #1c1c1e; --bg3: #2c2c2e; --line: rgba(84, 84, 88, .5);
  --fg: #fff; --fg2: #8e8e93; --fg3: #636366;
  --acc: #ffb454; --acc-fg: #1a1000; --ok: #30d158; --bad: #ff453a;
  --r: 14px; --nav-h: 54px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --round: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; font: 16px/1.4 var(--font); color: var(--fg); background: var(--bg); min-height: 100dvh; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, textarea { width: 100%; background: var(--bg3); border: 0; border-radius: 10px; padding: 11px 12px; font-size: 16px; outline: none; }
input:focus, textarea:focus { box-shadow: 0 0 0 2px var(--acc); }
textarea { resize: vertical; }
input[type=date], input[type=time] { min-height: 44px; -webkit-appearance: none; appearance: none; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg2); font-weight: 600; margin: 22px 4px 8px; }
.muted { color: var(--fg2); } .small { font-size: 13px; } .center { text-align: center; } .pad { padding: 14px 16px; margin: 0; }
.bad { color: var(--bad); }

header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 18px 8px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.ht { font-size: 30px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--fg3); }
.sync.ok { background: var(--ok); } .sync.off { background: #ff9f0a; } .sync.gone { background: var(--bad); }
.gear { background: none; border: 0; padding: 6px; line-height: 0; color: var(--fg2); }
.gear svg { width: 24px; height: 24px; fill: currentColor; }
body.bare header, body.bare nav { display: none; }
body.bare main { padding-top: calc(20px + env(safe-area-inset-top)); }
body.bare { padding-bottom: 24px; }
main { padding: 4px 16px 20px; max-width: 560px; margin: 0 auto; }

nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line); }
nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--fg3); text-decoration: none; font-size: 10.5px; font-weight: 500; }
nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav a.on { color: var(--acc); }

.card { background: var(--bg2); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; }
.card.empty { color: var(--fg2); text-align: center; }
.list-card { padding: 0; overflow: hidden; }
.row { display: flex; gap: 10px; align-items: center; } .row.between { justify-content: space-between; margin: 6px 4px; }
.grow { flex: 1; min-width: 0; } .col { display: flex; flex-direction: column; } .gap { gap: 12px; }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; background: var(--bg3); font-weight: 600; font-size: 16px; min-height: 46px; }
.btn.primary { background: var(--acc); color: var(--acc-fg); }
.btn.bad { background: rgba(255, 69, 58, .14); color: var(--bad); }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.big { font-size: 22px; padding: 22px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--bg2)); }
.btn:disabled { opacity: .5; }
.btn:active, .check:active, .pill:active, .chip:active { transform: scale(.97); }
.link { background: none; border: 0; color: var(--acc); padding: 6px 0; font-size: 14px; font-weight: 500; }
.link.bad { color: var(--bad); }

.who { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--c); white-space: nowrap; }
.who::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; background: rgba(118, 118, 128, .24); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 8px 6px; font-size: 14px; font-weight: 500; min-height: 36px; color: var(--fg); white-space: nowrap; }
.seg button.on { background: #636366; font-weight: 600; }
.seg.col { flex-direction: column; } .seg.col button { text-align: left; padding: 10px 12px; }
.seg.days button { padding: 8px 0; min-width: 0; }
.seg.days button.on { background: var(--acc); color: var(--acc-fg); }
.filt { margin: 4px 0 8px; } .filt .seg { flex: 1; }

/* неделя */
.weeknav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.weeknav > button { background: var(--bg2); border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--fg); }
.weeknav div { display: flex; flex-direction: column; align-items: center; } .weeknav b { font-size: 17px; }
.weeknav .link { padding: 2px 0; font-size: 13px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.st { background: var(--bg2); border-radius: var(--r); padding: 12px 14px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.st span { font-size: 13px; color: var(--c); font-weight: 600; } .st b { font: 700 22px/1.2 var(--round); }
.st i { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--c); }
.day { background: var(--bg2); border-radius: var(--r); padding: 6px 14px 10px; margin: 10px 0; }
.day.today { box-shadow: 0 0 0 1.5px var(--acc); }
.day.past { opacity: .62; }
.day-h { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 4px; }
.day-h b { font-size: 16px; } .day-h span { color: var(--fg2); font-size: 14px; }
.day-h em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--acc-fg); background: var(--acc); padding: 2px 8px; border-radius: 20px; }
.chore { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: .5px solid var(--line); }
.chore:first-of-type { border-top: 0; }
.check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--fg3); background: none; color: #000; font-weight: 800; font-size: 15px; display: grid; place-items: center; padding: 0; }
.done .check, .shop.done .check { background: var(--ok); border-color: var(--ok); }
.ch-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-t small { color: var(--fg2); font-size: 12px; }
.done .ch-t span { text-decoration: line-through; color: var(--fg2); }
.chore.late .ch-t span { color: var(--bad); }
.pill { border: 0; background: var(--bg3); border-radius: 20px; padding: 6px 11px; min-height: 32px; }
.ev { display: block; font-size: 14px; padding: 6px 0 2px; color: var(--fg); text-decoration: none; }
.ev.rem { color: #ffd60a; } .ev.late { color: var(--bad); } .ev.food { color: var(--fg2); }
.ev .who { margin-left: 4px; }

/* списки в листах */
.li, .pay, .ev-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; border-top: .5px solid var(--line); }
.li:first-child { border-top: 0; }
.li div, .pay div, .ev-main { display: flex; flex-direction: column; min-width: 0; }
.ev-main { align-items: flex-start; text-align: left; }
.li small, .pay small, .ev-main small { color: var(--fg2); font-size: 13px; }
.nx { display: flex; flex-direction: column; align-items: flex-end; } .nx small { color: var(--fg2); font-size: 12px; }
.pay { padding: 12px 16px; } .pay:first-child { border-top: 0; }
.pay > span { font: 600 17px var(--round); white-space: nowrap; }

/* покупки */
.add { display: flex; gap: 8px; margin: 4px 0 8px; } .add .btn { width: 50px; font-size: 24px; padding: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--bg3); border-radius: 20px; padding: 7px 12px; font-size: 14px; }
.shop { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-top: .5px solid var(--line); }
.shop:first-child { border-top: 0; }
.sh-t { flex: 1; min-width: 0; } .sh-t small { color: var(--fg2); font-size: 12px; }
.shop.done .sh-t { text-decoration: line-through; color: var(--fg2); }
.x { background: none; border: 0; color: var(--fg3); font-size: 15px; padding: 6px; min-width: 32px; min-height: 32px; }

/* деньги */
.bal { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; }
.bal b { font: 700 34px/1.1 var(--round); }
.bal .btn { margin-top: 4px; }

/* меню */
.meal { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-top: .5px solid var(--line); padding: 10px 0; text-align: left; }
.meal small { width: 44px; color: var(--fg2); font-size: 13px; flex: none; }
.meal span { flex: 1; min-width: 0; } .meal.empty span { color: var(--fg3); }

/* календарь */
.evrow { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-top: .5px solid var(--line); }
.evrow:first-child { border-top: 0; }
.evrow .ev-main { flex: 1; border: 0; }
.when { font-size: 13px; color: var(--fg2); white-space: nowrap; }
.evrow.now .when { color: var(--acc); font-weight: 600; } .evrow.late .when, .evrow.late b { color: var(--bad); }

/* листы */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 20; animation: fade .18s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: #1c1c1e; border-radius: 16px 16px 0 0; max-height: 90dvh; overflow-y: auto;
  padding: 0 18px calc(18px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2, .8, .2, 1); max-width: 560px; margin: 0 auto; overscroll-behavior: contain; }
.sheet.out { transform: translateY(100%); transition: transform .18s; } .sheet-back.out { opacity: 0; transition: opacity .18s; }
.grip { width: 38px; height: 5px; border-radius: 3px; background: var(--fg3); margin: 8px auto 4px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #1c1c1e; padding: 6px 0 8px; z-index: 1; }
.sheet-h b { font-size: 19px; }
.sheet .muted { font-size: 14px; }
.ask-msg { font-size: 17px; margin: 14px 0 18px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.fld > span { font-size: 13px; color: var(--fg2); font-weight: 500; }
.colors { display: flex; gap: 10px; margin: -4px 0 8px; }
.colors button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); padding: 0; }
.colors button.on { box-shadow: 0 0 0 2px #1c1c1e, 0 0 0 4px var(--c); }
.code { font: 700 32px var(--round); letter-spacing: .12em; text-align: center; padding: 16px; background: var(--bg3); border-radius: 12px; margin: 12px 0; user-select: all; -webkit-user-select: all; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); transform: translateX(-50%); z-index: 40;
  background: #3a3a3c; padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: 90vw; text-align: center; transition: opacity .3s; }
.toast.out { opacity: 0; }

/* первый вход */
.hello { padding-top: 16px; text-align: center; }
.hello h1 { margin: 6px 0; font-size: 32px; }
.logo-big { width: 84px; height: 84px; border-radius: 20px; }
.form { text-align: left; } .form b { font-size: 17px; }
.hello .btn.big { width: 100%; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.card.wide-card { display: block; width: 100%; border: 0; font-size: 16px; color: var(--acc); }
.cats { display: flex; flex-direction: column; gap: 10px; }
.cat { display: flex; justify-content: space-between; position: relative; padding-bottom: 6px; font-size: 15px; }
.cat b { font: 600 15px var(--round); }
.cat i { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; width: calc(var(--p, 0) * 100%); background: var(--acc); }
.cats-seg button { flex: 1 1 30%; }
nav a { font-size: 10px; letter-spacing: -.01em; }
.nowl { display: flex; gap: 10px; align-items: baseline; background: var(--bg2); border-radius: var(--r); padding: 11px 14px; margin: 8px 0; text-decoration: none; color: var(--fg); font-size: 14px; border-left: 3px solid var(--c); }
.nowl .who { flex: none; }
.ev.sch { color: var(--fg2); font-size: 13.5px; }
.slot { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-top: .5px solid var(--line); padding: 10px 0; }
.slot:first-of-type { border-top: 0; }
.slot .tm { font: 600 14px var(--round); color: var(--fg2); width: 92px; flex: none; }
.slot .grow { display: flex; flex-direction: column; } .slot small { color: var(--fg2); font-size: 13px; }
