:root {
  --W: #c9a227; --U: #2f6fde; --B: #4a4150; --R: #d6402e; --G: #2e9b4f; --C: #9a9a9a;
  --bg: #f6f5f2; --card: #fff; --ink: #1f1f1f; --muted: #6b6b6b; --line: #e3e1dc; --accent: #6d4ad6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
header h1 { font-size: 17px; margin: 0 8px 0 0; }
select, input[type=number], button { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input[type=number] { width: 70px; }
button { cursor: pointer; }
.tog { color: var(--muted); user-select: none; white-space: nowrap; }
#upMsg.err { color: #b3261e; }
body.dropping::after { content: "Drop the log file to import its drafts"; position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(109, 74, 214, .12); border: 3px dashed var(--accent); font-size: 20px; color: var(--accent); pointer-events: none; }
#logsBox { position: relative; }
#logsBox summary { cursor: pointer; color: var(--muted); font-size: 13px; white-space: nowrap; }
#logsBox summary.ok::before { content: "✓ "; color: #2e9b4f; }
#logsBox summary.warn { color: #b3261e; font-weight: 600; }
#logsBox summary.warn::before { content: "⚠ "; }
.logspanel { position: absolute; z-index: 20; top: 26px; left: 0; width: min(560px, 92vw); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.12); display: grid; gap: 8px; }
.logspanel code { font-size: 12px; word-break: break-all; background: #f6f5f2; padding: 1px 4px; border-radius: 4px; }
.logspanel .row { display: flex; gap: 6px; margin-top: 4px; }
.logspanel input[type=text] { flex: 1; font: 12px ui-monospace, monospace; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
#whereBox { display: inline-block; position: relative; margin-left: 6px; }
#whereBox summary { cursor: pointer; color: var(--accent); font-size: 13px; list-style: none; }
#whereBox summary::-webkit-details-marker { display: none; }
#whereBox summary::before { content: "? "; font-weight: 700; }
.ostabs { display: flex; gap: 4px; }
.ostabs button { font-size: 12px; }
.ostabs button[aria-selected=true] { background: #efeaff; border-color: #cfc2ff; font-weight: 600; }
#whereSteps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.pathrow { display: flex; gap: 6px; align-items: flex-start; margin-top: 3px; }
.pathrow code { flex: 1; }
.pathrow button { font-size: 12px; padding: 1px 6px; }
kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fafafa; }
ul.found { margin: 2px 0 4px; padding-left: 18px; }
#importMsg { display: grid; gap: 4px; margin-top: 4px; }
#dirMsg.err, #importMsg.err, .errtext { color: #b3261e; }
#status { margin-left: auto; color: var(--muted); font-size: 12px; }
#status.live::before { content: "●"; color: #2e9b4f; margin-right: 4px; }
#banner { padding: 10px 16px; background: #efeaff; border-bottom: 1px solid #ddd3ff; }
#phaseTitle { font-weight: 700; font-size: 16px; color: var(--accent); }
#pickLabel { margin-left: 10px; color: var(--muted); }
#nudge { font-size: 15px; margin-top: 2px; }
#advice { color: var(--muted); font-size: 12px; margin-top: 2px; }
main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 12px; padding: 12px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.wide { grid-column: 1 / -1; }
h2 { font-size: 14px; margin: 2px 0 8px; }
h2 small { font-weight: 400; color: var(--muted); }
.cardhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.opts { display: flex; gap: 12px; flex-wrap: wrap; }
#chart { width: 100%; height: auto; display: block; }
#pickSlider { width: 100%; }
#legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
#legend .lg { cursor: pointer; border-radius: 6px; padding: 0 4px; }
#legend .lg:hover { background: #f0edf8; }
#legend .lg.on { outline: 1.5px solid #6d4ad6; }
#legend .lg.dim { opacity: .45; }
#legend span b { font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.bar { display: grid; grid-template-columns: 18px 1fr 52px; gap: 6px; align-items: center; margin: 3px 0; font-variant-numeric: tabular-nums; }
.bar .track { background: #f0eee9; border-radius: 4px; height: 12px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 4px; }
.bar .v { text-align: right; font-size: 12px; color: var(--muted); }
#pool { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 12px; }
#strip { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-end; }
.pk { display: flex; flex-direction: column; align-items: center; width: 22px; cursor: pointer; padding: 2px 0; border-radius: 4px; }
.pk:hover, .pk.sel { background: #efeaff; }
.pk .big { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.pk .small { width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; border: 1px solid rgba(0,0,0,.15); }
.pk .n { font-size: 9px; color: var(--muted); }
.pk.nosig .big { opacity: .45; }
.packsep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #f0eee9; }
th { font-weight: 600; color: var(--muted); font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.picked { background: #fff6d6; }
td img.thumb { width: 34px; border-radius: 3px; display: block; }
.pip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 2px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.15); }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; background: #f0eee9; margin-right: 4px; }
.tag.best { background: #e5dcff; }
.tag.pick { background: #ffe9a6; }
.pos { color: #1d7a3e; } .neg { color: #b2382b; }
#preview { position: fixed; pointer-events: none; z-index: 10; }
#preview img { width: 240px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
footer { padding: 10px 16px 20px; color: var(--muted); font-size: 12px; }
footer a { color: inherit; }
@media (max-width: 800px) { main { grid-template-columns: 1fr; } }
#tip { position: fixed; z-index: 11; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 8px 10px; font-size: 12px; max-width: 380px; }
#tip table { margin-top: 4px; }
#tip td { padding: 1px 6px 1px 0; border: 0; white-space: nowrap; }
#tip td:first-child { white-space: normal; }
#chart { cursor: crosshair; }
#report { margin: 12px 16px 0; }
#report > div { margin: 4px 0; }
#report .verdict { font-weight: 600; }
#report .verdict.best { color: #2e7d32; }
#report .verdict.close { color: #b26a00; }
#report .verdict.off { color: #c62828; }
