:root {
  --bg: #0b0f19;
  --bg-soft: #111726;
  --bg-elev: #161d2f;
  --line: #232c42;
  --text: #e8ecf6;
  --text-dim: #8e9ab7;
  --accent: #6ea8fe;
  --accent-2: #a78bfa;
  --concept: #a78bfa;
  --product: #34d3b5;
  --rising: #fbbf24;
  --rising-2: #f97316;
  --danger: #f87171;
  --radius: 12px;
  --panel-w: 320px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(1200px 700px at 50% -10%, #16203a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------------------------------------------ 로그인 */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: min(340px, 100%);
  background: rgba(17, 23, 38, 0.85);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
}

.login-note {
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}

.login-box form {
  display: grid;
  gap: 14px;
}

.login-box label {
  display: grid;
  gap: 6px;
}

.login-box label span {
  font-size: 11.5px;
  color: var(--text-dim);
}

.login-box input {
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.login-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.16);
}

.login-box button {
  margin-top: 4px;
  padding: 11px;
  font-size: 14px;
}

.login-error {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: #fca5a5;
  line-height: 1.55;
}

.login-error[hidden] {
  display: none;
}

/* 상단바의 로그아웃 */
.who {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-dim);
  padding-left: 4px;
  border-left: 1px solid var(--line);
  margin-left: 2px;
}

.who b {
  color: #b9c4de;
  font-weight: 600;
}

.who button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 2px;
}

.who button:hover {
  color: var(--danger);
}

/* ------------------------------------------------------------------ 상단바 */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: rgba(11, 15, 25, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.brand:hover {
  background: var(--bg-soft);
}

.brand-mark {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.search {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 620px;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder {
  color: #61708f;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.16);
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn,
.select {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:hover,
.select:hover {
  background: var(--bg-elev);
  border-color: #33405e;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-primary {
  background: linear-gradient(180deg, #4f8ff7, #3b73d6);
  border-color: #3b73d6;
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #5f9bff, #4680e4);
}

.btn-mini {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: var(--accent);
  margin: 0;
}

.toggle:has(input:checked) {
  color: var(--text);
  border-color: #33405e;
}

/* ------------------------------------------------------------------ 무대 */

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.canvas.is-panning {
  cursor: grabbing;
}

.hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-dim);
  pointer-events: none;
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.hint strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.hint[hidden] {
  display: none;
}

/* 지도 보관함 (시작 화면) */
.resume {
  pointer-events: auto;
  margin-top: 16px;
  max-width: 620px;
}

.resume[hidden] {
  display: none;
}

.map-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}

.map-item {
  display: flex;
  align-items: stretch;
  border: 1px solid #2f4a7a;
  background: rgba(35, 52, 90, 0.45);
  border-radius: 11px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.map-item:hover {
  border-color: var(--accent);
}

.map-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: #c3cde4;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}

.map-open b {
  color: var(--text);
  font-weight: 600;
}

.map-open span {
  font-size: 10.5px;
  color: #61708f;
}

.map-del {
  background: none;
  border: none;
  border-left: 1px solid #2a3a5e;
  color: #61708f;
  padding: 0 9px;
  cursor: pointer;
  font-size: 12px;
}

.map-del:hover {
  color: var(--danger);
}

.trending {
  pointer-events: auto;
  margin-top: 18px;
  max-width: 620px;
}

.trending[hidden] {
  display: none;
}

.trending-title {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: #61708f;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.trending-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: #c3cde4;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, transform 0.12s;
}

.chip:hover {
  border-color: var(--rising);
  color: var(--rising);
  transform: translateY(-1px);
}

.chip .chip-traffic {
  color: #61708f;
  font-size: 10.5px;
  margin-left: 5px;
}

/* 트렌드 칩에 마우스를 올리면 관련 뉴스 제목을 보여 준다 */
.trend-preview {
  margin-top: 10px;
  min-height: 34px;
  font-size: 12px;
  line-height: 1.45;
  color: #8e9ab7;
  word-break: keep-all;
}

.trend-preview b {
  color: #c3cde4;
  font-weight: 600;
  margin-right: 6px;
}

.legend {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(17, 23, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-root {
  background: var(--accent);
}
.dot-concept {
  background: var(--concept);
}
.dot-product {
  background: var(--product);
}
.dot-suggest {
  background: #4a5b80;
}
.dot-rising {
  background: var(--rising);
}

.status {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(22, 29, 47, 0.95);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.status[hidden] {
  display: none;
}

.status.is-error {
  border-color: var(--danger);
  color: #fca5a5;
}

.status-stop {
  pointer-events: auto;
  border: 1px solid #4a3050;
  background: #2a1b2e;
  color: #f0a0b0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  margin-left: 2px;
}

.status-stop:hover {
  border-color: var(--danger);
  color: #fca5a5;
}

.status-stop[hidden] {
  display: none;
}

.status .spin {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(110, 168, 254, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ 그래프 */

.link {
  fill: none;
  stroke: #2b3555;
  stroke-linecap: round;
  transition: stroke 0.18s, opacity 0.18s;
  opacity: 0.75;
}

.link.to-concept {
  stroke: #3d3266;
}

.link.is-active {
  stroke: var(--accent);
  opacity: 1;
}

.node {
  cursor: pointer;
}

/* ---- 확대율에 따른 표시 수준 ----
   멀리서 보면 깊은 노드는 점으로 접히고, 다가가면 글자가 나타난다.
   노드가 150개를 넘으면 전체 보기에서 글자가 3px 이 되어 아무 의미가 없기 때문이다. */

.node-inner {
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.canvas.zoom-far .node.depth-3 .node-inner,
.canvas.zoom-far .node.depth-4 .node-inner {
  transform: scale(0.42);
  opacity: 0.62;
}

.canvas.zoom-far .node.depth-3 .node-label,
.canvas.zoom-far .node.depth-4 .node-label,
.canvas.zoom-mid .node.depth-4 .node-label {
  display: none;
}

.canvas.zoom-mid .node.depth-4 .node-inner {
  transform: scale(0.66);
  opacity: 0.8;
}

/* 선택했거나 경로에 걸린 노드는 축소 상태에서도 끝까지 보여 준다 */
.canvas .node.is-selected .node-inner,
.canvas .node.is-path .node-inner {
  transform: none;
  opacity: 1;
}

.canvas .node.is-selected .node-label,
.canvas .node.is-path .node-label {
  display: block;
}

.node-bg {
  fill: var(--bg-elev);
  stroke: #2c3755;
  stroke-width: 1.2;
  transition: fill 0.15s, stroke 0.15s;
}

.node-label {
  fill: var(--text);
  font-family: inherit;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}

.node:hover .node-bg {
  fill: #1d2740;
  stroke: var(--accent);
}

.node.is-path .node-bg {
  stroke: #4a6ba8;
}

.node.is-selected .node-bg {
  fill: #23345a;
  stroke: var(--accent);
  stroke-width: 2;
}

.node.is-root .node-bg {
  fill: #2a3f6d;
  stroke: var(--accent);
  stroke-width: 2;
}

/* 여러 단어를 한 지도에 놓을 때 가운데에 서는 이름표 */
.node.kind-group .node-bg {
  fill: #1b2338;
  stroke: #3d4a6b;
  stroke-dasharray: 4 3;
}

.node.kind-group .node-label {
  fill: #8e9ab7;
  font-weight: 600;
}

/* 여러 단어 모드에서 각 시작 단어 */
.node.kind-seed:not(.is-root) .node-bg {
  fill: #23345a;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.node.kind-seed:not(.is-root) .node-label {
  fill: #dbe7ff;
  font-weight: 700;
}

.node.is-root .node-label {
  font-weight: 700;
}

.node.depth-1 .node-label {
  fill: #dbe3f5;
}
.node.depth-2 .node-label,
.node.depth-3 .node-label,
.node.depth-4 .node-label {
  fill: #b9c4de;
}

/* 개념 노드(클로드가 만든 축·소재)와 검색어 노드를 색으로 구분한다 */
.node.kind-concept .node-bg {
  fill: #241f3c;
  stroke: #473a75;
}

.node.kind-concept .node-label {
  fill: #dcd2f7;
  font-weight: 600;
}

.node.kind-concept:hover .node-bg {
  fill: #2e2750;
  stroke: var(--concept);
}

.node.kind-concept.is-path .node-bg {
  stroke: #6b58ab;
}

.node.kind-concept.is-selected .node-bg {
  fill: #382c63;
  stroke: var(--concept);
  stroke-width: 2;
}

/* 브랜드가 이미 팔고 있는 제품 — 레퍼런스라 새 아이디어와 구분되어야 한다 */
.node.kind-product .node-bg {
  fill: #14312e;
  stroke: #2f6b5f;
  stroke-dasharray: 3 2;
}

.node.kind-product .node-label {
  fill: #a7ded1;
}

.node.kind-product:hover .node-bg {
  fill: #1b423d;
  stroke: var(--product);
}

.node.kind-product.is-selected .node-bg {
  fill: #1d4b44;
  stroke: var(--product);
  stroke-width: 2;
}

.link.to-product {
  stroke: #2a4d47;
}

.node.is-rising .node-bg {
  stroke: var(--rising);
}

.node.is-rising .node-label {
  fill: #fde68a;
}

.node-spinner {
  fill: var(--accent);
  opacity: 0;
}

.node.is-loading .node-spinner {
  opacity: 1;
  animation: pulse 0.9s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
    r: 3;
  }
  50% {
    opacity: 1;
    r: 5;
  }
}

/* ------------------------------------------------------------------ 패널 */

.panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--panel-w);
  background: rgba(13, 18, 31, 0.92);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease;
  z-index: 5;
}

.panel.is-collapsed {
  transform: translateX(100%);
}

.panel-toggle {
  position: absolute;
  left: -28px;
  top: 14px;
  width: 28px;
  height: 40px;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: rgba(13, 18, 31, 0.92);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.panel.is-collapsed .panel-toggle {
  transform: rotate(180deg);
  border-radius: 0 10px 10px 0;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

/* 브랜드 프로필 카드 */
.brand-card[hidden] {
  display: none;
}

.brand-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.brand-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.brand-head a {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
}

.brand-head a:hover {
  color: var(--accent);
}

.brand-what {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #c3cde4;
  word-break: keep-all;
}

.brand-rows {
  display: grid;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #a9b5cf;
}

.brand-rows b {
  color: #61708f;
  font-weight: 600;
  font-size: 10.5px;
  margin-right: 6px;
}

/* 이 목록이 어디서 왔는지 — 지어낸 게 아니라는 표시 */
.brand-rows em {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-style: normal;
  color: #4fbfa8;
}

.brand-warn {
  margin: 8px 0 0;
  font-size: 11px;
  color: #fbbf24;
  line-height: 1.5;
}

.panel-empty,
.board-empty {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 0;
}

.detail-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  word-break: keep-all;
  line-height: 1.35;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.badge.is-score {
  color: var(--accent);
  border-color: #2f4a7a;
}

.badge.is-concept {
  color: #cdbdfb;
  border-color: #4b3d7d;
  background: #241f3c;
}

.detail-query {
  font-size: 12.5px;
  color: #c3cde4;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  margin: 0 0 12px;
  line-height: 1.5;
  word-break: keep-all;
}

.detail-query span {
  display: block;
  font-size: 10.5px;
  color: #61708f;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

.badge.is-rising {
  color: #fde68a;
  border-color: #7c5a12;
  background: #2a2110;
}

.detail-path {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0 0 12px;
  word-break: break-all;
}

.detail-path b {
  color: #b9c4de;
  font-weight: 500;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ------------------------------------------------ 아이디어 뽑기 */

.idea-launch {
  padding-bottom: 12px;
}

.btn-idea {
  width: 100%;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #7c5cf0, #b06ae0);
  box-shadow: 0 4px 14px rgba(124, 92, 240, 0.25);
}

.btn-idea:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b6dfb, #bd79ea);
}

.btn-idea:disabled {
  background: var(--bg-elev);
  color: var(--text-dim);
  box-shadow: none;
}

.idea-sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.idea-hint {
  margin: 0;
  flex: 1;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* 디자인 시트는 아이디어 시트 위에 뜬다 (뒤로 돌아갈 수 있게) */
#design-sheet {
  z-index: 60;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sheet[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(3px);
}

.sheet-body {
  position: relative;
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  font-size: 15px;
}

.sheet-sub {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
}

.sheet-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* 방향을 지시하고 다시 뽑는 줄 */
.sheet-tools {
  display: flex;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 23, 38, 0.5);
}

.sheet-tools input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

.sheet-tools input:focus {
  border-color: var(--accent);
}

.sheet-tools input::placeholder {
  color: #56658a;
}

.sheet-content {
  overflow-y: auto;
  padding: 16px 18px 20px;
  display: grid;
  gap: 12px;
}

.sheet-content::-webkit-scrollbar {
  width: 9px;
}
.sheet-content::-webkit-scrollbar-thumb {
  background: #253052;
  border-radius: 8px;
}

.idea-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
}

.idea-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.idea-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #e6e0ff;
}

.badge-first {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #3a2f10;
  border: 1px solid #7c5a12;
  color: #fde68a;
  white-space: nowrap;
  align-self: center;
}

/* 실제 검색 데이터로 확인한 수요 신호 */
.idea-signal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  margin-bottom: 10px;
}

.idea-signal.s-strong {
  border-color: #2e5f43;
  color: #9ddcb1;
  border-style: solid;
}

.idea-signal.s-weak {
  border-color: #5a5230;
  color: #d9c98a;
  border-style: solid;
}

.idea-signal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.idea-signal a:hover {
  color: var(--accent);
}

.idea-star {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.idea-star:hover,
.idea-star.is-on {
  color: var(--rising);
}

.idea-chip.is-link {
  cursor: pointer;
}

.idea-chip.is-link:hover {
  border-color: var(--accent);
  color: #bcd3ff;
}

.board-item.is-idea span {
  cursor: default;
}

.board-item.is-idea span:hover {
  color: inherit;
}

.idea-pitch {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: keep-all;
}

.idea-from {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.idea-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #241f3c;
  border: 1px solid #473a75;
  color: #cdbdfb;
}

/* 왜 이게 그 브랜드다운가 — 신뢰도의 핵심이라 눈에 띄게 둔다 */
.idea-fit {
  border-left: 2px solid var(--product);
  background: rgba(52, 211, 181, 0.06);
  border-radius: 0 8px 8px 0;
  padding: 8px 11px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: #b6e3d8;
  word-break: keep-all;
}

.idea-fit b {
  display: block;
  font-size: 10.5px;
  color: #4fbfa8;
  font-weight: 700;
  margin-bottom: 3px;
}

.idea-fit span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #61708f;
}

.idea-meta {
  display: grid;
  gap: 5px;
  font-size: 12px;
  line-height: 1.55;
  color: #a9b5cf;
}

.idea-meta b {
  color: #61708f;
  font-weight: 600;
  margin-right: 6px;
  font-size: 11px;
}

.idea-card-actions {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ------------------------------------------------ 디자인 브리프 */

/* 디자인 A/B/C 안 전환 */
.variant-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.variant-chip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.variant-chip.is-on {
  background: #382c63;
  border-color: var(--concept);
  color: #dcd2f7;
}

.variant-chip:hover:not(.is-on) {
  border-color: #33405e;
  color: var(--text);
}

/* 팔레트가 실제로 함께 쓰인 모습 */
.palette-demo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.pd-card {
  border-radius: 10px;
  padding: 12px 16px;
  display: grid;
  gap: 2px;
  min-width: 120px;
}

.pd-card b {
  font-size: 14px;
}

.pd-card span {
  font-size: 10px;
  opacity: 0.75;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pd-chip {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11.5px;
}

.pd-btn {
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
}

.pd-note {
  font-size: 10.5px;
  opacity: 0.65;
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.design-cat {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #16323a;
  border: 1px solid #2c6a72;
  color: #8fd8dd;
  margin-bottom: 10px;
}

.design-concept {
  font-size: 15px;
  line-height: 1.55;
  color: #e6f2f4;
  margin: 0 0 14px;
  word-break: keep-all;
}

.design-mood {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}

.design-mood span {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: #a9b5cf;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.swatch {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: 104px;
  background: var(--bg-elev);
}

.swatch-chip {
  height: 52px;
  cursor: pointer;
}

.swatch-meta {
  padding: 6px 8px;
  font-size: 10.5px;
  line-height: 1.4;
}

.swatch-meta b {
  display: block;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.swatch-meta code {
  color: #61708f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.swatch-meta i {
  color: #4d5c7a;
  font-style: normal;
  margin-left: 4px;
}

.design-block {
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 13px;
}

.design-block:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.design-block h4 {
  margin: 0 0 6px;
  font-size: 11px;
  color: #61708f;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.design-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #c3cde4;
  word-break: keep-all;
}

.design-block ul {
  margin: 0;
  padding-left: 17px;
  display: grid;
  gap: 5px;
}

.design-block li {
  font-size: 12.5px;
  line-height: 1.55;
  color: #c3cde4;
  word-break: keep-all;
}

.design-block.is-avoid li {
  color: #f0a8a8;
}

.ref-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ref-links a {
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: #c3cde4;
  text-decoration: none;
}

.ref-links a:hover {
  border-color: var(--accent);
  color: #bcd3ff;
}

.ref-links a small {
  color: #61708f;
  margin-left: 5px;
}

/* ------------------------------------------------ 이미지 생성 프롬프트 */

.shot {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-elev);
  padding: 11px 13px;
  margin-bottom: 9px;
}

.shot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.shot-head b {
  font-size: 13px;
  color: #e6e0ff;
}

.shot-head code {
  font-size: 10.5px;
  color: #61708f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.shot-row {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.shot-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shot-row h5 {
  margin: 0;
  font-size: 10.5px;
  color: #61708f;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.shot-text {
  font-size: 12px;
  line-height: 1.55;
  color: #b9c4de;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
}

.copy-mini {
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 10.5px;
  padding: 2px 8px;
  cursor: pointer;
}

.copy-mini:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prompt-tips {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 10px 0 0;
  padding-left: 16px;
}

.idea-loading {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 32px 0;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.idea-loading small {
  font-size: 11.5px;
  color: #61708f;
}

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: none;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.board h2 {
  font-size: 13px;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 1px 7px;
}

.board-actions {
  display: flex;
  gap: 4px;
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 4px;
  align-content: start;
}

.board-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
}

.board-item span {
  flex: 1;
  word-break: keep-all;
  cursor: pointer;
}

.board-item span:hover {
  color: var(--accent);
}

.board-item button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
}

.board-item button:hover {
  color: var(--danger);
}

.board-list::-webkit-scrollbar {
  width: 8px;
}
.board-list::-webkit-scrollbar-thumb {
  background: #253052;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
  }
  .search {
    order: 3;
    max-width: none;
    flex-basis: 100%;
  }
  .panel {
    width: 100%;
    max-width: 320px;
  }
}
