
:root {
  color-scheme: dark;
  --bg: #07100e;
  --surface: #101a18;
  --surface-2: #17231f;
  --line: #314640;
  --text: #eff8f3;
  --muted: #9bb1aa;
  --gold: #e6bf66;
  --cyan: #7bd6d2;
  --green: #8be28f;
  --red: #ff8d86;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Arial, Helvetica, sans-serif; }
button, input, textarea, select { font: inherit; }
button { border: 1px solid var(--gold); background: #2c2616; color: var(--text); padding: 8px 12px; border-radius: 6px; cursor: pointer; }
button:hover { background: #3a311c; }
input, textarea, select { width: 100%; min-height: 38px; border: 1px solid var(--line); background: #08100e; color: var(--text); padding: 8px 10px; border-radius: 6px; }
textarea { min-height: 150px; resize: vertical; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 9px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
small { display: block; color: var(--muted); margin-top: 3px; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(320px, .9fr); align-items: stretch; position: relative; }
.intro { display: flex; flex-direction: column; justify-content: center; padding: 8vw; background: linear-gradient(rgba(7,16,14,.25), rgba(7,16,14,.88)), url("https://images.unsplash.com/photo-1446776811953-b23d57bd21aa?auto=format&fit=crop&w=1800&q=80") center/cover; }
.intro h1 { font-size: clamp(44px, 7vw, 92px); line-height: .92; margin: 18px 0; max-width: 760px; }
.intro p { max-width: 780px; color: #d8e7e1; font-size: 17px; }
.currency-note { border-left: 3px solid var(--gold); padding-left: 12px; }
.brand { color: var(--gold); letter-spacing: 0; font-weight: 800; font-size: 13px; }
.login-version { position: fixed; left: 18px; bottom: 14px; z-index: 3; color: rgba(216, 231, 225, .68); font-size: 12px; font-weight: 700; text-transform: uppercase; background: rgba(5, 12, 10, .62); border: 1px solid rgba(123, 214, 210, .22); border-radius: 8px; padding: 6px 9px; }
.auth-grid { display: grid; align-content: center; gap: 16px; padding: 5vw; background: #0b1311; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 20px; }
.panel label { display: block; color: var(--muted); margin: 12px 0; }
.login-briefing { padding: 0 2px 8px; max-width: 760px; }
.login-briefing h2 { margin: 0 0 10px; color: var(--gold); font-size: 14px; text-transform: uppercase; letter-spacing: 0; }
.login-briefing p { margin: 0; color: #dbe7e1; line-height: 1.65; font-size: 15px; }
.app-shell { min-height: 100vh; padding: 18px; position: relative; overflow: hidden; }
.app-shell::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(circle at 18% 22%, rgba(123,214,210,.13), transparent 23%), radial-gradient(circle at 80% 14%, rgba(230,191,102,.12), transparent 20%), linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: auto, auto, 100% 42px; opacity: .85; animation: drift-stars 18s linear infinite; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; align-items: center; gap: 18px; margin-bottom: 14px; position: relative; z-index: 1; }
.topbar h1 { margin: 4px 0 0; font-size: 28px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { display: grid; gap: 8px; justify-items: end; }
.server-clock { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; text-align: right; }
.server-clock strong { display: block; color: var(--gold); font-size: 15px; margin-top: 2px; }
.topbar nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { border: 1px solid var(--line); padding: 8px 10px; border-radius: 6px; background: var(--surface); }
.notice { border: 1px solid var(--gold); background: #251f12; padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; }
.office-tabs { display: flex; gap: 6px; align-items: end; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 14px; position: relative; z-index: 1; }
.office-tabs a { color: var(--text); border: 1px solid var(--line); border-bottom: 0; background: #0b1311; padding: 10px 14px; border-radius: 8px 8px 0 0; min-width: max-content; }
.office-tabs a.active { color: #fff; border-color: var(--gold); background: linear-gradient(180deg, #243528, var(--surface)); position: relative; top: 1px; }
.tab-stage { position: relative; z-index: 1; }
.office-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; align-items: start; }
.overview-main, .overview-side { display: grid; gap: 14px; align-content: start; }
.inventory-detail-panel { overflow-x: auto; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metrics div { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 14px; }
.metrics span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metrics strong { display: block; margin-top: 3px; font-size: 26px; }
.metrics.compact { margin-bottom: 0; }
.financial-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; align-items: start; }
.primary { display: grid; gap: 14px; }
.side { display: grid; gap: 14px; }
.market-panel { overflow-x: auto; }
.market-stack { display: grid; gap: 14px; }
.market-title { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.stock-workspace { position: relative; display: grid; gap: 14px; min-height: 560px; }
.ticker-button { display: grid; justify-items: start; gap: 2px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.ticker-button strong { color: var(--text); font-size: 16px; }
.ticker-button small { color: var(--muted); margin: 0; }
.ticker-button:hover strong { color: var(--gold); }
.stock-popout { position: absolute; top: 86px; right: 18px; z-index: 8; width: min(720px, calc(100vw - 64px)); max-height: min(72vh, 760px); overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.stock-popout[hidden] { display: none; }
.stock-detail-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0; }
.stock-detail-order { display: grid; grid-template-columns: minmax(140px, 1fr) 80px 80px; gap: 8px; }
.wallet-strip { display: inline-grid; grid-template-columns: auto auto; gap: 2px 9px; align-items: baseline; border: 1px solid var(--line); border-radius: 8px; background: #0b1311; padding: 8px 10px; margin-top: 10px; }
.wallet-strip span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.wallet-strip strong { color: var(--gold); font-size: 18px; }
.wallet-strip em { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-style: normal; }
.commodity-workspace { position: relative; display: grid; gap: 14px; min-height: 620px; }
.commodity-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.tool-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 430px; }
.tool-pills button { border-radius: 999px; padding: 7px 11px; background: #0b1311; border-color: var(--line); white-space: nowrap; }
.tool-pills button:hover { border-color: var(--gold); background: #1b2117; }
.map-workspace { position: relative; display: grid; gap: 14px; }
.map-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 12px; }
.map-head h2 { margin: 0; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.map-legend span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); background: #0b1311; }
.map-legend .office { border-color: var(--gold); color: var(--gold); }
.map-legend .busy { border-color: var(--cyan); color: var(--cyan); }
.stellar-map { position: relative; min-height: 560px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: radial-gradient(circle at 48% 54%, rgba(123,214,210,.14), transparent 16%), radial-gradient(circle at 24% 24%, rgba(230,191,102,.10), transparent 10%), radial-gradient(circle at 82% 72%, rgba(116,232,139,.08), transparent 12%), #050b0a; }
.stellar-map::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#dbe7e1 1px, transparent 1px), radial-gradient(rgba(123,214,210,.75) 1px, transparent 1px); background-size: 53px 53px, 97px 97px; background-position: 0 0, 21px 31px; opacity: .28; animation: drift-stars 22s linear infinite; }
.stellar-map svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.map-route { stroke: rgba(123,214,210,.34); stroke-width: .35; vector-effect: non-scaling-stroke; }
.map-route.active { stroke: var(--gold); stroke-width: .7; stroke-dasharray: 4 4; animation: map-route-pulse 2.2s linear infinite; filter: drop-shadow(0 0 5px rgba(230,191,102,.7)); }
.map-node { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: grid; place-items: center; gap: 4px; min-width: 122px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: center; }
.map-node span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--cyan); background: radial-gradient(circle at 34% 28%, #d9fff5, var(--cyan) 34%, #1d3a35 70%); box-shadow: 0 0 22px rgba(123,214,210,.35); }
.map-node strong { font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; }
.map-node em { font-size: 11px; color: var(--muted); font-style: normal; text-shadow: 0 1px 4px #000; }
.map-node.office span { border-color: var(--gold); box-shadow: 0 0 28px rgba(230,191,102,.55); }
.map-node.office strong { color: var(--gold); }
.map-node.busy span::after { content: ""; position: absolute; width: 46px; height: 46px; border: 1px solid rgba(230,191,102,.55); border-radius: 50%; margin: -10px 0 0 -10px; animation: map-ping 1.8s ease-out infinite; }
.map-node:hover span { transform: scale(1.12); }
.map-traffic { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.map-traffic li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #0b1311; padding: 10px 12px; color: #dbe7e1; }
.map-traffic strong { color: var(--gold); }
.map-traffic span { color: var(--muted); }
.map-popout { position: absolute; top: 92px; right: 18px; z-index: 10; width: min(780px, calc(100vw - 64px)); max-height: min(78vh, 860px); overflow: auto; box-shadow: 0 18px 60px rgba(0,0,0,.52); }
.map-popout[hidden] { display: none; }
.map-popout .popout-head { cursor: move; }
.map-popout.dragging { user-select: none; opacity: .96; }
.map-popout .dialog-actions { margin: 12px 0; justify-content: flex-start; }
.map-popout .dialog-actions a { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #0b1311; color: var(--cyan); }
.commodity-popout { position: absolute; top: 96px; right: 18px; z-index: 8; width: min(520px, calc(100vw - 64px)); max-height: min(70vh, 760px); overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.commodity-popout.wide { width: min(980px, calc(100vw - 64px)); }
.commodity-popout[hidden] { display: none; }
.popout-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.popout-head h2 { margin: 0; }
.popout-head button { padding: 6px 10px; border-color: var(--line); background: #0b1311; }
.order { display: grid; grid-template-columns: 80px 58px 58px; gap: 6px; min-width: 214px; }
.shipping-form { display: grid; grid-template-columns: minmax(160px, 1fr) 120px minmax(160px, 1fr) auto; gap: 8px; align-items: start; }
.facility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.facility-grid article { border: 1px solid var(--line); background: #0b1311; border-radius: 8px; padding: 14px; }
.facility-grid h3 { margin: 0 0 8px; font-size: 18px; }
.facility-grid h3 span { float: right; color: var(--gold); font-size: 13px; font-weight: 600; }
.facility-grid p { color: #dbe7e1; min-height: 62px; }
.facility-grid dl { display: grid; grid-template-columns: 70px 1fr; gap: 5px 10px; }
.facility-grid dt { color: var(--muted); }
.facility-grid dd { margin: 0; }
.produce-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; border: 1px solid var(--line); background: #0b1311; border-radius: 8px; padding: 12px; }
.produce-bar form { margin: 0; }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bank-grid article { border: 1px solid var(--line); background: #0b1311; border-radius: 8px; padding: 14px; display: grid; gap: 8px; }
.bank-grid h3 { margin: 0; color: var(--cyan); }
.bank-grid strong { color: var(--gold); }
.bank-form { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; gap: 8px; align-items: start; }
.company-console .panel { overflow: visible; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.company-card { border: 1px solid var(--line); background: #0b1311; border-radius: 8px; padding: 14px; display: grid; gap: 9px; align-content: start; }
.company-card.active { border-color: var(--gold); background: linear-gradient(135deg, rgba(237, 196, 93, 0.11), rgba(10, 21, 18, 0.96)); }
.company-card h3 { margin: 0; color: var(--cyan); font-size: 17px; display: flex; justify-content: space-between; gap: 10px; }
.company-card h3 span { color: var(--gold); font-size: 13px; }
.company-card p { margin: 0; color: #dbe7e1; min-height: 44px; }
.company-card dl { display: grid; grid-template-columns: 96px 1fr; gap: 5px 10px; margin: 0; }
.company-card dt { color: var(--muted); }
.company-card dd { margin: 0; }
.company-card strong { color: var(--gold); }
.company-card form { align-self: end; }
.company-card button { width: 100%; }
.ai-workspace { display: grid; gap: 14px; }
.ai-console { display: grid; gap: 10px; max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #0b1311; padding: 12px; }
.ai-line { border-left: 3px solid var(--line); padding: 8px 10px; background: rgba(123,214,210,.05); }
.ai-line.assistant { border-left-color: var(--cyan); }
.ai-line.user { border-left-color: var(--gold); }
.ai-line strong { color: var(--gold); display: block; margin-bottom: 4px; }
.ai-line.assistant strong { color: var(--cyan); }
.ai-line p { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.ai-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 12px; align-items: start; }
.ai-form textarea { min-height: 82px; }
.ai-thinking-status { margin-top: 8px; color: var(--gold); font-weight: 700; }
.thinking-dots::after { content: ""; animation: thinking-dots 1.2s steps(4, end) infinite; }
.ai-clear-form { margin-top: 8px; }
.ai-clear-form button { border-radius: 999px; padding: 7px 12px; background: #0b1311; border-color: var(--line); }
.ai-clear-form button:hover { border-color: var(--gold); }
.chat-feed { height: 280px; overflow: auto; border: 1px solid var(--line); background: #070d0b; border-radius: 8px; padding: 10px; display: grid; align-content: start; gap: 6px; }
.chat-feed.tall { height: 520px; }
.room-label { color: var(--gold); font-size: 14px; }
.room-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.room-tabs a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: #0b1311; color: var(--text); }
.room-tabs a.active { border-color: var(--gold); color: #fff; background: #2c2616; }
.system-relays { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.system-relays a { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #0b1311; color: var(--text); display: grid; gap: 3px; }
.system-relays a.active { border-color: var(--gold); background: #1b2117; }
.system-relays strong { color: var(--cyan); }
.system-relays span, .system-relays em { color: var(--muted); font-style: normal; font-size: 12px; }
.chat-line { color: #dbe7e1; overflow-wrap: anywhere; }
.chat-line span { color: var(--muted); margin-right: 8px; }
.chat-line strong { color: var(--cyan); margin-right: 6px; }
.chat-line em { color: var(--gold); font-style: normal; margin-right: 8px; font-size: 12px; }
.chat-system { color: var(--gold); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.mail-form { display: grid; gap: 10px; }
.mail-manager { position: relative; display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 14px; min-height: 640px; }
.mail-folders { align-self: start; }
.mail-folders nav { display: grid; gap: 6px; margin: 14px 0; }
.mail-folders nav a { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #0b1311; color: var(--text); }
.mail-folders nav a.active { border-color: var(--gold); background: linear-gradient(180deg, #243528, var(--surface)); }
.mail-folders nav strong { color: var(--gold); }
.folder-form { display: grid; gap: 8px; }
.mail-console { overflow-x: auto; }
.mail-toolbar { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.mail-toolbar h2 { margin: 0; }
.mail-table th, .mail-table td { vertical-align: top; }
.mail-subject { display: grid; gap: 3px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; min-width: 300px; }
.mail-subject strong { color: var(--text); }
.mail-subject small { color: var(--muted); margin: 0; white-space: normal; }
.mail-subject:hover strong { color: var(--gold); }
.mail-move { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 6px; min-width: 210px; }
.compose-popout, .contacts-popout, .mail-popout { position: absolute; top: 72px; right: 18px; z-index: 9; width: min(760px, calc(100vw - 64px)); max-height: min(76vh, 820px); overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.compose-popout[hidden], .mail-popout[hidden] { display: none; }
.mail-meta { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0b1311; padding: 12px; }
.mail-meta dt { color: var(--muted); }
.mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #dbe7e1; border: 1px solid var(--line); border-radius: 8px; background: #0b1311; padding: 14px; font-family: inherit; line-height: 1.5; }
.contacts-popout[hidden] { display: none; }
.contact-new, .contact-edit { display: grid; gap: 8px; }
.contact-new { grid-template-columns: minmax(130px, 1fr) minmax(190px, 1.2fr) minmax(130px, 1fr) auto; align-items: start; margin-bottom: 14px; }
.contact-new textarea { min-height: 42px; }
.contact-list { display: grid; gap: 10px; }
.contact-card { border: 1px solid var(--line); background: #0b1311; border-radius: 8px; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.contact-edit { grid-template-columns: minmax(130px, 1fr) minmax(190px, 1.2fr) minmax(130px, 1fr) minmax(180px, 1.3fr) auto; }
.contact-edit textarea { min-height: 38px; }
.contact-actions { display: grid; gap: 8px; }
.profile-form { display: grid; gap: 10px; }
.settings-shell { min-height: 100vh; padding: 18px; display: grid; gap: 14px; background: radial-gradient(circle at 50% 0, rgba(230,191,102,.12), transparent 34%), var(--bg); }
.settings-popout { position: fixed; top: 92px; right: 20px; z-index: 20; width: min(760px, calc(100vw - 40px)); max-height: calc(100vh - 120px); overflow: auto; box-shadow: 0 22px 70px rgba(0,0,0,.58); }
.settings-popout[hidden] { display: none; }
.leaderboard-popout { position: fixed; top: 92px; right: 20px; z-index: 18; width: min(840px, calc(100vw - 40px)); max-height: calc(100vh - 120px); overflow: auto; box-shadow: 0 22px 70px rgba(0,0,0,.58); }
.leaderboard-popout[hidden] { display: none; }
.help-popout { position: fixed; top: 92px; right: 20px; z-index: 19; width: min(980px, calc(100vw - 40px)); max-height: calc(100vh - 120px); overflow: auto; box-shadow: 0 22px 70px rgba(0,0,0,.58); }
.help-popout[hidden] { display: none; }
.dispatch-popout { position: fixed; top: 118px; right: 24px; z-index: 17; width: min(520px, calc(100vw - 48px)); box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.dispatch-popout time { display: block; color: var(--gold); font-size: 12px; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; }
.dispatch-popout p { color: #dbe7e1; line-height: 1.55; }
.guide-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.guide-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.guide-block h3 { margin: 0 0 10px; color: var(--gold); }
.guide-block p { color: #dbe7e1; line-height: 1.55; }
.guide-list { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.guide-list dt { color: var(--cyan); font-weight: 800; }
.guide-list dd { margin: 0; color: #dbe7e1; }
.charter-document { position: relative; border: 1px solid var(--gold); background: linear-gradient(180deg, rgba(44,38,22,.82), rgba(16,26,24,.96)); border-radius: 8px; padding: 22px; overflow: hidden; }
.charter-document.compact { margin-bottom: 14px; }
.charter-document.compact h1 { font-size: clamp(24px, 4vw, 38px); }
.charter-document::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 100% 36px; opacity: .5; }
.charter-document h1 { margin: 4px 0 16px; font-size: clamp(28px, 7vw, 48px); line-height: 1; }
.charter-seal { position: absolute; right: 18px; top: 18px; width: 72px; height: 72px; border: 1px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: var(--gold); font-weight: 800; font-size: 22px; background: rgba(7,16,14,.78); }
.charter-ledger { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; position: relative; z-index: 1; }
.charter-ledger dt { color: var(--muted); text-transform: uppercase; font-size: 12px; }
.charter-ledger dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.charter-clause { position: relative; z-index: 1; color: #dbe7e1; border-top: 1px solid var(--line); margin: 18px 0 0; padding-top: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.admin-shell .metrics { margin-bottom: 14px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-forms { display: grid; gap: 10px; }
.admin-forms form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: start; }
.admin-forms form:has(button:only-child) { grid-template-columns: auto; justify-content: start; }
.wide-panel { grid-column: 1 / -1; overflow-x: auto; }
.mail-row.unread td { background: rgba(123,214,210,.08); }
.muted { color: var(--muted); }
.news { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.news time { display: block; color: var(--muted); font-size: 12px; }
.up { color: var(--green); }
.down { color: var(--red); }
.flat { color: var(--muted); }
.boot-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 20%, rgba(123,214,210,.16), transparent 26%), #050b0a; overflow: hidden; }
.boot-shell::before { content: ""; position: fixed; inset: 0; background: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 100% 28px, 42px 100%; animation: boot-grid-drift 8s linear infinite; pointer-events: none; }
.boot-console { width: min(860px, 100%); border: 1px solid var(--line); border-radius: 8px; background: rgba(10,18,16,.92); box-shadow: 0 0 60px rgba(123,214,210,.16); padding: 28px; position: relative; overflow: hidden; }
.boot-console::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(123,214,210,.11), transparent); animation: boot-scan 3s ease-in-out infinite; pointer-events: none; }
.boot-brand { color: var(--gold); font-weight: 800; font-size: 13px; letter-spacing: 0; }
.boot-console h1 { margin: 8px 0 4px; font-size: clamp(28px, 5vw, 54px); }
.boot-console p { color: var(--muted); margin: 0 0 22px; }
.boot-node-detail { margin-top: -14px !important; color: var(--cyan) !important; font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.boot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.boot-grid span { min-height: 78px; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(180deg, rgba(123,214,210,.18), rgba(230,191,102,.08)); padding: 10px; display: grid; align-content: center; gap: 4px; opacity: 0; transform: translateY(10px); animation: boot-module-in .7s ease forwards, boot-cell 4.8s ease-in-out infinite; animation-delay: calc(var(--i) * 1.2s), calc(var(--i) * .45s); }
.boot-grid strong { color: var(--cyan); font-size: 13px; }
.boot-grid em { color: var(--muted); font-style: normal; font-size: 12px; }
.boot-grid b { color: var(--gold); font-size: 12px; }
.boot-lines { display: grid; gap: 8px; font-family: Consolas, "Courier New", monospace; }
.boot-line { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(49,70,64,.65); padding: 7px 0; opacity: 0; transform: translateY(8px); animation: boot-line-in .55s ease forwards; animation-delay: calc(var(--i) * 1.32s + 1.8s); }
.boot-line strong { color: var(--green); }
.boot-progress { height: 12px; border: 1px solid var(--line); border-radius: 999px; margin-top: 22px; overflow: hidden; background: #050b0a; }
.boot-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--gold)); animation: boot-progress 17.2s ease forwards; }
.boot-console footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); margin-top: 14px; }
.boot-console footer a { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #0b1311; }
@keyframes boot-line-in { to { opacity: 1; transform: translateY(0); } }
@keyframes boot-module-in { to { opacity: 1; transform: translateY(0); } }
@keyframes boot-progress { to { width: 100%; } }
@keyframes boot-cell { 50% { border-color: var(--cyan); transform: translateY(-2px); } }
@keyframes boot-scan { 0%, 100% { transform: translateX(-130%); } 50% { transform: translateX(130%); } }
@keyframes boot-grid-drift { to { background-position: 0 28px, 42px 0; } }
.orbital-scene { position: relative; width: 220px; height: 96px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: radial-gradient(circle at center, rgba(123,214,210,.12), transparent 54%), #08100e; }
.orbital-scene::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(123,214,210,.13), transparent); animation: sweep 4.8s ease-in-out infinite; }
.planet { position: absolute; width: 42px; height: 42px; border-radius: 50%; left: 89px; top: 27px; background: radial-gradient(circle at 34% 28%, #d9fff5, #7bd6d2 36%, #294a44 68%, #101a18); box-shadow: 0 0 24px rgba(123,214,210,.45); }
.orbit { position: absolute; border: 1px solid rgba(230,191,102,.5); border-radius: 50%; left: 37px; top: 16px; width: 146px; height: 64px; animation: orbit-spin 8s linear infinite; }
.orbit-b { left: 25px; top: 24px; width: 170px; height: 48px; border-color: rgba(123,214,210,.45); animation-duration: 11s; animation-direction: reverse; }
.orbit span { position: absolute; width: 7px; height: 7px; border-radius: 50%; right: 9px; top: 7px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.orbit-b span { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.ticker-pulse { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 16px; background: linear-gradient(90deg, transparent 0 8%, var(--green) 8% 10%, transparent 10% 18%, var(--gold) 18% 21%, transparent 21% 30%, var(--cyan) 30% 33%, transparent 33%); opacity: .75; animation: pulse-line 1.8s steps(5) infinite; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes sweep { 0%, 100% { transform: translateX(-120%); } 50% { transform: translateX(120%); } }
@keyframes pulse-line { 50% { opacity: .35; transform: translateY(-1px); } }
@keyframes map-route-pulse { to { stroke-dashoffset: -16; } }
@keyframes map-ping { from { opacity: .8; transform: scale(.75); } to { opacity: 0; transform: scale(1.65); } }
@keyframes drift-stars { to { background-position: 0 0, 0 0, 0 42px; } }
@keyframes thinking-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
@media (max-width: 980px) {
  .login-shell, .workspace, .office-grid { grid-template-columns: 1fr; }
  .intro { min-height: 48vh; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { grid-template-columns: 1fr auto; }
  .orbital-scene { display: none; }
  .mail-manager { grid-template-columns: 1fr; }
  .contact-new, .contact-edit { grid-template-columns: 1fr; }
  .bank-form { grid-template-columns: 1fr; }
  .ai-form { grid-template-columns: 1fr; }
  .shipping-form { grid-template-columns: 1fr 120px; }
  .commodity-head { grid-template-columns: 1fr; }
  .tool-pills { justify-content: flex-start; max-width: none; }
  .commodity-popout, .contacts-popout, .stock-popout, .compose-popout, .mail-popout { top: 150px; right: 10px; left: 10px; width: auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-forms form { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .app-shell { padding: 10px; }
  .topbar { display: block; }
  .topbar nav { margin-top: 12px; }
  .topbar-actions { justify-items: start; margin-top: 12px; }
  .server-clock { text-align: left; }
  .metrics { grid-template-columns: 1fr; }
  .shipping-form { grid-template-columns: 1fr; }
  .charter-ledger { grid-template-columns: 1fr; }
  .charter-seal { position: static; margin-left: auto; }
  .settings-popout, .help-popout, .leaderboard-popout, .dispatch-popout { top: 12px; right: 10px; left: 10px; width: auto; max-height: calc(100vh - 24px); }
  .guide-list { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
