:root {
  --ink: #1f2937;
  --ink2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --line2: #eef0f2;
  --paper: #f6f6f3;
  --panel: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -18px rgba(15, 23, 42, .35);
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --card-t: 14px;      /* 활동 카드 제목 — 브리프 기준 14~15px */
  --card-s: 11.5px;    /* 과목 라벨 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------------- header ---------------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 26px 12px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 60;
}
.eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--faint); font-weight: 600; text-transform: uppercase; }
.topbar h1 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 5px; }
.topbar h1 .dot { color: #d1d5db; font-weight: 400; margin: 0 5px; }
.topbar .sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.tb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.seg { display: inline-flex; background: #f3f4f6; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; padding: 6px 11px; border-radius: 7px; white-space: nowrap; font-weight: 500; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.10); }

.switchbig { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.switchbig button { border: 0; background: #fff; padding: 9px 15px; font-size: 13px; color: var(--muted); font-weight: 600; border-right: 1px solid var(--line); }
.switchbig button:last-child { border-right: 0; }
.switchbig button.on { background: #111827; color: #fff; }

.ghostbtn { border: 1px solid var(--line); background: #fff; color: var(--ink2); border-radius: 9px; padding: 7px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ghostbtn:hover { background: #f9fafb; }
.ghostbtn.tog.on { background: #111827; border-color: #111827; color: #fff; }
.ghostbtn.primary { background: #111827; border-color: #111827; color: #fff; }
.ghostbtn.danger { color: #b91c1c; border-color: #fecaca; background: #fff5f5; }

.iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink2); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* ---------------- toolbar ---------------- */
.toolbar { background: #fff; border-bottom: 1px solid var(--line); padding: 9px 26px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; position: sticky; top: 84px; z-index: 50; }
.toolbar .spacer { flex: 1 1 0; min-width: 0; }
.toolbar .lbl { font-size: 11.5px; color: var(--faint); font-weight: 600; letter-spacing: .02em; }
.banner { margin: 10px 26px 0; border: 1px dashed #d6d3d1; background: #fdfcf9; color: #78716c; border-radius: 10px; padding: 9px 13px; font-size: 12px; line-height: 1.55; display: flex; gap: 10px; align-items: flex-start; }
.banner b { color: #57534e; }
.banner .x { margin-left: auto; border: 0; background: none; color: #a8a29e; font-size: 15px; }

/* ---------------- stage ---------------- */
#stage { padding: 14px 26px 26px; }
.view { display: none; }
.view.on { display: block; }

.board { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.boardhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line2); background: #fff; }
.boardhead .eb { font-size: 10.5px; letter-spacing: .16em; color: var(--faint); font-weight: 700; }
.boardhead h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.boardhead .hint { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.boardhead .sum { display: flex; gap: 13px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.boardhead .sum b { color: var(--ink); font-weight: 700; }

.zoomwrap { overflow: auto; padding: 14px; background: radial-gradient(circle at 1px 1px, #e9e9e4 1px, transparent 0) 0 0/18px 18px, #fbfbf9; max-height: calc(100vh - 232px); }
.zoomlayer { transform-origin: top left; transition: transform .12s ease; }

/* ================= GROWTH MAP ================= */
.growboard { min-width: 900px; }
.ghead, .gbhead, .grow-row { display: grid; grid-template-columns: 190px repeat(var(--ncol, 3), minmax(210px, 1fr)); column-gap: 16px; row-gap: 8px; }

.gbhead { margin-bottom: 4px; }
.gbhead .gb { grid-column: span 2; text-align: center; font-size: 11px; font-weight: 800; color: #78716c; letter-spacing: .03em; background: #f4f4f2; border: 1px solid var(--line2); border-radius: 7px; padding: 4px 0; }

.ghead { position: sticky; top: 0; z-index: 9; background: #fff; padding: 2px 0 8px; }
.ghead::before { content: ""; position: absolute; left: -20px; right: -20px; top: -64px; bottom: -2px; background: #fff; z-index: -1; }
.gcorner { display: flex; align-items: flex-end; font-size: 11px; color: var(--faint); font-weight: 700; letter-spacing: .03em; padding-bottom: 8px; }
.gcol { background: #f4f4f2; border: 1px solid var(--line2); border-radius: 9px; padding: 7px 10px; text-align: center; font-size: 13.5px; font-weight: 800; color: #44403c; }
.gcol small { display: block; font-weight: 600; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.gcol.cur { background: #fff7ed; border-color: #fdba74; color: #9a3412; box-shadow: inset 0 0 0 1px #fdba74; }
.gcol.plan { background: #f6fdfb; border-color: #c6ece4; color: #0f766e; }

.groupband { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 6px 10px; border-radius: 8px; background: #faf9f6; border: 1px solid var(--line2); font-size: 12px; font-weight: 800; color: #44403c; cursor: pointer; }
.groupband .swatch { width: 9px; height: 9px; border-radius: 3px; }
.groupband .cnt { margin-left: auto; font-weight: 600; font-size: 11px; color: var(--faint); }
.groupband .chev { color: var(--faint); font-size: 11px; }

.grow-row { position: relative; align-items: stretch; margin-bottom: 5px; }

.catcell { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px 8px 10px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; border-left: 3px solid var(--cat); position: sticky; left: 0; z-index: 5; align-self: start; }
.catcell .code { font-size: 10px; font-weight: 800; color: var(--cat); letter-spacing: .05em; }
.catcell .nm { font-size: 13px; font-weight: 800; color: #292524; line-height: 1.25; }
.catcell .mt { font-size: 10.5px; color: var(--faint); line-height: 1.35; }
.catcell .fold { margin-top: auto; border: 0; background: none; padding: 2px 0 0; color: var(--faint); font-size: 10.5px; text-align: left; }
.catcell.collapsed { background: #fcfcfb; }
.catcell.isgap { border-color: #fecaca; background: #fffafa; }

.gcell { display: flex; flex-direction: column; gap: 5px; padding: 5px; border: 1px solid var(--line2); border-radius: 9px; background: #fdfdfc; min-height: 56px; }
.gcell.cur { background: #fffdf9; border-color: #fde7cf; }
.gcell.plan { background: #fbfefd; border-color: #e3f1ee; }

svg.rowflow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; overflow: visible; }

/* ---- activity card ---- */
.card { --cat: #999; text-align: left; border: 1.5px solid var(--cat); background: #fff; border-radius: 8px; padding: 6px 9px 7px; display: flex; flex-direction: column; gap: 3px; position: relative; box-shadow: 0 1px 1px rgba(15,23,42,.04); transition: box-shadow .12s ease, transform .08s ease; width: 100%; }
.card:hover { box-shadow: 0 4px 14px -8px rgba(15,23,42,.55); transform: translateY(-1px); }
.card .sub { font-size: var(--card-s); font-weight: 700; color: var(--cat); display: flex; align-items: center; gap: 5px; line-height: 1.25; flex-wrap: wrap; }
.card .t { font-size: var(--card-t); font-weight: 700; color: #1f2937; line-height: 1.34; letter-spacing: -.01em; }
.card .meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 1px; }
.card.st-done .sub::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cat); }
.card.st-ongoing { border: 2px solid #2563eb; background: #f5f9ff; }
.card.st-ongoing .sub { color: #1d4ed8; }
.card.st-planned { border: 2px solid #0d9488; background: #f2fdfb; }
.card.st-planned .sub { color: #0f766e; }
.card.st-ai { border: 1.8px dashed #7c3aed; background: #faf7ff; }
.card.st-ai .sub { color: #6d28d9; }
.card.st-gap { border: 2px dashed #ea580c; background: #fff8f1; }
.card.st-gap .sub { color: #c2410c; }
.card.st-missing { border: 2px dotted #94a3b8; background: #f8fafc; }
.card.st-missing .t { color: #64748b; }
.card.st-future { border: 3px double #94a3b8; background: #f8fafc; }

.tag { font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 999px; line-height: 1.6; border: 1px solid transparent; white-space: nowrap; }
.tag.v { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.tag.q { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.tag.p { background: #ecfdf5; color: #0f766e; border-color: #a7f3d0; }
.tag.sel { background: #111827; color: #fff; border-color: #111827; }
.tag.f { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.sbadge { font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: .02em; }
.sbadge.done { display: none; }
.sbadge.ongoing { background: #dbeafe; color: #1d4ed8; }
.sbadge.planned { background: #ccfbf1; color: #0f766e; }
.sbadge.ai { background: #ede9fe; color: #6d28d9; }
.sbadge.gap { background: #ffedd5; color: #c2410c; }
.sbadge.missing { background: #e2e8f0; color: #475569; }

/* 후속 탐구 제안 카드 */
.card.plan { border: 1.8px dashed #14b8a6; background: #f7fefc; }
.card.plan .sub { color: #0f766e; }
.card.plan .t { color: #115e59; font-weight: 700; }
.card.plan .src { font-size: 10.5px; color: #6b7280; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* 빈칸·보완·삽입 슬롯 */
.slot { border: 1.5px dashed #d1d5db; border-radius: 7px; background: #fff; color: #9ca3af; font-size: 11.5px; font-weight: 600; padding: 4px; text-align: center; }
.slot:hover { color: #4b5563; border-color: #94a3b8; background: #fafafa; }
.ghost { border: 1px dashed #e2e0dc; border-radius: 8px; padding: 8px 9px; font-size: 11.5px; color: #b3aea6; background: #fdfdfc; display: flex; align-items: center; gap: 6px; }
.ghost .d { width: 4px; height: 4px; border-radius: 50%; background: #ddd9d3; }
.gapmini { border: 2px dashed #fca5a5; border-radius: 8px; background: #fff5f5; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; }
.gapmini b { font-size: 12px; color: #b91c1c; font-weight: 800; }
.gapmini span { font-size: 11px; color: #b45309; line-height: 1.35; }
.more { border: 1px dashed #cbd5e1; background: #fff; color: #64748b; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 3px; width: 100%; }
.more:hover { color: #334155; border-color: #94a3b8; }

.foldrow { grid-column: 2 / -1; display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line); border-radius: 9px; padding: 7px 10px; font-size: 12px; color: var(--muted); background: #fdfdfb; }
.foldrow .pill { background: #f3f4f6; border-radius: 6px; padding: 1px 6px; font-size: 10.5px; color: #4b5563; }

/* ================= STRATEGY MAP ================= */
.stratwrap { padding: 16px; overflow: auto; background: radial-gradient(circle at 1px 1px, #ecebe6 1px, transparent 0) 0 0/20px 20px, #fcfcfa; max-height: calc(100vh - 232px); }
.stratcanvas { position: relative; min-width: 1180px; min-height: 700px; }
.stratgrid { position: relative; display: grid; grid-template-columns: minmax(300px, 1fr) 116px 292px 116px minmax(300px, 1fr); grid-template-areas: "g1 la center lb g2" "g3 la center lb g4" "rail rail rail rail rail" "g5 g5 g5 g5 g5"; gap: 12px; align-items: start; }

/* 연결 레인 — 카드와 카드 사이를 지나지 않고 흐름을 잇는 전용 통로 */
.flowlane { position: relative; align-self: stretch; z-index: 0; border-radius: 10px; background: linear-gradient(180deg, rgba(148,163,184,.035), rgba(148,163,184,.012)); border: 1px dashed #eceff3; }
.flowlane::before { content: attr(data-label); position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; letter-spacing: .08em; color: #b6bfcc; white-space: nowrap; }
.flowlane.la { grid-area: la; } .flowlane.lb { grid-area: lb; }

.cluster { position: relative; z-index: 1; border-radius: 13px; border: 1px solid var(--line); padding: 9px 9px 10px; background: var(--tint); }
.cluster > header.cl-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: 12px; font-weight: 800; color: #57534e; letter-spacing: .02em; }
.cluster > header.cl-head .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--gc); }
.cluster > header.cl-head .n { margin-left: auto; font-size: 10.5px; color: #a8a29e; font-weight: 700; }

.catbox { position: relative; z-index: 2; background: rgba(255,255,255,.55); border: 1px solid var(--line2); border-left: 3px solid var(--cat); border-radius: 9px; padding: 7px 8px 8px; margin-bottom: 8px; transition: box-shadow .15s ease; }
.catbox:last-child { margin-bottom: 0; }
.catbox > header.cb-head { display: flex; align-items: center; gap: 6px; cursor: pointer; margin-bottom: 5px; padding: 1px 2px; }
.catbox > header.cb-head .code { font-size: 10px; font-weight: 800; color: var(--cat); }
.catbox > header.cb-head .nm { font-size: 12.5px; font-weight: 800; color: #292524; }
.catbox > header.cb-head .cnt { margin-left: auto; font-size: 10.5px; color: #a8a29e; font-weight: 700; }
.catbox > header.cb-head .chev { font-size: 10px; color: #a8a29e; }
.catbox > header.cb-head .gapchip { font-size: 9.5px; font-weight: 800; color: #b91c1c; background: #fee2e2; border-radius: 4px; padding: 1px 5px; }
.catbox .cards { display: flex; flex-direction: column; gap: 10px; }
.catbox.folded .cards, .catbox.folded .morebtn { display: none; }
.catbox.isgap { border: 2px dashed #fca5a5; background: #fffafa; }
.catbox.hl { box-shadow: 0 0 0 3px #c4b5fd, 0 6px 20px -14px #7c3aed; }
.catbox .emptyline { font-size: 11.5px; color: #b0aca4; padding: 3px 2px 4px; }
.morebtn { border: 1px dashed #cbd5e1; background: #fff; color: #64748b; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 5px; width: 100%; margin-top: 5px; }

.catbox .card { position: relative; z-index: 5; }
.catbox .card .t { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- center column ---- */
.centerCol { grid-area: center; align-self: stretch; display: flex; flex-direction: column; gap: 9px; position: relative; z-index: 4; }
.centernode { background: #fff; border: 2px solid #d6d3d1; border-radius: 14px; box-shadow: 0 12px 34px -22px rgba(15,23,42,.7), 0 0 0 6px rgba(245,244,241,.9); padding: 14px 12px 12px; text-align: center; }
.centernode .who { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.centernode .who i { font-style: normal; font-size: 11px; font-weight: 700; color: #a8a29e; margin-left: 3px; }
.centernode .mj { font-size: 13.5px; color: #b91c1c; font-weight: 800; margin-top: 1px; }
.centernode .sm { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.centernode .bars { display: flex; gap: 4px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.centernode .bars span { font-size: 10px; background: #f4f4f2; border-radius: 5px; padding: 2px 6px; color: #57534e; font-weight: 700; }

.dircard { background: #fffdf7; border: 1.5px solid #f0d9b5; border-radius: 12px; padding: 11px 12px; }
.dircard .k { font-size: 10.5px; letter-spacing: .06em; font-weight: 800; color: #a1743f; }
.dircard .t { font-size: 14.5px; font-weight: 800; color: #7c2d12; margin: 4px 0 8px; line-height: 1.35; letter-spacing: -.01em; }
.dircard ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dircard li { display: grid; grid-template-columns: 62px 1fr; gap: 6px; align-items: start; }
.dircard li b { font-size: 9.5px; font-weight: 800; color: #b45309; background: #fff3e0; border-radius: 4px; padding: 2px 4px; text-align: center; }
.dircard li span { font-size: 11.5px; color: #57534e; line-height: 1.45; }

.nextlist, .gapbox, .todobox { background: #fff; border: 1px solid var(--line2); border-radius: 11px; padding: 10px 11px; }
.todobox { background: #f8fafc; }
.todobox .k { font-size: 10.5px; letter-spacing: .06em; font-weight: 800; color: #334155; }
.todobox ul { margin: 6px 0 0; padding-left: 14px; display: flex; flex-direction: column; gap: 5px; }
.todobox li { font-size: 11.5px; color: #475569; line-height: 1.4; }
.nextlist .k, .gapbox .k, .todobox .k { font-size: 10.5px; letter-spacing: .06em; font-weight: 800; color: #0f766e; display: flex; align-items: center; gap: 5px; }
.gapbox .k { color: #b91c1c; }
.nextlist ul, .gapbox ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.nextlist li { font-size: 11.5px; color: #334155; line-height: 1.4; display: grid; grid-template-columns: 34px 1fr; gap: 5px; }
.nextlist li b { font-size: 9.5px; font-weight: 800; color: #0f766e; background: #ecfdf5; border-radius: 4px; padding: 2px 3px; text-align: center; align-self: start; }
.gapbox li { font-size: 11.5px; color: #7f1d1d; line-height: 1.4; }
.gapbox li b { color: #b91c1c; }

/* ---- bridge rail ---- */
.bridgerail { grid-area: rail; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 9px; padding: 4px 2px; }
.bridge { --ac: #6d28d9; --bc: #b91c1c; position: relative; z-index: 5; text-align: left; border: 1.5px dashed #c4b5fd; background: linear-gradient(180deg, #fbf8ff, #fff); border-radius: 11px; padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; position: relative; }
.bridge:hover { border-color: #a78bfa; box-shadow: 0 6px 18px -14px #7c3aed; }
.bridge .kick { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: #7c3aed; }
.bridge .t { font-size: 14px; font-weight: 800; color: #3b0764; line-height: 1.3; letter-spacing: -.01em; }
.bridge .k { font-size: 10.5px; font-weight: 700; color: #6b7280; display: flex; gap: 4px; flex-wrap: wrap; }
.bridge .k span { background: #f3f4f6; border-radius: 4px; padding: 1px 5px; }
.bridge .n { font-size: 11px; color: #6b7280; line-height: 1.4; }

#linklayer { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; overflow: visible; }
#linklayer .hit { pointer-events: stroke; cursor: pointer; }
.badgelayer { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.linkbadge { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; display: flex; flex-direction: column; gap: 1px; align-items: flex-start; background: #fff; border: 1.5px solid var(--lc, #2563eb); border-radius: 8px; padding: 3px 7px; font-size: 10.5px; font-weight: 700; color: #334155; box-shadow: 0 2px 10px -6px rgba(15,23,42,.55); width: 104px; line-height: 1.3; }
.linkbadge b { color: var(--lc, #2563eb); font-weight: 800; font-size: 9.5px; letter-spacing: .02em; }
.linkbadge span { color: #475569; font-weight: 600; font-size: 10px; }
.linkbadge.sm { width: auto; padding: 2px 7px; }
.linkbadge:hover { background: #f8fafc; }

.legendwrap { border-top: 1px solid var(--line2); padding: 11px 18px; background: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.legend .it { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #57534e; font-weight: 600; }
.legend .swatchcard { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.lnklegend .swatchline { width: 24px; height: 0; border-top-width: 2.5px; border-top-style: solid; display: inline-block; }

.foot { margin: 12px 26px 26px; font-size: 11.5px; color: #a8a29e; line-height: 1.65; }

/* ---- parent mode ---- */
.parentpanel { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line2); background: #fffdf8; }
.parentpanel .pblock { flex: 1 1 260px; min-width: 240px; background: #fff; border: 1px solid #f0e6d8; border-radius: 11px; padding: 10px 12px; }
.parentpanel .pblock .k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; color: #a1743f; }
.parentpanel .pblock .t { font-size: 15px; font-weight: 800; color: #7c2d12; margin-top: 3px; line-height: 1.3; }
.parentpanel .pblock p { font-size: 12.5px; color: #57534e; line-height: 1.55; margin-top: 5px; }
.parentpanel .pblock.gap { border-color: #fecaca; background: #fffafa; }
.parentpanel .pblock.gap .k { color: #b91c1c; }
.parentpanel .pblock.gap .t { color: #991b1b; }
.parentpanel .pstats { display: flex; gap: 18px; flex-wrap: wrap; }
.parentpanel .pstats div { font-size: 11.5px; color: #78716c; }
.parentpanel .pstats b { display: block; font-size: 19px; color: #292524; font-weight: 800; }

body.parent { --card-t: 15px; --card-s: 12px; }
body.parent .editonly { display: none !important; }
body.parent .boardhead { background: #fffdf8; }
body.parent .gcell.plan { background: #f7fdfb; }

/* ---- modal ---- */
.scrim { position: fixed; inset: 0; background: rgba(24,24,27,.42); backdrop-filter: blur(1.5px); display: flex; align-items: flex-start; justify-content: center; z-index: 200; padding: 40px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 16px; width: min(760px, 100%); box-shadow: 0 30px 80px -30px rgba(15,23,42,.6); overflow: hidden; animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(6px); opacity: 0 } }
.modal.wide { width: min(920px, 100%); }
.mhead { padding: 16px 20px 12px; border-bottom: 1px solid var(--line2); }
.mhead .kick { font-size: 10.5px; letter-spacing: .12em; color: var(--faint); font-weight: 700; }
.mhead h3 { font-size: 18px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.mhead .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.mbody { padding: 16px 20px 20px; max-height: 68vh; overflow: auto; }
.mfoot { padding: 12px 20px; border-top: 1px solid var(--line2); display: flex; gap: 8px; justify-content: flex-end; background: #fcfcfb; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 104px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--faint); font-weight: 700; font-size: 11.5px; padding-top: 1px; }
.kv dd { margin: 0; color: #292524; line-height: 1.55; }
.sect { margin-top: 18px; }
.sect h4 { font-size: 12px; font-weight: 800; color: #57534e; letter-spacing: .02em; margin-bottom: 8px; }
.sum4 { display: grid; gap: 8px; }
.sum4 .row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; background: #fbfbf9; border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px; }
.sum4 .row b { font-size: 11px; color: #b45309; font-weight: 800; }
.sum4 .row p { font-size: 12.3px; line-height: 1.62; color: #374151; }

.linklist { display: grid; gap: 7px; }
.linkrow { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; background: #fff; font-size: 12px; }
.linkrow .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.linkrow .txt b { font-weight: 700; color: #292524; }
.linkrow .txt p { color: #6b7280; font-size: 11.5px; line-height: 1.5; margin-top: 2px; }
.linkrow .del { margin-left: auto; border: 0; background: none; color: #d4d4d8; font-size: 14px; }
.linkrow .del:hover { color: #b91c1c; }

.form { display: grid; gap: 10px; }
.form label { font-size: 11.5px; font-weight: 700; color: #57534e; display: block; margin-bottom: 4px; }
.form input, .form select, .form textarea { width: 100%; border: 1px solid #d6d3d1; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; color: var(--ink); background: #fff; }
.form textarea { min-height: 62px; resize: vertical; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.design .lead { font-size: 12.5px; color: #44403c; background: #fbfaf7; border: 1px solid var(--line2); border-left: 3px solid #a1743f; border-radius: 9px; padding: 11px 12px; line-height: 1.6; }
.design h4 { font-size: 12px; font-weight: 800; color: #57534e; margin: 16px 0 8px; }
.design ol { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.design ol li { font-size: 12.3px; line-height: 1.6; color: #374151; }
.design .outline { display: grid; gap: 7px; }
.design .outline div { font-size: 12.3px; line-height: 1.62; color: #374151; background: #fff; border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px; }
.design .outline b { color: #9a3412; }
.selchips { display: flex; gap: 5px; flex-wrap: wrap; }
.selchips span { font-size: 10.5px; background: #f5f5f4; border-radius: 999px; padding: 2px 8px; color: #57534e; }

.selbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111827; color: #fff; border-radius: 999px; padding: 8px 10px 8px 16px; display: none; align-items: center; gap: 10px; z-index: 180; box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); font-size: 12.5px; }
.selbar.on { display: flex; }
.selbar .n { font-weight: 800; }
.selbar button { border-radius: 999px; border: 0; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.selbar .b1 { background: #f59e0b; color: #1c1917; }
.selbar .b2 { background: #fff; color: #111827; }
.selbar .b3 { background: transparent; color: #9ca3af; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(8px); background: #1f2937; color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: all .18s ease; z-index: 220; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

#stage:fullscreen { background: var(--paper); overflow: auto; padding: 10px; }
#stage:fullscreen .board { box-shadow: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1200px) {
  .stratgrid { grid-template-columns: minmax(270px, 1fr) 104px 260px 104px minmax(270px, 1fr); }
}
@media (max-width: 900px) {
  .topbar { padding: 10px 12px 8px; gap: 8px; position: static; }
  .topbar h1 { font-size: 19px; margin-top: 3px; }
  .tb-right { gap: 5px; width: 100%; }
  .seg button { padding: 5px 7px; font-size: 11px; }
  .toolbar { position: static; padding: 7px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: 0 0 auto; }
  .toolbar .spacer, .toolbar .lbl { display: none; }
  .switchbig button { padding: 8px 10px; font-size: 12px; }
  #stage { padding: 10px 12px 24px; }
  .banner { margin: 10px 12px 0; }
  .foot { margin: 12px 14px 24px; }
  .zoomwrap, .stratwrap { max-height: none; padding: 10px; }
  .growboard { min-width: 760px; }
  .ghead, .gbhead, .grow-row { grid-template-columns: 132px repeat(var(--ncol, 3), minmax(170px, 1fr)); gap: 6px; }
  :root { --card-t: 13px; --card-s: 10.5px; }
  .catcell { padding: 6px; }
  .catcell .nm { font-size: 11.5px; }
  .catcell .mt { display: none; }
  .stratcanvas { min-width: 0; min-height: 0; }
  .stratgrid { grid-template-columns: 1fr; grid-template-areas: "center" "g1" "g2" "g3" "g4" "rail" "g5"; }
  .flowlane { display: none; }
  .centernode { width: 100%; }
  #linklayer, .badgelayer { display: none; }
  .scrim { padding: 10px 8px 20px; }
  .modal { border-radius: 13px; }
  .mhead { padding: 13px 14px 10px; }
  .mhead h3 { font-size: 16px; }
  .mbody { padding: 12px 14px 16px; max-height: 72vh; }
  .mfoot { padding: 10px 14px; }
  .kv { grid-template-columns: 78px 1fr; font-size: 12px; }
  .sum4 .row { grid-template-columns: 44px 1fr; padding: 8px 9px; }
  .legend { gap: 10px; }
  .legend .it { font-size: 10.5px; }
  .selbar { left: 8px; right: 8px; transform: none; bottom: 10px; flex-wrap: wrap; justify-content: center; }
  .parentpanel { padding: 10px 12px; }
}
