/* ============================================================================
   SKYROCK LOGBOOKS — THE GUIDE (/guide/Logbooks · public/guides/logbooks/)
   ----------------------------------------------------------------------------
   The teaching counterpart of the landing (logbooks-landing/styles.css), and a
   member of the same family: the cosmos brackets ONE white sheet, and the sheet
   speaks the product's own visual language. Tokens MIRROR the landing's — which
   themselves mirror components/logbooks/logbooks.css and its measured ink
   ladder (contrast ratios recorded there). Do not re-pick these by eye.

   What is new here relative to the landing: the guide draws MANY exhibits of
   the real builder (module cards, ports, cables, the health strip), so the
   canvas vocabulary lives here as reusable SVG classes (.gd-mod-*, .gd-port*,
   .gd-cable*) whose values come from the app stylesheet verbatim: 22px dot
   paper, 2.25px navy value cables, gold out-ports, the marked base port, the
   gate stitch (dash 4 5 in dark gold-ink), the error red #b3261e/#c6362c.
   The canvas exhibits are drawn BOTTOM-TO-TOP like the real workspace.
   ========================================================================== */

:root {
    /* ground */
    --gd-cosmos: #0b0e1a;
    --gd-sheet: #ffffff;
    --gd-tray: #f7f7f7;
    --gd-tray-2: #ebebeb;
    --gd-line: #e4e4e4;
    --gd-line-strong: #d2d2d2;

    /* ink ladder (measured on the tray — see landing styles for the ratios) */
    --gd-text: #232731;
    --gd-muted: #3f454f;
    --gd-subtle: #545a63;
    --gd-gold-ink: #7a5e17;
    --gd-gold-ink-ws: #695114;   /* the canvas-scoped harder gold-ink */
    --gd-green-ink: #21714d;

    /* on the cosmos */
    --gd-on-dark: #FFF6F6;
    --gd-on-dark-muted: rgba(255,255,255,0.76);
    --gd-on-dark-faint: rgba(255,255,255,0.55);
    --gd-gold-light: #d9c08a;

    /* brand */
    --gd-accent: #3C486B;
    --gd-accent-hover: #2e3a56;
    --gd-accent-soft: #eef1f7;
    --gd-gold: #c2a35a;
    --gd-gold-soft: rgba(194,163,90,0.40);
    --gd-green: #2e9e6b;
    --gd-danger-ink: #b3372f;
    --gd-steel-grad: linear-gradient(-145deg, #2e3a56, #3C486B, #283350, #46557e, #2e3a56);
    --gd-silver-grad: linear-gradient(-145deg, #f4f4f4, #e0e0e0, #fcfcfc, #d8d8d8, #eeeeee);
    --gd-plate: linear-gradient(145deg, #5a6068 0%, #34383f 38%, #23272d 55%, #444a52 78%, #2b2f35 100%);
    --gd-check-hi: #d9bc72;
    --gd-check-lo: #ab8a3c;

    /* canvas kind stripes (the app's exact hues) */
    --gd-k-in: #8b97b5;
    --gd-k-roll: #2e9e6b;

    /* type */
    --gd-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --gd-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --fs-xs: 0.72rem; --fs-sm: 0.84rem; --fs-md: 0.95rem; --fs-lg: 1.12rem;
    --fs-h2: clamp(1.55rem, 3.6vw, 2.35rem);
    --fs-hero: clamp(2.4rem, 7vw, 4.4rem);

    /* space · radius · depth · focus · motion */
    --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
    --sh-rest: 0 1px 2px rgba(8,12,24,0.06);
    --sh-sheet: 0 2px 6px rgba(8,12,24,0.20), 0 22px 60px rgba(8,12,24,0.40);
    --sh-pop: 0 4px 14px rgba(8,12,24,0.28);
    --gd-ring: 0 0 0 3px rgba(60,72,107,0.70);
    --gd-ring-dark: 0 0 0 3px rgba(244,244,244,0.85);
    --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
    --dur: 160ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
figure { margin: 0; }

/* The ground is Webb's NGC 628 (weic2403c, the PHANGS portrait — owner pick,
   2026-08-26) under the family scrim; its visible credit rides .gd-sky-credit
   (the owner's rule: Webb imagery always carries its credit). */
body {
    font-family: var(--gd-font);
    color: var(--gd-text);
    background-color: var(--gd-cosmos);
    background-image: linear-gradient(180deg, rgba(8,11,22,0.55), rgba(8,11,22,0.74)), url('/components/files/images/ngc628-phangs-webb.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

.gd-sky-credit {
    position: fixed; left: 10px; bottom: 6px; z-index: 5;
    font-size: 0.62rem; color: rgba(255,255,255,0.45);
    pointer-events: none;
}

.mono { font-family: var(--gd-mono); font-variant-numeric: tabular-nums; }

a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--gd-ring-dark); border-radius: var(--r-sm); }
.gd-sheet a:focus-visible { box-shadow: var(--gd-ring); }

/* =========================== Top bar ======================================= */
/* The SkyRock Superior WHITE VIBE (owner, 2026-08-26; the 15f verdict): white
   porcelain surfaces, the machined-silver gradient as the ONE trim, navy ink.
   The guide's chrome wears it — a white rail with the brand on its brushed-
   metal placard and links as quiet navy pills; silver marks the call to
   action. Gold remains only where it carries meaning (the canvas vocabulary,
   derived/locked marks, the attention rule on notes). */
/* The guides' header is BLACK (owner, 2026-08-27): the landings' black-metal
   family bar, not the white rail — one family bar across every public door. */
.gd-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    padding: 0.55rem clamp(1rem, 4vw, 2.4rem);
    background: linear-gradient(-145deg, #1c1c1c, #2a2a2a, #141414, #333333, #1c1c1c);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.gd-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.gd-brand-plate {
    width: 3.6rem; height: 1.8rem; border-radius: 8px;
    background-image: url('/components/files/icons/OfficialSkyRockWhiteLogo.svg'), var(--gd-plate);
    background-repeat: no-repeat; background-position: center; background-size: auto 1.46rem, cover;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.4);
}
.gd-brand-text {
    color: var(--gd-on-dark); font-weight: 800; letter-spacing: 0.08em; font-size: 1.02rem;
    display: flex; flex-direction: column; line-height: 1.05;
}
.gd-brand-sub {
    font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5); font-weight: 700;
}
.gd-nav { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.gd-nav a {
    color: rgba(255, 255, 255, 0.72); text-decoration: none; font-size: 0.9rem; font-weight: 600;
    padding: 0.42rem 0.8rem; border-radius: var(--r-pill); border: 1px solid transparent;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.gd-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.gd-nav a.is-cta { background: var(--gd-silver-grad); color: var(--gd-accent); border-color: var(--gd-line-strong); box-shadow: var(--sh-rest); }
.gd-nav a.is-cta:hover { filter: brightness(1.04); color: var(--gd-accent); }
.gd-lang { display: inline-flex; align-items: center; }

/* =========================== Hero ========================================= */
.gd-hero {
    max-width: 76rem; margin: 0 auto; padding: clamp(3rem, 8vw, 5.5rem) var(--s-5) var(--s-7);
    text-align: center;
}
.gd-hero-badge {
    display: inline-block; padding: 0.35rem 0.9rem; border-radius: var(--r-pill);
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--gd-on-dark); background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.45);
}
.gd-hero-title {
    margin-top: var(--s-4); font-size: var(--fs-hero); font-weight: 800;
    letter-spacing: -0.03em; line-height: 0.98; text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.gd-hero-t1 { display: block; color: var(--gd-on-dark); }
.gd-hero-t2 {
    display: block;
    background: linear-gradient(180deg, #ffffff 0%, #e6e6e6 45%, #c2c2c2 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gd-hero-lead {
    max-width: 46rem; margin: var(--s-5) auto 0; color: var(--gd-on-dark-muted);
    font-size: var(--fs-lg); line-height: 1.6;
}
.gd-hero-cta { margin-top: var(--s-6); display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

/* buttons — silver on the cosmos, steel on the sheet */
.gd-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0.65rem 1.35rem; border-radius: var(--r-md);
    font-weight: 700; font-size: var(--fs-md); text-decoration: none; border: 1px solid transparent;
    transition: filter var(--dur) var(--ease), background var(--dur) var(--ease), transform 80ms var(--ease);
}
.gd-btn:active { transform: translateY(1px); }
.gd-btn--silver { background: var(--gd-silver-grad); color: var(--gd-accent); box-shadow: var(--sh-pop); }
.gd-btn--silver:hover { filter: brightness(1.04); }
.gd-btn--ghost { background: rgba(255,255,255,0.08); color: var(--gd-on-dark); border-color: rgba(255,255,255,0.42); }
.gd-btn--ghost:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.62); }

/* =========================== The sheet ==================================== */
.gd-sheet {
    max-width: 76rem; margin: 0 auto; background: var(--gd-sheet);
    border-radius: var(--r-lg); box-shadow: var(--sh-sheet); overflow: hidden;
}
.gd-band { padding: clamp(2rem, 5vw, 3.4rem) clamp(1.1rem, 4vw, 3rem); background: var(--gd-sheet); scroll-margin-top: 4.6rem; }
.gd-band + .gd-band { border-top: 1px solid var(--gd-line); }
.gd-band--tray { background: var(--gd-tray); }
.gd-band--head { padding-top: clamp(1.6rem, 4vw, 2.6rem); }

.gd-bandhead { margin-bottom: var(--s-5); }
.gd-bandhead--split {
    display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-6); align-items: start;
}
.gd-eyebrow {
    display: flex; align-items: center; gap: 0.55rem;
    color: var(--gd-accent); font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: var(--s-3);
}
.gd-ch {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.7rem; height: 1.7rem; padding: 0 0.3rem; border-radius: var(--r-sm);
    background: var(--gd-accent); color: #fff;
    font-family: var(--gd-mono); font-size: 0.78rem; letter-spacing: 0.04em;
}
.gd-h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; max-width: 34ch; }
.gd-h3 { font-size: var(--fs-lg); font-weight: 700; margin: var(--s-6) 0 var(--s-3); }
.gd-lead { margin-top: var(--s-3); max-width: 60ch; color: var(--gd-muted); font-size: var(--fs-md); line-height: 1.65; }
.gd-p { max-width: 66ch; color: var(--gd-muted); font-size: var(--fs-md); line-height: 1.65; margin-bottom: var(--s-3); }
.gd-p--fine { font-size: var(--fs-sm); color: var(--gd-subtle); max-width: none; }

/* the formula chip — the family's typographic signature */
.gd-formula {
    justify-self: end; align-self: start;
    font-family: var(--gd-mono); font-size: var(--fs-md); color: var(--gd-text);
    background: var(--gd-tray-2); border: 1px solid var(--gd-line-strong);
    border-left: 3px solid #c2c2c2; border-radius: var(--r-sm);
    padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: 0.3rem;
    max-width: 100%; overflow-x: auto; white-space: nowrap;
}
.gd-formula-c { color: var(--gd-subtle); font-size: var(--fs-sm); white-space: normal; }

/* chips row (reserved words) */
.gd-chips {
    font-size: var(--fs-md); color: var(--gd-accent);
    background: var(--gd-tray-2); border: 1px solid var(--gd-line-strong); border-radius: var(--r-sm);
    padding: var(--s-3) var(--s-4); display: inline-block; margin-bottom: var(--s-3);
}

/* =========================== TOC ========================================== */
.gd-toc {
    list-style: none; margin-top: var(--s-5);
    display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.5rem;
    counter-reset: none;
}
.gd-toc a {
    display: flex; align-items: baseline; gap: 0.7rem; text-decoration: none;
    color: var(--gd-text); font-weight: 600; font-size: var(--fs-md);
    padding: 0.55rem 0.7rem; border-radius: var(--r-sm); border: 1px solid transparent;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.gd-toc a:hover { background: var(--gd-tray); border-color: var(--gd-line-strong); }
.gd-toc-n { font-family: var(--gd-mono); font-size: var(--fs-xs); color: var(--gd-accent); }

/* =========================== Cards & grids ================================= */
.gd-grid { display: grid; gap: var(--s-4); margin-top: var(--s-4); }
.gd-grid--2 { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.gd-grid--3 { grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }
.gd-grid--4 { grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.gd-grid--top { align-items: start; }
.gd-card {
    background: var(--gd-sheet); border: 1px solid var(--gd-line); border-radius: var(--r-md);
    box-shadow: var(--sh-rest); padding: var(--s-4) var(--s-4) var(--s-4);
}
.gd-band--tray .gd-card { border-color: var(--gd-line-strong); }
.gd-card h3 { font-size: var(--fs-md); font-weight: 700; margin-bottom: 0.45rem; }
.gd-card p { font-size: var(--fs-sm); color: var(--gd-muted); line-height: 1.6; }
.gd-card p + p { margin-top: 0.4rem; }
.gd-card--do { border-left: 3px solid var(--gd-green); }
.gd-card--dont { border-left: 3px solid var(--gd-danger-ink); }
.gd-card--pm { display: flex; flex-direction: column; gap: 0.5rem; }

/* premade trees */
.gd-tree { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.3rem; }
.gd-tree li { display: flex; flex-direction: column; gap: 0.25rem; }
.gd-tree li + li { border-left: 3px solid var(--gd-gold-soft); padding-left: 0.7rem; margin-left: 0.35rem; }
.gd-tree i { font-style: normal; font-size: var(--fs-sm); color: var(--gd-muted); line-height: 1.55; }
.gd-pill {
    align-self: flex-start; display: inline-block; padding: 0.14rem 0.6rem; border-radius: var(--r-pill);
    font-family: var(--gd-mono); font-size: var(--fs-xs); font-weight: 700;
    color: var(--gd-accent); background: var(--gd-accent-soft); border: 1px solid rgba(60,72,107,0.25);
}
.gd-pill--navy { color: #fff; background: var(--gd-accent); border-color: var(--gd-accent); }
.gd-pill--gold { color: var(--gd-gold-ink); background: rgba(194,163,90,0.14); border-color: var(--gd-gold-soft); }

/* steps */
.gd-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s-4); margin-top: var(--s-4); }
.gd-step {
    position: relative; background: var(--gd-sheet); border: 1px solid var(--gd-line-strong);
    border-radius: var(--r-md); box-shadow: var(--sh-rest); padding: var(--s-4);
}
.gd-step-n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--gd-steel-grad); color: #fff; font-weight: 800; font-size: var(--fs-sm);
    margin-bottom: 0.6rem;
}
.gd-step h4 { font-size: var(--fs-md); margin-bottom: 0.35rem; }
.gd-step p { font-size: var(--fs-sm); color: var(--gd-muted); line-height: 1.6; }

/* notes — read, don't shout */
.gd-note {
    margin-top: var(--s-4); padding: var(--s-4);
    background: var(--gd-tray); border: 1px solid var(--gd-line-strong);
    border-left: 3px solid var(--gd-gold); border-radius: var(--r-sm);
    font-size: var(--fs-sm); color: var(--gd-muted); line-height: 1.6;
}
.gd-band--tray .gd-note { background: var(--gd-sheet); }
.gd-note b { color: var(--gd-text); display: block; margin-bottom: 0.25rem; }
.gd-note--warn { border-left-color: var(--gd-danger-ink); }

/* =========================== Tables ======================================= */
.gd-tablewrap { overflow-x: auto; margin-top: var(--s-4); border: 1px solid var(--gd-line-strong); border-radius: var(--r-md); background: var(--gd-sheet); }
.gd-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 34rem; }
.gd-table thead th {
    text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--gd-subtle); background: var(--gd-tray); padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--gd-line-strong); white-space: nowrap;
}
.gd-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--gd-line); color: var(--gd-muted); vertical-align: top; line-height: 1.5; }
.gd-table tbody tr:last-child td { border-bottom: none; }
.gd-table td:first-child { color: var(--gd-text); font-weight: 600; white-space: nowrap; }
.gd-table--mods td:first-child, .gd-table td.mono { font-family: var(--gd-mono); font-weight: 600; }
.gd-table .num { text-align: right; font-family: var(--gd-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-table .ok { color: var(--gd-green-ink); font-weight: 600; white-space: normal; }
.gd-table .mid { color: var(--gd-gold-ink); font-weight: 600; white-space: normal; }
.gd-table .no { color: var(--gd-danger-ink); font-weight: 600; white-space: normal; }
.gd-table--sheet td { white-space: nowrap; }
.gd-th--derived { color: var(--gd-gold-ink) !important; }
.gd-tr--derived td { background: rgba(194,163,90,0.05); }
.gd-tchip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.5rem; height: 1.5rem; border-radius: 7px; margin-right: 0.5rem;
    font-family: var(--gd-mono); font-size: 0.8rem; font-weight: 800;
    color: var(--gd-accent); background: var(--gd-accent-soft);
}
.gd-tchip--res { background: rgba(60,72,107,0.10); border: 1px solid rgba(60,72,107,0.35); }
.gd-tchip--roll { color: var(--gd-green-ink); background: rgba(46,158,107,0.12); border: 1px solid rgba(46,158,107,0.4); }
.gd-tchip--up { background: rgba(60,72,107,0.10); border: 1px solid rgba(60,72,107,0.35); }
.gd-tchip--op { color: var(--gd-gold-ink); background: rgba(194,163,90,0.16); border: 1px solid var(--gd-gold-soft); }

/* =========================== Figures ====================================== */
.gd-fig { margin-top: var(--s-4); }
.gd-cap {
    margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--gd-subtle); line-height: 1.6; max-width: 72ch;
}
.gd-cap b { color: var(--gd-text); }
.gd-cap--list { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 0.4rem 1.2rem; max-width: none; }
.gd-cap--list > span { display: flex; gap: 0.5rem; }
.gd-cap--list b {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--gd-accent); color: #fff;
    font-size: var(--fs-xs);
}

/* ---- the workspace frame: chrome bar + dotted paper ---- */
.gd-bp-frame {
    background: #f6f6f6; border: 1px solid var(--gd-line-strong); border-radius: var(--r-lg);
    overflow: hidden; box-shadow: var(--sh-rest), inset 0 1px 0 rgba(255,255,255,0.5);
}
.gd-bp-frame--pad { padding-top: 0.4rem; }
.gd-bp-bar {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.9rem;
    background: linear-gradient(180deg, #ffffff, #f4f4f4); border-bottom: 1px solid var(--gd-line);
}
.gd-bp-dots { display: inline-flex; gap: 0.32rem; }
.gd-bp-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--gd-line-strong); }
.gd-bp-crumb { font-family: var(--gd-mono); font-size: var(--fs-xs); color: var(--gd-subtle); }
.gd-bp-scroll { overflow-x: auto; }
.gd-bp-svg { display: block; width: 100%; min-width: 34rem; height: auto; font-family: var(--gd-font); }

/* ---- SVG module vocabulary (values from the app stylesheet) ---- */
.gd-mod-box { fill: #ffffff; stroke: #d2d2d2; stroke-width: 1; filter: drop-shadow(0 2px 4px rgba(8,12,24,0.12)); }
.gd-out-box { fill: #fdfcf8; stroke: var(--gd-gold-soft); }
.gd-mod-head { fill: #f7f7f7; }
.gd-mod--error { stroke: #b3261e; stroke-width: 1.6; filter: drop-shadow(0 0 3px rgba(179,38,30,0.35)); }
.gd-kind-box { fill: #eef1f7; }
.gd-kind-box--op { fill: rgba(194,163,90,0.16); stroke: var(--gd-gold-soft); }
.gd-kind-box--res { fill: rgba(60,72,107,0.10); stroke: rgba(60,72,107,0.35); }
.gd-kind-box--roll { fill: rgba(46,158,107,0.12); stroke: rgba(46,158,107,0.4); }
.gd-kind-box--up { fill: rgba(60,72,107,0.10); stroke: rgba(60,72,107,0.35); }
.gd-kind { fill: var(--gd-accent); font-size: 11px; font-weight: 800; font-family: var(--gd-mono); }
.gd-title { fill: var(--gd-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.8px; }
.gd-title--gold { fill: var(--gd-gold-ink-ws); }
.gd-field { fill: #f7f7f7; stroke: #e4e4e4; }
.gd-note-t { fill: #474c53; font-size: 11px; }
.gd-formula-well { fill: #f7f7f7; stroke: #e4e4e4; }
.gd-formula-t { fill: var(--gd-accent); font-size: 11px; font-family: var(--gd-mono); }
.gd-formula-t--empty { fill: #8a8a8a; font-style: italic; }
.gd-lit { fill: #ffffff; stroke: #d2d2d2; }
.gd-lit--bad { fill: #fdf0ef; stroke: #d9534f; }
.gd-lit-t { fill: var(--gd-text); font-size: 11px; font-family: var(--gd-mono); }
.gd-plug-t { fill: var(--gd-gold-ink-ws); font-size: 11px; font-weight: 600; }
.gd-btn-mock { fill: #f0f0f0; stroke: #d2d2d2; }
.gd-btn-mock-t { fill: var(--gd-accent); font-size: 11px; font-weight: 600; }
.gd-paltab { fill: #ffffff; stroke: #d2d2d2; }
.gd-paltab-t { fill: var(--gd-accent); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.gd-call circle { fill: var(--gd-accent); }
.gd-call text { fill: #ffffff; font-size: 11px; font-weight: 800; }
.gd-x { fill: #8a8a8a; font-size: 13px; }
.gd-x2 { color: #8a8a8a; font-size: 0.95rem; padding: 0 0.3rem; }
.gd-rule { stroke: var(--gd-line); stroke-width: 1; }
.gd-chip3 { fill: rgba(194,163,90,0.16); stroke: var(--gd-gold); }
.gd-chip3-t { fill: var(--gd-gold-ink-ws); font-size: 11px; font-weight: 700; }
.gd-ax { fill: var(--gd-subtle); font-size: 10px; font-family: var(--gd-mono); }
/* The last-bar value label is MUTED in the product (lb-ch-vlabel renders in
   --lb-muted) — no gold chart mark exists there, so none is painted here. */
.gd-ax--val { fill: var(--gd-subtle); font-weight: 700; }
.gd-bar { fill: #4a6fd4; opacity: 0.82; }
.gd-bar--neg { fill: #b3372f; opacity: 0.82; }

/* ---- ports: shape says the kind; fill says the direction ---- */
.gd-port { fill: #ffffff; stroke: var(--gd-accent); stroke-width: 2; }
.gd-port--out { fill: var(--gd-gold); stroke: var(--gd-gold-ink-ws); }
.gd-port--base { stroke: var(--gd-gold-ink-ws); filter: drop-shadow(0 0 3px rgba(194,163,90,0.55)); }
.gd-port--bad { fill: #f6d7d4; stroke: #b3261e; filter: drop-shadow(0 0 3px rgba(179,38,30,0.35)); }
.gd-port--any { fill: var(--gd-gold); stroke: var(--gd-gold-ink-ws); stroke-width: 2; }
.gd-port--bool { fill: var(--gd-accent); stroke: var(--gd-accent-hover); stroke-width: 2; }
.gd-pin { fill: #ffffff; stroke: var(--gd-accent); stroke-width: 2; }
.gd-pin--wired { fill: var(--gd-check-hi); stroke: var(--gd-gold-ink-ws); }

/* ---- cables (stroke recipes verbatim from the app) ---- */
.gd-cable { fill: none; stroke: rgba(60,72,107,0.55); stroke-width: 2.25; stroke-linecap: round; }
.gd-cable--chain { fill: none; stroke: var(--gd-gold); stroke-width: 2; stroke-dasharray: 7 6; opacity: 0.85; stroke-linecap: round; }
.gd-cable--ghost { fill: none; stroke: var(--gd-gold); stroke-width: 2.25; stroke-dasharray: 5 5; stroke-linecap: round; }
.gd-cable--gate { fill: none; stroke: var(--gd-gold-ink-ws); stroke-width: 2; stroke-dasharray: 4 5; opacity: 0.85; stroke-linecap: round; }
.gd-cable--err { fill: none; stroke: #c6362c; stroke-width: 2.5; stroke-linecap: round; }
.gd-reroute { fill: #ffffff; stroke: var(--gd-accent); stroke-width: 2; }

/* ---- the health strips ---- */
.gd-strip {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.9rem; font-size: var(--fs-sm); line-height: 1.5;
}
.gd-strip--error { background: rgba(179,38,30,0.10); border-bottom: 1px solid rgba(179,38,30,0.55); color: #8f1d16; }
.gd-strip--warn {
    margin-top: var(--s-4); border: 1px solid var(--gd-gold-soft); border-radius: var(--r-sm);
    background: rgba(194,163,90,0.14); color: var(--gd-gold-ink);
}

/* =========================== The golden diamond =========================== */
.gd-diamond { position: relative; display: inline-block; width: 1.2rem; height: 1.2rem; flex: none; }
.gd-diamond::before {
    content: ''; position: absolute; inset: 2px; transform: rotate(45deg); border-radius: 3px;
    background: #ffffff; border: 2px solid var(--gd-accent); box-sizing: border-box;
}
.gd-diamond.is-on::before, .gd-diamond.is-wired::before {
    background: linear-gradient(135deg, var(--gd-check-hi), var(--gd-check-lo));
    border-color: var(--gd-gold-ink); box-shadow: 0 1px 4px rgba(194,163,90,0.38);
}
.gd-diamond.is-on::after, .gd-diamond.is-wired::after {
    content: ''; position: absolute; inset: 28%; background: var(--gd-accent);
    clip-path: polygon(12% 48%, 0 66%, 38% 100%, 100% 20%, 84% 4%, 36% 66%);
}
.gd-diamond.is-wired { opacity: 0.55; }
.gd-diamond-states {
    justify-self: end; display: flex; flex-direction: column; gap: 0.7rem;
    background: var(--gd-sheet); border: 1px solid var(--gd-line-strong); border-radius: var(--r-md);
    box-shadow: var(--sh-rest); padding: var(--s-4);
}
.gd-diamond-states > span { display: flex; align-items: center; gap: 0.7rem; }
.gd-diamond-states i { font-style: normal; font-size: var(--fs-sm); color: var(--gd-muted); }

/* =========================== Legend (ports & cables) ====================== */
.gd-legend {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: var(--s-5);
    background: var(--gd-tray); border: 1px solid var(--gd-line-strong); border-radius: var(--r-md);
    padding: var(--s-4);
}
.gd-legend-t { font-size: var(--fs-sm); font-weight: 700; color: var(--gd-text); margin-bottom: 0.7rem; }
.gd-lg-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.3rem 0; font-size: var(--fs-sm); color: var(--gd-muted); line-height: 1.5; }
.gd-lg-row svg { flex: none; width: 3.2rem; height: 1.6rem; overflow: visible; }
.gd-lg-row svg[viewBox="0 0 28 28"] { width: 1.6rem; }

/* =========================== Mocks ======================================== */
/* modal (entry form · import plan · agent card) */
.gd-modal {
    max-width: 30rem; background: var(--gd-sheet); border: 1px solid var(--gd-line-strong);
    border-radius: var(--r-md); box-shadow: var(--sh-pop); padding: var(--s-4);
}
.gd-modal--card { max-width: 34rem; }
.gd-modal-t { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--s-3); }
.gd-form { display: flex; flex-direction: column; gap: 0.6rem; }
.gd-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: var(--fs-xs); font-weight: 600; color: var(--gd-subtle); }
.gd-form input, .gd-form-still {
    font-size: var(--fs-sm); color: var(--gd-text); background: var(--gd-sheet);
    border: 1px solid var(--gd-line-strong); border-radius: var(--r-sm); padding: 0.45rem 0.6rem;
    font-family: inherit; pointer-events: none;
}
.gd-form input.num { text-align: right; font-family: var(--gd-mono); font-weight: 700; }
.gd-form input::placeholder { color: #8a8a8a; font-style: italic; }
.gd-form-still {
    display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
    border-style: dashed; background: var(--gd-tray); color: var(--gd-subtle); font-size: var(--fs-xs); font-weight: 600;
}
.gd-form-still b { color: var(--gd-text); font-size: var(--fs-sm); }
.gd-form-check { flex-direction: row !important; align-items: center; gap: 0.6rem !important; font-size: var(--fs-sm) !important; color: var(--gd-text) !important; }
.gd-selface {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
    font-size: var(--fs-sm); color: var(--gd-text);
    background: linear-gradient(180deg, #ffffff, #f6f6f6);
    border: 1px solid var(--gd-line-strong); border-radius: var(--r-sm); padding: 0.45rem 0.6rem;
}
.gd-selface i { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--gd-accent); }
.gd-selface--sm { padding: 0.3rem 0.5rem; font-size: var(--fs-xs); flex: none; min-width: 5.4rem; }
.gd-modal-btns { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: var(--s-4); }
.gd-btn-mock2 {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.4rem 0.9rem; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 700;
    color: var(--gd-accent); background: var(--gd-sheet); border: 1px solid var(--gd-line-strong); white-space: nowrap;
}
.gd-btn-mock2.is-silver { background: var(--gd-silver-grad); box-shadow: var(--sh-rest); }

/* agent review card items */
.gd-card-hint { font-size: var(--fs-sm); color: var(--gd-subtle); margin-bottom: var(--s-3); }
.gd-card-item {
    display: flex; gap: 0.7rem; align-items: flex-start;
    border: 1px solid var(--gd-line); border-radius: var(--r-sm); padding: 0.6rem 0.7rem; margin-bottom: 0.5rem;
    background: var(--gd-tray);
}
.gd-card-item > div { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.gd-card-item b { font-size: var(--fs-sm); }
.gd-card-item .mono { font-size: var(--fs-xs); color: var(--gd-muted); overflow-wrap: anywhere; }
.gd-card-foot {
    display: flex; align-items: center; gap: 0.6rem; justify-content: flex-end;
    font-size: var(--fs-xs); color: var(--gd-subtle); margin-top: var(--s-3);
}

/* sheet mock */
.gd-sheetmock { background: var(--gd-sheet); border: 1px solid var(--gd-line-strong); border-radius: var(--r-md); box-shadow: var(--sh-rest); padding: var(--s-4); }
.gd-crumbs { font-size: var(--fs-xs); color: var(--gd-subtle); margin-bottom: 0.6rem; }
.gd-crumbs .is-here { color: var(--gd-text); font-weight: 700; border-bottom: 2px solid var(--gd-gold); }
.gd-sheetbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.gd-sheetbar b { font-size: var(--fs-lg); margin-right: auto; }
.gd-sheetmock .gd-tablewrap { margin-top: 0.5rem; }
.gd-pager { text-align: center; margin-top: 0.7rem; font-size: var(--fs-sm); color: var(--gd-subtle); }

/* totals board */
.gd-board { background: var(--gd-sheet); border: 1px solid var(--gd-line-strong); border-radius: var(--r-md); box-shadow: var(--sh-rest); padding: var(--s-4); }
.gd-board-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: var(--s-3); }
.gd-board-head b { font-size: var(--fs-lg); }
.gd-tiles {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1px;
    background: var(--gd-line-strong); border: 1px solid var(--gd-line-strong); border-radius: var(--r-sm); overflow: hidden;
}
.gd-tile { background: var(--gd-sheet); padding: 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.gd-tile span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--gd-subtle); font-weight: 600; }
.gd-tile b { font-size: 1.35rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-tile--gold b { color: var(--gd-gold-ink); }
.gd-tabs { display: flex; gap: 0.3rem; margin: var(--s-3) 0 0.5rem; }
.gd-tabs span { padding: 0.3rem 0.8rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; color: var(--gd-subtle); border: 1px solid transparent; }
.gd-tabs .is-on { color: var(--gd-accent); background: var(--gd-accent-soft); border-color: rgba(60,72,107,0.25); }
.gd-chart-scroll { overflow-x: auto; }
.gd-chart-scroll svg { display: block; width: 100%; min-width: 28rem; height: auto; }

/* boundary management mock */
.gd-outmock {
    max-width: 30rem; background: #fdfcf8; border: 1px solid var(--gd-gold-soft); border-radius: var(--r-md);
    border-top: 3px solid var(--gd-gold); box-shadow: var(--sh-rest); padding: var(--s-4);
}
.gd-outmock-t { font-size: var(--fs-sm); font-weight: 700; color: var(--gd-gold-ink); letter-spacing: 0.06em; margin-bottom: 0.7rem; }
.gd-outmock-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.gd-outmock-row input {
    flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--gd-text); font-family: inherit;
    border: 1px solid var(--gd-line-strong); border-radius: var(--r-sm); padding: 0.35rem 0.55rem; pointer-events: none; background: var(--gd-sheet);
}
.gd-outmock-add { font-size: var(--fs-sm); font-weight: 700; color: var(--gd-accent); margin-top: 0.6rem; }

/* import plan mock */
.gd-plan { display: flex; flex-direction: column; gap: 0.45rem; font-size: var(--fs-sm); }
.gd-plan > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--gd-line); padding-bottom: 0.4rem; }
.gd-plan span { color: var(--gd-subtle); }
.gd-plan b { color: var(--gd-text); }
.gd-plan-safe { margin-top: var(--s-3); font-size: var(--fs-sm); font-weight: 700; color: var(--gd-green-ink); }
.gd-plan-note { margin-top: 0.3rem; font-size: var(--fs-xs); color: var(--gd-subtle); }

/* layers nesting figure */
.gd-ly { display: flex; flex-direction: column; gap: 0.6rem; }
.gd-ly-box {
    border: 1px solid var(--gd-line-strong); border-radius: var(--r-md); background: var(--gd-sheet);
    padding: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.gd-ly-box--u { border-color: var(--gd-gold-soft); border-top: 3px solid var(--gd-gold); background: #fdfcf8; }
.gd-ly-box--in { margin-left: 1.1rem; border-left: 3px solid var(--gd-gold); background: var(--gd-tray); }
.gd-ly-pill { align-self: flex-start; display: inline-block; padding: 0.14rem 0.6rem; border-radius: var(--r-pill); font-family: var(--gd-mono); font-size: var(--fs-xs); font-weight: 700; color: #fff; background: var(--gd-accent); }
.gd-ly-pill--gold { color: var(--gd-gold-ink); background: rgba(194,163,90,0.14); border: 1px solid var(--gd-gold-soft); }
.gd-ly-name { font-size: var(--fs-sm); color: var(--gd-muted); }

/* =========================== Closing & footer ============================= */
/* The closing panel wears the white vibe as well: a porcelain card echoing the
   sheet, navy ink, and — the landing's own law: silver on white is invisible —
   a STEEL primary with a quiet porcelain secondary. */
.gd-close { max-width: 76rem; margin: var(--s-7) auto 0; padding: 0 var(--s-5); }
.gd-close-panel {
    background: var(--gd-sheet); border: 1px solid var(--gd-line-strong); border-radius: var(--r-lg);
    box-shadow: var(--sh-sheet); padding: clamp(2rem, 5vw, 3rem); text-align: center; color: var(--gd-text);
}
.gd-close-panel h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.02em; }
.gd-close-panel p { max-width: 46rem; margin: var(--s-4) auto 0; color: var(--gd-muted); font-size: var(--fs-md); line-height: 1.65; }
.gd-close-cta { margin-top: var(--s-5); display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.gd-close-panel .gd-btn--silver { background: var(--gd-steel-grad); color: #ffffff; box-shadow: var(--sh-rest); }
.gd-close-panel .gd-btn--silver:hover { filter: brightness(1.12); }
.gd-close-panel .gd-btn--ghost { background: var(--gd-sheet); color: var(--gd-accent); border-color: var(--gd-line-strong); }
.gd-close-panel .gd-btn--ghost:hover { background: var(--gd-tray); border-color: var(--gd-accent); }
.gd-close-panel a:focus-visible { box-shadow: var(--gd-ring); }

.gd-foot {
    max-width: 76rem; margin: 0 auto; padding: var(--s-6) var(--s-5) var(--s-7);
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem;
    color: var(--gd-on-dark-faint); font-size: var(--fs-sm); text-align: center;
}
.gd-foot a { color: var(--gd-on-dark-muted); text-decoration: none; }
.gd-foot a:hover { color: #fff; text-decoration: underline; }
.gd-foot-dot { opacity: 0.5; }

/* =========================== Responsive =================================== */
@media (max-width: 60rem) {
    .gd-sheet { border-radius: 0; }
    .gd-close { padding: 0 var(--s-3); }
}
@media (max-width: 56rem) {
    .gd-bandhead--split { grid-template-columns: 1fr; }
    .gd-formula, .gd-diamond-states { justify-self: start; }
}
@media (max-width: 38rem) {
    .gd-top { flex-direction: column; align-items: center; gap: 0.5rem; }
    .gd-nav { justify-content: center; }
    .gd-hero-cta .gd-btn, .gd-close-cta .gd-btn { width: 100%; }
    .gd-table { min-width: 30rem; }
}
@media (max-width: 30rem) {
    .gd-ly-box--in { margin-left: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .gd-btn, .gd-nav a, .gd-toc a { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE gdx TRANSCRIPTION LAYER (owner rule 2026-08-28: exhibits must be EXACTLY
   the product). Every recipe below is copied VERBATIM from the app's own
   public/components/logbooks/logbooks.css — same colors, borders, radii,
   shadows, dashes, sizes — under a gdx- prefix so the guide's own chrome (gd-*)
   and the app transcription can never collide. When logbooks.css changes,
   RE-TRANSCRIBE; never restyle by eye. Static exhibits: resting states only.
   ═══════════════════════════════════════════════════════════════════════════ */

.gdx-editor {
    /* the app's tokens, inlined (logbooks.css :root) */
    --x-surface: #ffffff; --x-surface-2: #f7f7f7; --x-surface-hover: #f0f0f0;
    --x-line: #e4e4e4; --x-line-strong: #d2d2d2;
    --x-text: #232731; --x-muted: #3f454f; --x-subtle: #545a63;
    --x-accent: #3C486B; --x-accent-hover: #2e3a56;
    --x-gold: #c2a35a; --x-gold-soft: rgba(194, 163, 90, 0.40); --x-gold-ink: #7a5e17;
    --x-silver-grad: linear-gradient(-145deg, #f4f4f4, #e0e0e0, #fcfcfc, #d8d8d8, #eeeeee);
    --x-silver-ink: #8a8a8a;
    --x-check-hi: #d9bc72; --x-check-lo: #ab8a3c; --x-check-glow: rgba(194, 163, 90, 0.38);
    --x-danger-ink: #b3372f;
    --x-sh-sm: 0 1px 2px rgba(8, 12, 24, 0.06);
    --x-sh-md: 0 1px 3px rgba(8, 12, 24, 0.22), 0 8px 22px rgba(8, 12, 24, 0.28);
    --x-fs-xs: 0.72rem; --x-fs-sm: 0.82rem; --x-fs-md: 0.92rem; --x-fs-lg: 1.1rem; --x-fs-num: 1.6rem;
    background: var(--x-surface);
    border: 1px solid var(--gd-line);
    border-radius: 16px;
    padding: 0.9rem;
    display: flex; flex-direction: column; gap: 0.7rem;
    font-size: 16px; line-height: 1.4; color: var(--x-text);
    box-shadow: 0 1px 2px rgba(8, 12, 24, 0.06);
}

/* ---- workspace bar (lb-ws-bar family) ---- */
.gdx-ws-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.gdx-ws-crumbs { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; min-width: 0; }
.gdx-ws-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.gdx-ws-back {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--x-surface-2); color: var(--x-accent);
    border: 1px solid var(--x-line-strong); border-radius: 999px;
    padding: 0.3rem 0.8rem 0.3rem 0.6rem;
    font-size: 0.82rem; font-weight: 600;
}
.gdx-ws-back-icon { font-size: 1.05rem; line-height: 1; }
.gdx-ws-crumb {
    padding: 0.28rem 0.55rem; border-radius: 8px;
    color: var(--x-muted); font-size: 0.86rem; font-weight: 600; white-space: nowrap;
}
.gdx-ws-crumb.is-here { color: var(--x-text); }
.gdx-ws-crumb.is-here::after {
    content: ""; display: block; height: 2px; margin-top: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--x-gold), transparent);
}
.gdx-ws-sep { color: var(--x-subtle); }
.gdx-ws-icon {
    width: 2rem; height: 2rem; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--x-surface-2); color: var(--x-accent);
    border: 1px solid var(--x-line-strong); border-radius: 9px;
    font-size: 0.95rem; line-height: 1;
}
.gdx-ws-icon--flat { border: none; background: none; width: 1.7rem; }
.gdx-ico { width: 1.05rem; height: 1.05rem; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gdx-ws-zoombox {
    display: inline-flex; align-items: center; gap: 0.1rem;
    background: var(--x-surface-2);
    border: 1px solid var(--x-line-strong); border-radius: 9px;
    padding: 0.12rem 0.15rem;
}
.gdx-ws-zoom {
    min-width: 3.1rem; padding: 0.2rem 0.15rem; text-align: center;
    color: var(--x-text); font-size: 0.76rem; font-weight: 700;
    font-variant-numeric: tabular-nums; letter-spacing: 0.02em; border-radius: 6px;
}
.gdx-ws-warn {
    margin: 0; padding: 0.42rem 0.8rem;
    border: 1px solid var(--x-gold-soft); border-radius: 999px;
    background: rgba(194, 163, 90, 0.14); color: var(--x-gold-ink);
    font-size: 0.82rem; font-weight: 600; align-self: flex-start;
}
.gdx-ws-warn--error {
    border-color: rgba(232, 38, 31, 0.60);
    background: rgba(232, 38, 31, 0.12);
    color: #c11d17;
}

/* ---- buttons (lb-btn family) ---- */
.gdx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    border: 1px solid transparent; border-radius: 6px;
    padding: 0.55rem 1.1rem; font-size: 0.92rem; font-weight: 600; white-space: nowrap;
}
.gdx-btn--sm { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.gdx-btn--silver { background: var(--x-silver-grad); color: var(--x-accent); box-shadow: var(--x-sh-sm); }
.gdx-btn--ghost { background: var(--x-surface-2); color: var(--x-accent); border-color: var(--x-line-strong); }
.gdx-btn--danger-ghost { background: transparent; color: var(--x-danger-ink); border-color: rgba(179, 55, 47, 0.45); }

/* ---- the canvas paper (lb-ws-view) ---- */
.gdx-view {
    position: relative; overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: var(--x-sh-md), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background-color: #f6f6f6;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(88, 88, 88, 0.20) 1px, transparent 0),
        linear-gradient(158deg, rgba(255, 255, 255, 0.96), rgba(236, 236, 236, 0.94));
    background-size: 22px 22px, auto;
}
.gdx-cablesheet { position: absolute; inset: 0; width: 100%; height: 100%; }
/* An exhibit may present its plane at a truthful zoom: the wrapper clips at the
   scaled size and the toolbar's percentage says so, exactly as the app would. */
.gdx-plane { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.gdx-reroute { fill: #ffffff; stroke: #3C486B; stroke-width: 2; }
.gdx-pal-tab {
    position: absolute; right: 0; top: 1.2rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 6.4rem;
    padding: 0.9rem 0.42rem;
    background: var(--x-surface); color: var(--x-accent);
    border: 1px solid var(--x-line-strong); border-right: none;
    border-radius: 10px 0 0 10px;
    box-shadow: var(--x-sh-md);
}
.gdx-pal-tablabel {
    writing-mode: vertical-rl; text-orientation: mixed;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em;
}
/* The drawer's SECOND tab (owner, 2026-08-30): «Valores» sits directly below
   «Módulos», same edge, same metal, plum-marked — what it lists are the
   declarations, by name. The live one is joined to its panel by a rail on the
   inner edge; the app's own tabs are taller, and these are the same two tabs
   at the exhibit's scale. */
.gdx-pal-tab--values { top: 7.7rem; min-height: 5.4rem; }
.gdx-pal-tab--values .gdx-pal-tablabel { color: #7c3a6e; }
.gdx-pal-tab.is-on { background: #ffffff; }
.gdx-pal-tab.is-on::after {
    content: ""; position: absolute; left: 0; top: 0.6rem; bottom: 0.6rem; width: 2px;
    border-radius: 2px; background: var(--x-accent);
}
.gdx-pal-tab--values.is-on::after { background: #9C4F8B; }
/* With the drawer open the tabs travel with it, staying joined to its edge. */
.gdx-view.is-pal-open .gdx-pal-tab { transform: translateX(calc(-16.5rem - 0.6rem)); }
.gdx-callout {
    position: absolute; width: 20px; height: 20px; border-radius: 50%;
    background: var(--gd-accent, #3C486B); color: #ffffff;
    font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
    z-index: 5;
}
.gdx-swatch { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; flex: 0 0 auto; }

/* ---- cables (lb-cable family, stroke recipes verbatim) ----
   The cable's COLOR is its TYPE (owner, 2026-08-28): money gold, number
   green, integer sea-teal, text plum, date copper, checkbox ink. The chain
   is machined silver; the ghost keeps its stitch, pale, in its type's hue. */
.gdx-cable { fill: none; stroke: rgba(60, 72, 107, 0.55); stroke-width: 2.25; stroke-linecap: round; }
.gdx-cable--ghost { stroke: var(--x-gold, #c2a35a); stroke-width: 2.25; stroke-dasharray: 5 5; opacity: 0.45; }
.gdx-cable--money { stroke: #ab8a3c; }
.gdx-cable--num { stroke: #2e9e6b; }
.gdx-cable--int { stroke: #2F8080; }
.gdx-cable--text { stroke: #9C4F8B; }
.gdx-cable--date { stroke: #B0714A; }
.gdx-cable--bool { stroke: var(--x-accent, #3C486B); }
.gdx-cable--chain { stroke: var(--x-silver-ink, #8a8a8a); stroke-width: 2.5; }
.gdx-cable--gate { stroke: var(--x-accent, #3C486B); stroke-width: 2.25; }
.gdx-cable--bad { stroke: #f03127; stroke-width: 2.5; }

/* ---- modules (lb-mod family) ---- */
.gdx-mod {
    position: absolute; width: 14.5rem;
    background: var(--x-surface); color: var(--x-text);
    border: 1px solid var(--x-line-strong); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(8, 12, 24, 0.10), 0 10px 24px rgba(8, 12, 24, 0.14);
    display: flex; flex-direction: column;
    text-align: left;
}
.gdx-mod.is-locked { border-color: var(--x-gold-soft); }
.gdx-mod--error {
    border-color: #e8261f;
    box-shadow: 0 0 0 1.5px rgba(232, 38, 31, 0.60), 0 1px 2px rgba(8, 12, 24, 0.10), 0 10px 24px rgba(8, 12, 24, 0.14);
}
.gdx-mod--error > .gdx-mod-head { background: rgba(232, 38, 31, 0.10); }
.gdx-mod-head {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--x-line);
    border-radius: 11px 11px 0 0;
    background: linear-gradient(180deg, #ffffff, var(--x-surface-2));
    position: relative;
}
.gdx-mod-head::before {
    content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 2px; border-radius: 0 0 2px 2px;
}
.gdx-mod--input  .gdx-mod-head::before { background: linear-gradient(90deg, #8b97b5, transparent); }
.gdx-mod--op     .gdx-mod-head::before { background: linear-gradient(90deg, var(--x-gold), transparent); }
.gdx-mod--rollup .gdx-mod-head::before { background: linear-gradient(90deg, #2e9e6b, transparent); }
.gdx-mod--result .gdx-mod-head::before { background: linear-gradient(90deg, var(--x-accent), transparent); }
.gdx-mod--layer  .gdx-mod-head::before { background: linear-gradient(90deg, var(--x-gold), var(--x-accent)); }
.gdx-mod-kind {
    width: 1.4rem; height: 1.4rem; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; font-size: 0.78rem; font-weight: 800;
    background: #eef1f7; color: var(--x-accent);
    border: 1px solid var(--x-line-strong);
}
.gdx-mod--op     .gdx-mod-kind { background: rgba(194, 163, 90, 0.16); color: var(--x-gold-ink); border-color: var(--x-gold-soft); }
.gdx-mod--rollup .gdx-mod-kind { background: rgba(46, 158, 107, 0.12); color: #21714d; border-color: rgba(46, 158, 107, 0.4); }
.gdx-mod--upper  .gdx-mod-kind { background: rgba(60, 72, 107, 0.10); color: var(--x-accent); border-color: rgba(60, 72, 107, 0.35); }
/* ---- the variables plane (lb-mod--vardecl / --variable / --setter, verbatim) ----
   The declaration plaque wears PLUM: it HOLDS a value. The call reads like the
   upper GET — steel — because all it does is read. And the SET is the plaque's
   plum read the other way, its gradient running toward the card rather than
   away from it: a write coming home. */
.gdx-mod--vardecl  .gdx-mod-head::before { background: linear-gradient(90deg, #9C4F8B, transparent); }
.gdx-mod--vardecl  .gdx-mod-kind { background: rgba(156, 79, 139, 0.12); color: #7c3a6e; border-color: rgba(156, 79, 139, 0.4); }
.gdx-mod--variable .gdx-mod-head::before { background: linear-gradient(90deg, #8b97b5, transparent); }
.gdx-mod--variable .gdx-mod-kind { background: rgba(60, 72, 107, 0.10); color: var(--x-accent); border-color: rgba(60, 72, 107, 0.35); }
.gdx-mod--setter   .gdx-mod-head::before { background: linear-gradient(270deg, #9C4F8B, transparent); }
.gdx-mod--setter   .gdx-mod-kind { background: rgba(156, 79, 139, 0.12); color: #7c3a6e; border-color: rgba(156, 79, 139, 0.4); }
/* The FIX row is an ordinary in-body row, not a pin on the edge: the plaque's
   diamond sits beside its words (lb-mod-row lb-var-fix / lb-mod-lab). */
.gdx-mod-row { display: flex; align-items: center; gap: 0.35rem; }
.gdx-mod-lab { color: var(--x-muted); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.gdx-input.is-off, .gdx-select.is-off { color: var(--x-subtle); background-color: var(--x-surface-2); opacity: 0.75; }
.gdx-mod-title {
    flex: 1 1 auto; min-width: 0; font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em; color: var(--x-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gdx-mod-x { width: 1.3rem; height: 1.3rem; flex: 0 0 auto; text-align: center; color: var(--x-subtle); font-size: 0.75rem; line-height: 1.3rem; }
.gdx-mod-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem; }

/* input/select FACES (static spans wearing lb-mod-input / the SkyRock selector paint) */
.gdx-input, .gdx-select, .gdx-area {
    display: block; width: 100%; font-size: 0.85rem; color: var(--x-text);
    background: var(--x-surface); border: 1px solid var(--x-line-strong);
    border-radius: 8px; padding: 0.34rem 0.5rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gdx-select {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233C486B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #ffffff, #f6f6f6);
    background-repeat: no-repeat, no-repeat;
    background-size: 10px 6px, 100% 100%;
    background-position: right 0.45rem center, 0 0;
    padding-right: 1.35rem;
}
.gdx-area { white-space: pre-line; min-height: 3.4rem; }
.gdx-input--num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }
.gdx-mod-lits { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.gdx-lit {
    width: 3.4rem; flex: 1 1 3.4rem; min-width: 2.6rem; font-size: 0.78rem;
    padding: 0.22rem 0.35rem; text-align: center;
    color: var(--x-text); background: var(--x-surface);
    border: 1px solid var(--x-line-strong); border-radius: 8px;
    white-space: nowrap; overflow: hidden;
}
.gdx-lit.is-cable { opacity: 0.5; color: var(--x-subtle); }
.gdx-mod-formula {
    display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem; line-height: 1.5; color: var(--x-accent);
    background: var(--x-surface-2); border: 1px solid var(--x-line);
    border-radius: 8px; padding: 0.35rem 0.5rem; overflow-wrap: anywhere; white-space: normal;
}
.gdx-mod-formula.is-empty { color: var(--x-subtle); font-style: italic; }
.gdx-mod-grow { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.gdx-mod-pm {
    width: 1.5rem; height: 1.5rem; flex: 0 0 auto; text-align: center;
    border: 1px solid var(--x-line-strong); border-radius: 7px;
    background: var(--x-surface-2); color: var(--x-accent);
    font-size: 0.8rem; line-height: 1.4rem;
}
.gdx-mod-count { margin: 0; color: var(--x-muted); font-size: 0.76rem; font-weight: 600; text-align: center; flex: 1; }
.gdx-mod-note { margin: 0; color: var(--x-subtle); font-size: 0.74rem; line-height: 1.45; }
.gdx-mod-link { align-self: flex-start; color: var(--x-accent); font-size: 0.74rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
/* Toggle rows clear their own pin exactly as the app does: the row is NOT a
   positioned ancestor, so the absolute pin resolves against .gdx-mod itself
   (left: -0.72rem from the card edge — half in, half out) while `top` stays
   auto and keeps the pin on its own row. The text pads itself away. */
.gdx-mod-check {
    display: inline-flex; align-items: center; gap: 0.35rem;
    color: var(--x-muted); font-size: 0.76rem; padding-left: 0.45rem; min-height: 1.2rem;
}
.gdx-mod-tab {
    display: flex; align-items: center; gap: 0.3rem; width: 100%;
    margin-top: 0.1rem; padding: 0.28rem 0.1rem 0.05rem;
    border-top: 1px solid var(--x-line);
    color: var(--x-muted);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
}
.gdx-mod-tab-ch { font-size: 0.66rem; color: var(--x-subtle); }
.gdx-mod-tab.is-open .gdx-mod-tab-ch { color: var(--x-gold-ink); }
.gdx-mod-defv { display: flex; align-items: center; gap: 0.35rem; padding-left: 0.45rem; min-height: 1.2rem; }
.gdx-mod-defv-word { color: var(--x-muted); font-size: 0.82rem; font-weight: 600; }

/* ---- the app's DIAMOND checkbox (lb-app input[type=checkbox], static twin) ---- */
.gdx-cb { position: relative; width: 1.2rem; height: 1.2rem; flex: 0 0 auto; display: inline-block; }
.gdx-cb::before {
    content: ""; position: absolute; inset: 2px;
    transform: rotate(45deg); border-radius: 3px;
    background: var(--x-surface, #fff); border: 2px solid var(--x-accent, #3C486B);
    box-shadow: 0 1px 2px rgba(8, 12, 24, 0.10);
}
.gdx-cb::after {
    content: ""; position: absolute; inset: 28%;
    background: var(--x-accent, #3C486B);
    clip-path: polygon(12% 48%, 0 66%, 38% 100%, 100% 20%, 84% 4%, 36% 66%);
    transform: scale(0);
}
.gdx-cb.is-on::before {
    background: linear-gradient(135deg, var(--x-check-hi, #d9bc72), var(--x-check-lo, #ab8a3c));
    border-color: var(--x-gold-ink, #7a5e17);
    box-shadow: 0 1px 4px var(--x-check-glow, rgba(194, 163, 90, 0.38));
}
.gdx-cb.is-on::after { transform: scale(1); }
.gdx-cb.is-bad::before { border-color: #e8261f; background: #ffd9d6; box-shadow: 0 0 0 3px rgba(232, 38, 31, 0.30); }

/* toggle PINS: the diamond rides the card's LEFT edge (lb-port--pin) */
.gdx-pin { position: absolute; left: -0.72rem; display: inline-flex; padding: 2px; }

/* ---- ports (lb-port family) ---- */
.gdx-ports { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: 1.1rem; z-index: 3; }
.gdx-ports--in { bottom: -7px; }
.gdx-ports--out { top: -7px; }
.gdx-ports--spread { justify-content: stretch; gap: 0; }
.gdx-out-cell { flex: 1 1 0; display: flex; justify-content: center; }
.gdx-port {
    position: relative; display: inline-block;
    width: 14px; height: 14px; border-radius: 4px;
    background: var(--x-surface, #fff); border: 2px solid var(--x-accent, #3C486B);
    box-shadow: 0 1px 3px rgba(8, 12, 24, 0.28);
}
.gdx-port--out { border-color: var(--x-gold-ink, #7a5e17); background: var(--x-gold, #c2a35a); }
.gdx-port--base { border-color: var(--x-gold-ink, #7a5e17); box-shadow: 0 0 0 3px rgba(194, 163, 90, 0.28), 0 1px 3px rgba(8, 12, 24, 0.28); }
.gdx-port--bad { border-color: #e8261f; background: #ffd9d6; box-shadow: 0 0 0 3px rgba(232, 38, 31, 0.30); }
/* The port diamond retired 2026-08-28: any = a GOLD fill, in both directions.
   The diamond belongs to the casilla alone — its checkbox and its pins. */
.gdx-port--sh-any { background: var(--x-gold, #c2a35a); border-color: var(--x-gold-ink, #7a5e17); }

/* ---- the drawer, OPEN (lb-pal-panel family) ----
   A floating card resting on the workspace, not a slab bolted to its edge. It
   wears the identity of the tab that opened it: the hairline across its top is
   accent navy for «Módulos» and variables plum for «Valores». */
.gdx-pal-panel {
    position: absolute; right: 0.6rem; top: 0.6rem; bottom: 0.6rem;
    width: 16.5rem; max-width: calc(100% - 1.2rem);
    display: flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.94);
    color: var(--x-text);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 13px;
    box-shadow: 0 1px 2px rgba(8, 12, 24, 0.10), 0 14px 34px rgba(8, 12, 24, 0.16);
    z-index: 6;
}
.gdx-pal-panel::after {
    content: ""; position: absolute; left: 13px; right: 13px; top: 0; height: 2px;
    border-radius: 0 0 2px 2px; background: var(--x-accent);
}
.gdx-pal-panel--values::after { background: #9C4F8B; }
.gdx-pal-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.4rem 0.35rem 0.7rem; }
.gdx-pal-title {
    margin: 0; font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--x-subtle);
}
.gdx-pal-panel--values .gdx-pal-title { color: #7c3a6e; }
.gdx-pal-search {
    display: block; margin: 0 0.55rem 0.4rem; width: calc(100% - 1.1rem);
    font-size: 0.84rem; color: var(--x-subtle);
    background: var(--x-surface-2); border: 1px solid var(--x-line);
    border-radius: 8px; padding: 0.36rem 0.6rem;
}
.gdx-pal-body { flex: 1; overflow: hidden; padding: 0 0.35rem 0.55rem; }
.gdx-pal-group {
    margin: 0.55rem 0.35rem 0.2rem; font-size: 0.62rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.14em; color: var(--x-subtle);
}
.gdx-pal-item {
    display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left;
    padding: 0.3rem 0.4rem; border: 1px solid transparent; border-radius: 8px;
}
.gdx-pal-sym {
    width: 1.3rem; height: 1.3rem; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 0.72rem; font-weight: 800;
    background: rgba(194, 163, 90, 0.12); color: var(--x-gold-ink);
    border: 1px solid rgba(194, 163, 90, 0.28);
}
.gdx-pal-meta { display: flex; flex-direction: column; min-width: 0; }
.gdx-pal-name { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
/* One value in the Valores drawer: its NAME leads (a name is the address), its
   value today and its kind sit beneath, and a constant wears the filled mark
   its plaque wears. A row that admits neither answer is inert. */
.gdx-val-item .gdx-pal-sym { background: rgba(156, 79, 139, 0.12); color: #7c3a6e; border-color: rgba(156, 79, 139, 0.4); }
.gdx-val-item.is-fixed .gdx-pal-sym { background: rgba(156, 79, 139, 0.22); }
.gdx-val-line { display: flex; align-items: baseline; gap: 0.4rem; min-width: 0; }
.gdx-val-num {
    font-size: 0.78rem; color: var(--x-text); font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gdx-val-tag {
    flex: 0 0 auto; font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--x-subtle);
}
.gdx-val-item.is-fixed .gdx-val-tag { color: #7c3a6e; font-weight: 700; }
.gdx-val-item.is-off { opacity: 0.55; }

/* ---- the Obtener / Asignar menu (lb-varmenu family) ----
   The small card a value's row opens where the hand is. Plum-railed, like the
   plaque the value lives on; an answer it cannot take is greyed AND says why. */
.gdx-varmenu {
    position: relative; width: 21rem; max-width: 100%;
    background: var(--x-surface); color: var(--x-text);
    border: 1px solid var(--x-line-strong); border-radius: 12px;
    box-shadow: 0 18px 44px rgba(20, 24, 38, 0.18);
    padding: 0.5rem; display: flex; flex-direction: column; gap: 0.15rem;
    overflow: hidden;
}
.gdx-varmenu::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, #9C4F8B, transparent);
}
.gdx-varmenu-t {
    margin: 0.2rem 0.35rem 0.35rem; font-size: 0.72rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.09em; color: var(--x-muted);
}
.gdx-varmenu-item {
    display: flex; align-items: flex-start; gap: 0.55rem; width: 100%;
    padding: 0.5rem 0.55rem; border: 1px solid transparent; border-radius: 9px;
    text-align: left;
}
.gdx-varmenu-item.is-off { opacity: 0.55; }
.gdx-varmenu-sym {
    width: 1.5rem; height: 1.5rem; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; font-size: 0.8rem; font-weight: 800;
    background: rgba(156, 79, 139, 0.12); color: #7c3a6e; border: 1px solid rgba(156, 79, 139, 0.4);
}
.gdx-varmenu-item.is-off .gdx-varmenu-sym { background: #eef1f7; color: var(--x-subtle); border-color: var(--x-line-strong); }
.gdx-varmenu-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.gdx-varmenu-name { font-size: 0.88rem; font-weight: 700; color: var(--x-text); }
.gdx-varmenu-hint { font-size: 0.76rem; line-height: 1.35; color: var(--x-muted); }
.gdx-varmenu-pair { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ---- the workspace boundary (lb-mod--out) ---- */
.gdx-mod--out {
    width: auto; min-width: 15rem; max-width: 30rem;
    background: linear-gradient(180deg, #ffffff, #f6f6f6);
    border-color: var(--x-gold-soft);
}
.gdx-mod--out .gdx-mod-head::before { background: linear-gradient(90deg, var(--x-gold), var(--x-gold-soft), transparent); height: 3px; }
.gdx-mod--out .gdx-mod-kind { background: rgba(194, 163, 90, 0.16); color: var(--x-gold-ink); border-color: var(--x-gold-soft); }
.gdx-mod--out .gdx-mod-title { color: var(--x-gold-ink); }
.gdx-out-body { padding-top: 0.5rem; }
.gdx-out-legend { display: flex; flex-direction: column; gap: 0.3rem; }
.gdx-out-row { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.gdx-out-fnsel {
    width: auto; flex: 0 0 auto;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em;
    color: var(--x-gold-ink); padding: 0.24rem 1.15rem 0.24rem 0.3rem;
    background-position: right 0.3rem center, 0 0;
}
.gdx-out-namein { flex: 1 1 auto; min-width: 0; font-size: 0.78rem; padding: 0.3rem 0.45rem; }
.gdx-out-x { flex: 0 0 auto; width: 1.3rem; text-align: center; color: var(--x-subtle); font-size: 0.75rem; }
.gdx-out-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.15rem; }

/* ---- app screen chrome for sheet/totals/modal mocks ---- */
.gdx-crumbs { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.gdx-crumb { color: var(--x-muted); font-size: 0.86rem; font-weight: 600; padding: 0.28rem 0.55rem; border-radius: 8px; }
.gdx-crumb.is-here { color: var(--x-text); }
.gdx-crumb-sep { color: var(--x-subtle); }
.gdx-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
/* the sheet search — twin of .lb-search (logbooks.css) */
.gdx-search { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; margin: 0.55rem 0 0.35rem; }
.gdx-search .gdx-select { width: auto; flex: 0 0 auto; }
.gdx-search .gdx-input { flex: 1 1 10rem; max-width: 16rem; color: var(--x-subtle); }
.gdx-screen-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--x-text); }
.gdx-bar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gdx-tablewrap { background: var(--x-surface); border: 1px solid var(--x-line); border-radius: 16px; overflow-x: auto; }
.gdx-table { border-collapse: collapse; width: 100%; min-width: 32rem; }
.gdx-table th {
    text-align: left; white-space: nowrap;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--x-subtle); background: var(--x-surface-2);
    padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--x-line-strong);
}
.gdx-th--derived { color: var(--x-gold-ink); }
.gdx-table td {
    padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--x-line);
    color: var(--x-text); font-size: 0.92rem; white-space: nowrap;
}
.gdx-td--num { text-align: right; font-variant-numeric: tabular-nums; }
.gdx-td--actions { text-align: right; white-space: nowrap; }
.gdx-pager { display: flex; align-items: center; gap: 0.8rem; justify-content: center; padding: 0.6rem 0; color: var(--x-muted); font-size: 0.92rem; }
.gdx-totals { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.gdx-total-card {
    background: var(--x-surface-2);
    border: 1px solid var(--x-line); border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-5); text-align: center;
    display: flex; flex-direction: column; gap: 0.2rem;
}
.gdx-total-v { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--x-accent); font-variant-numeric: tabular-nums; }
.gdx-total-l { margin: 0; color: var(--x-muted); font-size: 0.82rem; }
.gdx-chart-card {
    background: var(--x-surface-2);
    border: 1px solid var(--x-line); border-radius: 16px;
    padding: 0.9rem 1rem 0.7rem; min-width: 0;
}
.gdx-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.gdx-chart-title { margin: 0; font-weight: 700; font-size: 0.92rem; color: var(--x-text); }
.gdx-chart-tabs { display: flex; gap: 0.25rem; }
.gdx-chart-tab {
    border: 1px solid var(--x-line-strong); background: var(--x-surface-2); color: var(--x-muted);
    border-radius: 999px; padding: 0.18rem 0.6rem; font-size: 0.72rem; font-weight: 700;
}
.gdx-chart-tab.is-on { background: linear-gradient(-145deg, #f4f4f4, #e0e0e0, #fcfcfc, #d8d8d8, #eeeeee); border-color: #cfcfcf; color: var(--x-accent); box-shadow: 0 1px 2px rgba(8, 12, 24, 0.06); }
.gdx-chart-body { margin-top: 0.55rem; }
.gdx-chart-scroll { overflow-x: auto; }
.gdx-ch-bar { fill: #4a6fd4; }
.gdx-ch-bar--neg { fill: #b3372f; }
.gdx-ch-vlabel { fill: var(--x-muted, #3f454f); font-size: 10.5px; font-weight: 700; }
.gdx-ch-xlabel { fill: var(--x-subtle, #545a63); font-size: 10px; }
.gdx-ch-zero { stroke: #d2d2d2; stroke-width: 1.5; }
.gdx-modal {
    width: 100%; max-width: 36rem; margin: 0 auto;
    background: var(--x-surface);
    border: 1px solid var(--x-line); border-radius: 16px;
    box-shadow: 0 14px 38px rgba(5, 8, 18, 0.20);
    padding: 1.2rem;
    display: flex; flex-direction: column; gap: 0.8rem;
    text-align: left;
}
.gdx-modal-title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--x-text); }
.gdx-modal-text { margin: 0; color: var(--x-muted); line-height: 1.55; font-size: 0.92rem; }
.gdx-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.gdx-form-fields { display: flex; flex-direction: column; gap: 0.8rem; }
.gdx-form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.gdx-label { display: block; color: var(--x-muted); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; }
.gdx-field-input {
    display: block; width: 100%; font-size: 0.92rem; color: var(--x-text);
    background: var(--x-surface); border: 1px solid var(--x-line-strong);
    border-radius: 10px; padding: 0.5rem 0.65rem; min-height: 1.4rem;
}
.gdx-field-input.is-ph { color: var(--x-subtle); font-style: italic; }
.gdx-field-input--area { min-height: 3.2rem; }
.gdx-field-select {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233C486B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #ffffff, #f6f6f6);
    background-repeat: no-repeat, no-repeat;
    background-size: 10px 6px, 100% 100%;
    background-position: right 0.7rem center, 0 0;
    padding-right: 1.9rem;
}
.gdx-note { margin: 0; color: var(--x-muted); font-size: 0.82rem; line-height: 1.5; }
.gdx-plan { display: flex; flex-direction: column; gap: 0.3rem; }
.gdx-plan-row { margin: 0; display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.92rem; }
.gdx-plan-k { color: var(--x-muted); }
.gdx-plan-v { color: var(--x-text); font-weight: 600; }
.gdx-dock-card-list { display: flex; flex-direction: column; gap: 0.5rem; }
.gdx-dock-card-row { display: flex; flex-direction: column; gap: 0.25rem; }
.gdx-dock-card-pick { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--x-text); font-size: 0.92rem; font-weight: 600; }
.gdx-dock-card-diff { display: flex; gap: 0.45rem; padding-left: 1.65rem; font-size: 0.82rem; color: var(--x-muted); flex-wrap: wrap; }
.gdx-dock-card-field { font-weight: 700; color: var(--x-subtle); }
.gdx-dock-card-count { margin: 0; color: var(--x-muted); font-size: 0.82rem; }


/* ── the finished-format display (owner 2026-08-28) — transcribed from
      logbooks.css: the instrument form, the typed sheet, the observatory ── */
.gdx-modal--inst { padding: 0; overflow: hidden; border: none; }
.gdx-mhead { background: linear-gradient(180deg, #212636, #171b26); padding: 0.55rem 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.gdx-mhead-eyebrow { margin: 0; color: var(--x-gold, #c2a35a); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; }
.gdx-mhead-title { margin: 2px 0 0; color: #f2f3f7; font-size: 1.02rem; font-weight: 700; }
.gdx-mbody { padding: 0.8rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.gdx-fw { position: relative; background: #fff; border: 1px solid #e4e4e4; border-left-width: 3px; border-radius: 8px; padding: 0.4rem 0.6rem 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.gdx-fw--money { border-left-color: #d9bc72; }
.gdx-fw--num   { border-left-color: #2e9e6b; }
.gdx-fw--int   { border-left-color: #2F8080; }
.gdx-fw--text  { border-left-color: #9C4F8B; }
.gdx-fw--date  { border-left-color: #B0714A; }
.gdx-fw--bool  { border-left-color: var(--x-accent, #3C486B); }
.gdx-fw-type { position: absolute; top: 0.4rem; right: 0.6rem; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #545a63; }
.gdx-fw--money .gdx-fw-type { color: #b8953f; }
.gdx-fw--num .gdx-fw-type   { color: #2e9e6b; }
.gdx-fw--int .gdx-fw-type   { color: #2F8080; }
.gdx-fw--text .gdx-fw-type  { color: #9C4F8B; }
.gdx-fw--date .gdx-fw-type  { color: #B0714A; }
.gdx-fw--bool .gdx-fw-type  { color: var(--x-accent, #3C486B); }
.gdx-fw-moneywrap { position: relative; }
.gdx-fw-moneywrap .gdx-field-input { display: block; padding-right: 3.2rem; }
.gdx-fw-unit { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; color: #545a63; background: #f7f7f7; border: 1px solid #e4e4e4; border-radius: 4px; padding: 2px 6px; }
.gdx-fw-checkrow { display: flex; align-items: center; gap: 0.5rem; padding: 2px 0; }
.gdx-fw-checkword { color: #545a63; font-size: 0.8rem; }
.gdx-fw-checkword.is-on { color: #7a5e17; font-weight: 600; }
.gdx-fw--sealed { background: #f7f7f7; border: 1px solid #e4e4e4; border-left: 3px solid #c2a35a; border-radius: 8px; padding: 0.4rem 0.6rem 0.6rem; display: flex; flex-direction: column; gap: 0.2rem; }
.gdx-fw--sealed .gdx-label { color: #7a5e17; }
.gdx-fw-sealed-v { margin: 0; font-size: 0.95rem; font-weight: 700; color: #232731; font-variant-numeric: tabular-nums; }
.gdx-fw-sealed-note { margin: 0; color: #7a5e17; font-size: 0.68rem; font-style: italic; }
.gdx-tick { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.gdx-tick--money { background: #d9bc72; box-shadow: inset 0 0 0 1px #ab8a3c; }
.gdx-tick--num   { background: #2e9e6b; }
.gdx-tick--int   { background: #2F8080; }
.gdx-tick--text  { background: #9C4F8B; }
.gdx-tick--date  { background: #B0714A; }
.gdx-tick--bool  { background: var(--x-accent, #3C486B); }
.gdx-dia { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; border: 2px solid var(--x-accent, #3C486B); background: #fff; vertical-align: -1px; }
.gdx-dia--on { background: linear-gradient(135deg, #d9bc72, #ab8a3c); border-color: #7a5e17; }
.gdx-descend-chain { display: inline-block; width: 14px; height: 2.5px; background: #8a8a8a; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.gdx-total-card.is-pick { border-color: #c2a35a; background: #f7f7f7; }
.gdx-total-mark { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.gdx-total-hint { margin: 2px 0 0; color: #545a63; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.gdx-total-card.is-pick .gdx-total-hint { color: #3f454f; }
.gdx-ch-bar--money { fill: #d9bc72; stroke: #ab8a3c; stroke-width: 1; }
.gdx-ch-bar--money.gdx-ch-bar--neg { fill: #d9bc72; fill-opacity: 0.4; stroke-width: 1.5; }

/* ---- the portada: THE BOARD (lb-band + lb-list families, 2026-08-31) ----
   Transcribed from the "The portada: THE BOARD" section of logbooks.css. The
   board replaced the 3D plate scene, so nothing here has depth: the descent is
   said in ONE hairline — the spine — with the layer numbers sitting on it.
   Static exhibit, so the hover and focus states of the real rows are not
   transcribed; the resting row is. */
.gdx-band {
    background: var(--x-surface-2);
    border: 1px solid var(--x-line); border-radius: var(--r-lg);
    padding: var(--s-4) var(--s-5) var(--s-5);
}
.gdx-band-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--s-3); flex-wrap: wrap;
    padding-bottom: var(--s-3); border-bottom: 1px solid var(--x-gold-soft);
}
.gdx-band-tag {
    margin: 0; color: var(--x-gold-ink);
    font-size: var(--x-fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
/* the column count is the number of figures actually shown (the app sets --n) */
.gdx-figs { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin-top: var(--s-4); }
.gdx-fig { padding: 0 var(--s-4); border-left: 1px solid var(--x-line); min-width: 0; }
.gdx-fig:first-child { padding-left: 0; border-left: none; }
.gdx-fig-v {
    margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.15;
    color: var(--x-accent); font-variant-numeric: tabular-nums;
}
/* the format's FIRST total, in its own field order, takes the numeral size */
.gdx-fig--lead .gdx-fig-v { font-size: var(--x-fs-num); }
.gdx-fig-l {
    margin: 3px 0 0; color: var(--x-subtle);
    font-size: var(--x-fs-xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
}
.gdx-band-foot {
    margin: var(--s-4) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--x-line);
    color: var(--x-subtle); font-size: var(--x-fs-xs); font-weight: 700; letter-spacing: 0.06em;
}

.gdx-lab-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3);
}
.gdx-lab {
    margin: 0; color: var(--x-subtle);
    font-size: var(--x-fs-xs); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.gdx-lab-when { margin: 0; color: var(--x-subtle); font-size: var(--x-fs-sm); }
.gdx-list {
    position: relative; background: var(--x-surface);
    border: 1px solid var(--x-line); border-radius: var(--r-lg);
    overflow: hidden;
}
/* THE SPINE belongs to the ROWS, not to the panel: rows are not a fixed height,
   so any constant inset misses the first or the last number the moment a
   summary line wraps. Each row draws its own segment at the number's x, and the
   two ends stop at 50% — the chip's own centre. */
.gdx-lrow::before {
    content: ""; position: absolute; z-index: 0;
    left: calc(var(--s-5) + 0.8rem); top: 0; bottom: 0;
    width: 1px; background: var(--x-line-strong);
}
.gdx-lrow:first-child::before { top: 50%; }
.gdx-lrow:last-child::before { bottom: 50%; }
/* quiet on a format with nothing in it */
.gdx-list--dry .gdx-lrow::before { background: var(--x-line); }
.gdx-lrow {
    position: relative; z-index: 1; width: 100%; box-sizing: border-box;
    display: flex; align-items: center; gap: var(--s-4);
    padding: var(--s-4) var(--s-5); text-align: left;
    font: inherit; color: inherit; background: none;
    border: none; border-bottom: 1px solid var(--x-line);
}
.gdx-lrow:last-child { border-bottom: none; }
/* positioned, so the chip paints OVER the spine: an opaque fill alone does not,
   because a positioned pseudo-element outranks ordinary inline content */
.gdx-lnum {
    position: relative;
    flex: 0 0 auto; width: 1.6rem; height: 1.6rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; background: var(--x-surface-2);
    border: 1px solid var(--x-line-strong); box-sizing: border-box;
    color: var(--x-accent); font-size: var(--x-fs-sm); font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.gdx-lnum--dry { color: var(--x-subtle); }
.gdx-what { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gdx-nameline { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.gdx-lname { font-size: var(--x-fs-lg); font-weight: 700; color: var(--x-text); }
.gdx-lname--dry { color: var(--x-muted); }
.gdx-lsum { color: var(--x-subtle); font-size: var(--x-fs-sm); }
.gdx-lcount { flex: 0 0 auto; text-align: right; }
.gdx-lcount-v {
    display: block; font-size: var(--x-fs-lg); font-weight: 700; line-height: 1.15;
    color: var(--x-text); font-variant-numeric: tabular-nums;
}
.gdx-lcount-l {
    display: block; margin-top: 1px; color: var(--x-subtle);
    font-size: var(--x-fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.gdx-lcount--dry .gdx-lcount-v { color: var(--x-subtle); }
.gdx-lgo { flex: 0 0 auto; color: var(--x-accent); font-size: 1.15rem; line-height: 1; }
/* the «principal» mark (lb-badge) */
.gdx-badge {
    display: inline-flex; align-items: center; white-space: nowrap;
    padding: 0.16rem 0.55rem; border-radius: 999px;
    background: var(--x-surface-2); border: 1px solid var(--x-line);
    color: var(--x-muted); font-size: var(--x-fs-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
}
/* the overflow button, at rest — the popover it opens is a gesture, and static
   exhibits show resting states only */
.gdx-ovf-btn { padding-left: 0.7rem; padding-right: 0.7rem; letter-spacing: 0.06em; }
.gdx-ovf { position: relative; display: inline-flex; }
.gdx-ovf-btn { padding-left: 0.7rem; padding-right: 0.7rem; letter-spacing: 0.06em; }
.gdx-ovf { position: relative; display: inline-flex; }
/* the popover, open — the same recipe as the background picker's, which is
   what logbooks.css reuses verbatim. No entrance animation: a static exhibit
   shows the state, never the gesture that reached it. */
.gdx-ovf-pop {
    position: absolute; right: 0; top: calc(100% + var(--s-2)); z-index: 20;
    min-width: 13rem;
    background: var(--x-surface); border: 1px solid var(--x-line-strong);
    border-radius: var(--r-lg); padding: 0.5rem;
    box-shadow: var(--x-sh-md);
}
.gdx-ovf-item {
    display: block; width: 100%; text-align: left;
    padding: 0.5rem 0.6rem; border: none; border-radius: var(--r-sm);
    font-weight: 600; color: var(--x-danger-ink);
}
/* the two breakpoints, or the exhibit lies on a phone */
@media (max-width: 52rem) {
    .gdx-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-4); }
    .gdx-fig:nth-child(odd) { padding-left: 0; border-left: none; }
}
@media (max-width: 40rem) {
    .gdx-figs { grid-template-columns: 1fr; }
    .gdx-fig { padding-left: 0; padding-right: 0; border-left: none; }
    .gdx-lrow { padding: var(--s-3) var(--s-4); gap: var(--s-3); }
    .gdx-lrow::before { left: calc(var(--s-4) + 0.8rem); }
    .gdx-band { padding: var(--s-4); }
}
