@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #ecf4ff;
  --muted: #91a4bd;
  --subtle: #5d718c;
  --panel: #101a2b;
  --panel-2: #141f33;
  --canvas: #0b1220;
  --line: rgba(168, 194, 225, .13);
  --cyan: #72e5dc;
  --lime: #d9f27e;
  --coral: #ff8c75;
  --violet: #b49cff;
  --shadow: 0 18px 50px rgba(1, 7, 18, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body { background: #08101c; color: var(--ink); font-family: 'Manrope', system-ui, sans-serif; }
button, input { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.app-shell { min-height: 100vh; background: radial-gradient(circle at 90% 0%, rgba(70, 106, 139, .15), transparent 31rem), #08101c; }
.topbar { min-height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 36px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: flex; align-items: end; gap: 3px; width: 25px; height: 28px; padding: 3px; border: 1px solid rgba(217,242,126,.65); border-radius: 7px; transform: rotate(-8deg); }
.brand-mark span { display: block; width: 4px; border-radius: 3px; background: var(--lime); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .5; }.brand-mark span:nth-child(2) { height: 16px; }.brand-mark span:nth-child(3) { height: 21px; opacity: .75; }
.eyebrow, .section-kicker, .stage-kicker, .tiny-label, .readout-label { margin: 0; font: 500 10px/1 'DM Mono', monospace; letter-spacing: .16em; color: var(--subtle); }
.topbar h1 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.03em; }
.topbar-meta { display: flex; align-items: center; gap: 10px; font: 11px 'DM Mono', monospace; color: var(--muted); }
.live-dot, .cursor-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.meta-divider { height: 13px; width: 1px; background: var(--line); margin: 0 4px; }.shortcut-hint { color: var(--subtle); }.shortcut-hint kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }

.workspace { display: grid; grid-template-columns: 306px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.control-panel { border-right: 1px solid var(--line); padding: 33px 22px 20px; display: flex; flex-direction: column; gap: 28px; background: linear-gradient(180deg, rgba(17,28,47,.92), rgba(13,22,37,.87)); }
.panel-intro { padding-bottom: 1px; }.panel-intro p { max-width: 230px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }.math-inline { color: var(--cyan); font: 500 13px 'DM Mono', monospace; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }.section-heading h2 { margin: 0; font-size: 13px; letter-spacing: -.01em; }.count-pill { color: var(--cyan); font: 10px 'DM Mono', monospace; }.tiny-label { font-size: 9px; }
.equation-list { display: grid; gap: 9px; }.equation-row { position: relative; padding: 10px 10px 10px 12px; background: rgba(22,35,56,.94); border: 1px solid rgba(164,193,226,.12); border-left: 3px solid var(--curve-color); border-radius: 7px; transition: border-color .2s, background .2s, opacity .2s; }.equation-row.invalid { border-color: rgba(255,140,117,.75); border-left-color: var(--coral); }.equation-row.muted { opacity: .54; }
.equation-top { display:flex; align-items:center; gap: 8px; }.curve-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--curve-color); box-shadow: 0 0 10px var(--curve-color); }.equation-name { flex: 1; color: var(--subtle); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }.icon-button { width: 22px; height: 22px; color: var(--subtle); background: transparent; border-radius: 5px; font-size: 17px; line-height: 1; }.icon-button:hover { background: rgba(255,255,255,.06); color: var(--ink); }.icon-button.remove:hover { color: var(--coral); }.equation-input { width: 100%; margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--ink); font: 500 14px 'DM Mono', monospace; letter-spacing: -.02em; }.equation-input::placeholder { color: var(--subtle); }.error-text { display: none; margin-top: 6px; color: var(--coral); font-size: 10px; line-height: 1.35; }.invalid .error-text { display: block; }.equation-input[aria-invalid="true"] { color: var(--coral); }
.add-function { width: 100%; margin-top: 11px; padding: 10px 12px; border: 1px dashed rgba(114,229,220,.38); border-radius: 7px; background: rgba(114,229,220,.04); color: var(--cyan); font-size: 11px; text-align: left; transition: background .2s, border-color .2s; }.add-function span { margin-right: 7px; font-size: 16px; vertical-align: -1px; }.add-function:hover { border-color: var(--cyan); background: rgba(114,229,220,.09); }
.example-list { display: grid; gap: 7px; }.example-card { width: 100%; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; background: rgba(255,255,255,.025); text-align: left; transition: border-color .2s, background .2s, transform .2s; }.example-card:hover { border-color: rgba(114,229,220,.3); background: rgba(114,229,220,.06); transform: translateX(2px); }.example-card strong, .example-card small { display: block; }.example-card strong { font-size: 11px; font-weight: 600; }.example-card small { margin-top: 2px; color: var(--subtle); font: 10px 'DM Mono', monospace; }.example-glyph { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: rgba(255,255,255,.05); font: 21px/1 Georgia, serif; }.sine-glyph { color: var(--cyan); }.parabola-glyph { color: var(--coral); }.ripple-glyph { color: var(--lime); }.arc-glyph { color: var(--violet); }.arrow { color: var(--subtle); font-size: 15px; }
.view-buttons { display: grid; grid-template-columns: 38px 1fr 38px; gap: 6px; }.tool-button { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.04); color: var(--muted); font: 12px 'DM Mono', monospace; }.tool-button:hover { border-color: rgba(114,229,220,.5); color: var(--cyan); }.reset-button { font-size: 10px; }.toggle-row { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; color: var(--muted); font-size: 11px; }.toggle-row > span:first-child { display: flex; align-items:center; gap: 8px; }.toggle-icon { width: 15px; color: var(--cyan); font: 15px 'DM Mono', monospace; text-align: center; }.axis-icon { color: var(--coral); font-size: 13px; }.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }.switch { position: relative; width: 28px; height: 16px; border-radius: 10px; background: #33435a; transition: .2s; }.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: .2s; }.toggle-row input:checked + .switch { background: rgba(114,229,220,.25); }.toggle-row input:checked + .switch::after { left: 15px; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.panel-footer { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }.help-chip { display: flex; align-items: center; gap: 7px; color: var(--subtle); font: 10px/1.4 'DM Mono', monospace; }.help-chip > span:first-child { color: var(--cyan); font-size: 19px; }.help-chip b { color: var(--muted); font-weight: 400; }.version-label { color: #455773; font: 9px 'DM Mono', monospace; }

.graph-stage { min-width: 0; padding: 32px 38px 24px; display: flex; flex-direction: column; }.stage-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }.stage-kicker { color: var(--cyan); font-size: 9px; }.stage-kicker span { color: var(--subtle); padding: 0 4px; }.stage-header h2 { margin: 9px 0 0; font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.045em; font-weight: 700; }.view-readout { color: var(--subtle); font: 10px 'DM Mono', monospace; white-space: nowrap; }.view-readout span { color: var(--cyan); margin: 0 4px; }
.graph-card { position: relative; height: clamp(450px, 64vh, 720px); min-height: 380px; overflow: hidden; border: 1px solid rgba(146,177,210,.17); border-radius: 12px; background: var(--canvas); box-shadow: var(--shadow); cursor: crosshair; }.graph-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 70px rgba(3, 8, 16, .42); z-index: 1; }.graph-card canvas { display: block; width: 100%; height: 100%; touch-action: none; }.canvas-badge, .zoom-hud { position: absolute; z-index: 2; display:flex; align-items:center; gap: 7px; padding: 7px 9px; border: 1px solid rgba(146,177,210,.12); border-radius: 5px; background: rgba(8,16,28,.72); color: var(--subtle); font: 9px 'DM Mono', monospace; pointer-events:none; }.canvas-badge { left: 14px; top: 14px; }.zoom-hud { right: 14px; top: 14px; gap: 8px; }.zoom-hud span { color: var(--subtle); }.zoom-hud b { color: var(--lime); font-weight: 500; }.cursor-dot { width: 5px; height: 5px; }
.cursor-readout { min-height: 58px; display: flex; align-items: center; gap: 22px; margin-top: 13px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(16,26,43,.65); }.readout-label { display:flex; align-items:center; gap: 8px; white-space: nowrap; color: var(--subtle); }.crosshair-symbol { color: var(--coral); font-size: 15px; }.readout-values { min-width: 0; display:flex; flex-wrap:wrap; align-items:center; gap: 8px; font: 11px 'DM Mono', monospace; }.empty-readout { color: var(--subtle); }.value-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 4px; background: rgba(255,255,255,.045); color: var(--muted); }.value-chip strong { color: var(--ink); font-weight: 500; }.value-chip .chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--curve-color); }.graph-footer { display:flex; align-items:center; gap: 20px; padding: 12px 2px 0; color: var(--subtle); font: 10px 'DM Mono', monospace; }.footer-dot { display:inline-block; width:5px; height:5px; margin-right: 5px; border-radius:50%; }.footer-dot.cyan { background: var(--cyan); }.footer-dot.coral { background: var(--coral); }.graph-coordinates { margin-left:auto; color: var(--muted); }

@media (max-width: 980px) { .workspace { grid-template-columns: 270px minmax(0, 1fr); }.graph-stage { padding: 28px 24px 20px; }.topbar { padding: 0 24px; }.topbar-meta { display:none; } }
@media (max-width: 740px) { .topbar { min-height: 68px; padding: 0 18px; }.workspace { display:flex; flex-direction:column; }.control-panel { order: 2; border: 0; border-top: 1px solid var(--line); padding: 24px 18px 18px; }.graph-stage { order: 1; padding: 24px 14px 18px; }.graph-card { height: min(67vh, 540px); min-height: 390px; }.stage-header { display:block; }.view-readout { margin-top: 12px; }.cursor-readout { display:block; }.readout-values { margin-top: 10px; }.graph-footer { flex-wrap:wrap; gap: 9px 16px; }.graph-coordinates { width:100%; margin-left:0; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
