:root { --bg: #0b1220; --panel: #121c2e; --line: #1f2f48; --text: #e6edf6; --muted: #8aa0bb; --accent: #3b8eea; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; min-height: 100vh; }
/* Faded brand watermark: fixed behind the page, feathered out at the edges. */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .12;
  background: url('brand-watermark.png?v=4') center 45% / min(560px, 62vmin) no-repeat;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 70%);
          mask-image: radial-gradient(ellipse at center, #000 25%, transparent 70%); }
/* Soft accent glow from the top edge. */
body::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(900px 480px at 50% -8%, rgba(59,142,234,.14), transparent 70%); }
header { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: linear-gradient(110deg, #1d2739, var(--panel) 40%); border-bottom: 1px solid #343443; box-shadow: 0 4px 18px rgba(0,0,0,.12); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 7px; letter-spacing: .09em; color: var(--text); background: none; border: 0; padding: 3px 0; font: inherit; font-size: 15px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.brand::before { content: ""; width: 24px; height: 28px; background: url('brand-watermark.png?v=4') center / contain no-repeat; }
.brand span { color: #f0c2ba; font-size: 10px; letter-spacing: .1em; background: #482b32; border: 1px solid #754048; border-radius: 5px; padding: 3px 5px; }
.brand:hover { color: #fff; }
.workspaces { display: flex; padding: 3px; gap: 3px; border: 1px solid #2a405d; border-radius: 9px; background: #0c1829; }
.workspaces button { border: 0; border-radius: 6px; background: transparent; color: #a4b8ce; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .05em; padding: 7px 10px; cursor: pointer; }
.workspaces button:hover { color: #fff; background: #1b304d; }
.workspaces button.on { background: #295485; color: #fff; box-shadow: inset 0 1px rgba(255,255,255,.1); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button { background: none; border: 0; color: #a4b8ce; padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
nav button:hover { background: #1a2d49; color: var(--text); }
nav button.on { background: #203a5b; color: #fff; box-shadow: inset 0 -2px #dc665d; }
main { position: relative; z-index: 1; padding: 18px; max-width: 1400px; margin: 0 auto; }
.workspace-intro, .dashboard { max-width: 1120px; margin: 6vh auto; }
.workspace-intro h1, .dashboard h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 8px; }
.eyebrow { color: #e8a39a; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.intro-copy { color: var(--muted); font-size: 15px; max-width: 650px; margin: 0 0 28px; }
.workspace-grid, .module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.workspace-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.workspace-card, .module-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; color: var(--text); text-align: left; }
.workspace-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 230px; background: linear-gradient(145deg, #1a304f, #101c30); border-color: #2a4669; font: inherit; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.workspace-card[data-open-workspace="command"] { background: linear-gradient(145deg, #173b43, #10232e); border-color: #28525c; }
.workspace-card::before { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; top: -110px; right: -40px; box-shadow: 0 0 0 36px rgba(255,255,255,.025), 0 0 0 72px rgba(255,255,255,.02); pointer-events: none; }
.workspace-card:hover { transform: translateY(-3px); border-color: #6eaef5; box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.workspace-card[data-open-workspace="command"]:hover { border-color: #72c9c4; }
.workspace-card strong { position: relative; font-size: clamp(22px, 3vw, 29px); letter-spacing: .1em; }
.module-link:hover { border-color: var(--accent); background: #162640; }
.module-card p, .module-link > span:not(.module-status):not(.workspace-link) { color: var(--muted); }
.workspace-link { color: #83bfff; font-weight: 600; margin-top: auto; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dashboard-heading h2, .dashboard-heading p { margin: 0; }
.module-card h2, .module-link strong { font-size: 16px; margin: 14px 0 8px; }
.module-card p { margin: 0; }
.module-status { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #b8c5d5; background: #25364b; padding: 4px 8px; border-radius: 5px; }
.module-status.available { color: #8eddb7; background: #173c34; }
.module-link { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font: inherit; cursor: pointer; min-height: 175px; }
.module-link strong { margin-bottom: 2px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1 { font-size: 20px; margin: 0 0 14px; } h2 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .grow { flex: 1; }
input, select, textarea { background: #0d1626; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 600; }
.btn.grey, .btn.small { background: #243651; } .btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: #0f1a2d; }
tr.click { cursor: pointer; } tr.click:hover td { background: #16243b; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #243651; }
.pill.ok { background: #14532d; } .pill.warn { background: #7c4a03; } .pill.bad { background: #7f1d1d; } .pill.blue { background: #1e3a8a; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-width: 420px; margin: 12vh auto 0; }
.card label, .modal label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.card input { width: 100%; }
.err { color: #ff8a8a; margin-top: 8px; min-height: 1.2em; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow: auto; z-index: 20; }
.modal[hidden], .toast[hidden], #top[hidden] { display: none; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; width: min(720px, 100%); }
.modal input, .modal select, .modal textarea { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.log { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1e3a8a; padding: 10px 18px; border-radius: 10px; z-index: 30; }
#map { height: calc(100vh - 150px); min-height: 420px; border-radius: 12px; border: 1px solid var(--line); }
.responder-marker-wrap { background: none; border: 0; }
.rmark { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 4px; border-radius: 12px; background: rgba(10,14,20,.92); border: 1.5px solid var(--rc); color: #fff; font: 700 11px/16px system-ui; white-space: nowrap; }
.rmark i { width: 11px; height: 11px; border-radius: 50%; background: var(--rc); } .rmark.stale { opacity: .5; }
@media (max-width: 700px) { header { flex-wrap: wrap; gap: 10px; } nav { order: 2; flex-basis: 100%; } .grid2 { grid-template-columns: 1fr; } th:nth-child(n+5), td:nth-child(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) { .workspace-card { transition: none; } .workspace-card:hover { transform: none; } }
