:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --soft: #f1eee7;
  --text: #17201c;
  --muted: #6b746f;
  --line: #e6e1d7;
  --head: #14201b;
  --head-ink: #f3f1ec;
  --accent: #e07a2c;
  --accent-soft: #fcebdc;
  --warn: #c2551d;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1512;
    --surface: #161f1b;
    --soft: #1d2823;
    --text: #e9eeeb;
    --muted: #8f9c95;
    --line: #26332d;
    --head: #0b110e;
    --head-ink: #e9eeeb;
    --accent: #f08c3c;
    --accent-soft: #3a2616;
    --warn: #f0905c;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
select { font: inherit; color: inherit; }
small, .small { color: var(--muted); font-size: 0.85em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; background: var(--head); color: var(--head-ink); padding-top: env(safe-area-inset-top); }
.top__inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { border-radius: 8px; }
.brand b { display: block; line-height: 1.15; }
.brand small { display: block; color: inherit; opacity: 0.7; font-size: 0.78rem; }
.sync { font-size: 0.75rem; opacity: 0.8; display: inline-flex; align-items: center; gap: 6px; }
.sync::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #8f9c95; }
.sync--synced::before { background: #5cc48a; }
.sync--offline::before { background: #f0a050; }

/* сторінка */
.main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; outline: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { font-size: 1.25rem; margin-bottom: 10px; }
.card h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 16px 0 4px; }
.card h3:first-of-type { margin-top: 6px; }

/* 3. кожен бере сам */
.cols { columns: 1; column-gap: 24px; }
@media (min-width: 600px) { .cols { columns: 2; } }
.cols > div { break-inside: avoid; }
.plain { margin: 0; padding-left: 20px; }
.plain li { margin: 3px 0; }

/* згорнуті блоки */
.extras { display: flex; flex-direction: column; gap: 8px; }
.more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.more summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: '+'; color: var(--muted); font-weight: 400; }
.more[open] summary::after { content: '−'; }
.more__body { padding: 0 16px 16px; }
.more__body img { border-radius: 10px; max-height: 520px; width: auto; margin: 0 auto; }

.seats { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.seats th, .seats td { text-align: left; padding: 7px 4px; border-top: 1px solid var(--line); }
.seats thead th { border-top: 0; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.more__body .small { margin-top: 8px; }

/* вкладки */
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tabs a {
  padding: 8px 14px; border-radius: 99px; text-decoration: none; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--line);
}
.tabs a[aria-current='page'] { background: var(--accent); border-color: var(--accent); color: #fff; }

.note { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; font-weight: 500; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.ticket b { color: var(--accent); }

/* редаговані списки */
.hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; }
.item__row { display: flex; align-items: center; gap: 6px; min-height: 48px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.item__name { flex: 1; min-width: 0; text-align: left; padding: 10px 0; overflow-wrap: anywhere; }
span.item__name { cursor: default; }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: none; max-width: 55%; padding: 6px 0; }
.x { width: 36px; height: 36px; flex: none; border-radius: 10px; color: var(--muted); font-size: 0.9rem; }
.x:hover { background: var(--soft); color: var(--warn); }
.add { margin: 4px 0 2px; padding: 8px 12px; border-radius: 10px; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.add:hover { border-color: var(--accent); color: var(--accent); }
.pick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 12px; }
.pick__btn { padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 0.9rem; background: var(--soft) !important; color: var(--text) !important; border: 2px solid var(--line); }
.pick__btn.is-on { color: #fff !important; border-color: transparent; }
.pick__btn.is-on.chip--zheka { background: #e07a2c !important; }
.pick__btn.is-on.chip--dima { background: #2f6fd6 !important; }
.pick__btn.is-on.chip--roma { background: #2e8a57 !important; }
.pick__btn.is-on.chip--maks { background: #8a4fd0 !important; }
.pick__btn.is-on.chip--sasha { background: #c9364a !important; }
.pick__btn.is-on.chip--all { background: var(--text) !important; color: var(--bg) !important; }
.pick__done { padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 0.9rem; background: var(--accent); color: #fff; margin-left: auto; }
.chip { font-size: 0.82rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; color: #fff; }
.chip--zheka { background: #e07a2c; }
.chip--dima { background: #2f6fd6; }
.chip--roma { background: #2e8a57; }
.chip--maks { background: #8a4fd0; }
.chip--sasha { background: #c9364a; }
.chip--all { background: var(--soft); color: var(--text); border: 1px solid var(--line); }
.chip--none { background: none; color: var(--warn); border: 1.5px dashed var(--warn); font-weight: 600; }
