/* 달인 연구소 — VS Code 감성 테마 */
:root, [data-theme="dark"] {
  --bg: #1e1e1e; --panel: #252526; --panel2: #2d2d30; --act: #333333; --line: #3c3c3c;
  --text: #d4d4d4; --muted: #8b8b8b; --strong: #ffffff;
  --accent: #3794ff; --accent-bg: #0e639c; --status: #007acc;
  --kw: #569cd6; --str: #ce9178; --cmt: #6a9955; --fn: #dcdcaa; --num: #b5cea8; --type: #4ec9b0; --pink: #c586c0;
  --card: #252526; --card-hover: #2a2d2e; --shadow: 0 8px 30px rgba(0,0,0,.35);
}
[data-theme="light"] {
  --bg: #ffffff; --panel: #f3f3f3; --panel2: #e8e8e8; --act: #2c2c2c; --line: #e0e0e0;
  --text: #333333; --muted: #6e6e6e; --strong: #111111;
  --accent: #005fb8; --accent-bg: #005fb8; --status: #005fb8;
  --kw: #0000ff; --str: #a31515; --cmt: #008000; --fn: #795e26; --num: #098658; --type: #267f99; --pink: #af00db;
  --card: #f8f8f8; --card-hover: #eef4fb; --shadow: 0 8px 30px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", system-ui, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
code, kbd, .mono { font-family: "Cascadia Code", Consolas, "D2Coding", monospace; }
.muted { color: var(--muted); } .small { font-size: 13px; }
[hidden] { display: none !important; }

/* 창 구조 */
.window { display: grid; grid-template-rows: 36px 1fr 24px; height: 100vh; height: 100dvh; }
.titlebar { display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--act); color: #ccc; border-bottom: 1px solid #00000040; }
[data-theme="light"] .titlebar { background: #dddddd; color: #333; }
.dots { display: flex; gap: 7px; } .dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; } .dots i:nth-child(2){background:#febc2e} .dots i:nth-child(3){background:#28c840}
.cmd-trigger { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; color: var(--muted); font-size: 13px; }
.cmd-trigger span { flex: 1; text-align: left; }
kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); color: var(--muted); }
.title-actions { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.icon-btn { background: none; border: 0; font-size: 16px; padding: 4px; }
.body { display: grid; grid-template-columns: 52px 230px 1fr; min-height: 0; }

/* 활동 막대 */
.activitybar { background: var(--act); display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
[data-theme="light"] .activitybar { background: #2c2c2c; }
.activitybar a { position: relative; width: 52px; height: 50px; display: grid; place-items: center; color: #858585; border-left: 2px solid transparent; text-decoration: none; }
.activitybar a span { font-size: 21px; filter: grayscale(.6); }
.activitybar a em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.activitybar a.active { border-left-color: var(--strong); } .activitybar a.active span, .activitybar a:hover span { filter: none; }
[data-theme="light"] .activitybar a.active { border-left-color: #fff; }
.activitybar .bottom { margin-top: auto; }
.badge { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--status); color: #fff; font-size: 10px; display: grid; place-items: center; font-style: normal; }

/* 탐색기 */
.explorer { background: var(--panel); border-right: 1px solid var(--line); padding: 8px 0; overflow: auto; font-size: 13.5px; }
.ex-head { padding: 4px 20px 8px; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.ex-group { padding: 3px 12px; font-weight: 700; font-size: 12px; color: var(--strong); }
.explorer > a { display: block; padding: 3px 12px 3px 26px; color: var(--text); text-decoration: none; }
.explorer > a:hover { background: var(--card-hover); }
.explorer > a.active { background: #37373d; color: #fff; } [data-theme="light"] .explorer > a.active { background: #e4e6f1; color: #000; }
.fav-list { padding: 2px 12px 2px 26px; } .fav-list a { display: block; padding: 2px 0; color: var(--text); }

/* 편집기 */
.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--line); height: 35px; flex-shrink: 0; }
.tab { padding: 0 16px; display: flex; align-items: center; font-size: 13px; background: var(--bg); border-top: 1px solid var(--accent); color: var(--strong); }
.notice { padding: 7px 24px; background: linear-gradient(90deg, #0e639c33, transparent); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.content { flex: 1; overflow: auto; padding: 28px clamp(16px, 4vw, 48px) 40px; outline: none; }
.site-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--panel); }
.site-foot a { color: var(--muted); }
.statusbar { display: flex; align-items: center; gap: 14px; padding: 0 10px; background: var(--status); color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; }
.statusbar .grow { flex: 1; }

/* 공통 블록 */
.wrap { max-width: 1120px; margin: 0 auto; }
h1, h2, h3 { color: var(--strong); line-height: 1.3; margin: 0; }
.h-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 38px 0 14px; }
.h-sec h2 { font-size: 20px; } .h-sec h2::before { content: "## "; color: var(--kw); font-family: Consolas, monospace; }
.h-sec a { font-size: 13px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; transition: border-color .15s, background .15s, transform .15s; }
.card:hover { border-color: var(--accent); background: var(--card-hover); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); font-size: 12.5px; color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent-bg); background: var(--accent-bg); color: #fff; font-size: 13.5px; text-decoration: none !important; }
.btn:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 4px; background: var(--panel2); color: var(--muted); }
.st-live { color: #3fb950; } .st-soon { color: #d29922; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

/* 홈: 히어로 */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.02em; margin: 6px 0 10px; }
.hero h1 .hl { background: linear-gradient(transparent 60%, #3794ff55 60%); }
.hero p.lead { color: var(--muted); margin: 0 0 18px; font-size: 16px; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3fb950; }
.searchbox { display: flex; gap: 8px; margin-bottom: 10px; } .searchbox input { flex: 1; }
.code { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 0; font-family: "Cascadia Code", Consolas, monospace; font-size: 13.5px; overflow: auto; }
.code div { padding: 0 16px; white-space: pre; } .code .ln { display: inline-block; width: 26px; color: #6e7681; user-select: none; }
.c-kw{color:var(--kw)} .c-str{color:var(--str)} .c-cmt{color:var(--cmt)} .c-fn{color:var(--fn)} .c-num{color:var(--num)} .c-type{color:var(--type)}

/* 홈: 오늘 정보 위젯 */
.today { display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 1fr; gap: 14px; margin-top: 28px; }
.w-title { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.w-title button { background: none; border: 0; color: var(--accent); font-size: 12px; padding: 0; }
.w-big { font-size: 28px; font-weight: 700; color: var(--strong); font-variant-numeric: tabular-nums; }
.w-sub { font-size: 13px; color: var(--muted); }
.meal-list { margin: 0; padding: 0; list-style: none; font-size: 14px; } .meal-list li::before { content: "· "; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.stat b { display: block; font-size: 24px; color: var(--strong); font-variant-numeric: tabular-nums; } .stat span { font-size: 12.5px; color: var(--muted); }

/* 앱 카드 */
.app-card { display: flex; flex-direction: column; gap: 8px; position: relative; }
.app-card .top { display: flex; gap: 12px; align-items: flex-start; }
.app-ico { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; font-size: 24px; border-radius: 10px; background: var(--panel2); }
.app-card h3 { font-size: 16px; } .app-card p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.app-card .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.app-card .actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.fav-btn { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 18px; color: var(--muted); }
.fav-btn.on { color: #e3b341; }
.rank { counter-reset: r; display: grid; gap: 8px; }
.rank a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.rank a:hover { border-color: var(--accent); }
.rank a::before { counter-increment: r; content: counter(r); font-weight: 800; font-size: 20px; color: var(--accent); width: 22px; text-align: center; }
.rank b { color: var(--strong); } .rank small { color: var(--muted); margin-left: auto; font-size: 12px; white-space: nowrap; }

/* 인사이트 */
.post-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none !important; }
.post-card .thumb { aspect-ratio: 16/8; border-radius: 8px; background: linear-gradient(135deg, #0e639c, #6a9955); display: grid; place-items: center; font-size: 40px; margin-bottom: 6px; }
.post-card h3 { font-size: 17px; } .post-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: 30px; margin: 8px 0 6px; } .article .meta { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.article .md h2 { font-size: 21px; margin: 32px 0 10px; } .article .md h3 { font-size: 17px; margin: 24px 0 8px; }
.article .md p, .article .md li { font-size: 16px; line-height: 1.85; }
.article .md pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow: auto; }
.article .md code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: .9em; } .article .md pre code { background: none; padding: 0; }
.article .md blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.article .md img { max-width: 100%; border-radius: 8px; }
.article .md table { border-collapse: collapse; } .article .md td, .article .md th { border: 1px solid var(--line); padding: 6px 10px; }

/* 게시판·댓글 */
.post-form { display: grid; gap: 8px; } .post-form .row { display: grid; grid-template-columns: 160px 1fr; gap: 8px; }
.feed { display: grid; gap: 10px; margin-top: 16px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.msg .who { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; } .msg .who b { color: var(--strong); }
.msg .text { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.msg .reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--panel2); border-radius: 0 8px 8px 0; font-size: 14px; white-space: pre-wrap; }

/* 팔레트·모달 */
.palette { position: fixed; inset: 0; background: #0006; display: flex; justify-content: center; padding-top: 10vh; z-index: 50; }
.palette-box { width: min(620px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; align-self: flex-start; }
.palette-box input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 16px; background: var(--panel); }
.palette-box ul { list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow: auto; }
.palette-box li { padding: 7px 16px; display: flex; gap: 10px; cursor: pointer; font-size: 14px; }
.palette-box li small { margin-left: auto; color: var(--muted); }
.palette-box li.sel { background: var(--accent-bg); color: #fff; } .palette-box li.sel small { color: #ddd; }
.modal { position: fixed; inset: 0; background: #0008; display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal-box { position: relative; width: min(560px, 100%); max-height: 86vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); }
.modal-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 24px; color: var(--muted); }
.modal-box h3 { margin-bottom: 8px; }

.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 20px; display: grid; gap: 18px; }
.timeline .item { position: relative; } .timeline .item::before { content: ""; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; } details.faq summary { cursor: pointer; font-weight: 600; color: var(--strong); }
details.faq p { margin: 8px 0 0; color: var(--muted); }

/* 반응형 */
@media (max-width: 1100px) { .today { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .body { grid-template-columns: 1fr; grid-template-rows: 1fr 58px; }
  .explorer { display: none; }
  .activitybar { order: 2; flex-direction: row; justify-content: space-around; padding: 0; border-top: 1px solid var(--line); }
  .activitybar a { height: 58px; flex: 1; border-left: 0; border-top: 2px solid transparent; gap: 0; }
  .activitybar a em { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: block; font-style: normal; font-size: 11.5px; margin-top: -6px; }
  .activitybar a.active { border-top-color: var(--accent); color: #fff; }
  .activitybar .bottom { margin-top: 0; }
  .hero { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .window { grid-template-rows: 44px 1fr 0; } .statusbar { display: none; }
  .cmd-trigger kbd, .visit-mini, .dots { display: none; }
  .editor { overflow: auto; } .content { padding: 20px 16px 32px; overflow: visible; flex: none; }
  .tabs { display: none; }
  .post-form .row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .today { grid-template-columns: 1fr; } .g2, .g3 { grid-template-columns: 1fr; } .activitybar a[data-route="changelog"] { display: none; } }

/* ===== 연구소 테마 ===== */
.ws-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.content { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 28px 28px; background-attachment: local; }
:root, [data-theme="dark"] { --grid: #ffffff08; --lab: #3fb950; }
[data-theme="light"] { --grid: #0000000a; --lab: #1a7f37; }
.ex-director { display: flex; gap: 10px; align-items: center; margin: 0 12px 12px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ex-director img { width: 38px; height: 38px; border-radius: 50%; background: var(--panel2); }
.ex-director b { display: block; font-size: 13px; color: var(--strong); } .ex-director span { font-size: 11.5px; color: var(--muted); }
.eyebrow::before { background: var(--lab); box-shadow: 0 0 0 3px #3fb95033; }
.lab-hero { position: relative; min-height: 360px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 70% 30%, #3794ff22, transparent 60%), linear-gradient(var(--grid) 1px, transparent 1px) 0 0/20px 20px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0/20px 20px, var(--panel);
  display: flex; align-items: flex-end; justify-content: flex-end; padding-right: 6%; }
.lab-hero::before { content: "🧪  ⚗️  🔬"; position: absolute; left: 20px; top: 120px; font-size: 22px; opacity: .55; letter-spacing: 4px; }
.director { height: 340px; width: auto; position: relative; z-index: 1; filter: drop-shadow(0 10px 18px #0006); margin-bottom: -6px; }
.bubble { position: absolute; top: 18px; left: 18px; z-index: 2; max-width: 46%; background: var(--bg); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--strong); box-shadow: var(--shadow); }
.bubble small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; } .bubble b { color: var(--accent); }
.lab-badge { position: absolute; left: 14px; bottom: 14px; z-index: 2; display: flex; gap: 8px; align-items: center; padding: 6px 12px 6px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.lab-badge img { width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); } .lab-badge b { display: block; color: var(--strong); } .lab-badge span { color: var(--muted); }
.exp-no { font-family: Consolas, "Cascadia Code", monospace; font-size: 11.5px; color: var(--lab); letter-spacing: .04em; }
a.plain { color: inherit; } a.plain:hover { color: var(--accent); text-decoration: none; }
.app-ico.img, .rank-ico.img, .detail-ico.img { object-fit: cover; padding: 0; }
.rank-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: var(--panel2); display: grid; place-items: center; font-size: 22px; }
.detail-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; padding: 24px; }
.detail-ico { width: 96px; height: 96px; flex: 0 0 96px; border-radius: 20px; background: var(--panel2); display: grid; place-items: center; font-size: 52px; }
.detail-head .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; } .shots img { height: 260px; border-radius: 10px; border: 1px solid var(--line); }
.feat { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.reply .av { width: 22px; height: 22px; border-radius: 50%; vertical-align: -6px; background: var(--panel2); }
.av-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--panel2); margin-bottom: 6px; }
@media (max-width: 900px) { .ws-name { display: none; } .lab-hero { min-height: 300px; } .director { height: 280px; } .bubble { max-width: 50%; font-size: 13px; } .lab-hero::before { top: 130px; font-size: 18px; } }

/* =========================================================
   윈도우 스타일 (VS Code Light/Dark Modern, Windows 11 느낌)
   ========================================================= */
:root, [data-theme="light"] {
  --bg: #ffffff; --panel: #f8f8f8; --panel2: #ececec; --act: #f8f8f8; --line: #d6d6d6;
  --text: #1f1f1f; --muted: #5c5c5c; --strong: #000000;
  --accent: #005fb8; --accent-bg: #005fb8; --status: #f8f8f8; --status-fg: #3b3b3b;
  --title: #f3f3f3; --title-fg: #1f1f1f; --win-hover: #e5e5e5;
  --card: #ffffff; --card-hover: #f2f7fc; --grid: #0000000b; --lab: #0f7b0f; --warn: #8a5300;
  --kw: #0000ff; --str: #a31515; --cmt: #008000; --fn: #795e26; --num: #098658; --type: #267f99;
  --focus: #0050a0; --shadow: 0 8px 24px rgba(0,0,0,.14);
}
[data-theme="dark"] {
  --bg: #1f1f1f; --panel: #181818; --panel2: #2b2b2b; --act: #181818; --line: #3c3c3c;
  --text: #e6e6e6; --muted: #a8a8a8; --strong: #ffffff;
  --accent: #4daafc; --accent-bg: #0078d4; --status: #181818; --status-fg: #cccccc;
  --title: #181818; --title-fg: #e6e6e6; --win-hover: #2d2d2d;
  --card: #232323; --card-hover: #2a2d2e; --grid: #ffffff09; --lab: #4ec36b; --warn: #e3b341;
  --kw: #569cd6; --str: #ce9178; --cmt: #6a9955; --fn: #dcdcaa; --num: #b5cea8; --type: #4ec9b0;
  --focus: #ffd34d; --shadow: 0 8px 30px rgba(0,0,0,.45);
}
body { font-family: "Pretendard Variable", Pretendard, "Segoe UI Variable", "Segoe UI", "Malgun Gothic", system-ui, sans-serif; }
.titlebar { height: 100%; padding: 0 0 0 10px; background: var(--title); color: var(--title-fg); border-bottom: 1px solid var(--line); gap: 10px; }
[data-theme="light"] .titlebar { background: var(--title); color: var(--title-fg); }
.app-logo { width: 22px; height: 22px; border-radius: 4px; vertical-align: -6px; margin-right: 4px; background: var(--panel2); }
.ws-name { color: var(--title-fg); text-decoration: none !important; font-size: 13px; }
.cmd-trigger { border-radius: 6px; background: var(--bg); min-height: 28px; }
.title-actions { gap: 4px; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--title-fg); font-size: 12.5px; }
.tb-btn:hover, .win-ctrl button:hover { background: var(--win-hover); }
.tb-btn[aria-pressed="true"] { border-color: var(--accent-bg); }
.win-ctrl { display: flex; align-self: stretch; margin-left: 6px; }
.win-ctrl button { width: 46px; border: 0; background: transparent; color: var(--title-fg); font-size: 14px; }
.activitybar { background: var(--act); border-right: 1px solid var(--line); }
[data-theme="light"] .activitybar { background: var(--act); }
.activitybar a { color: var(--muted); border-radius: 0; }
.activitybar a.active { border-left-color: var(--accent-bg); color: var(--strong); }
[data-theme="light"] .activitybar a.active { border-left-color: var(--accent-bg); }
.activitybar a span { filter: grayscale(.35); }
.explorer > nav > a { display: block; padding: 4px 12px 4px 26px; color: var(--text); text-decoration: none; min-height: 30px; }
.explorer > nav > a:hover { background: var(--card-hover); }
.explorer > nav > a.active { background: #0078d422; color: var(--strong); box-shadow: inset 2px 0 0 var(--accent-bg); }
.explorer h2.ex-group { font-size: 12px; margin: 14px 0 4px; }
.tab { border-top: 2px solid var(--accent-bg); }
.statusbar { background: var(--status); color: var(--status-fg); border-top: 1px solid var(--line); }
.card, .app-card, .rank a, .modal-box, .palette-box, .lab-hero, .detail-head { border-radius: 8px; }
.btn { border-radius: 4px; min-height: 40px; padding: 8px 16px; }
.chip { min-height: 36px; padding: 4px 14px; }
.fav-btn { width: 40px; height: 40px; top: 6px; right: 6px; border-radius: 4px; }
.w-title button { min-height: 32px; padding: 0 6px; border-radius: 4px; }
.w-title button:hover { background: var(--card-hover); }
.st-live { color: var(--lab); } .st-soon { color: var(--warn); }
.eyebrow::before { background: var(--lab); }
.notice { background: linear-gradient(90deg, #0078d41f, transparent); margin: 0; }
/* 윈도우 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: #8a8a8a66 transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; } ::-webkit-scrollbar-thumb { background: #8a8a8a66; border: 3px solid transparent; background-clip: padding-box; border-radius: 6px; }
body.side-off .body { grid-template-columns: 52px 0 1fr; } body.side-off .explorer { display: none; }

/* =========================================================
   ♿ 접근성 (KWCAG 2.2)
   ========================================================= */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 16px; background: #000; color: #fff !important; font-weight: 700; border-radius: 4px; text-decoration: underline; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; border-radius: 3px; box-shadow: 0 0 0 5px var(--bg); }
.content:focus, h1:focus { outline: none; box-shadow: none; }
.nw { font-size: .8em; margin-left: 2px; opacity: .8; }
.req { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.post-form label { font-size: 13.5px; font-weight: 600; color: var(--strong); display: block; margin-bottom: 4px; }
.post-form .row > div { min-width: 0; }
.form-err { color: #c50f1f; font-weight: 600; margin: 0; min-height: 1em; }
[data-theme="dark"] .form-err { color: #ff99a4; }
[aria-invalid="true"] { border-color: #c50f1f !important; outline: 2px solid #c50f1f; }
.h-modal { font-size: 19px; margin-bottom: 8px; }
.pal-help { margin: 0; padding: 6px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.kbd-table { border-collapse: collapse; width: 100%; } .kbd-table th, .kbd-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; } .kbd-table th { background: var(--panel2); }
.reading { outline: 3px dashed var(--accent) !important; outline-offset: 3px; background: #0078d414 !important; }
body.noscroll { overflow: hidden; }
/* 편의 기능 패널 */
.a11y-wrap { position: fixed; inset: 0; z-index: 70; background: #0007; display: flex; justify-content: flex-end; }
.a11y-panel { width: min(420px, 100%); height: 100%; overflow: auto; background: var(--bg); color: var(--text); padding: 18px 20px 28px; border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.a11y-head { display: flex; justify-content: space-between; align-items: center; } .a11y-head h2 { font-size: 20px; }
.a11y-head .modal-x { position: static; width: 44px; height: 44px; }
.a11y-panel fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 14px 0 0; padding: 10px 14px 14px; }
.a11y-panel legend { font-weight: 700; color: var(--strong); padding: 0 6px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-weight: 700; background: var(--panel); }
.seg label:nth-of-type(2) { font-size: 17px; } .seg label:nth-of-type(3) { font-size: 20px; } .seg label:nth-of-type(4) { font-size: 23px; }
.seg input:checked + label { background: var(--accent-bg); color: #fff; border-color: var(--accent-bg); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: 0; }
.opt input[type=checkbox] { appearance: none; flex: 0 0 46px; width: 46px; height: 26px; border-radius: 13px; background: var(--panel2); border: 1px solid var(--muted); position: relative; cursor: pointer; margin-top: 2px; padding: 0; }
.opt input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.opt input:checked { background: var(--accent-bg); border-color: var(--accent-bg); } .opt input:checked::after { left: 23px; background: #fff; }
.opt label { cursor: pointer; } .opt label b { display: block; color: var(--strong); } .opt label span { font-size: 13px; color: var(--muted); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.a11y-panel select { margin-top: 4px; }
/* 글자 크기 */
.a11y-font-1 .content, .a11y-font-1 .a11y-panel, .a11y-font-1 .explorer { zoom: 1.2; }
.a11y-font-2 .content, .a11y-font-2 .a11y-panel, .a11y-font-2 .explorer { zoom: 1.4; }
.a11y-font-3 .content, .a11y-font-3 .a11y-panel, .a11y-font-3 .explorer { zoom: 1.7; }
/* 읽기 쉬운 간격 */
.a11y-spacing .content { letter-spacing: .05em; word-spacing: .16em; }
.a11y-spacing .content p, .a11y-spacing .content li, .a11y-spacing .content .w-sub { line-height: 2 !important; }
.a11y-spacing .content p { margin-bottom: 1.2em; }
/* 링크 밑줄 */
.a11y-underline a:not(.btn):not(.chip) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; }
.a11y-underline .btn, .a11y-underline .chip { outline: 2px solid currentColor; outline-offset: -4px; }
/* 큰 포인터 */
.a11y-cursor, .a11y-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M3 2l7 19 2.6-7.4L20 11z' fill='%23000' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important; }
/* 움직임 줄이기 */
.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* 고대비 */
html.a11y-contrast {
  --bg: #000000; --panel: #000000; --panel2: #1a1a1a; --act: #000000; --line: #ffffff;
  --text: #ffffff; --muted: #ffff00; --strong: #ffff00; --accent: #00ffff; --accent-bg: #ffff00;
  --status: #000; --status-fg: #fff; --title: #000; --title-fg: #fff; --win-hover: #333;
  --card: #000; --card-hover: #1a1a1a; --grid: transparent; --lab: #7cff7c; --warn: #ffd000; --focus: #00ffff;
  --kw: #00ffff; --str: #ffff00; --cmt: #7cff7c; --fn: #fff; --num: #fff; --type: #00ffff;
}
html.a11y-contrast .btn { color: #000; } html.a11y-contrast .btn.ghost { color: #fff; border-color: #fff; }
html.a11y-contrast .chip.on, html.a11y-contrast .seg input:checked + label { color: #000; }
html.a11y-contrast .lab-hero { background: #000; } html.a11y-contrast .hl { background: none; text-decoration: underline; }
html.a11y-contrast a { text-decoration: underline; }
html.a11y-contrast .notice { background: #000; }
html.a11y-contrast img.director { background: #fff; border-radius: 12px; }
@media (max-width: 900px) {
  .tb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tb-btn { width: 40px; height: 36px; justify-content: center; padding: 0; font-size: 17px; }
  .win-ctrl, .ws-name { display: none; }
  .titlebar { padding: 0 8px; }
  .activitybar a { min-height: 58px; }
  .a11y-font-2 .content, .a11y-font-3 .content { zoom: 1.3; }
}

.card-h { font-size: 16px; margin: 0; }

/* =========================================================
   사이드바 (제미나이식 접기/펼치기) — 레이아웃 재구성
   ========================================================= */
.window { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr; height: 100vh; height: 100dvh; }
.main-col { display: grid; grid-template-rows: 44px 1fr 24px; min-width: 0; min-height: 0; }
.editor { min-height: 0; }
.titlebar { padding: 0 0 0 14px; }
.m-logo { display: none; }
.cmd-trigger { margin: 0; max-width: 560px; }
.title-actions { margin-left: auto; }
.sidebar { width: 264px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden auto; transition: width .18s ease; }
.sb-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 12px; min-height: 60px; }
.sb-logo { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; }
.sb-logo img { width: 36px; height: 36px; border-radius: 50%; }
.sb-logo:hover { box-shadow: 0 0 0 3px var(--card-hover); }
.sb-brand { flex: 1; font-weight: 800; font-size: 17px; color: var(--strong); text-decoration: none !important; white-space: nowrap; }
.sb-close { flex: 0 0 40px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; position: relative; }
.sb-close:hover, .sb-close:focus-visible { background: var(--panel2); color: var(--strong); }
.sb-close:hover::after, .sb-nav a:hover::after { pointer-events: none; }
/* 버튼 말풍선 (마우스·키보드 초점 모두) */
.sb-close::after { content: attr(title); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); padding: 6px 10px; border-radius: 6px; background: var(--strong); color: var(--bg); font-size: 12.5px; white-space: nowrap; opacity: 0; visibility: hidden; z-index: 30; }
.sb-close:hover::after, .sb-close:focus-visible::after { opacity: 1; visibility: visible; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; outline: none; }
.sb-nav a { position: relative; display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 12px; border-radius: 22px; color: var(--text); text-decoration: none !important; font-size: 14.5px; }
.sb-nav a .ico { width: 24px; text-align: center; font-size: 19px; filter: grayscale(.25); }
.sb-nav a em { font-style: normal; white-space: nowrap; }
.sb-nav a:hover { background: var(--panel2); }
.sb-nav a.active { background: #0078d424; color: var(--strong); font-weight: 700; }
html.a11y-contrast .sb-nav a.active { background: #333; outline: 2px solid #ffff00; }
.sb-nav .badge { position: static; margin-left: auto; }
.sb-title { font-size: 12.5px; color: var(--muted); font-weight: 700; margin: 18px 20px 6px; }
.sb-favs .fav-list { padding: 0 12px 0 20px; } .fav-list a { padding: 6px 0; min-height: 32px; display: block; }
.sb-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.sb-foot img { width: 36px; height: 36px; border-radius: 50%; background: var(--panel2); }
.sb-foot b { display: block; color: var(--strong); font-size: 13px; } .sb-foot span { color: var(--muted); }

/* 접힌 상태: 캐릭터 + 아이콘만 */
html.side-closed .sidebar { width: 64px; }
html.side-closed .sb-head { padding: 10px 12px 8px; justify-content: center; }
html.side-closed .sb-brand, html.side-closed .sb-close, html.side-closed .sb-favs, html.side-closed .sb-foot { display: none; }
html.side-closed .sb-nav { padding: 4px 8px; align-items: center; }
html.side-closed .sb-nav a { width: 48px; justify-content: center; padding: 0; gap: 0; }
html.side-closed .sb-nav a em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.side-closed .sb-nav .badge { position: absolute; top: 4px; right: 2px; }
html.side-closed .sb-nav a::after, html.side-closed .sb-logo::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 6px; background: var(--strong); color: var(--bg); font-size: 12.5px; white-space: nowrap; opacity: 0; visibility: hidden; z-index: 30; }
html.side-closed .sb-logo { position: relative; } html.side-closed .sb-logo::after { content: "사이드바 열기"; }
html.side-closed .sb-nav a:hover::after, html.side-closed .sb-nav a:focus-visible::after, html.side-closed .sb-logo:hover::after, html.side-closed .sb-logo:focus-visible::after { opacity: 1; visibility: visible; }
html.side-closed .sidebar { overflow: visible; }

/* 모바일: 아래 메뉴 막대 (안드로이드식) */
@media (max-width: 900px) {
  .window { grid-template-columns: 1fr; grid-template-rows: 1fr 62px; }
  .main-col { grid-template-rows: 52px 1fr 0; grid-row: 1; }
  .sidebar, html.side-closed .sidebar { grid-row: 2; width: auto; flex-direction: row; overflow: visible; border-right: 0; border-top: 1px solid var(--line); }
  .sb-head, .sb-favs, .sb-foot { display: none !important; }
  .sb-nav, html.side-closed .sb-nav { flex-direction: row; flex: 1; padding: 0; gap: 0; align-items: stretch; }
  .sb-nav a, html.side-closed .sb-nav a { flex: 1; width: auto; flex-direction: column; justify-content: center; gap: 2px; padding: 0; min-height: 62px; border-radius: 0; font-size: 11.5px; }
  .sb-nav a em, html.side-closed .sb-nav a em { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .sb-nav a.active { background: transparent; box-shadow: inset 0 3px 0 var(--accent-bg); }
  .sb-nav a.m-hide { display: none; }
  .sb-nav a::after { display: none; }
  .sb-nav .badge, html.side-closed .sb-nav .badge { position: absolute; top: 6px; right: calc(50% - 22px); }
  .m-logo { display: block; flex: 0 0 36px; } .m-logo img { width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); display: block; }
  .titlebar { padding: 0 8px; gap: 8px; }
  .cmd-trigger { flex: 1; }
  .statusbar { display: none; }
}

/* 홈: 모든 실험 아이콘 그리드 (moonsune·kimju 방식) */
.tiles { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; height: 100%; padding: 16px 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.tile b { color: var(--strong); font-size: 15px; line-height: 1.35; }
.tile-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 34px; background: var(--panel2); object-fit: cover; }
.tile-d { font-size: 12.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-t { margin-top: auto; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.tile.soon { border-style: dashed; }
.tile.soon .tile-ico { filter: grayscale(.6); }
@media (max-width: 600px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; } .tile { padding: 12px 4px 10px; } .tile-ico { width: 52px; height: 52px; font-size: 28px; border-radius: 14px; } .tile b { font-size: 13px; } .tile-d { display: none; } }

/* 앱 실행 화면: 연구소 안에서 열고 언제든 돌아오기 */
.runner { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: var(--bg); }
.run-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 52px; background: var(--panel, var(--card)); border-bottom: 2px solid var(--accent); }
.run-back { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 10px; background: var(--accent-bg); color: #fff; font-weight: 800; text-decoration: none; white-space: nowrap; }
.run-name { flex: 1; min-width: 0; margin: 0; font-size: 16px; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); text-decoration: none; white-space: nowrap; }
.run-btn:hover { border-color: var(--accent); }
.run-frame { flex: 1; width: 100%; border: 0; background: #fff; }
body.running { overflow: hidden; }
@media (max-width: 600px) { .run-name { font-size: 14px; } }
