:root {
  --bg: #030912;
  --panel: #071628;
  --panel2: #0b213c;
  --line: rgba(168, 199, 229, .16);
  --text: #f8fbff;
  --muted: #9db0c4;
  --cyan: #67b7ff;
  --blue: #1878d1;
  --gold: #f5c76b;
  --green: #56d79a;
}

body {
  background: #030912;
  overflow-x: hidden;
}

.ambient {
  background:
    radial-gradient(circle at 76% 12%, rgba(23, 104, 179, .24), transparent 30%),
    radial-gradient(circle at 8% 72%, rgba(8, 55, 98, .2), transparent 28%),
    linear-gradient(rgba(160, 201, 239, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 201, 239, .022) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
}

.site-header {
  min-height: 84px;
  padding: 0 max(24px, 4.5vw);
  border-bottom-color: rgba(168, 199, 229, .12);
  background: rgba(3, 9, 18, .88);
}

.brand { min-width: 252px; gap: 13px; }
.brand img { width: 50px; height: 50px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; object-fit: cover; }
.brand strong { font-size: 13px; letter-spacing: .2em; }
.brand small { color: #7fa7ca; font-size: 9px; letter-spacing: .34em; }
.site-header nav { justify-content: center; }
.site-header nav a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; }
.site-header nav a:hover, .site-header nav a.active { background: rgba(103, 183, 255, .1); color: #fff; }
.site-header nav a.active { box-shadow: inset 0 0 0 1px rgba(103, 183, 255, .15); }
.nav-toggle { display: none; }
.account-button { white-space: nowrap; }

.hero-wrap { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-wrap::before { content: ""; position: absolute; width: 640px; height: 640px; right: -120px; top: -150px; border: 1px solid rgba(103, 183, 255, .12); border-radius: 50%; box-shadow: 0 0 0 80px rgba(103, 183, 255, .018), 0 0 0 160px rgba(103, 183, 255, .012); }
.hero { min-height: min(760px, calc(100vh - 84px)); grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: clamp(38px, 7vw, 110px); padding-top: 50px; padding-bottom: 62px; }
.city-badge { display: inline-flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 13px; border: 1px solid rgba(103, 183, 255, .22); border-radius: 999px; background: rgba(8, 38, 67, .65); color: #cce7ff; font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.city-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 13px var(--green); }
.hero h1 { margin-top: 24px; font-size: clamp(58px, 7.7vw, 112px); line-height: .91; letter-spacing: -.072em; }
.hero h1 em { display: inline; color: #6dbbff; -webkit-text-stroke: 0; }
.hero .lead { max-width: 720px; margin-top: 26px; color: #b0c0d0; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.72; }
.hero .button-row { margin-top: 32px; }
.hero .button { gap: 24px; }
.hero-facts { display: flex; gap: clamp(22px, 4vw, 58px); margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts span, .hero-facts strong, .hero-facts small { display: block; }
.hero-facts strong { font-size: 17px; letter-spacing: .04em; }
.hero-facts small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.hero-emblem { position: relative; display: grid; justify-items: center; gap: 22px; }
.emblem-ring { width: min(35vw, 410px); aspect-ratio: 1; padding: 12px; border: 1px solid rgba(103, 183, 255, .28); border-radius: 50%; background: rgba(8, 25, 44, .52); box-shadow: 0 36px 100px rgba(0, 0, 0, .42), 0 0 80px rgba(17, 96, 166, .18); }
.emblem-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-emblem .status { padding: 11px 15px; border: 1px solid rgba(86, 215, 154, .2); border-radius: 999px; background: rgba(6, 25, 37, .78); }
.intro-section { padding-top: 96px; }
.intro-section .section-head h2 { max-width: 680px; }
.feature-card { position: relative; min-height: 280px; padding: 30px; overflow: hidden; }
.feature-card::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg, var(--blue), transparent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.feature-card:hover::after { transform: scaleX(1); }
.feature-number { display: block; margin-bottom: 48px; color: rgba(126, 184, 235, .45); font: 800 12px ui-monospace, monospace; }
.feature-card h2 { max-width: 290px; font-size: 25px; line-height: 1.14; }
.footer-brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.footer-brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.footer-brand strong, .footer-brand small { display: block; }
.footer-brand small { margin-top: 3px; color: var(--muted); }

@media (max-width: 950px) {
  .site-header { flex-wrap: nowrap; min-height: 74px; padding: 10px 4vw; }
  .brand { min-width: 0; margin-right: auto; }
  .brand img { width: 46px; height: 46px; }
  .nav-toggle { display: grid; width: 44px; height: 44px; place-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; }
  .nav-toggle span { width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-header nav { position: absolute; left: 4vw; right: 4vw; top: calc(100% + 8px); display: none; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(5, 16, 29, .98); box-shadow: 0 25px 70px rgba(0, 0, 0, .5); }
  .nav-open .site-header nav { display: grid; }
  .site-header nav a { justify-content: flex-start; min-height: 48px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 70px; }
  .hero-copy { text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero .button-row, .hero-facts { justify-content: center; }
  .hero-emblem { grid-row: 1; }
  .emblem-ring { width: min(56vw, 330px); }
}

@media (max-width: 620px) {
  .brand span { display: block !important; }
  .brand strong { font-size: 10px; }
  .brand small { font-size: 7px; }
  .account-button { display: none; }
  .hero { width: min(90vw, 1240px); padding-top: 38px; padding-bottom: 48px; gap: 34px; }
  .hero h1 { margin-top: 20px; font-size: clamp(48px, 15vw, 68px); }
  .hero .lead { font-size: 15px; }
  .hero .button-row { display: grid; }
  .hero .button { width: 100%; }
  .hero-facts { gap: 18px; justify-content: space-between; }
  .hero-facts strong { font-size: 15px; }
  .hero-facts small { font-size: 9px; }
  .emblem-ring { width: min(70vw, 280px); }
  .intro-section { padding-top: 64px; }
  .feature-card { min-height: 230px; }
  footer { align-items: flex-start; }
}

/* Complete portal design system */
::selection { background: rgba(103, 183, 255, .32); color: #fff; }
:focus-visible { outline: 3px solid rgba(103, 183, 255, .62); outline-offset: 3px; }
body { font-size: 15px; line-height: 1.55; }
main { min-height: calc(100vh - 168px); }
.page { width: min(1180px, calc(100% - 48px)); padding: 76px 0 96px; }
.page.hero { padding-top: 50px; padding-bottom: 62px; }
.eyebrow { margin-bottom: 14px; color: #6dbbff; font-size: 10px; letter-spacing: .18em; }
.muted { color: #9db0c4; line-height: 1.68; }

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(103, 183, 255, .36);
  border-radius: 12px;
  background: linear-gradient(135deg, #197ed9, #0e5ca5);
  box-shadow: 0 10px 28px rgba(11, 77, 136, .22), inset 0 1px rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 13px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.button:hover { border-color: #8dcbff; transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button.secondary { border-color: var(--line); background: rgba(11, 33, 60, .72); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.button.danger { border-color: rgba(255, 101, 120, .44); background: linear-gradient(135deg, rgba(189, 49, 70, .92), rgba(117, 26, 42, .95)); }
.button.compact { min-height: 42px; padding: 0 15px; }
.button:disabled { opacity: .46; cursor: not-allowed; transform: none; }

.section-head { align-items: flex-end; margin-bottom: 36px; }
.section-head h1, .section-head h2 { max-width: 760px; color: #fff; font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.057em; }
.section-head > p { margin: 0; color: #9db0c4; }
.grid { gap: 18px; }
.card, .status-card {
  border-color: rgba(168, 199, 229, .16);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(11, 33, 60, .9), rgba(5, 18, 33, .96));
  box-shadow: 0 24px 65px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .045);
}
.card { padding: 24px; }
.card h2 { color: #f7fbff; line-height: 1.18; }
.card h3 { color: #f7fbff; font-size: 18px; }
button.card { width: 100%; color: var(--text); text-align: left; cursor: pointer; transition: border-color .2s, transform .2s; }
button.card:hover { border-color: rgba(103, 183, 255, .42); transform: translateY(-2px); }

.rule { grid-template-columns: 94px minmax(0, 1fr); gap: 24px; padding: 28px; }
.rule-code { align-self: start; padding: 8px 10px; border: 1px solid rgba(103, 183, 255, .2); border-radius: 10px; background: rgba(103, 183, 255, .07); color: #7ec3ff; font-size: 15px; text-align: center; }
.rule h2 { margin-bottom: 10px; font-size: clamp(20px, 2.2vw, 27px); }
.rule p:last-child { margin-bottom: 0; }

.pill { min-height: 27px; padding: 0 10px; border-color: rgba(168, 199, 229, .19); background: rgba(130, 176, 217, .05); }
.pill.open, .pill.approved, .pill.accepted { background: rgba(86, 215, 154, .07); }
.pill.closed, .pill.rejected, .pill.ban { background: rgba(255, 101, 120, .07); }
.pill.pending, .pill.urgent, .pill.submitted, .pill.scheduled { color: var(--gold); border-color: rgba(245, 199, 107, .28); background: rgba(245, 199, 107, .07); }

.portal-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 24px; width: min(1320px, calc(100% - 48px)); }
.sidebar { top: 108px; gap: 6px; padding: 14px; border-radius: 18px; }
.sidebar button { min-height: 46px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.sidebar button:hover, .sidebar button.active { border-color: rgba(103, 183, 255, .18); background: rgba(103, 183, 255, .09); color: #fff; }
.sidebar button.active { box-shadow: inset 3px 0 #67b7ff; }
.profile { min-width: 0; padding: 5px 4px 18px; }
.profile span { min-width: 0; }
.profile strong, .profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { display: block; color: var(--muted); }
.avatar { border: 2px solid rgba(103, 183, 255, .3); }

.row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 13px 15px; border-color: rgba(168, 199, 229, .13); border-radius: 12px; background: rgba(2, 11, 20, .38); }
.row > :first-child { min-width: 0; flex: 1; }
.row strong, .row small { overflow-wrap: anywhere; }
.money { color: #f7fbff; font-size: clamp(24px, 3vw, 34px); }

.field { gap: 8px; }
.field label { color: #a9bed1; }
.field input, .field select, .field textarea, .toolbar input {
  min-height: 48px;
  border-color: rgba(168, 199, 229, .18);
  border-radius: 11px;
  background: rgba(2, 10, 19, .82);
  color: #fff;
}
.field textarea { min-height: 126px; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus { border-color: #67b7ff; box-shadow: 0 0 0 4px rgba(103, 183, 255, .1); }
label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; min-height: 38px; color: #b4c6d7; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: #258ce4; }
.toolbar { position: sticky; top: 96px; z-index: 5; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(5, 18, 33, .9); backdrop-filter: blur(16px); }

.connect { max-width: 760px; margin: 70px auto; padding: 44px; }
.connect.card { text-align: center; }
.command { max-width: 100%; overflow-wrap: anywhere; border-color: rgba(103, 183, 255, .28); background: #020912; color: #82c7ff; }
.radio-feed { height: min(520px, 60vh); }
.radio-item { border-left-color: #67b7ff; border-radius: 0 10px 10px 0; background: rgba(2, 11, 20, .55); }
.radio-item p { margin-bottom: 0; overflow-wrap: anywhere; }

.dossier-head { grid-template-columns: minmax(250px, 1fr) repeat(3, minmax(145px, 180px)); }
.timeline > div { padding-left: 24px; }
.timeline > div::before { left: -5px; width: 9px; height: 9px; background: #67b7ff; box-shadow: 0 0 0 4px rgba(103,183,255,.08); }
.empty { padding: 32px 20px; border-color: rgba(168, 199, 229, .18); border-radius: 14px; background: rgba(2, 11, 20, .24); }

.audit-card { overflow: hidden; }
.audit-event { border-color: rgba(168, 199, 229, .14); border-radius: 12px; background: rgba(2, 11, 20, .42); }
.audit-event summary { min-height: 64px; align-items: center; padding: 15px 17px; }
.audit-event[open] { border-color: rgba(103, 183, 255, .25); }
.audit-data pre { border-color: rgba(168, 199, 229, .14); background: #020912; color: #c0d0df; }

dialog { max-height: min(86vh, 850px); overflow: auto; border-color: rgba(168, 199, 229, .2); border-radius: 22px; padding: 32px; background: #07182b; }
.modal-close { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(2,10,19,.55); color: #fff; line-height: 1; }
.toasts { top: 100px; }
.toast { border-color: rgba(168, 199, 229, .2); border-left-color: #67b7ff; background: #07182b; }

footer { min-height: 104px; align-items: center; padding: 24px max(24px, 4.5vw); border-top-color: rgba(168, 199, 229, .12); background: #02070d; }

@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dossier-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 950px) {
  .portal-layout { grid-template-columns: 1fr; width: min(100% - 32px, 1180px); padding-top: 28px; }
  .sidebar { position: static; display: flex; grid-template-columns: none; align-items: center; overflow-x: auto; padding: 10px; scrollbar-width: thin; }
  .sidebar .profile { min-width: 210px; margin: 0 4px 0 0; padding: 0 16px 0 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .sidebar button { flex: 0 0 auto; white-space: nowrap; }
  .sidebar button.active { box-shadow: inset 0 -3px #67b7ff; }
  .toolbar { top: 82px; }
  .section-head { align-items: flex-start; }
}

@media (max-width: 700px) {
  .page { width: min(100% - 32px, 1180px); padding: 50px 0 68px; }
  .page.hero { padding-top: 38px; padding-bottom: 48px; }
  .section-head { display: grid; gap: 16px; margin-bottom: 26px; }
  .section-head h1, .section-head h2 { font-size: clamp(36px, 11vw, 50px); }
  .grid.two, .grid.three, .grid.four, .form-grid, .dossier-head { grid-template-columns: 1fr; }
  .card { padding: 20px; border-radius: 17px; }
  .rule { grid-template-columns: 1fr; gap: 15px; }
  .rule-code { width: fit-content; }
  .portal-layout { width: 100%; padding: 18px 16px 64px; }
  .sidebar .profile { display: none; }
  .row { align-items: flex-start; flex-wrap: wrap; }
  .row > :first-child { flex-basis: calc(100% - 90px); }
  .row > .button { width: 100%; }
  .toolbar { position: static; display: grid; grid-template-columns: 1fr; }
  .toolbar .button { width: 100%; }
  .connect { margin: 20px auto; padding: 28px 20px; }
  .audit-header, .audit-event summary { align-items: flex-start; }
  .audit-event summary { display: grid; }
  dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); padding: 24px 18px; border-radius: 18px; }
  .toasts { left: 12px; right: 12px; top: 84px; width: auto; }
  footer { display: grid; gap: 18px; min-height: 130px; }
}

@media (max-width: 620px) {
  .account-button { display: inline-flex; min-height: 42px; max-width: 82px; overflow: hidden; padding: 0 12px; text-overflow: ellipsis; font-size: 11px; }
  .site-header { gap: 8px; }
  .brand img { width: 42px; height: 42px; }
  .brand strong { letter-spacing: .13em; }
  .brand small { letter-spacing: .2em; }
  .nav-toggle { width: 42px; height: 42px; }
  .city-badge { font-size: 8px; }
  .hero-facts { width: 100%; }
}

@media (max-width: 390px) {
  .brand span { display: none !important; }
  .hero h1 { font-size: 47px; }
  .hero-facts { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
