:root {
  --navy: #0B1630; --raised: #14224A; --line: #243566;
  --amber: #FFB020; --amber-hi: #FFD36B;
  --text: #F2F5FF; --dim: #9FB0D8; --green: #2ECC71; --red: #FF5A5F;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--navy); color: var(--text); }
body { font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--amber); }
h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 16px; }
h2 { font-size: 18px; line-height: 1.3; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted, .fine { color: var(--dim); }
.fine { font-size: 13px; line-height: 20px; }
.pad { padding: 16px; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--amber); color: var(--navy); padding: 8px 16px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 8px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 16px; max-width: 960px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .02em; margin-right: auto; border-radius: 10px; }
.top nav { display: none; flex-direction: column; gap: 4px; order: 3; width: 100%; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.top nav.open { display: flex; }
.top nav a { color: var(--dim); text-decoration: none; padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 10px; font-weight: 500; font-size: 15px; }
.top nav a:hover { background: var(--navy); color: var(--text); }
.top nav a[aria-current="page"] { color: var(--amber); background: var(--navy); }
@media (min-width: 761px) {
  #menu { display: none !important; }
  .top nav, .top nav.open { display: flex; flex-direction: row; flex-wrap: wrap; order: 0; width: auto; flex: 1; background: none; border: 0; padding: 0; }
  .brand { margin-right: 0; }
  #signout { margin-left: auto; }
}

main { max-width: 960px; margin: 0 auto; padding: 8px 16px 64px; outline: none; }
main > section > h1 { margin-bottom: 16px; }
main > section > p.muted { margin: -8px 0 16px; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 16px; }
@media (min-width: 761px) { .card { padding: 24px; } }
.narrow { max-width: 440px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 761px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } .grid.cols3 { grid-template-columns: repeat(3, 1fr); } }
.grid { margin: 0 0 16px; }
.grid > .card { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 16px; }
.card > .row:last-child, .stack > .row { margin-bottom: 0; }
.row.tight { gap: 4px 8px; }
.row.tight .pill { margin: 0; }
.stack > * + * { margin-top: 16px; }

label, legend { display: block; font-weight: 500; font-size: 14px; margin: 0 0 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; min-height: 44px; font: inherit; color: var(--text); background: var(--navy);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 88px; }
input:focus-visible, .brand:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--amber-hi); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; font-size: 15px; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--amber); }
.radios { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .radios { grid-template-columns: 1fr 1fr; } }
.radios .check { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--navy); }
.radios .check:has(input:checked) { border-color: var(--amber); }
.check:has(input:focus-visible) { outline: 2px solid var(--amber-hi); outline-offset: 2px; }
.check input:focus-visible { outline-offset: 1px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .1s ease-out, background-color .2s ease, border-color .2s ease; }
.btn.primary { background: var(--amber); color: var(--navy); }
.btn.primary:hover { background: var(--amber-hi); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--raised); border-color: var(--dim); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 14px; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary:focus-visible { outline-color: var(--text); }

.msg { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; border: 1px solid var(--line); }
.msg.err { color: var(--red); border-color: var(--red); }
.msg.ok { color: var(--green); border-color: var(--green); }
.msg { overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); margin: 0 4px 4px 0; }
.pill.green { color: var(--green); border-color: var(--green); }
.pill.red { color: var(--red); border-color: var(--red); }
.pill.amber { color: var(--amber); border-color: var(--amber); }
.pill.dot::before, .chip::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); margin: 0 4px 4px 0; }
.chip.red { color: var(--red); border-color: var(--red); background: rgba(255,90,95,.1); }
.chip.amber { color: var(--amber); border-color: var(--amber); background: rgba(255,176,32,.1); }

.stat { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; transition: border-color .2s ease; }
.stat:hover { border-color: var(--dim); }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.banner p { margin: 4px 0 0; }
.banner.warn { border-color: var(--amber); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px 0; }
.empty p { margin: 0; }
.empty img { opacity: .7; }
.sk { height: 16px; border-radius: 10px; background: var(--line); margin: 0 0 12px; animation: pulse 1.6s ease-in-out infinite; }
.sk.short { width: 60%; } .sk-title { height: 32px; width: 40%; margin: 0 0 16px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--amber); border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.meter { height: 8px; border-radius: 999px; background: var(--navy); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 0; }
.meter > span { display: block; height: 100%; background: var(--amber); transition: width .4s ease-out; }
.meter.full > span { background: var(--red); }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.list .name { font-weight: 600; overflow-wrap: anywhere; }

.price { font-size: 28px; font-weight: 700; line-height: 1.2; }
.price small { font-size: 14px; font-weight: 400; color: var(--dim); }
ul.feat { padding-left: 20px; color: var(--dim); font-size: 15px; margin: 12px 0; }
.card.current { border-color: var(--amber); }

.result { text-align: center; }
.ring { position: relative; width: 168px; height: 168px; margin: 8px auto 16px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--line); }
.ring .arc { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s ease; }
.ring.approved .arc { stroke: var(--green); }
.ring.denied .arc, .ring.expired .arc { stroke: var(--red); }
.ring .count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 36px; font-weight: 700; }
.ring.approved .count { color: var(--green); }
.ring.denied .count, .ring.expired .count { color: var(--red); }
.verdict { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.verdict.approved { color: var(--green); } .verdict.denied, .verdict.expired { color: var(--red); }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 440px; margin: 0 auto; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.err { border-color: var(--red); color: var(--red); }
.toast.on { opacity: 1; transform: none; }
main > section { animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .pulse, main > section, .sk, .spin { animation: none; }
  html { scroll-behavior: auto; }
  .ring .arc, .meter > span { transition: none; }
  .toast { transform: none; }
  .btn { transition: background-color .2s ease; }
  .btn:active { transform: none; }
}

.welcome { display: grid; gap: 24px; }
@media (min-width: 861px) { .welcome { grid-template-columns: minmax(0, 440px) 1fr; gap: 48px; align-items: start; } }
.about h2 { font-size: 22px; }
.foot { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; border-top: 1px solid var(--line); color: var(--dim); }
.foot a { color: var(--dim); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot span { margin-left: auto; }

#home { order: 1; }
@media (min-width: 761px) { #home { order: 0; margin-left: auto; } #signout { margin-left: 0; } }
