/* CarrNET design system, web implementation (v0.2).
 *
 * Source of truth: ~/Documents/CarrNET/Design System/ (tokens, web components).
 * Ported here: the web display type scale, the radius scale, the shadow scale
 * (soft shadows replace flat borders on web surfaces), pill buttons with the
 * signal gradient, the dark glow hero, stats band, floating cards, gradient CTA
 * band and dark footer.
 *
 * Deliberate deviations, all for WCAG AA text contrast:
 *   --signal       #0C8599 stays for decoration (rules, glow, focus).
 *   --signal-text  is a slightly deeper teal for small text and links, because
 *                  #0C8599 on white measures about 4.3:1.
 *   --grad-start   #0A7A8D replaces #0C8599 as the start of the button and band
 *                  gradient so white text on it clears 4.5:1. The end colour is
 *                  the system's --signal-deep #075E6B.
 *   --muted        is deeper than #8A93A3 (about 3.2:1 on white).
 * The system defines no dark web theme, so the dark palette comes from
 * ~/.config/theme/palettes/carrnet.sh, and dark surfaces use a hairline border
 * instead of a shadow (shadows do not read on dark).
 *
 * No inline styles anywhere on this site: the CSP is `style-src 'self'`.
 * Keep every rule in this file.
 */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  /* colour, light */
  --bg: #f7f8fa;
  --paper: #ffffff;
  --paper-2: #f1f3f6;
  --ink: #0b1220;
  --slate: #4b5565;
  --muted: #5f6b7d;
  --border: #d7dce3;
  --border-strong: #b9c1cc;
  --signal: #0c8599;
  --signal-text: #08707f;
  --signal-deep: #075e6b;
  --signal-glow: #5fd3e0;
  --signal-tint: #e6f6f8;
  --grad-start: #0a7a8d;
  --grad: linear-gradient(135deg, var(--grad-start), var(--signal-deep));
  --danger: #b42329;
  --danger-tint: #fdecec;

  /* radius scale */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* shadow scale */
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(11, 18, 32, 0.1);
  --shadow-lg: 0 12px 40px rgba(11, 18, 32, 0.16);
  --shadow-card: 0 4px 20px rgba(11, 18, 32, 0.06);
  --shadow-btn: 0 8px 24px rgba(12, 133, 153, 0.35);
  --shadow-glow: 0 20px 60px rgba(12, 133, 153, 0.28);
  --card-border: transparent;

  /* dark bands and code panel (dark in both themes) */
  --band: #0b1220;
  --footer-bg: #0b1220;
  --code-bg: #0b1220;
  --code-fg: #e9edf2;
  --code-key: #14a8c0;
  --code-str: #6fd79a;
  --code-num: #f2c368;
  --code-punct: #9aa5b6;
  --code-comment: #6b7688;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --paper: #121a28;
    --paper-2: #16202e;
    --ink: #e9edf2;
    --slate: #9aa5b6;
    --muted: #8792a5;
    --border: #26303f;
    --border-strong: #3a4657;
    --signal-text: #14a8c0;
    --signal-tint: #123640;
    --danger: #ff6369;
    --danger-tint: #3a1b1f;
    --shadow-card: none;
    --shadow-sm: none;
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --card-border: #26303f;
    --footer-bg: #080d18;
    --code-bg: #0a101c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --paper: #121a28;
  --paper-2: #16202e;
  --ink: #e9edf2;
  --slate: #9aa5b6;
  --muted: #8792a5;
  --border: #26303f;
  --border-strong: #3a4657;
  --signal-text: #14a8c0;
  --signal-tint: #123640;
  --danger: #ff6369;
  --danger-tint: #3a1b1f;
  --shadow-card: none;
  --shadow-sm: none;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --card-border: #26303f;
  --footer-bg: #080d18;
  --code-bg: #0a101c;
  color-scheme: dark;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
img,
svg {
  max-width: 100%;
}
a {
  color: var(--signal-text);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.2;
}
p {
  margin: 0 0 1em;
}
code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
::selection {
  background: var(--signal-tint);
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
  padding-inline: 24px;
}
.mono {
  font-family: var(--font-mono);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  z-index: 100;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ---------- navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 24px;
  padding-block: 14px;
}
.wordmark {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  justify-self: start;
}
.wordmark .suffix {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.62em;
  color: var(--signal-text);
  letter-spacing: 0;
}
.site-nav {
  display: flex;
  gap: 32px;
}
.site-nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding-block: 4px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover {
  color: var(--ink);
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--signal);
}
.bar-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-toggle {
  appearance: none;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--slate);
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.9);
  padding: 64px 0 32px;
  margin-top: 96px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.footer-brand .logo {
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 10px;
}
.footer-brand .logo span {
  font-family: var(--font-mono);
  color: var(--signal-glow);
  font-weight: 600;
  font-size: 0.62em;
}
.footer-brand p {
  max-width: 300px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin: 0;
}
.footer-cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 14px;
}
.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
}
.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
}
.footer-bottom a {
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal-text);
  margin: 0 0 12px;
}
.page-head {
  padding-block: 56px 8px;
}
.page-head h1 {
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.lede {
  color: var(--slate);
  font-size: 19px;
  line-height: 1.5;
  max-width: 60ch;
  margin: 0;
  text-wrap: pretty;
}
.section {
  margin-top: 80px;
}
.section-head {
  max-width: 600px;
  margin: 0 auto 44px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-head p {
  color: var(--slate);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  text-wrap: balance;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border: 1.5px solid var(--border-strong);
}
.btn.ghost {
  background: transparent;
  color: var(--signal-text);
  box-shadow: none;
  padding-inline: 6px;
}
/* White pill for dark surfaces. The text colour is fixed, not var(--ink): in the dark
 * theme --ink is light, which made this button's label white on white. */
.btn.on-dark {
  background: #fff;
  color: #0b1220;
  box-shadow: none;
}
.btn.on-dark-ghost {
  background: transparent;
  color: #fff;
  box-shadow: none;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.btn.small {
  padding: 8px 16px;
  font-size: 13px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.icon-btn {
  appearance: none;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 38px;
  min-height: 38px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.icon-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- hero band ---------- */
.hero-band {
  position: relative;
  overflow: hidden;
  background: var(--band);
  color: #fff;
  padding: 96px 0 0;
}
.hero-band .wrap {
  position: relative;
}
/* The glow is a square that fades to nothing at its own edges (closest-side), so it
 * can never be clipped into a visible box or leave a seam, at any screen width. */
.hero-glow {
  position: absolute;
  right: -140px;
  top: -110px;
  width: min(760px, 90vw);
  aspect-ratio: 1;
  background: radial-gradient(
    closest-side,
    rgba(12, 133, 153, 0.5),
    rgba(12, 133, 153, 0.22) 45%,
    rgba(12, 133, 153, 0.06) 75%,
    transparent
  );
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 640px;
}
.hero-band .eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--signal-glow);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-band .eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal-glow);
  box-shadow: 0 0 12px var(--signal-glow);
}
.hero-band h1 {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 22px;
}
.hero-band h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--signal-glow), var(--signal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-band .sub {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  max-width: 500px;
  margin: 0 0 36px;
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- stats row (sits at the foot of the hero) ---------- */
.stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  margin-top: 72px;
  padding: 32px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.stat {
  padding: 4px 44px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.stat:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat .num {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stat .num span {
  color: var(--signal-glow);
}
.stat .lbl {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
}

/* ---------- cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:has(h3 a):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card .icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--signal-tint);
  color: var(--signal-text);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.card p {
  color: var(--slate);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
}
.card .cta {
  margin-top: auto;
  padding-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.card .cta::after {
  content: " \2192";
  color: var(--signal-text);
}
.card h3 a {
  color: inherit;
  text-decoration: none;
}
/* the whole card is the click target, through the heading link */
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}
.card:has(h3 a:focus-visible) {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}
.card h3 a:focus-visible {
  outline: none;
}
.card.is-empty {
  border: 1.5px dashed var(--border-strong);
  box-shadow: none;
  background: transparent;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: var(--signal-tint);
  color: var(--signal-text);
  padding: 4px 12px;
  border-radius: var(--r-pill);
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--grad);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 52px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-glow);
}
.cta-band h2 {
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.cta-band p {
  margin: 0;
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- forms ---------- */
label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 0;
}
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  min-height: 38px;
}
input.mono,
textarea.mono {
  font-family: var(--font-mono);
  font-size: 13.5px;
}
textarea {
  resize: vertical;
  line-height: 1.45;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 0;
  border-color: var(--signal);
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--grad-start);
  margin: 0;
  flex-shrink: 0;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--grad-start);
  margin: 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
}
.check input {
  margin-top: 3px;
}

/* ---------- tool layout ---------- */
.back-link {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
}
.back-link:hover {
  color: var(--signal-text);
}
.back-link::before {
  content: "\2190  ";
}
.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 32px;
}
.tool-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate);
  margin: 0;
}
.panel fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel fieldset:disabled {
  opacity: 0.5;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-2 .check {
  align-self: center;
}
.repeater {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.repeater-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 8px;
}
.output {
  position: sticky;
  top: 84px;
  background: var(--code-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 108px);
}
.output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid #26303f;
}
.output-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-punct);
}
.output-actions {
  display: flex;
  gap: 8px;
}
.output .btn.secondary {
  color: var(--code-fg);
  border-color: #3a4657;
}
.output pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--code-fg);
  tab-size: 2;
}
.output pre code {
  font-size: inherit;
}
.tok-key {
  color: var(--code-key);
}
.tok-str {
  color: var(--code-str);
}
.tok-num {
  color: var(--code-num);
}
.tok-punct {
  color: var(--code-punct);
}
.tok-comment {
  color: var(--code-comment);
}
.issues {
  margin: 0;
  padding: 16px 16px 16px 34px;
  color: #ffb4b7;
  font-size: 13.5px;
  line-height: 1.6;
}
.issues-title {
  margin: 0;
  padding: 16px 16px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ff8a8f;
}
.warnings {
  margin: 0;
  padding: 10px 16px 10px 34px;
  border-top: 1px solid #26303f;
  color: #f2c368;
  font-size: 12.5px;
  line-height: 1.55;
}
.output .status {
  margin: 0;
  padding: 6px 16px 10px;
  min-height: 2em;
  font-size: 12.5px;
  color: var(--code-punct);
}

/* ---------- passphrase tool ---------- */
.pp-result {
  margin-top: 32px;
  background: var(--code-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pp-text {
  margin: 0;
  padding: 36px 28px 30px;
  font-family: var(--font-mono);
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--code-fg);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 3.2em;
}
.pp-text.is-hidden {
  filter: blur(9px);
  user-select: none;
}
.pp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid #26303f;
}
.pp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pp-result .btn.secondary {
  color: var(--code-fg);
  border-color: #3a4657;
}
.pp-status {
  font-size: 12.5px;
  color: var(--code-punct);
  margin: 0;
  min-height: 1.4em;
}
.meter {
  display: flex;
  gap: 6px;
  margin: 4px 0 12px;
}
.meter i {
  flex: 1;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
}
.meter[data-level="1"] i:nth-child(-n + 1) {
  background: #e5484d;
}
.meter[data-level="2"] i:nth-child(-n + 2) {
  background: #e0a63c;
}
.meter[data-level="3"] i:nth-child(-n + 3) {
  background: #4caf7d;
}
.meter[data-level="4"] i:nth-child(-n + 4) {
  background: var(--signal);
}
.pp-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  margin: 0;
  font-size: 14px;
}
.pp-facts dt {
  color: var(--muted);
}
.pp-facts dd {
  margin: 0;
  font-weight: 600;
}
.pp-facts .mono {
  font-weight: 500;
}
.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.range-value {
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 2ch;
  text-align: right;
}
.pp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}
.note {
  color: var(--slate);
  font-size: 14px;
  line-height: 1.6;
}
.note p:last-child {
  margin-bottom: 0;
}

/* ---------- long-form text (docs) ---------- */
.prose {
  max-width: 68ch;
}
.prose h2 {
  font-size: 24px;
  margin: 2em 0 0.5em;
}
.prose h3 {
  font-size: 18px;
  margin: 1.6em 0 0.4em;
}
.prose p,
.prose li {
  color: var(--slate);
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--r-md);
  padding: 16px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.6;
}
.prose :not(pre) > code {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink);
}
.page-head .meta-line {
  margin: 14px 0 0;
}
article.section.prose {
  margin-top: 36px;
}
.prose table {
  font-size: 14px;
}
.prose blockquote {
  margin: 1.2em 0;
  padding: 4px 18px;
  border-left: 3px solid var(--signal);
  color: var(--slate);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose a {
  color: var(--signal-text);
}
.meta-line {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .tool,
  .pp-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .output {
    position: static;
    max-height: none;
  }
  .output pre {
    max-height: 480px;
  }
  .cta-band {
    padding: 40px 32px;
  }
  .stat {
    padding: 4px 28px;
  }
}
@media (max-width: 640px) {
  .site-header .bar {
    grid-template-columns: 1fr auto;
  }
  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 24px;
  }
  .hero-band {
    padding: 56px 0 0;
  }
  .hero-glow {
    right: -30%;
    top: 0;
    width: 90vw;
  }
  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
    margin-top: 48px;
  }
  .stat,
  .stat:first-child {
    padding-left: 0;
    border-left: 0;
  }
  .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .wrap {
    padding-inline: 16px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .repeater-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .repeater-row input:nth-child(2),
  .repeater-row textarea {
    grid-column: 1 / 2;
    grid-row: 2;
  }
  .repeater-row .icon-btn {
    grid-row: 1 / 3;
    grid-column: 2;
    align-self: stretch;
  }
  .page-head {
    padding-block: 36px 4px;
  }
  .section {
    margin-top: 56px;
  }
  .card {
    padding: 26px 22px;
  }
  .pp-text {
    padding: 26px 20px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
  .btn:hover:not(:disabled),
  .card:has(h3 a):hover {
    transform: none;
  }
}

/* ---------- JSON tool ---------- */
.json-panel {
  margin-top: 32px;
}
.json-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--paper);
}
.seg label {
  position: relative;
  font-weight: 600;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg span {
  display: block;
  padding: 7px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--slate);
}
.seg input:checked + span {
  background: var(--grad);
  color: #fff;
}
.seg input:focus-visible + span {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-field select {
  width: auto;
  min-width: 9.5em;
}
.inline-field.is-off {
  opacity: 0.45;
}
.json-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.json-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-top: 24px;
}
.json-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.json-col > label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate);
}
.json-in {
  flex: 1;
  min-height: 460px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
  background: var(--paper);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  resize: vertical;
}
.json-in.is-dragging {
  outline: 2px dashed var(--signal);
  outline-offset: 2px;
}
.output.static {
  position: static;
  flex: 1;
  min-height: 460px;
  max-height: none;
}
.output.static pre {
  flex: 1;
  max-height: 620px;
  white-space: pre;
}
.json-empty {
  margin: 0;
  padding: 24px 20px;
  color: var(--code-punct);
  font-size: 14px;
}
.json-error {
  padding: 18px 18px 6px;
}
.json-error .where {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ff8a8f;
}
.json-error .what {
  margin: 0 0 14px;
  color: #ffd3d5;
  font-size: 15px;
  line-height: 1.5;
}
.json-error pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--code-fg);
  font-size: 12.5px;
  line-height: 1.5;
  overflow: auto;
}
.json-error .btn {
  margin-bottom: 14px;
}
.tok-lit {
  color: #c39bff;
}
@media (max-width: 860px) {
  .json-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .json-in,
  .output.static {
    min-height: 320px;
  }
  .json-actions {
    margin-left: 0;
  }
}

/* ---------- password tool: ISM checks ---------- */
.acsc-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acsc-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  font-size: 13.5px;
  line-height: 1.4;
}
.acsc-list .what {
  color: var(--slate);
}
.acsc-list .what b {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.pill.ok {
  background: var(--signal-tint);
  color: var(--signal-text);
}
.pill.no {
  background: var(--paper-2);
  color: var(--muted);
}
.sources {
  margin: 0;
  padding-left: 1.2em;
}
.sources li {
  margin-bottom: 6px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
}
.panel-title.mini {
  margin-top: 18px;
}
.seg.seg-3 {
  align-self: flex-start;
}

/* ---------- the promise ---------- */
.promise-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: var(--signal-tint);
  color: var(--signal-text);
  font-size: 13.5px;
  font-weight: 500;
}
.promise-note svg {
  flex-shrink: 0;
}
.promise-note a {
  color: inherit;
  font-weight: 700;
}
.stats-note {
  position: relative;
  margin: 0;
  padding-bottom: 40px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px;
}
.stats-note a {
  color: var(--signal-glow);
}
.stats {
  padding-bottom: 18px;
}
.rules-list {
  margin: 0;
  padding-left: 1.2em;
  max-width: 68ch;
}
.rules-list li {
  margin-bottom: 10px;
  color: var(--slate);
}
.rules-list strong {
  color: var(--ink);
}
.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel p:last-child {
  margin-bottom: 0;
}
.panel code,
.note code {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.88em;
}
.codeblock {
  margin: 0 0 1em;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--code-bg);
  color: var(--code-fg);
  font-size: 12.5px;
  line-height: 1.6;
  overflow: auto;
}
.codeblock code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1em;
}
.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rule-table th,
.rule-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.rule-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
}
.rule-table td:first-child {
  white-space: nowrap;
}
.file-list {
  margin: 0;
  padding-left: 1.2em;
}
.file-list li {
  margin-bottom: 6px;
}
.file-list span {
  color: var(--muted);
}
@media (max-width: 640px) {
  .rule-table td:first-child {
    white-space: normal;
  }
}

/* ---------- Base64 tool ---------- */
/* a long Base64 string is one unbroken "word": wrap it inside the box instead of scrolling sideways */
#b-pre {
  white-space: pre-wrap;
  word-break: break-all;
}
.b64-extra {
  padding: 14px 18px 16px;
  border-top: 1px solid #26303f;
}
.b64-extra h3 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--code-punct);
}
.b64-extra pre {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--code-fg);
  font-size: 12.5px;
  line-height: 1.5;
}
/* IDs, because the general ".output pre" rule outranks a class here. Wrap code only where it must (long Base64 has no spaces). */
#b-cmd,
#b-snip {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: visible;
}
