/* Shared header, footer and document pages. Colour tokens come from style.css. */

.site-header {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 750; font-size: 1.25rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; }
.site-header nav a, .site-footer nav a {
  color: var(--muted); text-decoration: none; font-size: .95rem;
}
.site-header nav a:hover, .site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.site-header nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
@media (max-width: 640px) {
  .site-header nav { margin-left: 0; width: 100%; }
}

.site-footer {
  max-width: 1200px; margin: 40px auto 0;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; }
.site-footer p { margin: 6px 0; }
.site-version { font-size: .8rem; }

/* ---------- Policy and information pages ---------- */
.doc {
  max-width: 780px; margin: 0 auto; padding: 28px 20px 8px;
  line-height: 1.65;
}
.doc h1 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.3rem); margin-bottom: 6px; }
.doc .updated { color: var(--muted); margin: 0 0 24px; font-size: .92rem; }
.doc h2 { font-size: 1.2rem; margin: 32px 0 8px; }
.doc h3 { font-size: 1.02rem; margin: 20px 0 6px; }
.doc p, .doc li { max-width: 72ch; }
.doc ul { padding-left: 1.3em; }
.doc li { margin: 4px 0; }
.doc a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.doc .note {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 16px; margin: 18px 0;
}
.doc .table-wrap { overflow-x: auto; margin: 12px 0; }
.doc table { border-collapse: collapse; min-width: 480px; width: 100%; font-variant-numeric: tabular-nums; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-size: .9rem; color: var(--muted); font-weight: 600; }
.doc address { font-style: normal; }
.contact-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 16px 0; }
.contact-grid > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.contact-grid h3 { margin-top: 0; }
.mail-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.mail-topics a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  text-decoration: none; font-size: .92rem;
}
.mail-topics a:hover { border-color: var(--accent); }

/* ---------- Ad places ---------- */
.ad-row {
  max-width: 1200px; margin: 40px auto 0; padding: 0 20px;
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 560px)); justify-content: center;
}
.ad-slot { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; }
.ad-label { margin: 0 0 6px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ad-house { display: block; line-height: 0; }
.ad-house img { width: 100%; height: auto; border-radius: 6px; }
.ad-row + .site-footer { margin-top: 24px; }

/* ---------- Side rails (pages other than Home, wide screens) ---------- */
main.with-rails { position: relative; min-height: 680px; }
.ad-rail {
  position: absolute; top: 28px; width: 160px;
}
.ad-rail-left  { right: calc(100% + 32px); }
.ad-rail-right { left:  calc(100% + 32px); }
.ad-rail.is-empty { display: none; }
.ad-house-rail img { width: 160px; height: 600px; border-radius: 6px; }

/* ---------- Forms (account pages) ---------- */
.form-page { max-width: 560px; }
.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin: 18px 0; display: grid; gap: 14px;
}
.form-card h2 { margin: 0; font-size: 1.1rem; }
.form-card form { display: grid; gap: 14px; }
.form-card p { margin: 0; }
.form-page input[type="text"], .form-page input:not([type]), .form-page input[type="email"], .form-page input[type="password"] {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  padding: 10px 12px; min-height: 44px;
}
.form-page .field small { color: var(--muted); font-size: .8rem; }
.check { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: .95rem; line-height: 1.45; cursor: pointer; }
.check > span { min-width: 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: .92rem; border: 1px solid var(--line); background: var(--bg); }
.form-msg.is-error { color: var(--error); border-color: currentColor; }
.form-msg.is-ok { border-color: #2e9d5b; }
.form-msg.is-dev { margin-top: 16px; border-style: dashed; }
.form-links { font-size: .92rem; text-align: center; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.badge.is-ok { color: #2e9d5b; border-color: currentColor; }
.badge.is-warn { color: var(--error); border-color: currentColor; }
.form-card.danger { border-color: color-mix(in srgb, var(--error) 40%, var(--line)); }
.hint-small { color: var(--muted); font-size: .85rem; }
.form-card .btn + .btn, p > .btn + .btn { margin-left: 8px; }
.site-header nav a.nav-account { font-weight: 650; color: var(--ink); }

/* ---------- Site-wide notice ---------- */
.site-banner {
  max-width: 1200px; margin: 12px auto 0; padding: 10px 16px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
  border-left: 4px solid var(--accent); font-size: .95rem;
}
.site-banner.is-warning { border-left-color: var(--error); }
@media (max-width: 1240px) { .site-banner { margin-left: 20px; margin-right: 20px; } }

/* ---------- Contact forms ---------- */
.tabs { display: flex; gap: 8px; margin: 18px 0 0; flex-wrap: wrap; }
.tabs button {
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.form-page-inline input:not([type="checkbox"]), .form-page-inline textarea, .form-page-inline select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px;
}
.form-page-inline .field small { color: var(--muted); font-size: .82rem; }
.form-page-inline .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Checkout ---------- */
.buy-page { max-width: 620px; }
.buy-page h2 { margin: 6px 0 0; font-size: 1.05rem; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pack-card {
  position: relative; display: grid; gap: 2px; padding: 0 0 10px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line); background: var(--bg); text-align: center; overflow: hidden;
}
.pack-card .pack-name { background: var(--pc); color: #fff; font-weight: 700; font-size: .85rem; padding: 5px 4px; margin-bottom: 6px; }
.pack-card .pack-per { font-size: .75rem; color: var(--muted); }
.pack-card input { position: absolute; opacity: 0; }
.pack-card:has(input:checked) { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--panel)); box-shadow: 0 0 0 1px var(--pc); }
.pack-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.pack-credits { font-weight: 700; }
.pack-price { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.row-inline { display: flex; gap: 8px; }
.row-inline input { flex: 1; }
.price-summary { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.price-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.price-summary .total { font-weight: 750; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 8px; }
.price-summary .hint-small { margin: 0; }

.lot-list { margin: 0; padding-left: 1.2em; font-size: .92rem; }
.form-card h3.sub { margin: 6px 0 0; font-size: 1rem; }
.form-card details summary { cursor: pointer; color: var(--muted); font-size: .92rem; }

/* ---------- Theme switch ---------- */
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 1.05rem; line-height: 1;
  display: grid; place-items: center; flex: none;
}
.theme-btn:hover { border-color: var(--accent); }
@media (max-width: 640px) { .site-header .theme-btn { position: absolute; top: 14px; right: 16px; } .site-header { position: relative; } }

/* ---------- Shared cards (plans, choices, stats) ---------- */
.plan-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 18px 0 8px; }
.plan-card {
  --pc: #64748b;
  display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.plan-card.is-featured { border: 2px solid var(--pc); box-shadow: 0 8px 24px color-mix(in srgb, var(--pc) 22%, transparent); }
.plan-head { background: var(--pc); color: #fff; padding: 12px 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.plan-head .tag { margin-left: auto; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 999px; }
.plan-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-price { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan-sub { color: var(--muted); font-size: .9rem; margin: -4px 0 0; }
.plan-chip {
  align-self: flex-start; font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--pc) 16%, var(--panel)); color: var(--ink);
}
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.plan-list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.plan-list li::before { content: "✓"; color: var(--pc); font-weight: 800; }
.plan-best { font-size: .85rem; color: var(--muted); margin-top: auto; }
.plan-card .btn { width: 100%; background: var(--pc); border-color: var(--pc); color: #fff; }
.plan-card .btn:hover { filter: brightness(1.08); }
.plan-card.v-free { --pc: #64748b; }
.plan-card.v-try { --pc: #0d9488; }
.plan-card.v-starter { --pc: #2563eb; }
.plan-card.v-popular { --pc: #c2780a; }
.plan-card.v-best { --pc: #7c3aed; }
.plan-foot { font-size: .85rem; color: var(--muted); }

/* Small two-up option cards (voice tiers, ad formats, promises) */
.mini-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 14px 0; }
.mini-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--pc, var(--accent)); border-radius: 12px; padding: 14px 16px; }
.mini-card h3 { margin: 0 0 4px; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.mini-card p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.mini-card .big { font-size: 1.3rem; font-weight: 800; color: var(--ink); }

/* Stat card (account balance) */
.stat-card { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.stat-card .n { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card .l { color: var(--muted); }
.lot-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lot-card { border: 1px solid var(--line); border-left: 4px solid var(--pc, #0d9488); border-radius: 10px; padding: 10px 12px; font-size: .88rem; background: var(--bg); }
.lot-card.is-free { --pc: #7c3aed; }
.lot-card .n { font-size: 1.2rem; font-weight: 800; }
.lot-card .l { color: var(--muted); }

.doc.doc-wide { max-width: 1180px; }
.doc.doc-wide > p, .doc.doc-wide > ul, .doc.doc-wide > h2, .doc.doc-wide > .table-wrap, .doc.doc-wide > .mini-cards { max-width: 780px; }
.plan-head { white-space: nowrap; }
.plan-tag { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pc); margin-bottom: -6px; min-height: 1em; }
.site-header nav a.nav-logout { font-size: .9rem; }
.plan-card.v-pro { --pc: #2d5c4a; }
.site-banner.is-offer { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.site-banner a { color: inherit; font-weight: 700; margin-left: 8px; }
