:root {
  --ink: #171916;
  --paper: #f1f0eb;
  --paper-strong: #faf9f5;
  --line: #c9ccc4;
  --line-dark: #30342f;
  --muted: #626861;
  --dark: #121512;
  --dark-soft: #1a1e1a;
  --signal: #b8d956;
  --signal-deep: #637d18;
  --action: #3559e8;
  --alert: #da6249;
  --shadow: 0 24px 60px rgba(24, 28, 22, .12);
  font-family: "Aptos", "Noto Sans SC", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 26px 18px 20px; color: #e8ece4; background: var(--dark); border-right: 1px solid var(--line-dark); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #566246; color: var(--signal); font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; font-weight: 700; }
.brand-lockup h1 { margin: 2px 0 0; font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 22px; font-weight: 600; }
.eyebrow, .section-kicker, .note-kicker { margin: 0; color: #929a91; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; font-weight: 600; text-transform: uppercase; }
.sidebar-status { display: flex; align-items: center; gap: 9px; padding: 11px 0; border-top: 1px solid #2c302c; border-bottom: 1px solid #2c302c; color: #a9b0a8; font-size: 10px; }
.status-dot, .live-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgba(184, 217, 86, .12); }
.nav-stack { display: grid; gap: 3px; }
.nav-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 11px 9px; border: 1px solid transparent; color: #9da49d; background: transparent; text-align: left; font-size: 11px; }
.nav-anchor { text-decoration: none; }
.nav-item:hover { color: #eef1eb; border-color: #2f342f; background: #181c18; }
.nav-item.is-active { color: var(--signal); border-color: #4c5836; background: #1b2117; }
.nav-glyph { color: inherit; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; text-align: center; }
.nav-count { color: #697169; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; font-variant-numeric: tabular-nums; }
.nav-item.is-active .nav-count { color: var(--signal); }
.sidebar-note { margin-top: auto; padding: 16px 0 0; border-top: 1px solid #303430; }
.sidebar-note::before { content: ""; display: block; width: 28px; height: 2px; margin-bottom: 14px; background: var(--alert); }
.sidebar-note strong { display: block; margin-top: 8px; color: #f1f3ed; font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 14px; font-weight: 600; }
.sidebar-note p { margin: 7px 0 0; color: #838b83; font-size: 10px; line-height: 1.7; }
.sidebar-footer { display: flex; justify-content: space-between; gap: 8px; color: #687168; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.sidebar-footer a { color: inherit; text-decoration: none; }
.sidebar-footer a:hover { color: var(--signal); }

.main-content { min-width: 0; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; padding: 24px 5vw 0; }
.breadcrumb { color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.slash { margin: 0 8px; color: var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 14px; }
.icon-button:hover { border-color: var(--ink); background: var(--paper-strong); }
.text-button { color: var(--muted); font-size: 10px; text-decoration: none; }
.text-button:hover { color: var(--action); }

.hero-section, .workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section, .about-section, .footer { max-width: 1280px; margin: 0 auto; padding-right: 5vw; padding-left: 5vw; }
.hero-section { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: end; gap: 70px; padding-top: 76px; padding-bottom: 66px; }
.hero-copy { max-width: 640px; }
.section-kicker { color: var(--signal-deep); }
.pulse-line { display: inline-block; width: 25px; height: 1px; margin-right: 8px; vertical-align: middle; background: var(--alert); }
.hero-copy h2 { margin: 17px 0 21px; color: var(--ink); font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: clamp(48px, 6vw, 72px); line-height: 1; font-weight: 600; }
.hero-copy h2 em { color: var(--signal-deep); font-style: normal; }
.hero-copy p { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.hero-readout { padding: 17px 0 3px 20px; border-left: 1px solid var(--line); }
.readout-label { color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; font-weight: 600; }
.readout-value { margin: 10px 0 7px; color: var(--ink); font-family: "Bahnschrift SemiCondensed", sans-serif; font-size: 45px; line-height: 1; font-weight: 600; }
.readout-value span { margin-left: 3px; color: var(--alert); font-size: 15px; }
.readout-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.signal-bars { display: flex; align-items: end; gap: 2px; height: 12px; }
.signal-bars i { display: block; width: 2px; background: var(--signal-deep); }
.signal-bars i:nth-child(1) { height: 4px; opacity: .45; }.signal-bars i:nth-child(2) { height: 7px; opacity: .65; }.signal-bars i:nth-child(3) { height: 9px; opacity: .82; }.signal-bars i:nth-child(4) { height: 12px; }

.workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section { padding-top: 34px; padding-bottom: 38px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 20px; }
.section-heading h3 { margin: 7px 0 0; font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 24px; font-weight: 600; }
.search-field { display: flex; align-items: center; gap: 9px; width: min(278px, 100%); padding: 8px 0; border-bottom: 1px solid #8d938c; color: var(--muted); }
.search-field:focus-within { border-color: var(--action); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-field input::placeholder { color: #929791; }
kbd { min-width: 19px; padding: 2px 5px; border: 1px solid var(--line); color: var(--muted); background: var(--paper-strong); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; text-align: center; }

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tool-card { position: relative; min-height: 132px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; transition: background .18s ease, color .18s ease; }
.tool-card::after { content: ""; position: absolute; right: 12px; bottom: 12px; width: 18px; height: 1px; background: var(--line); transition: width .18s ease, background .18s ease; }
.tool-card:hover { background: var(--paper-strong); }
.tool-card:hover::after { width: 30px; background: var(--action); }
.tool-card.is-selected { color: #f1f4ed; background: var(--dark); }
.tool-card.is-selected::after { width: 30px; background: var(--signal); }
.tool-card[hidden] { display: none; }
.tool-card-top { display: flex; justify-content: space-between; width: 100%; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.tool-state { color: var(--signal-deep); font-weight: 700; }
.tool-card.is-selected .tool-card-top { color: #7d867d; }
.tool-card.is-selected .tool-state { color: var(--signal); }
.tool-icon { display: grid; place-items: center; min-width: 32px; height: 28px; margin: 17px 0 11px; padding: 0 7px; border: 1px solid #a9aea6; color: var(--ink); background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-weight: 700; }
.tool-card.is-selected .tool-icon { border-color: #536049; color: var(--signal); }
.tool-card strong { font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 14px; font-weight: 600; }
.tool-card > span:last-child { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.tool-card.is-selected > span:last-child { color: #9da69d; }
.empty-state { margin: 22px 0 0; color: var(--muted); font-size: 11px; }
.directory-link-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; color: var(--action); font-size: 10px; }
.directory-link-row a { text-decoration: none; }
.directory-link-row a:hover { color: var(--ink); }

.lab-heading { margin-bottom: 15px; }
.lab-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.lab-panel { overflow: hidden; border: 1px solid #2e342e; background: var(--dark); box-shadow: var(--shadow); }
.panel-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #303630; }
.toolbar-left, .toolbar-right, .output-label-row { display: flex; align-items: center; gap: 13px; }
.output-label-row { justify-content: space-between; }
.output-actions { display: flex; align-items: center; gap: 13px; }
.input-label { color: #9da69d; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; font-weight: 700; }
.sample-button, .small-action, .copy-button { padding: 0; border: 0; color: #9da69d; background: transparent; font-size: 10px; }
.sample-button:hover, .small-action:hover, .copy-button:hover { color: var(--signal); }
.toolbar-right { gap: 16px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 86px minmax(0, 1fr); min-height: 292px; }
.editor-column { display: flex; flex-direction: column; min-width: 0; padding: 17px 16px 13px; }
.editor-column textarea { flex: 1; min-height: 180px; resize: vertical; border: 0; outline: 0; color: #edf0e9; background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.75; }
.editor-column textarea::placeholder { color: #626b62; }
.editor-column.is-file-mode textarea { display: none; }
.file-control { margin: auto 0; color: #9da69d; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; line-height: 1.6; }
.file-input { display: none; }
.file-picker { display: inline-flex; margin-bottom: 12px; padding: 10px 13px; border: 1px solid #59654a; color: var(--signal); background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.file-picker:hover { color: var(--dark); background: var(--signal); }
.file-control > span { display: block; overflow-wrap: anywhere; }
.editor-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; color: #626b62; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.transform-column { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border-right: 1px solid #303630; border-left: 1px solid #303630; }
.run-button { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-width: 66px; padding: 10px 11px; border: 1px solid var(--signal); color: var(--dark); background: var(--signal); font-size: 10px; font-weight: 700; }
.run-button:hover { color: var(--signal); background: transparent; }
.run-button:active { transform: translateY(1px); }
.transform-hint { color: #626b62; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; writing-mode: vertical-rl; }
.output-column { background: #181c18; }
.copy-button { color: #8ca2ff; }
.copy-button:hover { color: #c1ccff; }

.pipeline-heading { margin-bottom: 15px; }
.chain-panel { display: grid; grid-template-columns: 310px minmax(0, 1fr); border: 1px solid #2e342e; background: var(--dark); box-shadow: var(--shadow); }
.chain-builder { min-width: 0; padding: 16px; border-right: 1px solid #303630; }
.chain-panel-head { display: flex; justify-content: space-between; align-items: start; gap: 15px; min-height: 44px; padding-bottom: 13px; border-bottom: 1px solid #303630; }
.chain-panel-head > div:first-child { display: grid; gap: 6px; }
.chain-panel-head strong { color: #edf0e9; font-size: 12px; font-weight: 600; }
.chain-panel-head > div:last-child { display: flex; gap: 11px; }
.chain-steps { display: grid; padding-top: 10px; }
.chain-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) 24px 24px 24px; align-items: center; gap: 5px; min-height: 48px; border-bottom: 1px solid #2b302b; }
.chain-step-index { color: var(--signal); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.chain-step select { width: 100%; min-width: 0; height: 31px; padding: 0 25px 0 8px; border: 1px solid #414841; border-radius: 0; outline: 0; color: #dfe4db; background: #181c18; font-size: 10px; }
.chain-step select:focus { border-color: var(--signal); }
.chain-step button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid transparent; color: #7f887f; background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.chain-step button:hover:not(:disabled) { border-color: #4a5249; color: var(--signal); }
.chain-step button:disabled { color: #3e443e; cursor: default; }
.chain-step .remove-step:hover:not(:disabled) { color: #f28b75; }
.chain-limit { margin: 12px 0 0; color: #687168; font-size: 9px; line-height: 1.6; }
.chain-console { display: grid; grid-template-columns: minmax(0, 1fr) 106px minmax(0, 1fr); min-width: 0; }
.chain-field { display: flex; min-width: 0; min-height: 330px; flex-direction: column; padding: 16px; }
.chain-field textarea { flex: 1; min-height: 220px; resize: vertical; border: 0; outline: 0; color: #edf0e9; background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.75; }
.chain-field textarea::placeholder { color: #626b62; }
.chain-output { background: #181c18; }
.chain-field-head, .chain-field-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #9da69d; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.chain-field-head button { padding: 0; border: 0; color: #8ca2ff; background: transparent; font-size: 9px; }
.chain-field-head button:hover { color: #c1ccff; }
.chain-field-meta { padding-top: 12px; color: #626b62; }
.chain-runbar { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; border-right: 1px solid #303630; border-left: 1px solid #303630; }
.chain-runbar > span { color: #687168; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.chain-run { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-width: 84px; padding: 10px 11px; border: 1px solid var(--signal); color: var(--dark); background: var(--signal); font-size: 10px; font-weight: 700; }
.chain-run:hover { color: var(--signal); background: transparent; }
.chain-run:disabled { opacity: .55; cursor: wait; }
.chain-trace-wrap { margin-top: 14px; border-top: 1px solid var(--line); }
.chain-trace-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 0 9px; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.chain-trace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.trace-step { min-width: 0; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trace-step-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.trace-step-head strong { color: var(--signal-deep); font-weight: 700; }
.trace-step pre { max-height: 112px; overflow: auto; margin: 11px 0 0; color: var(--ink); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.trace-step.is-error { border-top: 2px solid var(--alert); }
.trace-step.is-error .trace-step-head strong { color: var(--alert); }

.challenge-heading { margin-bottom: 15px; }
.challenge-heading-actions { display: flex; align-items: center; gap: 18px; }
.challenge-data-actions { display: flex; gap: 12px; padding-right: 2px; border-right: 1px solid var(--line); }
.new-challenge-button { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--signal-deep); color: var(--dark); background: var(--signal); font-size: 10px; font-weight: 700; }
.new-challenge-button:hover { color: var(--signal); background: var(--dark); }
.challenge-workbench { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 500px; border: 1px solid #2e342e; background: var(--dark); box-shadow: var(--shadow); }
.challenge-index { min-width: 0; border-right: 1px solid #303630; }
.challenge-index-head { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; border-bottom: 1px solid #303630; color: #6f786f; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.challenge-filters { display: grid; gap: 8px; padding: 11px 14px; border-bottom: 1px solid #303630; }
.challenge-search { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #414841; color: #687168; }
.challenge-search input { width: 100%; min-width: 0; height: 28px; border: 0; outline: 0; color: #dfe4db; background: transparent; font-size: 9px; }
.challenge-search input::placeholder { color: #687168; }
.challenge-search:focus-within { border-color: var(--signal); }
.challenge-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.challenge-filter-row select { width: 100%; min-width: 0; height: 27px; padding: 0 5px; border: 1px solid #3b423b; border-radius: 0; color: #98a198; background: #181c18; font-size: 8px; }
.challenge-list { display: grid; }
.challenge-list-empty { padding: 24px 14px; color: #687168; font-size: 9px; line-height: 1.7; }
.challenge-list-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; width: 100%; padding: 13px 14px; border: 0; border-bottom: 1px solid #292e29; color: #dce1d8; background: transparent; text-align: left; }
.challenge-list-item:hover { background: #181c18; }
.challenge-list-item.is-active { background: #1b2117; }
.challenge-list-marker { width: 6px; height: 6px; margin-top: 5px; border: 1px solid #667066; }
.challenge-list-item.is-active .challenge-list-marker { border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 3px rgba(184, 217, 86, .1); }
.challenge-list-item.is-solved .challenge-list-marker { border-color: var(--signal); background: var(--signal); }
.challenge-list-copy { min-width: 0; }
.challenge-list-copy strong { display: block; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.challenge-list-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: #788178; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; text-transform: uppercase; }
.challenge-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 54px 24px; text-align: center; }
.challenge-empty[hidden], .challenge-editor[hidden] { display: none; }
.challenge-empty-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border: 1px solid #465046; color: var(--signal); font-family: "Cascadia Code", Consolas, monospace; font-size: 17px; }
.challenge-empty strong { color: #edf0e9; font-size: 14px; }
.challenge-empty p { max-width: 370px; margin: 10px 0 18px; color: #7f887f; font-size: 10px; line-height: 1.75; }
.challenge-empty .small-action { color: var(--signal); }
.challenge-editor { min-width: 0; }
.challenge-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 82px; padding: 14px 16px; border-bottom: 1px solid #303630; }
.challenge-editor-head > div:first-child { display: grid; flex: 1; gap: 7px; min-width: 0; }
.challenge-title-input { width: 100%; border: 0; outline: 0; color: #edf0e9; background: transparent; font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 22px; font-weight: 600; }
.challenge-title-input:focus { box-shadow: inset 0 -1px 0 var(--signal); }
.challenge-editor-actions { display: flex; align-items: center; gap: 8px; }
.challenge-status-button { padding: 8px 10px; border: 1px solid #59654a; color: var(--signal); background: transparent; font-size: 9px; }
.challenge-status-button:hover, .challenge-status-button.is-solved { color: var(--dark); background: var(--signal); }
.icon-action { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid #4b524b; color: #a8b0a6; background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 14px; }
.icon-action:hover { border-color: var(--signal); color: var(--signal); }
.danger-action:hover { border-color: var(--alert); color: var(--alert); }
.challenge-meta-grid { display: grid; grid-template-columns: 130px 130px minmax(180px, 1fr); border-bottom: 1px solid #303630; }
.challenge-meta-grid label { display: grid; gap: 7px; min-width: 0; padding: 12px 14px; border-right: 1px solid #303630; color: #7f887f; font-size: 8px; }
.challenge-meta-grid label:last-child { border-right: 0; }
.challenge-meta-grid select, .challenge-meta-grid input, .challenge-flag-field input { width: 100%; min-width: 0; height: 28px; padding: 0; border: 0; border-bottom: 1px solid #414841; border-radius: 0; outline: 0; color: #dfe4db; background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; }
.challenge-meta-grid select:focus, .challenge-meta-grid input:focus, .challenge-flag-field input:focus { border-color: var(--signal); }
.challenge-meta-grid select { color-scheme: dark; }
.challenge-body-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .72fr); min-height: 330px; }
.challenge-notes-field { display: flex; min-width: 0; flex-direction: column; padding: 15px 16px 12px; border-right: 1px solid #303630; }
.challenge-notes-field textarea { flex: 1; min-height: 240px; margin-top: 12px; resize: vertical; border: 0; outline: 0; color: #dfe4db; background: transparent; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; line-height: 1.75; }
.challenge-notes-field textarea::placeholder { color: #5f685f; }
.challenge-notes-field small { color: #626b62; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.challenge-side-notes { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.challenge-flag-field { display: grid; gap: 9px; padding: 15px 14px; border-bottom: 1px solid #303630; }
.challenge-artifacts-block { min-width: 0; padding: 14px; border-bottom: 1px solid #303630; }
.challenge-artifacts-head { display: flex; justify-content: space-between; align-items: center; color: #697269; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.challenge-artifacts { display: grid; margin-top: 8px; }
.challenge-artifacts-empty { padding: 22px 0; color: #687168; font-size: 9px; line-height: 1.65; }
.challenge-artifact { min-width: 0; padding: 11px 0; border-top: 1px solid #303630; }
.challenge-artifact-head { display: flex; justify-content: space-between; gap: 10px; }
.challenge-artifact-head strong { overflow: hidden; color: var(--signal); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.challenge-artifact-head button { padding: 0; border: 0; color: #697269; background: transparent; font-size: 11px; }
.challenge-artifact-head button:hover { color: var(--alert); }
.challenge-artifact pre { max-height: 86px; overflow: auto; margin: 8px 0 0; color: #aeb6ad; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.challenge-artifact time { display: block; margin-top: 6px; color: #5f685f; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.challenge-attachments-block { min-width: 0; padding: 14px; }
.challenge-attachments-head, .challenge-attachment-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.challenge-attachments-head { color: #697269; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.challenge-attachment-actions { justify-content: flex-start; margin-top: 10px; }
.challenge-attachment-actions .small-action { color: #8ca2ff; }
.challenge-attachment-actions .small-action:hover { color: #c1ccff; }
.challenge-attachments { display: grid; margin-top: 8px; }
.challenge-attachments-empty { padding: 16px 0 5px; color: #687168; font-size: 9px; line-height: 1.65; }
.challenge-attachment { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 9px 0; border-top: 1px solid #303630; }
.challenge-attachment-preview { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border: 1px solid #3d453d; color: #778077; background: #181c18; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.challenge-attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.challenge-attachment-copy { min-width: 0; }
.challenge-attachment-copy strong { display: block; overflow: hidden; color: #cbd2c8; font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.challenge-attachment-copy span { display: block; margin-top: 5px; color: #606960; font-family: "Cascadia Code", Consolas, monospace; font-size: 7px; }
.challenge-attachment-controls { display: flex; gap: 6px; }
.challenge-attachment-controls button { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid transparent; color: #707970; background: transparent; font-size: 10px; }
.challenge-attachment-controls button:hover { border-color: #485048; color: var(--signal); }
.challenge-attachment-controls .remove-attachment:hover { border-color: var(--alert); color: var(--alert); }

.challenge-dialog { width: min(470px, calc(100vw - 32px)); padding: 0; border: 1px solid #454d45; border-radius: 0; color: #dfe4db; background: var(--dark); box-shadow: 0 30px 90px rgba(0, 0, 0, .4); }
.challenge-dialog::backdrop { background: rgba(10, 12, 10, .72); backdrop-filter: blur(3px); }
.challenge-dialog form { padding: 18px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid #303630; }
.dialog-head h2 { margin: 7px 0 0; font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 22px; font-weight: 600; }
.dialog-field { display: grid; gap: 8px; margin-top: 16px; color: #919a91; font-size: 9px; }
.dialog-field input, .dialog-field select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid #414841; border-radius: 0; outline: 0; color: #edf0e9; background: #181c18; font-size: 11px; }
.dialog-field input:focus, .dialog-field select:focus { border-color: var(--signal); }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 22px; padding-top: 15px; border-top: 1px solid #303630; }
.dialog-submit { padding: 10px 13px; border: 1px solid var(--signal); color: var(--dark); background: var(--signal); font-size: 10px; font-weight: 700; }
.dialog-submit:hover { color: var(--signal); background: transparent; }

.compact-heading { margin-bottom: 16px; }
.recent-list { display: grid; border-top: 1px solid var(--line); }
.recent-empty { padding: 17px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.recent-row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; font-size: 10px; }
.recent-row:hover { color: var(--action); }
.recent-tool { color: var(--signal-deep); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; font-weight: 700; }
.recent-preview { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.recent-time { color: #969c95; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }

.about-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); align-items: start; gap: 50px; padding-top: 48px; padding-bottom: 48px; border-top: 1px solid var(--line); }
.about-section h3 { max-width: 390px; margin: 8px 0 0; font-family: "Bahnschrift SemiCondensed", "Noto Sans SC", sans-serif; font-size: 27px; line-height: 1.15; font-weight: 600; }
.about-section > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 17px; padding-bottom: 22px; color: #8c938b; font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; border-top: 1px solid var(--line); }
.footer a { color: inherit; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 5; max-width: 320px; padding: 11px 14px; border-left: 2px solid var(--signal); color: #eff2eb; background: var(--dark); box-shadow: 0 16px 40px rgba(10, 12, 10, .22); font-size: 10px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body.is-light { --paper: #20241f; --paper-strong: #282d27; --ink: #edf0e9; --line: #444b42; --muted: #a8b0a6; --signal-deep: #b8d956; --shadow: 0 22px 55px rgba(0, 0, 0, .2); color-scheme: dark; }
body.is-light .tool-card.is-selected { color: #171916; background: var(--signal); }
body.is-light .tool-card.is-selected .tool-state, body.is-light .tool-card.is-selected .tool-icon { color: #171916; border-color: #63752c; }
body.is-light .tool-card.is-selected > span:last-child, body.is-light .tool-card.is-selected .tool-card-top { color: #465325; }

@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hero-copy, .hero-readout, .workspace-section { animation: enter .5s ease both; }
.hero-readout { animation-delay: .08s; }
.workspace-section { animation-delay: .14s; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 202px minmax(0, 1fr); }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-section { padding-top: 58px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 16px 20px; padding: 16px 18px; }
  .sidebar-status, .sidebar-note, .sidebar-footer { display: none; }
  .nav-stack { grid-column: 1 / -1; display: flex; overflow-x: auto; gap: 5px; margin: 0 -3px -2px; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; width: auto; grid-template-columns: 18px auto auto; padding: 8px 9px; }
  .hero-section, .workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section, .about-section, .footer, .topbar { padding-right: 18px; padding-left: 18px; }
  .hero-section { display: block; padding-top: 48px; padding-bottom: 48px; }
  .hero-copy h2 { font-size: clamp(44px, 13vw, 62px); }
  .hero-readout { margin-top: 34px; padding-left: 0; border-left: 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .search-field { width: 100%; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card { min-height: 128px; }
  .editor-grid { display: block; }
  .transform-column { border: 0; border-top: 1px solid #303630; border-bottom: 1px solid #303630; flex-direction: row; justify-content: space-between; padding: 12px 16px; }
  .transform-hint { writing-mode: initial; }
  .editor-column textarea { min-height: 142px; }
  .chain-panel { display: block; }
  .chain-builder { border-right: 0; border-bottom: 1px solid #303630; }
  .chain-console { display: block; }
  .chain-field { min-height: 230px; }
  .chain-field textarea { min-height: 150px; }
  .chain-runbar { flex-direction: row; justify-content: space-between; padding: 12px 16px; border: 0; border-top: 1px solid #303630; border-bottom: 1px solid #303630; }
  .chain-trace { grid-template-columns: 1fr; }
  .challenge-heading-actions { width: 100%; justify-content: space-between; }
  .challenge-workbench { display: block; }
  .challenge-index { border-right: 0; border-bottom: 1px solid #303630; }
  .challenge-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .challenge-list-item { border-right: 1px solid #292e29; }
  .challenge-meta-grid { grid-template-columns: 1fr 1fr; }
  .challenge-tags-field { grid-column: 1 / -1; border-top: 1px solid #303630; }
  .challenge-body-grid { display: block; }
  .challenge-notes-field { min-height: 300px; border-right: 0; border-bottom: 1px solid #303630; }
  .about-section { display: block; }
  .about-section > p { max-width: 530px; margin-top: 20px; }
}
@media (max-width: 450px) {
  .topbar-actions .text-button { display: none; }
  .hero-copy p { font-size: 13px; }
  .tool-card { padding: 12px 10px; }
  .challenge-heading-actions { align-items: flex-start; flex-direction: column; }
  .challenge-data-actions { border-right: 0; }
  .challenge-list { display: block; max-height: 250px; overflow: auto; }
  .challenge-meta-grid { display: block; }
  .challenge-meta-grid label { border-right: 0; border-bottom: 1px solid #303630; }
  .challenge-tags-field { border-top: 0; }
  .challenge-editor-head { align-items: flex-start; flex-direction: column; }
  .challenge-editor-actions { width: 100%; justify-content: space-between; }
  .dialog-grid { display: block; }
  .recent-row { grid-template-columns: 68px 1fr; gap: 7px; }
  .recent-time { grid-column: 2; }
  .footer { display: block; line-height: 1.9; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* 2026 interface system */
:root {
  --ink: #151915;
  --paper: #f5f6f1;
  --paper-strong: #ffffff;
  --line: #d8ddd4;
  --line-dark: #343a34;
  --muted: #697168;
  --dark: #151915;
  --dark-soft: #1d221d;
  --signal: #c7f36a;
  --signal-deep: #3c6d19;
  --action: #245bd7;
  --alert: #df6048;
  --shadow: 0 18px 48px rgba(30, 37, 30, .1);
  font-family: "Aptos", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
}

body {
  background-color: var(--paper);
  background-image: none;
}
::selection { color: var(--dark); background: var(--signal); }
html { scroll-padding-top: 84px; }

.app-shell { display: block; }
.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  width: 100%;
  height: 68px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  border: 0;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand-lockup { gap: 10px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  color: var(--dark);
  background: var(--signal);
  box-shadow: inset 0 0 0 1px rgba(21, 25, 21, .12);
}
.brand-lockup h1 { color: var(--ink); font-size: 20px; letter-spacing: -.01em; }
.brand-lockup .eyebrow { color: #8a9289; font-size: 7px; }
.sidebar-status {
  padding: 0 0 0 22px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.status-dot, .live-dot { background: #68b433; box-shadow: 0 0 0 3px rgba(104, 180, 51, .12); }
.nav-stack { display: flex; justify-content: flex-end; gap: 2px; min-width: 0; }
.nav-item {
  display: flex;
  grid-template-columns: none;
  width: auto;
  min-height: 36px;
  padding: 0 11px;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  color: #606860;
  font-size: 11px;
  white-space: nowrap;
}
.nav-item:hover { color: var(--ink); border-color: transparent; background: #eef1eb; }
.nav-item.is-active { color: var(--ink); border-color: transparent; background: #e6ebdf; }
.nav-glyph { font-size: 11px; }
.nav-count { color: #929a91; font-size: 7px; }
.nav-item.is-active .nav-count { color: var(--signal-deep); }
.sidebar-note, .sidebar-footer { display: none; }

.main-content { overflow: visible; }
.topbar {
  max-width: 1180px;
  padding: 16px 0 0;
}
.breadcrumb { font-size: 8px; }
.icon-button { border-radius: 5px; background: rgba(255, 255, 255, .7); }
.text-button { font-weight: 600; }
.hero-section, .workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section, .about-section, .footer {
  max-width: 1180px;
  padding-right: 0;
  padding-left: 0;
}
.hero-section {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 70px;
  padding-top: 48px;
  padding-bottom: 42px;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(rgba(30, 38, 30, .032) 1px, transparent 1px), linear-gradient(90deg, rgba(30, 38, 30, .032) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}
.hero-section::after {
  content: "0x";
  position: absolute;
  z-index: -1;
  right: 205px;
  bottom: -48px;
  color: rgba(35, 46, 35, .035);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 190px;
  font-weight: 700;
  line-height: 1;
}
.hero-copy h2 {
  max-width: 680px;
  margin: 14px 0 18px;
  font-size: clamp(46px, 6vw, 70px);
  letter-spacing: -.015em;
}
.hero-copy h2 em { color: var(--action); }
.hero-copy p { max-width: 600px; font-size: 14px; line-height: 1.8; }
.section-kicker { color: var(--signal-deep); font-size: 8px; }
.pulse-line { width: 18px; background: var(--alert); }
.hero-readout {
  align-self: end;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .68);
}
.readout-value { font-size: 42px; }

.workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section { padding-top: 38px; padding-bottom: 44px; }
.section-heading { align-items: center; margin-bottom: 18px; }
.section-heading h3 { font-size: 23px; letter-spacing: -.01em; }
.search-field {
  width: min(340px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
}
.search-field:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px rgba(36, 91, 215, .08); }
.tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border: 0; }
.tool-card {
  min-height: 144px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 1px 0 rgba(25, 31, 25, .03);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: #afb8ad; background: #fff; box-shadow: 0 9px 24px rgba(30, 37, 30, .07); }
.tool-card.is-selected { color: #f5f7f2; border-color: var(--dark); background: var(--dark); box-shadow: 0 12px 30px rgba(21, 25, 21, .16); }
.tool-card::after { right: 15px; bottom: 15px; height: 2px; }
.tool-icon { margin-top: 20px; border-radius: 4px; }
.tool-card strong { font-size: 15px; }
.tool-card > span:last-child { margin-top: 5px; font-size: 10px; }
.directory-link-row { margin-top: 16px; font-weight: 600; }

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px dashed #c7cdc4;
  border-radius: 6px;
  color: #8c948b;
  background: rgba(255, 255, 255, .46);
  font-family: "Cascadia Code", Consolas, monospace;
  text-align: center;
}
.ad-slot span { font-size: 8px; font-weight: 700; }
.ad-slot small { font-size: 7px; }
.ad-slot-horizontal { min-height: 82px; margin-top: 28px; }

.lab-panel, .chain-panel, .challenge-workbench { border-color: #2b312b; border-radius: 8px; box-shadow: var(--shadow); }
.editor-grid { min-height: 270px; }
.challenge-workbench { min-height: 420px; }
.panel-toolbar, .chain-panel-head, .challenge-editor-head { background: #181d18; }
.editor-column textarea, .chain-field textarea, .challenge-notes-field textarea { caret-color: var(--signal); }
.run-button, .chain-run, .new-challenge-button, .dialog-submit { border-radius: 5px; }
.small-action, .copy-button, .sample-button { font-weight: 600; }
.chain-step select, .challenge-filter-row select, .dialog-field input, .dialog-field select { border-radius: 4px; }
.chain-panel { grid-template-columns: 300px minmax(0, 1fr); }
.challenge-workbench { grid-template-columns: 272px minmax(0, 1fr); }
.challenge-list-item { transition: background .16s ease; }
.challenge-list-item.is-active { box-shadow: inset 2px 0 0 var(--signal); }
.challenge-dialog { border-radius: 8px; overflow: hidden; }
.recent-row { min-height: 48px; }
.about-section { padding-top: 52px; padding-bottom: 52px; }
.about-section h3 { font-size: 30px; letter-spacing: -.01em; }

body.is-light {
  --paper: #181c18;
  --paper-strong: #222722;
  --ink: #edf1ea;
  --line: #3a4239;
  --muted: #a9b1a7;
  --signal-deep: #bde95e;
  color-scheme: dark;
}
body.is-light { background-image: none; }
body.is-light .hero-section::before { opacity: .5; }
body.is-light .sidebar { color: var(--ink); background: rgba(25, 29, 25, .95); }
body.is-light .brand-lockup h1, body.is-light .nav-item:hover, body.is-light .nav-item.is-active { color: var(--ink); }
body.is-light .nav-item:hover, body.is-light .nav-item.is-active { background: #292f28; }
body.is-light .hero-readout, body.is-light .search-field, body.is-light .tool-card { background: rgba(34, 39, 34, .76); }
body.is-light .tool-card:hover { background: #272d27; }
body.is-light .tool-card.is-selected { color: #171b17; background: var(--signal); }
body.is-light .ad-slot { background: rgba(34, 39, 34, .5); }

@media (max-width: 1228px) {
  .sidebar { padding-right: 24px; padding-left: 24px; }
  .topbar, .hero-section, .workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section, .about-section, .footer { margin-right: 24px; margin-left: 24px; }
  .nav-item { padding-right: 8px; padding-left: 8px; }
}
@media (max-width: 960px) {
  .sidebar { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  .sidebar-status { display: none; }
  .nav-stack { overflow-x: auto; justify-content: flex-start; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chain-panel { display: block; }
  .chain-builder { border-right: 0; border-bottom: 1px solid #303630; }
  .chain-console { grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    padding: 12px 18px 10px;
  }
  .nav-stack { grid-column: 1 / -1; justify-content: flex-start; margin: 0; padding: 0 0 2px; }
  .nav-item { padding: 0 9px; }
  .nav-count { display: none; }
  .topbar, .hero-section, .workspace-section, .lab-section, .pipeline-section, .challenge-section, .recent-section, .about-section, .footer { margin-right: 18px; margin-left: 18px; padding-right: 0; padding-left: 0; }
  .topbar { padding-top: 13px; }
  .hero-section { padding-top: 40px; padding-bottom: 42px; }
  .hero-section::after { right: -20px; bottom: 10px; font-size: 130px; }
  .hero-readout { margin-top: 28px; padding: 15px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card { min-height: 132px; }
  .chain-console { display: block; }
  .challenge-workbench { display: block; }
  .challenge-workbench { min-height: 0; }
  .ad-slot-horizontal { min-height: 72px; }
}
@media (max-width: 450px) {
  .brand-lockup .eyebrow, .nav-glyph { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-lockup h1 { margin: 0; font-size: 18px; }
  .nav-item { min-height: 31px; font-size: 9px; }
  .tool-grid { gap: 7px; }
  .tool-card { min-height: 126px; padding: 12px; }
  .tool-icon { margin-top: 17px; }
  .hero-copy h2 { font-size: 45px; }
}
