/* styles.css — AI Ranking Dashboard 화면 스타일 (라이트/다크 자동) */
:root {
  --bg: #f6f7fb; --panel: #ffffff; --ink: #14181f; --muted: #5b6474; --line: #e3e6ee;
  --accent: #2563eb; --accent-ink: #ffffff; --good: #15803d; --bad: #b91c1c; --warn-bg: #fff7e6; --warn-ink: #8a5a00;
  --chip: #eef2ff; --chip-ink: #3730a3; --bar: #dbe4ff; --bar-fill: #2563eb; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --gold: #d4a017; --silver: #8d99ae; --bronze: #b87333;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --panel: #171b24; --ink: #e8ebf1; --muted: #9aa4b5; --line: #262c38;
    --accent: #5b8def; --accent-ink: #0b1020; --good: #4ade80; --bad: #f87171; --warn-bg: #3a2d0f; --warn-ink: #fbd38d;
    --chip: #1e2a4a; --chip-ink: #c7d2fe; --bar: #22304f; --bar-fill: #5b8def; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1218; --panel: #171b24; --ink: #e8ebf1; --muted: #9aa4b5; --line: #262c38;
  --accent: #5b8def; --accent-ink: #0b1020; --good: #4ade80; --bad: #f87171; --warn-bg: #3a2d0f; --warn-ink: #fbd38d;
  --chip: #1e2a4a; --chip-ink: #c7d2fe; --bar: #22304f; --bar-fill: #5b8def; --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 17px; }
.brand:hover { text-decoration: none; }
.logo { width: 22px; height: 22px; border-radius: 5px; background: var(--accent); position: relative; }
.logo::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 10px; background: linear-gradient(90deg, #fff 0 25%, transparent 25% 37%, #fff 37% 62%, transparent 62% 75%, #fff 75%); clip-path: polygon(0 60%, 25% 60%, 25% 0, 50% 0, 50% 100%, 75% 100%, 75% 30%, 100% 30%, 100% 100%, 0 100%); opacity: .95; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a.active, .nav a:hover { background: var(--chip); color: var(--chip-ink); text-decoration: none; }
.search { margin-left: auto; position: relative; }
.search input { width: 220px; max-width: 60vw; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.search-results { position: absolute; right: 0; top: 38px; min-width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; }
.search-results a { display: block; padding: 8px 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--chip); text-decoration: none; }
.statusline { font-size: 13px; color: var(--muted); padding-bottom: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
main { min-height: 60vh; padding: 18px 16px 30px; }
.loading, .empty { color: var(--muted); padding: 30px 0; text-align: center; }
h1 { font-size: 22px; margin: 6px 0 4px; }
h2 { font-size: 18px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.sub { color: var(--muted); margin: 0 0 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 500; font-size: 14px; }
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.card h3 small { color: var(--muted); font-weight: 400; }
.card ol { margin: 0; padding-left: 20px; }
.card li { margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card li b { font-weight: 600; }
.card .sc { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.row:hover { background: color-mix(in srgb, var(--chip) 45%, transparent); }
.rank { font-weight: 700; width: 44px; }
.rank .medal { display: inline-block; width: 24px; height: 24px; border-radius: 50%; color: #fff; text-align: center; line-height: 24px; font-size: 13px; }
.m1 { background: var(--gold); } .m2 { background: var(--silver); } .m3 { background: var(--bronze); }
.delta { font-size: 12px; margin-left: 4px; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--muted); }
.model a { font-weight: 600; color: var(--ink); }
.model .vendor { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.bar { position: relative; height: 10px; background: var(--bar); border-radius: 6px; min-width: 120px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar-fill); border-radius: 6px; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); color: var(--chip-ink); white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge.muted { background: var(--line); color: var(--muted); }
.conf { font-size: 12px; color: var(--muted); white-space: nowrap; }
.conf i { display: inline-block; width: 46px; height: 6px; background: var(--bar); border-radius: 4px; vertical-align: middle; margin-right: 6px; position: relative; }
.conf i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--muted); border-radius: 4px; }
button.link { background: none; border: 1px solid var(--line); color: var(--accent); padding: 4px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
button.link:hover { border-color: var(--accent); }
button.link[aria-expanded="true"] { background: var(--chip); }
tr.evidence td { background: color-mix(in srgb, var(--chip) 35%, transparent); padding: 10px 12px 14px; }
.ev-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ev table { font-size: 13px; background: var(--panel); border-radius: 8px; overflow: hidden; }
.ev th, .ev td { padding: 6px 8px; }
.ev .self { color: var(--warn-ink); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; font-size: 14px; }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.toolbar select, .toolbar input[type="number"] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.chart-box { position: relative; height: 420px; }
.chart-box.small { height: 300px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } .hide-sm { display: none; } .chart-box { height: 340px; } }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; font-size: 14px; }
.kv div span { display: block; color: var(--muted); font-size: 12px; }
.source-status { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.s-ok { background: var(--good); } .s-failed, .s-blocked { background: var(--bad); } .s-skipped { background: var(--muted); }
.note { color: var(--muted); font-size: 13px; }
.foot { color: var(--muted); font-size: 12.5px; padding: 20px 16px 36px; display: flex; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
ol.steps { padding-left: 20px; } ol.steps li { margin: 4px 0; }
.scroll { overflow-x: auto; }
.small { font-size: 13px; }
/* v0.0.2: 가격·가성비 */
.price { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.bar.cost > i { background: var(--good); }
