:root {
  color-scheme: dark;
  --bg: #0b1220;
  --sidebar: #0d1525;
  --surface: #111c2e;
  --surface-raised: #152137;
  --line: #233149;
  --line-soft: #1c2a40;
  --text: #eef2ff;
  --muted: #8f9bb2;
  --faint: #68758d;
  --violet: #a58cff;
  --cyan: #65cfe8;
  --green: #73d4a1;
  --amber: #ecc17a;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --font-display: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font-body);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #a58cff;
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: 238px;
  padding: 27px 16px 20px;
  border-right: 1px solid #1d2a3e;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 6px 43px;
  color: var(--text);
  font: 750 17px var(--font-display);
  letter-spacing: -.6px;
  text-decoration: none;
}

.brand-mark { color: #b09bff; font-size: 25px; line-height: 1; }
.brand-light { color: #a8b3c7; font-weight: 500; }
.side-label { margin: 0 9px 10px; color: #67748d; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.primary-nav { display: grid; gap: 5px; }
.nav-link, .area-link { display: flex; align-items: center; gap: 12px; min-height: 39px; padding: 0 10px; border-radius: 8px; color: #a8b3c7; text-decoration: none; }
.nav-link { font-size: 13px; }
.nav-link > span { width: 16px; color: #8794aa; font-size: 16px; text-align: center; }
.nav-link:hover, .area-link:hover { background: #152137; color: #edf0ff; }
.nav-link.active { background: #1a2540; color: #e8e0ff; font-weight: 600; }
.nav-link.active > span { color: #b39bff; }
.side-divider { height: 1px; margin: 25px 4px 22px; background: var(--line-soft); }
.area-link { width: 100%; border: 0; background: transparent; cursor: pointer; font-size: 12px; text-align: left; }
.area-dot, .legend-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }
.dot-violet, .legend-dot.violet { background: var(--violet); box-shadow: 0 0 8px #a58cff66; }
.dot-cyan, .legend-dot.cyan { background: var(--cyan); box-shadow: 0 0 8px #65cfe866; }
.dot-green, .legend-dot.green { background: var(--green); box-shadow: 0 0 8px #73d4a166; }
.dot-amber, .legend-dot.amber { background: var(--amber); box-shadow: 0 0 8px #ecc17a66; }
.area-count { margin-left: auto; color: #71809a; font-size: 11px; }
.sidebar-bottom { margin-top: auto; padding: 0 8px; }
.privacy-mark { display: flex; align-items: center; gap: 8px; padding: 12px 10px; border: 1px solid #233149; border-radius: 8px; color: #9eabc2; font-size: 11px; }
.privacy-mark span { color: #84c9ad; font-size: 15px; }
.side-version { margin: 17px 3px 0; color: #58657d; font-size: 9px; letter-spacing: .8px; }

.main-content { min-height: 100vh; margin-left: 238px; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; height: 61px; padding: 0 38px; border-bottom: 1px solid #1d2a3e; background: rgb(11 18 32 / 94%); backdrop-filter: blur(14px); }
.breadcrumbs { color: #8693aa; font-size: 12px; }
.breadcrumbs span { padding: 0 9px; color: #54617a; }
.breadcrumbs strong { color: #d3d9e8; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.saved-status { color: #8795ac; font-size: 11px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: #68d29a; box-shadow: 0 0 8px #68d29970; }
.avatar { width: 29px; height: 29px; border: 1px solid #3b3559; border-radius: 50%; background: #28223e; color: #c9baff; font-weight: 700; cursor: default; }
.content-wrap { width: min(1240px, 100%); margin: 0 auto; padding: 38px 38px 26px; }
.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin: 0 0 27px; }
.eyebrow { color: #a998ed; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.eyebrow-star { padding-right: 5px; font-size: 13px; }
h1, h2, p { margin-top: 0; }
h1 { margin: 10px 0 8px; font: 750 clamp(27px, 3vw, 36px)/1.17 var(--font-display); letter-spacing: -1.5px; }
.mobile-break { display: none; }
.welcome-copy { margin: 0; color: #929eb4; font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 650; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: #9d84f5; background: #9479ee; color: #101328; box-shadow: 0 5px 20px #8066df25; }
.button-primary:hover { background: #a28cff; }
.button-subtle { border-color: #2b3a53; background: #17243a; color: #d6def0; }
.button-subtle:hover { border-color: #596883; background: #1c2b43; }

.stats-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; margin-bottom: 31px; }
.stat-card { min-height: 148px; padding: 17px 19px 15px; border: 1px solid #223149; border-radius: 11px; background: linear-gradient(135deg, #121d30, #111a2b); }
.stat-icon { display: grid; width: 27px; height: 27px; margin-bottom: 12px; border-radius: 8px; place-items: center; font-size: 15px; }
.icon-violet { background: #312a4b; color: #b4a0ff; }
.icon-cyan { background: #1d3545; color: #7ed5e8; }
.icon-amber { background: #3a3226; color: #e8c17d; }
.stat-label { color: #8996ac; font-size: 9px; font-weight: 700; letter-spacing: .9px; }
.info-tip { display: inline-grid; width: 13px; height: 13px; margin-left: 3px; border: 1px solid #647189; border-radius: 50%; color: #aeb8c9; font-size: 9px; line-height: 1; place-items: center; cursor: help; }
.stat-value { margin: 4px 0 2px; color: #f0f1fb; font: 750 28px/1.25 var(--font-display); letter-spacing: -.7px; }
.stat-value small { padding-left: 2px; color: #a998ed; font-size: 16px; }
.stat-date { margin-top: 8px; font-size: 22px; }
.progress-track { height: 4px; margin: 11px 0 8px; overflow: hidden; border-radius: 5px; background: #28334a; }
.progress-fill { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9279eb, #c2a8f7); transition: width .4s ease; }
.stat-foot { display: flex; justify-content: space-between; gap: 8px; color: #7e8aa1; font-size: 9px; }
.stat-description { margin-top: 7px; color: #7f8ca4; font-size: 10px; }

.map-section { margin: 0 0 25px; }
.section-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2, .panel-heading h2 { margin: 0; font: 700 16px var(--font-display); letter-spacing: -.3px; }
.section-heading p { margin: 4px 0 0; color: #8491a8; font-size: 11px; }
.map-tools { display: flex; align-items: center; gap: 8px; }
.select-control { min-height: 32px; padding: 0 27px 0 10px; border: 1px solid #2b3a53; border-radius: 7px; background: #121d30; color: #c7d0e1; font-size: 10px; }
.icon-button { display: grid; width: 33px; height: 33px; border: 1px solid #2b3a53; border-radius: 7px; background: #121d30; color: #b9c5db; cursor: pointer; font-size: 18px; place-items: center; }
.icon-button:hover { border-color: #7565b5; color: white; }
.map-card { display: grid; min-height: 408px; grid-template-columns: minmax(0, 1fr) 228px; overflow: hidden; border: 1px solid #25344c; border-radius: 11px; background: #0e1829; }
.map-canvas { position: relative; min-width: 0; min-height: 408px; overflow: hidden; background: radial-gradient(ellipse at 51% 48%, #182341 0%, #101b2d 47%, #0e1829 82%); }
#neural-map { display: block; width: 100%; height: 100%; min-height: 408px; }
.edge { fill: none; stroke: #8090ad; stroke-opacity: .25; stroke-width: 1.15; transition: stroke-opacity .22s ease, stroke-width .22s ease; }
.edge.active { stroke: #b6a2ff; stroke-opacity: .82; stroke-width: 1.8; stroke-dasharray: 5 5; filter: url(#node-glow); animation: signal-flow 1.8s linear infinite; }
.edge.category-link { stroke: #9c8bd6; stroke-opacity: .28; stroke-width: 1; }
.edge.dimmed { stroke-opacity: .06; }
.node-core-glow { fill: url(#core-glow); transform-box: fill-box; transform-origin: center; animation: core-breathe 5s ease-in-out infinite; }
.map-node { cursor: pointer; transition: opacity .2s ease; }
.map-node .node-halo { fill: currentColor; opacity: .12; }
.map-node .node-circle { fill: #111c2e; stroke: currentColor; stroke-width: 1.5; }
.map-node .node-center { fill: currentColor; }
.map-node .node-label { fill: #b9c4d9; font: 10px var(--font-body); pointer-events: none; }
.shared-halo { fill: url(#core-glow); }
.shared-bridge { stroke: #a99aff; stroke-opacity: .8; stroke-width: 1.5; }
.partner-halo { fill: currentColor; opacity: .18; }
.partner-halo.partner-human, .partner-circle.partner-human { color: #ecc17a; }
.partner-halo.partner-assistant, .partner-circle.partner-assistant { color: #b09bff; }
.partner-circle { fill: #111c2e; stroke: currentColor; stroke-width: 1.6; }
.partner-label { fill: #f0d59b; font: 700 8px var(--font-display); }
.assistant-label { fill: #d5caff; }
.map-node:hover .node-halo, .map-node.selected .node-halo { opacity: .25; }
.map-node.selected .node-circle { stroke-width: 2.8; filter: url(#node-glow); }
.map-node.filtered-out { opacity: .09; pointer-events: none; }
.map-legend { position: absolute; bottom: 14px; left: 16px; display: flex; flex-wrap: wrap; gap: 12px; padding: 7px 10px; border: 1px solid #2a3850; border-radius: 7px; background: #111c2dcc; color: #9da9bd; font-size: 9px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 6px; height: 6px; }
.node-detail { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 18px; border-left: 1px solid #25344c; background: #111c2d; }
.detail-empty { max-width: 170px; text-align: center; }
.detail-spark { display: inline-grid; width: 35px; height: 35px; margin-bottom: 13px; border: 1px solid #4f4476; border-radius: 50%; background: #28223d; color: #c0adff; font-size: 20px; place-items: center; }
.detail-empty strong { display: block; color: #e4e8f4; font: 650 12px var(--font-display); }
.detail-empty p { margin: 7px 0 13px; color: #8390a7; font-size: 10px; }
.text-button { padding: 0; border: 0; background: transparent; color: #b09cff; cursor: pointer; font-size: 10px; }
.text-button:hover { color: #d4c9ff; }
.detail-content { width: 100%; }
.detail-category { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--detail-color); font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.detail-title { margin: 0 0 10px; color: #f0f2fa; font: 650 15px/1.45 var(--font-display); overflow-wrap: anywhere; }
.detail-note { margin: 0 0 14px; color: #a1acc0; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-meta { padding-top: 11px; border-top: 1px solid #2a374e; color: #7e8ba2; font-size: 9px; }
.detail-actions { display: flex; justify-content: space-between; margin-top: 14px; }
.delete-idea { padding: 4px 0; border: 0; background: none; color: #cf8e98; cursor: pointer; font-size: 10px; }
.delete-idea:hover { color: #ffb2bf; }
.map-caption { display: flex; align-items: center; gap: 7px; margin: 9px 2px 0; color: #73819a; font-size: 9px; }
.caption-pulse { width: 6px; height: 6px; border-radius: 50%; background: #a691ff; box-shadow: 0 0 8px #a691ff; }

.bottom-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.panel { min-width: 0; padding: 18px 19px; border: 1px solid #223149; border-radius: 11px; background: #111b2c; }
.panel-heading { align-items: flex-start; margin-bottom: 13px; }
.panel-kicker { display: block; margin-bottom: 5px; color: #828fa6; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.panel-heading h2 { font-size: 14px; }
.idea-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.idea-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 0; border-top: 1px solid #202d42; cursor: pointer; }
.idea-row:hover .idea-title { color: #d0c1ff; }
.idea-row:first-child { border-top: 0; }
.idea-marker { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--row-color); box-shadow: 0 0 8px color-mix(in srgb, var(--row-color) 55%, transparent); }
.idea-main { min-width: 0; flex: 1; }
.idea-title { display: block; overflow: hidden; color: #dce2ef; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.idea-sub { display: block; margin-top: 2px; color: #7d8aa1; font-size: 9px; }
.idea-arrow { flex: 0 0 auto; color: #64718a; }
.empty-list { padding: 15px 0; color: #8c99af; font-size: 11px; }
.empty-list button { margin-left: 4px; }
.growth-panel { position: relative; overflow: hidden; }
.growth-panel .panel-heading { position: relative; z-index: 1; }
.growth-panel .panel-heading h2 { max-width: 240px; line-height: 1.4; }
.growth-visual { position: relative; display: grid; height: 105px; margin: 5px 0 0; overflow: hidden; place-items: center; }
.growth-orbit { position: absolute; display: block; width: 240px; height: 64px; border: 1px solid #564b80; border-radius: 50%; transform: rotate(-15deg); }
.orbit-two { width: 160px; height: 108px; border-color: #365967; transform: rotate(43deg); }
.growth-seed { z-index: 1; display: grid; width: 44px; height: 44px; border: 1px solid #8a76ce; border-radius: 50%; background: radial-gradient(circle, #443a69, #211d37); box-shadow: 0 0 28px #a28aff3d; color: #c0adff; font-size: 24px; place-items: center; }
.growth-leaf { position: absolute; z-index: 2; color: #77d3ae; }
.leaf-one { top: 17px; right: 29%; font-size: 12px; }
.leaf-two { bottom: 17px; left: 31%; color: #7ccfe4; font-size: 10px; }
.growth-note { position: relative; z-index: 1; max-width: 420px; margin: 0 0 13px; color: #8996ac; font-size: 10px; }
.growth-panel .button { min-height: 31px; font-size: 10px; }
.footer-note { display: flex; justify-content: space-between; gap: 14px; padding: 19px 2px 4px; color: #65738b; font-size: 9px; }

.evaluation-section { margin: 28px 0 5px; scroll-margin-top: 78px; }
.evaluation-section > .section-heading { margin-bottom: 14px; }
.evaluation-tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #294a43; border-radius: 99px; background: #142a2b; color: #98d4b5; font-size: 9px; white-space: nowrap; }
.evaluation-tag .status-dot { margin: 0; }
.evaluation-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(255px, .65fr); gap: 14px; align-items: start; }
.evaluation-form { display: block; }
.evaluation-intro { padding-bottom: 12px; border-bottom: 1px solid #26344b; }
.evaluation-intro .panel-kicker { color: #b3a0f6; }
.evaluation-intro p { max-width: 720px; margin: 5px 0 0; color: #929fb4; font-size: 11px; }
.model-label { display: block; margin: 13px 0 6px; color: #cbd4e4; font-size: 10px; font-weight: 650; }
.model-label span { color: #77859d; font-weight: 400; }
.evaluation-input { width: 100%; padding: 9px 10px; border: 1px solid #34435d; border-radius: 7px; background: #0d1728; color: #edf1fb; font-size: 10px; }
.evaluation-input::placeholder { color: #68758b; }
textarea.evaluation-input { resize: vertical; }
.test-list { display: grid; gap: 7px; margin-top: 13px; }
.test-card { display: grid; grid-template-columns: 27px minmax(0, 1fr) 110px; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #26354d; border-radius: 8px; background: #0f192a; }
.test-index { display: grid; width: 24px; height: 24px; border-radius: 7px; background: #27233e; color: #bcaaff; font: 700 9px var(--font-display); place-items: center; }
.test-copy { min-width: 0; }
.test-copy h3 { margin: 0 0 2px; color: #e0e6f2; font: 650 10px var(--font-display); }
.test-copy p { margin: 0; color: #8390a5; font-size: 9px; line-height: 1.4; }
.test-score { min-height: 31px; width: 100%; padding: 0 7px; border: 1px solid #34435d; border-radius: 6px; background: #142036; color: #cad3e3; font-size: 9px; }
.evaluation-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }
.evaluation-actions > span { max-width: 240px; color: #8290a6; font-size: 9px; }
.evaluation-actions .button { min-height: 34px; flex: 0 0 auto; font-size: 10px; }
.evaluation-disclaimer { margin: 12px 0 0; color: #76839a; font-size: 9px; }
.history-panel { position: sticky; top: 78px; }
.session-count { display: grid; min-width: 23px; height: 23px; padding: 0 6px; border: 1px solid #394660; border-radius: 99px; color: #c5cde0; font-size: 9px; place-items: center; }
.no-evaluation { padding: 17px 7px 20px; text-align: center; }
.no-evaluation .detail-spark { margin-bottom: 10px; }
.no-evaluation strong { display: block; color: #e0e6f2; font: 650 12px var(--font-display); }
.no-evaluation p { margin: 7px auto 0; max-width: 260px; color: #8794aa; font-size: 10px; }
.evaluation-result { display: flex; align-items: center; gap: 13px; padding: 4px 0 12px; }
.evaluation-score { display: flex; align-items: baseline; justify-content: center; min-width: 65px; color: #b9a6ff; font: 750 27px var(--font-display); }
.evaluation-score small { font-size: 12px; }
.evaluation-summary { min-width: 0; }
.evaluation-summary strong { color: #e1e7f3; font: 650 10px var(--font-display); }
.evaluation-summary p { margin: 3px 0 2px; color: #8c99af; font-size: 9px; }
.evaluation-model { display: block; overflow: hidden; color: #a59acb; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.evaluation-track { height: 4px; overflow: hidden; border-radius: 5px; background: #28334a; }
.evaluation-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9479ee, #72d2aa); transition: width .35s ease; }
.evaluation-history { display: grid; max-height: 260px; gap: 0; overflow-y: auto; margin: 12px 0 0; padding: 0; list-style: none; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px 0; border-top: 1px solid #26344b; }
.history-main { display: grid; min-width: 0; gap: 2px; }
.history-main strong { color: #d8dfed; font-size: 9px; font-weight: 600; }
.history-main span { overflow: hidden; color: #7f8ca3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.history-score { flex: 0 0 auto; color: #b7a3ff; font: 700 12px var(--font-display); }
.history-note { flex-basis: 100%; margin: 0; color: #8a97ac; font-size: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-row:has(.history-note) { flex-wrap: wrap; }

.chat-section { margin: 30px 0 8px; scroll-margin-top: 78px; }
.chat-section > .section-heading { margin-bottom: 7px; }
.chat-disclaimer, .memory-intro { color: #8794aa; font-size: 10px; }
.chat-disclaimer { margin: 0 0 13px; }
.chat-login { max-width: 510px; }
.chat-login label, .memory-form label, .chat-form > label:not(.sr-only) { display: block; margin: 0 0 6px; color: #cbd4e4; font-size: 10px; font-weight: 650; }
.login-row { display: flex; gap: 9px; }
.login-row input, .memory-form input, .memory-form textarea, .chat-form textarea {
  width: 100%;
  min-height: 39px;
  padding: 9px 10px;
  border: 1px solid #34435d;
  border-radius: 7px;
  background: #0d1728;
  color: #edf1fb;
  font-size: 12px;
}
.login-row input { min-width: 0; flex: 1; }
.chat-workspace[hidden], .chat-error[hidden] { display: none; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.provider-status { margin: 0; color: #92a0b6; font-size: 10px; }
.provider-status.is-warning { color: #ecc17a; }
.chat-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.chat-toolbar-actions .button { min-height: 33px; font-size: 10px; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(245px, .65fr); gap: 14px; align-items: start; }
.conversation-panel, .memory-panel { min-height: 350px; }
.conversation-panel h3, .memory-panel h3 { margin: 0; font: 700 14px var(--font-display); }
.chat-messages { display: flex; min-height: 190px; max-height: 460px; flex-direction: column; gap: 10px; overflow-y: auto; margin: 0 0 13px; padding: 4px 2px 12px; list-style: none; }
.chat-empty { max-width: 360px; margin: auto; color: #8794aa; font-size: 11px; text-align: center; }
.chat-message { max-width: 88%; padding: 10px 12px; border: 1px solid #293750; border-radius: 10px; background: #0f192a; }
.chat-message.user { align-self: flex-end; border-color: #514774; background: #211e36; }
.chat-message.assistant { align-self: flex-start; }
.chat-message-label { display: block; margin-bottom: 4px; color: #b6a5f5; font-size: 9px; font-weight: 700; }
.chat-message.user .chat-message-label { color: #a4cfe0; }
.chat-message-content { margin: 0; color: #dce3f0; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message-time { display: block; margin-top: 5px; color: #718099; font-size: 8px; text-align: right; }
.chat-form { padding-top: 12px; border-top: 1px solid #26344b; }
.chat-form .select-control { width: 100%; min-height: 35px; margin-bottom: 10px; font-size: 11px; }
.chat-form textarea { display: block; min-height: 76px; resize: vertical; }
.chat-form textarea::placeholder, .memory-form textarea::placeholder { color: #68758b; }
.chat-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.chat-form-footer > span { color: #74819a; font-size: 9px; }
.chat-form-footer .button { min-height: 34px; font-size: 10px; }
.chat-error { margin: 9px 0 0; color: #f1a7a7; font-size: 10px; }
.memory-intro { margin: -3px 0 12px; }
.memory-form { padding-bottom: 13px; border-bottom: 1px solid #26344b; }
.memory-form input, .memory-form textarea { margin-bottom: 9px; }
.memory-form textarea { min-height: 66px; resize: vertical; }
.memory-form .button { min-height: 33px; font-size: 10px; }
.memory-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.memory-empty { color: #77849b; font-size: 10px; }
.memory-item { min-width: 0; padding: 10px; border: 1px solid #26344b; border-radius: 8px; background: #0f192a; }
.memory-item h4 { margin: 0 0 5px; color: #e0e6f2; font: 650 11px var(--font-display); overflow-wrap: anywhere; }
.memory-item p { margin: 0; color: #8e9bb0; font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-item-actions { display: flex; gap: 12px; margin-top: 8px; }
.memory-item-actions button { padding: 0; border: 0; background: transparent; color: #b6a5f5; cursor: pointer; font-size: 9px; }
.memory-edit { display: grid; gap: 7px; margin-top: 9px; }
.memory-edit input, .memory-edit textarea { width: 100%; padding: 8px; border: 1px solid #34435d; border-radius: 6px; background: #0d1728; color: #edf1fb; font: inherit; font-size: 10px; }
.memory-edit textarea { min-height: 62px; resize: vertical; }
.memory-edit-actions { display: flex; gap: 12px; }
.memory-edit-actions button { padding: 0; border: 0; background: transparent; color: #b6a5f5; cursor: pointer; font-size: 9px; }

.idea-dialog { width: min(460px, calc(100% - 28px)); padding: 0; border: 1px solid #374661; border-radius: 14px; background: #121d30; color: var(--text); box-shadow: 0 24px 100px #000a; }
.idea-dialog::backdrop { background: #060b14bb; backdrop-filter: blur(4px); }
.idea-dialog form { padding: 23px; }
.dialog-topline { display: flex; align-items: center; justify-content: space-between; }
.dialog-topline .eyebrow { font-size: 9px; }
.close-button { width: 28px; height: 28px; border: 1px solid #34425a; border-radius: 7px; background: #17243a; color: #acb7ca; cursor: pointer; font-size: 19px; line-height: 1; }
.idea-dialog h2 { margin: 12px 0 5px; font: 700 20px var(--font-display); }
.dialog-copy { margin: 0 0 17px; color: #8f9cb2; font-size: 11px; }
.idea-dialog label { display: block; margin: 13px 0 6px; color: #cbd4e4; font-size: 10px; font-weight: 600; }
.idea-dialog input, .idea-dialog select, .idea-dialog textarea { width: 100%; padding: 10px 11px; border: 1px solid #34435d; border-radius: 7px; background: #0d1728; color: #edf1fb; font-size: 11px; }
.idea-dialog input::placeholder, .idea-dialog textarea::placeholder { color: #66748d; }
.idea-dialog textarea { resize: vertical; }
.input-hint { display: flex; justify-content: space-between; margin-top: 4px; color: #74819a; font-size: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.dialog-actions .button { min-height: 35px; font-size: 10px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(360px, calc(100vw - 32px)); padding: 11px 15px; border: 1px solid #4a5b70; border-radius: 9px; background: #1b2a3f; color: #e1e9f5; box-shadow: 0 10px 35px #0005; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@keyframes core-breathe {
  0%, 100% { transform: scale(.92); opacity: .72; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes signal-flow {
  to { stroke-dashoffset: -20; }
}

@media (min-width: 1500px) {
  .content-wrap { padding-right: 54px; padding-left: 54px; }
  .map-card, .map-canvas, #neural-map { min-height: 450px; }
}

@media (max-width: 1100px) {
  .sidebar { width: 208px; }
  .main-content { margin-left: 208px; }
  .content-wrap { padding-right: 25px; padding-left: 25px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .map-card { grid-template-columns: minmax(0, 1fr) 196px; }
  .node-detail { padding: 14px; }
  .map-legend { gap: 8px; }
}

@media (max-width: 820px) {
  .sidebar { width: 64px; align-items: center; padding-right: 8px; padding-left: 8px; }
  .brand { margin: 2px 0 38px; }
  .brand > span:last-child, .side-label, .nav-link:not(.active), .nav-link.active { font-size: 0; }
  .brand > span:last-child { display: none; }
  .brand-mark { font-size: 25px; }
  .primary-nav { width: 100%; }
  .nav-link { justify-content: center; width: 45px; height: 42px; padding: 0; margin: auto; font-size: 0 !important; }
  .nav-link > span { font-size: 18px; }
  .side-divider { width: 100%; margin: 22px 0 12px; }
  .area-link { justify-content: center; width: 42px; height: 38px; min-height: 38px; padding: 0; font-size: 0; }
  .area-count, .sidebar-bottom { display: none; }
  .main-content { margin-left: 64px; }
  .map-card { grid-template-columns: minmax(0, 1fr) 180px; }
  .bottom-grid { grid-template-columns: 1fr; }
  .growth-panel { min-height: 220px; }
  .evaluation-layout { grid-template-columns: 1fr; }
  .history-panel { position: static; }
  .chat-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 51px; padding: 0 14px; }
  .saved-status { font-size: 0; }
  .status-dot { width: 7px; height: 7px; margin: 0; }
  .topbar-right { gap: 12px; }
  .content-wrap { padding: 25px 14px 22px; }
  .welcome-row { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 19px; }
  h1 { font-size: 29px; }
  .mobile-break { display: none; }
  .welcome-copy { max-width: 300px; font-size: 12px; }
  .welcome-row .button { min-height: 36px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 24px; }
  .stat-card { min-height: 131px; padding: 13px; }
  .stat-card:first-child { grid-column: 1 / -1; min-height: 135px; }
  .stat-icon { width: 24px; height: 24px; margin-bottom: 9px; font-size: 13px; }
  .stat-value { font-size: 24px; }
  .stat-date { font-size: 18px; }
  .stat-label { font-size: 8px; }
  .stat-foot { font-size: 8px; }
  .stat-description { font-size: 9px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .chat-toolbar { align-items: flex-start; flex-direction: column; }
  .chat-toolbar-actions { width: 100%; justify-content: space-between; }
  .map-tools { width: 100%; }
  .select-control { flex: 1; }
  .map-card { grid-template-columns: 1fr; }
  .map-canvas, #neural-map { min-height: 330px; }
  #neural-map { height: 330px; }
  .node-detail { min-height: 132px; border-top: 1px solid #25344c; border-left: 0; }
  .detail-empty { max-width: 280px; }
  .detail-empty p { margin-bottom: 8px; }
  .map-legend { right: 8px; bottom: 8px; left: 8px; justify-content: center; gap: 7px 10px; padding: 6px; font-size: 8px; }
  .map-legend span { gap: 4px; }
  .bottom-grid { gap: 10px; }
  .panel { padding: 15px; }
  .footer-note { flex-direction: column; gap: 5px; font-size: 8px; }
  .idea-dialog form { padding: 18px; }
  .test-card { grid-template-columns: 25px minmax(0, 1fr); gap: 8px; }
  .test-score { grid-column: 2; width: 100%; }
  .evaluation-actions { align-items: flex-start; flex-direction: column; }
  .chat-message { max-width: 96%; }
  .login-row { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
