:root {
  color-scheme: dark;
  --bg: #090909;
  --surface: #111111;
  --surface-2: #151515;
  --surface-3: #1b1b1b;
  --line: rgba(212, 175, 55, .16);
  --line-strong: rgba(212, 175, 55, .42);
  --text: #f7f7f7;
  --muted: #bdbdbd;
  --gold: #d4af37;
  --gold-soft: #f2cf63;
  --blue: #4b9cff;
  --cyan: #39d5ff;
  --violet: #b39aff;
  --danger: #ff8f9a;
  --success: #7ce3b2;
  --radius: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .93) 0%, rgba(0, 0, 0, .72) 42%, rgba(0, 0, 0, .94) 100%),
    url("./images/aureus-background.png") center bottom / cover fixed no-repeat,
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; border-bottom: 1px solid rgba(212, 175, 55, .35); background: rgba(9, 9, 9, .92); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; letter-spacing: .08em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: linear-gradient(145deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .03)); box-shadow: 0 0 24px rgba(212, 175, 55, .08); }
.brand-mark img { width: 27px; height: 27px; }
.brand strong { display: block; font-size: 14px; color: var(--gold-soft); letter-spacing: .16em; }
.brand small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .19em; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button { border: 1px solid var(--line); color: var(--text); background: transparent; border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; font-size: 20px; transition: .2s ease; }
.icon-button:hover { border-color: var(--line-strong); color: var(--gold-soft); background: rgba(212, 175, 55, .08); }
.mobile-only { display: none; }
.status-pill, .mode-badge, .count-badge { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); color: var(--muted); padding: 7px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-ok { color: var(--success); border-color: rgba(124, 227, 178, .25); }
.status-ok .status-dot { background: var(--success); box-shadow: 0 0 12px rgba(124, 227, 178, .8); }
.status-error { color: var(--danger); border-color: rgba(255, 143, 154, .25); }
.status-error .status-dot { background: var(--danger); }
.status-loading .status-dot { animation: pulse 1.2s infinite; }
.mode-badge { color: var(--gold-soft); border-color: rgba(212, 175, 55, .38); background: rgba(212, 175, 55, .1); }
.install-button { padding: 8px 12px !important; }
.public-beta-banner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid rgba(212, 175, 55, .28); background: rgba(212, 175, 55, .08); color: var(--muted); font-size: 11px; text-align: center; }
.public-beta-banner strong { color: var(--gold-soft); letter-spacing: .08em; font-size: 10px; }

.app-layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { border-right: 1px solid rgba(212, 175, 55, .18); padding: 27px 15px 20px; display: flex; flex-direction: column; background: rgba(9, 9, 9, .82); }
.sidebar-label, .eyebrow, .stat-label { color: var(--muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-label { padding: 0 13px 13px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); text-align: left; transition: .2s ease; }
.nav-item span { width: 20px; text-align: center; color: #607089; font-size: 16px; }
.nav-item:hover, .nav-item.active { background: rgba(212, 175, 55, .1); color: var(--gold-soft); border-color: rgba(212, 175, 55, .28); }
.nav-item.active span { color: var(--gold); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin: auto 6px 0; padding: 13px 9px; border-top: 1px solid var(--line); color: var(--muted); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 11px; color: var(--gold-soft); }
.sidebar-footer small { font-size: 10px; margin-top: 4px; }
.mini-seal { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(230, 184, 92, .1); }
.mini-seal img { width: 20px; height: 20px; }

.content { width: 100%; max-width: 1500px; padding: 42px clamp(20px, 4vw, 62px) 70px; margin: 0 auto; }
.view { display: none; animation: reveal .25s ease; }
.view.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 29px; }
.hero-heading {
  align-items: center;
  position: relative;
  isolation: isolate;
  min-height: 236px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(212, 175, 55, .42);
  border-radius: 15px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .76) 44%, rgba(0, 0, 0, .32) 100%),
    url("./images/aureus-banner.png") center / cover no-repeat;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .34), inset 0 0 45px rgba(212, 175, 55, .06);
}
.hero-heading > div { position: relative; z-index: 1; }
.hero-heading h1 { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .72); }
.hero-heading .lead { color: #dedede; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(31px, 4vw, 54px); line-height: 1.04; letter-spacing: -.045em; margin: 10px 0 12px; }
h2 { font-size: 18px; letter-spacing: -.02em; margin: 7px 0 0; }
.lead { color: var(--muted); max-width: 690px; line-height: 1.65; margin-bottom: 0; }
.heading-controls { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; justify-content: flex-end; }
.select-label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.select-control { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 31px 10px 11px; outline: none; min-width: 125px; }
.select-control:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .14); }
.button { border: 1px solid transparent; border-radius: 10px; padding: 11px 15px; font-weight: 700; font-size: 12px; letter-spacing: .02em; transition: .2s ease; }
.button-primary { background: linear-gradient(135deg, var(--gold), #b8861b); color: #0b0b0b; box-shadow: 0 10px 25px rgba(212, 175, 55, .16); }
.button-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.button-ghost:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-strong); }
.text-button { border: 0; background: transparent; color: var(--gold-soft); font-size: 11px; padding: 3px 0; }
.text-button:hover { color: white; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.stat-card { min-height: 135px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -55px; bottom: -70px; border-radius: 50%; background: currentColor; opacity: .06; }
.stat-card strong { display: block; margin: 17px 0 7px; font-size: 32px; letter-spacing: -.05em; }
.stat-card small { color: var(--muted); font-size: 11px; }
.accent-gold { color: var(--gold); border-top: 2px solid var(--gold); }
.accent-blue { color: var(--blue); border-top: 2px solid var(--blue); }
.accent-cyan { color: var(--cyan); border-top: 2px solid var(--cyan); }
.accent-violet { color: var(--violet); border-top: 2px solid var(--violet); }
.accent-gold strong, .accent-blue strong, .accent-cyan strong, .accent-violet strong { color: var(--text); }

.content-grid { display: grid; gap: 17px; margin-bottom: 17px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wallet-layout { grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); }
.panel { border: 1px solid rgba(212, 175, 55, .2); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20, 20, 20, .94), rgba(7, 7, 7, .92)); padding: 22px; min-width: 0; box-shadow: 0 14px 35px rgba(0, 0, 0, .18); }
.panel-featured { min-height: 290px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.empty-state { color: var(--muted); min-height: 110px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line); border-radius: 12px; padding: 20px; line-height: 1.55; font-size: 12px; }
.wallet-preview { min-height: 193px; }
.wallet-preview:not(.empty-state) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; padding: 0; text-align: left; }
.wallet-tile, .alert-item, .integration-item, .report-item, .ecosystem-item { border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.wallet-tile { padding: 15px; cursor: pointer; transition: .2s ease; }
.wallet-tile:hover { border-color: var(--line-strong); background: rgba(212,175,55,.08); }
.wallet-tile strong, .wallet-tile small { display: block; }
.wallet-tile strong { color: var(--gold-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-tile small { color: var(--muted); margin-top: 7px; font-size: 11px; }
.alert-list { min-height: 193px; display: grid; align-content: start; gap: 8px; border: 0; padding: 0; text-align: left; }
.alert-item { padding: 12px 14px; }
.alert-item strong { display: block; font-size: 11px; color: var(--gold-soft); }
.alert-item small { color: var(--muted); font-size: 10px; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.integration-item { padding: 13px; }
.integration-item strong, .integration-item small { display: block; }
.integration-item strong { font-size: 11px; }
.integration-item small { color: var(--muted); font-size: 10px; margin-top: 5px; }
.integration-state { color: var(--success); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.integration-state.off { color: var(--muted); }
.compact-status-list { display: grid; gap: 10px; }
.compact-status-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.compact-status-row:last-child { border-bottom: 0; padding-bottom: 0; }
.compact-status-row strong { font-size: 12px; }
.compact-status-row span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }

.wallet-list { display: grid; align-content: start; gap: 8px; min-height: 340px; border: 0; padding: 0; text-align: left; }
.wallet-row { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); cursor: pointer; }
.wallet-row:hover, .wallet-row.selected { border-color: var(--line-strong); background: rgba(212,175,55,.08); }
.wallet-row strong, .wallet-row small { display: block; }
.wallet-row strong { color: var(--text); font-size: 12px; }
.wallet-row small { color: var(--muted); font-size: 10px; margin-top: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wallet-row .delete-wallet { color: var(--muted); border: 0; background: transparent; font-size: 17px; padding: 4px; }
.wallet-row .delete-wallet:hover { color: var(--danger); }
.wallet-detail-panel { min-height: 420px; }
.wallet-detail { min-height: 325px; border: 0; padding: 0; text-align: left; display: block; }
.detail-stack { display: grid; gap: 12px; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); font-size: 11px; }
.detail-row strong { font-size: 12px; text-align: right; }
.data-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.data-tab { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 7px 10px; font-size: 10px; }
.data-tab.active { color: var(--gold-soft); border-color: var(--line-strong); background: rgba(212,175,55,.1); }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { color: var(--muted); text-align: left; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; padding: 9px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); color: var(--text); }
.data-table td.muted-cell { color: var(--muted); }

.capability-list { display: grid; gap: 10px; }
.capability-list > div { display: grid; grid-template-columns: 26px 1fr; gap: 2px 9px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.capability-list span { grid-row: span 2; color: var(--cyan); font-size: 17px; }
.capability-list strong { font-size: 12px; }
.capability-list small { color: var(--muted); font-size: 10px; }
.boundary-grid { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 13px; align-items: center; }
.boundary-grid > div:not(.boundary-arrow) { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.boundary-grid strong, .boundary-grid span, .boundary-grid small { display: block; }
.boundary-grid strong { color: var(--gold-soft); font-size: 12px; }
.boundary-grid span { color: var(--cyan); font-size: 10px; margin-top: 6px; text-transform: uppercase; letter-spacing: .07em; }
.boundary-grid small { color: var(--muted); line-height: 1.45; font-size: 10px; margin-top: 7px; }
.boundary-arrow { color: var(--gold); font-size: 23px; }

.report-list, .ecosystem-list { display: grid; gap: 10px; border: 0; padding: 0; text-align: left; }
.report-item { display: grid; grid-template-columns: minmax(0, 1.3fr) auto auto; gap: 15px; align-items: center; padding: 16px; }
.report-item { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); color: var(--text); text-align: left; cursor: pointer; }
.report-item:hover { border-color: var(--line-strong); background: rgba(212,175,55,.08); }
.report-item strong, .report-item small { display: block; }
.report-item strong { font-size: 13px; }
.report-item small { color: var(--muted); font-size: 10px; margin-top: 6px; }
.report-status { color: var(--success); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.report-status.pending { color: var(--gold); }
.ecosystem-item { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.5fr) auto; gap: 16px; align-items: center; padding: 15px; }
.ecosystem-item strong { font-size: 12px; }
.ecosystem-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.ecosystem-item .boundary-label { color: var(--muted); font-size: 10px; text-align: right; }
.configured { color: var(--success) !important; }
.not-configured { color: var(--muted) !important; }
.governance-card { min-height: 235px; }
.proposal-card { display: grid; gap: 13px; }
.proposal-card h2 { color: var(--gold-soft); }
.vote-bar { height: 9px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.vote-bar span { display: block; width: 50%; height: 100%; background: linear-gradient(90deg, var(--gold), var(--cyan)); }
.vote-counts { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.news-card { border: 1px solid rgba(212,175,55,.24); border-radius: var(--radius); padding: 23px; background: linear-gradient(145deg, rgba(212,175,55,.1), rgba(0,0,0,.45)); min-height: 190px; }
.news-tag { color: var(--gold); font-size: 10px; letter-spacing: .14em; }
.news-card h2 { margin: 18px 0 10px; }
.news-card p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.news-card small { color: #67758a; font-size: 10px; }
.chat-panel { max-width: 880px; min-height: 500px; display: flex; flex-direction: column; }
.chat-messages { flex: 1; display: grid; align-content: start; gap: 13px; padding-bottom: 20px; }
.chat-message { display: flex; gap: 10px; max-width: 80%; }
.chat-message.user { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.chat-avatar { flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: rgba(230,184,92,.16); color: var(--gold-soft); font-weight: 700; font-size: 12px; }
.chat-message.user .chat-avatar { background: rgba(120,169,255,.17); color: var(--blue); }
.chat-message strong { font-size: 11px; color: var(--gold-soft); }
.chat-message p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.chat-form { display: flex; gap: 9px; border-top: 1px solid var(--line); padding-top: 17px; }
input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); padding: 12px; outline: none; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; margin-bottom: 15px; }
.muted { color: #68758a; font-size: 10px; }
.modal { width: min(440px, calc(100vw - 30px)); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 17px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.modal::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
.modal-header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 23px; }
.modal-header h2 { margin-top: 7px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(370px, calc(100vw - 44px)); padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #151c28; color: var(--text); font-size: 12px; box-shadow: 0 15px 35px rgba(0,0,0,.32); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .25s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,143,154,.45); color: #ffd6da; }

@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (max-width: 1050px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .boundary-grid { grid-template-columns: 1fr; } .boundary-arrow { transform: rotate(90deg); justify-self: center; } }
@media (max-width: 800px) { .topbar { height: 67px; padding: 0 16px; } .mobile-only { display: grid; } .app-layout { display: block; min-height: calc(100vh - 67px); } .sidebar { position: fixed; top: 67px; left: 0; bottom: 0; width: 270px; z-index: 15; transform: translateX(-105%); transition: .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.35); } .sidebar.open { transform: translateX(0); } .content { padding: 30px 16px 60px; } .page-heading, .hero-heading { align-items: flex-start; flex-direction: column; } .heading-controls { justify-content: flex-start; } .two-columns, .wallet-layout { grid-template-columns: 1fr; } .topbar .status-pill { display: none; } .report-item, .ecosystem-item { grid-template-columns: 1fr; gap: 8px; } .ecosystem-item .boundary-label { text-align: left; } }
@media (max-width: 480px) { .brand small { display: none; } .brand-mark { width: 34px; height: 34px; } .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; } .stat-card { min-height: 118px; padding: 14px; } .stat-card strong { font-size: 25px; margin-top: 14px; } .stat-card small { font-size: 9px; } .panel { padding: 16px; } .wallet-preview:not(.empty-state), .integration-grid { grid-template-columns: 1fr; } .chat-form { flex-direction: column; } }

.stack-form { display: grid; gap: 2px; }
.stack-form label { margin-bottom: 10px; }
.stack-form textarea { min-height: 112px; resize: vertical; }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 2px; }
.check-row input { width: auto; }
.citizen-list, .checkpoint-list { display: grid; gap: 10px; }
.citizen-item, .checkpoint-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.citizen-item strong, .citizen-item small, .checkpoint-item strong, .checkpoint-item small { display: block; }
.citizen-item small, .checkpoint-item small { color: var(--muted); font-size: 10px; margin-top: 5px; }
.ai-response { min-height: 130px; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 15px; line-height: 1.55; }
.ai-response:not(.empty-state) { color: var(--text); }
.result-box { min-height: 16px; margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.result-box.ok { color: var(--success); }
.result-box.error { color: var(--danger); }
.price-badge { color: var(--gold-soft); border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 14px; font-size: 12px; white-space: nowrap; }

/* AUREUS_OFFICIAL_HEADER_LOGO */
img[src$="aureus-republic-header-logo.jpg"] {
    width: 150px;
    height: 58px;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    display: block;
}
