/* ════════════════════════════════════════════════════════════════════════
   limbic web · the stylesheet
   psychos' shared web interface system. extracted from psychos.com on
   2026-08-03, which is the only place this system was ever built.

   the file holds three cascade layers:

     limbic.tokens      the numbers and the colours. every page gets them.
     limbic.motion      the curve, the measurement state, the tone carrier,
                        the light and dark crossfade. every page gets them.
     limbic.components  the limb, the island, the controls. a page opts in
                        by carrying the class "limbic" on its html element.

   a page that does not opt in receives the tokens and the motion only, and
   its own component styles stay untouched. every rule here is layered, so a
   page rule always wins over a library rule of any specificity.
   ════════════════════════════════════════════════════════════════════════ */

@layer limbic.tokens, limbic.motion, limbic.components;

/* the identity tokens are declared as colours, so they interpolate (loka
   reported the pop on an identity swap, 2026-08-07). a plain custom property
   changes in one step, so a swap moved every border and rule at once while
   the ground behind them faded, and only the text carried a transition. a
   registered colour fades, every property reading it follows, and the drawn
   frame reads the same mid-fade value the css page does. */
@property --ink {
  syntax: "<color>"; inherits: true; initial-value: #d9d9d9;
}
@property --ink-dim {
  syntax: "<color>"; inherits: true; initial-value: #6a6a6a;
}
@property --rule {
  syntax: "<color>"; inherits: true; initial-value: #1a1a1a;
}
@property --isl-line {
  syntax: "<color>"; inherits: true; initial-value: #242424;
}

/* ── tokens ─────────────────────────────────────────────────────────── */
@layer limbic.tokens {
  :root {
    --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 104px;
    --smooth: 1;
    /* one control height for the whole page. the navbar sets it, and every button,
       island, field and trigger measures itself against it, so the header reads as one row. */
    --ctl-h: 32px;
    /* the minimum gap between two limbs. the cart trigger and the world trigger set it,
       and no limb may close on a neighbour any tighter than this at any width. */
    --ctl-gap: 10px;
    /* one row height and one gutter for every line inside a limb, so a limb of
       settings and a limb of countries read as the same object (loka, 2026-08-05). */
    --row-h: 38px;
    --gut: 16px;
    /* the dwell before a tooltip appears. mental's own value. */
    --tip-dwell: 1s;
    /* ── the unit system ──────────────────────────────────────────────
       one scale for every measurement, mental's own ui.scale token. a
       measurement is written as its point value times this scale, never as a
       bare pixel, so the whole interface grows and shrinks as one. browser
       zoom multiplies it further, exactly as it multiplies every css length.

       THE TOKEN TRUTH IS THE VAULT, NOT THE CODE (found 2026-08-06, after a
       web build read the swift defaults and drew every control wrong): mental
       reads its live values from tokens.json in its own vault, and the
       embedded swift table is only the fallback under it. the values below
       are loka's live ones. */
    --ui-scale: 1;
    --pt: calc(1px * var(--ui-scale));
    /* the control geometry · tokens.json metrics */
    --knob: calc(14 * var(--pt));       /* size.knob */
    --light: calc(6 * var(--pt));       /* size.light */
    --track: calc(4 * var(--pt));       /* size.track */
    --track-h: calc(var(--track) * 1.5);/* the slider trough, mental's own 1.5x */
    /* the parameter row, mental's node metrics: the band is one eighth of a
       node block (176 / 8 = 22), and the control draws two points inset
       inside it, so the drawn bar stands 18 tall. */
    --param-band: calc(22 * var(--pt));
    --param-inset: calc(2 * var(--pt));
    --ctl-inset: calc(2 * var(--pt));   /* space.xs / 2, the toggle's own inset */
    --tgl-h: calc(var(--knob) + 2 * var(--ctl-inset));
    --tgl-w: calc(var(--tgl-h) * 1.9);
    /* the control colours · mental's live tokens.json, read 2026-08-10 and
       encoded for css. the colour store (limbic.tokens.js) is the source and
       overwrites these at boot; the hexes here are the fallback under it.
       the earlier hexes encoded the compiled swift defaults, which is why
       the controls never matched: loka dials mental live, and grey.24 for
       the lit trough is nearly the trough itself on his dial. */
    --ctl-trough: #242427;        /* control.trough · grey.09 · linear 0.0174 */
    --ctl-trough-lit: #29292a;    /* control.trough.lit · grey.24 · linear 0.0225 */
    --ctl-trough-empty: #050505;  /* the activation's empty side · lit x 0.0625, the shader's own law */
    --ctl-trough-border: #29292b; /* control.trough.border · border.trough · linear 0.0223 */
    --ctl-thumb: #4e4e4e;         /* control.thumb · grey.40 · linear 0.0764 */
    --ctl-thumb-border: #78787a;  /* control.thumb.border · border.thumb · linear 0.188 */
    --glow-inner: #f9f9f9;        /* glow.inner · linear 0.95 */
    --dot-off: #272727;           /* exposure.dot.off · linear 0.02 */
    /* a limb's body is glass, not paint. it holds one neutral tint at every position
       on the page, so whatever is behind it passes through and its own boundaries
       carry across the panel. the tint weight is live on the dev slider. */
    --limb-tint: 0.14;
    /* the blur every limb's backdrop takes. it was written into each rule as a
       number until 2026-08-04, when the renderer had to run the same blur and
       a number written twice became a number that could disagree with itself. */
    --limb-blur: 14px;
    --glass: rgba(0,0,0,var(--limb-tint));
    --paper: #000; --tone: dark;
    --ink: #d9d9d9; --ink-dim: #6a6a6a; --rule: #1a1a1a;
    /* the open island's border: one step past the rule, stated per theme so
       an opening never flips the line to the other theme's value */
    --isl-line: #242424;
    /* the node light's statuses, mental's node.light tokens read at the
       source: off and resting are one near-dark (linear 0.08), and activity
       lifts to the active value (linear 0.886), both encoded for css */
    --node-light-off: #505050;
    --node-light-active: #f2f2f2;
    /* the script reads these, so a duration is written once */
    /* the page swap's own duration, and the one follow: a limb's ink and the
       ground under it travel on this same number, written by the follow dial
       (loka merged the two 2026-08-09). */
    --fade-view: 400ms; --fade-tone: 500ms;
    /* a real ease in over the first stretch, and a long soft landing. the old
       handles (0.12, 0, 0.21, 1) started at nearly full speed, and loka read
       the collapse as abrupt and linear on 2026-08-05. the dev limb carries
       two live dials for the handles, and this default is the baked feel. */
    --scurve: cubic-bezier(0.38, 0, 0.16, 1);
    /* how fast a trailing neighbour closes the gap the layout opened under it.
       one time constant: the gap decays by 1/e every 150ms of smoothness. */
    --trail: 150ms;
  }

  /* light and dark are one token set read twice. a page switches by putting
     "light" on its html element, and limbic.themeFade carries the change. */
  :root.light {
    --glass: rgba(255,255,255,var(--limb-tint));
    --paper: #f2f1ee; --tone: light;
    --ink: #23221f; --ink-dim: #6a6862; --rule: #dcdad5;
    --isl-line: #cfccc5;
  }
}

/* ── motion ─────────────────────────────────────────────────────────── */
@layer limbic.motion {
  /* a limb's tone is not transitioned by css. a css transition restarts when a new
     target arrives, which loses the motion already underway and changes cadence.
     the tone tokens are driven per frame instead, so a new target course corrects. */
  .limbaware { position: relative; }

  /* measurement state for limbic.expand: layout settles instantly so the final rect is readable */
  .nomotion, .nomotion * { transition: none !important; }

  /* light and dark fade rather than switch, and the fade is per colour rather
     than per page: every colour token travels from the value it holds to the
     value the other state gives it, on one clock and one curve. the script
     carries it, so there is no rule here. */
}

/* ── components ─────────────────────────────────────────────────────── */
@layer limbic.components {

  /* ── the header row ── */
  .limbic header {
    position: fixed; top: 0; left: 0; right: 0;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: flex-start;
    /* the growing limb pushes the nav pill aside, and the gap holds them apart the
       whole way. without it the cart body meets the pill's border at contact. */
    column-gap: var(--ctl-gap);
    padding: 24px 4vw; z-index: 10;
  }
  .limbic body.bare header { display: none; }
  .limbic .devdock { position: fixed; right: 4vw; bottom: 24px; z-index: 20; display: flex; justify-content: flex-end; }
  .limbic .navpill {
    grid-column: 2; display: flex; align-items: center; gap: 42px;
    height: var(--ctl-h);
    border: 1px solid var(--rule); border-radius: 999px; padding: 0 34px;
    background-color: var(--glass); backdrop-filter: blur(var(--limb-blur)); -webkit-backdrop-filter: blur(var(--limb-blur));
  }
  .limbic .home {
    color: var(--ink); text-decoration: none;
    font-family: "manifold-extd-cf", "Helvetica Neue", sans-serif; font-weight: 400;
    font-size: 13px; letter-spacing: 0.14em; margin-right: 6px;
    line-height: 1;
    text-box-trim: trim-both; text-box-edge: cap alphabetic;
  }
  .limbic .navpill a.link { line-height: 1; text-box-trim: trim-both; text-box-edge: cap alphabetic; }
  .limbic .navpill a.link { color: var(--ink-dim); text-decoration: none; font-size: 12px; letter-spacing: 0.12em; }
  .limbic .navpill a.link:hover, .limbic .navpill a.link.on { color: var(--ink); }
  .limbic .auth { grid-column: 3; display: flex; justify-content: flex-end; align-items: flex-start; gap: var(--ctl-gap); }
  .limbic .auth #authlink { line-height: var(--ctl-h); margin-left: 8px; }
  .limbic .auth a { color: var(--ink-dim); text-decoration: none; font-size: 12px; letter-spacing: 0.12em; }
  .limbic .auth a:hover { color: var(--ink); }

  /* ── the island limbs ── */
  .limbic .island {
    background-color: var(--glass); border: 1px solid var(--rule); border-radius: calc(var(--ctl-h) / 2);
    backdrop-filter: blur(var(--limb-blur)); -webkit-backdrop-filter: blur(var(--limb-blur));
    overflow: hidden;
    /* the closed width hugs the trigger on every island, stated by the
       instance as a token; the open width is the second token. an island
       with neither stays at the resting width in both states. */
    max-width: var(--iw-closed, var(--iw, 340px));
    transition: max-width calc(0.5s * var(--smooth)) var(--scurve),
                opacity calc(0.5s * var(--smooth)) var(--scurve);
  }
  /* closed widths hug the trigger; nothing else props an island open */
  .limbic .island.dev, .limbic .island.world { max-width: var(--ctl-h); }

  .limbic .island.dev { display: flex; flex-direction: column-reverse; }
  .limbic .island.cart { max-width: 64px; }
  /* open width matches content exactly, so the s-curve completes instead of clipping */
  .limbic .island.cart { --iw: 266px; }

  .limbic .island.world { --iw: 226px; }
  .limbic .island.dev { --iw: 222px; }
  .limbic .island.on { max-width: var(--iw, 340px); border-color: var(--isl-line); }
  .limbic .ihead {
    background: none; border: none; font: inherit; cursor: pointer;
    height: calc(var(--ctl-h) - 2px); min-width: calc(var(--ctl-h) - 2px); padding: 0 10px; width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    color: var(--ink-dim); font-size: 12px; white-space: nowrap;
  }
  .limbic .ihead:hover { color: var(--ink); }
  .limbic .island.on .ihead { color: var(--ink); }
  .limbic .ibody {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .island.on .ibody { grid-template-rows: 1fr; }
  .limbic .ibodyin {
    overflow: hidden; min-height: 0; opacity: 0;
    transition: opacity calc(0.5s * var(--smooth)) var(--scurve),
                padding calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .island.on .ibodyin { opacity: 1; }
  .limbic .island.dev .ihead, .limbic .island.world .ihead { width: calc(var(--ctl-h) - 2px); min-width: calc(var(--ctl-h) - 2px); padding: 0; }
  /* the anchor law: a trigger holds its natural corner; the body grows away from it.
     right-side islands pin their trigger to the top right. */
  .limbic .island.world .ihead, .limbic .island.dev .ihead { margin-left: auto; }
  .limbic .island.cart .ihead { justify-content: flex-end; padding: 0 12px; }
  .limbic .island.cart { max-width: 0; opacity: 0; pointer-events: none; }
  .limbic .island.cart.show { max-width: 64px; opacity: 1; pointer-events: auto; }
  .limbic .island.cart.show.on { max-width: var(--iw); }
  .limbic .island.cart .ibodyin { width: 264px; padding: 0; }
  .limbic .island.world .ibodyin { width: 224px; }
  .limbic .island.dev .ibodyin { width: 220px; }
  .limbic .island.dev.on .ibody { border-bottom: 1px solid var(--isl-line, var(--rule)); }
  /* ── the row, the one line every limb is built from ─────────────────────
     loka ruled it 2026-08-05, after a settings limb grew parts nobody else
     had. one height, one gutter, one hairline, a name at the left and a value
     at the right. the world limb is where this shape came from, so it reads
     exactly as it did. every other limb now uses the same line. */
  .limbic .row, .limbic .worlditem {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; width: 100%; height: var(--row-h); padding: 0 var(--gut);
    background: none; border: none; font: inherit; text-align: left;
    font-size: 12px; letter-spacing: 0.08em; color: var(--ink-dim);
    /* the stroke role: a rule inside a limb is the same line as the limb's
       own rim (loka ruled it 2026-08-07) */
    border-top: 1px solid var(--isl-line, var(--rule));
  }
  .limbic .row:first-child, .limbic .worlditem:first-child { border-top: none; }
  /* a hidden row is gone. the row's own display would otherwise beat the
     hidden attribute, and the empty line held its height under the renderer
     section until 2026-08-05. */
  .limbic .row[hidden] { display: none; }
  /* a row that answers the hand says so by lighting up */
  .limbic .worlditem, .limbic .row.pick { cursor: pointer; }
  .limbic .worlditem:hover, .limbic .row.pick:hover { color: var(--ink); }
  .limbic .worlditem.on, .limbic .row.pick.on { color: var(--ink); }
  .limbic .worlditem .cur, .limbic .row .val { color: var(--ink-dim); opacity: 0.7; }

  /* the section: a row whose value is a hairline reaching the right edge and
     a chevron that turns. what it holds folds away under it. */
  .limbic .row.sec { cursor: pointer; gap: 12px; }
  .limbic .row.sec:hover { color: var(--ink); }
  .limbic .row.sec .rule { flex: 1; height: 1px; background: var(--isl-line, var(--rule)); }
  .limbic .row.sec .chev {
    flex: none; transition: transform calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .row.sec.on .chev { transform: rotate(180deg); }
  /* a section expands on the island's own clock and curve: every limb inside
     a limb moves by one motion system (loka ruled it 2026-08-06). */
  .limbic .secbody {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .secbody > div { overflow: hidden; min-height: 0; }
  .limbic .row.sec.on + .secbody { grid-template-rows: 1fr; }

  /* a row that carries a slider rather than a value. the slider pairs with
     the name row above it as one unit, so the air between them closes
     (loka caught the loose rhythm 2026-08-05). */
  .limbic .row.slide { height: 22px; margin-top: -9px; border-top: none; }
  .limbic .row.slide input[type="range"] { width: 100%; }

  /* the foot: the limb's own trigger with its actions beside it, one row at
     the bottom edge (loka ruled it 2026-08-05). the leftmost action holds the
     left corner, the trigger holds the right corner, and the rest space
     themselves between. closed, only the trigger is there. */
  .limbic .ifoot {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: var(--ctl-h);
  }
  /* inside the foot the trigger gives up its anchor margin, or that margin
     absorbs the free space and the actions bunch at the left corner. the
     selector carries the island class so it outweighs the anchor law above. */
  .limbic .island .ifoot .ihead { width: auto; flex: none; margin-left: 0; }
  .limbic .rowbtn {
    position: relative; flex: none; width: 0; height: var(--ctl-h);
    display: grid; place-items: center; cursor: pointer; overflow: hidden;
    background: none; border: none; color: var(--ink-dim); padding: 0;
    opacity: 0; pointer-events: none;
    transition: width calc(0.5s * var(--smooth)) var(--scurve),
                opacity calc(0.4s * var(--smooth)) var(--scurve),
                color calc(0.24s * var(--smooth)) var(--scurve);
  }
  .limbic .island.on .rowbtn {
    width: calc(var(--ctl-h) - 2px); opacity: 1; pointer-events: auto;
  }
  .limbic .rowbtn:hover { color: var(--ink); }
  .limbic .rowbtn.on { color: var(--ink); }
  .limbic .rowbtn.armed { color: #d99; }

  /* the tooltip: a name for a control that carries only a mark. it waits out
     the dwell before it appears, which is mental's own one second (loka ruled
     that duration 2026-06-29, after half a second read as too quick). it goes
     the moment the hand leaves, so a hand crossing a row of controls never
     drags a trail of names behind it. */
  .limbic [data-tip] { position: relative; }
  .limbic [data-tip]::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    white-space: nowrap; font-size: 11px; letter-spacing: 0.08em;
    color: var(--ink-dim); background: var(--paper); padding: 5px 9px;
    border: 1px solid var(--rule); border-radius: calc(var(--ctl-h) / 2);
    pointer-events: none; z-index: 5; opacity: 0;
    transition: opacity calc(0.18s * var(--smooth)) var(--scurve);
    transition-delay: 0s;
  }
  .limbic [data-tip]:hover::after {
    opacity: 1;
    transition-delay: var(--tip-dwell);
  }
  /* the first and the last control keep their name inside the limb */
  .limbic .ifoot > [data-tip]:first-child::after { left: 0; transform: none; }
  .limbic .ifoot > [data-tip]:last-child::after { left: auto; right: 0; transform: none; }

  /* sliders and toggles are mental's own controls, structure and values from
     limbic/Components/Controls.swift (loka sent the audit back 2026-08-06):
     a recessed trough, a CONSTANT-brightness knob slug, and a separate inner
     light whose exposure alone carries the state. the library writes --val
     from 0 to 1 onto every slider, and the trough split and the light read it. */
  .limbic input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%;
    --val: 0.5;
    height: var(--track-h); border-radius: calc(var(--track-h) / 2); outline: none;
    /* mental's own trough (Controls.swift Slider.make, ported 2026-08-10):
       the trough holds the lit colour, the filled left keeps it, and the
       empty side falls to a sixteenth of it, the shader's activation law.
       the boundary tracks the knob's CENTRE, not the raw value, exactly as
       mental computes its fill fraction. */
    background:
      linear-gradient(to right,
        var(--ctl-trough-lit) 0 calc(var(--val) * (100% - var(--knob)) + var(--knob) / 2),
        var(--ctl-trough-empty) calc(var(--val) * (100% - var(--knob)) + var(--knob) / 2));
  }
  .limbic input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: var(--knob); height: var(--knob); border-radius: 50%; cursor: pointer;
    /* the border draws inside the knob's own diameter, as mental's quad
       border does, so the knob stands at size.knob exactly */
    box-sizing: border-box;
    border: 1px solid var(--ctl-thumb-border);
    /* the thumb holds one constant brightness and the light alone carries the
       value (loka ruled it 2026-08-09). nothing paints a halo: the glow comes
       from the light's own brightness and from diffusion, and css has no
       diffusion, so in css there is no glow at all. the mix runs in linear
       light, mental's own ramp from the resting exposure to the glow's peak. */
    background:
      radial-gradient(circle,
        color-mix(in srgb-linear, var(--glow-inner) calc(var(--val) * 100%), var(--dot-off))
          0 calc(var(--light) / 2),
        var(--ctl-thumb) calc(var(--light) / 2));
  }

  /* ── the parameter row, mental's node parameter ported (loka ruled it
     2026-08-09) ──
     one band per row, and the control draws inset inside its band, so the air
     is a property of the control and never spacing that drifts the rhythm.
     the row is one bar rather than a track and a knob: the bar spans the row
     and the value fills it, and the name and the number stand on the bar. */
  .limbic .param {
    position: relative; height: var(--param-band);
    padding: var(--param-inset) 0;
    margin: 0 var(--s3);
  }
  .limbic .param input[type="range"] {
    -webkit-appearance: none; appearance: none;
    position: absolute; left: 0; right: 0;
    top: var(--param-inset); bottom: var(--param-inset);
    width: 100%; height: auto; margin: 0;
    border-radius: 6px; outline: none; cursor: ew-resize;
    border: 1px solid var(--ctl-trough-border);
    /* the lit fraction keeps the trough's colour and the rest falls to a
       sixteenth of it, the drawn backend's own activation law. the empty
       side is the derived sixteenth, never the bare trough, so the css bar
       and the drawn bar hold one law (aligned 2026-08-10). */
    background:
      linear-gradient(to right,
        var(--ctl-trough-lit) 0 calc(var(--val) * 100%),
        var(--ctl-trough-empty) calc(var(--val) * 100%));
  }
  /* a parameter row carries no knob at all: the fill is the reading, exactly
     as mental's node parameter draws it */
  .limbic .param input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 0; height: 0; background: none; border: 0; box-shadow: none;
  }
  /* the name and the number stand on the bar. they sit in an ordinary row
     rather than in absolutely placed boxes, because the text walk reads a
     plain row and left every absolute label out of the drawn frame
     (measured 2026-08-09). */
  .limbic .param .plabels {
    position: relative; height: 100%;
    padding: 0 10px; border-top: none; pointer-events: none;
    font-size: 11px; letter-spacing: 0.01em;
  }
  /* the name takes mental's text.dim rung. limbic web's own dim ink is
     mental's text.faint, which vanishes on a lit bar (measured 2026-08-09). */
  .limbic .param .pname { color: var(--text-dim, #9e9ea2); }
  .limbic .param .pval { color: var(--ink); }

  /* mental's toggle (Controls.swift Toggle, ported one to one 2026-08-10):
     no border on the track and none on the knob, truly circular caps, the
     track easing from the trough to its lit colour with the slide, the knob
     a constant-brightness slug, and the inner light alone carrying the
     state. on loka's live dial the lit trough stands a breath above the
     trough, so the track reads nearly constant, exactly as mental does. */
  .limbic .tgl {
    width: var(--tgl-w); height: var(--tgl-h); border-radius: calc(var(--tgl-h) / 2);
    background: var(--ctl-trough); border: none;
    position: relative; cursor: pointer; padding: 0; flex: none;
    transition: background calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .tgl .dot {
    position: absolute; top: 50%; left: var(--ctl-inset); transform: translateY(-50%);
    width: var(--knob); height: var(--knob); border-radius: 50%;
    background: var(--ctl-thumb);
    transition: left calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .tgl .dot .lit {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: var(--light); height: var(--light); border-radius: 50%;
    background: var(--dot-off); display: block;
    /* the light rides the slide's own clock and curve: in mental one eased
       position drives the knob, the track and the light together */
    transition: background calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .tgl.on { background: var(--ctl-trough-lit); }
  .limbic .tgl.on .dot { left: calc(100% - var(--knob) - var(--ctl-inset)); }
  .limbic .tgl.on .dot .lit { background: var(--glow-inner); }

  /* ── the rows inside a limb ── */
  .limbic .dline {
    display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
    padding: 15px 16px; border-top: 1px solid rgba(128,128,128,0.14);
  }
  .limbic .dline:first-child { border-top: none; }
  .limbic .dline { font-size: 14px; }
  .limbic .dline .lm { font-size: 10.5px; color: var(--ink-dim); letter-spacing: 0.08em; margin-top: 7px; display: flex; align-items: center; gap: 10px; }
  .limbic .dline .lp { font-size: 12px; color: var(--ink); text-align: right; }
  .limbic .dline .lx { background: none; border: none; color: var(--ink-dim); font: inherit; font-size: 13px; cursor: pointer; padding: 0; margin-top: 4px; float: right; opacity: 0.7; }
  .limbic .dline .lx:hover { opacity: 1; }
  .limbic .qty { display: inline-flex; align-items: center; gap: 8px; }
  .limbic .qty button {
    background: none; border: 1px solid var(--rule, #1e1e1e); border-radius: 6px;
    color: var(--ink-dim, #777); font: inherit; font-size: 11px; width: 18px; height: 18px;
    cursor: pointer; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  }
  .limbic .qty button:hover { color: var(--ink, #fff); border-color: var(--ink-dim, #3a3a3a); }
  .limbic .qty button:disabled { opacity: 0.35; cursor: default; }
  .limbic .qty .qn { font-size: 11px; color: var(--ink-dim, #8a8a8a); min-width: 10px; text-align: center; }
  .limbic .dtotal { display: flex; justify-content: space-between; padding: 14px 16px 4px; font-size: 12.5px; color: var(--ink); border-top: 1px solid var(--rule); }
  .limbic .dbtns { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 14px; margin-top: 14px; }
  .limbic .dbtns .pill { padding: 0 24px; font-size: 12px; }

  /* ── the page swap ── */
  .limbic .view { display: none; opacity: 0; transition: opacity var(--fade-view) ease; }
  .limbic .view.on { display: block; }
  .limbic .view.in { opacity: 1; }
  /* panels cross-fade on the global smoothness, like every other swap */
  .limbic .tabpanel { display: none; opacity: 0; transition: opacity calc(0.3s * var(--smooth)) ease; }
  .limbic .tabpanel.on { display: block; }
  .limbic .tabpanel.in { opacity: 1; }

  /* ── the button ── */
  /* a button is the navbar's height, everywhere. only the horizontal padding varies. */
  .limbic .pill {
    display: inline-block; height: var(--ctl-h); line-height: calc(var(--ctl-h) - 2px);
    white-space: nowrap; text-align: center;
    font-size: 12.5px; letter-spacing: 0.06em; text-decoration: none;
    border-radius: 999px; padding: 0 26px; cursor: pointer;
    background: transparent; font-family: inherit;
  }
  .limbic .pill.ghost { color: #9a9a9a; border: 1px solid #202020; }
  .limbic .pill.ghost:hover { color: #eee; border-color: #383838; }
  .limbic .pill.fill { color: #cfcfcf; background: #111; border: 1px solid #111; }
  .limbic .pill.fill:hover { color: #fff; background: #1a1a1a; }
  .limbic .pill.held, .limbic .act.held { color: #4a4a4a; }
  .limbic .pill.held:hover { color: #8a8a8a; background: #111; }
  /* the plain text button */
  .limbic .act {
    font-size: 12px; letter-spacing: 0.06em; color: var(--ink-dim, #8a8a8a);
    background: none; border: none; padding: 0; cursor: pointer;
    text-decoration: none; font-family: inherit; white-space: nowrap;
  }
  .limbic .act:hover { color: var(--ink, #fff); }
  /* the active text action holds the ink, the worlditem's own on state */
  .limbic .act.on { color: var(--ink, #fff); }
  .limbic .act.danger { color: #9a6a6a; }
  .limbic .act.danger:hover { color: #d99; }

  /* ── the node light ──
     mental's own status light on a render module: the render family
     signature, dot for dot from the source (LightSignature: a core, an
     inner ring, a faint outer ring). the light is the module's switch, and
     it ties the design language between limbic web and mental's nodes
     (loka ruled it 2026-08-06). */
  .limbic .nodelight {
    background: none; border: none; padding: 0; cursor: pointer;
    display: flex; align-items: center; flex: none;
  }
  .limbic .nodelight svg { display: block; }
  .limbic .nodelight circle {
    fill: var(--node-light-off);
    transition: fill calc(0.3s * var(--smooth)) ease;
  }
  /* the light is emissive when a signal passes: it takes the one light
     source every control emits (loka tied it to the glow inner,
     2026-08-06), lifted on the open axis so the bloom carries it through
     diffusion */
  .limbic .nodelight.active circle { fill: var(--glow-inner); }
  .limbic .nodelight.active { --emit: 6; }
  /* the halo stands in for the diffusion bloom while the css backend
     paints; with the renderer live, the emit lift carries the bloom itself.
     the gate is the pipeline's own live class rather than the frame class,
     because the reader drops the frame class during every read and a halo
     filter seen then would refuse the light. */
  html:not(.rlive) .limbic .nodelight.active svg {
    filter: drop-shadow(0 0 2px rgba(250, 250, 250, 0.9))
            drop-shadow(0 0 7px rgba(250, 250, 250, 0.55));
  }

  /* ── the render chain's subsections ──
     a subsection stands inside its section: indented one step and one size
     finer, so the hierarchy reads at a glance (loka asked 2026-08-06) */
  .limbic .sub[hidden] { display: none; }
  .limbic .sub { padding-left: 14px; }
  .limbic .sub .row.sec { gap: 10px; font-size: 12px; }
  .limbic .sub.lifting { position: relative; z-index: 5; }
  .limbic .sub.lifting .row.sec { color: var(--ink); }

  /* ── the settings limb, library native (loka ruled it 2026-08-06) ──
     the panel holds a limited height and scrolls inside itself, the world
     limb's own pattern. the native scrollbar is drawn by the browser and
     the reader cannot see it, so it is off entirely and limbic web draws
     its own, standing over every row so no row can cover it in pieces. */
  .limbic .devpanel { max-height: 418px; overflow-y: auto; overscroll-behavior: contain; }
  .limbic .devpanel { scrollbar-width: none; }
  .limbic .devpanel::-webkit-scrollbar { width: 0; height: 0; }
  .limbic .limbscroll {
    position: absolute; right: 3px; width: 4px; border-radius: 2px;
    background: var(--ctl-thumb); opacity: 0; pointer-events: none;
    z-index: 3;
    transition: opacity calc(0.5s * var(--smooth)) var(--scurve);
  }
  .limbic .limbscroll.on { opacity: 0.7; }
  /* the foot holds the trigger alone, at its right corner */
  .limbic .devdock .ifoot { justify-content: flex-end; }
  /* a curve plot: the active curve drawn as a line inside a hairline frame,
     the shape mental's source view gives a curve */
  .limbic .devpanel .row.plot { height: 64px; border-top: none; }
  .limbic .devpanel .row.plot svg {
    width: 100%; height: 52px; display: block; color: var(--ink);
    border: 1px solid var(--rule); border-radius: 6px;
  }
  .limbic #rendernote { font-size: 10.5px; line-height: 1.4; text-align: right; }


  /* ── the colour picker (ported 2026-08-09) ──
     a modal limb over a scrim: the swatch carries the true colour and its
     own emission, and the value trough marks diffuse white at its middle. */
  .limbic.pickhost { position: fixed; inset: 0; z-index: 60; }
  .limbic .pickscrim { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
  .limbic .picklimb {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 320px; max-height: 82vh; overflow-y: auto;
    background-color: var(--glass); border: 1px solid var(--isl-line, var(--rule));
    border-radius: 16px; padding: 6px 0 10px;
    backdrop-filter: blur(var(--limb-blur)); -webkit-backdrop-filter: blur(var(--limb-blur));
  }
  .limbic .picklimb { scrollbar-width: none; }
  .limbic .picklimb::-webkit-scrollbar { width: 0; height: 0; }
  .limbic .pickhead {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px 12px; border-bottom: 1px solid var(--isl-line, var(--rule));
  }
  .limbic .pickswatch {
    width: 40px; height: 40px; border-radius: 8px; flex: none;
    border: 1px solid var(--rule); background: var(--ink);
  }
  .limbic .pickname { font-size: 13px; color: var(--ink); }
  /* the seam: diffuse white at the middle of the value trough */
  .limbic .row.slide.seam { position: relative; }
  .limbic .row.slide.seam::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 1px; height: 10px; margin-top: -5px;
    background: var(--ink-dim); pointer-events: none;
  }

  /* ── the stacked limb of fields ── */
  .limbic .card { display: flex; flex-direction: column; align-items: center; gap: 28px; }
  .limbic .card .title { font-size: clamp(24px, 3vw, 38px); font-weight: 100; letter-spacing: 0.1em; color: #ececec; }
  .limbic .limb {
    width: 320px; border: 1px solid #1e1e1e; border-radius: 16px;
    background: #070707; overflow: hidden; display: flex; flex-direction: column;
  }
  /* a field is the same height as a button, and the height comes from the token,
     never from vertical padding, so a font change cannot move it. */
  .limbic .limb input {
    background: transparent; border: none; color: #b5b5b5;
    font: inherit; font-size: 13px; letter-spacing: 0.04em;
    height: var(--ctl-h); padding: 0 18px; outline: none; caret-color: #777; width: 100%;
  }
  .limbic .limb input::placeholder { color: #3a3a3a; }
  .limbic .limb .seg {
    max-height: 0; opacity: 0;
    transition: max-height calc(0.55s * var(--smooth)) var(--scurve),
                opacity calc(0.55s * var(--smooth)) ease;
  }
  .limbic .limb .seg.open { max-height: 40px; opacity: 1; }
  .limbic .limb .div { height: 1px; background: #161616; }
  .limbic .prow { display: flex; align-items: center; }
  .limbic .cap {
    display: none; background: transparent; border: none; color: #555;
    font: inherit; font-size: 15px; padding: 0 18px; cursor: pointer; align-self: stretch;
  }
  .limbic .cap.ready { display: block; }
  .limbic .cap:hover { color: #eee; }
  .limbic .card .alt { font-size: 12px; color: #3a3a3a; }
  .limbic .card .alt a { color: #555; text-decoration: none; cursor: pointer; }
  .limbic .card .alt a:hover { color: #bbb; }
  .limbic .card .err { font-size: 12px; color: #5c3434; min-height: 1.2em; }

  /* ── the field groups ── */
  .limbic .cardfields { display: none; flex-direction: column; gap: 12px; width: 100%; max-width: 380px; padding: var(--s2) 0; }
  .limbic .cardfields.on { display: flex; }
  .limbic .cardfields input, .limbic .addrfields input {
    background: #070707; border: 1px solid #1c1c1c; border-radius: 12px;
    color: #b5b5b5; font: inherit; font-size: 13px; letter-spacing: 0.08em;
    height: var(--ctl-h); padding: 0 16px; outline: none; caret-color: #777; width: 100%;
  }
  .limbic .cardfields input::placeholder, .limbic .addrfields input::placeholder { color: #333; }
  .limbic .cardfields .split { display: flex; gap: 12px; }
  .limbic .cardfields .split input { width: 50%; }
  .limbic .addrfields { display: none; flex-direction: column; gap: 12px; width: 100%; max-width: 380px; padding: var(--s2) 0; }
  .limbic .addrfields.on { display: flex; }

  /* ── the small stated pieces ── */
  .limbic .chip {
    display: inline-flex; align-items: center; gap: 12px;
    border: 1px solid #1c1c1c; border-radius: 10px; padding: 10px 14px;
    font-size: 12px; letter-spacing: 0.14em; color: #9a9a9a; background: #070707;
  }
  .limbic .chip .brand { width: 22px; height: 14px; border-radius: 3px; background: #181818; }
  .limbic .empty { font-size: 12.5px; color: #333; padding: var(--s3) 0; }
  .limbic .empty a { color: #6a6a6a; text-decoration: none; }
  .limbic .empty a:hover { color: #ddd; }

  /* ── breakpoints ──
     the thresholds match limbic.bp, which states the same two numbers to the
     script and writes the current one onto the html element as data-bp. */
  @media (max-width: 900px) {
    .limbic .navpill { gap: 26px; padding: 0 24px; }
  }
  @media (max-width: 600px) {
    .limbic header { padding: 14px 3vw; }
    .limbic .navpill { gap: 16px; padding: 0 18px; }
    .limbic .navpill a.link { font-size: 11px; letter-spacing: 0.08em; }
    .limbic .home { font-size: 11.5px; letter-spacing: 0.1em; }
    .limbic .auth { gap: var(--ctl-gap); }
    .limbic .island.on { max-width: min(var(--iw, 340px), calc(100vw - 20px)); }
    .limbic .island.cart .ibodyin { width: min(264px, calc(100vw - 52px)); }
  }
}

/* ── the pipeline's suppression, outside every layer on purpose ──────────
   these rules are runtime machinery, not look: when the renderer owns the
   frame, an element whose surface it took must stop painting whatever the
   page's own rules say, so the suppression has to win over unlayered page
   css. the pipeline adds and removes the classes; nothing else uses them. */
.limbicframe { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: none; }
html.rpaint .limbicframe { display: block; }
html.rpaint .rsf {
  background-color: transparent; background-image: none; border-color: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* a taken slider hands its whole self over: the track, the thumb and the
   thumb's ring */
html.rpaint .rsf::-webkit-slider-thumb {
  background: transparent; border-color: transparent; box-shadow: none;
}
html.rpaint .rtx { -webkit-text-fill-color: transparent; }
/* an icon the renderer drew hands its own paint over */
html.rpaint .rsf svg, html.rpaint svg.rsf { visibility: hidden; }
/* INTERIM, until the web sutra's editing half: a field's text, caret and
   selection are the browser's own, so a field stands above the frame */
html.rpaint input:not([type="range"]), html.rpaint textarea,
html.rpaint [contenteditable] {
  position: relative; z-index: 101;
}
