/* Layout: centred 860px column; tinted intro band per page; form split into panels. */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --band: #e8f0ec;
  --line: #d6dfdb;
  --ink: #142420;
  --muted: #5b6b66;
  --accent: #17604d;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe4;
  --danger: #b3322b;
  --ok: #1d7a46;
  --st-open-fg: #2f5fd0; --st-open-bg: #e4ebfb;
  --st-progress-fg: #8a5a00; --st-progress-bg: #fbefd5;
  --st-ready-fg: #1d7a46; --st-ready-bg: #dcf2e4;
  --focus: #2f5fd0;
  --shadow: 0 1px 2px rgba(20, 36, 32, .06), 0 4px 16px rgba(20, 36, 32, .05);
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513; --surface: #15201d; --band: #13231e; --line: #26352f;
    --ink: #e3ece8; --muted: #94a7a0; --accent: #4fc39f; --accent-ink: #062018; --accent-soft: #173a30;
    --danger: #ff8f86; --ok: #6fd69b;
    --st-open-fg: #93b2ff; --st-open-bg: #1c2a4a;
    --st-progress-fg: #f0c06a; --st-progress-bg: #3a2d12;
    --st-ready-fg: #6fd69b; --st-ready-bg: #15361f;
    --focus: #93b2ff;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent); }

.container { max-width: 860px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.container.narrow { max-width: 460px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 20px; padding-block: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.logo svg { width: 32px; height: 32px; flex: none; }
.logo-bg { fill: var(--accent); }
.logo-fg { stroke: var(--accent-ink); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.logo strong { font-family: var(--font-display); font-size: 17px; display: block; line-height: 1.1; }
.logo small { color: var(--muted); font-size: 12px; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 7px 12px; border-radius: 8px; }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.lang-select { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.link-btn { font: inherit; font-size: 14px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 4px; }
.link-btn:hover { color: var(--ink); }

/* page intro */
.page-intro { background: var(--band); border-bottom: 1px solid var(--line); padding-block: 32px 28px; margin-bottom: 24px; }
h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; text-wrap: balance; }
h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 14px; }
.lead { color: var(--muted); max-width: 62ch; margin: 0; }
.eyebrow { font-size: 13px; color: var(--accent); font-weight: 600; margin: 0 0 6px; letter-spacing: .02em; }

/* login */
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-block: 56px; box-shadow: var(--shadow); }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.login-card label { font-weight: 600; }
.code-input { font-family: var(--font-mono) !important; font-size: 18px !important; letter-spacing: .12em; text-transform: uppercase; }

/* form */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.panel.disabled { opacity: .45; pointer-events: none; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-check { justify-content: flex-end; padding-bottom: 10px; }
.field > label, .label { font-weight: 600; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; }
input[type=text], input[type=url], input[type=number], input[type=date], select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
.mono { font-family: var(--font-mono); font-size: 13.5px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); cursor: pointer; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { margin-top: 4px; accent-color: var(--accent); }
.option small { display: block; color: var(--muted); font-size: 13px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.row-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.heroes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: hero; }
.hero-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: start; counter-increment: hero; }
.hero-row::before { content: counter(hero); font-family: var(--font-mono); color: var(--muted); font-size: 13px; padding-top: 11px; text-align: right; }
@media (max-width: 640px) {
  .hero-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .hero-row .sub { grid-column: 2; }
}

.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 20px; text-align: center; background: var(--bg); }
.dropzone p { margin: 0 0 6px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid:empty { display: none; }
.photo { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line); }
.photo .meta { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.photo .meta input { padding: 6px 8px; font-size: 13px; }
.photo .name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { font: inherit; font-weight: 600; font-size: 15px; border-radius: 10px; padding: 11px 20px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: .55; cursor: wait; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { font-size: 13.5px; padding: 6px 12px; border-radius: 8px; }
.btn.wide { width: 100%; }
.icon-btn { width: 40px; height: 42px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 18px; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

.submit-bar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding-block: 12px calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; z-index: 5; }
.container-inner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-msg { margin: 0; font-size: 14px; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

/* requests */
.request-list { list-style: none; margin: 0 0 48px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.request-item a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.request-item a:hover { border-color: var(--accent); }
.request-item .title { font-weight: 600; overflow-wrap: anywhere; }
.request-item .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.status { font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; grid-row: span 2; }
.status.open { color: var(--st-open-fg); background: var(--st-open-bg); }
.status.in_progress { color: var(--st-progress-fg); background: var(--st-progress-bg); }
.status.ready { color: var(--st-ready-fg); background: var(--st-ready-bg); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; background: var(--surface); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* detail */
.back { text-decoration: none; font-weight: 600; display: inline-block; margin-top: 24px; }
.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0 20px; }
.detail-head .meta { color: var(--muted); font-size: 14px; margin: 0; }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; white-space: pre-wrap; }
.note h3, .result h3 { margin: 0 0 6px; font-size: 14px; font-family: var(--font-display); }
.result { background: var(--st-ready-bg); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.result ul { margin: 0; padding-left: 18px; font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
dl.kv { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 10px 18px; margin: 0 0 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
dl.kv dt { color: var(--muted); font-size: 14px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; } dl.kv dd { margin-bottom: 8px; } }
.quote { display: inline-block; font-family: var(--font-mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin: 0 4px 4px 0; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs figure { margin: 0; width: 120px; }
.thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: var(--line); }
.thumbs figcaption { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
