/* leadmaker.cz shared design tokens and components (Google-classic minimalism). */
:root {
  color-scheme: light;
  --ink: #1f2b28; --muted: #5f6b67; --faint: #8a9591; --line: #e3e7e5; --soft: #f6f8f7; --card: #fff; --bg: #fff;
  --teal: #0f6b5c; --teal-soft: #e3f1ed; --night: #17221f; --dot: #f07a22;
  --ok: #1e8e5a; --warn: #c27c0e; --bad: #c8412f;
  --radius: 14px; --shadow: 0 1px 6px rgba(32,33,36,.1); --shadow-hi: 0 4px 22px rgba(32,33,36,.14);
}
/* Light is the default for everyone; dark only when the visitor picks it (theme switch). */
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e6ecea; --muted: #a3aeaa; --faint: #7d8884; --line: #2c3633; --soft: #1b2321; --card: #171e1c; --bg: #111715;
    --teal: #4fc0a8; --teal-soft: #17302a; --night: #e6ecea; --shadow: 0 1px 6px rgba(0,0,0,.5); --shadow-hi: 0 6px 24px rgba(0,0,0,.6);
  }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Roboto, system-ui, sans-serif; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-toggle { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 50%; display: inline-grid; place-items: center; }
.theme-toggle:hover { color: var(--ink); background: var(--soft); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* wordmark */
.wordmark { font: 700 28px/1 Outfit, sans-serif; letter-spacing: -.035em; color: var(--night); white-space: nowrap; }
.wordmark .t { color: var(--teal); }
.wordmark .dotted { position: relative; color: var(--teal); }
.wordmark .dotted::before { content: ""; position: absolute; left: 50%; top: .19em; width: .22em; height: .22em; margin-left: -.03em; border-radius: 50%; background: var(--dot); }
a.wordmark:hover { text-decoration: none; }

/* search box + suggestions */
.search { position: relative; width: min(640px, 100%); }
.box { display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 20px; border: 1px solid var(--line); border-radius: 27px; background: var(--card); box-shadow: var(--shadow); transition: box-shadow .2s, border-radius .1s; }
.box:hover, .box:focus-within { box-shadow: var(--shadow-hi); border-color: transparent; }
.search.open .box { border-radius: 27px 27px 0 0; box-shadow: var(--shadow-hi); border-color: transparent; }
.box > svg { flex: none; color: var(--muted); }
.box input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px; color: var(--ink); background: transparent; min-width: 0; }
.box input::placeholder { color: var(--faint); }
.box .clear { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; display: none; }
.search.has-text .clear { display: block; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--card); border-radius: 0 0 24px 24px; box-shadow: var(--shadow-hi); padding: 6px 0 12px; display: none; clip-path: inset(0 -30px -30px -30px); }
.search.open .suggest { display: block; }
.suggest::before { content: ""; display: block; height: 1px; background: var(--line); margin: 0 20px 6px; }
.sg { display: flex; align-items: center; gap: 14px; padding: 8px 20px; cursor: pointer; }
.sg[aria-selected="true"], .sg:hover { background: var(--soft); }
.sg .ic { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font: 700 14px Outfit, sans-serif; color: #fff; background: var(--teal); }
.sg .ic.dead { background: var(--faint); }
.sg .tx { min-width: 0; flex: 1; }
.sg .nm { font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg .nm b { font-weight: 700; }
.sg .mt { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg .bd { flex: none; display: flex; gap: 6px; }
.sg-foot { padding: 8px 20px 0; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sg-foot kbd { font: 12px Roboto, sans-serif; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

/* chips + tags */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.kv dd.bad { color: var(--bad); font-weight: 500; }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.teal { background: var(--teal-soft); color: var(--teal); }

/* reveal card on the homepage */
.reveal { width: min(640px, 100%); margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; text-align: left; opacity: 0; transform: translateY(8px); filter: blur(6px); transition: opacity .35s, transform .35s, filter .45s; pointer-events: none; }
.reveal.on { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.reveal h2 { margin: 0; font: 600 22px/1.25 Roboto, sans-serif; letter-spacing: -.01em; }
.reveal .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.reveal .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px 18px; margin-top: 16px; }
.fact .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fact .v { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 1px; overflow-wrap: anywhere; }
.fact .v small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.scramble { color: var(--faint); }
.reveal .go { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }

/* layout for inner pages */
.topbar { display: flex; align-items: center; gap: 24px; padding: 16px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .search { width: min(560px, 100%); flex: 1 1 320px; }
.topbar .box { height: 46px; }
.topbar nav { display: flex; gap: 18px; font-size: 14px; margin-left: auto; }
.topbar nav a { color: var(--muted); }
.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 28px 24px 64px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.note { color: var(--muted); font-size: 14px; }
.empty { color: var(--faint); font-size: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.tablebox { overflow-x: auto; }
footer.site { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 28px; padding: 16px 24px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
footer.site a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--night); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translateX(-50%); }
@keyframes pulse { 50% { opacity: .45; } }
.loading { animation: pulse 1.2s ease-in-out infinite; }
@media (max-width: 560px) { .topbar { padding: 12px 16px; gap: 12px; } .topbar nav { margin-left: 0; } .wrap { padding: 20px 16px 48px; } .sg .bd { display: none; } }
@media (prefers-reduced-motion: reduce) { *, .reveal { animation: none !important; transition: none !important; } }

/* public tender cards (zakazky, zakazka, firma) */
.tc { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.tc:last-child { border-bottom: 0; }
.tc-title { font-size: 18px; line-height: 1.35; font-weight: 500; }
.tc-meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.tc-meta a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }
.tc-sub { margin: 6px 0 0; font-size: 14px; color: var(--ink); opacity: .85; }
.tc .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* server-rendered summary paragraph and breadcrumbs (src/leadmaker/api/pages.py, hubs.py) */
.lead { font-size: 16px; line-height: 1.55; max-width: 72ch; margin: 0 0 20px; color: var(--ink); }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--muted); }

/* feedback button (ui.js mountFeedback): slides in, two soft pulses, still for reduced motion */
.fb-btn { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 11px 17px; border: 0; border-radius: 999px; background: var(--teal); color: var(--card); font: 500 14px/1 Roboto, sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; animation: fb-in .7s cubic-bezier(.2,.8,.2,1) .8s both, fb-pulse 2.2s ease-out 2.6s 2; transition: transform .15s; }
.fb-btn:hover { transform: translateY(-2px); }
.fb-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@keyframes fb-in { from { transform: translateY(140%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fb-pulse { 0% { box-shadow: 0 0 0 0 rgba(15,118,110,.5), 0 6px 20px rgba(0,0,0,.18); } 100% { box-shadow: 0 0 0 20px rgba(15,118,110,0), 0 6px 20px rgba(0,0,0,.18); } }
@media (prefers-reduced-motion: reduce) { .fb-btn { animation: none; } }
@media (max-width: 560px) { .fb-btn span { display: none; } .fb-btn { padding: 13px; } }
.fb-dlg { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.fb-dlg::backdrop { background: rgba(0,0,0,.35); }
.fb-dlg h3 { margin: 0 0 4px; font-size: 17px; }
.fb-form textarea, .fb-form input { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 9px 11px; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.fb-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.fb-form .err { color: var(--bad); font-size: 13.5px; min-height: 18px; margin: 6px 0 0; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
/* panels the API renders on /firma and the tool pages (pages.py) */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
dl.kv dt { color: var(--faint); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
ul.reasons { margin: 0; padding-left: 18px; font-size: 14px; }
.panel h4 { margin: 14px 0 6px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
td small { display: block; color: var(--muted); font-size: 12.5px; }

/* KPI cards: firma, hub pages (e-shopy, DPH, telefon, datová schránka), zakázka */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.kpi .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.kpi .v { font-size: clamp(19px, 4.6vw, 24px); font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .d { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Phones: long panels, intros, filter forms and link walls fold to a screenful (ui.js `fold`);
   the whole content stays in the HTML and opens on one tap. */
@media (max-width: 560px) {
  /* a long label wraps inside 40% instead of widening the page; FAQ lists (h2 + dl) stack */
  dl.kv { grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 8px 12px; }
  h2 + dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  h2 + dl.kv dt { color: var(--ink); font-weight: 500; }
  h2 + dl.kv dd { margin-bottom: 12px; color: var(--muted); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .panel { padding: 16px; }
  [data-fold] { position: relative; }
  [data-fold="closed"] { max-height: var(--fold); overflow: hidden; }
  .fold-btn { display: block; width: 100%; border: 0; background: none; padding: 10px 0 0; color: var(--teal); font-weight: 500; font-size: 14px; text-align: left; cursor: pointer; }
  [data-fold="closed"] > .fold-btn { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 12px; background: linear-gradient(to bottom, transparent, var(--fold-bg, var(--card)) 55%); }
  p[data-fold], form[data-fold], nav[data-fold] { --fold-bg: var(--bg); }
  p[data-fold="closed"] > .fold-btn, nav[data-fold="closed"] > .fold-btn { padding-left: 0; }
  nav[data-fold] > .fold-btn { text-align: center; }
  /* a folded filter form shows its first field whole; the button sits under it, no fade */
  form[data-fold="closed"] > .fold-btn { padding: 6px 0 0; background: var(--bg); }
}
