/* ==========================================================================
   net_tools — shared styles
   Every rule is scoped to .nt (a tool), .nt-shell (standalone header) or
   .nt-geo (location badge), so the file can be dropped into any site.
   Colours read the host site's own variables first (tomislavk.blog uses
   --bg, --surface, --ink, --accent …) and fall back to the same values.
   ========================================================================== */

:where(.nt, .nt-shell, .nt-geo, .nt-toast, .nt-about){
  --nt-bg:        var(--bg, #0f172a);
  --nt-surface:   var(--surface, #111827);
  --nt-surface-2: var(--surface-2, #162033);
  --nt-surface-3: var(--surface-3, #0b1220);
  --nt-line:      var(--line, #1e293b);
  --nt-line-2:    var(--line-strong, #334155);
  --nt-ink:       var(--ink, #f8fafc);
  --nt-muted:     var(--muted, #94a3b8);
  --nt-muted-2:   var(--muted-strong, #cbd5e1);
  --nt-accent:    var(--accent, #38bdf8);
  --nt-accent-2:  var(--accent-strong, #7dd3fc);
  --nt-accent-deep: var(--accent-deep, #2563eb);
  --nt-radius:    var(--radius, 8px);

  --nt-ok:        var(--success, #34d399);
  --nt-ok-ink:    #6ee7b7;
  --nt-ok-tint:   rgba(52, 211, 153, .08);
  --nt-ok-line:   rgba(52, 211, 153, .38);
  --nt-err:       #f87171;
  --nt-err-ink:   #fca5a5;
  --nt-err-tint:  rgba(248, 113, 113, .08);
  --nt-err-line:  rgba(248, 113, 113, .42);
  --nt-warn:      #fbbf24;
  --nt-warn-ink:  #fcd34d;
  --nt-warn-tint: rgba(251, 191, 36, .08);
  --nt-warn-line: rgba(251, 191, 36, .4);
  --nt-on-state:  #04121f;

  --nt-track-off: #334155;
  --nt-track-off-line: #475569;
  --nt-knob:      #e2e8f0;

  --nt-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nt-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--nt-ink);
  font-family: var(--nt-font);
}
:where([data-theme="light"]) :where(.nt, .nt-shell, .nt-geo, .nt-toast, .nt-about){
  --nt-bg:        var(--bg, #f8fafc);
  --nt-surface:   var(--surface, #ffffff);
  --nt-surface-2: var(--surface-2, #f1f5f9);
  --nt-surface-3: var(--surface-3, #eaf2fb);
  --nt-line:      var(--line, #dbe4ef);
  --nt-line-2:    var(--line-strong, #b8c7d9);
  --nt-ink:       var(--ink, #0f172a);
  --nt-muted:     var(--muted, #526177);
  --nt-muted-2:   var(--muted-strong, #334155);
  --nt-accent:    var(--accent, #0369a1);
  --nt-accent-2:  var(--accent-strong, #075985);
  --nt-accent-deep: var(--accent-deep, #1d4ed8);

  --nt-ok:        #059669;
  --nt-ok-ink:    #047857;
  --nt-ok-tint:   #ecfdf5;
  --nt-ok-line:   #a7f3d0;
  --nt-err:       #dc2626;
  --nt-err-ink:   #b91c1c;
  --nt-err-tint:  #fef2f2;
  --nt-err-line:  #fecaca;
  --nt-warn:      #d97706;
  --nt-warn-ink:  #b45309;
  --nt-warn-tint: #fffbeb;
  --nt-warn-line: #fde68a;
  --nt-on-state:  #ffffff;

  /* An off switch has to be legible against a near-white card, so the track carries
     real weight rather than the palest grey in the ramp */
  --nt-track-off: #94a3b8;
  --nt-track-off-line: #64748b;
  --nt-knob:      #ffffff;
}

/* ---------- standalone page (only used by this repo's own pages) ---------- */
html:has(body.nt-page){ font-size: clamp(15px, .3vw + 11.5px, 18px); background: #0f172a; }
html[data-theme="light"]:has(body.nt-page){ background: #f8fafc; }
body.nt-page{
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(56,189,248,.10), transparent 60%),
    #0f172a;
  color: #f8fafc;
  font: 1rem/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[data-theme="light"] body.nt-page{
  background: radial-gradient(1200px 500px at 15% -10%, rgba(3,105,161,.08), transparent 60%), #f8fafc;
  color: #0f172a;
}

/* ---------- base inside a tool ---------- */
.nt, .nt *, .nt-shell, .nt-shell *, .nt-geo, .nt-geo *,
.nt-about, .nt-about *{ box-sizing: border-box; }
.nt{
  display: block; max-width: 1240px; margin: 0 auto;
  padding-inline: clamp(16px, 2.5vw, 32px); padding-block: 2.2rem 4rem;
  line-height: 1.55;
}
.nt :focus-visible, .nt-shell :focus-visible, .nt-geo :focus-visible{ outline: 2px solid var(--nt-accent); outline-offset: 2px; }
.nt button, .nt-shell button, .nt-geo button{ font: inherit; color: inherit; cursor: pointer; }
.nt a{ color: var(--nt-accent); text-decoration: none; }
.nt a:hover{ text-decoration: underline; }
.nt code, .nt .mono{ font-family: var(--nt-mono); }
.nt h1, .nt h2, .nt h3, .nt p{ margin: 0; }

/* ---------- hero ----------
   A tool is not a landing page: the input is what people came for. The title and its
   one-line description sit side by side so the query bar stays near the top of the screen. */
.nt-hero{
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline;
  gap: .25rem 2.25rem; margin-bottom: 1.1rem;
}
.nt-eyebrow{
  grid-column: 1 / -1;
  font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--nt-accent); margin-bottom: .1rem;
}
.nt-hero h1{
  font-size: clamp(1.7rem, 1.1vw + 1.25rem, 2.3rem); font-weight: 800; letter-spacing: -.025em;
  line-height: 1.1; text-wrap: balance;
}
.nt-hero .nt-lede{ color: var(--nt-muted-2); font-size: .97rem; max-width: 46rem; }
@media (max-width: 860px){
  .nt-hero{ grid-template-columns: 1fr; gap: .45rem; }
}

/* ---------- panel & form ---------- */
.nt-panel{
  background: var(--nt-surface); border: 1px solid var(--nt-line); border-radius: var(--nt-radius);
  padding: 1.15rem;
}
.nt-label{
  display: block; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--nt-muted); margin-bottom: .45rem;
}
.nt-row{ display: flex; gap: .6rem; flex-wrap: wrap; align-items: stretch; }
.nt-row > .nt-grow{ flex: 1 1 16rem; min-width: 0; }
.nt-input, .nt-select, .nt-textarea{
  width: 100%; min-width: 0; color: var(--nt-ink);
  background: var(--nt-surface-3); border: 1px solid var(--nt-line-2); border-radius: var(--nt-radius);
  font-family: var(--nt-mono); font-size: 1rem;
}
.nt-input{ padding: .8rem .95rem; font-size: clamp(1.05rem, .6vw + .9rem, 1.35rem); font-weight: 500; }
.nt-input.nt-sm{ font-size: .95rem; padding: .6rem .8rem; }
.nt-input::placeholder, .nt-textarea::placeholder{ color: var(--nt-muted); opacity: .7; }
.nt-input:focus, .nt-select:focus, .nt-textarea:focus{ border-color: var(--nt-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--nt-accent) 22%, transparent); }
.nt-select{ width: auto; padding: 0 .8rem; min-height: 3.2rem; font-family: var(--nt-font); font-size: .92rem; font-weight: 500; }
.nt-textarea{ padding: .7rem .85rem; font-size: .9rem; line-height: 1.55; resize: vertical; min-height: 8rem; }

.nt-btn{
  border: 0; border-radius: var(--nt-radius); min-height: 3.2rem; padding: 0 1.5rem;
  font-weight: 700; font-size: .98rem; color: #fff;
  background: linear-gradient(135deg, #2563eb, #0284c7);
  box-shadow: 0 10px 28px rgba(37, 99, 235, .28);
  transition: transform .12s ease, filter .15s ease;
}
.nt-btn:hover{ filter: brightness(1.08); }
.nt-btn:active{ transform: scale(.97); }
.nt-btn[disabled]{ opacity: .6; cursor: progress; }
.nt-ghost{
  border: 1px solid var(--nt-line-2); background: transparent; border-radius: var(--nt-radius);
  padding: .32rem .7rem; font-size: .82rem; font-weight: 500; color: var(--nt-muted-2); white-space: nowrap;
}
.nt-ghost:hover{ color: var(--nt-ink); border-color: var(--nt-accent); }
.nt-ghost[aria-pressed="true"]{ color: var(--nt-accent); border-color: var(--nt-accent); background: color-mix(in srgb, var(--nt-accent) 10%, transparent); }

.nt-hint{ margin-top: .6rem !important; font-size: .86rem; color: var(--nt-muted); }
.nt-hint.bad{ color: var(--nt-err-ink); }
.nt-cmd{
  display: flex; align-items: center; gap: .6rem; margin-top: .85rem; padding-top: .85rem;
  border-top: 1px dashed var(--nt-line-2);
}
/* As its own panel the command needs no divider: the panel edge already separates it */
.nt-dig{ margin-top: .8rem; }
.nt-dig .nt-cmd{ margin: 0; padding: 0; border-top: 0; }
.nt-dig .nt-cmd code{ font-size: .86rem; padding-bottom: .2rem; }
.nt-cmd code{ flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: .84rem; color: var(--nt-muted); scrollbar-width: thin; }
.nt-cmd code b{ color: var(--nt-ink); font-weight: 500; }
.nt-cmd code i{ font-style: normal; color: var(--nt-accent); }

/* segmented tabs */
.nt-tabs{ display: inline-flex; gap: .25rem; padding: .25rem; background: var(--nt-surface-3); border: 1px solid var(--nt-line); border-radius: calc(var(--nt-radius) + 2px); flex-wrap: wrap; }
.nt-tab{ border: 0; background: transparent; border-radius: 6px; padding: .45rem .9rem; font-size: .88rem; font-weight: 600; color: var(--nt-muted); }
.nt-tab[aria-selected="true"]{ background: var(--nt-surface-2); color: var(--nt-ink); box-shadow: inset 0 0 0 1px var(--nt-line-2); }
.nt-tab:hover{ color: var(--nt-ink); }

/* ---------- summary bar ---------- */
.nt-bar{ display: flex; align-items: center; justify-content: space-between; gap: .8rem 1.4rem; flex-wrap: wrap; margin: 1.6rem 0 .85rem; }
.nt-tally{ display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .9rem; color: var(--nt-muted); font-variant-numeric: tabular-nums; }
.nt-tally span{ display: inline-flex; align-items: center; gap: .45rem; }
.nt-tally strong{ color: var(--nt-ink); font-weight: 700; }
.nt-dot{ width: .55rem; height: .55rem; border-radius: 50%; background: var(--nt-muted); display: inline-block; }
.nt-dot.ok{ background: var(--nt-ok); } .nt-dot.err{ background: var(--nt-err); } .nt-dot.warn{ background: var(--nt-warn); }
.nt-leds{ display: flex; gap: .25rem; flex-wrap: wrap; }
.nt-led{
  min-width: 2.6rem; height: 1.55rem; border-radius: 5px; border: 1px solid var(--nt-line-2);
  background: var(--nt-surface); font: 700 .62rem/1 var(--nt-mono); color: var(--nt-muted); padding: 0 .3rem;
}
.nt-led[data-state="found"]{ background: var(--nt-ok); border-color: var(--nt-ok); color: var(--nt-on-state); }
.nt-led[data-state="error"]{ background: var(--nt-err); border-color: var(--nt-err); color: var(--nt-on-state); }
.nt-led[data-state="warn"]{ background: var(--nt-warn); border-color: var(--nt-warn); color: var(--nt-on-state); }
.nt-led[data-state="empty"]{ color: var(--nt-ink); }
.nt-led[data-state="off"]{ border-style: dashed; background: transparent; }
.nt-led[data-state="loading"]{ animation: nt-pulse 1s ease-in-out infinite; }
.nt-presets{ display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- result cards ---------- */
.nt-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr));
  grid-auto-flow: row dense; gap: .8rem; align-items: start;
}
/* nt-core gives each child a row span from its height, so they pack upwards with no dead space.
   Applies to any grid it is called on: result cards (.nt-grid) and panel columns (.nt-split). */
.nt-masonry{ grid-auto-rows: 4px; align-items: start; }
.nt-card{
  background: var(--nt-surface); border: 1px solid var(--nt-line); border-radius: var(--nt-radius);
  min-width: 0; transition: border-color .25s ease, background-color .25s ease;
}
@media (min-width: 52rem){ .nt-card.wide{ grid-column: span 2; } }
.nt-card.full{ grid-column: 1 / -1; }
.nt-card[data-state="off"]{ order: 1; background: transparent; border-style: dashed; border-color: var(--nt-line-2); }
.nt-card[data-state="found"]{ border-color: var(--nt-ok-line); background: linear-gradient(var(--nt-ok-tint), var(--nt-surface) 4.5rem); }
.nt-card[data-state="error"]{ border-color: var(--nt-err-line); background: linear-gradient(var(--nt-err-tint), var(--nt-surface) 4.5rem); }
.nt-card[data-state="warn"]{ border-color: var(--nt-warn-line); background: linear-gradient(var(--nt-warn-tint), var(--nt-surface) 4.5rem); }

.nt-card-head{ display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; }
.nt-tag{
  flex: none; min-width: 4.3rem; text-align: center; padding: .38rem .5rem; border-radius: 6px;
  font: 700 .86rem/1 var(--nt-mono); letter-spacing: .02em;
  background: var(--nt-surface-2); color: var(--nt-ink); border: 1px solid var(--nt-line-2);
}
.nt-card[data-state="off"] .nt-tag{ background: transparent; color: var(--nt-muted); }
.nt-card[data-state="found"] .nt-tag{ background: var(--nt-ok); border-color: var(--nt-ok); color: var(--nt-on-state); }
.nt-card[data-state="error"] .nt-tag{ background: var(--nt-err); border-color: var(--nt-err); color: var(--nt-on-state); }
.nt-card[data-state="warn"] .nt-tag{ background: var(--nt-warn); border-color: var(--nt-warn); color: var(--nt-on-state); }
.nt-meta{ flex: 1; min-width: 0; }
.nt-meta h3{ font-size: .96rem; font-weight: 700; line-height: 1.3; }
.nt-card[data-state="off"] .nt-meta h3{ color: var(--nt-muted); }
.nt-status{ margin-top: .12rem !important; font-size: .85rem; color: var(--nt-muted); font-variant-numeric: tabular-nums; }
.nt-card[data-state="found"] .nt-status{ color: var(--nt-ok-ink); font-weight: 600; }
.nt-card[data-state="error"] .nt-status{ color: var(--nt-err-ink); font-weight: 600; }
.nt-card[data-state="warn"] .nt-status{ color: var(--nt-warn-ink); font-weight: 600; }
.nt-card[data-state="loading"] .nt-status::after{
  content: ""; display: inline-block; width: .65rem; height: .65rem; margin-left: .5rem; vertical-align: -1px;
  border: 2px solid var(--nt-line-2); border-top-color: var(--nt-accent); border-radius: 50%; animation: nt-spin .7s linear infinite;
}
.nt-card-body{ padding: 0 1rem .9rem; }
.nt-card-body:empty{ display: none; }

/* slider switch */
.nt-switch{ position: relative; flex: none; width: 3rem; height: 1.72rem; display: inline-block; }
.nt-switch input{ position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.nt-track{
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--nt-track-off); box-shadow: inset 0 0 0 1px var(--nt-track-off-line);
  transition: background-color .2s ease, box-shadow .2s ease;
}
.nt-track::after{
  content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.32rem; height: 1.32rem; border-radius: 50%;
  background: var(--nt-knob); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .22s cubic-bezier(.3,1.4,.5,1);
}
.nt-switch:hover .nt-track{ box-shadow: inset 0 0 0 1px var(--nt-accent); }
.nt-switch input:checked + .nt-track{ background: var(--nt-accent); box-shadow: none; }
/* standalone switches that mean "on = good", to match the green switches on result cards */
.nt-switch.on-ok input:checked + .nt-track{ background: var(--nt-ok); }
.nt-card[data-state="found"] .nt-switch input:checked + .nt-track{ background: var(--nt-ok); }
.nt-card[data-state="error"] .nt-switch input:checked + .nt-track{ background: var(--nt-err); }
.nt-card[data-state="warn"] .nt-switch input:checked + .nt-track{ background: var(--nt-warn); }
.nt-switch input:checked + .nt-track::after{ transform: translateX(1.28rem); background: #fff; }
.nt-switch input:focus-visible + .nt-track{ outline: 2px solid var(--nt-accent); outline-offset: 2px; }

/* record rows */
.nt-records{ list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: 0 1.4rem; }
.nt-records.one{ grid-template-columns: 1fr; }
.nt-records.scrolly{ max-height: 24rem; overflow-y: auto; scrollbar-width: thin; padding-right: .2rem; }
.nt-records.clamped{ max-height: 24rem; overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.nt-more{ margin-top: .55rem; width: 100%; }
/* The card is the box. Rows inside it are separated by a hairline, not boxed again. */
.nt-rec{
  display: flex; align-items: flex-start; gap: .6rem; min-width: 0;
  border-bottom: 1px solid var(--nt-line); padding: .5rem .1rem;
  animation: nt-rise .3s ease both;
}
.nt-rec:last-child{ border-bottom: 0; }
.nt-rec:hover{ background: var(--nt-surface-3); }
.nt-val{ flex: 1; min-width: 0; font: .86rem/1.55 var(--nt-mono); overflow-wrap: anywhere; color: var(--nt-ink); }
.nt-pri{ display: inline-block; font: 700 .72rem/1 var(--nt-mono); color: var(--nt-accent); background: color-mix(in srgb, var(--nt-accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--nt-accent) 35%, transparent); border-radius: 4px; padding: .2rem .33rem; margin-right: .5rem; vertical-align: 1px; }
.nt-ttl{ flex: none; font: .78rem/1.55 var(--nt-mono); color: var(--nt-muted); font-variant-numeric: tabular-nums; }
.nt-copy{ flex: none; border: 0; background: transparent; color: var(--nt-muted); font-size: .78rem; padding: 0 .15rem; line-height: 1.55; }
.nt-copy:hover{ color: var(--nt-accent); }
.nt-via{ font-size: .82rem; color: var(--nt-muted); margin: 0 0 .5rem !important; }
.nt-via code{ color: var(--nt-ink); }
.nt-msg{ font-size: .9rem; border-radius: 6px; padding: .62rem .8rem; border: 1px solid; }
.nt-msg small{ display: block; color: var(--nt-muted); margin-top: .2rem; font-size: .82rem; }
.nt-msg.err{ color: var(--nt-err-ink); background: var(--nt-err-tint); border-color: var(--nt-err-line); }
.nt-msg.warn{ color: var(--nt-warn-ink); background: var(--nt-warn-tint); border-color: var(--nt-warn-line); }
.nt-msg.ok{ color: var(--nt-ok-ink); background: var(--nt-ok-tint); border-color: var(--nt-ok-line); }
.nt-msg.info{ color: var(--nt-muted-2); background: var(--nt-surface-3); border-color: var(--nt-line); }
.nt-msgs{ display: flex; flex-direction: column; gap: .4rem; }
.nt-note{ font-size: .86rem; color: var(--nt-muted); }

/* key / value table (sipcalc style) */
.nt-kv{ display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: 0; margin: 0; font-size: .9rem; }
.nt-kv dt, .nt-kv dd{ padding: .5rem .2rem; border-bottom: 1px solid var(--nt-line); margin: 0; }
.nt-kv dt{ color: var(--nt-muted); padding-right: 1rem; }
.nt-kv dd{ font-family: var(--nt-mono); overflow-wrap: anywhere; display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.nt-kv dd .nt-copy{ opacity: 0; transition: opacity .15s; }
.nt-kv dd:hover .nt-copy, .nt-kv dd:focus-within .nt-copy{ opacity: 1; }
.nt-kv dt:last-of-type, .nt-kv dd:last-of-type{ border-bottom: 0; }
.nt-kv .nt-sub{ color: var(--nt-muted); font-size: .82rem; }

/* data table */
.nt-table-wrap{ overflow-x: auto; border: 1px solid var(--nt-line); border-radius: var(--nt-radius); }
.nt-table{ width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.nt-table th{ text-align: left; font-size: .8rem; font-weight: 700; color: var(--nt-muted-2); background: var(--nt-surface-2); padding: .55rem .75rem; white-space: nowrap; position: sticky; top: 0; }
.nt-table td{ padding: .45rem .75rem; border-top: 1px solid var(--nt-line); font-family: var(--nt-mono); white-space: nowrap; }
.nt-table tr:hover td{ background: var(--nt-surface-3); }
.nt-table .num{ color: var(--nt-muted); }

/* chips */
.nt-chips{ display: flex; gap: .35rem; flex-wrap: wrap; }
.nt-chip{ display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; padding: .22rem .55rem; border-radius: 999px; border: 1px solid var(--nt-line-2); color: var(--nt-muted-2); background: var(--nt-surface-3); }
.nt-chip.ok{ color: var(--nt-ok-ink); border-color: var(--nt-ok-line); background: var(--nt-ok-tint); }
.nt-chip.err{ color: var(--nt-err-ink); border-color: var(--nt-err-line); background: var(--nt-err-tint); }
.nt-chip.warn{ color: var(--nt-warn-ink); border-color: var(--nt-warn-line); background: var(--nt-warn-tint); }
.nt-chip.mono{ font-family: var(--nt-mono); font-weight: 500; }

/* verdict banner */
.nt-verdict{ display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 1.15rem; border-radius: var(--nt-radius); border: 1px solid var(--nt-line); background: var(--nt-surface); margin: 1.4rem 0 .9rem; }
.nt-verdict[data-state="found"]{ border-color: var(--nt-ok-line); background: var(--nt-ok-tint); }
.nt-verdict[data-state="warn"]{ border-color: var(--nt-warn-line); background: var(--nt-warn-tint); }
.nt-verdict[data-state="error"]{ border-color: var(--nt-err-line); background: var(--nt-err-tint); }
.nt-verdict .nt-grade{ font: 800 2.2rem/1 var(--nt-font); letter-spacing: -.03em; min-width: 3.2rem; text-align: center; }
.nt-verdict[data-state="found"] .nt-grade{ color: var(--nt-ok); }
.nt-verdict[data-state="warn"] .nt-grade{ color: var(--nt-warn); }
.nt-verdict[data-state="error"] .nt-grade{ color: var(--nt-err); }
.nt-verdict h2{ font-size: 1.1rem; font-weight: 700; }
.nt-verdict p{ color: var(--nt-muted-2); font-size: .92rem; }
.nt-verdict .nt-grow{ flex: 1 1 18rem; }

/* SPF include tree */
.nt-tree{ list-style: none; margin: 0; padding: 0; font: .84rem/1.6 var(--nt-mono); }
.nt-tree ul{ list-style: none; margin: 0; padding-left: 1.1rem; border-left: 1px dashed var(--nt-line-2); margin-left: .35rem; }
.nt-tree li{ padding: .12rem 0; overflow-wrap: anywhere; }
.nt-tree .cost{ display: inline-block; min-width: 1.6rem; text-align: center; font-size: .7rem; font-weight: 700; border-radius: 4px; padding: .05rem .25rem; margin-right: .4rem; background: var(--nt-surface-2); color: var(--nt-accent); border: 1px solid var(--nt-line-2); }
.nt-tree .cost.zero{ color: var(--nt-muted); }
.nt-tree .bad{ color: var(--nt-err-ink); }

/* lookup-count meter */
.nt-meter{ display: flex; gap: 3px; margin: .3rem 0 .6rem; }
.nt-meter i{ flex: 1; height: .5rem; border-radius: 2px; background: var(--nt-surface-2); border: 1px solid var(--nt-line); }
.nt-meter i.on{ background: var(--nt-ok); border-color: var(--nt-ok); }
.nt-meter.warn i.on{ background: var(--nt-warn); border-color: var(--nt-warn); }
.nt-meter.err i.on{ background: var(--nt-err); border-color: var(--nt-err); }

/* bit ruler (subnet) */
.nt-bits{ display: flex; flex-direction: column; gap: .35rem; font-family: var(--nt-mono); }
.nt-bits-row{ display: flex; flex-wrap: wrap; gap: .5rem .8rem; }
.nt-octet{ display: flex; gap: 2px; }
.nt-bit{
  width: 1.15rem; height: 1.6rem; display: grid; place-items: center; border-radius: 3px; font-size: .78rem; font-weight: 700;
  background: var(--nt-surface-3); color: var(--nt-muted); border: 1px solid var(--nt-line);
}
.nt-bit.net{ background: color-mix(in srgb, var(--nt-accent) 18%, var(--nt-surface)); color: var(--nt-accent-2); border-color: color-mix(in srgb, var(--nt-accent) 45%, transparent); }
.nt-bits.v6 .nt-bit{ width: .62rem; height: 1.25rem; font-size: .56rem; border-radius: 2px; }
.nt-bits.v6 .nt-bits-row{ gap: .35rem .55rem; }
.nt-bits-legend{ display: flex; gap: 1rem; font-size: .78rem; color: var(--nt-muted); font-family: var(--nt-font); flex-wrap: wrap; }
.nt-bits-legend span{ display: inline-flex; align-items: center; gap: .35rem; }
.nt-bits-legend i{ width: .7rem; height: .7rem; border-radius: 2px; display: inline-block; background: var(--nt-surface-3); border: 1px solid var(--nt-line-2); }
.nt-bits-legend i.net{ background: color-mix(in srgb, var(--nt-accent) 30%, var(--nt-surface)); border-color: var(--nt-accent); }

/* range slider (prefix length) */
.nt-range{ display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.nt-range input[type="range"]{ flex: 1 1 14rem; accent-color: var(--nt-accent); height: 1.5rem; min-width: 0; }
.nt-range output{ font: 700 1.05rem var(--nt-mono); color: var(--nt-accent); min-width: 3.2rem; }

/* two-column layout */
.nt-split{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); gap: .9rem; align-items: start; }
/* Sentence case: uppercase is reserved for form labels, so a page has one kind of small-caps, not three */
.nt-section-title{ font-size: .95rem; font-weight: 700; color: var(--nt-ink); margin: 0 0 .7rem !important; display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.nt-stack{ display: flex; flex-direction: column; gap: .9rem; }
.nt-empty{ padding: 2.2rem 1rem; text-align: center; color: var(--nt-muted); border: 1px dashed var(--nt-line-2); border-radius: var(--nt-radius); }
.nt-flag{ width: 1.35rem; height: 1rem; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); vertical-align: -2px; flex: none; }
.nt-flag.lg{ width: 2.4rem; height: 1.8rem; border-radius: 3px; }
details.nt-raw{ margin-top: .7rem; }
details.nt-raw summary{ cursor: pointer; font-size: .82rem; color: var(--nt-muted); }
details.nt-raw pre{ max-height: 22rem; overflow: auto; font: .78rem/1.5 var(--nt-mono); background: var(--nt-surface-3); border: 1px solid var(--nt-line); border-radius: 6px; padding: .7rem; margin: .5rem 0 0; color: var(--nt-muted-2); }

.nt-foot{ margin-top: 2.2rem; font-size: .82rem; color: var(--nt-muted); }

/* ---------- form grids, stats, bars, code (EVPN calculator) ---------- */
.nt-fields{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 100%), 1fr)); gap: .85rem 1rem; }
.nt-field{ display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.nt-field .nt-label{ margin: 0; }
.nt-field .nt-input, .nt-field .nt-select{ width: 100%; font-size: .95rem; padding: .5rem .7rem; min-height: 2.6rem; }
.nt-field small{ color: var(--nt-muted); font-size: .76rem; line-height: 1.35; }
.nt-field.full{ grid-column: 1 / -1; }
.nt-field .nt-range output{ font-size: .95rem; min-width: 2.8rem; }
.nt-check{ display: flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .88rem; color: var(--nt-muted-2); }
.nt-tenants{ display: flex; flex-direction: column; gap: .5rem; }
.nt-tenant{ display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(9rem, 2fr) auto; gap: .5rem; align-items: center; }
.nt-tenant .nt-input{ font-size: .92rem; padding: .5rem .7rem; }
.nt-stats{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: .8rem; }
.nt-stat{ background: var(--nt-surface); border: 1px solid var(--nt-line); border-radius: var(--nt-radius); padding: .95rem 1.05rem; }
.nt-stat.lead{ border-color: color-mix(in srgb, var(--nt-accent) 50%, transparent); background: linear-gradient(color-mix(in srgb, var(--nt-accent) 8%, var(--nt-surface)), var(--nt-surface)); }
.nt-stat b{ display: block; font: 800 clamp(1.55rem, 1.4vw + 1rem, 2.2rem)/1.1 var(--nt-font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--nt-ink); }
.nt-stat span{ display: block; margin-top: .3rem; font-size: .82rem; color: var(--nt-muted); line-height: 1.4; }
.nt-hbar{ height: .7rem; background: var(--nt-surface-2); border-radius: 4px; overflow: hidden; min-width: 8rem; }
.nt-hbar i{ display: block; height: 100%; background: var(--nt-accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.nt-table td.wrap{ white-space: normal; font-family: var(--nt-font); color: var(--nt-muted); font-size: .82rem; min-width: 14rem; }
.nt-table td.r{ text-align: right; }
.nt-table tfoot td{ font-weight: 700; background: var(--nt-surface-2); }
.nt-code{
  max-height: 38rem; overflow: auto; margin: 0; padding: .9rem 1rem; white-space: pre;
  font: .8rem/1.6 var(--nt-mono); color: var(--nt-muted-2);
  background: var(--nt-surface-3); border: 1px solid var(--nt-line); border-radius: 6px;
}
.nt-code .c{ color: var(--nt-muted); font-style: italic; }
.nt-code .k{ color: var(--nt-accent-2); }

/* ---------- standalone header ---------- */
.nt-shell{
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--nt-bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--nt-line);
}
.nt-shell-inner{ max-width: 1240px; margin: 0 auto; padding: .8rem clamp(16px, 2.5vw, 32px); display: flex; align-items: center; gap: 1rem 1.4rem; flex-wrap: wrap; }
.nt-brand{ display: flex; align-items: center; gap: .7rem; color: var(--nt-ink); text-decoration: none; }
.nt-mark{
  width: 2.5rem; height: 2.5rem; border-radius: 8px; display: grid; place-items: center;
  font: 800 .95rem/1 var(--nt-mono); color: var(--nt-ink); letter-spacing: -.04em;
  background: linear-gradient(var(--nt-surface), var(--nt-surface)) padding-box, linear-gradient(135deg, #38bdf8, #2563eb) border-box;
  border: 2px solid transparent;
}
.nt-brand strong{ display: block; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.nt-brand small{ display: block; color: var(--nt-muted); font-size: .76rem; }
.nt-nav{ display: flex; gap: .2rem; flex-wrap: wrap; }
.nt-nav a{ color: var(--nt-muted-2); text-decoration: none; font-size: .9rem; font-weight: 500; padding: .4rem .7rem; border-radius: 6px; }
.nt-nav a:hover{ color: var(--nt-ink); background: var(--nt-surface-2); }
.nt-nav a[aria-current="page"]{ color: var(--nt-accent); background: color-mix(in srgb, var(--nt-accent) 10%, transparent); }
.nt-shell-end{ margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.nt-theme{ border: 0; background: transparent; padding: 0; }
.nt-theme-track{ display: block; width: 3.1rem; height: 1.75rem; border-radius: 999px; background: var(--nt-surface-2); border: 1px solid var(--nt-line-2); position: relative; }
.nt-theme-thumb{ position: absolute; top: .17rem; left: .2rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.nt-theme[aria-pressed="true"] .nt-theme-thumb{ transform: translateX(1.3rem); }

/* ---------- location badge (header, upper right) ---------- */
.nt-geo{ position: relative; display: inline-block; font-family: var(--nt-font); }
.nt-geo-btn{
  display: inline-flex; align-items: center; gap: .5rem; max-width: 22rem;
  border: 1px solid var(--nt-line-2); background: var(--nt-surface); border-radius: 999px;
  padding: .32rem .75rem .32rem .45rem; font-size: .82rem; color: var(--nt-ink); line-height: 1.2;
}
.nt-geo-btn:hover{ border-color: var(--nt-accent); }
.nt-geo-btn .ip{ font-family: var(--nt-mono); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.nt-geo-btn .place{ color: var(--nt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9rem; }
/* a flag is 2:1, so cropping it to a circle hides the part that identifies it */
.nt-geo-btn .nt-flag{ width: 1.4rem; height: 1.05rem; border-radius: 2px; }
.nt-geo-btn .nt-geo-ph{ width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--nt-surface-2); animation: nt-pulse 1s ease-in-out infinite; }
.nt-geo-pop{
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 40; width: min(20rem, calc(100vw - 32px));
  background: var(--nt-surface); border: 1px solid var(--nt-line-2); border-radius: var(--nt-radius);
  box-shadow: 0 24px 60px rgba(2, 6, 23, .45); padding: .9rem; color: var(--nt-ink);
}
.nt-geo-pop h4{ margin: 0 0 .6rem; font-size: .92rem; color: var(--nt-ink); font-weight: 700; }
.nt-geo-pop .nt-kv{ font-size: .84rem; grid-template-columns: max-content 1fr; }
.nt-geo-pop .nt-kv dt, .nt-geo-pop .nt-kv dd{ padding: .35rem .1rem; }
.nt-geo-pop .nt-kv dd{ font-size: .8rem; }
.nt-geo-pop a{ display: inline-block; margin-top: .7rem; color: var(--nt-accent); font-size: .85rem; font-weight: 600; text-decoration: none; }
.nt-geo-pop a:hover{ text-decoration: underline; }
.nt-geo-pop .src{ font-size: .72rem; color: var(--nt-muted); margin-top: .5rem; }

/* ---------- toast ---------- */
.nt-toast{
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 1.2rem);
  background: var(--nt-ink); color: var(--nt-bg); padding: .5rem 1rem; border-radius: 999px; font-size: .86rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.nt-toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* ---------- hub ---------- */
.nt-hub{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); gap: .9rem; }
.nt-hub .try{ margin-top: auto; padding-top: .7rem; font: .82rem var(--nt-mono); color: var(--nt-muted); border-top: 1px solid var(--nt-line); }
.nt-hub .try b{ color: var(--nt-accent); font-weight: 500; }
.nt-hub a{
  display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem; border-radius: var(--nt-radius);
  background: var(--nt-surface); border: 1px solid var(--nt-line); color: var(--nt-ink); text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}
.nt-hub a:hover{ border-color: var(--nt-accent); transform: translateY(-2px); text-decoration: none; }
.nt-hub .k{ font: 700 .78rem var(--nt-mono); color: var(--nt-accent); }
.nt-hub h2{ font-size: 1.15rem; font-weight: 700; }
.nt-hub p{ color: var(--nt-muted); font-size: .92rem; }

@keyframes nt-spin{ to{ transform: rotate(360deg); } }
@keyframes nt-pulse{ 50%{ opacity: .4; } }
@keyframes nt-rise{ from{ opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce){
  .nt *, .nt *::before, .nt *::after, .nt-shell *, .nt-geo *{ animation: none !important; transition: none !important; }
}
/* ---------- phones: keep the standalone header short ---------- */
@media (max-width: 680px){
  .nt-shell-inner{ gap: .55rem .8rem; padding-block: .6rem; }
  .nt-brand small{ display: none; }
  .nt-mark{ width: 2.1rem; height: 2.1rem; }
  /* one swipeable row instead of three wrapped ones */
  .nt-nav{
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(clamp(16px, 2.5vw, 32px) * -1); padding-inline: clamp(16px, 2.5vw, 32px);
  }
  .nt-nav::-webkit-scrollbar{ display: none; }
  .nt-nav a{ white-space: nowrap; }
}

/* ---------- touch screens: bigger hit areas, same look ---------- */
@media (pointer: coarse){
  .nt-copy{ display: inline-flex; align-items: center; min-height: 2.4rem; padding: 0 .55rem; }
  .nt-ghost{ min-height: 2.4rem; padding-block: .5rem; }
  .nt-tab{ min-height: 2.4rem; }
  .nt-led{ min-height: 2rem; }
  .nt-theme{ padding-block: .55rem; }          /* grows the target, not the switch */
  .nt-geo-btn{ min-height: 2.4rem; }
  /* the switch input is invisible and sits on top of the track, so stretching it
     past the track enlarges the tap area without moving anything on screen */
  .nt-switch input{ inset: -0.6rem -0.3rem; }
  .nt-range input[type="range"]{ height: 2.4rem; }
  .nt-kv dd .nt-copy{ opacity: 1; }            /* no hover on touch, so always show it */
}


/* ==========================================================================
   Notes under a tool, on the standalone pages only. The Jekyll build has its
   own .tool-notes, styled by the blog, so this is scoped to body.nt-page and
   sits before the media queries that end the file.
   ========================================================================== */
.nt-page main.nt{ padding-bottom: 2.4rem; }    /* the notes supply the rest */

.nt-about{
  max-width: 1240px; margin: 0 auto;
  padding-inline: clamp(16px, 2.5vw, 32px);
  padding-block: 2.2rem 4rem;
  border-top: 1px solid var(--nt-line);
  line-height: 1.6;
}
.nt-about h2{
  margin: 0 0 .55rem; font-size: 1rem; font-weight: 650;
  letter-spacing: -0.01em; color: var(--nt-ink);
}
/* A single measure-capped column left the notes at half the width of the tool
   above them, which reads as a mistake rather than a choice. Two columns fill
   the width the rest of the page uses and keep the line at a readable length;
   below the breakpoint one column does the same job. */
.nt-about p{ margin: 0; max-width: 78ch; font-size: .95rem; color: var(--nt-muted-2); }
@media (min-width: 56rem){
  .nt-about p{ max-width: none; columns: 2; column-gap: clamp(2rem, 4vw, 3.5rem); }
}
.nt-about code{ font-family: var(--nt-mono); font-size: .9em; }
.nt-about a{ color: var(--nt-accent); text-decoration: none; }
.nt-about a:hover{ text-decoration: underline; }

/* Without the border the notes would float; without the narrower gutter they
   would not line up with the tool above them on a phone. */
@media (max-width: 680px){
  .nt-about{ padding-block: 1.8rem 3rem; }
}

@media (max-width: 560px){
  .nt-row > .nt-btn, .nt-row > .nt-select{ flex: 1 1 auto; }
  .nt-bar{ flex-direction: column; align-items: flex-start; }
  .nt-kv{ grid-template-columns: 1fr; }
  .nt-kv dt{ border-bottom: 0; padding-bottom: 0; }
  .nt-geo-btn .place{ display: none; }
  .nt-shell-end{ margin-left: 0; width: 100%; justify-content: space-between; }
}
