:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --accent: #1f6feb; --accent-ink: #fff; --ok: #1a7f37; --warn: #9a6700; --bad: #cf222e;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --card: #171b23; --ink: #e6e9ef; --muted: #9aa3b5; --line: #2a303c;
          --accent: #4c8dff; --ok: #3fb950; --warn: #d29922; --bad: #f85149; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 15px/1.5 "Segoe UI", "Assistant", "Heebo", system-ui, -apple-system, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 700; color: var(--ink); font-size: 17px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; }
nav a.on, nav a:hover { color: var(--ink); background: var(--bg); text-decoration: none; }
main { padding: 24px 16px 60px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 40px; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink);
       padding: 8px 16px; border-radius: 8px; cursor: pointer; font: inherit; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { padding: 11px 28px; font-size: 16px; }
.btn.tiny { padding: 3px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: wait; }
.inline { display: inline; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: none; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--bg); }
tr.archived td { opacity: .55; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); }
.badge.big { font-size: 15px; padding: 4px 14px; }
.badge.queued { color: var(--muted); }
.badge.running { color: var(--warn); }
.badge.done { color: var(--ok); }
.badge.failed { color: var(--bad); }
.status-box { text-align: left; }
/* form */
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
       border-radius: 8px; padding: 8px 10px; font-weight: 400; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { width: auto; }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.grid2, .grid3 { display: grid; gap: 0 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg); cursor: pointer; }
.drop span { font-weight: 400; color: var(--muted); font-size: 13px; }
.drop input { border: none; background: transparent; padding: 0; }
.small-drop { padding: 10px 14px; margin-top: 12px; }
.search { margin-bottom: 8px; }
.lum-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.lum-item { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important;
            padding: 8px 12px; margin: 0 !important; border-bottom: 1px solid var(--line); font-weight: 400 !important; cursor: pointer; }
.lum-item:last-child { border-bottom: none; }
.lum-item:hover { background: var(--bg); }
.lum-name { font-weight: 600; }
.upload-row { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; margin: 0 !important; }
.inline-edit { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-edit input { width: auto; flex: 1; min-width: 140px; padding: 4px 8px; }
.inline-edit .note { font-size: 13px; }
.ok { color: var(--ok); margin: 10px 0 0; }
/* job */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cols .card { margin-bottom: 16px; }
.req { white-space: pre-wrap; font-size: 16px; background: var(--bg); padding: 10px 14px; border-radius: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.example { max-width: 220px; max-height: 220px; border: 1px solid var(--line); border-radius: 8px; }
.decisions { white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; font-size: 14px; line-height: 1.7; font-family: inherit; margin: 0; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.imgs img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.files { columns: 2; margin: 0; padding-inline-start: 18px; font-size: 13px; }
@media (max-width: 760px) {
  .grid2, .grid3, .cols { grid-template-columns: 1fr; }
  .files { columns: 1; }
  .top-in { height: auto; padding: 10px 16px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .upload-row { flex-direction: column; align-items: stretch; }
  td, th { white-space: nowrap; padding: 8px 10px; }
  nav { gap: 0; }
  nav a { padding: 4px 8px; }
  main { padding-top: 16px; }
  .head-row h1 { font-size: 20px; }
}
.banner { overflow-wrap: anywhere; }
details.edit summary { cursor: pointer; color: var(--accent); list-style: none; display: inline-block; margin-top: 2px; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] summary { display: none; }
details.edit .inline-edit { flex-direction: column; margin-top: 6px; }
.banner { margin-top: 12px; padding: 8px 14px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, var(--card));
          color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); font-size: 14px; }
.who { margin-inline-start: auto; white-space: nowrap; }
.login { max-width: 460px; margin: 60px auto; text-align: center; padding: 36px 28px; }
.login h1 { margin-bottom: 10px; }
.login .btn { margin: 18px 0 10px; }
.err { color: var(--bad); }
.warn-line { color: var(--warn); margin: -6px 0 14px; font-size: 14px; }
.corrections { margin: 0 0 12px; padding-inline-start: 20px; }
.correct-form { display: flex; gap: 10px; align-items: flex-start; }
.correct-form textarea { flex: 1; }
@media (max-width: 760px) { .correct-form { flex-direction: column; align-items: stretch; } .who { margin: 0; } }
.legal { max-width: 820px; margin: 0 auto; line-height: 1.75; }
.legal h2 { margin-top: 22px; }
.legal ul, .legal ol { padding-inline-start: 22px; }
.legal code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
