:root {
  --navy: #142235;
  --navy-2: #1d3150;
  --gold: #F5BE43;
  --gold-d: #b7841a;
  --white: #FFFFFF;
  --bg: #f3f5f9;
  --line: #dde3ec;
  --text: #17263a;
  --muted: #5d6b80;
  --ok: #157a4a;
  --ok-bg: #e5f5ec;
  --warn: #9a5b00;
  --warn-bg: #fff4dc;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --info-bg: #e9f0fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 34, 53, .06), 0 4px 14px rgba(20, 34, 53, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: #1d5fa8; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button, .btn { font: inherit; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 9px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; justify-content: center; line-height: 1.2; }
button:hover, .btn:hover { background: var(--navy-2); }
button.secondary, .btn.secondary { background: #fff; color: var(--navy); border-color: #c4cdda; }
button.secondary:hover, .btn.secondary:hover { background: #f1f4f8; }
button.gold, .btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 650; }
button.gold:hover, .btn.gold:hover { background: #f0b22a; }
button.danger { background: #fff; color: var(--bad); border-color: #e8b4ae; }
button.danger:hover { background: var(--bad-bg); }
button.small, .btn.small { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

input, select, textarea { font: inherit; color: inherit; border: 1px solid #c4cdda; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); vertical-align: middle; }
label { display: block; font-size: 13px; font-weight: 600; color: #34445b; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; margin: 6px 0; }
.help { font-weight: 400; color: var(--muted); font-size: 12px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #e8eef6; color: #2c3e57; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.gold { background: #fdf0cf; color: #7a5600; }
.notice { border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: var(--info-bg); }
.notice.warn { background: var(--warn-bg); }
.notice.bad { background: var(--bad-bg); }
.notice.ok { background: var(--ok-bg); }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); }
.toast.warn { background: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8fafc; }
.table-wrap { overflow-x: auto; }
progress { width: 100%; height: 10px; accent-color: var(--ok); }

dialog { border: none; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(20, 34, 53, .55); }
dialog .dlg-head { background: var(--navy); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1; }
dialog .dlg-head h3 { margin: 0; }
dialog .dlg-body { padding: 18px; }
dialog .dlg-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.demo-badge { background: var(--gold); color: var(--navy); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 6px; letter-spacing: .05em; }
