:root {
  color-scheme: dark;
  --bg: #09090b;
  --sidebar: #0d0d10;
  --surface: #111114;
  --surface-raised: #17171b;
  --surface-hover: #1d1b21;
  --line: #29292f;
  --line-soft: #222227;
  --text: #f5f4f7;
  --muted: #a09da7;
  --dim: #74717b;
  --purple: #7655ad;
  --purple-light: #a587d4;
  --purple-soft: #241a33;
  --green: #9ac6a8;
  --amber: #d9b875;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-width: 320px; margin: 0; }
body { height: 100vh; overflow: hidden; background: var(--bg); color: var(--text); font-size: 13px; font-weight: 400; }
.auth-gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-gate[hidden] { display: none !important; }
.auth-gate-card { width: min(100%, 380px); padding: 28px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.auth-gate-kicker { margin: 0 0 8px; color: var(--purple-light); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
.auth-gate-card h1 { margin: 0 0 18px; font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
.auth-gate-card form { display: grid; gap: 8px; }
.auth-gate-card input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #0d0d10; color: var(--text); }
.auth-gate-card .primary-button { min-height: 42px; margin-top: 4px; }
.auth-gate-switch { margin: 12px 0 0; color: var(--dim); font-size: 12px; }
.auth-gate-switch button { border: 0; padding: 0; background: transparent; color: var(--purple-light); cursor: pointer; }
.auth-gate-note { margin: 10px 0 0; color: var(--dim); font-size: 11px; line-height: 1.5; }
.auth-gate-note.error { color: #e89b9b; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, input, textarea, select, [contenteditable="true"] { transition: box-shadow .32s ease, border-color .28s ease, background .18s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [contenteditable="true"]:focus-visible { outline: none; box-shadow: 0 0 0 1px #b79ae088; }
button:disabled { opacity: .5; cursor: not-allowed; }
.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; }
.app-shell { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.topbar { z-index: 5; height: 54px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--line); background: rgba(13,13,16,.97); }
.brand-button { width: 148px; flex: none; display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 17px; font-weight: 600; letter-spacing: -.07em; text-align: left; }
.brand-mark { width: 25px; height: 25px; flex: none; object-fit: contain; border-radius: 50%; }
.crumbs { min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs strong { overflow: hidden; color: var(--text); font-weight: 500; text-overflow: ellipsis; }
.crumb-divider { color: var(--dim); }
.topbar-spacer { flex: 1; }
.save-state { color: var(--dim); font-size: 10px; white-space: nowrap; }
.quiet-button, .primary-button, .toolbar-button, .icon-button, .avatar-button, .add-block-button, .text-button, .danger-button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-raised); color: #dedbe3; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .12s ease; }
.quiet-button, .primary-button { min-height: 31px; padding: 0 12px; }
.quiet-button:hover, .toolbar-button:hover, .icon-button:hover, .avatar-button:hover, .text-button:hover { background: #222127; border-color: #3a3741; }
.quiet-button:active, .primary-button:active, .toolbar-button:active { transform: translateY(1px); }
.primary-button { border-color: #8060b0; background: var(--purple); color: #fff; }
.primary-button:hover { background: #8768b9; }
.avatar-button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #51456d; color: #fff; font-weight: 500; }
.mobile-menu { display: inline-grid; }
.app-body { min-height: 0; flex: 1; display: grid; grid-template-columns: 224px minmax(0,1fr); transition: grid-template-columns .32s cubic-bezier(.22,.8,.28,1); }
.app-body.assistant-open { grid-template-columns: 224px minmax(0,1fr) minmax(240px, 300px); }
.app-body.sidebar-collapsed { grid-template-columns: 0 minmax(0,1fr); }
.app-body.sidebar-collapsed.assistant-open { grid-template-columns: 0 minmax(0,1fr) minmax(240px, 300px); }
.sidebar { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 13px 10px 9px; border-right: 1px solid var(--line); background: var(--sidebar); overflow-x: hidden; overflow-y: auto; transition: opacity .28s ease, padding .32s ease, border-color .32s ease; }
.app-body.sidebar-collapsed .sidebar { opacity: 0; pointer-events: none; padding: 0; border-right-color: transparent; }
.sidebar-workspace { display: flex; align-items: center; gap: 9px; min-height: 38px; margin: 0 3px 11px; padding: 0 5px; }
.workspace-symbol { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #3b3347; border-radius: 6px; background: #1d1824; color: #c4aae7; font-size: 11px; }
.workspace-title { min-width: 0; flex: 1; overflow: hidden; color: #e8e5ec; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 29px; height: 29px; display: inline-grid; place-items: center; padding: 0; font-size: 17px; }
.icon-button.tiny { width: 24px; height: 24px; border-color: transparent; background: transparent; color: var(--dim); font-size: 16px; }
.primary-nav, .spaces-list, .pages-list { display: grid; gap: 2px; }
.nav-item { min-width: 0; width: 100%; min-height: 33px; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 11px; }
.nav-item:hover, .space-item:hover, .page-item:hover { background: #17171b; color: var(--text); }
.nav-item.active, .space-item.active, .page-item.active { background: #21192d; color: #eee8f7; }
.nav-glyph { width: 17px; flex: none; color: #a88bce; text-align: center; font-size: 14px; }
.shortcut { margin-left: auto; color: var(--dim); font-size: 9px; }
.nav-section-title { min-height: 28px; display: flex; align-items: center; justify-content: space-between; margin: 12px 5px 3px 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.space-context-title { margin-top: 15px; }
.space-title-button { min-width: 0; flex: 1; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; text-transform: inherit; letter-spacing: inherit; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-title-button:hover { color: var(--text); }
.space-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.space-row .space-item { flex: 1; }
.space-rename { opacity: 0; flex: none; }
.space-row:hover .space-rename, .space-row:focus-within .space-rename, .space-rename:focus-visible { opacity: 1; }
.space-item, .page-item { min-width: 0; width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 11px; }
.space-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--purple-light); }
.page-item .page-glyph { width: 17px; flex: none; color: #a88bce; text-align: center; }
.item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.local-note { display: flex; align-items: center; gap: 7px; padding: 11px 9px 3px; color: var(--dim); font-size: 9px; }
.local-dot { width: 6px; height: 6px; border-radius: 50%; background: #779b82; }
.main-area { min-width: 0; min-height: 0; overflow: auto; background: var(--bg); }
.assistant-panel { display: none; min-width: 0; min-height: 0; flex-direction: column; padding: 17px 14px 16px; border-left: 1px solid var(--line); background: var(--sidebar); overflow: auto; }
.app-body.assistant-open .assistant-panel { display: flex; }
.assistant-heading { min-height: 27px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 12px; font-weight: 500; }
.assistant-title { display: inline-flex; align-items: center; gap: 7px; }
.assistant-intro { display: flex; gap: 9px; padding: 11px; border: 1px solid #362b46; border-radius: 8px; background: #17131e; }
.assistant-spark { color: #c7a8ee; font-size: 14px; }
.assistant-intro strong { color: #e9dff5; font-size: 10px; font-weight: 500; }
.assistant-intro p { margin: 4px 0 0; color: #bab4c1; font-size: 10px; line-height: 1.5; }
.assistant-quick-actions { display: grid; gap: 5px; margin: 10px 0 13px; }
.assistant-quick-actions button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #c3bdc9; cursor: pointer; text-align: left; font-size: 10px; }
.assistant-quick-actions button:hover { border-color: #514163; background: #18151d; color: #e8def3; }
.assistant-messages { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 2px 1px 8px; }
.assistant-message { max-width: 95%; padding: 8px 9px; border-radius: 8px; background: #17171b; color: #c8c4ce; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.assistant-message.user { align-self: flex-end; background: #241a33; color: #e2d5f3; }
.assistant-form { display: flex; align-items: flex-end; gap: 6px; padding: 7px; border: 1px solid #37343c; border-radius: 8px; background: #141417; }
.assistant-form textarea { min-width: 0; flex: 1; resize: vertical; border: 0; outline: none; background: transparent; color: var(--text); font-size: 11px; }
.assistant-form textarea::placeholder { color: var(--dim); }
.assistant-form button { width: 27px; height: 27px; flex: none; border: 0; border-radius: 6px; background: var(--purple); color: #fff; cursor: pointer; font-size: 16px; }
.assistant-footnote { margin: 9px 2px 0; color: var(--dim); font-size: 9px; line-height: 1.4; }
.coming-soon { display: grid; justify-items: start; gap: 8px; margin-top: 8px; padding: 18px 16px; border: 1px solid #362b46; border-radius: 10px; background: #17131e; }
.coming-soon-mark, .coming-soon .assistant-spark { color: #c7a8ee; font-size: 18px; }
.coming-soon h3, .coming-soon strong { margin: 0; color: #efe8f8; font-size: 14px; font-weight: 500; }
.coming-soon p { margin: 0; color: #b7b0c0; font-size: 11px; line-height: 1.55; }

/* Page and document editor */
.pagebar { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.pagebar strong { color: var(--text); font-weight: 500; }
.pagebar-spacer { flex: 1; }
.page-content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 44px) 72px; }
.doc-type { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #bda6df; font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.doc-title-input { width: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: clamp(24px, 3vw, 30px); font-weight: 500; letter-spacing: -.05em; }
.doc-title-input::placeholder { color: #625f67; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; color: var(--dim); font-size: 9px; }
.project-note { width: 100%; min-height: 52px; display: block; margin-top: 8px; padding: 8px 10px; resize: vertical; border: 1px solid #29262f; border-radius: 7px; background: #0d0d10; color: #c9c5cf; font-size: 11px; line-height: 1.6; }
.project-note::placeholder { color: var(--dim); }
.document-rule { height: 1px; margin: 20px 0; background: var(--line-soft); }
.doc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 15px; }
.toolbar-button { min-height: 29px; padding: 0 9px; color: #c9c5cf; font-size: 10px; }
.toolbar-label { margin-right: 4px; color: var(--dim); font-size: 9px; }
.document-blocks { display: grid; gap: 13px; }
.doc-block { position: relative; min-width: 0; padding: 3px 0 24px 28px; }
.block-controls { position: absolute; left: 0; top: 6px; z-index: 2; opacity: 0; }
.block-handle { width: 18px; height: 22px; padding: 0; border: 0; border-radius: 5px; background-color: transparent; background-image: radial-gradient(circle, #7d7786 1.15px, transparent 1.3px); background-size: 6px 6px; background-position: 3px 4px; cursor: grab; }
.block-handle:hover { background-color: #1c1b21; }
.block-handle:active { cursor: grabbing; }
.block-remove { position: absolute; top: 0; right: 0; opacity: 0; width: 24px; height: 24px; border-color: transparent; background: transparent; color: var(--dim); }
.icon-button.block-export { position: absolute; right: 0; bottom: 0; width: auto; min-width: 0; height: 22px; padding: 0 8px; opacity: 0; border-color: transparent; background: transparent; color: var(--dim); font-size: 10px; letter-spacing: .02em; line-height: 22px; white-space: nowrap; }
.doc-block:hover .block-controls, .doc-block:focus-within .block-controls, .doc-block:hover .block-remove, .doc-block:hover .block-export, .block-remove:focus-visible, .block-export:focus-visible, .block-controls:focus-within { opacity: 1; }
.doc-block.dragging { opacity: .45; }
.doc-block.drop-before::before, .doc-block.drop-after::after { content: ""; position: absolute; left: 28px; right: 8px; height: 2px; border-radius: 2px; background: #a182d1; }
.doc-block.drop-before::before { top: -8px; }
.doc-block.drop-after::after { bottom: -8px; }
.text-block { width: 100%; min-height: 43px; padding: 7px 5px; overflow: hidden; resize: none; border: 1px solid transparent; border-radius: 6px; outline: 0; background: transparent; color: #d1ced6; font-size: 12px; line-height: 1.7; field-sizing: content; }
.text-block:hover, .text-block:focus { border-color: #28262d; background: #0d0d10; }
.text-block::placeholder { color: #696670; }
.block-heading { min-height: 34px; color: #ece9ef; font-size: 17px; font-weight: 500; line-height: 1.4; }
.block-subheading { min-height: 31px; color: #e2dee7; font-size: 14px; font-weight: 500; }
.empty-editor { margin-top: 24px; padding: 18px 15px; border: 1px dashed #34313a; border-radius: 8px; color: var(--dim); font-size: 11px; text-align: center; }
.add-block-wrap { position: relative; margin-top: 14px; }
.add-block-button { min-height: 33px; padding: 0 10px; border-color: transparent; background: transparent; color: #9c96a3; font-size: 11px; }
.add-block-button:hover { background: #17171b; color: #e4d7f5; }
.block-menu { position: absolute; z-index: 4; left: 0; top: 36px; width: 220px; display: grid; padding: 6px; border: 1px solid #393640; border-radius: 9px; background: #151518; box-shadow: 0 12px 40px #0009; }
.block-menu[hidden] { display: none; }
.block-menu button { min-height: 34px; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #d6d2db; cursor: pointer; text-align: left; font-size: 11px; }
.block-menu button:hover { background: #242129; }
.block-menu button span { width: 18px; color: var(--purple-light); text-align: center; }
.equation-block, .circuit-block, .molecule-block, .plot-block { padding: 13px; border: 1px solid #2c2a31; border-radius: 8px; background: #0d0d10; }
.block-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #c5b0e2; font-size: 10px; font-weight: 500; }
.block-header-spacer { flex: 1; }
.block-caption { margin-top: 8px; color: var(--dim); font-size: 9px; }
.equation-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.equation-input { min-width: 160px; flex: 1; padding: 9px 11px; border: 1px solid #37343d; border-radius: 6px; background: #141417; color: #f2eef7; font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.var-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.var-input { width: 70px; padding: 7px 8px; border: 1px solid #37343d; border-radius: 6px; background: #141417; color: var(--text); }
.equation-result { min-height: 35px; display: flex; align-items: center; gap: 7px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.equation-result strong { color: #efe7f8; font-family: Georgia, serif; font-size: 15px; font-weight: 500; }
.equation-result.error { color: #e79c98; }
.latex-preview-label { margin-top: 11px; color: #8d8398; font-size: 8px; letter-spacing: .11em; }
.latex-preview { min-height: 43px; display: flex; align-items: center; overflow-x: auto; margin-top: 4px; padding: 8px 11px; border: 1px solid #25232a; border-radius: 6px; background: #0a0a0c; color: #f0eaf6; font-size: 18px; }
.latex-preview:empty::before { content: "Your formatted equation will appear here"; color: #625e68; font: 10px Inter,Arial,sans-serif; }
.latex-preview .katex-display { margin: 0; }
.latex-preview .katex { white-space: nowrap; }
.circuit-tools, .molecule-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.circuit-tools button, .molecule-tools button { min-height: 27px; padding: 0 8px; border: 1px solid #35313a; border-radius: 6px; background: #151419; color: #cfc9d4; cursor: pointer; font-size: 9px; }
.circuit-tools button:hover, .molecule-tools button:hover { border-color: #67517f; background: #201a29; }
.circuit-tools button.active { border-color: #a182d1; background: #2a2036; color: #f0e8fa; }
.schematic-canvas { width: 100%; height: auto; min-height: 240px; display: block; overflow: hidden; border: 1px solid #302d35; border-radius: 7px; background: #0a0a0c; touch-action: none; user-select: none; }
.schematic-canvas[data-tool="select"] { cursor: grab; }
.schematic-canvas[data-tool="select"]:active { cursor: grabbing; }
.schematic-canvas[data-tool="wire"] { cursor: crosshair; }
.schematic-canvas[data-tool="Source"], .schematic-canvas[data-tool="Resistor"], .schematic-canvas[data-tool="Capacitor"], .schematic-canvas[data-tool="Inductor"], .schematic-canvas[data-tool="LED"], .schematic-canvas[data-tool="Ground"] { cursor: copy; }
.sch-part { color: #ddd4e8; cursor: grab; }
.sch-part.selected { color: #e8d6ff; filter: drop-shadow(0 0 4px #a182d188); }
.sch-part:active { cursor: grabbing; }
.sch-pin { fill: #0a0a0c; stroke: #c6a7ee; stroke-width: 1.5; cursor: crosshair; }
.sch-pin.pending { fill: #c6a7ee; }
.sch-label { fill: #9d95a8; font-size: 9px; font-family: ui-monospace, Menlo, monospace; pointer-events: none; }
.sch-wire-hit { fill: none; stroke: transparent; stroke-width: 10; cursor: pointer; }
.sch-wire-line { fill: none; stroke: #b7adc4; stroke-width: 2; pointer-events: none; }
.sch-wire.selected .sch-wire-line { stroke: #d7b8ff; }
.circuit-inspector { min-height: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; color: var(--dim); font-size: 10px; }
.circuit-inspector:empty { display: none; }
.circuit-inspector input { width: 90px; padding: 5px 7px; border: 1px solid #35313a; border-radius: 5px; background: #151419; color: #ddd7e3; font: inherit; }
.circuit-inspector button { min-height: 27px; padding: 0 8px; border: 1px solid #35313a; border-radius: 6px; background: #151419; color: #cfc9d4; cursor: pointer; font-size: 9px; }
.circuit-empty, .molecule-empty { color: var(--dim); font-size: 10px; }
.circuit-summary { margin-top: 10px; color: var(--muted); font-size: 10px; }
.plot-block svg { width: 100%; height: auto; max-height: 250px; display: block; overflow: visible; }
.plot-axes { fill: none; stroke: #57525d; stroke-width: 1; }
.plot-grid { stroke: #26242b; stroke-width: 1; }
.plot-curve { fill: none; stroke: #a182d1; stroke-width: 2; }
.plot-label { fill: #8b8690; font: 10px Inter,Arial,sans-serif; }

/* Board */
.board-page { min-height: 100%; }
.board-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.board-title { min-width: 160px; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 23px; font-weight: 500; letter-spacing: -.04em; }
.shared-badge { padding: 3px 7px; border-radius: 5px; background: #201a29; color: #c7a9ed; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.board-note { width: 100%; display: block; resize: vertical; border: 1px solid transparent; border-radius: 7px; outline: 0; background: transparent; color: #c9c5cf; font-size: 11px; line-height: 1.6; }
.board-note:hover, .board-note:focus, .project-note:hover, .project-note:focus { border-color: #302d35; background: #0d0d10; }
.board-note::placeholder { color: var(--dim); }
.board-summary { min-height: 45px; margin: 8px 0 4px; padding: 8px 10px; }
.board-project-notes { min-height: 78px; margin: 2px 0 16px; padding: 10px; border-color: #29262f; background: #0d0d10; }
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.board-toolbar .toolbar-button { min-height: 28px; font-size: 9px; }
.board-toolbar-spacer { flex: 1; }
.board-table-wrap { width: 100%; overflow-x: auto; container-type: inline-size; }
.board-table { width: 100%; min-width: 520px; border-collapse: collapse; table-layout: fixed; text-align: left; }
.board-table th { padding: 8px 9px; border-bottom: 1px solid #343238; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; font-weight: 500; }
.board-table th:first-child { width: 41%; }
.board-table td { position: relative; height: 44px; padding: 6px 9px; border-bottom: 1px solid #25252a; color: #d2cfd6; font-size: 10px; }
.task-row { transition: background .28s ease; }
.task-row.done td { color: #8c8794; }
.task-strike { position: absolute; left: 38px; top: 50%; z-index: 2; width: calc(100cqw - 56px); height: 1.7px; border-radius: 99px; background: linear-gradient(90deg, #cbb6ee 0%, #8b6cc0 55%, #6d4ea0 100%); pointer-events: none; transform: scaleX(0); transform-origin: left center; opacity: .9; transition: transform .38s cubic-bezier(.22,.8,.28,1), opacity .28s ease; }
.task-row.done .task-strike { transform: scaleX(1); }
.task-cell { display: flex; align-items: center; gap: 8px; }
.task-check { width: 18px; height: 18px; flex: none; display: grid; place-items: center; padding: 0; line-height: 0; border: 1px solid #5a5560; border-radius: 5px; background: transparent; color: #e6d9f8; cursor: pointer; transition: border-color .22s ease, background .22s ease, box-shadow .22s ease; }
.task-check-mark { width: 11px; height: 11px; display: block; opacity: 0; transform: scale(.55); transform-origin: center; transition: opacity .2s ease, transform .28s cubic-bezier(.22,1.2,.36,1); }
.task-check.done { border-color: #8b6cc0; background: #2a1f3a; box-shadow: inset 0 0 0 1px #8b6cc055; }
.task-check.done .task-check-mark { opacity: 1; transform: scale(1); }
.task-title-input { width: 100%; min-width: 0; padding: 4px 5px; border: 1px solid transparent; border-radius: 4px; outline: 0; background: transparent; color: #f0edf3; font-size: 10px; transition: color .28s ease; }
.task-row.done .task-title-input { color: #9a959f; }
.task-title-input:hover, .task-title-input:focus { border-color: #36323b; background: #111114; }
.status-select { width: 100%; max-width: 102px; padding: 5px 7px; border: 0; border-radius: 5px; background: #25202e; color: #c5a8ee; font-size: 9px; }
.status-select[data-status="Needs review"] { background: #302a1d; color: #e0c47f; }
.status-select[data-status="Done"] { background: #1d2a22; color: #a7cbae; }
.status-select[data-status="Not started"] { background: #25252a; color: #b7b4bd; }
.owner-input { width: 100%; max-width: 116px; padding: 5px 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #c9c5ce; font-size: 9px; }
.owner-input:hover, .owner-input:focus { border-color: #36323b; background: #111114; }
.date-trigger { width: 100%; max-width: 132px; min-height: 28px; display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #d5d0dc; cursor: pointer; text-align: left; font-size: 9px; }
.date-trigger svg { width: 12px; height: 12px; flex: none; color: #a990d0; }
.date-trigger.empty { color: #6f6b75; }
.date-trigger:hover, .date-trigger.open { border-color: #4a3d62; background: #16131c; }
.task-delete { opacity: 0; width: 23px; height: 23px; border-color: transparent; background: transparent; color: var(--dim); }
.board-table tr:hover .task-delete, .task-delete:focus-visible { opacity: 1; }
.date-popover { position: fixed; z-index: 40; width: 268px; padding: 12px; border: 1px solid #3d3450; border-radius: 12px; background: #141218; box-shadow: 0 18px 48px #000a, 0 0 0 1px #a182d118; }
.date-popover-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.date-popover-title { flex: 1; color: #efeaf6; text-align: center; font-size: 12px; font-weight: 500; letter-spacing: -.01em; }
.date-nav { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid #322b3f; border-radius: 8px; background: #1b1722; color: #d4c4ea; cursor: pointer; font-size: 16px; }
.date-nav:hover { border-color: #6d55a0; background: #241a33; }
.date-popover-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; color: #8d7aa8; text-align: center; font-size: 9px; letter-spacing: .06em; }
.date-popover-week span { padding: 4px 0; }
.date-popover-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.date-day { width: 100%; aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #e6e1ee; cursor: pointer; font-size: 11px; }
.date-day:hover { background: #241a33; }
.date-day.muted { color: #5c5666; }
.date-day.today:not(.selected) { box-shadow: inset 0 0 0 1px #a587d4; color: #dccaf5; }
.date-day.selected { background: #7655ad; color: #fff; font-weight: 500; }
.date-popover-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid #2a2633; }
.date-foot-button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #b7a4d4; cursor: pointer; font-size: 11px; }
.date-foot-button:hover { background: #1f1a27; }
.date-foot-button.accent { color: #d4c0f0; }
.board-empty { padding: 37px 12px; color: var(--dim); text-align: center; font-size: 11px; }
.add-row { padding: 12px 9px; border: 0; background: transparent; color: #a990d0; cursor: pointer; font-size: 10px; }
.board-workspace-label { margin: 22px 0 0; color: #d9d5de; font-size: 12px; font-weight: 500; }
.add-row:hover { color: #c6a8e8; }

/* Home and workspace views */
.home-view { max-width: 900px; margin: 0 auto; padding: clamp(26px,5vw,58px) clamp(18px,4vw,54px); }
.eyebrow { margin-bottom: 9px; color: #bda6df; text-transform: uppercase; letter-spacing: .11em; font-size: 9px; }
.home-view h1 { margin: 0; font-size: clamp(25px,4vw,33px); font-weight: 500; letter-spacing: -.05em; }
.home-subtitle { max-width: 510px; margin: 9px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 29px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 9px; color: #d9d5de; font-size: 11px; font-weight: 500; }
.recent-list { display: grid; border-top: 1px solid var(--line-soft); }
.recent-row { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 5px 7px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: #d4d0d9; cursor: pointer; text-align: left; }
.recent-row:hover { background: #121215; }
.recent-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: #21192d; color: #c5a7e9; }
.recent-description { min-width: 0; flex: 1; display: grid; gap: 3px; }
.recent-description strong { overflow: hidden; color: var(--text); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.recent-description small { color: var(--dim); font-size: 9px; }
.empty-state { padding: 20px 6px; color: var(--dim); font-size: 10px; }
.search-results { display: grid; gap: 2px; }
.search-result { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 9px; border: 0; border-radius: 6px; background: transparent; color: #d7d3dc; cursor: pointer; text-align: left; }
.search-result:hover { background: #242129; }
.settings-list { display: grid; gap: 8px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); color: #d9d5de; font-size: 11px; }
.settings-row small { display: block; margin-top: 3px; color: var(--dim); font-size: 9px; }
.danger-button { padding: 7px 10px; border-color: #563639; background: #241719; color: #e5a6a2; }

/* Dialogs, menus, feedback */
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: start center; padding: min(18vh,130px) 16px 24px; background: #0009; backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(480px,100%); max-height: min(72vh,650px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #3a3740; border-radius: 12px; background: #151518; box-shadow: 0 24px 80px #000a; }
.modal-header { min-height: 51px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px 0 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; color: #ece9ef; font-size: 13px; font-weight: 500; }
.modal-content { min-height: 0; overflow: auto; padding: 16px 18px 19px; }
.modal-form { display: grid; gap: 12px; }
.field-label { display: grid; gap: 5px; color: #d3cfd8; font-size: 10px; }
.field-input, .field-select, .field-textarea { width: 100%; padding: 9px 10px; border: 1px solid #39363f; border-radius: 6px; background: #101013; color: var(--text); font-size: 11px; }
.field-textarea { min-height: 75px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 4px; }
.helper-copy { color: var(--muted); font-size: 10px; line-height: 1.55; }
.toast-region { position: fixed; z-index: 30; right: 16px; bottom: 16px; display: grid; gap: 8px; }
.toast { max-width: min(360px,calc(100vw - 32px)); padding: 10px 13px; border: 1px solid #403a49; border-radius: 8px; background: #1a171e; color: #eeeaf2; box-shadow: 0 8px 32px #0008; font-size: 11px; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1060px) {
  .app-body { grid-template-columns: 200px minmax(0,1fr); }
  .app-body.assistant-open { grid-template-columns: 200px minmax(0,1fr) minmax(220px, 270px); }
  .app-body.sidebar-collapsed { grid-template-columns: 0 minmax(0,1fr); }
  .app-body.sidebar-collapsed.assistant-open { grid-template-columns: 0 minmax(0,1fr) minmax(220px, 270px); }
  .brand-button { width: 137px; }
}
@media (max-width: 820px) {
  body { overflow: hidden; }
  .app-body { position: relative; grid-template-columns: minmax(0,1fr); }
  .app-body.assistant-open { grid-template-columns: minmax(0,1fr) minmax(200px, 42vw); }
  .app-body.sidebar-collapsed, .app-body.sidebar-collapsed.assistant-open { grid-template-columns: minmax(0,1fr); }
  .app-body.sidebar-collapsed.assistant-open { grid-template-columns: minmax(0,1fr) minmax(200px, 42vw); }
  .sidebar { position: absolute; z-index: 8; inset: 0 auto 0 0; width: min(225px, 86vw); opacity: 1; padding: 13px 10px 9px; border-right: 1px solid var(--line); box-shadow: 12px 0 30px #0007; transform: translateX(-105%); transition: transform .22s ease; pointer-events: auto; }
  .sidebar.open { transform: translateX(0); opacity: 1; }
  .brand-button { width: auto; }
  .crumbs { margin-left: 4px; }
  .assistant-panel { border-left: 1px solid var(--line); }
}
@media (max-width: 540px) {
  .topbar { height: 50px; gap: 6px; padding: 0 8px; }
  .brand-button { gap: 4px; font-size: 15px; }
  .brand-mark { width: 22px; height: 22px; }
  .crumbs { flex: 1; min-width: 0; gap: 6px; font-size: 10px; }
  .save-state { display: none; }
  .quiet-button { min-height: 28px; padding: 0 8px; font-size: 10px; }
  .avatar-button { width: 27px; height: 27px; }
  .pagebar { padding: 0 12px; }
  .page-content { padding: 18px 12px 52px; }
  .board-title { font-size: 21px; }
  .shortcut { display: none; }
  .app-body.assistant-open { grid-template-columns: minmax(0,1fr) minmax(148px, 46vw); }
  .coming-soon { padding: 14px 12px; }
  .doc-block { padding-left: 22px; }
  .board-table { min-width: 460px; }
}
@media (hover: none) {
  .block-controls, .block-remove, .block-export, .task-delete, .space-rename { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }


/* Embedded Desmos, molecule editor, and syntax-colored code blocks */
.desmos-block { overflow: hidden; }
.desmos-calculator { width: 100%; height: min(64vh, 590px); min-height: 390px; overflow: hidden; border: 1px solid #302d35; border-radius: 7px; background: #0d0d10; }
.desmos-loading { min-height: 180px; display: grid; place-items: center; padding: 24px; color: var(--muted); font-size: 11px; text-align: center; }
.chem-canvas { width: 100%; height: auto; min-height: 280px; display: block; overflow: hidden; border: 1px solid #2c2933; border-radius: 8px; background: radial-gradient(120% 90% at 50% 0%, #141218 0%, #0b0b0e 55%); touch-action: none; }
.chem-canvas[data-tool="select"] { cursor: grab; }
.chem-canvas[data-tool="select"]:active { cursor: grabbing; }
.chem-canvas[data-tool="bond"], .chem-canvas[data-tool="double"], .chem-canvas[data-tool="triple"], .chem-canvas[data-tool="element"] { cursor: crosshair; }
.chem-bg { fill: transparent; }
.chem-bond-line { fill: none; stroke: #d5cee0; stroke-width: 2.15; stroke-linecap: round; pointer-events: none; }
.chem-bond-hit { fill: none; stroke: transparent; stroke-width: 10; cursor: pointer; }
.chem-atom { cursor: pointer; }
.chem-hit { fill: transparent; }
.chem-atom.selected { filter: drop-shadow(0 0 5px #a182d1aa); }
.chem-atom text { font: 700 12px/1 ui-sans-serif, system-ui, sans-serif; pointer-events: none; }
.chem-preview { fill: none; stroke: #b79ae0; stroke-width: 2; stroke-dasharray: 4 3; pointer-events: none; }
.chem-sep { width: 1px; align-self: stretch; min-height: 16px; background: #322f38; margin: 0 3px; }
.chem-element { min-width: 26px; }
.code-block { overflow: hidden; border: 1px solid #302d35; border-radius: 8px; background: #101014; }
.code-header { min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border-bottom: 1px solid #29262f; background: #141318; }
.code-mark { color: #b998e0; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-language { padding: 4px 7px; border: 1px solid #35313a; border-radius: 5px; background: #1a181e; color: #d8d1e0; font-size: 10px; color-scheme: dark; }
.code-header-spacer { flex: 1; }
.code-language-note { color: #827c89; font-size: 9px; }
.code-editor { position: relative; min-height: 180px; max-height: 560px; overflow: auto; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.code-highlight, .code-source { box-sizing: border-box; width: 100%; min-height: 180px; margin: 0; padding: 13px 15px; border: 0; font: inherit; line-height: inherit; letter-spacing: normal; tab-size: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-highlight { position: relative; pointer-events: none; background: transparent !important; }
.code-highlight code, .code-highlight code.hljs { display: block; box-sizing: border-box; margin: 0; padding: 0 !important; border: 0; background: transparent !important; font: inherit; line-height: inherit; letter-spacing: normal; white-space: inherit; tab-size: inherit; }
.code-source { position: absolute; inset: 0; height: 100%; resize: vertical; outline: 0; overflow: hidden; background: transparent; color: transparent; caret-color: #f1eafa; -webkit-text-fill-color: transparent; }
.code-source::selection { background: #74539980; -webkit-text-fill-color: transparent; }
.code-source:focus-visible { outline: none; box-shadow: inset 0 0 0 1px #b79ae088; }
@media (max-width: 540px) { .desmos-calculator { min-height: 340px; height: 58vh; } .code-editor { font-size: 11px; } .molecule-tools { gap: 4px; } }

.equation-check { min-height: 36px; padding: 0 12px; border: 1px solid #70558f; border-radius: 6px; background: #261c33; color: #e6d5fa; cursor: pointer; font: inherit; font-size: 10px; }
.equation-check:hover { background: #352444; }
.equation-committed { width: 100%; min-height: 50px; display: block; padding: 8px 4px; border: 0; border-radius: 7px; background: transparent; color: #f1eafa; cursor: text; text-align: left; }
.equation-committed:hover { background: #121115; }
.committed-preview { min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; font-size: 21px; }
.committed-preview:empty::before { content: ""; }
