:root {
      color-scheme: dark;
      --bg: #090c0d;
      --surface: #0f1415;
      --surface-2: #141b1c;
      --surface-3: #192223;
      --line: rgba(220, 239, 235, .10);
      --line-strong: rgba(220, 239, 235, .18);
      --text: #edf6f3;
      --muted: #92a6a1;
      --faint: #60716d;
      --mint: #8dd7c5;
      --mint-2: #b6ece0;
      --cyan: #84bfd0;
      --violet: #aaa3d9;
      --sand: #d8bf91;
      --load: 0;
      --shadow: 0 24px 80px rgba(0, 0, 0, .38);
      --radius: 24px;
    }

    * { box-sizing: border-box; }
    [hidden] { display: none !important; }

    html, body { min-height: 100%; }

    body {
      margin: 0;
      overflow-x: hidden;
      background:
        radial-gradient(circle at 50% -20%, rgba(141, 215, 197, .10), transparent 38%),
        linear-gradient(180deg, #0a0e0f 0%, var(--bg) 100%);
      color: var(--text);
      font-family: "IBM Plex Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
      letter-spacing: -.015em;
    }

    button, input { font: inherit; }
    button { color: inherit; }

    .app-shell {
      min-height: 100vh;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      display: grid;
      grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
      align-items: center;
      gap: 20px;
      min-height: 76px;
      padding: 14px 24px;
      border-bottom: 1px solid var(--line);
      background: rgba(9, 12, 13, .82);
      backdrop-filter: blur(18px);
    }

    .brand { display: flex; align-items: center; gap: 13px; }
    .brand-mark {
      width: 38px; height: 38px; border-radius: 12px;
      display: grid; place-items: center;
      border: 1px solid var(--line-strong);
      background: linear-gradient(145deg, rgba(141, 215, 197, .13), rgba(141, 215, 197, .03));
      box-shadow: inset 0 0 22px rgba(141, 215, 197, .06);
    }
    .brand-mark svg { width: 23px; }
    .brand strong { display: block; font-size: 14px; font-weight: 680; }
    .brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

    .day-state {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255,255,255,.025);
    }
    .day-state button {
      border: 0;
      border-radius: 10px;
      padding: 9px 14px;
      color: var(--muted);
      background: transparent;
      cursor: pointer;
      transition: .2s ease;
    }
    .day-state button.active {
      color: var(--text);
      background: var(--surface-3);
      box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
    }

    .top-actions { display: flex; justify-content: flex-end; gap: 10px; }
    .ghost-button, .icon-button {
      border: 1px solid var(--line);
      background: rgba(255,255,255,.025);
      border-radius: 12px;
      cursor: pointer;
      transition: .18s ease;
    }
    .ghost-button { padding: 10px 13px; color: var(--muted); }
    .icon-button { width: 42px; height: 42px; display: grid; place-items: center; }
    .ghost-button:hover, .icon-button:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }

    main { padding: 22px; }

    .runtime-stage {
      position: relative;
      isolation: isolate;
      min-height: calc(100vh - 122px);
      max-width: 1560px;
      margin: 0 auto;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 30px;
      background:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
        radial-gradient(circle at 50% 47%, rgba(141, 215, 197, .055), transparent 28%),
        #0c1011;
      background-size: 44px 44px, 44px 44px, auto, auto;
      box-shadow: var(--shadow);
    }

    .runtime-stage::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 16%, transparent 84%, rgba(0,0,0,.25));
      z-index: 4;
    }

    .flow-map {
      position: absolute;
      inset: 0;
      z-index: 0;
      width: 100%; height: 100%;
      opacity: .76;
      pointer-events: none;
    }
    .flow-path {
      fill: none;
      stroke: rgba(141, 215, 197, .18);
      stroke-width: 1.2;
      stroke-dasharray: 3 9;
      animation: stream 9s linear infinite;
    }
    .flow-path.secondary { stroke: rgba(132, 191, 208, .14); animation-duration: 12s; }
    .flow-node { fill: #101617; stroke: rgba(141, 215, 197, .25); stroke-width: 1; }
    @keyframes stream { to { stroke-dashoffset: -120; } }

    .runtime-grid {
      position: relative;
      z-index: 2;
      min-height: calc(100vh - 124px);
      display: grid;
      grid-template-columns: minmax(260px, .95fr) minmax(430px, 1.6fr) minmax(260px, .95fr);
      grid-template-rows: minmax(280px, 1fr) minmax(230px, .72fr);
      gap: 18px;
      padding: 18px;
    }

    .zone {
      position: relative;
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: linear-gradient(145deg, rgba(18, 24, 25, .90), rgba(11, 15, 16, .78));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
      backdrop-filter: blur(8px);
    }

    .signals-zone { grid-column: 1; grid-row: 1 / span 2; }
    .processor-zone { grid-column: 2; grid-row: 1; }
    .memory-zone { grid-column: 3; grid-row: 1 / span 2; }
    .load-zone { grid-column: 2; grid-row: 2; }

    .zone-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 19px 20px 0;
    }
    .eyebrow {
      margin: 0 0 5px;
      color: var(--faint);
      font-size: 10px;
      font-weight: 760;
      letter-spacing: .16em;
      text-transform: uppercase;
    }
    h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
    .zone-description { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; max-width: 30ch; }
    .zone-counter { color: var(--faint); font-size: 11px; padding-top: 3px; white-space: nowrap; }

    .add-button {
      width: 30px; height: 30px;
      display: grid; place-items: center;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: rgba(255,255,255,.025);
      color: var(--muted);
      cursor: pointer;
    }
    .add-button:hover { color: var(--text); border-color: var(--line-strong); }

    /* Signals */
    .signal-field {
      position: relative;
      height: calc(100% - 93px);
      min-height: 470px;
      margin: 12px;
      border-radius: 18px;
      overflow: hidden;
      background:
        radial-gradient(circle at 50% 45%, rgba(141, 215, 197, .04), transparent 42%),
        rgba(6, 9, 10, .28);
    }
    .signal-field::after {
      content: "INTENSITY";
      position: absolute;
      left: 12px; bottom: 12px;
      color: rgba(255,255,255,.16);
      font-size: 9px; letter-spacing: .18em;
      writing-mode: vertical-rl;
      transform: rotate(180deg);
    }
    .signal-axis {
      position: absolute;
      inset: 18px 18px 30px 38px;
      display: grid;
      grid-template-rows: repeat(5, 1fr);
      pointer-events: none;
    }
    .signal-axis i { border-top: 1px dashed rgba(255,255,255,.045); }
    .signal-axis span { position: absolute; left: -25px; top: -6px; color: rgba(255,255,255,.20); font-size: 9px; }
    .signal-axis i:nth-child(2) span { top: calc(25% - 6px); }
    .signal-axis i:nth-child(3) span { top: calc(50% - 6px); }
    .signal-axis i:nth-child(4) span { top: calc(75% - 6px); }
    .signal-axis i:nth-child(5) span { top: calc(100% - 6px); }

    .signal-orb {
      --intensity: 5;
      --x: 50%;
      position: absolute;
      left: var(--x);
      bottom: calc(38px + (var(--intensity) - 1) * 9%);
      width: calc(62px + var(--intensity) * 2px);
      aspect-ratio: 1;
      transform: translate(-50%, 50%);
      display: grid;
      place-items: center;
      border: 1px solid rgba(141, 215, 197, calc(.12 + var(--intensity) * .025));
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,.11), transparent 30%),
        radial-gradient(circle, rgba(141,215,197, calc(.04 + var(--intensity) * .012)), rgba(19,28,28,.92) 70%);
      box-shadow: 0 0 calc(var(--intensity) * 4px) rgba(141,215,197, calc(var(--intensity) * .012));
      cursor: ns-resize;
      user-select: none;
      touch-action: none;
      transition: box-shadow .2s ease, border-color .2s ease;
    }
    .signal-orb:hover, .signal-orb.dragging { border-color: rgba(182,236,224,.48); box-shadow: 0 0 34px rgba(141,215,197,.18); }
    .signal-orb strong { max-width: 75%; text-align: center; font-size: 11px; line-height: 1.1; font-weight: 600; }
    .signal-orb em {
      position: absolute; right: -2px; top: -2px;
      width: 23px; height: 23px; display: grid; place-items: center;
      border-radius: 50%;
      background: var(--mint-2); color: #0c1514;
      font-style: normal; font-size: 10px; font-weight: 800;
      box-shadow: 0 3px 10px rgba(0,0,0,.25);
    }
    .signal-hint {
      position: absolute; inset: auto 20px 16px 40px;
      display: flex; justify-content: space-between; color: var(--faint); font-size: 10px;
      pointer-events: none;
    }

    /* Processor */
    .processor-content {
      display: grid;
      grid-template-columns: minmax(250px, .9fr) minmax(230px, 1.1fr);
      align-items: center;
      gap: 24px;
      padding: 13px 22px 24px;
      height: calc(100% - 78px);
      min-height: 210px;
    }
    .cpu-visual {
      position: relative;
      width: min(31vh, 250px);
      min-width: 205px;
      aspect-ratio: 1;
      margin: auto;
      display: grid;
      place-items: center;
    }
    .cpu-ring, .cpu-ring::before, .cpu-ring::after {
      position: absolute; inset: 0; border-radius: 50%; content: "";
    }
    .cpu-ring {
      border: 1px solid rgba(141,215,197,.18);
      background: conic-gradient(from 220deg, rgba(141,215,197,.34) calc(var(--load) * 1%), rgba(141,215,197,.035) 0);
      mask: radial-gradient(circle, transparent 64%, #000 65%);
      filter: drop-shadow(0 0 14px rgba(141,215,197,.06));
      transform: rotate(-20deg);
    }
    .cpu-ring::before { inset: 14px; border: 1px dashed rgba(255,255,255,.075); }
    .cpu-ring::after { inset: 28px; border: 1px solid rgba(132,191,208,.11); }
    .cpu-chip {
      position: relative;
      z-index: 2;
      width: 56%; aspect-ratio: 1;
      display: grid; place-items: center;
      border: 1px solid var(--line-strong);
      border-radius: 30%;
      background:
        linear-gradient(90deg, transparent 48%, rgba(255,255,255,.035) 49%, rgba(255,255,255,.035) 51%, transparent 52%),
        linear-gradient(transparent 48%, rgba(255,255,255,.035) 49%, rgba(255,255,255,.035) 51%, transparent 52%),
        radial-gradient(circle at 50% 40%, rgba(141,215,197,.10), transparent 54%),
        #101718;
      box-shadow: inset 0 0 32px rgba(141,215,197,.035), 0 20px 35px rgba(0,0,0,.22);
    }
    .cpu-chip::before {
      content: ""; position: absolute; inset: -10px;
      border: 1px dotted rgba(255,255,255,.12); border-radius: 32%;
    }
    .cpu-chip strong { display: block; font-size: 28px; font-weight: 640; text-align: center; }
    .cpu-chip span { color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }

    .cores {
      position: absolute; inset: 0;
      pointer-events: none;
    }
    .core-dot {
      --angle: 0deg;
      --value: 30;
      position: absolute;
      left: 50%; top: 50%;
      width: 28px; height: 28px;
      transform: rotate(var(--angle)) translateY(-110px) rotate(calc(var(--angle) * -1));
      margin: -14px;
      display: grid; place-items: center;
      border-radius: 50%;
      border: 1px solid rgba(141,215,197,.18);
      background: color-mix(in srgb, var(--mint) calc(var(--value) * .35%), #111819);
      color: rgba(237,246,243,.82);
      font-size: 9px;
      box-shadow: 0 0 calc(var(--value) * .2px) rgba(141,215,197,.10);
    }

    .process-stack { display: grid; gap: 10px; align-content: center; }
    .process-row {
      padding: 12px 13px 11px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255,255,255,.022);
    }
    .process-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 9px; }
    .process-title { font-size: 12px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .process-cores { color: var(--muted); font-size: 10px; white-space: nowrap; }
    .process-track {
      position: relative;
      height: 9px; border-radius: 999px; overflow: visible;
      background: rgba(255,255,255,.055);
    }
    .process-fill {
      height: 100%; width: var(--value, 50%);
      border-radius: inherit;
      background: linear-gradient(90deg, rgba(141,215,197,.38), rgba(141,215,197,.84));
      box-shadow: 0 0 12px rgba(141,215,197,.12);
    }
    .process-row:nth-child(2) .process-fill { background: linear-gradient(90deg, rgba(132,191,208,.32), rgba(132,191,208,.82)); }
    .process-row:nth-child(3) .process-fill { background: linear-gradient(90deg, rgba(170,163,217,.28), rgba(170,163,217,.74)); }
    .process-slider {
      position: absolute; inset: -7px 0; width: 100%; opacity: 0; cursor: ew-resize;
    }
    .process-empty {
      border: 1px dashed var(--line-strong); border-radius: 16px;
      min-height: 118px; display: grid; place-items: center; text-align: center; padding: 20px;
      color: var(--muted); font-size: 12px; line-height: 1.45;
    }

    /* Memory */
    .memory-space {
      position: relative;
      height: calc(100% - 84px);
      min-height: 480px;
      margin: 12px;
      overflow: hidden;
      border-radius: 18px;
      background: radial-gradient(circle at 50% 42%, rgba(170,163,217,.055), transparent 46%), rgba(6,9,10,.20);
    }
    .memory-orbit {
      position: absolute; left: 50%; top: 43%; transform: translate(-50%, -50%);
      width: min(90%, 330px); aspect-ratio: 1; border-radius: 50%;
      border: 1px solid rgba(170,163,217,.10);
    }
    .memory-orbit::before, .memory-orbit::after {
      content: ""; position: absolute; border-radius: 50%; border: 1px dashed rgba(255,255,255,.055);
    }
    .memory-orbit::before { inset: 15%; }
    .memory-orbit::after { inset: 32%; }
    .memory-center {
      position: absolute; inset: 39%; display: grid; place-items: center; text-align: center;
      border-radius: 50%; border: 1px solid rgba(170,163,217,.16); background: #111617;
      color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
    }
    .memory-item {
      --weight: 5;
      --mx: 50%; --my: 50%;
      position: absolute; left: var(--mx); top: var(--my);
      width: calc(48px + var(--weight) * 7px); aspect-ratio: 1;
      transform: translate(-50%, -50%);
      display: grid; place-items: center;
      padding: 10px;
      text-align: center;
      border-radius: 50%;
      border: 1px solid rgba(170,163,217, calc(.12 + var(--weight) * .025));
      background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.09), transparent 27%), rgba(35,33,49,.78);
      box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 0 calc(var(--weight) * 4px) rgba(170,163,217,.07);
      cursor: grab;
      user-select: none;
      touch-action: none;
    }
    .memory-item:active { cursor: grabbing; }
    .memory-item strong { font-size: 10px; font-weight: 590; line-height: 1.12; }
    .memory-item em {
      position: absolute; right: 3px; bottom: 3px;
      width: 20px; height: 20px; display: grid; place-items: center;
      border-radius: 50%; background: var(--violet); color: #12121a;
      font-size: 9px; font-style: normal; font-weight: 800;
    }
    .memory-legend {
      position: absolute; left: 18px; right: 18px; bottom: 16px;
      display: flex; justify-content: space-between; gap: 10px;
      color: var(--faint); font-size: 10px;
    }

    /* Load engine */
    .load-content {
      height: calc(100% - 18px);
      display: grid;
      grid-template-columns: minmax(205px, .72fr) 1fr;
      gap: 22px;
      align-items: center;
      padding: 18px 23px;
    }
    .load-dial {
      position: relative;
      width: min(24vh, 205px); min-width: 172px; aspect-ratio: 1;
      margin: auto; display: grid; place-items: center;
    }
    .load-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
    .dial-bg { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 8; }
    .dial-value {
      fill: none; stroke: var(--mint); stroke-width: 8; stroke-linecap: round;
      stroke-dasharray: 326.73;
      stroke-dashoffset: calc(326.73 - (326.73 * var(--load) / 100));
      filter: drop-shadow(0 0 7px rgba(141,215,197,.25));
      transition: stroke-dashoffset .65s cubic-bezier(.2,.7,.2,1);
    }
    .dial-center { text-align: center; position: relative; z-index: 2; }
    .dial-center strong { display: block; font-size: clamp(39px, 4vw, 58px); line-height: .9; font-weight: 610; letter-spacing: -.055em; }
    .dial-center span { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

    .load-summary { min-width: 0; }
    .status-line { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
    .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(141,215,197,.35); }
    .status-line strong { font-size: 15px; font-weight: 650; }
    .status-copy { color: var(--muted); font-size: 12px; line-height: 1.45; max-width: 54ch; margin-bottom: 14px; }
    .projection {
      display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
      margin-bottom: 14px;
    }
    .projection-card {
      border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; background: rgba(255,255,255,.02);
    }
    .projection-card span { display: block; color: var(--faint); font-size: 9px; letter-spacing: .10em; text-transform: uppercase; }
    .projection-card strong { display: block; margin-top: 4px; font-size: 19px; font-weight: 630; }
    .contribution-bar { display: flex; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.04); }
    .contribution-bar i { height: 100%; display: block; }
    .contribution-bar .sig { width: 0%; background: var(--mint); opacity: .72; }
    .contribution-bar .proc { width: 0%; background: var(--cyan); opacity: .72; }
    .contribution-bar .mem { width: 0%; background: var(--violet); opacity: .72; }
    .contribution-labels { display: flex; gap: 12px; margin-top: 8px; color: var(--faint); font-size: 9px; flex-wrap: wrap; }
    .contribution-labels b { color: var(--muted); font-weight: 600; }

    .blank-overlay {
      position: absolute; inset: 0; z-index: 10;
      display: none; place-items: center;
      padding: 24px;
      background: rgba(9, 13, 14, .52);
      backdrop-filter: blur(5px);
    }
    .runtime-stage.blank .blank-overlay { display: grid; }
    .runtime-stage.blank .zone { opacity: .46; filter: saturate(.55); }
    .runtime-stage.blank .load-zone { opacity: .82; }
    .runtime-stage.blank .blank-overlay { opacity: 1; filter: none; }
    .blank-card {
      width: min(490px, 100%);
      padding: 30px;
      text-align: center;
      border: 1px solid var(--line-strong);
      border-radius: 25px;
      background: rgba(14, 20, 21, .92);
      box-shadow: 0 24px 80px rgba(0,0,0,.42);
    }
    .blank-glyph {
      width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center;
      border-radius: 22px; border: 1px solid rgba(141,215,197,.18);
      background: radial-gradient(circle, rgba(141,215,197,.10), transparent 68%);
    }
    .blank-card h1 { margin: 0 0 9px; font-size: 25px; letter-spacing: -.035em; }
    .blank-card p { margin: 0 auto 21px; max-width: 45ch; color: var(--muted); font-size: 13px; line-height: 1.55; }
    .blank-actions { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
    .primary-button {
      border: 1px solid rgba(141,215,197,.25); border-radius: 12px;
      padding: 11px 15px; background: var(--mint-2); color: #0b1513; font-weight: 700; cursor: pointer;
    }
    .secondary-button {
      border: 1px solid var(--line); border-radius: 12px;
      padding: 11px 15px; background: rgba(255,255,255,.025); color: var(--muted); cursor: pointer;
    }

    /* Inspector */
    .inspector {
      position: fixed; z-index: 40; top: 0; right: 0; bottom: 0;
      width: min(430px, 100vw);
      transform: translateX(102%);
      transition: transform .28s cubic-bezier(.2,.75,.2,1);
      border-left: 1px solid var(--line-strong);
      background: rgba(11,15,16,.96);
      backdrop-filter: blur(24px);
      box-shadow: -20px 0 60px rgba(0,0,0,.35);
      overflow: auto;
    }
    .inspector.open { transform: translateX(0); }
    .inspector-head {
      position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
      padding: 20px 20px 16px; border-bottom: 1px solid var(--line); background: rgba(11,15,16,.92); z-index: 2;
    }
    .inspector-head h3 { margin: 0; font-size: 16px; }
    .inspector-body { padding: 20px; display: grid; gap: 18px; }
    .inspect-section { border: 1px solid var(--line); border-radius: 16px; padding: 15px; background: rgba(255,255,255,.018); }
    .inspect-section h4 { margin: 0 0 10px; font-size: 12px; }
    .formula {
      font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.65;
      color: var(--mint-2); background: rgba(0,0,0,.22); border-radius: 10px; padding: 11px;
    }
    .formula small { color: var(--faint); }
    .inspect-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 11px; }
    .inspect-grid span { color: var(--muted); }
    .inspect-grid b { font-weight: 620; }
    pre { margin: 0; white-space: pre-wrap; color: #b6c8c4; font-size: 10px; line-height: 1.55; }

    .toast {
      position: fixed; left: 50%; bottom: 22px; z-index: 60;
      transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
      padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
      background: #12191a; color: var(--muted); font-size: 12px;
      transition: .22s ease;
      box-shadow: 0 12px 35px rgba(0,0,0,.35);
    }
    .toast.show { transform: translate(-50%, 0); opacity: 1; }

    @media (max-width: 1100px) {
      .runtime-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
      }
      .signals-zone { grid-column: 1; grid-row: 1; }
      .memory-zone { grid-column: 2; grid-row: 1; }
      .processor-zone { grid-column: 1 / span 2; grid-row: 2; }
      .load-zone { grid-column: 1 / span 2; grid-row: 3; }
      .signal-field, .memory-space { min-height: 430px; }
      .processor-content { min-height: 260px; }
      .core-dot { transform: rotate(var(--angle)) translateY(-102px) rotate(calc(var(--angle) * -1)); }
    }

    @media (max-width: 720px) {
      .topbar { grid-template-columns: 1fr auto; padding: 12px 14px; }
      .day-state { order: 3; grid-column: 1 / span 2; justify-self: stretch; }
      .day-state button { flex: 1; }
      .ghost-button { display: none; }
      main { padding: 10px; }
      .runtime-stage { border-radius: 22px; }
      .runtime-grid { display: flex; flex-direction: column; padding: 10px; }
      .signals-zone, .memory-zone, .processor-zone, .load-zone { min-height: auto; }
      .processor-content, .load-content { grid-template-columns: 1fr; }
      .processor-content { padding-top: 20px; }
      .signal-field, .memory-space { min-height: 420px; }
      .cpu-visual { width: 230px; }
      .load-dial { width: 185px; }
      .blank-card { padding: 24px 18px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
    }


    /* Rest controls (MVP) */
    .rest-controls {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
      margin-top: 12px;
    }
    .rest-controls .ghost-button, .rest-controls .primary-button {
      padding: 8px 12px; font-size: 12px;
    }
    .rest-outcome {
      display: grid; gap: 8px; margin-top: 10px;
      padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px;
      background: rgba(255,255,255,.02);
    }
    .rest-outcome .outcome-row { display: flex; flex-wrap: wrap; gap: 8px; }
    .rest-outcome label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
    .rest-copy { margin: 0 0 4px; color: var(--faint); font-size: 11px; }

    /* Sessions dialog */
    .sessions-dialog {
      border: 1px solid var(--line-strong); border-radius: 18px;
      padding: 0; background: #0f1415; color: var(--text);
      width: min(420px, 92vw);
      box-shadow: var(--shadow);
    }
    .sessions-dialog::backdrop { background: rgba(0,0,0,.55); }
    .sessions-sheet { display: grid; gap: 12px; padding: 18px; }
    .sessions-sheet header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .sessions-sheet h2 { margin: 0; font-size: 16px; }
    .sessions-sheet ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
    .sessions-sheet li {
      padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
      background: rgba(255,255,255,.02);
    }
    .tiny { font-size: 11px; }
    .muted { color: var(--muted); }

    /* Recent / still relevant / inline add */
    .recent-row, .still-relevant {
      margin: 0 12px 8px; padding: 8px 10px;
      border: 1px dashed var(--line); border-radius: 12px;
      background: rgba(255,255,255,.015);
    }
    .recent-row { display: grid; gap: 6px; }
    .recent-label, .still-relevant strong { color: var(--faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
    .chip-row, .still-relevant .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
    .chip-row button, .still-relevant button {
      border: 1px solid var(--line); border-radius: 999px;
      padding: 5px 10px; background: rgba(255,255,255,.03);
      color: var(--muted); font-size: 11px; cursor: pointer;
    }
    .chip-row button:hover, .still-relevant button:hover { color: var(--text); border-color: var(--line-strong); }

    .inline-add {
      display: none; gap: 8px; align-items: center;
      margin: 0 12px 8px; padding: 8px;
      border: 1px solid var(--line); border-radius: 12px;
      background: rgba(0,0,0,.18);
    }
    .inline-add.open { display: flex; }
    .inline-add input {
      flex: 1; min-width: 0;
      border: 1px solid var(--line); border-radius: 10px;
      padding: 8px 10px; background: rgba(255,255,255,.03); color: var(--text);
    }
    .inline-add input:focus { outline: 1px solid rgba(141,215,197,.35); }

    .process-row { position: relative; }
    .process-row .remove-proc {
      position: absolute; top: 8px; right: 8px;
      width: 22px; height: 22px; border: 0; border-radius: 8px;
      background: transparent; color: var(--faint); cursor: pointer; font-size: 14px;
    }
    .process-row .remove-proc:hover { color: var(--text); background: rgba(255,255,255,.05); }
    .process-meta { padding-right: 24px; }

    .memory-item .remove-mem {
      position: absolute; left: 3px; top: 3px;
      width: 18px; height: 18px; border: 0; border-radius: 50%;
      background: rgba(0,0,0,.35); color: #edf6f3; font-size: 11px; cursor: pointer;
      opacity: 0; transition: opacity .15s ease;
    }
    .memory-item:hover .remove-mem { opacity: 1; }

    .signal-orb .remove-sig {
      position: absolute; left: -2px; top: -2px;
      width: 20px; height: 20px; border: 0; border-radius: 50%;
      background: rgba(0,0,0,.4); color: #edf6f3; font-size: 11px; cursor: pointer;
      opacity: 0;
    }
    .signal-orb:hover .remove-sig { opacity: 1; }

    .bg-subhead {
      margin: 0 20px 0; color: var(--faint); font-size: 9px;
      letter-spacing: .14em; text-transform: uppercase;
    }

    .cold-start {
      color: var(--faint); font-size: 11px; margin-top: 4px;
    }

    button:disabled { opacity: .45; cursor: not-allowed; }

    .status-dot.is-building { background: var(--sand); box-shadow: 0 0 12px rgba(216,191,145,.35); }
    .status-dot.is-approaching, .status-dot.is-recommended { background: var(--sand); }
    .status-dot.is-elevated { background: #e0a070; }
    .status-dot.is-resting { background: var(--cyan); box-shadow: 0 0 12px rgba(132,191,208,.35); }

    .contribution-bar .sig { background: var(--mint); opacity: .72; }
    .contribution-bar .proc { background: var(--cyan); opacity: .72; }
    .contribution-bar .mem { background: var(--violet); opacity: .72; }

    #signal-orbs, #memory-items {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }
    #signal-orbs > *, #memory-items > * { pointer-events: auto; }

