/* ============================================================
   «Щас!» — дизайн «Семейный ежедневник»
   Бумага в точку · чернильный контур · карточки-стикеры · риз-цвета
   ============================================================ */
:root {
  --paper: #F6F0E4;
  --paper-dot: rgba(40, 32, 20, .085);
  --card: #FFFCF5;
  --card-2: #F1EADB;
  --ink: #1E1A15;
  --ink-2: #5F574A;
  --ink-3: #9C9282;
  --edge: #1E1A15;
  --edge-w: 1.5px;
  --lift: 3px;
  --shadow: var(--lift) var(--lift) 0 var(--edge);

  --tomato: #FF5A36;
  --cobalt: #3150F5;
  --sun: #FFC229;
  --mint: #16BE93;
  --plum: #8E5CF2;
  --rose: #FF77AE;
  --sky: #2FB2F1;
  --olive: #97A72A;

  --primary: var(--tomato);
  --on-primary: #FFFFFF;
  --gold: var(--sun);
  --gold-soft: #FFEDB8;
  --danger: #E8402A;
  --danger-soft: #FFD9CF;
  --ok: #109E79;
  --ok-soft: #CDF2E5;
  --accent-soft: #DCE3FF;

  --radius: 18px;
  --radius-sm: 12px;
  --dock-h: 66px;
  --serif: "New York", ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120E;
    --paper-dot: rgba(255, 240, 210, .06);
    --card: #1F1B15;
    --card-2: #2A251D;
    --ink: #F4ECDB;
    --ink-2: #C3B8A3;
    --ink-3: #847B6C;
    --edge: #F4ECDB;
    --edge-w: 1.25px;
    --shadow: var(--lift) var(--lift) 0 rgba(0, 0, 0, .75);
    --gold-soft: #3B3015;
    --danger-soft: #45201A;
    --ok-soft: #13372C;
    --accent-soft: #1E2547;
    --danger: #FF6A50;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.1px, transparent 1.4px);
  background-size: 20px 20px;
  background-attachment: fixed;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
a { color: var(--ink); }
::selection { background: var(--sun); color: #1E1A15; }

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(var(--dock-h) + env(safe-area-inset-bottom) + 34px);
}
#app.no-tabbar { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }

/* ---------- типографика ---------- */
.serif { font-family: var(--serif); }
h1, .h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
h2.section {
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  margin: 26px 2px 10px; display: flex; align-items: center; gap: 10px;
}
h2.section::after { content: ""; flex: 1; border-top: 1.5px dashed var(--ink-3); opacity: .6; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }

/* ---------- верхняя строка ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }
.topbar h1 { font-size: 30px; margin: 0; flex: 1; line-height: 1.1; }
.topbar .sub { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; border: var(--edge-w) solid var(--edge); background: var(--card);
  box-shadow: var(--shadow); font-size: 18px; cursor: pointer; flex: none; position: relative;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
  transition: transform .08s, box-shadow .08s;
}
.icon-btn:active { transform: translate(var(--lift), var(--lift)); box-shadow: none; }
.icon-btn .badge {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: var(--tomato); color: #fff; font-size: 11.5px; line-height: 17px; font-weight: 800;
  border: var(--edge-w) solid var(--edge);
}
.pill-btn {
  border: var(--edge-w) solid var(--edge); border-radius: 999px; padding: 7px 14px; background: var(--card);
  font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.pill-btn:active { background: var(--card-2); }

/* ---------- стикеры (карточки) ---------- */
.card {
  background: var(--card); border: var(--edge-w) solid var(--edge); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px;
}
.card.flat { box-shadow: none; }
.card.danger { background: var(--danger-soft); }
.card.gold { background: var(--gold-soft); }
.card.accent { background: var(--accent-soft); }
.card.ok { background: var(--ok-soft); }
.card .title { font-weight: 750; }
.sticker {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; font-weight: 800;
  font-size: 13.5px; border: var(--edge-w) solid var(--edge); box-shadow: 2px 2px 0 var(--edge); background: var(--sun);
  color: #1E1A15; transform: rotate(-1.5deg);
}
.sticker.tomato { background: var(--tomato); color: #fff; transform: rotate(1.2deg); }
.sticker.mint { background: var(--mint); color: #fff; }
.sticker.plain { background: var(--card); color: var(--ink); transform: none; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  border: var(--edge-w) solid var(--edge); border-radius: 14px; padding: 12px 18px; font-weight: 800; font-size: 16px;
  background: var(--primary); color: var(--on-primary); cursor: pointer; min-height: 50px; box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, opacity .15s;
}
.btn:active { transform: translate(var(--lift), var(--lift)); box-shadow: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.soft { background: var(--card-2); color: var(--ink); }
.btn.accent { background: var(--mint); color: #fff; }
.btn.cobalt { background: var(--cobalt); color: #fff; }
.btn.sun { background: var(--sun); color: #1E1A15; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 12px; min-height: 38px; font-size: 14px; border-radius: 11px; box-shadow: 2px 2px 0 var(--edge); }
.btn.small:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ---------- формы ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--ink-2); margin: 0 2px 6px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; }
.input, select.input, textarea.input {
  width: 100%; border: var(--edge-w) solid var(--edge); background: var(--card); border-radius: 13px;
  padding: 12px 14px; outline: none; min-height: 50px; -webkit-appearance: none; appearance: none;
}
.input:focus { box-shadow: 0 0 0 3px var(--sun); }
input[type="time"].input, input[type="date"].input { font-variant-numeric: tabular-nums; font-weight: 700; }
textarea.input { resize: vertical; min-height: 88px; }
.time-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.seg { display: flex; background: var(--card-2); border: var(--edge-w) solid var(--edge); border-radius: 15px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 11px; padding: 9px 6px; font-weight: 800;
  font-size: 14px; cursor: pointer; color: var(--ink-2);
}
.seg button.on { background: var(--ink); color: var(--paper); }
.days-mask { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days-mask button {
  border: var(--edge-w) solid var(--edge); border-radius: 11px; padding: 10px 0; font-weight: 800; background: var(--card);
  color: var(--ink-2); cursor: pointer;
}
.days-mask button.on { background: var(--ink); color: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: var(--edge-w) solid var(--edge); border-radius: 999px; padding: 7px 14px; background: var(--card);
  font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--ink); color: var(--paper); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: var(--edge-w) solid var(--edge); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { font-size: 24px; border: var(--edge-w) solid transparent; background: var(--card-2); border-radius: 12px; padding: 6px 0; cursor: pointer; }
.emoji-grid button.on { border-color: var(--edge); background: var(--sun); }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { display: none; }
.toggle .knob {
  width: 52px; height: 32px; border-radius: 999px; background: var(--card-2); position: relative; flex: none;
  border: var(--edge-w) solid var(--edge); transition: background .2s;
}
.toggle .knob::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%;
  background: var(--card); border: var(--edge-w) solid var(--edge); transition: left .2s;
}
.toggle input:checked + .knob { background: var(--mint); }
.toggle input:checked + .knob::after { left: 22px; }
details summary { cursor: pointer; }

/* ---------- люди ---------- */
.ava {
  width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; flex: none; background: var(--c, var(--card-2)); border: var(--edge-w) solid var(--edge);
}
.ava.sm { width: 28px; height: 28px; font-size: 15px; border-radius: 9px; }
.ava.lg { width: 52px; height: 52px; font-size: 28px; border-radius: 16px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px;
  font-weight: 800; background: var(--card-2); white-space: nowrap; border: 1px solid transparent;
}
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: currentColor; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: currentColor; }
.tag.gold { background: var(--gold-soft); color: #8A5A00; border-color: #C99000; }
@media (prefers-color-scheme: dark) { .tag.gold { color: var(--sun); border-color: var(--sun); } }
.shift-pill {
  display: inline-flex; align-items: center; border-radius: 9px; padding: 4px 10px; font-weight: 850; font-size: 14px;
  color: var(--on, #fff); background: var(--c, var(--cobalt)); white-space: nowrap; border: var(--edge-w) solid var(--edge);
  font-variant-numeric: tabular-nums;
}
.shift-pill.off { background: var(--card-2); color: var(--ink-2); }
.shift-pill.none { background: transparent; border-style: dashed; color: var(--ink-3); }

/* ---------- «Сегодня»: крупная дата ---------- */
.dayhero { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 14px; margin: 4px 0 6px; }
.dayhero .num { font-family: var(--serif); font-weight: 700; font-size: 84px; line-height: .82; letter-spacing: -.04em; }
.dayhero .meta { padding-bottom: 6px; min-width: 0; }
.dayhero .wd { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.1; }
.dayhero .mo { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.dayhero .nav { display: flex; gap: 8px; padding-bottom: 6px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.who-strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; }
.who-strip::-webkit-scrollbar { display: none; }
.who-card {
  flex: none; display: flex; align-items: center; gap: 10px; background: var(--card); border: var(--edge-w) solid var(--edge);
  border-radius: 16px; padding: 8px 12px 8px 8px; box-shadow: var(--shadow); cursor: pointer; min-width: 150px;
}
.who-card:active { transform: translate(var(--lift), var(--lift)); box-shadow: none; }
.who-card .nm { font-weight: 800; font-size: 14px; }
.who-card .st { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* ---------- лента дня (поручения) ---------- */
.leg { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; position: relative; }
.leg + .leg { border-top: 1.5px dashed var(--card-2); }
.leg .time { font-weight: 850; font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.leg .time small { display: block; font-weight: 600; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.leg .who {
  display: inline-flex; align-items: center; gap: 6px; border: var(--edge-w) solid var(--edge); background: var(--card);
  border-radius: 999px; padding: 3px 11px 3px 3px; cursor: pointer; font-weight: 800; font-size: 13.5px;
  box-shadow: 2px 2px 0 var(--edge);
}
.leg .who:active { transform: translate(2px, 2px); box-shadow: none; }
.leg .who .ava { border-radius: 50%; }
.leg .who.conflict { background: var(--tomato); color: #fff; padding: 7px 13px; }
.leg .who.unknown { background: var(--gold-soft); border-style: dashed; }
.leg .what { font-size: 14px; }
.fix-card { display: flex; gap: 10px; align-items: center; padding: 10px 0; flex-wrap: wrap; }
.fix-card + .fix-card { border-top: 1.5px dashed color-mix(in srgb, var(--edge) 25%, transparent); }

/* ---------- неделя ---------- */
.week-wrap { overflow-x: auto; margin: 0 -16px; padding: 8px 16px 8px; -webkit-overflow-scrolling: touch; }
.week { display: grid; grid-template-columns: 40px repeat(7, minmax(0, 1fr)); gap: 4px; min-width: 300px; }
@media (min-width: 480px) { .week { grid-template-columns: 60px repeat(7, minmax(0, 1fr)); gap: 6px; } .week .cell .bar { font-size: 11px; letter-spacing: -.02em; } }
.week .hd {
  text-align: center; padding: 6px 0 5px; border-radius: 12px; cursor: pointer; font-size: 10.5px; color: var(--ink-2);
  font-weight: 800; position: relative; letter-spacing: .06em; text-transform: uppercase; border: var(--edge-w) solid transparent;
}
.week .hd b { display: block; font-family: var(--serif); font-size: 21px; color: var(--ink); letter-spacing: 0; text-transform: none; line-height: 1.1; }
.week .hd.today { background: var(--ink); color: var(--paper); }
.week .hd.today b { color: var(--paper); }
.week .hd.together { background: var(--sun); color: #1E1A15; border-color: var(--edge); }
.week .hd.together b { color: #1E1A15; }
.week .hd.today.together { box-shadow: inset 0 -5px 0 var(--sun); background: var(--ink); color: var(--paper); }
.week .hd.today.together b { color: var(--paper); }
.week .hd .dot {
  position: absolute; top: -7px; right: -4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--tomato);
  color: #fff; font-size: 10px; line-height: 14px; padding: 0 4px; border: var(--edge-w) solid var(--edge); letter-spacing: 0;
}
.week .name { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px;
  font-weight: 800; color: var(--ink-2); text-align: center; overflow: hidden; white-space: nowrap; max-width: 100%; }
.week .name .e { font-size: 20px; line-height: 1.1; }
.week .cell {
  min-height: 54px; border-radius: 11px; background: var(--card); padding: 4px 2px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--edge) 22%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 800; text-align: center;
}
.week .cell.col-together { background: color-mix(in srgb, var(--sun) 22%, var(--card)); }
.week .cell .bar {
  width: 100%; border-radius: 7px; padding: 4px 0; color: var(--on, #fff); background: var(--c, var(--cobalt));
  font-size: 9.5px; line-height: 1.1; overflow: hidden; white-space: nowrap; letter-spacing: -.045em;
  border: 1px solid color-mix(in srgb, var(--edge) 35%, transparent);
}
.week .cell .off { color: var(--ink-3); font-weight: 700; font-size: 10.5px; }
.week .cell .nod { color: var(--ink-3); opacity: .5; font-size: 16px; line-height: 1; }
.week .cell .dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.week .cell .d { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink-3)); border: 1px solid color-mix(in srgb, var(--edge) 40%, transparent); }
.week .cell .d.x { width: 15px; height: 15px; border-radius: 5px; background: var(--tomato); color: #fff; font-size: 11px; line-height: 13px; font-weight: 900; border: 1px solid var(--edge); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--edge); display: inline-block; }

/* ---------- календарь месяца / заполнение ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-2); padding: 2px 0; letter-spacing: .08em; text-transform: uppercase; }
.cal .wd.we { color: var(--tomato); }
.cal .day {
  aspect-ratio: 1 / 1.08; border-radius: 12px; background: var(--card); padding: 5px 2px 4px; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--edge) 22%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; cursor: pointer;
  position: relative; font-weight: 800; font-size: 15px;
}
.cal .day .n { font-family: var(--serif); font-size: 16px; }
.cal .day.empty { background: transparent; border: 0; cursor: default; }
.cal .day.past { opacity: .5; }
.cal .day.today .n { background: var(--ink); color: var(--paper); border-radius: 7px; padding: 0 6px; }
.cal .day.ptr { border: 2.5px solid var(--tomato); box-shadow: 2px 2px 0 var(--tomato); }
.cal .day .lbl {
  width: 100%; border-radius: 7px; font-size: 10.5px; font-weight: 850; padding: 3px 1px; color: var(--on, #fff);
  background: var(--c, var(--cobalt)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal .day .lbl.off { background: var(--card-2); color: var(--ink-2); }
.cal .day .lbl.cycle { opacity: .55; }
.cal .day.together { background: color-mix(in srgb, var(--sun) 35%, var(--card)); }
.cal .day .marks { font-size: 11px; display: flex; gap: 1px; }
.cal .day .bad { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 3px; background: var(--tomato); border: 1px solid var(--edge); }

.horizon { margin: 0 0 14px; }
.horizon .bar { height: 12px; border-radius: 6px; background: var(--card-2); border: var(--edge-w) solid var(--edge); overflow: hidden; margin-top: 6px; }
.horizon .bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--mint), var(--mint) 6px, #12A982 6px, #12A982 12px); }
.horizon .bar i.low { background: repeating-linear-gradient(-45deg, var(--sun), var(--sun) 6px, #F0AE00 6px, #F0AE00 12px); }

.fill-panel {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 16px);
  background: var(--card); border: var(--edge-w) solid var(--edge); box-shadow: var(--shadow); border-radius: 20px;
  padding: 12px; z-index: 20; max-width: 700px; margin: 0 auto;
}
.fill-panel .tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fill-panel .tpls button {
  border: var(--edge-w) solid var(--edge); border-radius: 13px; padding: 11px 6px; font-weight: 850; font-size: 16px;
  color: var(--on, #fff); background: var(--c, var(--cobalt)); cursor: pointer; min-height: 52px; box-shadow: 2px 2px 0 var(--edge);
}
.fill-panel .tpls button:active { transform: translate(2px, 2px); box-shadow: none; }
.fill-panel .tpls button.off { background: var(--card-2); color: var(--ink); }
.fill-panel .tpls button.clear { background: transparent; border-style: dashed; color: var(--ink-2); box-shadow: none; }
.fill-spacer { height: 230px; }

/* ---------- задачи и покупки ---------- */
.task .joke { font-family: var(--serif); font-size: 19px; line-height: 1.32; font-weight: 600; white-space: pre-line; }
.task .orig { margin-top: 10px; font-size: 13px; color: var(--ink-2); border-top: 1.5px dashed var(--card-2); padding-top: 8px; }
.task.done { opacity: .62; }
.task.done .joke { text-decoration: line-through; text-decoration-thickness: 2px; }
.styles-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; }
.styles-scroll::-webkit-scrollbar { display: none; }
.styles-scroll .chip { flex: none; }
.preview {
  border-radius: var(--radius); background: var(--sun); color: #1E1A15; padding: 16px; font-family: var(--serif);
  font-size: 18px; font-weight: 600; white-space: pre-line; min-height: 68px; border: var(--edge-w) solid var(--edge);
  box-shadow: var(--shadow); transform: rotate(-.6deg);
}
.shop-add { display: flex; gap: 8px; margin-bottom: 14px; }
.shop-add .input { flex: 1; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; cursor: pointer; }
.shop-item + .shop-item { border-top: 1.5px dashed var(--card-2); }
.shop-item .box { width: 26px; height: 26px; border-radius: 8px; border: var(--edge-w) solid var(--edge); flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900; background: var(--card); }
.shop-item.done .box { background: var(--mint); color: #fff; }
.shop-item.done .t { text-decoration: line-through; color: var(--ink-3); }
.shop-item .x { border: 0; background: none; color: var(--ink-3); font-size: 18px; cursor: pointer; padding: 4px 8px; }

/* ---------- лента изменений ---------- */
.feed-item { display: flex; gap: 10px; padding: 10px 0; align-items: flex-start; }
.feed-item + .feed-item { border-top: 1.5px dashed var(--card-2); }
.feed-item.unread .t { font-weight: 800; }
.feed-item .tm { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.feed-item .dotu { width: 9px; height: 9px; border-radius: 50%; background: var(--tomato); margin-top: 6px; flex: none; }
.feed-item .dotu.read { background: transparent; }

/* ---------- док (нижняя панель) ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none;
  padding: 0 10px calc(env(safe-area-inset-bottom) + 10px);
}
#tabbar .inner {
  pointer-events: auto; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--dock-h); background: var(--ink); border-radius: 22px; padding: 6px;
  box-shadow: 0 10px 30px rgba(30, 26, 21, .28); gap: 4px;
}
@media (prefers-color-scheme: dark) { #tabbar .inner { background: #2A251D; border: 1px solid #3A3328; box-shadow: 0 10px 30px rgba(0,0,0,.6); } }
#tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 16px;
  text-decoration: none; color: #BDB3A1; font-size: 10.5px; font-weight: 800; position: relative; letter-spacing: .02em;
  transition: background .15s, color .15s;
}
#tabbar a .i { font-size: 21px; line-height: 1.1; filter: grayscale(1) brightness(1.4); opacity: .85; transition: filter .15s; }
#tabbar a.on { background: var(--paper); color: var(--ink); }
#tabbar a.on .i { filter: none; opacity: 1; }
@media (prefers-color-scheme: dark) { #tabbar a.on { background: var(--sun); color: #1E1A15; } }
#tabbar a .badge {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--tomato); color: #fff; font-size: 11px; line-height: 18px; padding: 0 5px;
}
#tabbar.hidden { display: none; }

/* ---------- нижний лист ---------- */
.sheet-overlay { position: fixed; inset: 0; background: rgba(20, 16, 10, .42); z-index: 50; opacity: 0; transition: opacity .22s; }
.sheet-overlay.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.1px, transparent 1.4px); background-size: 20px 20px;
  border-radius: 26px 26px 0 0; border-top: var(--edge-w) solid var(--edge);
  max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, 1.15, .35, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: translateY(0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--ink-3); margin: 9px auto 2px; flex: none; }
.sheet .sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; flex: none; }
.sheet .sheet-head h3 { margin: 0; font-size: 22px; flex: 1; font-family: var(--serif); line-height: 1.15; }
.sheet .sheet-body { overflow-y: auto; padding: 4px 16px 24px; -webkit-overflow-scrolling: touch; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; width: 640px; transform: translate(-50%, 100%); border: var(--edge-w) solid var(--edge); border-bottom: 0; }
  .sheet.open { transform: translate(-50%, 0); }
}

/* ---------- всплывашка ---------- */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px) rotate(-1deg); opacity: 0;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 26px); z-index: 60;
  background: var(--sun); color: #1E1A15; padding: 12px 18px; border-radius: 14px; font-weight: 800; font-size: 15px;
  border: 1.5px solid #1E1A15; box-shadow: 3px 3px 0 #1E1A15;
  transition: all .25s cubic-bezier(.2, 1.2, .35, 1); pointer-events: none; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) rotate(-1deg); }
#toast.err { background: var(--tomato); color: #fff; }

/* ---------- вход / лендинг ---------- */
.landing { padding-top: 8px; }
.landing .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.landing .brand img { width: 52px; height: 52px; border-radius: 15px; border: var(--edge-w) solid var(--edge); box-shadow: var(--shadow); }
.landing .brand b { font-family: var(--serif); font-size: 28px; }
.landing h1 { font-size: clamp(38px, 11vw, 58px); line-height: .98; margin: 0 0 14px; letter-spacing: -.03em; }
.landing h1 em { font-style: italic; color: var(--tomato); }
.landing .lead { font-size: 17px; color: var(--ink-2); margin: 0 0 22px; max-width: 34ch; }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 24px; }
.feature { background: var(--card); border: var(--edge-w) solid var(--edge); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); font-size: 13.5px; }
.feature b { display: block; font-size: 15px; margin: 4px 0 2px; }
.feature:nth-child(1) { background: var(--sun); color: #1E1A15; transform: rotate(-1.2deg); }
.feature:nth-child(4) { background: var(--mint); color: #fff; transform: rotate(1deg); }
.empty { text-align: center; padding: 28px 8px; color: var(--ink-2); }
.empty .big { font-size: 46px; }
.empty b { display: block; font-family: var(--serif); font-size: 20px; color: var(--ink); margin: 6px 0 2px; }
.checklist .item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checklist .item + .item { border-top: 1.5px dashed var(--card-2); }
.checklist .item .mark { width: 24px; height: 24px; border-radius: 7px; border: var(--edge-w) solid var(--edge); display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 900; flex: none; }
.checklist .item .mark.ok { background: var(--mint); color: #fff; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; }
.list-item + .list-item { border-top: 1.5px dashed var(--card-2); }
.spinner { margin: 44px auto; width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--card-2); border-top-color: var(--tomato); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- конфетти ---------- */
.confetti { position: fixed; top: -14px; width: 9px; height: 14px; z-index: 70; pointer-events: none; border: 1px solid #1E1A15;
  animation: fall var(--d, 1.4s) cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes fall { to { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 540deg)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
