@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('/fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('/fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 400; font-display: swap; src: url('/fonts/nunito-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 600; font-display: swap; src: url('/fonts/nunito-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 700; font-display: swap; src: url('/fonts/nunito-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --ink: #2B1408;
  --muted: #6B5246;
  --line: #CDB9AC;
  --line-soft: #EADDD3;
  --accent: #B8440C;
  --accent-dark: #8A2D0A;
  --link: #A63A08;
  --tint: #FBEFE2;
  --ground: #FFFFFF;
  --ok: #1E6B3A;
  --ok-tint: #E8F3EC;
  --err: #A3180F;
  --err-tint: #FBEAE8;
  --focus: #F0A04B;
  --display: 'Montserrat', system-ui, sans-serif;
  --body: 'Nunito Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
p { margin: 0; }
a { color: var(--link); font-weight: 600; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
label, .label { font-size: 15px; font-weight: 700; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; color: var(--ink);
}
input::placeholder { color: #8A7468; }
input[aria-invalid=true] { border-color: var(--err); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px; }
.pw-toggle {
  position: absolute; top: 4px; right: 4px; height: 44px; min-width: 64px; padding: 0 12px; border: 0;
  border-radius: 8px; background: transparent; font: inherit; font-size: 15px; font-weight: 700; color: var(--link); cursor: pointer;
}
.code-input { font-size: 26px !important; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0;
  border-radius: 10px; background: var(--accent); color: #fff; font-family: var(--display); font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-wide { width: 100%; min-height: 54px; font-size: 17px; }
.btn-quiet { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-quiet:hover { background: var(--tint); color: var(--ink); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn-danger { background: #fff; color: var(--err); border: 1.5px solid #E3B5B0; }
.btn-danger:hover { background: var(--err-tint); color: var(--err); }
.linklike { border: 0; background: none; padding: 0; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; color: var(--link); cursor: pointer; text-decoration: underline; }
.note { padding: 14px 16px; border-radius: 10px; background: var(--tint); font-size: 15px; color: #5A2A10; }
.note-err { background: var(--err-tint); color: var(--err); font-weight: 600; }
.note-ok { background: var(--ok-tint); color: var(--ok); font-weight: 600; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }

/* ---------- sign-in / setup layout ---------- */
.split { min-height: 100vh; display: flex; flex-wrap: wrap; }
.split-main { flex: 1 1 440px; min-width: 0; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 40px; }
.split-inner { width: 100%; max-width: 420px; }
.split-art { flex: 1.15 1 480px; min-width: 0; min-height: 100vh; padding: 64px; background: var(--tint); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.split-art img { display: block; width: 78%; max-width: 560px; height: auto; }
.logo { display: block; width: 220px; height: auto; }
@media (max-width: 860px) { .split-art { display: none; } }
.steps { display: flex; gap: 8px; margin: 0 0 4px; padding: 0; list-style: none; }
.steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--line-soft); }
.steps li.on { background: var(--accent); }
.qr { display: block; width: 220px; height: 220px; border: 1.5px solid var(--line-soft); border-radius: 12px; background: #fff; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; word-break: break-all; padding: 12px 14px; border-radius: 10px; background: var(--tint); }
.codes { margin: 0; padding: 16px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; border: 1.5px solid var(--line-soft); border-radius: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-variant-numeric: tabular-nums; }
ol.plain { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- signed-in layout ---------- */
.top { border-bottom: 1.5px solid var(--line-soft); background: #fff; }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.top .logo { width: 150px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a, .nav button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--tint); color: var(--ink); }
.nav a[aria-current=page] { color: var(--link); background: var(--tint); }
.page { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; display: flex; flex-direction: column; gap: 32px; }
.card { border: 1.5px solid var(--line-soft); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-narrow { max-width: 520px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; align-items: start; }
.table-box { overflow-x: auto; border: 1.5px solid var(--line-soft); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
th { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: #FDF8F3; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 200px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--line-soft); color: var(--ink); }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-wait { background: var(--tint); color: #7A3A0C; }
.badge-off { background: #ECE7E3; color: #55473F; }
.badge-lock { background: var(--err-tint); color: var(--err); }
.actions { display: flex; gap: 8px; }

dialog { width: min(460px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 24px 64px rgba(43, 20, 8, 0.28); }
dialog::backdrop { background: rgba(43, 20, 8, 0.5); }
.linkbox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; padding: 12px 14px; border-radius: 10px; background: var(--tint); user-select: all; }

@media print {
  .no-print, .split-art { display: none !important; }
  .split-main { padding: 0; }
}

.captcha { min-height: 65px; }
.captcha[hidden] { display: none; }
