:root {
  --bg: #1b1b1d;          /* бліда чорнота */
  --panel: #242427;
  --panel-2: #2c2c30;
  --line: #36363c;
  --text: #f4f2e8;
  --muted: #9c9ca4;
  --y: #ffd60a;           /* яскраво-жовтий */
  --y-ink: #17150a;
  --y-soft: rgba(255, 214, 10, .12);
  --bad: #ff7a66;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --num: 'Unbounded', 'Onest', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font); padding-bottom: 32px;
}
button, input { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--y); outline-offset: 2px }

.page { max-width: 1040px; margin: 0 auto; padding: 32px 16px 24px }

/* ----- шапка ----- */
.head h1 { margin: 0 0 6px; font: 600 clamp(26px, 5vw, 40px)/1.1 var(--font); letter-spacing: -.01em }
.head p { margin: 0; color: var(--muted); max-width: 52ch }

/* ----- вкладки ----- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 28px 0 20px; border-bottom: 1px solid var(--line) }   /* без overflow: інакше з'являється вертикальна прокрутка */
.tabs button {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500;
}
.tabs button:hover { color: var(--text) }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--y) }

/* ----- пошук: вулиця + табличка з номером ----- */
.finder { margin-bottom: 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: end }
.field { position: relative }
.field label, .plate label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px }
.street input {
  width: 100%; height: 76px; padding: 0 16px; background: var(--panel); border: 2px solid var(--line);
  border-radius: 10px; font-size: 18px;
}
.street input::placeholder { color: #6f6f77 }
.street input:focus { outline: none; border-color: var(--y) }
.street input:focus-visible { outline: none; border-color: var(--y); box-shadow: 0 0 0 3px var(--y-soft) }

/* Табличка з номером будинку: єдиний яскравий елемент сторінки */
.plate {
  background: var(--y); color: var(--y-ink); border-radius: 12px; padding: 8px 14px 6px; width: 190px;
  box-shadow: inset 0 0 0 3px var(--y), inset 0 0 0 5px var(--y-ink);
}
.plate label { color: var(--y-ink); opacity: .75; margin: 2px 6px 0; font-weight: 500 }
.plate input {
  width: 100%; background: transparent; border: 0; padding: 0 6px; height: 54px;
  font: 600 38px/1 var(--num); color: var(--y-ink); letter-spacing: -.02em;
}
.plate input::placeholder { color: rgba(23, 21, 10, .28) }
.plate input:focus { outline: none }
.plate:focus-within { outline: 3px solid var(--y); outline-offset: 4px }

.reset {
  height: 76px; padding: 0 16px; background: none; border: 2px solid var(--line); border-radius: 10px;
  color: var(--muted); cursor: pointer;
}
.reset:hover { color: var(--text); border-color: var(--muted) }

/* підказки вулиць */
.sugg {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 4px; list-style: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.sugg li { padding: 9px 12px; border-radius: 7px; cursor: pointer }
.sugg li:hover, .sugg li[aria-selected="true"] { background: var(--y); color: var(--y-ink) }

/* ----- таблиця ----- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel) }
table { border-collapse: collapse; width: 100%; min-width: 760px }
th { text-align: left; font-weight: 500; font-size: 14px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top }
tbody tr:last-child td { border-bottom: 0 }
td.nw { white-space: nowrap; font-variant-numeric: tabular-nums }
tr.done td:not(:first-child) { opacity: .5 }
tr.hit td:first-child { box-shadow: inset 4px 0 0 var(--y) }   /* жовта смужка: цей рядок про ваш будинок */
tr.hit { background: var(--y-soft) }
mark { background: var(--y); color: var(--y-ink); padding: 0 4px; border-radius: 4px; font-weight: 600 }
.dim { color: var(--muted); font-style: italic }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1.5px solid var(--line); color: var(--muted) }
.pill.active { background: var(--y); border-color: var(--y); color: var(--y-ink) }
.pill.upcoming { border-color: var(--y); color: var(--y) }
.sub { display: block; color: var(--muted); font-size: 13px }

.empty { padding: 36px 20px; text-align: center; color: var(--muted) }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px }


/* ----- вузькі екрани ----- */
@media (max-width: 720px) {
  .finder { grid-template-columns: 1fr 1fr }
  .field.street { grid-column: 1 / -1 }
  .street input, .reset { height: 56px }
  .plate { width: auto }
  /* таблиця стає списком карточок: усі поля видно без горизонтальної прокрутки */
  table { min-width: 0 }
  thead { display: none }
  table, tbody, tr, td { display: block }
  tr { padding: 12px 14px; border-bottom: 1px solid var(--line) }
  tbody tr:last-child { border-bottom: 0 }
  tr.hit { box-shadow: inset 4px 0 0 var(--y) }
  tr.hit td:first-child { box-shadow: none }
  td { display: flex; gap: 12px; border: 0; padding: 3px 0 }
  td::before { content: attr(data-label); flex: 0 0 120px; color: var(--muted); font-size: 14px }
  td.nw { white-space: normal }

  /* ---- доробка під телефон (ПК-версія не зачіпається) ---- */
  body { padding-bottom: max(32px, env(safe-area-inset-bottom)) }
  .page { padding: 20px max(12px, env(safe-area-inset-left)) 16px max(12px, env(safe-area-inset-right)) }
  .head p { font-size: 15px }
  .tabs { margin: 18px 0 14px; gap: 0 }
  .tabs button { flex: 1 1 auto; padding: 12px 8px; font-size: 15px; white-space: normal; line-height: 1.2; min-height: 48px }
  .finder { gap: 12px; margin-bottom: 16px; align-items: stretch }
  .street input { font-size: 17px; padding: 0 14px }   /* ≥16px, щоб iOS не наближав сторінку при фокусі */
  .plate { padding: 6px 12px 4px }
  .plate input { height: 48px; font-size: 32px }
  .reset { height: auto; min-height: 56px; font-size: 16px }
  .sugg { max-height: 40vh; -webkit-overflow-scrolling: touch }
  .sugg li { padding: 13px 12px }                       /* зручна зона дотику */
  .table-wrap { border-radius: 10px }
  tr { padding: 12px }
  td { align-items: baseline; overflow-wrap: anywhere }
  td::before { flex: 0 0 108px }
  td:first-child { padding-bottom: 6px }
  .empty { padding: 28px 14px }
}
@media (max-width: 380px) {
  .head h1 { font-size: 24px }
  td { flex-direction: column; gap: 0 }
  td::before { flex: none; font-size: 13px }
  td:first-child { flex-direction: row }
  td:first-child::before { flex: 0 0 108px }
}