/* ==========================================================================
   Free Histogram Maker — shared stylesheet
   Direction: "instrument panel" for data. Cool paper, cobalt + amber,
   monospace data readouts, axis-tick dividers. Mobile-first.
   ========================================================================== */

:root {
  /* palette */
  --ink:        #16203a;   /* deep navy ink for text            */
  --ink-soft:   #46506a;   /* secondary text                    */
  --ink-faint:  #7a8398;   /* captions / meta                   */
  --paper:      #f5f7fb;   /* cool page background              */
  --paper-2:    #eef2f9;   /* alt band                          */
  --surface:    #ffffff;   /* cards                             */
  --line:       #dde3ee;   /* hairlines                         */
  --line-soft:  #e9edf5;
  --cobalt:     #2945d6;   /* primary / links / axis            */
  --cobalt-700: #1f33a8;   /* hover                             */
  --cobalt-50:  #eaeefc;   /* tint                              */
  --amber:      #f59e0b;   /* accent: bars / highlight          */
  --amber-600:  #d97706;
  --amber-50:   #fff5e3;
  --green:      #1f9e6e;   /* positive notes                    */
  --rose:       #e0556b;   /* warnings                          */

  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "SF Mono", "SFMono-Regular", ui-monospace, "Cascadia Code", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* fluid type scale */
  --fs-h1:  clamp(1.95rem, 1.35rem + 2.6vw, 3.1rem);
  --fs-h2:  clamp(1.45rem, 1.15rem + 1.4vw, 2.05rem);
  --fs-h3:  clamp(1.18rem, 1.02rem + 0.7vw, 1.45rem);
  --fs-h4:  clamp(1.02rem, 0.96rem + 0.3vw, 1.15rem);
  --fs-body: 1.0625rem;
  --fs-sm:  0.9375rem;
  --fs-xs:  0.8125rem;

  /* spacing / shape */
  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow:   0 1px 2px rgba(22,32,58,.05), 0 8px 24px -12px rgba(22,32,58,.18);
  --shadow-lg: 0 24px 60px -28px rgba(22,32,58,.35);
  --maxw: 1120px;
  --maxw-read: 760px;
}

/* reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cobalt); text-decoration-color: rgba(41,69,214,.35); text-underline-offset: 2px; }
a:hover { color: var(--cobalt-700); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4, h5, h6 { line-height: 1.2; font-weight: 760; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 680; }
code, kbd, samp { font-family: var(--mono); font-size: .92em; }
:not(pre) > code {
  background: var(--cobalt-50); color: var(--cobalt-700);
  padding: .12em .42em; border-radius: 6px; font-size: .85em;
  border: 1px solid #dde3fb;
}
kbd {
  background: #fff; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: .06em .45em; color: var(--ink); font-size: .82em;
}

/* layout ----------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(2.6rem, 6vw, 4.6rem); }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.band-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.prose { max-width: var(--maxw-read); }
.prose p { margin-block: 0.9em; }
.prose h2 { margin-top: 2em; margin-bottom: .5em; }
.prose h3 { margin-top: 1.5em; margin-bottom: .35em; }
.prose ul, .prose ol { margin-block: 0.9em; padding-left: 1.3em; color: var(--ink-soft); }
.prose li { margin-block: .35em; }
.prose li::marker { color: var(--cobalt); }

/* axis-tick divider (signature) ------------------------------------------ */
.ticks {
  height: 14px; border-top: 1.5px solid var(--ink);
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 26px);
  background-position: top left; background-repeat: repeat-x; background-size: 26px 8px;
  opacity: .85; margin: 0;
}
.eyebrow {
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .14em;
  text-transform: uppercase; color: var(--cobalt); font-weight: 600;
  display: inline-flex; align-items: center; gap: .5em;
}
.eyebrow::before { content: ""; width: 1.6em; height: 0; border-top: 2px solid var(--amber); }

/* header / nav (CSS-only, no JS) ----------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: .58rem; font-weight: 820;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-size: 1.07rem;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand .glyph {
  width: 30px; height: 26px; flex: none; display: grid;
  grid-template-columns: repeat(4,1fr); align-items: end; gap: 2px;
}
.brand .glyph i { display:block; background: var(--cobalt); border-radius: 2px 2px 0 0; }
.brand .glyph i:nth-child(1){ height: 38%; }
.brand .glyph i:nth-child(2){ height: 72%; }
.brand .glyph i:nth-child(3){ height: 100%; background: var(--amber); }
.brand .glyph i:nth-child(4){ height: 56%; }
.brand b { color: var(--cobalt); }

.nav-toggle { display: none; }
.nav-burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; color: var(--ink);
}
.nav-burger svg { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: .15rem; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-weight: 580; font-size: var(--fs-sm);
  padding: .5rem .72rem; border-radius: 9px; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a.active { color: var(--cobalt); background: var(--cobalt-50); }
.nav-cta {
  background: var(--cobalt) !important; color: #fff !important; font-weight: 680 !important;
  padding: .55rem 1rem !important;
}
.nav-cta:hover { background: var(--cobalt-700) !important; }

@media (max-width: 880px) {
  .nav-burger { order: 3; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .12rem;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .6rem clamp(1rem,4vw,2rem) 1rem; box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .28s ease, visibility .28s;
  }
  .nav-links a { padding: .7rem .6rem; font-size: 1rem; }
  .nav-toggle:checked ~ .nav-links { max-height: 70vh; visibility: visible; overflow: auto; }
  .nav-cta { text-align: center; }
}

/* buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 680; font-size: var(--fs-sm); line-height: 1;
  padding: .8rem 1.25rem; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: 0 8px 18px -10px rgba(41,69,214,.8); }
.btn-primary:hover { background: var(--cobalt-700); color: #fff; }
.btn-amber { background: var(--amber); color: #3a2a06; }
.btn-amber:hover { background: var(--amber-600); color: #2a1f04; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cobalt); color: var(--cobalt); }
.btn-sm { padding: .55rem .85rem; font-size: var(--fs-xs); border-radius: 9px; }
.btn-block { width: 100%; }

/* hero ------------------------------------------------------------------- */
.hero { padding-top: clamp(1.8rem, 4vw, 3rem); padding-bottom: clamp(1.4rem, 3vw, 2rem); }
.hero h1 { max-width: 18ch; }
.hero .lead { font-size: clamp(1.02rem, .98rem + .4vw, 1.2rem); color: var(--ink-soft); max-width: 56ch; margin-top: .7rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); font-weight: 600;
  color: var(--ink-soft); background: #fff; border: 1px solid var(--line);
  padding: .34rem .7rem; border-radius: 999px;
}
.pill svg { width: 14px; height: 14px; color: var(--green); }

/* tool ------------------------------------------------------------------- */
.tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; margin-top: 1.5rem;
}
.tool-head {
  display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem,3vw,1.6rem); border-bottom: 1px solid var(--line); background: var(--paper);
}
.tool-head .title { font-weight: 760; font-size: 1.05rem; display: flex; align-items: center; gap: .55rem; }
.tool-head .title svg { width: 20px; height: 20px; color: var(--cobalt); }
.mode-switch { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.mode-switch label {
  font-size: var(--fs-xs); font-weight: 640; color: var(--ink-soft); cursor: pointer;
  padding: .42rem .7rem; border-radius: 8px; white-space: nowrap;
}
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch input:checked + label { background: #fff; color: var(--cobalt); box-shadow: var(--shadow); }

.tool-body { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 940px) { .tool-body { grid-template-columns: minmax(0,1.05fr) minmax(0,1.35fr); } }

.tool-input { padding: clamp(1rem,3vw,1.5rem); border-bottom: 1px solid var(--line); }
@media (min-width: 940px) { .tool-input { border-bottom: 0; border-right: 1px solid var(--line); } }

.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.field-label label { font-weight: 660; font-size: var(--fs-sm); }
.field-label .hint { font-size: var(--fs-xs); color: var(--ink-faint); }
.data-area {
  width: 100%; min-height: 168px; resize: vertical; font-family: var(--mono); font-size: .95rem; line-height: 1.6;
  color: var(--ink); background: #fbfcfe; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .8rem .9rem; tab-size: 8;
}
.data-area:focus { border-color: var(--cobalt); background: #fff; outline: none; box-shadow: 0 0 0 4px var(--cobalt-50); }
.input-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .7rem; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link-btn { background: none; border: 0; color: var(--cobalt); font: inherit; font-size: var(--fs-xs); font-weight: 620; cursor: pointer; padding: .3rem; }
.link-btn:hover { color: var(--cobalt-700); text-decoration: underline; }

.controls { margin-top: 1.1rem; display: grid; gap: 1rem; }
.control { }
.control > .field-label label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 660; }
.range-row { display: flex; align-items: center; gap: .8rem; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 999px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--cobalt); border: 3px solid #fff; box-shadow: var(--shadow); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--cobalt); border: 3px solid #fff; cursor: pointer; }
.range-val { font-family: var(--mono); font-weight: 680; min-width: 2.6ch; text-align: right; color: var(--cobalt); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: var(--fs-xs); font-weight: 620; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: .34rem .6rem; cursor: pointer; }
.chip:hover { border-color: var(--cobalt); color: var(--cobalt); }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .9rem; }
.toggle { display: flex; align-items: center; gap: .55rem; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--cobalt); cursor: pointer; }
.color-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.color-row input[type=color] { width: 42px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.text-field { width: 100%; font: inherit; font-size: var(--fs-sm); padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fbfcfe; color: var(--ink); }
.text-field:focus { border-color: var(--cobalt); outline: none; background: #fff; }

.tool-output { padding: clamp(1rem,3vw,1.5rem); min-width: 0; }
.chart-shell { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; }
.chart-shell canvas { width: 100%; height: auto; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  text-align: center; min-height: 240px; color: var(--ink-faint); padding: 1.5rem;
}
.empty svg { width: 48px; height: 48px; color: var(--line); }
.out-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.shape-note {
  margin-top: .9rem; font-size: var(--fs-sm); background: var(--amber-50); border: 1px solid #f6e2b8;
  border-radius: var(--radius-sm); padding: .7rem .85rem; color: #6b4e0e;
}
.shape-note b { color: #5a3f08; }

/* stat readout (monospace instrument panel) ------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-top: 1.2rem; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; padding: .7rem .8rem; }
.stat .k { font-size: var(--fs-xs); color: var(--ink-faint); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.stat .v { font-family: var(--mono); font-weight: 680; font-size: 1.12rem; color: var(--ink); margin-top: .15rem; }

/* tables ----------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 1.2rem; }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data-table th, table.data-table td { padding: .55rem .8rem; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table thead th { background: var(--paper); font-weight: 680; color: var(--ink); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
table.data-table tbody tr:hover { background: var(--cobalt-50); }
table.data-table td.num, table.data-table th.num { font-family: var(--mono); }
table.data-table tfoot td { font-weight: 700; background: var(--paper); }

/* generic compare table */
.compare { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.compare th, .compare td { padding: .7rem .85rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--ink); color: #fff; font-weight: 640; }
.compare tbody tr:nth-child(even) { background: var(--paper); }
.compare .yes { color: var(--green); font-weight: 700; }
.compare .no { color: var(--rose); font-weight: 700; }

/* feature / tool cards --------------------------------------------------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .grid-3 { grid-template-columns: repeat(3,1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.25rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem;
}
.card h3 { font-size: 1.1rem; }
.card p { font-size: var(--fs-sm); color: var(--ink-soft); }
.card .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--cobalt-50); color: var(--cobalt); margin-bottom: .3rem; }
.card .ico svg { width: 21px; height: 21px; }

.link-card {
  display: flex; align-items: flex-start; gap: .9rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow); transition: border-color .15s, transform .1s, box-shadow .15s;
}
.link-card:hover { border-color: var(--cobalt); transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }
.link-card .ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--cobalt-50); color: var(--cobalt); }
.link-card .ico svg { width: 22px; height: 22px; }
.link-card .lc-body strong { display: block; font-size: 1.02rem; color: var(--ink); }
.link-card .lc-body span { font-size: var(--fs-sm); color: var(--ink-soft); }
.link-card .arrow { margin-left: auto; align-self: center; color: var(--ink-faint); flex: none; }
.link-card:hover .arrow { color: var(--cobalt); }

/* steps ------------------------------------------------------------------ */
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: .9rem; }
.steps li { position: relative; padding-left: 3rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 2rem; height: 2rem; border-radius: 9px;
  background: var(--cobalt); color: #fff; font-family: var(--mono); font-weight: 700; font-size: .95rem;
  display: grid; place-items: center;
}
.steps li strong { display: block; color: var(--ink); }
.steps li p { margin-top: .15rem; font-size: var(--fs-sm); }

/* code block ------------------------------------------------------------- */
.code {
  background: #0f1830; color: #e7ecfb; border-radius: var(--radius-sm); overflow: auto;
  border: 1px solid #1f2c4f; margin: 1rem 0;
}
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .9rem; border-bottom: 1px solid #24335a; }
.code-head span { font-family: var(--mono); font-size: var(--fs-xs); color: #9fb0d8; letter-spacing: .04em; }
.code pre { margin: 0; padding: .9rem 1.1rem; font-family: var(--mono); font-size: .88rem; line-height: 1.7; }
.code .cm { color: #7e8db5; } .code .kw { color: #7fb0ff; } .code .st { color: #8ed8a8; } .code .fn { color: #f6c177; }

/* callouts --------------------------------------------------------------- */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--cobalt); background: var(--surface); border-radius: var(--radius-sm); padding: .9rem 1.05rem; margin: 1.1rem 0; font-size: var(--fs-sm); }
.callout.tip { border-left-color: var(--green); background: #f0faf5; }
.callout.warn { border-left-color: var(--amber); background: var(--amber-50); }
.callout strong { display: inline; }

/* FAQ (native details, no JS) -------------------------------------------- */
.faq { display: grid; gap: .6rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: .95rem 1.1rem; font-weight: 660; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--cobalt); transition: transform .2s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq .ans { padding: .2rem 1.1rem 1.05rem; color: var(--ink-soft); font-size: var(--fs-sm); }
.faq .ans p { margin-block: .6em; }
.faq .ans p:first-child { margin-top: .7em; }

/* breadcrumb ------------------------------------------------------------- */
.crumbs { font-size: var(--fs-xs); color: var(--ink-faint); padding-block: .9rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 560; }
.crumbs a:hover { color: var(--cobalt); }
.crumbs span[aria-current] { color: var(--ink); font-weight: 620; }
.crumbs .sep { color: var(--line); }

/* related ---------------------------------------------------------------- */
.related-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .related-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .related-grid { grid-template-columns: repeat(3,1fr); } }

/* ad slots --------------------------------------------------------------- */
.ad-slot {
  margin: 1.4rem auto; max-width: var(--maxw); width: 100%;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #f3f5fa 0 12px, #eef1f8 12px 24px);
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--ink-faint); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.ad-slot.in-wrap { margin-inline: 0; }

/* history (localStorage) ------------------------------------------------- */
.history { margin-top: 1.1rem; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.history-head h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.history-list { display: grid; gap: .4rem; }
.hist-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .55rem .7rem; cursor: pointer; font: inherit; }
.hist-item:hover { border-color: var(--cobalt); background: var(--cobalt-50); }
.hist-item .mini { font-family: var(--mono); font-size: var(--fs-xs); color: var(--cobalt); font-weight: 700; flex: none; }
.hist-item .meta { font-size: var(--fs-xs); color: var(--ink-faint); margin-left: auto; flex: none; }
.hist-empty { font-size: var(--fs-xs); color: var(--ink-faint); padding: .4rem 0; }

/* footer ----------------------------------------------------------------- */
.site-footer { background: #0f1830; color: #c5cfe6; margin-top: 3rem; }
.footer-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: 1fr; padding-block: clamp(2.4rem,5vw,3.4rem); }
@media (min-width: 620px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 920px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand .brand { color: #fff; }
.footer-brand .brand b { color: var(--amber); }
.footer-brand p { color: #8b97b8; font-size: var(--fs-sm); margin-top: .7rem; max-width: 34ch; }
.footer-col h5 { color: #fff; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8rem; font-weight: 700; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-col a { color: #b3bedb; text-decoration: none; font-size: var(--fs-sm); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #24335a; padding-block: 1.1rem; display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between; }
.footer-bottom p { color: #8b97b8; font-size: var(--fs-xs); }
.footer-bottom .fb-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-bottom .fb-links a { color: #b3bedb; font-size: var(--fs-xs); text-decoration: none; }
.footer-bottom .fb-links a:hover { color: #fff; }

/* cookie banner ---------------------------------------------------------- */
.cookie {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 80;
  width: min(680px, calc(100% - 2rem)); background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 1rem 1.1rem;
  display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; justify-content: space-between;
}
.cookie.hidden { display: none; }
.cookie p { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; flex: 1 1 280px; }
.cookie a { font-weight: 620; }
.cookie .cookie-actions { display: flex; gap: .5rem; }

/* 404 -------------------------------------------------------------------- */
.e404 { text-align: center; padding-block: clamp(3rem,8vw,6rem); }
.e404 .big { font-family: var(--mono); font-weight: 800; font-size: clamp(4.5rem, 18vw, 9rem); line-height: .9; color: var(--cobalt); letter-spacing: -.03em; }
.e404 .big .bars { display: inline-flex; align-items: flex-end; gap: 5px; height: .7em; margin: 0 .08em; vertical-align: baseline; }
.e404 .big .bars i { width: .16em; background: var(--amber); border-radius: 3px 3px 0 0; }
.e404 .big .bars i:nth-child(1){height:45%}.e404 .big .bars i:nth-child(2){height:100%}.e404 .big .bars i:nth-child(3){height:65%}

/* utility ---------------------------------------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 2rem; }
.muted { color: var(--ink-faint); }
.lead-section-head { max-width: 60ch; margin-bottom: 1.6rem; }
.lead-section-head h2 { margin-top: .4rem; }
.lead-section-head p { margin-top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag-row a { font-size: var(--fs-xs); font-weight: 580; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; text-decoration: none; }
.tag-row a:hover { border-color: var(--cobalt); color: var(--cobalt); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.4rem 0; }
.toc h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-bottom: .5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 1.5rem; }
.toc li { margin-block: .25rem; font-size: var(--fs-sm); }
@media (max-width: 560px){ .toc ol { columns: 1; } }

/* --- non-heading section labels (replaces former footer h5 / toc h4 / in-tool h3,h4 to keep a clean H1>H2>H3 outline) --- */
.footer-col .footer-h { color: #fff; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 .8rem; font-weight: 700; }
.toc .toc-h { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin: 0 0 .5rem; font-weight: 700; }
.history-head .block-title { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin: 0; font-weight: 700; }
.stats-block .block-title, .tool-output .block-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.3; }

/* --- figures (original illustrative diagrams + screenshot-ready slots) --- */
figure.fig { margin: 1.4rem 0; }
figure.fig img, figure.fig svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
figure.fig figcaption { font-size: var(--fs-sm); color: var(--ink-faint); margin-top: .55rem; text-align: center; }

/* --- byline / editorial credit --- */
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; font-size: var(--fs-sm); color: var(--ink-faint); margin: -.2rem 0 1.1rem; }
.byline a { color: var(--cobalt); font-weight: 600; }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); display: inline-block; }
