:root {
  --navy: #0A1A5C; --gold: #BD9A50; --red: #8B1538;
  --bg: #F4F5F8; --card: #FFFFFF; --text: #212529; --body: #4F4F4F; --muted: #6B7280;
  --line: #DDE1EA; --accent-bg: #EEF1F8; --todo: #D5D9E2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1220; --card: #171C2E; --text: #EEF0F5; --body: #C9CDD8; --muted: #9AA1B2;
    --line: #2A3148; --accent-bg: #1E2640; --todo: #343B55; --navy: #8FA3FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1220; --card: #171C2E; --text: #EEF0F5; --body: #C9CDD8; --muted: #9AA1B2;
  --line: #2A3148; --accent-bg: #1E2640; --todo: #343B55; --navy: #8FA3FF;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--body); font: 16px/1.55 Inter, system-ui, sans-serif; }
h1, h2 { font-family: Poppins, Inter, sans-serif; color: var(--text); margin: 0; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.top { background: #0A1A5C; color: #fff; padding: 28px 0 24px; border-bottom: 4px solid var(--gold); margin-bottom: 20px; }
.top h1 { color: #fff; font-size: 1.7rem; }
.top p { margin: 6px 0 0; opacity: .85; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #fff; font-size: .9rem; }
.lbl { display: block; font-weight: 600; color: var(--text); margin: 0 0 6px; font-size: .92rem; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
#code { width: 100%; max-width: 360px; }
input:focus-visible, select:focus-visible, button:focus-visible, .drop:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 28px 16px; text-align: center; cursor: pointer; display: grid; justify-items: center; gap: 4px; color: var(--navy); transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--accent-bg); border-color: var(--gold); }
.drop strong { color: var(--text); }
.files { list-style: none; padding: 0; margin: 12px 0 0; }
.files li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.fname { font-weight: 600; color: var(--text); word-break: break-all; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .bad { color: #C0392B; }
.lead { margin: 0 0 12px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.sel td { background: var(--accent-bg); }
td label { cursor: pointer; color: var(--text); font-weight: 500; }
.tag { font-size: .7rem; background: var(--gold); color: #fff; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.row .lbl { margin: 0; }
#budget { width: 90px; }
button { font: 600 .95rem Inter, sans-serif; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; background: var(--gold); color: #fff; }
button:hover:not(:disabled) { filter: brightness(1.07); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
button.danger { background: var(--red); }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 500; text-decoration: underline; margin-left: auto; }
.fp { padding: 12px 0; border-top: 1px solid var(--line); }
.fp-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.bar { height: 8px; background: var(--todo); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.bar div { height: 100%; background: var(--gold); transition: width .3s; }
.cells { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; }
.cells i { width: 10px; height: 10px; border-radius: 2px; background: var(--todo); }
.cells .c-working { background: var(--gold); } .cells .c-done { background: var(--navy); } .cells .c-failed { background: #C0392B; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
footer { padding: 8px 16px 32px; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 150%); background: #0A1A5C; color: #fff; padding: 12px 18px; border-radius: 10px; max-width: calc(100% - 32px); transition: transform .25s; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#toast.show { transform: translate(-50%, 0); } #toast.bad { background: #8B1538; }
@media (max-width: 560px) { .top h1 { font-size: 1.4rem; } th:nth-child(4), td:nth-child(4) { display: none; } }
