/* TachoArchive – shared styles for the landing page, docs and the panel. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef1f5; --ink: #14202e; --muted: #5b6b7d; --line: #dde3ea;
  --brand: #0f3d5c; --brand-ink: #ffffff; --accent: #f2a516; --accent-ink: #1c1300;
  --ok: #1f8a4c; --ok-bg: #e3f5ea; --warn: #9a6200; --warn-bg: #fff2d6; --bad: #b4232c; --bad-bg: #fde6e7;
  --code-bg: #0e1a26; --code-ink: #d9e6f2; --radius: 12px; --shadow: 0 1px 2px rgba(16,32,48,.06), 0 6px 24px rgba(16,32,48,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141c; --surface: #141e29; --surface-2: #1b2734; --ink: #e6edf4; --muted: #95a6b8; --line: #263444;
    --brand: #7cc0ea; --brand-ink: #0b1620; --accent: #f2a516; --ok: #5fd08e; --ok-bg: #14301f; --warn: #f5c35c; --warn-bg: #33270e;
    --bad: #ff8a8f; --bad-bg: #3a1619; --code-bg: #0a1118; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--code-bg); color: var(--code-ink); padding: 16px 18px; border-radius: 10px; overflow-x: auto; line-height: 1.5; margin: 0 0 1rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

/* Brand */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo b { color: var(--accent); font-weight: 800; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn-sm { padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.err { color: var(--bad); font-size: .85rem; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* Alerts & badges */
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; background: var(--surface-2); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-soon { background: var(--warn-bg); color: var(--warn); }
.badge-overdue { background: var(--bad-bg); color: var(--bad); }

/* Cards & tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card h2 { font-size: 1.1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } }

/* Panel shell */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--ink); background: var(--surface-2); }
.top-right { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.langs { display: inline-flex; gap: 2px; }
.langs a { padding: 3px 7px; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; }
.langs a.on { background: var(--surface-2); color: var(--ink); }
.main { padding: 28px 0 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; margin-left: auto; }
  .nav { display: none; order: 9; flex-basis: 100%; flex-direction: column; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .top-right { order: 8; flex-basis: 100%; justify-content: space-between; padding-bottom: 10px; display: none; }
  .nav.open + .top-right { display: flex; }
}

/* Upload */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 34px 16px; text-align: center; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--warn-bg); }
.drop strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.drop input { display: none; }
.uploads { list-style: none; padding: 0; margin: 14px 0 0; }
.uploads li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
.uploads .name { font-weight: 600; word-break: break-all; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { font-size: .78rem; color: var(--muted); }
@media (max-width: 960px) { .filters { grid-template-columns: 1fr 1fr; } }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; font-size: .88rem; }
.pager .on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.token-box { display: flex; gap: 8px; align-items: center; background: var(--code-bg); color: var(--code-ink); padding: 10px 12px; border-radius: 9px; word-break: break-all; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.auth .card { width: 100%; max-width: 460px; padding: 28px; }
.auth .card.wide { max-width: 560px; }
.auth .logo { margin-bottom: 20px; }
.auth h1 { font-size: 1.4rem; }
.auth .below { text-align: center; margin-top: 16px; font-size: .92rem; }

/* Landing */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 22px; min-height: 64px; }
.site-nav { display: flex; gap: 20px; flex: 1; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .94rem; }
.site-nav a:hover { color: var(--ink); }
.head-cta { display: flex; gap: 10px; align-items: center; }
@media (max-width: 900px) { .site-nav { display: none; } .head-cta .btn-ghost { display: none; } .site-head .wrap { gap: 12px; } .head-cta { margin-left: auto; } }
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: .82rem; font-weight: 700; color: var(--brand); background: var(--surface); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero .flags { display: flex; gap: 16px; margin-top: 22px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.flag { display: inline-flex; align-items: center; gap: 7px; }
.flag i { width: 22px; height: 15px; border-radius: 3px; display: inline-block; box-shadow: 0 0 0 1px var(--line); }
.flag-pl { background: linear-gradient(#fff 50%, #dc143c 50%); }
.flag-ch { background: #d52b1e; position: relative; }
.flag-ch::before, .flag-ch::after { content: ""; position: absolute; background: #fff; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.flag-ch::before { width: 9px; height: 3px; } .flag-ch::after { width: 3px; height: 9px; }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(15,40,70,.14); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-body { padding: 16px; }
.mock-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: .86rem; }
.mock-row:last-child { border-bottom: 0; }
.mock-row .ic { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--brand); }
.mock-row small { display: block; color: var(--muted); font-size: .76rem; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .hero { padding-top: 44px; } }
section.block { padding: 64px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { max-width: 720px; margin-bottom: 36px; }
.section-title h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-title p { color: var(--muted); font-size: 1.06rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
section.alt .feature { background: var(--bg); }
.feature .fi { width: 40px; height: 40px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); display: grid; place-items: center; margin-bottom: 14px; }
.feature .fi svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.countries { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.country { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.country h3 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; }
.country h3 .flag i { width: 28px; height: 19px; }
.country ul { padding-left: 18px; margin: 12px 0 0; }
.country li { margin-bottom: 8px; }
.country .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 800px) { .countries { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.step { position: relative; padding: 22px 22px 22px 66px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 20px; top: 20px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.step h3 { font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.api-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 32px; align-items: start; }
.api-split ul { padding-left: 18px; } .api-split li { margin-bottom: 6px; }
@media (max-width: 860px) { .api-split { grid-template-columns: 1fr; } }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
.cta-band { background: var(--brand); color: var(--brand-ink); border-radius: 18px; padding: 40px 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .85; }
.site-foot { padding: 32px 0 40px; color: var(--muted); font-size: .88rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.note { font-size: .82rem; color: var(--muted); margin-top: 22px; }

/* Docs */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 36px 0 60px; }
.docs aside { position: sticky; top: 84px; align-self: start; font-size: .92rem; }
.docs aside a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; }
.docs aside a:hover { color: var(--ink); }
.docs article { min-width: 0; }
.docs article h1 { font-size: 2rem; }
.docs article h2 { margin-top: 40px; padding-top: 10px; font-size: 1.4rem; border-top: 1px solid var(--line); }
.docs article h3 { margin-top: 26px; font-size: 1.05rem; }
.endpoint { display: flex; gap: 10px; align-items: center; font-family: ui-monospace, Menlo, monospace; font-size: .95rem; margin: 18px 0 10px; flex-wrap: wrap; }
.method { padding: 2px 9px; border-radius: 6px; font-weight: 800; font-size: .78rem; background: var(--ok-bg); color: var(--ok); }
.method.post { background: var(--warn-bg); color: var(--warn); }
.tabs { display: flex; gap: 4px; margin-bottom: -1px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); color: var(--muted); padding: 6px 12px; border-radius: 8px 8px 0 0; font: inherit; font-size: .85rem; cursor: pointer; }
.tabs button.on { background: var(--code-bg); color: var(--code-ink); border-color: var(--code-bg); }
.tabpanes pre { border-top-left-radius: 0; }
.tabpanes pre:not(.on) { display: none; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs aside { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; } }

/* Fixes: compact panel nav, no horizontal scroll on phones */
.nav { flex-wrap: nowrap; }
.nav a { padding: 8px 10px; white-space: nowrap; }
@media (max-width: 1060px) {
  .menu-btn { display: inline-flex; margin-left: auto; }
  .nav { display: none; order: 9; flex-basis: 100%; flex-direction: column; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .top-right { order: 8; flex-basis: 100%; justify-content: space-between; padding-bottom: 10px; display: none; }
  .nav.open + .top-right { display: flex; }
}
.mock-row > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.hero .wrap > * { min-width: 0; }
@media (max-width: 560px) {
  .head-cta .btn-accent { display: none; }
  .hero h1 { font-size: 1.85rem; overflow-wrap: anywhere; hyphens: auto; }
  .mock-row { grid-template-columns: 26px 1fr; }
  .mock-row .badge { grid-column: 2; justify-self: start; }
}
.filters > *, .grid2 > *, .docs > * { min-width: 0; }
@media (max-width: 960px) { .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 860px) { .docs { grid-template-columns: minmax(0, 1fr); } }
:not(pre) > code { overflow-wrap: anywhere; }
.docs .table-wrap { margin: 0 0 1rem; padding: 0; }
