/* Цвета и размеры меняются здесь, в одном месте. */
:root {
  --bg: #f7f3f5; --card: #ffffff; --text: #2c2430; --muted: #6f6475; --line: #e4dbe2;
  --accent: #7a4a6b; --accent-text: #ffffff; --warn: #a8481f; --ok: #2f6f4f;
  --radius: 14px; --ctl: 44px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* иначе .field и #tabs показывались бы, несмотря на hidden */
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { padding: 12px 12px 88px; max-width: 720px; margin: 0 auto; }
#offline { background: var(--warn); color: #fff; padding: 8px 12px; text-align: center; font-size: 14px; }
#tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; min-height: 56px; border: 0; background: none; font-size: 13px; color: var(--muted); }
#tabs button.on { color: var(--accent); font-weight: 700; }
button, .btn { min-height: var(--ctl); padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--warn); border-color: var(--warn); }
button.ghost { border: 0; background: none; color: var(--muted); }
input, select, textarea { width: 100%; min-height: var(--ctl); padding: 8px 10px; border-radius: 10px; border: 1px solid #a99fa8; background: #fff; font-size: 16px; color: var(--text); }
textarea { min-height: 88px; }
.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.day-head.today { color: var(--accent); }
.note { font-size: 14px; color: var(--warn); margin-bottom: 6px; }
.row { display: flex; width: 100%; min-height: var(--ctl); gap: 10px; align-items: center; justify-content: flex-start; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 6px 4px; background: none; }
.row .t { width: 56px; flex: none; font-variant-numeric: tabular-nums; color: var(--muted); }
.row .n { flex: 1; }
.row .sub { display: block; font-size: 13px; color: var(--muted); }
.row.free .n { color: #a99fa8; }
.row.covered .n { color: var(--muted); font-style: italic; }
.row.done .n { color: var(--ok); }
.row.owes .n { color: var(--warn); font-weight: 600; }
.row.gone .n { text-decoration: line-through; color: var(--muted); }
.day-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.small-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.small-actions button { min-height: 36px; font-size: 14px; }
.banner { display: block; width: 100%; margin-bottom: 10px; background: #fbeee6; border-color: #e8c7b2; }
#sheet { border: 0; border-radius: var(--radius); padding: 14px; width: min(94vw, 520px); max-height: 90vh; overflow: auto; }
#sheet::backdrop { background: rgba(30, 20, 30, .45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 18px; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pick-list button { display: block; width: 100%; margin-top: 4px; text-align: left; }
.search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-row button { flex: none; white-space: nowrap; }
.row-edit { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.row-edit input { flex: 1; min-width: 0; }
.row-edit select { flex: 0 0 42%; width: 42%; }
.row-edit button { flex: none; padding: 0 8px; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.full { display: block; width: 100%; border-radius: 10px; }
.hint { background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.hint:empty { display: none; }
.hint button { margin-top: 6px; min-height: 36px; font-size: 14px; }
.warn { color: var(--warn); font-size: 14px; margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
.big { font-size: 24px; font-weight: 700; }
.line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.line .sub { display: block; font-size: 13px; color: var(--muted); }
.line-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.line-actions .btn, .line-actions button { min-height: 36px; padding: 0 10px; font-size: 14px; }
