/* vidIQ 앱 화면과 같은 모습(2026-10-19 vidiq.com 화면에서 뽑은 색·글꼴). 우리 색은 나중에 이 변수만 바꿔 더한다 */
:root {
  --bg-page: #0A0D15; --bg-rail: #0A0D15; --bg-surface: #161922; --bg-subtle: #1E212B; --bg-hover: #242733; --bg-selected: #242733;
  --border: rgba(255, 255, 255, .07); --border-strong: rgba(255, 255, 255, .14);
  --text: #F7F7F7; --text-2: #A2A7B8; --text-3: #83899C; --text-4: #585C6A; --text-on-accent: #FFFFFF; --text-accent: #4F8EFF;
  --accent: #2574F5; --accent-hover: #3B83F7;
  --good: #3DCB71; --good-soft: rgba(61, 203, 113, .16); --good-solid: #2FB463;
  --mid: #F2C01D; --mid-soft: rgba(242, 192, 29, .16);
  --bad: #F0544F; --bad-soft: rgba(240, 84, 79, .16);
  --c1: #4F8EFF; --c2: #3DCB71; --c3: #F2C01D; --c4: #B07CFF; --grid: rgba(255, 255, 255, .06);
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Satoshi, Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg-page); -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--text-accent); text-decoration: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 왼쪽 아이콘 줄 */
.side {
  position: fixed; inset: 0 auto 0 0; width: 92px; padding: 16px 8px; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  background: var(--bg-rail); border-right: 1px solid var(--border); z-index: 5;
}
.logo { display: grid; place-items: center; padding: 6px 0 18px; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.logo-mark svg.i { width: 18px; height: 18px; }
.logo-text { display: none; }
.nav { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: var(--r-md); color: var(--text-3); cursor: pointer; font-size: 12px; font-weight: 500; text-align: center; line-height: 1.25; }
/* 호버·선택 표시는 누르는 범위(메뉴 칸 전체)와 같게 */
.nav .ic { width: 40px; height: 32px; display: grid; place-items: center; }
.nav:hover { color: var(--text); background: var(--bg-subtle); }
.nav.on { color: var(--text-accent); background: rgba(37, 116, 245, .14); }
.nav.on:hover { background: rgba(37, 116, 245, .22); }
.side .grow { flex: 1; }
.side-card { display: none; }
main { margin-left: 92px; padding: 28px 40px 56px; display: flex; flex-direction: column; gap: 20px; min-height: 100vh; max-width: 1480px; }
.icon-btn.menu-btn { display: none; }

/* 글자 */
h1 { margin: 0; font-size: 26px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.lead { margin: 4px 0 0; color: var(--text-2); }
h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
h2 svg.i { width: 16px; height: 16px; color: var(--text-3); }
.muted { color: var(--text-3); font-size: 13px; }
.head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-row.between { justify-content: space-between; }

/* 부품 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--r-pill);
  font-weight: 700; border: 1px solid transparent; cursor: pointer; white-space: nowrap; background: var(--accent); color: var(--text-on-accent);
}
.btn:hover { background: var(--accent-hover); }
.btn.sub { background: var(--bg-subtle); color: var(--text); border-color: var(--border); font-weight: 500; }
.btn.sub:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.search {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; padding: 14px 24px; border-radius: var(--r-pill);
  background: var(--bg-surface); border: 1px solid var(--border-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.search:hover { border-color: rgba(255, 255, 255, .24); }
.search:focus-within { border-color: rgba(79, 142, 255, .6); box-shadow: 0 0 0 4px rgba(37, 116, 245, .12); }
.search:focus-within:hover { border-color: rgba(79, 142, 255, .9); }
.search svg.i { color: var(--text-3); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; font-size: 17px; }
.search input::placeholder, textarea::placeholder { color: var(--text-4); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel.flush { padding: 22px 0 10px; gap: 0; }
.panel.flush > .head-row, .panel.flush > .note, .panel.flush > .hint-wrap { padding: 0 24px 14px; }
.hint-wrap { display: flex; justify-content: center; }
.hint { display: inline-block; padding: 5px 14px; border-radius: var(--r-pill); background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card .lab { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.card .lab svg.i { width: 14px; height: 14px; color: var(--text-3); }
.card .val { font-size: 30px; line-height: 38px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .val.good { color: var(--good); } .card .val.mid { color: var(--mid); } .card .val.bad { color: var(--bad); }
.card .sub { font-size: 13px; color: var(--text-3); }
.chip { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; line-height: 16px; white-space: nowrap; }
.chip.good { background: var(--good-solid); color: #08130C; } .chip.mid { background: var(--mid); color: #1A1404; } .chip.bad { background: var(--bad); color: #1C0606; }
.chip.none { background: var(--bg-subtle); color: var(--text-3); font-weight: 500; }
.badge { display: inline-flex; min-width: 40px; justify-content: center; padding: 4px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.mid { background: var(--mid-soft); color: var(--mid); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.none { background: var(--bg-subtle); color: var(--text-3); }
.tag { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: var(--r-pill); background: var(--bg-subtle); border: 1px solid var(--border); font-size: 14px; color: var(--good); cursor: pointer; }
.tag.plain { padding: 8px 16px; color: var(--text); }
.tag:hover { background: var(--bg-hover); }
.tag .badge { padding: 2px 8px; font-size: 13px; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* 알약 탭 */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--bg-surface); border: 1px solid var(--border); align-self: flex-start; }
.tabs button, .tabs a { border: 0; background: transparent; padding: 8px 18px; border-radius: var(--r-pill); cursor: pointer; color: var(--text-2); font-weight: 500; }
.tabs .on { background: var(--accent); color: #fff; font-weight: 700; }
.tabs :is(a, button):not(.on):hover { color: var(--text); background: var(--bg-subtle); }
.tabs .on:hover { background: var(--accent-hover); }

/* 표 */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { white-space: nowrap; text-align: left; font-size: 13px; font-weight: 500; color: var(--text-3); padding: 10px 12px; background: var(--bg-subtle); }
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
.tbl { padding: 0 12px; }
td { padding: 13px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
td.kw { font-weight: 500; word-break: keep-all; }
td a:hover { text-decoration: underline; }
input[type=checkbox] { accent-color: var(--accent); cursor: pointer; opacity: .8; }
input[type=checkbox]:hover { opacity: 1; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctr { text-align: center; }
tr.click { cursor: pointer; } tr.click:hover td { background: rgba(255,255,255,.025); }
.box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--text-4); display: inline-block; vertical-align: -3px; }
.icon-btn { border: 0; background: transparent; color: var(--text-3); padding: 6px; border-radius: var(--r-sm); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn svg.i { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn.on { color: var(--text-accent); }
.icon-btn.on svg.i { fill: currentColor; }
.more { display: flex; justify-content: center; padding: 12px 0 6px; }

/* 점수 바늘 */
.overview { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 6px; padding-bottom: 8px; }
.overview h3 { justify-self: start; margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.gauge { width: 240px; height: 150px; position: relative; }
.gauge svg { width: 240px; height: 150px; overflow: visible; }
.gauge .score { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.gauge .score.good { background: var(--good-solid); color: #08130C; } .gauge .score.mid { background: var(--mid); color: #1A1404; } .gauge .score.bad { background: var(--bad); color: #1C0606; } .gauge .score.none { background: var(--bg-subtle); color: var(--text-3); }
.gauge .cap { position: absolute; left: 0; right: 0; top: 120px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text-2); line-height: 1.3; }
.gauge .cap b { display: block; font-size: 13px; color: var(--text); letter-spacing: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 440px; text-align: center; margin-top: 10px; }
.stats .lab { color: var(--text-2); font-size: 14px; }
.stats .val { font-size: 26px; font-weight: 700; line-height: 34px; font-variant-numeric: tabular-nums; }

/* 영상 */
.vids { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.vcard { display: flex; flex-direction: column; gap: 8px; color: inherit; min-width: 0; padding: 8px; margin: -8px; border-radius: var(--r-md); }
.vcard:hover { background: var(--bg-subtle); }
.vcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); background: var(--bg-subtle); }
.vcard .t { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.vcard .m { font-size: 13px; color: var(--text-3); }
.vcard .g { font-size: 12px; font-weight: 700; color: var(--good); }
.vid { display: flex; gap: 12px; padding: 10px 0; color: inherit; }
.vid img { width: 96px; height: 54px; border-radius: var(--r-sm); object-fit: cover; background: var(--bg-subtle); flex: none; }
.vid .t { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid .m { font-size: 13px; color: var(--text-3); }

/* 그래프 */
.chart svg { width: 100%; height: 180px; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.kchip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px 9px 16px; border-radius: var(--r-pill); background: var(--bg-surface); border: 1px solid var(--border-strong); font-weight: 500; }
.kchip .x:hover { background: var(--bg-hover); color: var(--text); }
.kchip .x { border: 0; background: var(--bg-subtle); color: var(--text-2); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; line-height: 1; }

/* 상태 */
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.err { padding: 14px 18px; border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad); }
.skel { background: linear-gradient(90deg, var(--bg-surface), var(--bg-subtle), var(--bg-surface)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--r-lg); }
@keyframes sh { to { background-position: -200% 0; } }
.idea { padding: 14px 16px; border-radius: var(--r-md); background: var(--bg-subtle); cursor: pointer; border: 1px solid var(--border); }
.idea:hover { background: var(--bg-hover); }
.idea .t { font-weight: 700; } .idea .m { font-size: 13px; color: var(--text-2); }
textarea { width: 100%; min-height: 96px; resize: vertical; padding: 14px 20px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--bg-page); outline: 0; font-size: 15px; }
textarea:focus { border-color: rgba(79, 142, 255, .6); }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.cand { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-subtle); }
.cand .t { font-weight: 700; } .cand .m { font-size: 13px; color: var(--text-3); }
.cand > div { flex: 1; min-width: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--bg-subtle); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 18px; border-radius: var(--r-pill); background: var(--text); color: var(--bg-page); font-size: 13px; font-weight: 500; z-index: 20; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
details.how summary { cursor: pointer; color: var(--text-3); font-size: 13px; display: inline-block; }
details.how summary:hover { color: var(--text); }
details.how p { margin: 8px 0 0; color: var(--text-3); font-size: 13px; }


/* 표 머리글 정렬 단추 */
.sort { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.sort:hover { color: var(--text); }
.sort::after { content: '↕'; margin-left: 4px; opacity: .5; }
.sort[data-dir="up"]::after { content: '↑'; opacity: 1; } .sort[data-dir="down"]::after { content: '↓'; opacity: 1; }
/* 고른 키워드 처리 줄 — 떠 있는 것은 반투명·흐림 */
.selbar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: rgba(30, 33, 43, .82); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--border-strong); z-index: 15; max-width: calc(100vw - 32px); flex-wrap: wrap; }
.selbar .cnt { font-weight: 700; margin-right: 4px; }
@media (max-width: 760px) { .selbar { bottom: 80px; border-radius: 20px; justify-content: center; } }

/* 좁은 화면 */
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .vids { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .side { inset: auto 0 0 0; width: auto; height: 68px; flex-direction: row; padding: 6px 4px; border-right: 0; border-top: 1px solid var(--border); gap: 0; background: rgba(10, 13, 21, .78); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .side .logo, .side .grow, .side .nav[data-r="settings"] { display: none; }
  .nav { flex: 1; padding: 4px 0; font-size: 11px; }
  .nav .ic { height: 28px; }
  main { margin-left: 0; padding: 16px 16px 96px; gap: 16px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card .val { font-size: 26px; }
  .search { padding: 12px 18px; }
  .search input { font-size: 16px; }
  .panel { padding: 18px; }
  .panel.flush > .head-row, .panel.flush > .note, .panel.flush > .hint-wrap { padding: 0 18px 12px; }
  .tbl { padding: 0 6px; }
  th.hide-s, td.hide-s { display: none; }
  .axis .odd { display: none; }
  td.kw { word-break: keep-all; }
  .vids { grid-template-columns: minmax(0, 1fr); }
  .tabs { align-self: stretch; }
  .tabs button { flex: 1; padding: 8px 10px; }
}
