/* /buy, /buy/done, /account, /admin - one look with the cabinet (cabinet.css palette). */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5f6b7a;
  --line: #dfe3e8;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --accent-soft: #e7f0fe;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --ok: #2e7d32;
  --ok-soft: #e8f5e9;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 6%);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1b2027;
    --text: #e8ebef;
    --muted: #9aa5b1;
    --line: #2d343d;
    --accent: #4c8dff;
    --accent-text: #0b1020;
    --accent-soft: #1d2a40;
    --danger: #ff6b6b;
    --danger-soft: #3a1f22;
    --ok: #66bb6a;
    --ok-soft: #1b2e1d;
    --warn: #f0c060;
    --warn-soft: #33290f;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; text-decoration: none; color: var(--text); }
.bar nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bar nav a { text-decoration: none; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
#who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; color: var(--muted); }

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 520px; margin: 6vh auto 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 24px; max-width: 46em; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Controls */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text);
  border-radius: 10px; padding: 9px 16px; cursor: pointer; min-height: 42px;
}
button:hover, .button:hover { border-color: var(--muted); }
button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.big { width: 100%; padding: 12px; font-size: 1.05rem; }
.link { border: 0; background: none; padding: 4px; min-height: 0; color: var(--accent); }
.danger { color: var(--danger); }
button:disabled { opacity: 0.55; cursor: default; }
input, select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; min-height: 42px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }

/* Segmented switch */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; min-height: 36px; padding: 6px 14px; border-radius: 9px; background: none; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.switches { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.save { color: var(--ok); font-size: 0.85rem; font-weight: 600; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.plan.pick { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan .seats { color: var(--muted); font-size: 0.9rem; margin-top: -6px; }
.price { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
.price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.plan .grow { flex: 1; }
.tag {
  position: absolute; top: -10px; right: 14px; background: var(--accent); color: var(--accent-text);
  font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px;
}

/* Cards and notes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.note { border-radius: 12px; padding: 12px 16px; background: var(--accent-soft); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.bad { background: var(--danger-soft); color: var(--danger); }
.trial { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 22px; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.big-status { font-size: 1.35rem; font-weight: 650; margin: 4px 0; }
.bar-meter { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar-meter > i { display: block; height: 100%; background: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: var(--bg); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 180px; }
.members li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.members { list-style: none; margin: 8px 0 12px; padding: 0; }

section + section { margin-top: 28px; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 8px 0 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; transition: 0.2s; max-width: calc(100vw - 32px);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--danger); color: #fff; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 22px; max-width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / 40%); }

footer { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 0.85rem; }

/* /buy: one tariff - choice on the left, the price and payment on the right (a column on a phone) */
.flat { margin: 0; }
.row.between { justify-content: space-between; }
.bar .seg.lang button { min-height: 30px; padding: 2px 9px; font-size: 0.85rem; }
.buy-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .buy-grid { grid-template-columns: minmax(0, 1fr); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 38px; padding: 6px 14px; border-radius: 99px; }
.chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
#plan-name { font-size: 1.35rem; margin-top: 4px; }
.facts { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.seats-field { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.seats-field input { width: 6.5em; }
.pay .seg.cur { align-self: flex-start; flex-wrap: wrap; }
.pay .price { overflow-wrap: anywhere; }
.price s.old { font-size: 1.1rem; font-weight: 500; color: var(--muted); }
.promo { flex-wrap: nowrap; margin-top: 8px; }
.promo input { min-width: 0; text-transform: uppercase; }
details summary { cursor: pointer; color: var(--accent); }
.trial-line { margin-top: 22px; }

/* The site's language switch (assets/site.js): a native <select> with a globe. */
.langs { position: relative; display: inline-flex; flex-direction: row; align-items: center; gap: 0; color: var(--muted); }
.langs svg { position: absolute; left: 9px; width: 15px; height: 15px; pointer-events: none; }
.langs select { width: auto; min-height: 36px; padding: 6px 10px 6px 29px; border-radius: 10px; font-size: .9rem; max-width: 11.5em; }
/* lic/watch.js: the page's module did not start - only the "reload" line is left */
main.stale > :not(#stale) { display: none !important; }
#stale { display: flex; align-items: center; gap: 12px; justify-content: space-between; }

/* «Є ідея чи проблема?» (/account, /ideas, /news; 47-feedback-loop.md §6) */
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: 0.95rem; }
label.check input { width: auto; min-height: 0; }
.fb-list li { display: block; padding: 12px 0; }
.fb-item p { margin: 6px 0; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-credit { margin-top: 8px; gap: 8px; }
.fb-credit input[type="text"] { max-width: 340px; }
#fb-form .seg { align-self: flex-start; }
.idea { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.idea h3 { margin: 0 0 4px; }
.idea .vote { flex: none; min-width: 7.5em; }
.news-block h2 { margin-bottom: 2px; }
.news-block ul { margin: 6px 0 10px; padding-left: 22px; }
