/* 홍브레인 — AI 테마 (어두운 기본 + 밝은 변형). 클래스는 전부 br-(화면) / bm-(지도) 앞머리 */
:root {
  --bg: #070b16; --bg-2: #0b1222; --card: rgba(255, 255, 255, .035); --card-2: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .16);
  --ink: #e8eefc; --ink-2: #c3cde6; --muted: #8d9bbb; --cyan: #4de3ff; --cyan-2: #9bf0ff; --violet: #8b7cff; --ok: #3ddc97; --warn: #ffb347; --danger: #ff6b6b;
  --brain-lit: #4de3ff; --brain-dim: #42527a; --brain-pulse: #a08cff; --brain-lit-hex: #4de3ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45); --glow: 0 0 0 1px rgba(77, 227, 255, .25), 0 0 32px rgba(77, 227, 255, .18);
  --r: 16px; --r-s: 10px; --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "D2Coding", "Courier New", monospace;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f3f6fd; --bg-2: #ffffff; --card: rgba(255, 255, 255, .78); --card-2: #ffffff; --line: #dde4f2; --line-2: #c6d0e6;
  --ink: #0f172a; --ink-2: #27324a; --muted: #5d6c8c; --cyan: #0891b2; --cyan-2: #0e7490; --violet: #6d5df6; --ok: #0f9f6e; --warn: #c27a00; --danger: #d64545;
  --brain-lit: #0ea5c9; --brain-dim: #a9b6d1; --brain-pulse: #7b6cf6; --brain-lit-hex: #0ea5c9;
  --shadow: 0 16px 48px rgba(30, 50, 100, .12); --glow: 0 0 0 1px rgba(8, 145, 178, .25), 0 0 28px rgba(8, 145, 178, .14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[hidden] { display: none !important; }   /* 어떤 display 규칙보다 hidden 속성이 우선 (로그인 창·탭 등) */
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; min-height: 100dvh; overflow-x: hidden; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
small { font-weight: 400; }
::selection { background: rgba(77, 227, 255, .3); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* ── 배경: 미세한 격자 + 천천히 떠다니는 빛 ── */
#br-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(1200px 700px at 70% -10%, rgba(139, 124, 255, .16), transparent 60%), radial-gradient(900px 600px at 10% 110%, rgba(77, 227, 255, .12), transparent 60%), var(--bg); }
.br-bg-grid { position: absolute; inset: -2px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, .55), transparent 75%); opacity: .5; }
.br-bg-glow { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(80px); opacity: .22; animation: br-drift 36s ease-in-out infinite alternate; }
.br-bg-glow-1 { background: var(--cyan); left: -18vmax; top: 20vh; }
.br-bg-glow-2 { background: var(--violet); right: -22vmax; top: -10vh; animation-duration: 44s; animation-direction: alternate-reverse; }
html[data-theme="light"] .br-bg-glow { opacity: .14; }
@keyframes br-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(8vw, 6vh, 0) scale(1.12); } }

/* ── 위 막대 ── */
.br-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 clamp(12px, 3vw, 28px); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
.br-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.br-logo-mark { position: relative; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, var(--cyan-2), var(--cyan) 55%, var(--violet)); box-shadow: 0 0 18px rgba(77, 227, 255, .5); }
.br-logo-mark i { position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--cyan); opacity: 0; animation: br-ping 2.6s ease-out infinite; }
@keyframes br-ping { 0% { transform: scale(.7); opacity: .7; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }
.br-nav { display: flex; gap: 2px; margin-left: 6px; }
.br-nav a { white-space: nowrap; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; transition: color .2s, background .2s, transform .2s var(--ease); }
.br-nav a:hover { color: var(--ink); background: var(--card-2); }
.br-nav a.is-active { color: var(--bg); background: var(--cyan); box-shadow: 0 6px 18px rgba(77, 227, 255, .25); }
html[data-theme="light"] .br-nav a.is-active { color: #fff; }
.br-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.br-top-pct { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; transition: border-color .2s, box-shadow .3s; }
.br-top-pct:hover { border-color: var(--line-2); box-shadow: var(--glow); }
.br-top-pct svg { width: 26px; height: 26px; }
.br-top-ring-bg, .br-top-ring { fill: none; stroke-width: 3.2; }
.br-top-ring-bg { stroke: var(--line-2); }
.br-top-ring { stroke: var(--cyan); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray 1s var(--ease); }
.br-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 15px; display: grid; place-items: center; transition: transform .2s var(--ease), border-color .2s, background .2s; }
.br-icon-btn:hover { transform: translateY(-1px); border-color: var(--line-2); background: var(--card-2); }
.br-icon-btn:active { transform: scale(.94); }
.br-user-btn { font-weight: 800; font-size: 13px; background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; border: 0; }

/* ── 본문 틀 + 화면 전환 ── */
.br-main { max-width: 1240px; margin: 0 auto; padding: 22px clamp(12px, 3vw, 28px) 90px; transition: opacity .17s ease, transform .17s ease; }
.br-main.br-leave { opacity: 0; transform: translateY(6px) scale(.995); }
.br-main.br-enter { animation: br-arrive .55s var(--ease) both; }
@keyframes br-arrive { from { opacity: 0; transform: translateY(10px) scale(.992); } to { opacity: 1; transform: none; } }
.br-stagger > * { animation: br-rise .7s var(--ease) both; }
.br-stagger > :nth-child(1) { animation-delay: .04s; } .br-stagger > :nth-child(2) { animation-delay: .12s; } .br-stagger > :nth-child(3) { animation-delay: .2s; } .br-stagger > :nth-child(4) { animation-delay: .28s; } .br-stagger > :nth-child(5) { animation-delay: .36s; } .br-stagger > :nth-child(6) { animation-delay: .44s; } .br-stagger > :nth-child(n+7) { animation-delay: .5s; }
@keyframes br-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.br-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.br-reveal.is-in { opacity: 1; transform: none; }
.br-enter .br-bar-fill, .br-enter .br-dom-bar .br-bar-fill { animation: br-grow 1s var(--ease) both; transform-origin: left; }
@keyframes br-grow { from { transform: scaleX(0); } }
.br-view { display: grid; gap: 18px; }
.br-view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 18px; padding: 4px 2px; }
.br-view-head h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.br-view-head p { margin-top: 6px; max-width: 64ch; }
.br-muted { color: var(--muted); }
.br-grad { background: linear-gradient(90deg, var(--cyan-2), var(--cyan) 40%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.br-kicker { color: var(--cyan); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }

/* ── 카드·버튼·배지 ── */
.br-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .25s, transform .25s var(--ease), box-shadow .3s; }
.br-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 40%); }
html[data-theme="light"] .br-card { box-shadow: 0 6px 24px rgba(30, 50, 100, .06); }
.br-card-title { display: flex; align-items: baseline; gap: 10px; font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.br-card-title small { color: var(--muted); font-size: 12px; font-weight: 600; }
.br-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1.3; transition: transform .18s var(--ease), box-shadow .25s, background .2s, border-color .2s, color .2s; text-align: center; }
.br-btn:hover { transform: translateY(-1px); border-color: var(--cyan); }
.br-btn:active { transform: translateY(0) scale(.97); }
.br-btn:disabled { opacity: .55; cursor: default; transform: none; }
.br-btn-primary { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #061018; border: 0; box-shadow: 0 10px 28px rgba(77, 227, 255, .25); }
html[data-theme="light"] .br-btn-primary { color: #fff; }
.br-btn-primary:hover { box-shadow: 0 14px 34px rgba(77, 227, 255, .35); }
.br-btn-ghost { background: transparent; }
.br-btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; flex-direction: column; align-items: flex-start; gap: 2px; }
.br-btn-lg small { font-weight: 500; font-size: 12px; opacity: .85; }
.br-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink-2); white-space: nowrap; }
.br-badge-memorize { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.br-badge-try { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.br-badge-understand { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.br-badge-level, .br-badge-time, .br-badge-pos { color: var(--muted); }
.br-bar { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.br-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 12px rgba(77, 227, 255, .5); transition: width .8s var(--ease); }
.br-seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.br-seg button { padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; transition: background .2s, color .2s; }
.br-seg button.is-on { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.br-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.br-error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }
.br-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); z-index: 50; padding: 12px 18px; border-radius: 14px; background: color-mix(in srgb, var(--bg-2) 85%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(14px); font-weight: 600; font-size: 14px; max-width: min(92vw, 520px); opacity: 0; transition: opacity .3s, transform .4s var(--ease); pointer-events: none; }
.br-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.br-toast.is-good { border-color: color-mix(in srgb, var(--ok) 50%, transparent); box-shadow: var(--shadow), 0 0 30px rgba(61, 220, 151, .25); }
.br-toast.is-bad { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

/* ── 로비 ── */
.br-lobby { display: grid; gap: 22px; }
.br-hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; min-height: min(62vh, 560px); border-radius: 24px; border: 1px solid var(--line); overflow: hidden; background: radial-gradient(800px 420px at 30% 50%, rgba(77, 227, 255, .10), transparent 60%), var(--card); }
.br-brain { width: 100%; height: 100%; min-height: 420px; display: block; touch-action: pan-y; }
.br-hero-copy { padding: 36px 40px 36px 8px; display: grid; gap: 16px; align-content: center; }
.br-title { font-size: clamp(34px, 4.6vw, 56px); font-weight: 900; letter-spacing: -.03em; line-height: 1.08; }
.br-sub { color: var(--ink-2); font-size: 15px; }
.br-sub b { color: var(--ink); font-weight: 800; }
.br-num { font-variant-numeric: tabular-nums; }
.br-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.br-lobby-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.br-next-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.br-lrow { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; background: var(--card); transition: border-color .2s, background .2s, transform .2s var(--ease); }
a.br-lrow:hover { border-color: var(--line-2); background: var(--card-2); transform: translateX(3px); }
.br-lrow-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--bg); transition: background .3s, border-color .3s, transform .3s var(--ease); }
.br-lrow.is-done .br-lrow-check { background: var(--ok); border-color: var(--ok); }
.br-lrow.is-review .br-lrow-check { border-color: var(--warn); color: var(--warn); }
.br-lrow.is-next .br-lrow-check { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(77, 227, 255, .18); animation: br-breathe 2.4s ease-in-out infinite; }
@keyframes br-breathe { 50% { box-shadow: 0 0 0 7px rgba(77, 227, 255, .05); } }
.br-lrow.is-planned { opacity: .55; }
.br-lrow-body { min-width: 0; display: grid; gap: 1px; }
.br-lrow-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-lrow-title em { font-style: normal; color: var(--cyan); font-size: 11px; font-weight: 800; margin-left: 6px; vertical-align: 1px; }
.br-lrow-trail { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-lrow-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.br-dom-bars { display: grid; gap: 8px; }
.br-dom-bar { display: grid; grid-template-columns: 28px 1fr 42px; grid-template-rows: auto auto; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 10px; transition: background .2s; }
.br-dom-bar:hover { background: var(--card-2); }
.br-dom-bar.is-empty { opacity: .55; }
.br-dom-bar-num { grid-row: 1 / 3; font-family: var(--mono); font-size: 12px; color: var(--cyan); font-weight: 700; }
.br-dom-bar-title { grid-column: 2; grid-row: 1; font-weight: 700; font-size: 13px; }
.br-dom-bar .br-bar { grid-column: 2; grid-row: 2; height: 5px; }
.br-dom-bar-pct { grid-column: 3; grid-row: 1 / 3; text-align: right; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.br-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14px; }
.br-steps b { color: var(--ink); }
.br-steps a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

/* ── 지도 (SVG) ── */
.br-map { position: relative; min-height: 360px; }
.bm-svg { display: block; width: 100%; max-width: 940px; margin: 0 auto; height: auto; overflow: visible; font-family: var(--font); }
.bm-orbit { fill: none; stroke: var(--line); stroke-dasharray: 3 7; }
.bm-orbit-2 { stroke-dasharray: 2 9; opacity: .7; }
.bm-link { fill: none; stroke: var(--line-2); stroke-width: 1.6; transition: stroke .3s; }
.bm-link.is-going { stroke: color-mix(in srgb, var(--cyan) 55%, var(--line-2)); }
.bm-link.is-done { stroke: var(--cyan); filter: drop-shadow(0 0 4px rgba(77, 227, 255, .6)); }
.bm-tlink { stroke: var(--line); stroke-width: 1; }
.bm-tlink.is-going, .bm-tlink.is-done { stroke: color-mix(in srgb, var(--cyan) 50%, var(--line)); }
.bm-ring-bg { fill: none; stroke: var(--line-2); stroke-width: 5; }
.bm-ring { fill: none; stroke: var(--cyan); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray 1.1s var(--ease); }
.bm-ring-center { stroke-width: 7; stroke: url(#bm-grad-fallback) var(--cyan); }
.bm-ring-topic { stroke-width: 3; }
.bm-ring-topic + .bm-topic-dot { }
.bm-center { cursor: pointer; }
.bm-center-halo { fill: url(#bm-glow); animation: bm-halo 4s ease-in-out infinite; transform-origin: 500px 500px; }
@keyframes bm-halo { 50% { transform: scale(1.08); opacity: .8; } }
.bm-center-bg { fill: var(--bg-2); stroke: var(--line-2); }
.bm-center-pct { fill: var(--ink); font-size: 46px; font-weight: 900; text-anchor: middle; dominant-baseline: middle; letter-spacing: -.03em; }
.bm-center-unit { font-size: 22px; font-weight: 700; fill: var(--muted); }
.bm-center-label { fill: var(--ink); font-size: 17px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.bm-center-sub { fill: var(--muted); font-size: 12px; text-anchor: middle; dominant-baseline: middle; }
.bm-dom { cursor: pointer; transition: filter .25s; }
.bm-dom:hover .bm-dom-bg, .bm-dom:focus-visible .bm-dom-bg { stroke: var(--cyan); }
.bm-dom:hover { filter: drop-shadow(0 0 10px rgba(77, 227, 255, .45)); }
.bm-dom-bg { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.2; transition: stroke .2s; }
.bm-dom.is-done .bm-dom-bg { fill: color-mix(in srgb, var(--cyan) 18%, var(--bg-2)); }
.bm-dom-num { fill: var(--cyan); font-family: var(--mono); font-size: 13px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.bm-dom-pct { fill: var(--ink); font-size: 18px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.bm-dom.is-new .bm-dom-pct { fill: var(--muted); }
.bm-dom-label { fill: var(--ink-2); font-size: 15px; font-weight: 700; dominant-baseline: middle; }
.bm-next-halo { fill: none; stroke: var(--cyan); stroke-width: 1.5; stroke-dasharray: 4 6; animation: bm-spin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
.bm-next-tag { fill: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .06em; animation: bm-bob 1.8s ease-in-out infinite; }
@keyframes bm-bob { 50% { transform: translateY(-3px); } }
.bm-topic { cursor: pointer; }
.bm-topic-hit { fill: transparent; }
.bm-topic-dot { fill: var(--line-2); transition: fill .2s, r .2s; }
.bm-topic.is-going .bm-topic-dot { fill: color-mix(in srgb, var(--cyan) 60%, var(--line-2)); }
.bm-topic.is-done .bm-topic-dot { fill: var(--cyan); }
.bm-topic.is-next .bm-topic-dot { fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }
.bm-topic:hover .bm-topic-dot, .bm-topic:focus-visible .bm-topic-dot { fill: var(--cyan-2); }
/* 지도 목록(좁은 화면) */
.bm-list { display: grid; gap: 10px; }
.bm-list-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.bm-list-pct { font-size: 34px; font-weight: 900; letter-spacing: -.03em; color: var(--cyan); }
.bm-list-pct small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.bm-row { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; }
.bm-row.is-next { border-color: color-mix(in srgb, var(--cyan) 50%, var(--line)); box-shadow: var(--glow); }
.bm-row-main { display: grid; grid-template-columns: 34px 1fr 48px; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: transparent; text-align: left; }
.bm-row-num { font-family: var(--mono); color: var(--cyan); font-weight: 700; font-size: 13px; }
.bm-row-body { min-width: 0; display: grid; gap: 6px; }
.bm-row-title { font-weight: 800; font-size: 15px; }
.bm-row-next { font-style: normal; color: var(--cyan); font-size: 11px; font-weight: 800; margin-left: 6px; }
.bm-row-pct { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.bm-row.is-new .bm-row-pct { color: var(--muted); }
.bm-row-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.bm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-2); transition: border-color .2s, background .2s; }
.bm-chip:hover { border-color: var(--cyan); background: var(--card-2); }
.bm-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.bm-chip.is-going i { background: color-mix(in srgb, var(--cyan) 60%, var(--line-2)); }
.bm-chip.is-done i { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.bm-chip small { color: var(--muted); }

/* ── 공부 순서 ── */
.br-path { gap: 14px; }
.br-path-dom { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 18px 20px; display: grid; gap: 12px; }
.br-path-dom.is-next { border-color: color-mix(in srgb, var(--cyan) 45%, var(--line)); }
.br-path-dom-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.br-path-dom-head a { display: flex; align-items: center; gap: 12px; }
.br-path-dom-head h2 { font-size: 20px; font-weight: 800; }
.br-path-num { font-family: var(--mono); color: var(--cyan); font-weight: 800; font-size: 15px; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.br-path-pct { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.br-path-summary { color: var(--ink-2); font-size: 14px; }
.br-guide { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); color: var(--ink); font-size: 14px; }
.br-guide b { color: var(--violet); white-space: nowrap; }
html[data-theme="light"] .br-guide b { color: #5b4be0; }
.br-path-topic { display: grid; gap: 8px; padding-top: 6px; }
.br-path-topic h3 { font-size: 15px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; }
.br-path-topic h3 small { color: var(--muted); font-weight: 600; font-size: 12px; }
.br-path-topic h3 a:hover { color: var(--cyan); }
.br-path-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.br-path-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ── 영역·주제 페이지 ── */
.br-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.br-crumb a:hover { color: var(--cyan); }
.br-crumb i { font-style: normal; opacity: .5; }
.br-node-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.br-node-head h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; letter-spacing: -.02em; }
.br-node-head .br-summary { margin-top: 8px; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.br-ring { position: relative; width: 108px; height: 108px; }
.br-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.br-ring circle { fill: none; stroke-width: 8; }
.br-ring .bg { stroke: var(--line-2); }
.br-ring .fg { stroke: var(--cyan); stroke-linecap: round; transition: stroke-dasharray 1.1s var(--ease); filter: drop-shadow(0 0 6px rgba(77, 227, 255, .5)); }
.br-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 900; letter-spacing: -.03em; }
.br-ring b small { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: -4px; }
.br-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.br-stat { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--ink-2); }
.br-stat b { color: var(--ink); font-weight: 800; }
.br-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.br-topic-card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); transition: transform .25s var(--ease), border-color .2s, box-shadow .3s; }
.br-topic-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.br-topic-card h3 { font-size: 16px; font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }
.br-topic-card h3 span { color: var(--cyan); font-variant-numeric: tabular-nums; }
.br-topic-card p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.br-topic-card .br-lrow-meta { justify-content: flex-start; }
.br-section-title { font-size: 17px; font-weight: 800; margin: 6px 0 2px; display: flex; align-items: baseline; gap: 8px; }
.br-section-title small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ── 글 보기 ── */
.br-lesson { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.br-lesson-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.br-lesson-head { display: grid; gap: 12px; padding: 22px 24px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 8%, transparent), transparent 50%), var(--card); }
.br-lesson-head h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -.02em; }
.br-lesson-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.br-waynote { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.br-waynote div { display: flex; gap: 8px; align-items: flex-start; }
.br-toc { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 10px 14px; font-size: 13px; }
.br-toc summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.br-toc ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.br-toc a:hover { color: var(--cyan); }
.br-md { padding: 6px 24px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); font-size: 16px; line-height: 1.85; color: var(--ink); }
.br-md > :first-child { margin-top: 18px; }
.br-md h2 { font-size: 21px; font-weight: 800; margin: 36px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); letter-spacing: -.01em; }
.br-md h2:first-child { border-top: 0; padding-top: 0; margin-top: 18px; }
.br-md h3 { font-size: 17px; font-weight: 800; margin: 24px 0 8px; color: var(--ink); }
.br-md h4 { font-size: 15px; margin: 18px 0 6px; color: var(--ink-2); }
.br-md p { margin: 0 0 14px; }
.br-md ul, .br-md ol { margin: 0 0 14px; padding-left: 24px; }
.br-md li { margin: 4px 0; }
.br-md li > p { margin: 0; }
.br-md a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.br-md strong { font-weight: 800; }
.br-md code { font-family: var(--mono); font-size: .9em; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--cyan) 10%, var(--card-2)); color: var(--cyan-2); }
html[data-theme="light"] .br-md code { color: #0b6b85; }
.br-md pre { margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; background: #050912; border: 1px solid var(--line); overflow: auto; line-height: 1.6; }
html[data-theme="light"] .br-md pre { background: #0f172a; }
.br-md pre code { padding: 0; background: none; color: #dbe7ff; font-size: 13.5px; }
.br-md blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 3px solid var(--line-2); color: var(--ink-2); background: var(--card-2); border-radius: 0 10px 10px 0; }
.br-md table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; display: block; overflow-x: auto; }
.br-md th, .br-md td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.br-md th { background: var(--card-2); font-weight: 800; }
.br-md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.br-md img { max-width: 100%; border-radius: 10px; }
.br-md mark { background: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.br-md kbd { font-family: var(--mono); font-size: .85em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--card-2); }
/* 안내 카드 */
.br-callout { margin: 18px 0; border-radius: 14px; border: 1px solid var(--co, var(--line-2)); background: color-mix(in srgb, var(--co, var(--cyan)) 9%, transparent); overflow: hidden; }
.br-callout-head { padding: 9px 16px; font-weight: 800; font-size: 13.5px; letter-spacing: .01em; color: var(--co, var(--cyan)); background: color-mix(in srgb, var(--co, var(--cyan)) 10%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--co, var(--cyan)) 25%, transparent); }
.br-callout-body { padding: 12px 16px 2px; }
.br-callout-body > :last-child { margin-bottom: 12px; }
.br-callout-memorize { --co: var(--warn); }
.br-callout-try { --co: var(--ok); }
.br-callout-myth { --co: var(--danger); }
.br-callout-important { --co: var(--cyan); }
.br-callout-analogy { --co: var(--violet); }
.br-callout-summary { --co: var(--cyan); }
.br-callout-interview { --co: #ff8fd8; }
.br-callout-answer { --co: var(--muted); }
details.br-callout > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.br-callout > summary::-webkit-details-marker { display: none; }
details.br-callout > summary::after { content: "펼치기 ▾"; font-size: 12px; opacity: .8; font-weight: 600; }
details.br-callout[open] > summary::after { content: "접기 ▴"; }
details.br-callout .br-callout-body { animation: br-rise .35s var(--ease) both; }
/* 아래 단추 줄 */
.br-lesson-foot { position: sticky; bottom: 12px; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg-2) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.br-lesson-acts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.br-btn-done { min-width: 150px; background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #061018; border: 0; font-size: 15px; box-shadow: 0 8px 26px rgba(77, 227, 255, .25); }
html[data-theme="light"] .br-btn-done { color: #fff; }
.br-btn-done.is-on { background: var(--ok); color: #04150c; box-shadow: 0 8px 26px rgba(61, 220, 151, .3); }
.br-btn-done.is-pop { animation: br-pop .6s var(--ease); }
@keyframes br-pop { 30% { transform: scale(1.08); } 60% { transform: scale(.98); } }
.br-btn-review.is-on { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
body.br-celebrate::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; background: radial-gradient(circle at 50% 70%, rgba(61, 220, 151, .22), transparent 55%); animation: br-flash 1.1s ease-out forwards; }
@keyframes br-flash { from { opacity: 1; } to { opacity: 0; } }
/* 오른쪽 패널 */
.br-panel { position: sticky; top: 74px; display: grid; grid-template-rows: auto 1fr; max-height: calc(100dvh - 92px); border-radius: var(--r); border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; }
.br-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.br-tabs button { flex: 1; padding: 9px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; transition: background .2s, color .2s; }
.br-tabs button.is-on { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.br-tabs .br-panel-close { flex: 0 0 38px; display: none; }
.br-tabpane { display: grid; min-height: 0; animation: br-rise .35s var(--ease) both; }
.br-tabpane[hidden] { display: none; }
.br-tabpane[data-pane="memo"] { grid-template-rows: 1fr auto; }
#br-memo { width: 100%; min-height: 320px; height: 100%; resize: none; border: 0; background: transparent; padding: 14px 16px; line-height: 1.7; font-size: 14.5px; outline: none; }
#br-memo::placeholder { color: var(--muted); }
.br-memo-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.br-memo-foot .br-muted { transition: color .3s; }
.br-memo-foot .is-saving { color: var(--warn); }
.br-tabpane[data-pane="help"] { grid-template-rows: 1fr auto auto auto; }
.br-chat { overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; min-height: 220px; }
.br-chat-empty { color: var(--muted); font-size: 13px; padding: 10px; text-align: center; }
.br-msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.65; animation: br-rise .35s var(--ease) both; }
.br-msg.is-user { justify-self: end; background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 30%, var(--card-2)), color-mix(in srgb, var(--violet) 30%, var(--card-2))); border: 1px solid var(--line-2); }
.br-msg.is-bot { justify-self: start; background: var(--card-2); border: 1px solid var(--line); }
.br-msg.is-bot .br-md-mini > :first-child { margin-top: 0; } .br-msg.is-bot .br-md-mini > :last-child { margin-bottom: 0; }
.br-md-mini p { margin: 0 0 8px; } .br-md-mini ul, .br-md-mini ol { margin: 0 0 8px; padding-left: 20px; } .br-md-mini pre { margin: 6px 0; padding: 10px; border-radius: 10px; background: #050912; overflow: auto; font-size: 12.5px; } .br-md-mini code { font-family: var(--mono); font-size: .9em; }
.br-md-mini h1, .br-md-mini h2, .br-md-mini h3 { font-size: 15px; margin: 8px 0 4px; }
.br-md-mini .br-callout { margin: 8px 0; }
.br-msg-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.br-msg-foot button { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; }
.br-msg-foot button:hover { border-color: var(--cyan); color: var(--cyan); }
.br-msg.is-err { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.br-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.br-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: br-dot 1.2s ease-in-out infinite; }
.br-typing i:nth-child(2) { animation-delay: .15s; } .br-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes br-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.br-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.br-quick button { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 700; transition: border-color .2s, color .2s, transform .15s; }
.br-quick button:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.br-ask { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px 6px; }
.br-ask textarea { resize: none; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); padding: 10px 12px; font-size: 14px; line-height: 1.5; outline: none; transition: border-color .2s, box-shadow .2s; }
.br-ask textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(77, 227, 255, .15); }
.br-help-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 12px 10px; font-size: 12px; }
.br-help-foot select { border-radius: 8px; border: 1px solid var(--line-2); background: var(--card-2); padding: 4px 8px; font-size: 12px; }
.br-panel-fab { display: none; }

/* ── 메모 모음 ── */
.br-memo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.br-memo-card { display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); transition: transform .25s var(--ease), border-color .2s; }
.br-memo-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.br-memo-card h3 { font-size: 15px; font-weight: 800; }
.br-memo-card h3 small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.br-memo-card .br-md-mini { font-size: 14px; color: var(--ink-2); max-height: 180px; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); }
.br-memo-card time { color: var(--muted); font-size: 12px; }
.br-empty { display: grid; place-items: center; gap: 10px; padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }

/* ── 로그인 ── */
.br-login { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); }
.br-login-card { width: min(100%, 400px); display: grid; gap: 14px; padding: 30px 28px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--card-2); box-shadow: var(--shadow), var(--glow); text-align: center; }
.br-login-card h1 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.br-login-card form { display: grid; gap: 10px; text-align: left; }
.br-login-card label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.br-login-card input { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.br-login-card input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(77, 227, 255, .15); }
.br-login-brain { display: flex; justify-content: center; gap: 8px; height: 22px; align-items: center; }
.br-login-brain span { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: br-dot 1.4s ease-in-out infinite; }
.br-login-brain span:nth-child(2) { animation-delay: .2s; background: var(--violet); box-shadow: 0 0 10px var(--violet); } .br-login-brain span:nth-child(3) { animation-delay: .4s; }
.br-captcha { min-height: 0; display: flex; justify-content: center; }
.br-login-foot { font-size: 13px; color: var(--muted); }
.br-login-foot a:hover { color: var(--cyan); }

/* ── 반응형 ── */
@media (max-width: 1040px) {
  .br-lesson { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 900px) {
  .br-hero { grid-template-columns: 1fr; min-height: 0; }
  .br-brain { min-height: 300px; height: min(46vh, 380px); }
  .br-hero-copy { padding: 6px 22px 26px; }
  .br-lobby-grid { grid-template-columns: 1fr; }
  .br-lesson { grid-template-columns: minmax(0, 1fr); }
  .br-panel { position: fixed; inset: auto 0 0 0; top: auto; z-index: 25; max-height: 82dvh; height: 72dvh; border-radius: 20px 20px 0 0; transform: translateY(104%); transition: transform .45s var(--ease); box-shadow: var(--shadow); background: color-mix(in srgb, var(--bg-2) 94%, transparent); }
  .br-panel.is-open { transform: none; }
  .br-tabs .br-panel-close { display: grid; place-items: center; }
  .br-panel-fab { position: fixed; right: 14px; bottom: 86px; z-index: 24; display: grid; gap: 8px; }
  .br-panel-fab button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(10px); font-size: 20px; box-shadow: var(--shadow); transition: transform .2s var(--ease); }
  .br-panel-fab button:active { transform: scale(.92); }
  .br-lesson-foot { grid-template-columns: 1fr; gap: 8px; padding: 8px; }
  .br-lesson-foot .br-nav-prev, .br-lesson-foot .br-nav-next { display: none; }
  .br-lesson-acts { display: grid; grid-template-columns: 1fr 1.4fr; }
  .br-node-head { grid-template-columns: 1fr; }
  .br-ring { width: 92px; height: 92px; }
}
@media (max-width: 640px) {
  .br-top { height: 54px; gap: 8px; }
  .br-logo-text { display: none; }
  .br-nav { margin-left: 0; }
  .br-nav a { padding: 6px 9px; font-size: 13px; }
  .br-top-pct span { display: none; }
  .br-top-pct { padding: 3px; }
  .br-main { padding: 14px 12px 110px; }
  .br-title { font-size: clamp(30px, 9vw, 40px); }
  .br-hero-actions .br-btn { flex: 1 1 100%; }
  .br-card { padding: 16px; }
  .br-lrow { grid-template-columns: 24px 1fr; }
  .br-lrow-meta { grid-column: 2; justify-content: flex-start; }
  .br-md { padding: 4px 16px 8px; font-size: 15.5px; }
  .br-md h2 { font-size: 19px; }
  .br-lesson-head { padding: 18px 16px; }
  .br-md table { font-size: 13px; }
  .br-dom-bar { grid-template-columns: 26px 1fr 40px; }
  .br-path-dom { padding: 14px; }
  .br-login-card { padding: 24px 18px; }
}
@media (max-width: 400px) {
  .br-top { gap: 6px; padding: 0 10px; }
  .br-nav a { padding: 6px 6px; font-size: 12.5px; }
  .br-icon-btn { width: 30px; height: 30px; font-size: 14px; }
  .br-top-pct svg { width: 22px; height: 22px; }
  .br-quick button { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .br-reveal { opacity: 1; transform: none; }
}
