:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66716e;
  --line: #dbe2df;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --accent: #0f766e;
  --danger: #b42318;
  --warn: #9a6700;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); font-weight: 700; text-decoration: none; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-size: 18px; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-danger { color: var(--danger); font-size: 15px; font-weight: 1000; text-transform: uppercase; }
.nav form { margin: 0; }
.shell { width: min(1180px, calc(100vw - 32px)); margin: 28px auto; }
.grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 20px; align-items: start; }
.panel, .auth-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: 0 10px 24px rgba(24, 33, 31, .05); }
.panel.narrow { max-width: 760px; margin: 0 auto; }
.auth-panel { max-width: 420px; margin: 10vh auto; }
h1, h2 { margin: 0 0 18px; line-height: 1.15; }
h1 { font-size: 28px; } h2 { font-size: 19px; }
.form { display: grid; gap: 14px; }
.form.compact { grid-template-columns: 1fr; margin-bottom: 18px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font: inherit; color: var(--ink); background: #fff; }
input[type="checkbox"] { width: auto; }
.inline-check { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.inline-check input { flex: 0 0 auto; }
textarea { resize: vertical; }
button { border: 0; border-radius: 6px; padding: 11px 14px; font: inherit; font-weight: 800; background: var(--accent); color: #fff; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 11px 14px; font: inherit; font-weight: 800; background: var(--accent); color: #fff; cursor: pointer; }
.ghost-link { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.shirts { display: grid; gap: 10px; }
.shirt { display: grid; grid-template-columns: 34px 68px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.shirt.dragging { opacity: .45; border-color: var(--accent); }
.drag-handle { width: 34px; height: 34px; padding: 0; border-radius: 6px; background: #eef2f0; color: var(--muted); cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.shirt img { width: 68px; height: 68px; object-fit: contain; border-radius: 6px; background: #eef2f0; }
.shirt span { display: block; color: var(--muted); font-size: 13px; }
.presets { display: grid; gap: 8px; margin: 0 0 18px; }
.preset { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preset span { display: block; color: var(--muted); font-size: 13px; }
.preset form { margin: 0; }
.picker { display: grid; gap: 8px; max-height: 380px; overflow: auto; padding-right: 4px; }
.picker-item { display: grid; grid-template-columns: 18px 64px 1fr; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.picker-item:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(15, 118, 110, .12); }
.picker-item img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #eef2f0; }
.picker-item strong { color: var(--ink); }
.picker-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.pick-count { color: var(--muted); font-size: 13px; font-weight: 800; }
.preset-save { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.muted { opacity: .55; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.status { display: inline-flex; min-width: 86px; justify-content: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; background: #eef2f0; }
.status.completed { background: #dcfce7; color: #166534; }
.status.failed { background: #fee2e2; color: var(--danger); }
.status.running { background: #fef3c7; color: var(--warn); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job-actions { display: flex; align-items: center; gap: 10px; }
.job-actions form { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters a { border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; color: var(--muted); }
.filters a.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
figure { margin: 0; } figure img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #eef2f0; border: 1px solid var(--line); border-radius: 8px; }
figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.gallery-item.is-posted { box-shadow: inset 0 0 0 2px rgba(22, 101, 52, .12); }
.gallery-item img { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: #eef2f0; display: block; }
.gallery-meta { display: flex; justify-content: space-between; gap: 10px; padding: 12px; align-items: start; }
.gallery-meta span, .gallery-meta small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.gallery-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
.gallery-actions form { margin: 0; }
.gallery-actions button, .gallery-actions .button { width: 100%; }
.source-gallery { display: grid; gap: 12px; }
.source-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.source-card img { width: 96px; height: 120px; object-fit: contain; border-radius: 6px; background: #eef2f0; }
.source-card-meta span { display: block; color: var(--muted); font-size: 13px; margin: 4px 0; }
.source-card form { margin: 0; }
pre { white-space: pre-wrap; background: #f0f4f2; padding: 14px; border-radius: 8px; border: 1px solid var(--line); }
code { overflow-wrap: anywhere; }
.token-box { color: var(--accent); font-weight: 800; }
.muted-text, .help-text { color: var(--muted); margin: 0 0 18px; }
.help-text { margin: 14px 0 0; font-size: 13px; }
.settings { display: grid; gap: 8px; margin: 0 0 18px; }
.settings div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.settings dt { color: var(--muted); font-weight: 800; }
.settings dd { margin: 0; overflow-wrap: anywhere; }
.events { padding-left: 20px; } .events li { margin: 8px 0; } .events span { color: var(--muted); margin-right: 10px; }
.events .error, .error-text { color: var(--danger); font-weight: 700; }
.tutorial h1 { color: var(--danger); font-size: 34px; text-transform: uppercase; }
.tutorial p, .tutorial li { font-size: 17px; line-height: 1.55; }
.tutorial-steps { padding-left: 24px; }
.tutorial-steps li { margin: 10px 0; }
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; background: #eef2f0; }
.flash.error { color: var(--danger); background: #fee2e2; }
.flash.ok { color: #166534; background: #dcfce7; }
@media (max-width: 860px) { .grid, .images, .gallery { grid-template-columns: 1fr; } .topbar { padding: 0 16px; } .row { align-items: flex-start; flex-direction: column; } .source-card { grid-template-columns: 86px 1fr; } .source-card form { grid-column: 1 / -1; } }
