@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("/static/fonts/nunito-latin.woff2") format("woff2"); }
:root {
  color-scheme: light;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #eef1f7; --border: #dfe3ec;
  --text: #17191f; --text-2: #4d5260; --muted: #858a97;
  --brand: #183f82; --brand-ink: #ffffff; --brand-soft: #e6ecf7;
  --ok: #1d7a3a; --ok-bg: #e3f3e7; --warn: #8a5a00; --warn-bg: #fdf1d6; --bad: #b42323; --bad-bg: #fbe4e2;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(20,30,60,.07);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214; --surface: #1b1c1f; --surface-2: #25272b; --border: #33353a;
    --text: #f0f0ee; --text-2: #c4c5c0; --muted: #8f9096;
    --brand: #8fb0ef; --brand-ink: #0d1530; --brand-soft: #1f2a44;
    --ok: #5fc27a; --ok-bg: #16301e; --warn: #f0b84a; --warn-bg: #3a2c0d; --bad: #f07a72; --bad-bg: #3d1a18;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #1b1c1f; --surface-2: #25272b; --border: #33353a;
  --text: #f0f0ee; --text-2: #c4c5c0; --muted: #8f9096;
  --brand: #8fb0ef; --brand-ink: #0d1530; --brand-soft: #1f2a44;
  --ok: #5fc27a; --ok-bg: #16301e; --warn: #f0b84a; --warn-bg: #3a2c0d; --bad: #f07a72; --bad-bg: #3d1a18;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { line-height: 1.45; -webkit-text-size-adjust: 100%; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.boot { padding: 40px 20px; color: var(--muted); }
.muted { color: var(--muted); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(110px + env(safe-area-inset-bottom)); }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border);
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; gap: 10px; }
.top img { height: 30px; display: block; }
.top .t { font-weight: 800; font-size: 17px; flex: 1; }
.top .t small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.top img.logo-d, .login img.logo-d { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .top img.logo-l, :root:not([data-theme="light"]) .login img.logo-l { display: none; }
  :root:not([data-theme="light"]) .top img.logo-d, :root:not([data-theme="light"]) .login img.logo-d { display: block; }
}

/* cards, headings */
h1 { font-size: 22px; margin: 6px 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 22px 0 8px; color: var(--text-2); font-weight: 700; }
.lead { color: var(--text-2); margin: 0 0 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer; }
.item .grow { flex: 1; min-width: 0; }
.item .ttl { font-weight: 700; overflow-wrap: anywhere; }
.item .sub { color: var(--text-2); font-size: 14px; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.chip.import { background: var(--brand-soft); color: var(--brand); }
.chip.export { background: var(--warn-bg); color: var(--warn); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; min-height: 48px; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.big { min-height: 60px; font-size: 18px; border-radius: 16px; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* forms */
label.f { display: block; font-weight: 700; margin: 14px 0 6px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 52px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 14px; font-size: 17px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yesno button { min-height: 64px; font-size: 18px; font-weight: 800; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; }
.yesno button.on.si { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.yesno button.on.no { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper button { min-height: 52px; font-size: 24px; font-weight: 800; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; }
.stepper input { text-align: center; font-size: 22px; font-weight: 800; }
.seal { font-size: 22px; font-weight: 800; letter-spacing: .04em; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-block; }
.choice { display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 8px; cursor: pointer; background: var(--surface); }
.choice.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.choice input { width: 22px; height: 22px; accent-color: var(--brand); }
.err { color: var(--bad); font-weight: 700; margin-top: 10px; min-height: 1.2em; }

/* wizard */
.prog { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 4px 0 6px; }
.prog i { height: 6px; border-radius: 3px; background: var(--border); }
.prog i.done { background: var(--brand); }
.prog i.cur { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.stepno { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ctx { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.bar .in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 8px; }
.bar .btn { padding: 10px 12px; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: pointer; }
.photos .up { display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.cam { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }

/* summary */
dl.sum { display: grid; grid-template-columns: 42% 1fr; gap: 8px 12px; margin: 0; }
dl.sum dt { color: var(--muted); font-size: 14px; }
dl.sum dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.edit { font-size: 13px; font-weight: 700; }
.alert { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand); }
.done-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 40px; margin: 10px auto; }

/* login */
.login { max-width: 420px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 20px 40px; }
.login .logo { display: block; height: 64px; margin: 10px auto 18px; }
.login h1 { text-align: center; }
.login p.c { text-align: center; color: var(--text-2); margin-top: 0; }
.login .btn { width: 100%; margin-top: 18px; }
.chk { display: flex; gap: 10px; align-items: center; margin-top: 14px; color: var(--text-2); }
.chk input { width: 22px; height: 22px; accent-color: var(--brand); }
.secret { font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all; background: var(--surface-2); padding: 10px; border-radius: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: none;
  background: #1e2533; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
