/* 웹소설 해체분석기 — design system (flat, data-first; neutral grays, purple only for active/selection/primary action) */
:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-2: #f6f7f9;
  --th: #fafbfc;
  --line: #e7e9ed;
  --line-soft: #f0f1f4;
  --hover: #f6f4fe;
  --tx: #1a1c21;
  --tx2: #575d6a;
  --tx3: #8d929c;
  --accent: #7c3aed;
  --accent-2: #b39cf2;
  --accent-weak: #f1eafe;
  --on-accent: #fff;
  --up: #e5484d;
  --up-weak: #fdeeee;
  --down: #2f6fed;
  --ok: #12a594;
  --warn: #c27803;
  --tier-s: #f0513c;
  --tier-a: #0a8cf0;
  --tier-b: #12a594;
  --tier-c: #e5a000;
  --tier-d: #9aa1ab;
  --tip-bg: #24262d;
  --r: 6px;
  --r-sm: 4px;
  --row: 44px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  /* legacy aliases used by charts / inline styles */
  --text: var(--tx);
  --muted: var(--tx3);
  --border: var(--line);
  --accent-soft: var(--accent-weak);
  --row-hover: var(--hover);
  --hl-row: var(--accent-weak);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111216;
  --surface: #1a1b20;
  --surface-2: #212228;
  --th: #1e1f25;
  --line: #2c2e35;
  --line-soft: #24262c;
  --hover: #241f33;
  --tx: #eceef2;
  --tx2: #b3b7c0;
  --tx3: #858a94;
  --accent: #a78bfa;
  --accent-2: #6d55b8;
  --accent-weak: #2a2240;
  --on-accent: #150d2a;
  --up: #ff6b6f;
  --up-weak: #3a1d20;
  --down: #6aa0ff;
  --ok: #3cc7b2;
  --warn: #f0b23c;
  --tier-s: #f26652;
  --tier-a: #3aa3f5;
  --tier-b: #22b5a3;
  --tier-c: #e8ad1c;
  --tier-d: #6f7680;
  --tip-bg: #3a3c45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--tx);
  font: 14px/1.45 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--tx); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--tx3); }
.small { font-size: 12px; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
svg.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
svg.ic.sm { width: 14px; height: 14px; }
svg.ic.lg { width: 20px; height: 20px; }

/* ---------- help tooltip (?) — positioned by app.js (.tip-pop) ---------- */
.q { display: inline-grid; place-items: center; color: var(--tx3); cursor: help; outline: 0; vertical-align: middle; margin-left: 2px; }
.q svg.ic { width: 13px; height: 13px; vertical-align: 0; }
.q:hover, .q:focus-visible { color: var(--tx); }
.tip-pop {
  position: fixed; z-index: 200; max-width: 260px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--tip-bg); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0;
  pointer-events: none; white-space: pre-line;
}

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.gnb-row { display: flex; align-items: center; }
.gnb-1 .gnb-row { height: 56px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; white-space: nowrap; color: var(--tx); }
.brand-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--tx); color: var(--surface); flex: none; }
.brand-mark svg.ic { width: 15px; height: 15px; vertical-align: 0; }
.platnav { display: flex; align-self: stretch; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.platnav::-webkit-scrollbar { display: none; }
html.one-plat .platnav { display: none; }
.platnav a { display: flex; align-items: center; gap: 6px; padding: 0 12px; font-weight: 600; color: var(--tx2); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.platnav a:hover { color: var(--tx); }
.platnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.platnav a.dim { color: var(--tx3); opacity: .6; font-weight: 500; }
.platnav a.dim.active { opacity: 1; color: var(--accent); }
.soon { font-style: normal; font-size: 11px; font-weight: 500; }
.gnb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.top-link { display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 32px; color: var(--tx2); font-weight: 500; border-radius: var(--r-sm); white-space: nowrap; }
.top-link:hover, .icon-btn:hover { background: var(--bg); color: var(--tx); }
.top-link.active { color: var(--accent); background: var(--accent-weak); font-weight: 700; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--tx2); border-radius: var(--r-sm); padding: 0; flex: none; }
.icon-btn[aria-expanded="true"] { background: var(--bg); color: var(--tx); }
.gnb-2 { border-top: 1px solid var(--line-soft); }
.gnb-2 .gnb-row { height: 44px; gap: 12px; }
.mainnav { display: flex; align-self: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { display: flex; align-items: center; padding: 0 12px; color: var(--tx2); font-weight: 500; white-space: nowrap; position: relative; flex: none; }
.mainnav a:hover { color: var(--tx); }
.mainnav a.active { color: var(--tx); font-weight: 700; }
.mainnav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--accent); }
.gnb-2 .seg { margin-left: auto; flex: none; flex-wrap: nowrap; }

/* header search popover */
.search-pop { position: relative; }
.search-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: calc(100vw - 32px); z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; box-shadow: 0 8px 24px rgba(20, 22, 30, .08); }
.search-panel input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); outline: 0; }
.search-panel input:focus { border-color: var(--accent); }
.search-panel .search-results { position: static; width: auto; max-width: none; margin-top: 6px; border: 0; box-shadow: none; padding: 0; }

/* global filter row (작품 티어) — not sticky */
.filterbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.filterbar-inner { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.fb-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx3); font-weight: 600; }
.fb-field select { height: 30px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--tx); font-size: 13px; }
.fb-field select:disabled { opacity: .5; }
.fb-note { margin-left: auto; font-size: 12px; color: var(--tx3); }

/* ---------- main + footer ---------- */
main.wrap { padding-top: 24px; padding-bottom: 40px; min-height: 60vh; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-top: 28px; padding-bottom: 40px; font-size: 12px; color: var(--tx3); }
.foot-legal { display: flex; flex-wrap: wrap; gap: 4px 0; }
.foot-legal a { color: var(--tx2); }
.foot-legal a:hover { color: var(--tx); text-decoration: underline; }
.foot-legal a + a::before { content: "·"; margin: 0 6px; color: var(--tx3); }

/* ---------- typography ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.h-page { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.h-page .mkt { font-size: 12px; font-weight: 700; padding: 0 8px; line-height: 22px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--tx2); border: 1px solid var(--line); }
.h-lead { margin: 4px 0 0; color: var(--tx3); font-size: 13px; }
.h-section { font-size: 15px; font-weight: 700; margin: 0; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.h-sub { font-size: 12px; color: var(--tx3); font-weight: 500; white-space: nowrap; }
.h-sub-section { font-size: 13px; font-weight: 700; margin: var(--s4) 0 var(--s2); color: var(--tx2); }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--tx3); display: inline-flex; align-items: center; gap: 2px; }
.link { color: var(--accent); font-weight: 600; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--tx3); }
.intro { white-space: pre-line; color: var(--tx2); margin: 12px 0 0; line-height: 1.6; }

/* ---------- panels (flat; header bar with divider; tables bleed to the edges) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); min-width: 0; }
.panel + .panel { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-height: 52px; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); padding: 8px var(--s4); border-bottom: 1px solid var(--line); }
.panel-head > div:first-child { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.panel-head .more, .more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--tx3); white-space: nowrap; }
.panel-head .more:hover, .more:hover { color: var(--tx); }
.panel-head .chip-row { margin-left: auto; }
.panel > .stat-wrap, .panel > .cm-list, .panel > .list, .panel > .rp-body > .rp-list, .panel > .tier-list, .panel > .cal { margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); }
.panel > .stat-wrap:last-child, .panel > .cm-list:last-child, .panel > .list:last-child, .panel > .tier-list:last-child { margin-bottom: calc(-1 * var(--s4)); }
.panel > .stat-wrap { border: 0; border-radius: 0; }
.panel > .toolbar + .stat-wrap, .panel > .toolbar:first-child { }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s4); align-items: start; }
.layout-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.layout-2 > .panel + .panel, .layout-even > .panel + .panel { margin-top: 0; }
.stack > * + * { margin-top: var(--s4); }
.section-gap { margin-top: var(--s4); }
.section-gap-b { margin-bottom: var(--s4); }
@media (max-width: 1100px) { .layout-2 { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 960px) { .layout-2, .layout-even { grid-template-columns: minmax(0, 1fr); } }

/* ---------- chips / badges (small rects; one per row) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--tx2); border: 1px solid transparent; white-space: nowrap; line-height: 1;
}
.chip.accent { background: var(--accent-weak); color: var(--accent); }
.chip.topic { background: var(--surface); border-color: var(--line); }
a.chip.topic:hover { border-color: var(--tx3); color: var(--tx); }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); }
.chip.paid { color: var(--up); }
.chip.done { color: var(--down); }
.chip.fail { color: var(--tx3); }
button.chip { cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
button.chip.topic.on { color: #fff; }
.chip-row { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.badge-new { display: inline-block; height: 18px; padding: 0 6px; border-radius: var(--r-sm); font-size: 11px; font-weight: 700; line-height: 18px; background: var(--up-weak); color: var(--up); }
.st-text { font-size: 12px; color: var(--tx3); white-space: nowrap; }
.st-text .on { color: var(--ok); font-weight: 600; }
.st-text .off { color: var(--warn); font-weight: 600; }

/* 전환 티어 — numeric pill, distinct from the square work tiers */
.chip.grade { border-radius: 999px; padding: 0 9px 0 2px; gap: 5px; height: 20px; font-size: 11px; background: var(--surface-2); color: var(--tx2); border-color: var(--line); }
.chip.grade .gnum { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 800; color: #fff; background: var(--tier-d); }
.chip.grade.g4 .gnum { background: var(--tier-s); }
.chip.grade.g3 .gnum { background: var(--tier-a); }
.chip.grade.g2 .gnum { background: var(--tier-b); }
.chip.grade.pred { border-style: dashed; }
.chip.grade.pred .gnum { opacity: .8; }

/* work / topic tiers — small squares */
.tier { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-sm); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; flex: none; letter-spacing: 0; vertical-align: middle; }
.tier.sm { width: 16px; height: 16px; font-size: 10px; }
.tier.lg { width: 30px; height: 30px; font-size: 15px; }
.tier-S { background: var(--tier-s); }
.tier-A { background: var(--tier-a); }
.tier-B { background: var(--tier-b); }
.tier-C { background: var(--tier-c); }
.tier-D { background: var(--tier-d); }
.tier-none { background: var(--surface-2); color: var(--tx3); border: 1px dashed var(--line); }

/* 유료 도달 band — dot + colored text (not a badge) */
.chip.rb { background: none; border: 0; padding: 0; height: auto; gap: 5px; font-weight: 600; }
.chip.rb::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.rb.rb-sure { color: var(--accent); }
.chip.rb.rb-high { color: var(--up); }
.chip.rb.rb-unk { color: var(--tx3); }
.chip.rb.rb-low { color: var(--tx3); opacity: .75; }
.chip.rb.rb-early { color: var(--tx3); font-weight: 500; }
.chip.rb.rb-early::before { background: none; border: 1px dashed currentColor; }
.chip.rb.lg { font-size: 18px; font-weight: 800; }
.chip.rb.lg::before { width: 10px; height: 10px; }

/* ---------- segmented control / tabs ---------- */
.seg { display: inline-flex; padding: 2px; background: var(--bg); border-radius: var(--r); gap: 2px; flex-wrap: wrap; }
.seg button, .seg a.seg-a {
  border: 0; background: none; height: 28px; padding: 0 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--tx3);
  display: inline-flex; align-items: center; white-space: nowrap;
}
.seg button:hover, .seg a.seg-a:hover { color: var(--tx); }
.seg button.on, .seg a.seg-a.on { background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.seg button.off { opacity: .45; cursor: not-allowed; }
.seg.sm button { height: 24px; padding: 0 10px; font-size: 12px; }
.tabs, .utabs { position: relative; display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .utabs::-webkit-scrollbar { display: none; }
.tabs a, .utabs button {
  position: relative; display: flex; align-items: center; height: 40px; padding: 0 12px; font-weight: 500; font-size: 14px; color: var(--tx2);
  white-space: nowrap; border: 0; background: none;
}
.tabs a:hover, .utabs button:hover { color: var(--tx); }
.tabs a.active, .utabs button.on { color: var(--tx); font-weight: 700; }
.tabs a.active::after, .utabs button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--accent); }
.tabpanel[hidden] { display: none; }

/* ---------- toolbar / inputs / buttons ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: var(--s3); }
.toolbar select, select.sel { height: 30px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--tx); font-size: 13px; }
.chip-filter { height: 30px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); outline: none; width: 200px; max-width: 100%; }
.chip-filter:focus { border-color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--tx2); height: 30px; }
.toggle input { accent-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px; border: 1px solid var(--accent); cursor: pointer; white-space: nowrap;
}
.btn:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.ghost, .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--tx); border-radius: var(--r-sm); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn.ghost:hover, .btn-ghost:hover { background: var(--bg); color: var(--tx); filter: none; }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; }
.more-btn { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 40px; margin: 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--tx2); font-size: 13px; font-weight: 600; cursor: pointer; }
.more-btn:hover { background: var(--bg); color: var(--tx); }
.panel > .more-btn:last-child, .panel > .stat-wrap + .more-btn { margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); width: calc(100% + 2 * var(--s4)); border-radius: 0 0 var(--r) var(--r); }
.pager { display: flex; justify-content: center; gap: 4px; margin-top: var(--s4); flex-wrap: wrap; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager button:hover { background: var(--bg); }
.pager button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------- search results (hero / header / pickers) ---------- */
.search { position: relative; min-width: 0; }
.search-results {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; min-width: 260px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 0; box-shadow: 0 8px 24px rgba(20, 22, 30, .08);
  max-height: 420px; overflow-y: auto;
}
.search-results a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 14px; }
.search-results a.sel, .search-results a:hover { background: var(--hover); color: inherit; }
.search-results .empty { padding: 12px 14px; color: var(--tx3); font-size: 13px; }
.search-results .row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.search-results .row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search input[type=search]::-webkit-search-cancel-button { display: none; }

/* ---------- home ---------- */
.hero { padding: 12px 0 24px; display: flex; justify-content: center; }
.hero-search { position: relative; display: flex; align-items: center; width: min(720px, 100%); height: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 6px 0 0; }
.hero-search:focus-within { border-color: var(--accent); }
.hs-plat { display: flex; align-items: center; height: 100%; padding: 0 18px; font-size: 13px; font-weight: 700; color: var(--tx2); border-right: 1px solid var(--line); white-space: nowrap; }
.hero-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0 16px; font-size: 16px; background: none; }
.hero-search input::placeholder { color: var(--tx3); }
.btn-primary { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); flex: none; }
.btn-primary:hover { filter: brightness(1.06); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 332px; gap: 16px; align-items: start; }
.home-grid .side { display: grid; gap: 16px; min-width: 0; }
.home-grid .side > .panel + .panel { margin-top: 0; }
@media (max-width: 1320px) { .home-grid { grid-template-columns: minmax(0, 1fr) 312px; } }
@media (max-width: 1120px) { .home-grid { grid-template-columns: minmax(0, 1fr) 288px; } }
@media (max-width: 960px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.tf-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.tf-chip { height: 26px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); font-size: 12px; font-weight: 600; color: var(--tx2); display: inline-flex; align-items: center; gap: 6px; }
.tf-chip:hover { color: var(--tx); }
.tf-chip[aria-checked="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }

/* side lists (44px rows) */
.list { list-style: none; margin: 0; padding: 4px 0; }
.li { display: flex; align-items: center; gap: 10px; min-height: var(--row); padding: 4px 16px; min-width: 0; }
a.li:hover, .li:hover { background: var(--hover); color: inherit; }
.li .n { width: 14px; flex: none; font-size: 13px; font-weight: 600; color: var(--tx3); text-align: center; font-variant-numeric: tabular-nums; }
.li .body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .m { font-size: 12px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.li .v { flex: none; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.li .v small { display: block; font-size: 11px; font-weight: 500; color: var(--tx3); }
.li .ic-box { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--bg); color: var(--tx2); }
.li .ic-box svg.ic { width: 14px; height: 14px; vertical-align: 0; }
.list .empty { padding: 20px 16px; text-align: center; color: var(--tx3); font-size: 13px; }
.dday { flex: none; min-width: 48px; text-align: right; font-size: 12px; font-weight: 700; color: var(--tx2); font-variant-numeric: tabular-nums; }
.dday.today { color: var(--tx); }
.tabs-sm { margin-left: auto; display: inline-flex; gap: 2px; }
.tabs-sm button { border: 0; background: none; height: 26px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; color: var(--tx3); }
.tabs-sm button:hover { color: var(--tx); }
.tabs-sm button[aria-selected="true"] { color: var(--accent); background: var(--accent-weak); }

/* ---------- KPI strip (one bordered strip, divided cells) ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: var(--s4); }
.kpis.kpi-strip, .kpis.kpi-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { padding: 14px 20px 16px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line-soft); }
.kpi .eyebrow, .kpi-l { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--tx3); white-space: nowrap; }
.kpi-num { margin-top: 4px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-num small { font-size: 14px; font-weight: 600; color: var(--tx2); margin-left: 2px; }
.kpi-num.fit { font-size: 20px; line-height: 1.5; }
.kpi-num.up { color: var(--up); } .kpi-num.down { color: var(--down); }
.kpi .sub { margin-top: 2px; font-size: 12px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-mp { display: flex; align-items: center; gap: 2px; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--tx2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi.sec .kpi-num { font-size: 20px; color: var(--tx2); line-height: 1.45; }
.kpi-unit { font-size: 14px; font-weight: 700; color: var(--tx3); margin-right: 2px; }
.panel .kpis { border-left: 0; border-right: 0; border-radius: 0; margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); }
@media (max-width: 1120px) { .kpi { padding: 12px 14px 14px; } .kpi-num { font-size: 22px; } }
@media (max-width: 900px) {
  .kpis, .kpis.kpi-strip, .kpis.kpi-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(2n) { border-left: 1px solid var(--line-soft); }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

/* ---------- dense tables ---------- */
.stat-wrap { overflow-x: auto; overflow-y: visible; border: 1px solid var(--line); border-radius: var(--r); }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.dt th { height: 36px; padding: 0 8px; background: var(--th); color: var(--tx3); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.dt td { height: var(--row); padding: 4px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
table.dt th:first-child, table.dt td:first-child { padding-left: 16px; }
table.dt th:last-child, table.dt td:last-child { padding-right: 16px; }
table.dt tbody tr:last-child td { border-bottom: 0; }
table.dt tbody tr:hover td { background: var(--hover); }
table.dt tr.hl td { background: var(--accent-weak); font-weight: 700; }
table.dt .r { text-align: right; font-variant-numeric: tabular-nums; }
table.dt .c { text-align: center; }
table.dt th.sortable { cursor: pointer; user-select: none; }
table.dt th.sortable:hover, table.dt th.sorted { color: var(--tx); }
table.dt th .sort-ind { color: var(--accent); font-size: 10px; margin-left: 2px; }
table.dt td.pri { font-weight: 700; font-size: 14px; }
table.dt th.pri { color: var(--tx2); }
table.dt td.sec { color: var(--tx3); }
table.dt td.sec .up, table.dt td.sec .down { font-weight: 500; }
.delta-cell .up, .delta-cell .down { font-weight: 600; }
table.dt .t-work { display: flex; align-items: baseline; gap: 8px; min-width: 160px; max-width: 360px; }
table.dt .t-work .tt { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
table.dt .t-work .ta { font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 10 auto; min-width: 30px; }
table.dt .t-work a:hover .tt { color: var(--accent); }
table.dt td.rk-no { font-size: 14px; font-weight: 700; color: var(--tx2); font-variant-numeric: tabular-nums; }
table.dt td.rk-no.top { color: var(--tx); font-weight: 800; }
table.dt td.rk-chg { font-size: 12px; font-weight: 600; }
.streak { font-size: 12px; font-weight: 600; white-space: nowrap; }
.streak.up { color: var(--up); } .streak.down { color: var(--down); }
table.dt td.empty-note { text-align: center; color: var(--tx3); height: 60px; }
/* fitted tables: no horizontal scroll; low-priority columns hide (see fitTable) */
table.dt.fit { table-layout: fixed; width: 100%; }
table.dt.fit td, table.dt.fit th { overflow: hidden; text-overflow: ellipsis; }
table.dt.fit th { padding: 0 6px; }
table.dt.fit td { padding: 4px 6px; }
table.dt.fit th:first-child, table.dt.fit td:first-child { padding-left: 16px; }
table.dt.fit th:last-child, table.dt.fit td:last-child { padding-right: 16px; }
table.dt.fit .t-work { min-width: 0; max-width: none; }
table.dt.fit .chip { padding: 0 6px; font-size: 11px; height: 20px; }
table.dt.fit .chip.grade { padding: 0 7px 0 2px; }
table.dt.fit .chip.rb { padding: 0; }
table.dt.heat td, table.dt.heat th { height: 30px; padding: 2px 4px; font-size: 12px; }
table.dt.heat .low-col { box-shadow: inset 2px 0 0 var(--up), inset -2px 0 0 var(--up); }
table.dt.heat th.low-col { color: var(--up); }
table.dt.heat.fit td, table.dt.heat.fit th { padding: 2px 1px; font-size: 11px; text-overflow: clip; }
table.dt.heat.fit th:first-child, table.dt.heat.fit td:first-child { padding-left: 8px; }
@media (max-width: 700px) { table.dt.heat.fit td, table.dt.heat.fit th { font-size: 9px; } }
table.hour-grid td:first-child { white-space: nowrap; padding-right: 8px; }

/* in-cell bar / sparkline */
.minibar { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; width: 100%; min-width: 96px; }
.minibar .track { flex: 1 1 40px; max-width: 60px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.minibar .track > i { display: block; height: 100%; background: var(--tx3); }
.minibar .v { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.dt.fit .minibar { min-width: 0; }
table.dt.fit .minibar .track { flex: 1 1 24px; max-width: 40px; }
table.dt.fit .minibar .v { min-width: 0; font-size: 12px; }
.spark { display: inline-block; vertical-align: middle; max-width: 100%; height: auto; }
.toolbar .h-sub { white-space: normal; min-width: 0; }
.spark .ln { fill: none; stroke: var(--tx3); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .dot { fill: var(--tx3); }
.spark.up .ln { stroke: var(--up); } .spark.up .dot { fill: var(--up); }
.spark.down .ln { stroke: var(--down); } .spark.down .dot { fill: var(--down); }

/* ---------- misc blocks (flat, divider-based) ---------- */
.caveat { margin: 0 0 var(--s4); padding: 10px 12px; border-left: 2px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--tx2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.collecting { margin: 0 0 var(--s4); padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--tx2); font-size: 13px; }
.low-tag { font-size: 12px; font-weight: 700; color: var(--up); }
.rank-time { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 var(--s3); font-size: 13px; color: var(--tx2); }
.rank-time .when { font-weight: 600; color: var(--tx); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.kv > div { padding: 10px 14px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-width: 0; }
.kv .k { font-size: 12px; color: var(--tx3); font-weight: 600; }
.kv .v { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.m-lf { display: none; }
html.m .m-lf { display: inline; }
.kv > .sec .v { font-weight: 600; font-size: 14px; color: var(--tx2); }
.coef { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 52px; gap: 6px 10px; align-items: center; font-size: 13px; }
.coef .bar { height: 8px; position: relative; background: var(--surface-2); border-radius: 2px; }
.coef .bar > i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.reach { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.retention .k { font-size: 12px; color: var(--tx3); font-weight: 600; }
.retention .v { font-weight: 800; font-size: 17px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 16px; position: relative; border-left: 1px solid var(--line); margin-left: 4px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--tx3); }
.timeline .when { font-size: 12px; color: var(--tx3); }
.rp-list { list-style: none; margin: 0; padding: 0; }
.rp-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.rp-list li:last-child { border-bottom: 0; }
.rp-list li:hover { background: var(--hover); }
.rp-list a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel > .rp-body:last-child > .rp-list { margin-bottom: calc(-1 * var(--s4)); }

/* calendar (전환 예정) — flat grid of day columns */
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); border-top: 0; }
.cal-day { padding: 10px 16px 12px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); min-width: 0; }
.cal-day.today .cal-date .d { color: var(--accent); }
.cal-date { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.cal-date .d { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cal-date .w { font-size: 12px; color: var(--tx3); font-weight: 600; }
.cal-date .w.sun { color: var(--up); } .cal-date .w.sat { color: var(--down); }
.cal-item { display: block; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.cal-item:first-of-type { border-top: none; }
.cal-item:hover .t { color: var(--accent); }
.cal-item .t { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item .small { display: block; }
.conv-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4)); border-top: 1px solid var(--line); }
.mini-panel { padding: var(--s3) var(--s4); min-width: 0; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mini-panel .panel-head { margin: 0 0 var(--s2); padding: 0; min-height: 0; border: 0; font-size: 13px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--tx3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-line { stroke: var(--line); }
.chart .guide { stroke: var(--tx3); stroke-dasharray: 3 3; }
.chart .axis-title { fill: var(--tx3); font-size: 11px; font-weight: 600; }
.chart .region-label { font-size: 12px; font-weight: 700; opacity: .85; }
.chart .pt-label { font-size: 11px; font-weight: 600; fill: var(--tx); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; }
.chart .dot-pt { cursor: pointer; stroke-width: 1; }
.chart .dot-pt.on, .chart .dot-pt:hover { fill-opacity: 1; stroke: var(--tx); stroke-width: 2; }
.chart .sub-lbl { font-size: 10px; opacity: .8; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(20, 22, 30, .1); border-radius: var(--r-sm); padding: 8px 10px; font-size: 12px; white-space: nowrap; min-width: 120px; }
.chart-tip .tt { font-weight: 700; margin-bottom: 4px; }
.chart-tip .tr { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tip .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--tx3); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.box { height: 9px; width: 9px; border-radius: 2px; }
.panel-head .legend { margin: 0; }

/* ---------- states ---------- */
.loading { padding: 60px 0; text-align: center; color: var(--tx3); }
.error-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; text-align: center; }
.error-box h2 { margin: 0 0 6px; font-size: 17px; }
.error-box p { color: var(--tx3); margin: 4px 0; }
.empty-note { color: var(--tx3); padding: 16px 0; text-align: center; font-size: 13px; }
.panel > .empty-note:only-child { padding: var(--s4) 0; }

/* ---------- 소재 메타 ---------- */
.ind { border-bottom: 1px dotted currentColor; cursor: help; }
.chip.quad { background: none; border: 0; padding: 0; height: auto; gap: 5px; color: var(--q); font-weight: 700; }
.chip.quad::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--q); }
.boards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.boards > .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .boards { grid-template-columns: minmax(0, 1fr); } }
.board-head { display: flex; align-items: center; gap: 8px; }
.qdot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.board-list { list-style: none; margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: 4px 0; }
.board-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; min-height: 40px; padding: 0 16px; font-size: 13px; }
.board-list li:hover { background: var(--hover); }
.board-list a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .bl-no { font-weight: 600; color: var(--tx3); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.board-list .bl-sub { font-size: 12px; font-variant-numeric: tabular-nums; }
.tier-list { display: flex; flex-direction: column; border-top: 0; }
.tl-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); border-bottom: 1px solid var(--line-soft); }
.tl-row:last-child { border-bottom: 0; }
.tl-tier { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-right: 1px solid var(--line-soft); padding: 8px 4px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; align-items: center; }
details.raw > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
details.raw > summary::-webkit-details-marker { display: none; }
details.raw > summary::before { content: '▸'; color: var(--tx3); }
details.raw[open] > summary::before { content: '▾'; }
.topic-detail { border-color: var(--accent); margin-bottom: var(--s4); }

/* ---------- 작품 상세 ---------- */
.wk-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: start; }
.wk-head h1 { font-size: 22px; margin: 6px 0 4px; letter-spacing: -0.02em; line-height: 1.3; }
.wk-head .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--tx3); }
.wk-head .meta b { color: var(--tx); }
.wk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.wk-tier { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx3); font-weight: 600; }
@media (max-width: 700px) { .wk-head { grid-template-columns: minmax(0, 1fr); } .wk-side { flex-direction: row; align-items: center; justify-content: space-between; } }
.utabs { margin: var(--s4) 0; }
.growth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s4); align-items: start; }
.growth-grid > .panel + .panel { margin-top: 0; }
@media (max-width: 1000px) { .growth-grid { grid-template-columns: minmax(0, 1fr); } }
.vel-cmp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: var(--s3); }
.panel > .sub { font-size: 12px; color: var(--tx3); margin-top: 4px; }
.posbar + .posbar { margin-top: var(--s4); }
.pb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.pb-track { position: relative; height: 8px; border-radius: 2px; background: var(--surface-2); }
.pb-band { position: absolute; top: 0; bottom: 0; background: var(--line); border-radius: 2px; }
.pb-med { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--tx3); }
.pb-me { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.pb-legend { margin-top: 6px; }
.st-cmp { font-size: 13px; margin-top: 8px; }
.stint + .stint { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.st-flow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.st-step { display: flex; flex-direction: column; min-width: 84px; }
.st-step b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.st-arrow { color: var(--tx3); display: inline-flex; }
.st-stats { display: flex; gap: var(--s4); margin-left: auto; padding-left: var(--s4); border-left: 1px solid var(--line); }
.st-chart { margin-top: var(--s4); }
@media (max-width: 700px) { .st-stats { margin-left: 0; padding-left: 0; border-left: 0; width: 100%; } }

/* ---------- 소재 조합기 ---------- */
.topic-tabs { margin-bottom: var(--s4); }
.combo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
.combo-controls .seg button { white-space: nowrap; }
.combo-add { margin-left: auto; flex: 0 1 240px; }
.combo-add input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); outline: 0; }
.combo-add input:focus { border-color: var(--accent); }
.cb-chips { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; border: 1px solid var(--line); border-radius: var(--r); }
.cb-plus { display: none; }
.cb-chip { display: flex; flex-direction: column; gap: 6px; min-width: 170px; flex: 1 1 170px; padding: 12px 14px; border-right: 1px solid var(--line-soft); }
.cb-chip:last-child { border-right: 0; }
.cb-chip.locked { box-shadow: inset 0 2px 0 var(--accent); }
.cb-chip-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cb-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.cb-name:hover { color: var(--accent); }
.cb-lock { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: var(--r-sm); color: var(--tx3); display: grid; place-items: center; }
.cb-lock[aria-pressed="true"] { color: var(--accent); }
.cb-lock:hover { background: var(--bg); color: var(--tx); }
.cb-summary { margin-top: var(--s4); padding: 10px 14px; font-size: 14px; border-left: 3px solid var(--tx3); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.cb-summary.tone-none { border-color: var(--tier-a); }
.cb-summary.tone-ok { border-color: var(--ok); }
.cb-summary.tone-rare { border-color: var(--tier-c); }
.chip.pl { background: none; border: 0; padding: 0; height: auto; font-weight: 700; }
.chip.pl-none { color: var(--tier-a); }
.chip.pl-rare { color: var(--warn); }
.chip.pl-mid { color: var(--tx3); }
.chip.pl-often { color: var(--ok); }
.cb-all > summary { cursor: pointer; }
.cb-hist { list-style: none; margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: 4px 0; }
.cb-hist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.cb-hist li:last-child { border-bottom: 0; }
.cb-hist li:hover { background: var(--hover); }
.cb-hist a { font-weight: 600; }
@media (max-width: 560px) { .combo-add { margin-left: 0; flex-basis: 100%; } .cb-chip { border-right: 0; border-bottom: 1px solid var(--line-soft); } .combo-controls .fb-field { flex-direction: column; align-items: flex-start; gap: 4px; } }

/* ---------- community ---------- */
.chip.cm-cat { background: none; border: 0; padding: 0; height: auto; color: var(--tx2); font-weight: 700; flex: none; }
.chip.cm-cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cc); margin-right: 1px; }
.chip.cm-plat { background: var(--surface-2); color: var(--tx2); flex: none; height: 20px; font-size: 11px; }
.chip.cm-wchip { color: var(--tx2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-flex; }
.cm-plats { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 16px; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) 0; border-bottom: 1px solid var(--line-soft); }
.cm-pf-chip { height: 26px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--tx2); background: var(--surface); display: inline-flex; align-items: center; }
.cm-pf-chip:hover { color: var(--tx); }
.cm-pf-chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.cm-plats + .panel-head { margin-top: 0; }
.cm-list { border-top: 0; }
.cm-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 56px 72px; gap: 8px; align-items: center; min-height: 56px; padding: 6px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.cm-row:last-child { border-bottom: 0; }
.cm-row:hover { background: var(--hover); }
.cm-row.del { opacity: .55; }
.cm-tline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-tt { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cm-rc { color: var(--tx3); font-weight: 600; font-size: 12px; flex: none; }
.cm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 12px; color: var(--tx3); margin-top: 2px; min-width: 0; }
.cm-meta .chip { font-size: 11px; height: 18px; padding: 0 6px; }
.cm-mob { display: none; }
.cm-num { text-align: right; display: flex; flex-direction: column; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cm-num b { font-size: 14px; }
.cm-num span, .cm-last { font-size: 11px; color: var(--tx3); }
.cm-last { text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .cm-row { grid-template-columns: minmax(0, 1fr); } .cm-num, .cm-last { display: none; } .cm-mob { display: inline; } }
.cm-mini { padding: 4px 0; }
.cm-mini li { padding: 6px 16px; }
.cm-mini a { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-dot { flex: none; font-size: 11px; font-weight: 700; color: var(--tx3); display: inline-flex; align-items: center; gap: 4px; }
.cm-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cc); }
.crumbs { margin: 0 0 var(--s3); color: var(--tx3); font-size: 13px; }
.crumbs a:hover { color: var(--tx); }
.cm-h1 { font-size: 22px; line-height: 1.3; margin: 8px 0 6px; word-break: keep-all; overflow-wrap: anywhere; }
.cm-au { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--tx); }
.cm-head .cm-meta { font-size: 13px; }
.cm-tags { margin-top: var(--s3); }
.cm-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: var(--s3) calc(-1 * var(--s4)) calc(-1 * var(--s4)); border-top: 1px solid var(--line-soft); }
.cm-wcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 16px; border-right: 1px solid var(--line-soft); }
.cm-wcard:hover { background: var(--hover); }
.cm-wc-main { display: flex; flex-direction: column; min-width: 0; }
.cm-wc-main .tt { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cm-wc-main .ta { font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-wc-kv { display: flex; gap: 14px; }
.cm-wc-kv > span { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.cm-wc-kv small { font-size: 11px; color: var(--tx3); }
.cm-wc-kv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cm-wcard .more { grid-column: 1 / -1; margin: 0; }
.cm-post { padding: var(--s4) 0; border-top: 1px solid var(--line-soft); }
.cm-post:first-child { border-top: 0; padding-top: 0; }
.cm-post.del .cm-body { font-style: italic; }
.cm-ph { display: flex; align-items: center; gap: 10px; }
.cm-pu { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; flex: 1; }
.cm-tools { display: flex; gap: 12px; font-size: 13px; flex: none; }
.cm-tools .link-btn { color: var(--tx3); font-weight: 500; }
.cm-tools .link-btn:hover { color: var(--tx); }
.cm-body { margin: 8px 0 0; overflow-wrap: anywhere; line-height: 1.65; }
.cm-inline { margin: 8px 0 0; }
.cm-pf { margin: 8px 0 0; }
.cm-lbl { flex: none; }
b.cm-lbl { font-size: 14px; }
.chip.cm-op { background: var(--tx); color: var(--surface); }
.ts-box:empty { display: none; }
.ts-box { min-height: 65px; }
.ts-act { position: fixed; right: 16px; bottom: 16px; z-index: 130; }
html.m .ts-act { bottom: calc(var(--tabbar) + 16px); }
.md-table { overflow-x: auto; margin: 8px 0; }
.md-table table { min-width: 100%; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md img, .md video { max-width: 100%; height: auto; border-radius: var(--r-sm); }
.md pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; white-space: pre-wrap; word-break: break-all; font-size: 13px; }
.md code { background: var(--surface-2); border-radius: 3px; padding: 0 4px; font-size: .92em; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 8px 0; padding: 2px 12px; border-left: 2px solid var(--line); color: var(--tx2); }
.md a { color: var(--accent); text-decoration: underline; }
.md table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font-size: 1.1em; margin: 12px 0 6px; }
.md ul, .md ol { padding-left: 1.4em; }
/* legal documents */
.legal-tabs { margin-bottom: var(--s4); }
.legal-doc { padding: var(--s6); line-height: 1.75; max-width: 880px; overflow-wrap: anywhere; }
.legal-doc h1 { font-size: 24px; margin: 0 0 16px; }
.legal-doc h2 { font-size: 18px; margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.legal-doc h3 { font-size: 15px; margin: 18px 0 6px; }
.legal-doc p, .legal-doc li { color: var(--tx); }
.legal-doc table { table-layout: auto; font-size: 13px; }
.legal-doc th { background: var(--th); text-align: left; }
html.m .legal-doc { padding: 16px 14px; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--tx2); font-weight: 600; font-size: 13px; cursor: pointer; }
.vote-btn:hover { color: var(--tx); background: var(--bg); }
.vote-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.cm-form { display: flex; flex-direction: column; gap: var(--s3); }
.cm-form .h-section { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--tx3); }
.field input, .field select, .cm-editor textarea, .cm-pickers input { width: 100%; height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--tx); outline: none; }
.cm-editor textarea { height: auto; padding: 10px; resize: vertical; min-height: 96px; line-height: 1.6; }
.field input:focus, .field select:focus, .cm-editor textarea:focus, .cm-pickers input:focus { border-color: var(--accent); }
.cm-frow { display: grid; grid-template-columns: 160px 150px minmax(0, 1fr); gap: var(--s3); }
@media (max-width: 560px) { .cm-frow { grid-template-columns: minmax(0, 1fr); } }
.cm-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 560px) { .cm-pickers { grid-template-columns: minmax(0, 1fr); } }
.chip.cm-tag { gap: 6px; background: var(--surface-2); color: var(--tx); }
.chip.cm-tag button { border: 0; background: none; color: var(--tx3); cursor: pointer; padding: 0; display: grid; place-items: center; }
.chip.cm-tag button:hover { color: var(--tx); }
.cm-editor { display: flex; flex-direction: column; gap: 8px; }
.cm-editor .seg { align-self: flex-start; }
.cm-preview { margin: 0; min-height: 96px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.cm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.cm-actions .small { margin-right: auto; }
.form-err { margin: 0; color: var(--up); font-weight: 600; font-size: 13px; }
.cm-tabs { margin-bottom: var(--s4); }
@media (max-width: 560px) { .cm-tabs a { padding: 0 10px; } }
.modal { border: 1px solid var(--line); border-radius: var(--r); padding: 0; background: var(--surface); color: var(--tx); width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(15, 16, 22, .45); }
.modal-body { padding: var(--s5); }
.modal .panel-head { margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) 0; padding: 8px var(--s5); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--tx); color: var(--surface); padding: 10px 16px; border-radius: var(--r); font-weight: 600; font-size: 13px; }
.toast.err { background: var(--up); color: #fff; }

/* ---------- 준비 중 ---------- */
.soon-page { text-align: center; padding: 56px 24px; }
.soon-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--bg); color: var(--tx2); margin-bottom: 12px; }
.soon-mark svg.ic { width: 22px; height: 22px; vertical-align: 0; }
.soon-page .h-page { justify-content: center; }
.soon-page .h-lead { max-width: 520px; margin: 8px auto 0; }
.soon-actions { justify-content: center; margin-top: 20px; }

/* ---------- glue ---------- */
.ph-l { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.h-page .q svg.ic { width: 15px; height: 15px; }
.panel > .stat-wrap:has(+ .more-btn[hidden]) { margin-bottom: calc(-1 * var(--s4)); }
.kpis.kpi-strip, .kpis.kpi-home { grid-template-columns: repeat(var(--kn, 6), minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis.kpi-home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi .kpi-num .chip.rb { font-size: 18px; font-weight: 800; }
.kpi .kpi-num .chip.rb.rb-early { font-size: 14px; }
.v.muted { color: var(--tx3); }
th .q { margin-left: 2px; }
@media (max-width: 1120px) and (min-width: 901px) {
  .kpis.kpi-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.kpi-strip .kpi:nth-child(4n+1) { border-left: 0; }
  .kpis.kpi-strip .kpi:nth-child(n+5) { border-top: 1px solid var(--line-soft); }
}

.panel > .panel-head + .stat-wrap, .panel > .panel-head + .list, .panel > .panel-head + .rp-body, .panel > .panel-head + .cm-list, .panel > .panel-head + .cal, .panel > .panel-head + .tier-list, .panel > .panel-head + .board-list, .panel > .panel-head + .cb-hist { margin-top: calc(-1 * var(--s4)); }
.panel > .rp-body > .list { margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); }
.panel > .rp-body > .empty-note { padding: 16px 0 0; }
/* ---------- widths ---------- */
@media (max-width: 1120px) {
  .wrap { padding: 0 16px; }
  .gnb-1 .gnb-row { gap: 16px; }
  .platnav a { padding: 0 8px; }
  .platnav .soon { display: none; }
  .brand-nm { display: none; }
  .tl-nm { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .gnb-1 .gnb-row { height: auto; flex-wrap: wrap; gap: 0 8px; }
  .brand { height: 44px; }
  .gnb-right { height: 44px; gap: 2px; }
  .platnav { order: 3; flex-basis: 100%; height: 34px; margin: 0 -12px; padding: 0 4px; border-top: 1px solid var(--line-soft); }
  .platnav a { font-size: 13px; }
  .gnb-2 .gnb-row { height: 38px; gap: 6px; }
  .mainnav a { padding: 0 9px; font-size: 13px; }
  .mainnav a.active::after { left: 9px; right: 9px; }
  .gnb-2 .seg button { height: 26px; padding: 0 9px; font-size: 12px; }
  .search-pop { position: static; }
  .search-panel { left: 12px; right: 12px; width: auto; top: 44px; }
  main.wrap { padding-top: 16px; }
  .panel { padding: var(--s3); }
  .panel-head { margin: calc(-1 * var(--s3)) calc(-1 * var(--s3)) var(--s3); padding: 8px var(--s3); min-height: 46px; }
  .panel > .stat-wrap, .panel > .cm-list, .panel > .list, .panel > .rp-body > .rp-list, .panel > .tier-list, .panel > .cal { margin-left: calc(-1 * var(--s3)); margin-right: calc(-1 * var(--s3)); }
  .panel > .stat-wrap:last-child, .panel > .cm-list:last-child, .panel > .list:last-child, .panel > .tier-list:last-child, .board-list, .cb-hist, .panel > .stat-wrap:has(+ .more-btn[hidden]) { margin-bottom: calc(-1 * var(--s3)); }
  .panel > .rp-body > .list { margin: 0 calc(-1 * var(--s3)) calc(-1 * var(--s3)); }
  .panel > .panel-head + .stat-wrap, .panel > .panel-head + .list, .panel > .panel-head + .rp-body, .panel > .panel-head + .cm-list, .panel > .panel-head + .cal, .panel > .panel-head + .tier-list, .panel > .panel-head + .board-list, .panel > .panel-head + .cb-hist { margin-top: calc(-1 * var(--s3)); }
  .panel > .more-btn:last-child, .panel > .stat-wrap + .more-btn { margin: 0 calc(-1 * var(--s3)) calc(-1 * var(--s3)); width: calc(100% + 2 * var(--s3)); }
  .board-list, .cb-hist, .conv-charts, .cm-works, .panel .kpis { margin-left: calc(-1 * var(--s3)); margin-right: calc(-1 * var(--s3)); }
  .cm-plats { margin: calc(-1 * var(--s3)) calc(-1 * var(--s3)) 0; padding: 8px 12px; }
  .hero { padding: 0 0 16px; }
  .hero-search { height: 48px; }
  .hs-plat { padding: 0 12px; }
  .hero-search input { padding: 0 10px; font-size: 15px; }
  .btn-primary { width: 38px; height: 38px; }
  .h-page { font-size: 19px; }
  .filterbar-inner { gap: 6px 12px; }
  .fb-note { width: 100%; margin-left: 0; }
}

/* =====================================================================
   Mobile layout (html.m — auto at ≤ 768px or forced from the footer toggle)
   ===================================================================== */
.m-top, .m-back, .m-tabbar, .m-only { display: none; }
.foot-ctl { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.foot-layout { color: var(--tx3); font-weight: 500; font-size: 12px; text-decoration: underline; }
.m-search { position: fixed; inset: 0; z-index: 120; background: var(--surface); padding: env(safe-area-inset-top) 0 0; }
.m-search-bar { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; }
.m-search-bar .search { flex: 1; }
.m-search-bar input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); outline: 0; font-size: 16px; }
.m-search-bar input:focus { border-color: var(--accent); }
.m-search .search-results { position: static; max-width: none; min-width: 0; border: 0; box-shadow: none; max-height: calc(100vh - 80px); margin-top: 6px; }
.m-search .search-results a { min-height: 52px; }
.m-search-bar .btn-ghost { height: 44px; }
html.m-lock, html.m-lock body { overflow: hidden; }

html.m { --tabbar: calc(56px + env(safe-area-inset-bottom)); --s4: 12px; }
html.m .topbar { display: none; }
html.m .m-only { display: inline-flex; }
html.m .m-top {
  display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 50; height: 52px; padding: 0 8px 0 4px;
  padding-top: env(safe-area-inset-top); box-sizing: content-box; background: var(--surface); border-bottom: 1px solid var(--line);
}
html.m .m-plat { position: relative; margin-right: auto; }
html.m .m-plat-btn { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; border: 0; background: none; font-size: 17px; font-weight: 800; color: var(--tx); border-radius: var(--r-sm); }
html.m .m-plat-btn[aria-expanded="true"] { background: var(--bg); }
html.m .m-plat-menu { position: absolute; left: 4px; top: calc(100% + 4px); z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 0; box-shadow: 0 8px 24px rgba(20, 22, 30, .12); }
html.m .m-plat-menu a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; font-weight: 600; }
html.m .m-plat-menu a.on { color: var(--accent); }
html.m .m-plat-menu a.dim { color: var(--tx3); }
html.m .m-plat-menu a svg { margin-left: auto; }
html.m.one-plat .m-plat-btn { cursor: default; }
html.one-plat .m-plat-btn svg { display: none; }
html.m .m-top .icon-btn, html.m .foot-ctl .icon-btn { width: 44px; height: 44px; }
html.m .m-top .seg button { height: 40px; padding: 0 12px; }
html.m .foot-layout { min-height: 44px; display: inline-flex; align-items: center; }
html.m .m-tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--tabbar); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
}
html.m .m-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 11px; font-weight: 600; color: var(--tx3); }
html.m .m-tabbar a.on { color: var(--accent); }
html.m .m-tabbar a svg.ic { width: 22px; height: 22px; vertical-align: 0; }
/* full-screen thread / write: back bar, no top bar or tab bar */
html.m body[data-sub] .m-top, html.m body[data-sub] .m-tabbar { display: none; }
html.m body[data-sub] .m-back { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 50; height: 52px; padding: env(safe-area-inset-top) 8px 0 4px; box-sizing: content-box; background: var(--surface); border-bottom: 1px solid var(--line); }
html.m .m-back .icon-btn { width: 44px; height: 44px; }
html.m .m-back-t { font-weight: 700; font-size: 16px; }
html.m body[data-sub] .crumbs { display: none; }
html.m body[data-sub] .footer { padding-bottom: 32px; }

html.m .wrap { padding: 0 12px; }
html.m main.wrap { padding-top: 12px; padding-bottom: 24px; }
html.m .footer { flex-direction: column; align-items: flex-start; padding-bottom: calc(var(--tabbar) + 24px); }
html.m .foot-ctl { margin-left: 0; flex-wrap: wrap; }
html.m .filterbar-inner { padding-left: 12px; padding-right: 12px; }
html.m .page-head { margin-bottom: 12px; }
html.m .h-page { font-size: 19px; }
html.m .hero { padding: 0 0 12px; }
html.m .home-grid { grid-template-columns: minmax(0, 1fr); }
html.m .layout-2, html.m .layout-even, html.m .growth-grid, html.m .boards { grid-template-columns: minmax(0, 1fr); }
html.m .kpis, html.m .kpis.kpi-strip, html.m .kpis.kpi-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.m .kpi { padding: 12px 14px; }
html.m .kpi + .kpi { border-left: 0; }
html.m .kpi:nth-child(2n) { border-left: 1px solid var(--line-soft); }
html.m .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
html.m .kpi-num { font-size: 22px; }
html.m .tabs, html.m .utabs { position: relative; }
html.m .utabs { position: sticky; top: calc(53px + env(safe-area-inset-top)); z-index: 20; background: var(--bg); margin: 12px -12px; padding: 0 4px; }
html.m .panel-head { gap: 6px 10px; }
html.m .panel-head .tf-chips { order: 3; flex-basis: 100%; padding-bottom: 4px; }
html.m #g-sub { display: none; }

/* touch targets ≥ 44px */
html.m .btn, html.m .btn-ghost, html.m .btn.ghost { min-height: 44px; }
html.m .btn.sm { min-height: 36px; }
html.m .tabs a, html.m .utabs button { height: 46px; }
html.m .seg button, html.m .seg a.seg-a { height: 40px; }
html.m .seg.sm button { height: 36px; }
html.m .tf-chip, html.m .cm-pf-chip { height: 40px; padding: 0 12px; }
html.m .pager button { min-width: 44px; height: 44px; }
html.m .more-btn { height: 48px; }
html.m .tabs-sm button { height: 40px; padding: 0 12px; }
html.m .toolbar select, html.m select.sel, html.m .fb-field select, html.m .chip-filter, html.m .field input, html.m .field select, html.m .combo-add input, html.m .cm-pickers input { height: 44px; font-size: 15px; }
html.m .toggle { min-height: 44px; }
html.m .li { min-height: 56px; }
html.m .board-list li, html.m .cb-hist li { min-height: 48px; }
html.m .cb-lock { width: 44px; height: 44px; }
html.m .q { position: relative; }
html.m .q::before { content: ""; position: absolute; inset: -15px; }
html.m .vote-btn { height: 40px; }
html.m button.chip { height: 36px; }
html.m .search-results a { min-height: 48px; }

/* card lists */
.mc-head { display: flex; justify-content: space-between; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--tx3); background: var(--th); border-bottom: 1px solid var(--line); margin: 0 -12px; }
.mlist { margin: 0 -12px; }
.panel > .mlist:last-child { margin-bottom: -12px; }
.mcard { display: flex; flex-direction: column; gap: 3px; min-height: 64px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); justify-content: center; }
.mcard:last-child { border-bottom: 0; }
.mcard:active, .mcard:hover { background: var(--hover); color: inherit; }
.mcard.hl { background: var(--accent-weak); }
.mc-l1, .mc-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-rank { width: 24px; flex: none; text-align: center; font-weight: 700; color: var(--tx2); font-variant-numeric: tabular-nums; font-size: 13px; }
.mc-t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.mc-v { flex: none; font-weight: 800; font-size: 15px; }
.mc-chg { flex: none; font-size: 11px; font-weight: 700; min-width: 28px; text-align: right; }
.mc-l2 { font-size: 12px; color: var(--tx3); padding-left: 32px; }
.mc-l2 .mc-a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.mc-l2 .mc-k { flex: none; white-space: nowrap; }
.mc-l2 .mc-k b { color: var(--tx2); font-weight: 600; }
.mc-l2 .spark { flex: none; }
.m-tools { margin: 0 0 8px; }
.m-sort { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 소재 지도 zoom */
.map-zoom { margin: 0 -12px; }
.mz-ctl { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.mz-ctl .btn-ghost { min-width: 44px; justify-content: center; }
.mz-scroll { overflow: auto; touch-action: pan-x pan-y; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); max-height: 80vh; }
.mz-scroll #t-map { width: 100%; }

/* 소재 조합기: 뽑기 pinned near the bottom */
html.m body[data-page="topics"] #cb-draw { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + 12px); z-index: 40; height: 52px; font-size: 16px; box-shadow: 0 6px 20px rgba(20, 22, 30, .18); }
html.m body[data-page="topics"]:has(#cb-draw) .footer { padding-bottom: calc(var(--tabbar) + 88px); }

/* 커뮤니티: floating write button above the tab bar */
html.m #cm-write { position: fixed; right: 16px; bottom: calc(var(--tabbar) + 16px); z-index: 40; height: 52px; padding: 0 20px; border-radius: 26px; box-shadow: 0 6px 20px rgba(20, 22, 30, .22); font-size: 15px; }
html.m .cm-row { padding: 8px 12px; min-height: 64px; }
html.m .cm-body, html.m .cm-inline, html.m .cm-pf { margin-left: 0; }
html.m .cm-frow, html.m .cm-pickers { grid-template-columns: minmax(0, 1fr); }
html.m .cm-editor textarea { font-size: 16px; }

/* ---------- public mode: 공개용 홈 · hourly detail ---------- */
.h-detail { margin-top: var(--s4); }
.h-detail > summary { min-height: 36px; }
.h-detail .stat-wrap { margin-top: var(--s2); }
.pub-list li { display: flex; align-items: center; }
.pub-list li > .li { flex: 1; padding-right: 4px; }
.pub-ext { margin-right: 8px; color: var(--tx3); }
.pub-ext:hover { color: var(--accent); background: var(--hover); }
.pub-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.pub-topics .h-sub-section { margin-top: 0; }
.panel .pub-topics .board-list { margin: 0 -8px; }
.pub-topics .board-list li { padding: 0 8px; }
.pub-cta { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.pub-cta:hover { background: var(--hover); color: inherit; }
.pub-cta .ic-box { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); background: var(--accent-weak); color: var(--accent); }
.pub-cta .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-cta .go { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px; }
.pub-kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pub-kv > div { padding: 10px; }
.pub-kv .v small { font-size: 12px; font-weight: 500; color: var(--tx3); margin-left: 2px; }
.panel .pub-recent { margin: 0 calc(-1 * var(--s4)); padding: 0; }
html.m .panel .pub-recent { margin: 0 calc(-1 * var(--s3)); }
.pub-dist { list-style: none; margin: 0; padding: 0; }
.pub-dist li { display: grid; grid-template-columns: 84px minmax(0, 1fr) 40px; gap: 10px; align-items: center; min-height: 32px; font-size: 13px; }
.pub-dist li > b { text-align: right; }
.pub-dist .pd-d { color: var(--tx2); }
.pub-bar { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.pub-bar > i { display: block; height: 100%; background: var(--tx3); border-radius: 3px; }
@media (max-width: 560px) { .pub-topics { grid-template-columns: minmax(0, 1fr); gap: var(--s3); } .pub-cta .go { display: none; } }
html.m .pub-ext { width: 44px; height: 44px; margin-right: 4px; }
html.m .h-detail > summary { min-height: 44px; }

/* ---------- admin (#/admin) ---------- */
.adm-login { max-width: 480px; }
.adm-row { padding: var(--s4); border-top: 1px solid var(--line-soft); min-width: 0; }
.adm-row:first-child { border-top: 0; }
.adm-row.del .adm-body { font-style: italic; }
.adm-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.adm-tt { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.adm-st { display: inline-flex; gap: 4px; }
.adm-rep { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); }
.adm-body { max-height: 240px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 4px; }
.adm-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.adm-ban { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.adm-ban select { height: 28px; }
.adm-note { display: inline-flex; align-items: center; gap: 4px; }
html.m .adm-row { padding: 12px; }
html.m .adm-acts .btn, html.m .adm-ban select { min-height: 44px; }
html.m .adm-ban { margin-left: 0; }

/* ---------- 공지 (cid 6): pinned rows ---------- */
.cm-row.pinned { background: var(--surface-2); }
.cm-row.pinned .cm-tt { font-weight: 700; }
.chip.cm-pin { flex: none; gap: 3px; background: none; border: 1px solid var(--warn); color: var(--warn); font-weight: 700; }
.list li.pinned > .li { background: var(--surface-2); }
.list li.pinned .ic-box { color: var(--warn); }
.list li.pinned .t { font-weight: 700; }
