/* ==========================================================================
   CloudCode — shared stylesheet
   Neutral charcoal + single electric-blue accent. No external fonts, no CDNs.
   Type scale: 12 / 14 / 16 / 20 / 32 / 56
   ========================================================================== */

:root {
  /* Surfaces */
  --bg:         #0b0d10;
  --bg-panel:   #12151a;
  --bg-elev:    #161a20;
  --bg-input:   #0e1116;
  --line:       #22262e;
  --line-soft:  #1a1e25;
  --line-strong:#2f353f;

  /* Text */
  --ink:        #e7eaee;
  --ink-soft:   #c3c9d2;
  --dim:        #8b93a1;
  --dim2:       #5f6875;

  /* Accent — electric blue */
  --accent:     #3b82f6;
  --accent-hi:  #60a5fa;
  --accent-dim: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-line: rgba(59, 130, 246, 0.34);

  /* Code syntax (used only inside code / mono surfaces) */
  --c-green: #7ee787;
  --c-amber: #ffa657;
  --c-pink:  #ff7b9c;
  --c-cyan:  #79c0ff;
  --c-violet:#d2a8ff;

  /* Semantic */
  --ok:   #4ade80;
  --warn: #fbbf24;
  --err:  #f87171;

  /* Shape */
  --r-sm: 7px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Shadow — light layering only, never heavy drops */
  --sh-1: 0 1px 0 rgba(255,255,255,.02), 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 1px 0 rgba(255,255,255,.02), 0 8px 24px rgba(0,0,0,.35);
  --sh-3: 0 18px 50px rgba(0,0,0,.5);

  /* Motion */
  --t-fast: 120ms;
  --t:      200ms;
  --t-slow: 320ms;
  --ease:   cubic-bezier(.2,.7,.2,1);

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

  --wrap: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
code, pre, kbd, samp { font-family: var(--mono); }
hr { border: 0; border-top: 1px solid var(--line); }
::selection { background: rgba(59,130,246,.32); color: #fff; }

/* Visible, consistent keyboard focus */
:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Background layers (subtle, < 8% opacity) ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(rgba(120,140,170,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,140,170,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 100% 62% at 50% 0%, #000 22%, transparent 74%);
          mask-image: radial-gradient(ellipse 100% 62% at 50% 0%, #000 22%, transparent 74%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
}
.bg-glow::before {
  content: ""; position: absolute; top: -420px; left: 50%; transform: translateX(-50%);
  width: 980px; height: 620px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(59,130,246,.16), rgba(59,130,246,.05), transparent 72%);
  filter: blur(18px);
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.container.tool-page { padding-top: 30px; padding-bottom: 8px; }
.section { padding: 72px 0; }
.section-sm { padding: 44px 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(11,13,16,.82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
}
.site-header .container {
  display: flex; align-items: center; gap: 16px;
  height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600;
  letter-spacing: -0.01em; flex: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-hi));
  box-shadow: 0 0 0 1px rgba(96,165,250,.35), 0 6px 18px rgba(59,130,246,.28);
}
.brand-mark svg { width: 16px; height: 16px; }
.brand-name { font-size: 15.5px; }
.brand-name b { font-weight: 700; }
.brand-name span { color: var(--accent-hi); font-weight: 700; }

.nav {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--dim); font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm);
  text-decoration: none; transition: color var(--t-fast), background var(--t-fast);
}
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.04); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle:hover { border-color: var(--line-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-elev); color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  text-decoration: none; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); background: #1a1f27; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(140deg, var(--accent-dim), var(--accent));
  box-shadow: 0 6px 18px rgba(59,130,246,.26);
}
.btn-primary:hover { background: linear-gradient(140deg, var(--accent), var(--accent-hi)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); background: rgba(255,255,255,.03); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-icon { padding: 0 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; position: relative; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--dim); text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; background: rgba(255,255,255,.02); margin-bottom: 26px;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(74,222,128,.14);
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px); font-weight: 700; letter-spacing: -0.035em;
  line-height: 1.05; max-width: 15ch;
}
.hero h1 .grad {
  background: linear-gradient(96deg, var(--accent-hi), #93c5fd 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-lead {
  margin-top: 22px; max-width: 60ch; color: var(--dim); font-size: 17px; line-height: 1.65;
}
.hero-lead strong { color: var(--ink-soft); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px;
  font-family: var(--mono); font-size: 12.5px; color: var(--dim2);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 14px; height: 14px; color: var(--accent); }

/* ---------- Section headings ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-hi); margin-bottom: 12px;
}
.section-title { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; letter-spacing: -0.03em; }
.section-sub { margin-top: 12px; color: var(--dim); font-size: 15.5px; max-width: 62ch; }

/* ---------- Tool grid (home) ---------- */
.tool-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.tool-card {
  position: relative; display: flex; flex-direction: column;
  padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg));
  text-decoration: none; color: var(--ink);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.tool-card:hover {
  text-decoration: none; border-color: var(--accent-line); transform: translateY(-3px);
  box-shadow: var(--sh-2);
}
.tool-card:focus-visible { transform: translateY(-3px); }
.tool-card-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.tool-ico {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--accent-hi);
  transition: border-color var(--t), color var(--t);
}
.tool-card:hover .tool-ico { border-color: var(--accent-line); color: var(--accent-hi); }
.tool-ico svg { width: 17px; height: 17px; }
.tool-card h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.tool-card p { font-size: 13.5px; color: var(--dim); line-height: 1.6; }
.tool-card .go {
  margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--dim2);
  display: inline-flex; align-items: center; gap: 6px; transition: color var(--t);
}
.tool-card:hover .go { color: var(--accent-hi); }
.tool-card .go svg { width: 13px; height: 13px; transition: transform var(--t); }
.tool-card:hover .go svg { transform: translateX(3px); }

/* ---------- Panels ---------- */
.panel {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-panel); overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.012);
}
.panel-head h2, .panel-head h3 {
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--dim); font-family: var(--mono);
}
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 16px; }
.panel-body + .panel-body { border-top: 1px solid var(--line-soft); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > label, .label {
  display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  margin-bottom: 7px; letter-spacing: .01em;
}
.field .hint { font-size: 12.5px; color: var(--dim2); margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-input); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  font-size: 14px; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
.textarea { resize: vertical; min-height: 150px; line-height: 1.6; }
.textarea.mono, .input.mono { font-family: var(--mono); font-size: 13px; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
}
.input::placeholder, .textarea::placeholder { color: var(--dim2); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .field { flex: 1 1 200px; margin-top: 0; }
.row > .btn { flex: none; }
.checkbox {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--ink-soft); user-select: none;
}
.checkbox input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* ---------- Code / output surfaces ---------- */
.code {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-input); overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.014);
}
.code-head .name {
  font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: .02em;
}
.code-head .spacer { margin-left: auto; }
.code pre, .code textarea {
  margin: 0; padding: 13px 14px; width: 100%;
  font-size: 13px; line-height: 1.65; color: var(--ink-soft);
  overflow: auto; white-space: pre; tab-size: 2;
}
.code pre { max-height: 460px; min-height: 58px; }
.code textarea { border: 0; background: transparent; resize: vertical; min-height: 180px; }
.code textarea:focus { outline: none; }
.code pre.wrap, .code textarea.wrap { white-space: pre-wrap; word-break: break-word; }

/* Syntax token colors — only inside code surfaces */
.tok-key  { color: var(--c-cyan); }
.tok-str  { color: var(--c-green); }
.tok-num  { color: var(--c-amber); }
.tok-bool { color: var(--c-pink); }
.tok-null { color: var(--c-pink); }
.tok-punc { color: var(--dim); }
.tok-key-special { color: var(--c-violet); }
.tok-err { color: var(--err); text-decoration: underline wavy var(--err); text-underline-offset: 3px; }

/* ---------- Tables ---------- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.tbl th {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dim); font-weight: 600; position: sticky; top: 0; background: var(--bg-panel);
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.mono, table.tbl th.mono { font-family: var(--mono); font-size: 12.5px; }
table.tbl tbody tr:hover { background: rgba(255,255,255,.015); }
table.tbl td.num { text-align: right; font-family: var(--mono); }

/* ---------- Definition list (key/value readouts) ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 0; }
.kv dt {
  font-family: var(--mono); font-size: 12.5px; color: var(--dim);
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
}
.kv dd {
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 13px; color: var(--ink); word-break: break-word;
}
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

/* ---------- Badges / chips / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--dim); background: rgba(255,255,255,.02);
}
.badge.ok   { color: var(--ok);   border-color: rgba(74,222,128,.3);  background: rgba(74,222,128,.08); }
.badge.warn { color: var(--warn); border-color: rgba(251,191,36,.3);  background: rgba(251,191,36,.08); }
.badge.err  { color: var(--err);  border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.08); }
.badge.info { color: var(--accent-hi); border-color: var(--accent-line); background: var(--accent-soft); }

/* Status line used under tool inputs */
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); min-height: 20px; }
.status.ok  { color: var(--ok); }
.status.err { color: var(--err); }
.status .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Tool page layout ---------- */
.page { padding: 34px 0 8px; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--dim2); margin-bottom: 20px;
  font-family: var(--mono);
}
.breadcrumb a { color: var(--dim); }
.breadcrumb a:hover { color: var(--accent-hi); }
.breadcrumb .sep { color: var(--line-strong); }

.tool-head { max-width: 74ch; }
.tool-head h1 {
  font-size: clamp(26px, 4.4vw, 38px); font-weight: 700; letter-spacing: -0.03em;
  font-family: var(--mono);
}
.tool-head .lead { margin-top: 12px; color: var(--dim); font-size: 16px; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.tool-main { margin-top: 26px; }
.tool-main + .tool-main { margin-top: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- Prose (SEO copy) ---------- */
.prose { max-width: 74ch; }
.prose h2 { font-size: 20px; margin-bottom: 14px; letter-spacing: -0.02em; }
.prose h3 { font-size: 16px; margin: 22px 0 8px; }
.prose p { color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.prose p + p { margin-top: 13px; }
.prose code {
  font-size: 13px; background: var(--bg-elev); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: var(--accent-hi);
}
.prose ul { margin: 12px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }
.prose li { margin-top: 7px; }
.prose li::marker { color: var(--dim2); }

/* Small mono heading used inside feature panels */
.card-h { font-family: var(--mono); font-size: 14px; color: var(--accent-hi); font-weight: 600; }

/* ---------- Related tools ---------- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.related {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-panel); text-decoration: none; color: var(--ink);
  transition: border-color var(--t), background var(--t);
}
.related:hover { text-decoration: none; border-color: var(--accent-line); background: var(--bg-elev); }
.related b { font-size: 14px; font-weight: 600; }
.related span { font-size: 12.5px; color: var(--dim); line-height: 1.5; }

/* ---------- Contact block ---------- */
.contact {
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 44px 36px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(59,130,246,.06), rgba(59,130,246,.01));
}
.contact h2 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.02em; margin-bottom: 12px; }
.contact p { color: var(--dim); max-width: 52ch; margin: 0 auto 24px; font-size: 15px; }
.mail {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 15px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 12px 22px; background: var(--bg-input);
  transition: border-color var(--t), box-shadow var(--t);
}
.mail:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mail svg { width: 17px; height: 17px; color: var(--accent-hi); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 40px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h4 {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim2); margin-bottom: 14px; font-weight: 600;
}
.footer-grid p { color: var(--dim); font-size: 13.5px; max-width: 40ch; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--dim); font-size: 13.5px; }
.footer-links a:hover { color: var(--accent-hi); }
.footer-bottom {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--dim2); font-size: 12.5px; font-family: var(--mono);
}
.footer-bottom a { color: var(--dim); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  font-size: 13.5px; color: var(--ink);
  background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 18px; box-shadow: var(--sh-3);
  animation: toast-in var(--t) var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
}
.toast svg { width: 15px; height: 15px; color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */
.mono { font-family: var(--mono); }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.scroll-x { overflow-x: auto; }

/* ---------- Tool components ---------- */
/* Collapse control inside the JSON tree */
.fold {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-right: 4px; padding: 0;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg-elev); color: var(--dim);
  font-size: 9px; line-height: 1; cursor: pointer; vertical-align: middle;
}
.fold:hover { border-color: var(--accent-line); color: var(--accent-hi); }
.tok-comment { color: var(--dim2); font-style: italic; }

/* Error readout (parse failures, invalid input) */
.errbox {
  border: 1px solid rgba(248,113,113,.34); background: rgba(248,113,113,.06);
  border-radius: var(--r); padding: 11px 13px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  color: var(--ink-soft); overflow-x: auto; white-space: pre;
}
.errbox .caret { color: var(--err); font-weight: 700; }
.errbox .where { color: var(--err); }

/* Segmented control */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-input);
}
.seg button {
  border: 0; background: transparent; color: var(--dim);
  font-size: 13px; padding: 6px 13px; border-radius: 7px; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hi); }

/* Stat cells */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line-soft); }
.stat-cell { background: var(--bg-panel); padding: 14px 16px; }
.stat-cell .k { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim2); }
.stat-cell .v { font-family: var(--mono); font-size: 16px; color: var(--ink); margin-top: 6px; word-break: break-all; }
.stat-cell .v.sm { font-size: 13px; }

/* Big readout (timestamps, ratios) */
.readout {
  font-family: var(--mono); font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -0.02em; color: var(--ink); word-break: break-all;
}
.readout .unit { font-size: 13px; color: var(--dim2); margin-left: 6px; letter-spacing: 0; }

/* Colour swatch + colour input */
.swatch { height: 84px; border-radius: var(--r); border: 1px solid var(--line); }
input[type="color"] {
  width: 46px; height: 40px; padding: 3px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-input);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Inline key/value pill used for compact readouts */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
  background: rgba(255,255,255,.02);
}
.pill b { color: var(--accent-hi); font-weight: 600; }

/* File drop area */
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
input[type="file"] {
  font-size: 13px; color: var(--dim); max-width: 100%;
}
input[type="file"]::file-selector-button {
  font: inherit; font-size: 13px; margin-right: 12px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-elev); color: var(--ink); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--line-strong); }

/* Output list of generated values (UUIDs) */
.out-list {
  font-family: var(--mono); font-size: 13px; line-height: 1.9;
  max-height: 420px; overflow: auto; padding: 12px 14px; margin: 0;
  color: var(--ink-soft); white-space: pre;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .tool-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-panel); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; gap: 2px; box-shadow: var(--sh-2);
  }
  .nav.open a { padding: 12px; font-size: 15px; }
  .nav-toggle { display: inline-flex; }
  .site-header .container { position: relative; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 52px 0; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 2px; }
  .contact { padding: 32px 20px; }
}
@media (max-width: 560px) {
  .tool-grid, .related-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .container { padding: 0 18px; }
  .hero h1 { font-size: clamp(30px, 9vw, 40px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .tool-card:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .bg-grid, .bg-glow, .site-header, .site-footer, .toast-wrap { display: none; }
  body { background: #fff; color: #000; }
}
