:root {
  --ink: #17211b;
  --muted: #647069;
  --paper: #f5f7f2;
  --panel: #ffffff;
  --line: #dce2dc;
  --idea: #256d4a;
  --idea-soft: #d9eee2;
  --blocker: #d4563a;
  --blocker-soft: #f8ded7;
  --lime: #c9ef74;
  --violet: #7d6bd8;
  --blue: #4c87b9;
  --gold: #c79235;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input { font: inherit; }
button { color: inherit; }

.primary-button, .secondary-button, .edit-button { min-height: 40px; padding: 8px 15px; border: 1px solid var(--ink); border-radius: 10px; cursor: pointer; font-weight: 700; }
.primary-button { background: var(--ink); color: white; }
.primary-button:hover { background: var(--idea); border-color: var(--idea); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.secondary-button, .edit-button { background: white; }
.secondary-button:hover, .edit-button:hover { border-color: var(--idea); color: var(--idea); }

main { width: min(1540px, 94vw); margin: 0 auto; }
.intro { padding: clamp(42px, 6vw, 84px) 0 42px; display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 8vw, 120px); align-items: end; }
.eyebrow { margin: 0 0 12px; color: var(--idea); font-size: .76rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; max-width: 760px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 6vw, 6rem); font-weight: 400; line-height: .96; letter-spacing: -.05em; }
.lede { max-width: 620px; margin: 0; color: #48534d; font-size: clamp(1.03rem, 1.35vw, 1.28rem); line-height: 1.6; }

.workspace { min-height: 650px; display: grid; grid-template-columns: 245px minmax(440px, 1fr) 310px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 60px rgba(32, 54, 41, .07); }
.controls, .detail { padding: 26px; }
.controls { border-right: 1px solid var(--line); }
.detail { max-height: 645px; overflow-y: auto; border-left: 1px solid var(--line); background: #fbfcfa; }
.search-label, legend, .theme-heading { font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.search-wrap { position: relative; margin-top: 9px; }
.search-wrap svg { position: absolute; width: 18px; left: 13px; top: 50%; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-wrap input { width: 100%; height: 44px; padding: 0 12px 0 40px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--paper); }
.search-wrap input:focus { border-color: var(--idea); box-shadow: 0 0 0 3px rgba(37, 109, 74, .11); }
fieldset { margin: 26px 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 10px; background: var(--paper); }
.segmented button { padding: 7px 4px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: .78rem; }
.segmented button.active { background: white; box-shadow: 0 1px 5px rgba(28, 38, 32, .12); font-weight: 700; }
.theme-heading { display: flex; justify-content: space-between; align-items: center; }
.text-button { padding: 2px; border: 0; background: none; color: var(--idea); cursor: pointer; font-size: .74rem; text-transform: none; letter-spacing: 0; }
.theme-list { margin-top: 11px; display: grid; gap: 5px; }
.theme-button { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: center; padding: 9px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; font-size: .86rem; }
.theme-button:hover, .theme-button.active { background: var(--paper); border-color: var(--line); }
.theme-swatch { width: 8px; height: 8px; border-radius: 3px; background: var(--theme); }
.theme-count { color: var(--muted); font-size: .75rem; }
.stats { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; line-height: 1; }
.stat span { color: var(--muted); font-size: .74rem; }

.map-panel { min-width: 0; display: flex; flex-direction: column; }
.map-key { min-height: 55px; padding: 0 22px; border-bottom: 1px solid var(--line); display: flex; gap: 18px; align-items: center; font-size: .75rem; color: var(--muted); }
.map-key span { display: inline-flex; gap: 6px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.idea-dot { background: var(--idea); }
.blocker-dot { background: var(--blocker); }
.map-key .hint { margin-left: auto; }
.map { position: relative; flex: 1; min-height: 590px; overflow: hidden; background-color: #fcfdfb; background-image: radial-gradient(circle, #d7ddd7 1px, transparent 1px); background-size: 25px 25px; }
#connections { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.connection { stroke: #b7c0ba; stroke-width: 1; opacity: .35; transition: opacity .2s, stroke .2s; }
.connection.active { stroke: var(--ink); opacity: .55; }
.connection.hidden { opacity: 0; }
.node { --size: 17px; position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: var(--size); height: var(--size); padding: 0; border: 3px solid white; border-radius: 50%; transform: translate(-50%, -50%); background: var(--idea); box-shadow: 0 2px 7px rgba(24, 35, 29, .22), 0 0 0 1px var(--idea); cursor: pointer; transition: transform .18s, opacity .18s, box-shadow .18s; }
.node.blocker { background: var(--blocker); box-shadow: 0 2px 7px rgba(24, 35, 29, .22), 0 0 0 1px var(--blocker); }
.node::after { content: attr(aria-label); position: absolute; left: 50%; top: 19px; width: max-content; max-width: 150px; transform: translateX(-50%); padding: 4px 7px; border-radius: 5px; background: rgba(255,255,255,.92); color: var(--ink); font-size: .7rem; font-weight: 650; line-height: 1.2; opacity: 0; pointer-events: none; z-index: 4; }
.node.label-above::after { top: auto; bottom: 19px; }
.node.label-right::after { left: -5px; transform: none; }
.node.label-left::after { right: -5px; left: auto; transform: none; }
.node:hover, .node:focus-visible, .node.selected { z-index: 3; transform: translate(-50%, -50%) scale(1.45); box-shadow: 0 3px 14px rgba(24,35,29,.26), 0 0 0 3px var(--lime); outline: none; }
.node:hover::after, .node:focus-visible::after, .node.selected::after { opacity: 1; }
.node.dim { opacity: .1; pointer-events: none; }
.empty-state { position: absolute; inset: 45% 20px auto; text-align: center; color: var(--muted); }

.detail-empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.detail-empty h2 { margin: 24px 0 5px; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 400; }
.detail-empty p { max-width: 230px; margin: 0; color: var(--muted); font-size: .88rem; }
.orbit { position: relative; width: 82px; height: 82px; border: 1px solid var(--line); border-radius: 50%; }
.orbit::before { content: ""; position: absolute; inset: 18px; border: 1px solid var(--line); border-radius: 50%; }
.orbit i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--idea); }
.orbit i:nth-child(1) { top: 9px; left: 20px; }.orbit i:nth-child(2) { right: 11px; bottom: 20px; background: var(--blocker); }.orbit i:nth-child(3) { left: 28px; bottom: 29px; width: 7px; height: 7px; }
.detail-content { animation: reveal .25s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.detail-type { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--idea-soft); color: var(--idea); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.detail-type.blocker { background: var(--blocker-soft); color: var(--blocker); }
.detail-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.edit-button { min-height: 34px; padding: 5px 11px; font-size: .76rem; }
.detail h2 { margin: 19px 0 11px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 400; line-height: 1.12; }
.detail-description { margin: 0; color: #4f5b54; font-size: .9rem; }
.detail-section { margin-top: 27px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 11px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 8px; border-radius: 6px; background: #edf1ec; font-size: .73rem; }
.related-list { display: grid; gap: 8px; }
.related { width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.related strong { display: block; font-size: .82rem; }
.related span { color: var(--muted); font-size: .72rem; }
.idea-index { margin-top: 4px; }
.index-add-button { width: 100%; margin-bottom: 20px; }
#selection-detail:not(:empty) + .idea-index { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.idea-index-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.idea-index-heading .eyebrow { margin-bottom: 3px; font-size: .67rem; }
.idea-index-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 400; }
.idea-index-heading > span { color: var(--muted); font-size: .75rem; }
.idea-list { display: grid; gap: 4px; }
.idea-list-item { width: 100%; display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; padding: 10px 7px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.idea-list-item:hover, .idea-list-item.active { background: #edf2eb; }
.idea-list-dot { width: 9px; height: 9px; margin-top: 5px; border: 2px solid white; border-radius: 50%; background: var(--idea); box-shadow: 0 0 0 1px var(--idea); }
.idea-list-dot.blocker { background: var(--blocker); box-shadow: 0 0 0 1px var(--blocker); }
.idea-list-copy strong { display: block; font-size: .82rem; line-height: 1.3; }
.idea-list-copy small { color: var(--muted); font-size: .68rem; }

footer { width: min(1540px, 94vw); margin: 22px auto 34px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .76rem; }
footer p { margin: 0; }
code { padding: 2px 5px; border-radius: 4px; background: #e8ece6; }

.idea-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px rgba(20, 33, 25, .26); }
.idea-dialog::backdrop { background: rgba(15, 25, 19, .45); backdrop-filter: blur(3px); }
.idea-form { padding: 28px; }
.dialog-heading { margin-bottom: 24px; }
.dialog-heading .eyebrow { margin-bottom: 6px; }
.dialog-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
.dialog-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.concept-type-fieldset { margin: 0 0 20px; }
.concept-type-fieldset legend { margin-bottom: 7px; }
.concept-type-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.concept-type-options label { position: relative; cursor: pointer; }
.concept-type-options input { position: absolute; opacity: 0; pointer-events: none; }
.concept-type-options span { min-height: 42px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: .86rem; font-weight: 700; }
.concept-type-options input:checked + span { border-color: var(--idea); background: var(--idea-soft); color: var(--idea); box-shadow: 0 0 0 2px rgba(37, 109, 74, .1); }
.concept-type-options label:last-child input:checked + span { border-color: var(--blocker); background: var(--blocker-soft); color: var(--blocker); box-shadow: 0 0 0 2px rgba(212, 86, 58, .1); }
.concept-type-options input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.idea-form > label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.idea-form > input[type="text"] { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); outline: none; }
.idea-form > input[type="text"]:focus { border-color: var(--idea); box-shadow: 0 0 0 3px rgba(37, 109, 74, .11); }
.form-status { min-height: 24px; margin: 8px 0 0; color: var(--blocker); font-size: .84rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 220px 1fr; }
  .detail { grid-column: 1 / -1; min-height: 280px; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  .detail-empty { min-height: 230px; }
}
@media (max-width: 740px) {
  .primary-button, .secondary-button { min-height: 38px; padding: 7px 12px; }
  main { width: 92vw; }.intro { grid-template-columns: 1fr; gap: 22px; }
  .workspace { display: block; }.controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .theme-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }.stats { max-width: 220px; }
  .map-key .hint { display: none; }.map { min-height: 500px; }
  footer { width: 92vw; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
