:root {
  --ink: #14202b; --muted: #596977; --line: #d5dce2; --bg: #f1f4f6; --card: #ffffff;
  --brand: #16212b; --link: #0a7aa3; --focus: #1fa6d4;
  --ok: #1b6e41; --ok-bg: #e5f4ea; --warn: #8a5200; --warn-bg: #fff3d6; --bad: #a82a22; --bad-bg: #fde9e7;
  --radius: 8px; --tap: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px max(16px, env(safe-area-inset-left)); background: #fff; border-bottom: 3px solid var(--focus); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .02em; }
.brand img { height: 36px; width: auto; display: block; }
.brand span { border-left: 1px solid var(--line); padding-left: 12px; font-size: 1rem; }
.who { display: flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--muted); text-align: right; }
.who strong { color: var(--ink); display: block; }

main { max-width: 860px; margin: 0 auto; padding: 16px 16px 96px; outline: none; }
.banner { padding: 10px 16px; font-weight: 600; text-align: center; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: 92vw; background: var(--brand); color: #fff; padding: 12px 18px; border-radius: var(--radius); z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.spread { justify-content: space-between; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.tile strong { font-size: 1.05rem; } .tile span { color: var(--muted); font-size: .875rem; }
.tile.primary { background: var(--brand); color: #fff; border-color: var(--brand); grid-column: 1 / -1; min-height: 88px; }
.tile.primary span { color: #c8d4de; }
.tile.disabled { opacity: .55; pointer-events: none; border-style: dashed; }
.tile:hover:not(.disabled) { border-color: var(--focus); }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-weight: 400; color: var(--muted); font-size: .8125rem; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #aab6c0; border-radius: var(--radius); }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
textarea.big { min-height: 260px; }
input::placeholder, textarea::placeholder { color: #8b97a2; font-style: italic; }   /* grey guidance: never real data */
input[readonly] { background: #eef2f5; color: #3b4854; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid #aab6c0; border-radius: var(--radius); margin-bottom: 8px; background: #fff; cursor: pointer; font-weight: 400; }
.radio input { width: 22px; min-height: 22px; margin: 2px 0 0; flex: none; }
.radio.checked { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #f6fafc; }

button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; font: inherit; font-weight: 600; border-radius: var(--radius); border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--brand); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.small { min-height: 40px; padding: 6px 12px; font-size: .875rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* chips */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.chip.ok { color: var(--ok); background: var(--ok-bg); } .chip.warn { color: var(--warn); background: var(--warn-bg); } .chip.bad { color: var(--bad); background: var(--bad-bg); } .chip.neutral { color: var(--muted); background: #eef2f5; }

/* wizard */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.steps li { text-align: center; font-size: .8125rem; padding: 8px 4px; border-bottom: 4px solid var(--line); color: var(--muted); font-weight: 600; }
.steps li.on { border-color: var(--focus); color: var(--ink); } .steps li.done { border-color: var(--brand); color: var(--ink); }
.steps button { all: unset; cursor: pointer; display: block; width: 100%; padding: 8px 4px; }
.wizard-nav { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 24%); padding: 20px 0 max(12px, env(safe-area-inset-bottom)); display: flex; gap: 12px; justify-content: space-between; }
.savebar { font-size: .8125rem; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 12px; }

/* photos */
.photo { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: #fff; }
.photo img { width: 140px; height: 110px; object-fit: cover; border-radius: 6px; background: #dde3e8; }
.photo .acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .photo { grid-template-columns: 1fr; } .photo img { width: 100%; height: 200px; } }
.drop { border: 2px dashed #aab6c0; border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 14px; background: #fff; }
.photo.drag { opacity: .5; }

/* tables / lists */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.scroll { overflow-x: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.nc { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
.nc.issued { background: #f5f7f9; }
.path { font-family: Consolas, "SF Mono", monospace; font-size: .8125rem; word-break: break-all; background: #eef2f5; padding: 6px 8px; border-radius: 6px; user-select: all; }
.errors { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.result { border-radius: var(--radius); padding: 16px; margin-bottom: 16px; border: 1px solid; }
.result.ok { background: var(--ok-bg); border-color: var(--ok); } .result.warn { background: var(--warn-bg); border-color: var(--warn); } .result.bad { background: var(--bad-bg); border-color: var(--bad); }
.login { max-width: 460px; margin: 8vh auto; }
.login button { width: 100%; margin-bottom: 10px; justify-content: flex-start; text-align: left; }
@media (prefers-reduced-motion: no-preference) { .tile, button { transition: border-color .12s, background-color .12s; } }

/* spacing between adjacent flex rows / blocks */
.row + .row, .row + p, .row + .field, p + .row, .result + .row, .errors + .row, .result + .result { margin-top: 12px; }
.card .row + h3 { margin-top: 16px; }
button.icon { padding: 6px 10px; min-width: 40px; }
