/* mxhop — built on the Tooling Ninja design system.
   Tokens, type scale, radii and gutters are lifted from tooling.ninja; the one
   thing added here is the SMTP transcript, which is this product's own material.
   Dark-first, because the brand is. */

:root {
  /* tn — surfaces */
  --bg: #0e0f11;
  --bg-deep: #0a0b0d;
  --panel: #14161a;
  --surface: #17181b;
  --line: #2a2c31;
  --hair: #ffffff17;
  --hair-2: #ffffff29;

  /* tn — text */
  --text: #f2f2ef;
  --text-2: #e3e4e0;
  --dim: #b5b9c2;
  --muted: #9a9ca3;
  --faint: #8a8c93;

  /* tn — brand */
  --lime: #d4f26a;
  --lime-hi: #e6fa9e;
  --olive: #4a6400;
  --orange: #f2b880;
  --danger: #ff8a8a;
  --on-lime: #0e0f11;

  /* tn — type */
  --font-display: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --h1: clamp(36px, 6vw, 64px);
  --h2: clamp(28px, 4vw, 42px);
  --h3: clamp(20px, 2.4vw, 26px);
  --body: 16px;
  --lead: 18px;
  --mono-sz: 14px;

  /* tn — shape and rhythm */
  --r-xs: 8px;
  --r-btn: 10px;
  --r-field: 12px;
  --r-card: 16px;
  --r-panel: 20px;
  --wrap: 1280px;
  --gutter: 20px;
  --btn-h: 48px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: .2s;

  color-scheme: dark;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 760px) { :root { --gutter: 32px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; } }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f2ef;
    --bg-deep: #e7e7e1;
    --panel: #fbfbf8;
    --surface: #ffffff;
    --line: #dcdcd5;
    --hair: #0e0f1114;
    --hair-2: #0e0f1124;
    --text: #0e0f11;
    --text-2: #22242a;
    --dim: #45474d;
    --muted: #5c5e65;
    --faint: #6f7178;
    --olive: #4a6400;
    --danger: #b03232;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f2f2ef;
  --bg-deep: #e7e7e1;
  --panel: #fbfbf8;
  --surface: #ffffff;
  --line: #dcdcd5;
  --hair: #0e0f1114;
  --hair-2: #0e0f1124;
  --text: #0e0f11;
  --text-2: #22242a;
  --dim: #45474d;
  --muted: #5c5e65;
  --faint: #6f7178;
  --olive: #4a6400;
  --danger: #b03232;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

a { color: var(--lime); text-decoration-color: color-mix(in srgb, var(--lime) 45%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--lime-hi); }
:root[data-theme="light"] a, :root:not([data-theme="dark"]) a { }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) a { color: var(--olive); text-decoration-color: color-mix(in srgb, var(--olive) 45%, transparent); }
  :root:not([data-theme="dark"]) a:hover { color: #35490a; }
}
:root[data-theme="light"] a { color: var(--olive); text-decoration-color: color-mix(in srgb, var(--olive) 45%, transparent); }

a:focus-visible, .btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: var(--r-xs); }
code, kbd, pre { font-family: var(--font-mono); }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 2; }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-block: 16px; }
.brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem;
  letter-spacing: -0.02em; color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 9px;
}
.brand .mark {
  width: 10px; height: 10px; border-radius: 3px; background: var(--lime); flex: none;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; }
.masthead nav a {
  font-size: 0.875rem; color: var(--muted); text-decoration: none; font-family: var(--font-body);
}
.masthead nav a:hover { color: var(--text); }
.masthead nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; }

/* ---------- page heads ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--lime); margin: 0 0 16px;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .eyebrow { color: var(--olive); } }
:root[data-theme="light"] .eyebrow { color: var(--olive); }

h1 {
  font-family: var(--font-display); font-size: var(--h1); line-height: 1.04;
  letter-spacing: -0.035em; font-weight: 600; margin: 0 0 20px;
  text-wrap: balance; max-width: 19ch;
}
h2 { font-family: var(--font-display); font-size: var(--h2); line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 14px; text-wrap: balance; }
h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.015em; }

.lede { font-size: var(--lead); color: var(--dim); max-width: 62ch; margin: 0 0 28px; }
.lede strong { color: var(--text); font-weight: 600; }
p { margin: 0 0 14px; max-width: 68ch; color: var(--dim); }
p strong { color: var(--text); font-weight: 600; }
.body > :last-child, .panel > :last-child { margin-bottom: 0; }

section { padding-block: 64px; }
section.tight { padding-block: 44px; }
section + section { border-top: 1px solid var(--line); }
.pagehead { padding-block: 56px 40px; }

/* ---------- status strip ---------- */
.status {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.78rem;
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 8px 15px; margin: 0 0 30px; color: var(--muted);
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: none; }
.status b { color: var(--text); font-weight: 600; }

/* ---------- buttons ---------- */
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  min-height: var(--btn-h); padding: 0 22px; border-radius: var(--r-btn);
  display: inline-flex; align-items: center; text-decoration: none;
  border: 1px solid var(--lime); background: var(--lime); color: var(--on-lime);
  transition: filter var(--fast) var(--ease);
}
.btn:hover { background: var(--lime-hi); border-color: var(--lime-hi); color: var(--on-lime); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--lime); color: var(--text); background: transparent; }

/* ---------- transcript ---------- */
.transcript {
  background: var(--bg-deep); color: var(--text-2);
  font-family: var(--font-mono); font-size: var(--mono-sz); line-height: 1.75;
  padding: 18px 20px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--r-card);
  margin: 0 0 16px;
}
.transcript .c { color: var(--faint); }
.transcript .you { color: var(--text); }
.transcript .r2 { color: var(--lime); }
.transcript .r3 { color: var(--orange); }
.transcript .r5 { color: var(--danger); }
.transcript b { color: var(--lime); font-weight: 600; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .transcript { background: #0e0f11; color: #e3e4e0; border-color: #0e0f11; }
  :root:not([data-theme="dark"]) .transcript .you { color: #f2f2ef; }
  :root:not([data-theme="dark"]) .transcript .c { color: #8a8c93; }
}
:root[data-theme="light"] .transcript { background: #0e0f11; color: #e3e4e0; border-color: #0e0f11; }
:root[data-theme="light"] .transcript .you { color: #f2f2ef; }
:root[data-theme="light"] .transcript .c { color: #8a8c93; }

.cap { font-size: 0.875rem; color: var(--muted); margin: 10px 0 0; max-width: 68ch; }

/* ---------- panels, cards, grids ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 24px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.cards > * { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; min-width: 0; }
.cards p { font-size: 0.94rem; margin: 0; }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.two > div { min-width: 0; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.three > * { min-width: 0; }

.label {
  font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.11em; color: var(--faint); font-weight: 500; margin: 0 0 10px;
}

/* ---------- route cards (install chooser) ---------- */
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.route {
  display: block; text-decoration: none; color: inherit; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 22px; transition: border-color var(--fast) var(--ease);
}
.route:hover { border-color: var(--lime); color: inherit; }
.route h3 { margin-bottom: 6px; }
.route p { font-size: 0.93rem; margin: 0 0 14px; }
.route .go { font-family: var(--font-mono); font-size: 0.8rem; color: var(--lime); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .route .go { color: var(--olive); } }
:root[data-theme="light"] .route .go { color: var(--olive); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--dim); }
th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 500; }
td code { font-size: 0.88em; color: var(--text); }
td strong { color: var(--text); }
.scroll { overflow-x: auto; }
.mono-cell { font-family: var(--font-mono); white-space: nowrap; color: var(--text); }
.never td:first-child { color: var(--danger); }
.always td:first-child { color: var(--lime); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .always td:first-child { color: var(--olive); } }
:root[data-theme="light"] .always td:first-child { color: var(--olive); }

/* ---------- lists ---------- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; color: var(--dim); }
ul.plain li:last-child { border-bottom: 0; }
ul.plain b { color: var(--text); font-weight: 600; }

ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
ol.steps > li { position: relative; padding: 0 0 26px 52px; }
ol.steps > li:last-child { padding-bottom: 0; }
ol.steps > li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--lime);
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-xs);
  width: 32px; height: 32px; display: grid; place-items: center;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) ol.steps > li::before { color: var(--olive); } }
:root[data-theme="light"] ol.steps > li::before { color: var(--olive); }
ol.steps h3 { margin-top: 3px; }

/* ---------- downloads ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.dl > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; min-width: 0; }
.dl .arch { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.dl .file { font-family: var(--font-mono); font-size: 0.84rem; word-break: break-all; margin: 8px 0 6px; }
.dl .size { font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- note ---------- */
.note {
  border-left: 3px solid var(--lime); border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding: 4px 0 4px 18px; color: var(--dim); font-size: 0.94rem; margin: 20px 0;
  max-width: 68ch;
}
.note b { color: var(--text); }
.note.warn { border-left-color: var(--orange); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .note { border-left-color: var(--olive); } }
:root[data-theme="light"] .note { border-left-color: var(--olive); }

/* ---------- cli ---------- */
.cli { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.cli > div { background: var(--panel); padding: 18px 20px; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 6px 24px; }
.cli dt, .cli .k { font-family: var(--font-mono); font-size: 0.86rem; color: var(--text); margin: 0; word-break: break-word; }
.cli .v { font-size: 0.93rem; color: var(--dim); margin: 0; max-width: 60ch; }
@media (max-width: 760px) { .cli > div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- next links ---------- */
.next { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- footer ---------- */
footer { background: var(--panel); border-top: 1px solid var(--line); }
footer .wrap { padding-block: 30px; display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 0.85rem; color: var(--muted); }
footer a { color: var(--muted); text-decoration-color: var(--hair-2); }
footer a:hover { color: var(--text); }
footer .right { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- docs section ---------- */
.subnav { border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.subnav .wrap { display: flex; flex-wrap: wrap; gap: 2px 18px; padding-block: 11px; }
.subnav a {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  text-decoration: none; white-space: nowrap;
}
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--lime); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .subnav a[aria-current="page"] { color: var(--olive); } }
:root[data-theme="light"] .subnav a[aria-current="page"] { color: var(--olive); }

h2[id], h3[id] { scroll-margin-top: 24px; }

.toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.toc a {
  display: block; text-decoration: none; color: inherit; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 18px 20px; transition: border-color var(--fast) var(--ease);
}
.toc a:hover { border-color: var(--lime); color: inherit; }
.toc .n {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 7px;
}
.toc strong { display: block; font-family: var(--font-display); font-size: 1.04rem; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 5px; }
.toc span.d { font-size: 0.9rem; color: var(--muted); }

/* key reference table */
.keys { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.keys th, .keys td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.keys td:first-child { font-family: var(--font-mono); color: var(--text); white-space: nowrap; font-size: 0.86rem; }
.keys td:nth-child(2) { font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); white-space: nowrap; }
.keys td:nth-child(3) { color: var(--dim); min-width: 240px; }
.keys .req { color: var(--orange); font-size: 0.72rem; font-family: var(--font-mono); }

/* reply code table */
.replies td:first-child { font-family: var(--font-mono); white-space: nowrap; font-size: 0.86rem; }
.replies tr.c5 td:first-child { color: var(--danger); }
.replies tr.c4 td:first-child { color: var(--orange); }
.replies tr.c2 td:first-child { color: var(--lime); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .replies tr.c2 td:first-child { color: var(--olive); } }
:root[data-theme="light"] .replies tr.c2 td:first-child { color: var(--olive); }

/* recipe blocks */
.recipe { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--panel); padding: 24px; margin: 0 0 20px; }
.recipe > h3 { font-size: 1.14rem; margin-bottom: 4px; }
.recipe .who { font-size: 0.88rem; color: var(--faint); margin: 0 0 16px; font-family: var(--font-mono); }
.recipe > :last-child { margin-bottom: 0; }

/* symptom blocks */
.sym { border-left: 3px solid var(--line); padding-left: 20px; margin: 0 0 28px; }
.sym h3 { font-family: var(--font-body); font-size: 1rem; margin-bottom: 8px; }
.sym .fix { font-size: 0.93rem; color: var(--dim); }
.sym .fix b { color: var(--text); }

/* stacked facts and multi-paragraph callouts, without forced line breaks */
.ln { display: block; }
.note p, .cap p, .v p, .fix p, td p { margin: 0 0 10px; max-width: none; }
.note p:last-child, .cap p:last-child, .v p:last-child, .fix p:last-child, td p:last-child { margin-bottom: 0; }
td p { color: inherit; }
.keys td .ln + .ln, td .ln + .ln { margin-top: 2px; }

/* transcripts soft-wrap instead of needing hand-broken lines */
.transcript { white-space: pre-wrap; overflow-wrap: break-word; }
