/* ReCompile web - the desktop app's dark look (app/web/style.css tokens) */
:root {
  --bg: #121418; --bg2: #171a1f; --panel: #1d2026; --panel2: #242830; --panel3: #2c313a; --line: #2e333b; --line2: #3a4049;
  --fg: #e8e9eb; --muted: #9aa0a8; --accent: #ffb347; --accent2: #5fb3ff; --ok: #6fd58a; --danger: #ff6b6b; --warn: #ffd166;
  --radius: 8px; --topbar-h: 48px;
}
:root[data-theme="light"] { --bg: #f6f7f9; --bg2: #eceef2; --panel: #ffffff; --panel2: #f0f2f5; --panel3: #e4e7ec; --line: #d9dde3; --line2: #c8cdd5; --fg: #1b1e23; --muted: #5d6470; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--fg); font-size: 14px; }
h2 { margin: 0 0 10px; font-size: 18px; } h3 { margin: 16px 0 8px; font-size: 15px; color: var(--accent); }
h2 small, h3 small { font-weight: 400; font-size: 12px; color: var(--muted); }
a { color: var(--accent2); }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
button { background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); } button.active { background: var(--panel3); border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); } button.mini { padding: 2px 8px; font-size: 12px; }
select, input[type=range] { background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
label.inline, label.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.sep { width: 1px; height: 22px; background: var(--line2); }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.tag.ko { color: var(--ok); border-color: var(--ok); }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }

#topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 16px; background: #0e1013; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 19px; font-weight: 700; white-space: nowrap; } .brand .logo { color: var(--accent); } .brand small { font-size: 11px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs button { background: transparent; border-color: transparent; padding: 6px 14px; font-size: 14px; color: var(--muted); }
.tabs button.active { background: var(--panel2); border-color: var(--line2); color: var(--fg); }
#main { padding: 14px 16px 40px; max-width: 1100px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.page { max-width: 900px; }

.drop { border: 1.5px dashed var(--line2); border-radius: 12px; padding: 16px 18px; background: var(--bg2); margin-bottom: 16px; }
.drop.over { border-color: var(--accent); background: var(--panel); }
.drop p { margin: 6px 0; line-height: 1.55; }
.status { min-height: 20px; font-size: 13px; color: var(--muted); } .status.ok { color: var(--ok); } .status.warn { color: var(--warn); }

.libhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.empty { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.vol { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
.vol.dim { opacity: .55; } .vol.soon { border-style: dashed; } .vol.other h3 { color: var(--fg); }
.volhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.volhead h3 { margin: 4px 0; }
.chips { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.chip { display: inline-block; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line2); color: var(--muted); }
.chip.ok { border-color: var(--ok); color: var(--ok); }
.entries { display: flex; flex-direction: column; }
.entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 2px; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.ename { min-width: 0; } .ename .muted { font-size: 12.5px; }
.ebtn { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.need { color: var(--warn); max-width: 360px; white-space: normal; }
.unk { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }

.playhead { display: flex; justify-content: space-between; align-items: flex-end; }
.toolbar { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
#screenwrap { background: #000; border-radius: var(--radius); display: flex; justify-content: center; align-items: center; aspect-ratio: 640 / 400; max-height: calc(100vh - 220px); margin: 8px auto; }
#screenwrap:fullscreen { max-height: none; border-radius: 0; }
#screen { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; outline: none; cursor: crosshair; }
#screen:focus { box-shadow: 0 0 0 2px var(--accent); }
.notes { color: var(--muted); line-height: 1.5; }

table.cache { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cache th, table.cache td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cache th { color: var(--muted); font-weight: 500; } table.cache td.num { white-space: nowrap; }
ul.small li { margin: 4px 0; line-height: 1.5; }

@media (max-width: 720px) {
  #main { padding: 10px 16px 30px; }
  #topbar { gap: 8px; padding: 0 10px; } .brand { font-size: 16px; } .topright { display: none; }
  .tabs { overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .brand small { display: none; } .tabs button { padding: 6px 8px; font-size: 13px; }
  .entry { flex-direction: column; align-items: flex-start; } .ebtn { justify-content: flex-start; }
  #screenwrap { max-height: none; }
}
