/* TrackKit — shared styles. System fonts, single brand colour, dark mode. */
:root {
  --brand: #2f9e44;
  --brand-dark: #268138;
  --brand-weak: rgba(47, 158, 68, 0.12);
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --bg-card: #ffffff;
  --border: #e3e8e5;
  --border-strong: #cdd6d1;
  --text: #182420;
  --text-soft: #5a6b63;
  --text-faint: #8a978f;
  --shadow: 0 1px 2px rgba(16, 32, 24, .04), 0 8px 24px rgba(16, 32, 24, .05);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4ade80;
    --brand-dark: #3ec66d;
    --brand-weak: rgba(74, 222, 128, 0.14);
    --bg: #0f1512;
    --bg-soft: #151d19;
    --bg-card: #161f1a;
    --border: #263029;
    --border-strong: #35443a;
    --text: #e8efe9;
    --text-soft: #a3b1a8;
    --text-faint: #74857a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { a { color: var(--brand); } }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
img, svg { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--text-soft); font-size: 14.5px; padding: 7px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand-dark); font-weight: 600; }
@media (prefers-color-scheme: dark) { .nav a[aria-current="page"] { color: var(--brand); } }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex; margin-left: auto; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--bg-card); color: var(--text); cursor: pointer;
  }
  .nav {
    position: absolute; top: 60px; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 12px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 16px; }
}

/* ---- hero ---- */
.hero { text-align: center; padding: 46px 0 8px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); margin: 0 0 12px; }
.hero p.lede { font-size: clamp(16px, 2.4vw, 19px); color: var(--text-soft); max-width: 640px; margin: 0 auto; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px;
  background: var(--brand-weak); color: var(--brand-dark); font-weight: 600; font-size: 13px;
  padding: 6px 13px; border-radius: 999px;
}
@media (prefers-color-scheme: dark) { .hero .pill { color: var(--brand); } }
.hero .pill svg { width: 15px; height: 15px; }

/* ---- tool widget ---- */
.tool-shell { max-width: 860px; margin: 26px auto 0; }
#tool { display: block; }
.tk-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tk-visually-hidden, .tk-visually-hidden * { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tk-drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-soft); text-align: center; padding: 40px 22px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tk-drop:hover, .tk-drop:focus-visible { border-color: var(--brand); }
.tk-drop.is-drag { border-color: var(--brand); background: var(--brand-weak); }
.tk-upload-icon { width: 40px; height: 40px; color: var(--brand); }
.tk-drop-title { font-size: 18px; font-weight: 600; margin: 10px 0 14px; }
.tk-drop-hint { color: var(--text-faint); font-size: 13px; margin: 12px 0 0; }
.tk-privacy { display: flex; align-items: center; gap: 7px; justify-content: center; color: var(--text-soft); font-size: 13.5px; margin: 14px 0 0; }
.tk-privacy svg { color: var(--brand); flex: none; }

.tk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); cursor: pointer;
  font-family: inherit;
}
.tk-btn:hover { border-color: var(--brand); }
.tk-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.tk-btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { .tk-btn-primary { color: #06210f; } }

.tk-results { margin-top: 22px; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 6px 0 16px; }
.tk-download span { white-space: nowrap; }

.tk-error, .tk-notice {
  display: flex; gap: 9px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 14.5px; margin: 12px 0;
}
.tk-error { background: #fdecec; color: #9a2020; border: 1px solid #f5c6c6; }
.tk-notice { background: #fff7e6; color: #8a5a00; border: 1px solid #f2d999; }
.tk-error svg, .tk-notice svg { flex: none; margin-top: 1px; }
@media (prefers-color-scheme: dark) {
  .tk-error { background: #2a1414; color: #f3b0b0; border-color: #4a2020; }
  .tk-notice { background: #2a2310; color: #f0cf8a; border-color: #4a3d16; }
}

.tk-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text-soft); }
.tk-options { margin: 4px 0 16px; }
.tk-segmented, .tk-units { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.tk-seg, .tk-unit {
  min-height: 40px; padding: 0 16px; border: none; background: var(--bg-card); color: var(--text-soft);
  font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; border-right: 1px solid var(--border);
}
.tk-seg:last-child, .tk-unit:last-child { border-right: none; }
.tk-seg.is-on, .tk-unit.is-on { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .tk-seg.is-on, .tk-unit.is-on { color: #06210f; } }
.tk-units { margin-left: auto; }

.tk-radios { display: flex; flex-direction: column; gap: 8px; }
.tk-radio { display: flex; align-items: center; gap: 9px; min-height: 40px; font-size: 15px; cursor: pointer; }
.tk-radio input { width: 18px; height: 18px; accent-color: var(--brand); }

.tk-slider-wrap { display: flex; align-items: center; gap: 14px; }
.tk-slider { flex: 1; accent-color: var(--brand); height: 30px; }
.tk-slider-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 62px; text-align: right; }
.tk-readout { display: grid; gap: 6px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.tk-readout-row { display: flex; justify-content: space-between; font-size: 15px; }
.tk-readout-row span { color: var(--text-soft); }
.tk-readout-row strong { font-variant-numeric: tabular-nums; }

.tk-filelist { display: grid; gap: 8px; margin-bottom: 16px; }
.tk-filerow { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.tk-filename { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-filemeta { color: var(--text-soft); font-size: 13.5px; margin-left: auto; white-space: nowrap; }
.tk-remove { flex: none; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-soft); font-size: 20px; line-height: 1; cursor: pointer; }
.tk-remove:hover { border-color: #d66; color: #d66; }

/* ---- stats card ---- */
.tk-card { border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.tk-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tk-card-title { font-size: 16px; margin: 0; overflow: hidden; text-overflow: ellipsis; }
.tk-badges { display: flex; gap: 6px; margin-left: auto; }
.tk-badge { background: var(--brand-weak); color: var(--brand-dark); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
@media (prefers-color-scheme: dark) { .tk-badge { color: var(--brand); } }
.tk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 18px; }
.tk-stat { background: var(--bg-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.tk-stat-label { font-size: 12.5px; color: var(--text-soft); }
.tk-stat-value { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tk-viz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 16px; }
.tk-caption { display: block; font-size: 12px; color: var(--text-faint); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.tk-shape, .tk-profile { min-width: 0; }
.tk-shape-svg { width: 100%; height: auto; max-height: 200px; display: block; }
.tk-profile-svg { width: 100%; height: 110px; display: block; background: var(--bg-soft); border-radius: var(--radius-sm); }
@media (max-width: 620px) { .tk-viz { grid-template-columns: 1fr; } }

/* ---- ad slots (zero height, no fake boxes) ---- */
.ad-slot { height: 0; overflow: hidden; margin: 0; }

/* ---- content sections ---- */
.section { padding: 30px 0; }
.section h2 { font-size: 24px; margin: 0 0 14px; }
.section h3 { font-size: 18px; margin: 24px 0 8px; }
.prose { font-size: 16.5px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-weak); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
@media (prefers-color-scheme: dark) { .steps li::before { color: var(--brand); } }
.faq { display: grid; gap: 4px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); padding: 2px 16px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 22px; font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq p { margin: 12px 0; color: var(--text-soft); }

.callout { border: 1px solid var(--border); border-left: 3px solid var(--brand); background: var(--bg-soft); border-radius: var(--radius-sm); padding: 14px 18px; margin: 18px 0; }
.disclaimer { color: var(--text-faint); font-size: 13.5px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 26px; }

/* ---- related tools grid ---- */
.related h2 { font-size: 20px; margin-bottom: 14px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card { display: block; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); padding: 16px 18px; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); }
.tool-card h3 { font-size: 15.5px; margin: 0 0 4px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tool-card p { font-size: 13.5px; color: var(--text-soft); margin: 0; }
.tool-card .ic { width: 18px; height: 18px; color: var(--brand); flex: none; }

/* ---- guide cards ---- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); padding: 20px; }
.guide-card h3 { font-size: 17px; margin: 0 0 8px; }
.guide-card p { color: var(--text-soft); font-size: 14.5px; margin: 0 0 12px; }
.article { max-width: 720px; }
.article p, .article li { font-size: 17px; }
.article h2 { font-size: 25px; margin-top: 34px; }
.article .meta { color: var(--text-faint); font-size: 14px; margin-bottom: 8px; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); margin-top: 50px; background: var(--bg-soft); }
.site-footer .wrap { padding: 32px 20px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer .cols { display: flex; gap: 46px; flex-wrap: wrap; }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 0 0 10px; }
.site-footer a { display: block; color: var(--text-soft); font-size: 14.5px; padding: 3px 0; }
.site-footer a:hover { color: var(--text); }
.copyright { color: var(--text-faint); font-size: 13.5px; width: 100%; border-top: 1px solid var(--border); padding-top: 16px; }

/* ---- misc ---- */
.crumbs { font-size: 13.5px; color: var(--text-faint); padding: 18px 0 0; }
.crumbs a { color: var(--text-soft); }
.center { text-align: center; }
hr.rule { border: none; border-top: 1px solid var(--border); margin: 34px 0; }
.big-404 { text-align: center; padding: 70px 0; }
.big-404 .num { font-size: 90px; font-weight: 800; color: var(--brand); letter-spacing: -0.04em; line-height: 1; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
