:root {
  --bg: #f6f5f2; --surface: #ffffff; --line: #e3e1db; --fg: #1d1d1b; --muted: #6f6d66;
  --accent: #3b5bdb; --idle: #2f9e44; --run: #e8a300; --block: #d9480f; --review: #1c7ed6; --done: #868e96;
  --radius: 12px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111214; --surface: #1a1b1e; --line: #2c2e33; --fg: #ececea; --muted: #9a9890; --accent: #748ffc; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: calc(15px * var(--fs, 1))/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 12px 16px 80px; display: grid; gap: 22px; }
h2 { font-size: calc(17px * var(--fs, 1)); margin: 0; font-weight: 600; }
h3 { font-size: calc(17px * var(--fs, 1)); margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 12px; white-space: nowrap; flex: none; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; }
button.danger.on { background: var(--block); border-color: var(--block); color: #fff; }
button.plain { border: 0; background: none; padding: 0; text-align: left; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 11px; }
textarea { resize: vertical; }
select { width: auto; }
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; }
.top-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meter { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 10px; background: transparent; }
.seg button.on { background: var(--fg); color: var(--bg); }
.small-seg button { padding: 4px 10px; font-size: calc(13px * var(--fs, 1)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.throw textarea { border: 0; padding: 4px; font-size: calc(17px * var(--fs, 1)); background: transparent; }
.throw textarea:focus { outline: none; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: calc(13px * var(--fs, 1)); }
.block { display: block; }
.empty { padding: 6px 2px; }
.warn { color: var(--block); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.section-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.pill:not(:empty) { background: var(--review); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: calc(13px * var(--fs, 1)); }
.board { display: grid; gap: 10px; }
.board.large { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.board.small { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 640px) { .board.small { grid-template-columns: repeat(3, 1fr); } .board.large { grid-template-columns: 1fr; } }
.ai-card { display: grid; gap: 6px; border-top-width: 4px; }
.lamp-border-idle { border-top-color: var(--idle); } .lamp-border-running { border-top-color: var(--run); }
.lamp-border-blocked { border-top-color: var(--block); } .lamp-border-needs_review { border-top-color: var(--review); }
.lamp { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lamp-idle { background: var(--idle); color: var(--idle); } .lamp-running { background: var(--run); color: var(--run); }
.lamp-blocked { background: var(--block); color: var(--block); } .lamp-needs_review { background: var(--review); color: var(--review); }
.ai-small { margin: 0; text-align: center; padding: 10px 8px; }
.ai-small figcaption { display: flex; flex-direction: column; }
.gauge { width: 100%; max-width: 160px; background: none !important; }
.g-track { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; }
.g-arc { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; }
.g-needle { stroke: var(--fg); stroke-width: 3; stroke-linecap: round; transform-origin: 80px 86px; transition: transform .6s ease; }
.g-hub { fill: var(--surface); stroke: var(--fg); stroke-width: 2; }
.job-line, .item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; }
.job-line { padding: 6px 8px; border-color: transparent; background: color-mix(in srgb, var(--line) 35%, transparent); }
.list { display: grid; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--done); }
.st-queued { background: var(--idle); } .st-running { background: var(--run); } .st-blocked { background: var(--block); }
.st-needs_review { background: var(--review); } .st-done { background: var(--done); }
.check-btn { border-radius: 50%; width: 30px; height: 30px; padding: 0; flex: none; }
.add-form { display: grid; gap: 8px; }
.check { display: flex; gap: 6px; align-items: center; font-size: calc(13px * var(--fs, 1)); }
.check input { width: auto; }
dialog { width: min(760px, 96vw); max-height: 90vh; border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--fg); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-inner { padding: 16px; display: grid; gap: 10px; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
summary { cursor: pointer; font-weight: 600; font-size: calc(14px * var(--fs, 1)); }
.pre { white-space: pre-wrap; word-break: break-word; font: calc(13px * var(--fs, 1))/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 8px 0 0; max-height: 360px; overflow: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
fieldset { display: grid; gap: 8px; }
legend { font-weight: 600; font-size: calc(14px * var(--fs, 1)); padding: 0 4px; }
.timeline { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
#mic.rec { background: var(--block); color: #fff; border-color: var(--block); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; transition: .25s; pointer-events: none; max-width: 92vw; font-size: calc(14px * var(--fs, 1)); }
#toast.show { opacity: 1; transform: translateX(-50%); }
.job-line, .item { white-space: normal; flex: initial; min-width: 0; }
.job-line { flex-wrap: wrap; }
.job-line .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-basis: 60%; }
.ai-card { min-width: 0; overflow: hidden; }
.fontsize { display: flex; align-items: center; gap: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.fontsize input { width: 110px; padding: 0; accent-color: var(--accent); }
.fontsize output { min-width: 3.2em; text-align: right; }
/* 글자를 키워도 겹치지 않게 */
.board.large { grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(200px * var(--fs, 1))), 1fr)); }
.ai-card > header { flex-wrap: wrap; row-gap: 2px; }
.meter { min-width: calc(120px * var(--fs, 1)); }
.meter .small { white-space: nowrap; }
