:root {
  --ink: #101316;
  --paper: #f4f2ed;
  --paper-strong: #fbfaf6;
  --line: #d6d8d0;
  --muted: #6b716e;
  --dark: #161a1c;
  --dark-soft: #202629;
  --green: #a6d969;
  --green-deep: #6fa83d;
  --orange: #f7a553;
  --blue: #7db5ee;
  --shadow: 0 18px 50px rgba(30, 37, 35, 0.12);
  font-family: "Segoe UI", "Noto Sans SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(125, 181, 238, 0.75); outline-offset: 3px; }

.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 28px 20px 22px; color: #e8ece6; background: var(--dark); border-right: 1px solid #2b3132; }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--dark); background: var(--green); font-size: 13px; font-weight: 800; letter-spacing: -0.04em; }
.brand-lockup h1 { margin: 3px 0 0; font-size: 20px; line-height: 1; letter-spacing: -0.06em; font-weight: 800; }
.eyebrow, .section-kicker, .note-kicker { margin: 0; color: #9ba69d; font-size: 9px; font-weight: 800; letter-spacing: 0.17em; text-transform: uppercase; }
.brand-lockup .eyebrow { color: var(--green); }
.sidebar-status { display: flex; align-items: center; gap: 9px; padding: 10px 0; border-top: 1px solid #2b3132; border-bottom: 1px solid #2b3132; color: #aeb8af; font-size: 11px; }
.status-dot, .live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(166, 217, 105, 0.11); }
.nav-stack { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 11px 10px; border: 1px solid transparent; color: #abb3ad; background: transparent; text-align: left; font-size: 12px; }
.nav-item:hover { color: #f4f8f2; background: #1c2224; }
.nav-item.is-active { border-color: #34413b; color: var(--green); background: #202a26; }
.nav-glyph { color: inherit; font-size: 15px; text-align: center; }
.nav-count { color: #68746c; font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-item.is-active .nav-count { color: var(--green); }
.sidebar-note { margin-top: auto; padding: 15px 14px; border-left: 2px solid var(--orange); background: #202527; }
.sidebar-note strong { display: block; margin-top: 10px; color: #f4f5ee; font-size: 13px; }
.sidebar-note p { margin: 8px 0 0; color: #89948c; font-size: 11px; line-height: 1.6; }
.sidebar-footer { display: flex; justify-content: space-between; gap: 8px; color: #707d74; font-size: 10px; }
.sidebar-footer a { color: inherit; text-decoration: none; }
.sidebar-footer a:hover { color: var(--green); }

.main-content { min-width: 0; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; max-width: 1250px; margin: 0 auto; padding: 23px 5.5vw 0; }
.breadcrumb { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.slash { margin: 0 8px; color: var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.icon-button { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 15px; }
.icon-button:hover { background: var(--paper-strong); }
.text-button { color: var(--muted); font-size: 11px; text-decoration: none; }
.text-button:hover { color: var(--ink); }

.hero-section, .workspace-section, .lab-section, .recent-section, .about-section, .footer { max-width: 1250px; margin: 0 auto; padding-right: 5.5vw; padding-left: 5.5vw; }
.hero-section { display: flex; justify-content: space-between; align-items: end; gap: 44px; padding-top: 82px; padding-bottom: 75px; }
.hero-copy { max-width: 610px; }
.section-kicker { color: var(--green-deep); }
.pulse-line { display: inline-block; width: 28px; height: 2px; margin-right: 7px; vertical-align: middle; background: var(--orange); }
.hero-copy h2 { margin: 17px 0 21px; color: var(--ink); font-size: clamp(52px, 7vw, 94px); line-height: 0.93; letter-spacing: -0.075em; font-weight: 800; }
.hero-copy h2 em { color: var(--green-deep); font-style: normal; }
.hero-copy p { max-width: 505px; margin: 0; color: #5f6661; font-size: 15px; line-height: 1.8; }
.hero-readout { min-width: 180px; padding: 19px 0 2px 21px; border-left: 1px solid var(--line); }
.readout-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.17em; }
.readout-value { margin: 8px 0 6px; color: var(--ink); font-size: 48px; line-height: 1; letter-spacing: -0.07em; font-weight: 800; }
.readout-value span { margin-left: 3px; color: var(--orange); font-size: 18px; letter-spacing: 0; }
.readout-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.signal-bars { display: flex; align-items: end; gap: 2px; height: 12px; }
.signal-bars i { display: block; width: 3px; background: var(--green-deep); }
.signal-bars i:nth-child(1) { height: 5px; opacity: .4; }.signal-bars i:nth-child(2) { height: 8px; opacity: .6; }.signal-bars i:nth-child(3) { height: 10px; opacity: .8; }.signal-bars i:nth-child(4) { height: 12px; }

.workspace-section, .lab-section, .recent-section { padding-top: 38px; padding-bottom: 38px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 23px; }
.section-heading h3 { margin: 8px 0 0; font-size: 23px; letter-spacing: -0.045em; }
.search-field { display: flex; align-items: center; gap: 9px; width: min(280px, 100%); padding: 9px 10px; border-bottom: 1px solid #9ea5a0; color: var(--muted); }
.search-field:focus-within { border-color: var(--ink); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #979d98; }
kbd { min-width: 19px; padding: 2px 5px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }

.tool-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.tool-card { min-height: 153px; padding: 13px 12px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); color: var(--ink); background: rgba(251, 250, 246, .65); text-align: left; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: #9da99c; background: var(--paper-strong); }
.tool-card.is-selected { border-color: var(--green-deep); background: #eef5e4; box-shadow: inset 0 3px 0 var(--green-deep); }
.tool-card[hidden] { display: none; }
.tool-card-top { display: flex; justify-content: space-between; width: 100%; color: var(--muted); font-size: 9px; letter-spacing: .11em; }
.tool-state { color: var(--green-deep); font-weight: 800; }
.tool-icon { display: grid; place-items: center; height: 39px; margin: 19px 0 14px; padding: 0 9px; color: var(--dark); background: var(--orange); font-family: "Consolas", monospace; font-size: 13px; font-weight: 800; letter-spacing: -0.08em; }
.tool-card strong { font-size: 14px; letter-spacing: -0.02em; }
.tool-card > span:last-child { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.empty-state { margin: 23px 0 0; color: var(--muted); font-size: 12px; }

.lab-heading { margin-bottom: 16px; }
.lab-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-family: "Consolas", monospace; font-size: 10px; }
.lab-panel { overflow: hidden; border: 1px solid #2f3738; 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 #303839; }
.toolbar-left, .toolbar-right, .output-label-row { display: flex; align-items: center; gap: 13px; }
.input-label { color: #9eaaa1; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.sample-button, .small-action, .copy-button { padding: 0; border: 0; color: #9eaaa1; background: transparent; font-size: 10px; }
.sample-button:hover, .small-action:hover, .copy-button:hover { color: var(--green); }
.toolbar-right { gap: 16px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 98px minmax(0, 1fr); min-height: 290px; }
.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: #e9efe8; background: transparent; font-family: "Consolas", "SFMono-Regular", monospace; font-size: 13px; line-height: 1.7; }
.editor-column textarea::placeholder { color: #64706a; }
.editor-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; color: #627069; font-family: "Consolas", monospace; font-size: 9px; }
.transform-column { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; border-right: 1px solid #303839; border-left: 1px solid #303839; }
.run-button { display: flex; justify-content: space-between; align-items: center; gap: 25px; min-width: 74px; padding: 11px 12px; border: 0; color: var(--dark); background: var(--green); font-size: 12px; font-weight: 800; }
.run-button:hover { background: #b8e683; }
.run-button:active { transform: translateY(1px); }
.transform-hint { color: #5f6c64; font-family: "Consolas", monospace; font-size: 8px; writing-mode: vertical-rl; letter-spacing: .12em; }
.output-column { background: #1b2022; }
.copy-button { color: var(--blue); }
.copy-button:hover { color: #a9d4ff; }

.compact-heading { margin-bottom: 17px; }
.recent-list { display: grid; gap: 7px; }
.recent-empty { padding: 18px; border: 1px dashed #b8bdb7; color: var(--muted); font-size: 11px; }
.recent-row { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 14px; padding: 11px 13px; border: 0; border-left: 2px solid var(--green-deep); color: var(--ink); background: rgba(251, 250, 246, .62); text-align: left; font-size: 11px; }
.recent-row:hover { background: var(--paper-strong); }
.recent-tool { color: var(--green-deep); font-family: "Consolas", monospace; font-size: 10px; font-weight: 800; }
.recent-preview { overflow: hidden; color: #5e6661; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { color: #9ba29d; font-family: "Consolas", monospace; font-size: 9px; }

.about-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 450px); align-items: start; gap: 40px; padding-top: 52px; padding-bottom: 52px; border-top: 1px solid var(--line); }
.about-section h3 { max-width: 370px; margin: 9px 0 0; font-size: 28px; line-height: 1.1; letter-spacing: -0.06em; }
.about-section > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 17px; padding-bottom: 20px; color: #989f99; font-family: "Consolas", monospace; font-size: 9px; letter-spacing: .05em; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 5; max-width: 320px; padding: 12px 14px; border-left: 3px solid var(--green); color: #eff5eb; background: var(--dark); box-shadow: 0 12px 30px rgba(10, 12, 12, .2); font-size: 11px; opacity: 0; transform: translateY(12px); 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: #252b2d; --paper-strong: #2e3637; --ink: #ecf1e9; --line: #4a5553; --muted: #a5b0a8; --green-deep: #a6d969; --shadow: 0 18px 50px rgba(0, 0, 0, .18); }
body.is-light .main-content { color: var(--ink); }
body.is-light .breadcrumb strong, body.is-light .hero-copy h2, body.is-light .readout-value, body.is-light .section-heading h3, body.is-light .tool-card, body.is-light .search-field input { color: var(--ink); }
body.is-light .tool-card, body.is-light .recent-row { background: #2c3435; }
body.is-light .tool-card.is-selected { background: #314133; }
body.is-light .hero-copy p, body.is-light .about-section > p { color: #b6c0b8; }
body.is-light .tool-card > span:last-child { color: #a8b3aa; }
body.is-light .search-field input::placeholder { color: #87938b; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-section { padding-top: 62px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 17px 20px; padding: 17px 18px; }
  .sidebar-status, .sidebar-note, .sidebar-footer { display: none; }
  .nav-stack { grid-column: 1 / -1; display: flex; overflow-x: auto; gap: 6px; margin: 0 -4px -2px; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; width: auto; grid-template-columns: 20px auto auto; padding: 8px 9px; }
  .hero-section, .workspace-section, .lab-section, .recent-section, .about-section, .footer, .topbar { padding-right: 18px; padding-left: 18px; }
  .hero-section { display: block; padding-top: 55px; padding-bottom: 53px; }
  .hero-copy h2 { font-size: clamp(52px, 15vw, 76px); }
  .hero-readout { margin-top: 38px; 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: 144px; }
  .editor-grid { display: block; }
  .transform-column { border: 0; border-top: 1px solid #303839; border-bottom: 1px solid #303839; flex-direction: row; justify-content: space-between; padding: 13px 16px; }
  .transform-hint { writing-mode: initial; }
  .editor-column textarea { min-height: 142px; }
  .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: 14px; }
  .tool-grid { gap: 7px; }
  .tool-card { padding: 11px 10px; }
  .tool-icon { margin-top: 15px; }
  .recent-row { grid-template-columns: 70px 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; }
}
