:root { --bg: #14110f; --panel: #1c1815; --ink: #e6dccb; --dim: #8f8473; --line: #3a322b; --jade: #7fc8a0; --gold: #d8b25a; --red: #d0705f; --blue: #8fb3d9; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
header { display: flex; align-items: baseline; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
h1 { font-size: 20px; margin: 0; color: var(--gold); letter-spacing: 1px; font-weight: normal; }
h2 { font-size: 12px; margin: 0 0 8px; color: var(--dim); text-transform: uppercase; letter-spacing: 2px; font-weight: normal; }
h3 { font-size: 13px; margin: 16px 0 6px; color: var(--gold); font-weight: normal; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
#status { flex: 1; color: var(--dim); }
#status b { color: var(--ink); font-weight: normal; }
#status .fast { color: var(--jade); }
#status .warn { color: var(--red); }
main { display: grid; grid-template-columns: 270px 1fr 300px; gap: 0; height: calc(100% - 46px); }
section { padding: 12px 14px; overflow-y: auto; border-right: 1px solid var(--line); }
section:last-child { border-right: 0; }
button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 4px 9px; cursor: pointer; }
button:hover { border-color: var(--gold); }
#sys button { font-size: 12px; color: var(--dim); }
#lang { display: inline-flex; margin-right: 6px; }
#lang button:first-child { border-radius: 3px 0 0 3px; border-right: 0; }
#lang button:last-child { border-radius: 0 3px 3px 0; }
#lang button.on { border-color: var(--gold); color: var(--gold); }
#lang button.on + button { border-left-color: var(--gold); }
html[lang="ko"] body { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; word-break: keep-all; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 4px; cursor: pointer; border-radius: 2px; font-variant-numeric: tabular-nums; }
.row:hover, .row.sel { background: var(--panel); }
.row .v { color: var(--ink); } .row .c { color: var(--dim); }
.row .r { width: 62px; text-align: right; color: var(--jade); }
.row .r.neg { color: var(--red); } .row .r.zero { color: var(--dim); }
.row.full .v { color: var(--gold); }
.row.low .v { color: var(--red); }
#explain { margin-top: 12px; padding: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--dim); min-height: 60px; }
#explain b { color: var(--ink); font-weight: normal; }
#explain div { display: flex; justify-content: space-between; }
#tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
#tabs button.on { border-color: var(--gold); color: var(--gold); }
#tabs button.ping::after { content: " •"; color: var(--jade); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.act { text-align: left; padding: 7px 9px; display: block; width: 100%; }
.act * { pointer-events: none; }   /* a press always lands on the button itself, even while its text refreshes */
.act b { font-weight: normal; color: var(--ink); }
.act i { font-style: normal; color: var(--dim); float: right; }
.act .desc { display: block; font-size: 12px; color: var(--dim); }
.act .cost { display: block; font-size: 12px; margin-top: 2px; }
.act.st-ok { border-color: var(--jade); }
.act.st-wait { opacity: .78; }
.act.st-cap { opacity: .5; border-style: dashed; }
.act .lack { color: var(--red); } .act .eta { color: var(--blue); } .act .capnote { color: var(--gold); }
.job { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.job .nm { width: 130px; } .job .ct { width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
.job .yield { color: var(--dim); font-size: 12px; flex: 1; }
.job button { width: 28px; padding: 2px 0; }
#queue { font-size: 12.5px; color: var(--dim); margin-bottom: 8px; }
#queue:empty { display: none; }
#queue span.q { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px 2px 8px; margin: 0 4px 4px 0; color: var(--ink); }
#queue span.q em { font-style: normal; color: var(--blue); }
#queue span.q em.capnote { color: var(--gold); }
#queue span.q button { border: 0; background: none; color: var(--red); padding: 2px 6px; }
input { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; width: 210px; max-width: 100%; margin-bottom: 4px; }
textarea { width: 100%; height: 120px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); font: 11px/1.3 ui-monospace, Menlo, monospace; padding: 6px; }
.note { color: var(--dim); font-size: 12.5px; margin: 6px 0; }
.big { font-size: 16px; color: var(--gold); margin: 4px 0 8px; }
.big.warn { color: var(--red); }
.pick button.on { border-color: var(--gold); color: var(--gold); }
.bar { height: 8px; background: var(--panel); border: 1px solid var(--line); margin: 6px 0; }
.bar > div { height: 100%; background: var(--jade); }
#log p { margin: 0 0 6px; font-size: 12.5px; color: var(--dim); }
#log p.good { color: var(--jade); } #log p.bad { color: var(--red); } #log p.info { color: var(--ink); }
#log p span { color: var(--line); margin-right: 6px; }
.done { color: var(--dim); font-size: 12px; }
@media (max-width: 900px) {
  html, body { height: auto; }
  header { flex-wrap: wrap; gap: 4px 12px; padding: 8px 10px; }
  #status { flex-basis: 100%; order: 3; font-size: 12.5px; }
  #sys { margin-left: auto; }
  main { display: block; height: auto; }
  section { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; overflow: visible; }
  #left h2 { display: none; }
  #res { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 6px; font-size: 12px; }   /* minmax(0): a long name is cut short, never the rate beside it */
  .row { padding: 1px 2px; gap: 3px; white-space: nowrap; }
  .row > span:first-child { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .row .r { width: auto; min-width: 0; }
  .row .c { font-size: 11.5px; }
  #explain { min-height: 0; margin-top: 6px; padding: 5px 8px; }
  #tabs { position: sticky; top: 0; background: var(--bg); padding: 6px 0; margin-bottom: 4px; z-index: 5; }
  #tabs button { min-height: 36px; flex: 1; padding: 4px 4px; white-space: nowrap; }
  .grid { grid-template-columns: 1fr 1fr; }
  .act { min-height: 44px; }
  .job { flex-wrap: wrap; gap: 4px 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
  .job .nm { width: auto; flex: 1; }
  .job .yield { flex-basis: 100%; }
  .job button { width: 44px; min-height: 36px; }
  .pick button { margin-bottom: 4px; min-height: 36px; }
  #right { max-height: 260px; overflow-y: auto; }
}
