:root {
  color-scheme: light;
  --ink: #16263b;
  --muted: #586983;
  --navy: #0f1e32;
  --navy-2: #1d3858;
  --paper: #f4f7fb;
  --line: #dce5ef;
  --white: #fff;
  --gold: #e8bc72;
  --green: #086651;
  --red: #9a353c;
  --radius: 13px;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: #214e7c; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #317db6; outline-offset: 2px;
}
.skip { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .6rem; background: white; }
.skip:focus { top: .5rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.58rem, 3.5vw, 2.45rem); line-height: 1.16; letter-spacing: -.045em; }
h2 { font-size: 1.15rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
p + p { margin-top: .6rem; }
small, .muted { color: var(--muted); }
img { display: block; max-width: 100%; }
.loading { padding: 3rem; }
.button, button {
  min-height: 39px; border: 1px solid var(--line); border-radius: 8px; padding: .48rem .78rem;
  color: var(--ink); background: white; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1.3;
}
button:hover, .button:hover { background: #f1f6fc; border-color: #bacde1; }
.primary { color: white; background: #1b4167; border-color: #1b4167; }
.primary:hover { background: #285982; color: white; }
.subtle { min-height: 32px; font-size: .84rem; padding: .35rem .6rem; }
.danger { color: var(--red); }
.danger-primary { color: white; background: #922f38; border-color: #922f38; }
.danger-primary:hover { color: white; background: #75242c; border-color: #75242c; }
.actions, .filters, .stack-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.shell { display: grid; grid-template-columns: 228px minmax(0,1fr); min-height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; gap: 1.6rem; background: var(--navy); color: #ecf2fa;
  padding: 1.15rem .95rem; position: sticky; top: 0; height: 100dvh; overflow: auto;
}
.wordmark { display: flex; align-items: center; gap: .7rem; }
.wordmark img { width: 42px; aspect-ratio: 1; object-fit: contain; }
.wordmark strong { display: block; font-size: .96rem; }
.wordmark small { display: block; color: #b5c4d7; font-size: .76rem; }
.sidebar nav { display: grid; gap: .28rem; }
.nav-caption { color: #a4b7cf; text-transform: uppercase; letter-spacing: .11em; font-size: .69rem; margin: 0 .7rem .35rem; }
.nav { justify-content: flex-start; padding: .64rem .72rem; border-color: transparent; background: transparent; color: #dbe8f8; text-align: left; }
.nav:hover, .nav.current { color: white; background: #233d5d; border-color: #385573; }
.nav.current { box-shadow: inset 3px 0 0 var(--gold); }
.nav-icon { display: inline-grid; place-items: center; width: 1.35rem; color: #b6cbe5; flex: 0 0 1.35rem; }
.nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; }
.sidebar footer { margin-top: auto; display: grid; gap: .4rem; border-top: 1px solid #304459; padding-top: .8rem; }
.sidebar footer .actions { gap: .35rem; }
.sidebar footer button { background: #1c3049; color: #eaf2fc; border-color: #3a526c; }
.workspace { min-width: 0; padding: clamp(.9rem, 3vw, 2rem); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.pagehead p { color: var(--muted); margin-top: .35rem; max-width: 64ch; }
.eyebrow { color: #2d5877; font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; display: block; margin-bottom: .35rem; }
.hero {
  color: white; border-radius: 16px; padding: clamp(1.1rem, 3vw, 2rem);
  background: #162b45 url('/ui/brand-pattern.svg') center 47% / cover;
  margin-bottom: 1rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.hero .eyebrow { color: var(--gold); }
.hero p { margin-top: .35rem; color: #c7d6e9; }
.hero input { background: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(205px,100%),1fr)); gap: .8rem; margin-bottom: 1rem; }
.card, .panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.card { padding: .9rem 1rem; }
.fee-steps { margin: 0; }
.fee-steps p { margin: .25rem 0 .55rem; color: var(--muted); }
.fee-breakdown { display: grid; gap: .22rem; margin: 0; }
.fee-breakdown div { display: flex; justify-content: space-between; gap: .8rem; }
.fee-breakdown div:last-child { border-top: 1px solid var(--line); margin-top: .2rem; padding-top: .35rem; }
.metric span { display: block; color: var(--muted); font-weight: 600; font-size: .83rem; }
.metric strong { display: block; font-size: clamp(1.17rem, 2.25vw, 1.7rem); letter-spacing: -.04em; margin: .25rem 0 .12rem; overflow-wrap: anywhere; }
.metric small { display: block; font-size: .78rem; }
.metric.positive strong { color: var(--green); }
.metric.negative strong { color: var(--red); }
.panel { min-width: 0; margin-bottom: 1rem; }
.panel-head { padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.panel-body { padding: 1rem; }
.columns { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(360px,100%),1fr)); gap: .9rem; }
.table-wrap { overflow: auto; max-width: 100%; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .67rem .82rem; border-bottom: 1px solid #e9eff6; vertical-align: middle; }
th { font-size: .75rem; color: #4f6480; background: #f7f9fd; white-space: nowrap; }
td { font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; border-radius: 20px; padding: .22rem .53rem; color: #324d72; background: #eaf1fa; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.tag.good { color: #075445; background: #dcefe9; }
.tag.warn { color: #805310; background: #fff0d4; }
.tag.bad { color: #822f37; background: #f9e5e8; }
.empty { padding: 1.25rem; text-align: center; color: var(--muted); }
.notice-box { border: 1px solid #d3e3f1; background: #eff6fc; padding: .78rem .9rem; border-radius: 8px; margin-bottom: 1rem; color: #244561; }
.notice-box.warn { background: #fff6e6; border-color: #f3d39d; color: #664514; }
.notice-box.bad, .form-error:not(:empty) { color: var(--red); background: #fcf0f1; border: 1px solid #edc5ca; padding: .65rem .8rem; border-radius: 8px; }
.filters { margin-bottom: .85rem; }
.field { display: flex; flex-direction: column; min-width: 0; gap: .29rem; font-weight: 600; font-size: .88rem; }
.field small { font-weight: 400; }
input, select, textarea {
  display: block; color: var(--ink); background: white; border: 1px solid #bccce0; border-radius: 7px;
  min-width: 0; width: 100%; min-height: 39px; padding: .46rem .55rem;
}
textarea { resize: vertical; min-height: 68px; }
input[type="checkbox"] { width: 1.05rem; min-height: 1.05rem; margin: .2rem 0; accent-color: #23557c; }
.check { display: flex; align-items: center; gap: .55rem; min-height: 39px; font-size: .88rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.full { grid-column: 1/-1; }
.form-error { margin: .7rem 0 0; font-size: .9rem; }
.form-error:empty, [hidden] { display: none !important; }
.search { min-width: min(245px,100%); }
dialog { padding: 0; width: min(670px,calc(100% - 1.3rem)); max-height: min(90dvh, 880px); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 20px 85px #0a1d3d66; }
dialog::backdrop { background: #0c1c32a8; }
.dialog-form { display: flex; flex-direction: column; max-height: min(90dvh,880px); }
.dialog-head, .dialog-actions { flex-shrink: 0; background: white; padding: .75rem 1rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.dialog-head { border-bottom: 1px solid var(--line); justify-content: space-between; }
.dialog-actions { border-top: 1px solid var(--line); justify-content: flex-end; }
.dialog-content { overflow: auto; min-height: 0; padding: .95rem 1rem; }
#notice { position: fixed; bottom: .8rem; right: .8rem; max-width: min(390px,92vw); z-index: 10; }
.toast { padding: .75rem 1rem; border-radius: 9px; background: #183d5c; color: white; box-shadow: 0 8px 25px #15375133; }
.toast.bad { background: #8a2f3a; }
.gate { min-height: 100dvh; display: grid; grid-template-columns: minmax(0,1.03fr) minmax(0,.97fr); }
.gate-art { background: #12243d url('/ui/brand-pattern.svg') center / cover; color: white; padding: clamp(1.4rem,5vw,4rem); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 1.3rem; }
.gate-art .eyebrow { color: var(--gold); }
.gate-art h1 { font-size: clamp(2.15rem, 5.5vw, 4.6rem); max-width: 12ch; }
.gate-art p { color: #ccdaed; max-width: 41ch; margin-top: .7rem; }
.gate-art .big-logo { width: 133px; max-height: 24vh; object-fit: contain; }
.gate-main { display: grid; align-content: center; padding: clamp(1rem,5vw,4.1rem); }
.gate-main form, .gate-main .gate-inner { width: min(100%,460px); margin: auto; }
.gate-main .field, .gate-main .actions { margin-top: .65rem; }
.gate-main h1 { margin-bottom: .5rem; }
.gate-main .institution { max-width: 300px; margin-bottom: 1rem; }
.key { overflow-wrap: anywhere; white-space: normal; display: block; padding: .65rem; border: 1px solid var(--line); background: #f4f7fb; user-select: all; }
#print-area { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 176px minmax(0,1fr); }
  .sidebar { padding: .85rem .65rem; }
}
@media (max-width: 730px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; gap: .6rem; }
  .sidebar nav, .sidebar footer { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
  .sidebar footer { padding-top: .4rem; }
  .nav-caption { display: none; }
  .nav { font-size: .82rem; min-height: 32px; padding: .35rem .55rem; }
  .nav-icon { display: none; }
  .wordmark img { width: 33px; }
  .gate { display: block; }
  .gate-art { display: none; }
  .gate-main { min-height: 100dvh; align-content: center; }
}
@media (max-width: 490px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .dialog-head, .dialog-actions, .dialog-content { padding: .65rem .72rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media print {
  @page { margin: 13mm; size: A4; }
  :root, body { color: #111; background: #fff; font-size: 11pt; }
  body > :not(#print-area) { display: none !important; }
  #print-area { display: block; }
  .print-head { display: flex; align-items: center; gap: 15px; border-bottom: 2px solid #173655; padding-bottom: 9px; }
  .print-head img { width: 145px; }
  .print-body { padding-top: 15px; }
  .print-policy { margin-top: 15px; border-top: 1px solid #ddd; padding-top: 10px; }
  tr { break-inside: avoid; }
}
