@font-face {
  font-family: "DM Sans";
  src: url("DM-Sans.woff2") format("woff2"), url("DM-Sans.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
/* Shared visual layer for the launcher and both operating consoles. */
:root {
  --page: #f1f5f7;
  --line: #d8e2e8;
  --muted: #526778;
  --lagoon-ink: #086678;
  --mast: #162f51;
}
[data-theme="dark"] {
  --page: #0b1521;
  --line: #2b4052;
  --muted: #a9bac8;
  --lagoon-ink: #7adce3;
  --mast: #132b45;
}
body { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Launcher */
.launcher .page { max-width: 1240px; padding-top: clamp(20px,3vw,44px); gap: 20px; }
.launcher .topline { padding-inline: max(22px,calc((100% - 1188px)/2)); }
.launcher .hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: none;
  padding: clamp(24px,4vw,56px);
  border-radius: 18px;
  background: var(--mast);
  color: #fff;
}
.launcher .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 55%;
  background: url("atoll-contours.svg") center right / cover no-repeat;
}
.launcher .hero .eyebrow { color: #9adfe5; letter-spacing: .13em; }
.launcher .hero h1 { color: inherit; font-size: clamp(32px,4vw,56px); letter-spacing: -.045em; }
.launcher .hero .sub { max-width: 48ch; color: #e0ebf2; font-size: 15px; }
.launcher .grid { gap: 18px; }
.launcher .tile { padding: clamp(18px,2.4vw,30px); gap: 15px; min-height: 0; }
.launcher .tile .ttl { font-size: 22px; color: var(--ink); line-height: 1.2; }
.launcher .tile .top { align-items: center; }
.launcher .tile .desc { color: var(--muted); font-size: 14px; max-width: 52ch; }
.launcher .tile .arr { display: none; }
.launcher .tile .go {
  min-height: 42px;
  padding-inline: 16px;
  border: 0;
  color: white;
  background: #263e77;
}
.launcher .tile.dash .go { color: white; background: #096577; }
.launcher .tile.dash .ico { color: var(--lagoon-ink); }
.launcher .tile:hover .go { background: #1a305f; }
.launcher .tile.dash:hover .go { background: #074e5d; }
.launcher .features { gap: 0; border-top: 1px solid var(--line); }
.launcher .feat { background: none; border: 0; box-shadow: none; padding: 17px 15px 8px 0; }
.launcher .feat b, .launcher .feat span { font-size: 12px; }
.launcher .foot .copy { color: var(--muted); }

/* Consoles */
@media (min-width:1241px) {
  :root { --sidebar-w: clamp(204px,16vw,254px); }
}
.app .sb-label { color: var(--muted); }
.app .tb-title { font-size: clamp(16px,1.35vw,21px); letter-spacing: -.035em; }
.app .tile { min-width: 0; }
.app .panel { min-width: 0; }
.app .panel-h { background: var(--surface-2); }
.app .panel-t { text-transform: none; font-size: 13px; letter-spacing: -.015em; color: var(--ink); }
.app .panel-b { scrollbar-color: var(--line-2) var(--surface); }
.app .perf-strip .t-v { line-height: 1.25; }
.app .perf-strip .t-l, .app .perf-strip .t-c { max-width: 100%; }
.app .tile-sync .t-v { align-items: center; overflow-wrap: anywhere; }
@media (min-width:901px) and (max-width:1080px) {
  .app:not(.mobile-view) .console { grid-template-columns: minmax(220px,.9fr) minmax(310px,1.35fr) minmax(200px,.8fr); gap: 10px; }
}

/* Phone navigation remains in document flow, leaving room for the existing action bar. */
@media (max-width:900px) {
  .app .sidebar, .app.mobile-view .sidebar {
    display: flex;
    position: static;
    flex-direction: row;
    width: 100%;
    height: auto;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .app .sidebar .sb-brand { margin: 0; height: 54px; padding: 0 10px; }
  .app .sidebar .brand-mark { width: 30px; height: 30px; }
  .app .sidebar .sb-nav {
    min-width: 0;
    height: 54px;
    padding: 0 8px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .app .sidebar .sb-item { flex: 0 0 auto; width: auto; min-height: 44px; padding: 0 10px; gap: 6px; margin: 0; font-size: 12px; }
  .app .sidebar .sb-item span:not(.sb-count) { display: inline; }
  .app .sidebar .sb-foot, .app .sidebar .sb-label { display: none; }
  .app .console { grid-template-columns: minmax(0,1fr); }
  .app .modal-inner { max-height: 100dvh; }
}
@media (max-width:600px) {
  .launcher .page { padding: 16px 14px 22px; gap: 14px; }
  .launcher .hero::after { inset-inline-start: 58%; opacity: .32; }
  .launcher .topline { padding-inline: 14px; gap: 8px; height: 60px; }
  .launcher .brand img { max-width: 28vw; height: auto; max-height: 40px; }
  .launcher .features { grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .launcher .feat { padding-right: 0; }
  .launcher .theme-btn, .app .icon-btn { min-width: 44px; min-height: 44px; }
  .app .perf-strip { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .app .tile .t-c { white-space: normal; font-size: 12px; }
  .app .tile .t-l { white-space: normal; letter-spacing: .065em; }
  .app .seg .tab { min-height: 40px; }
}
@media (prefers-reduced-motion:reduce) {
  .launcher *, .launcher *::after { animation: none !important; transition: none !important; }
}
.app .perf-strip + .console { margin-top: 14px; }
@media (max-width:900px) {
  .app .sidebar .sb-nav { overscroll-behavior-inline: contain; }
  .app .sidebar .sb-item { scroll-margin-inline: 8px; }
}

/* Portal colours. Tinted menu selections stay quieter than committed actions. */
:root {
  --page: #f2f4f6;
  --ink: #21263d;
  --ink-2: #363c53;
  --muted: #535e73;
  --line: #d9dde2;
  --line-2: #bcc3cc;
  --lagoon: #388592;
  --lagoon-ink: #226a77;
  --lagoon-bg: #e8f2f3;
  --lagoon-line: #b8d6da;
  --surface-2: #fafbfc;
  --surface-3: #f0f3f5;
  --primary-fill: linear-gradient(106deg,#316f7b,#347e8b 62%,#30828e);
  --on-primary: #fff;
  --menu-fill: linear-gradient(105deg,#fff,#f5f7f8);
  --menu-active: linear-gradient(105deg,#dcecef,#eff5f6);
  --control-sheen: linear-gradient(125deg,rgba(255,255,255,.12),rgba(70,107,128,.07));
  --panel-shadow: 0 2px 3px rgba(29,37,56,.05),0 8px 22px rgba(29,37,56,.065);
  --mono: ui-monospace,"Cascadia Mono",Consolas,monospace;
}
:root[data-theme="dark"] {
  --page: #0d1423;
  --card: #131826;
  --surface: #131826;
  --surface-2: #171d2c;
  --surface-3: #1a2234;
  --shell: #131826;
  --ink: #f0f3fa;
  --ink-2: #dce1ed;
  --muted: #b0bad1;
  --line: #303645;
  --line-2: #475066;
  --chip: #1a2335;
  --chip-2: #222d41;
  --lagoon: #59b6c3;
  --lagoon-ink: #87d3dc;
  --lagoon-bg: #192d37;
  --lagoon-line: #365763;
  --primary-fill: linear-gradient(106deg,#51a6b2,#63bdc9);
  --on-primary: #081621;
  --menu-fill: linear-gradient(105deg,#171e2d,#131826);
  --menu-active: linear-gradient(105deg,#1b3843,#192c37);
  --control-sheen: linear-gradient(125deg,rgba(142,189,215,.085),rgba(0,0,0,.09));
  --panel-shadow: 0 2px 4px rgba(0,0,0,.16),0 10px 24px rgba(0,0,0,.13);
}

/* Use the transparent brand artwork directly on each theme's surface. */
.app .sb-brand { background: var(--card); border-bottom-color: var(--line); justify-content: center; }
.app .sidebar .brand-lockup { width: min(166px,100%); height: auto; }
.app .brand-mark {
  border-radius: 0;
  background: url("Manta-Air-Lockup.png") right top / 360% auto no-repeat;
  clip-path: polygon(0 0,100% 0,100% 95%,80% 71%,58% 57%,0 73%);
}
[data-theme="dark"] :is(.brand .lockup-dark,.sb-brand .lockup-dark,.brand-mark) { filter: brightness(0) invert(1); }
@media (min-width:1241px) {
  .app:not(.mobile-view) { padding: 12px; gap: 12px; }
  .app:not(.mobile-view) .sidebar,
  .app:not(.mobile-view) .topbar {
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: var(--panel-shadow);
  }
  .app:not(.mobile-view) .sidebar { overflow: hidden; }
  .app:not(.mobile-view) .page-content { padding: 19px 3px 14px; }
}
@media (max-width:1240px) {
  .app .sidebar .brand-lockup { display: none; }
}
.app .sidebar.collapsed .brand-lockup { display: none; }
.launcher .hero {
  background: linear-gradient(115deg,var(--card) 48%,var(--lagoon-bg));
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--panel-shadow);
}
.launcher .hero .eyebrow { color: var(--lagoon-ink); }
.launcher .hero .sub { color: var(--muted); }
.launcher .hero h1 { font-weight: 700; }
.launcher .tile, .app .panel { box-shadow: var(--panel-shadow); }
.launcher .tile .go { border-radius: 999px; }
.app .sb-nav, .app .seg { background-image: var(--control-sheen); }
.app .sb-item { font-weight: 600; border-color: transparent; }
.app .sb-item.active::before { background: var(--lagoon); }
.app .sb-label, .launcher .eyebrow, .app .clock, .launcher .stamp,
.app .perf-strip .t-l, .app .mono-num { font-family: var(--mono); }
.app .perf-strip .t-l { font-weight: 600; }
.app .tb-title, .app .panel-t { font-weight: 700; }
.app .clock, .app .seg, .app .seg .tab, .app .icon-btn,
.app .add-btn, .app .btn, .launcher .theme-btn { border-radius: 999px; }
.app .seg .tab.active .count { background: var(--card); color: var(--ink); }
.app :is(input,select,textarea):focus-visible { outline-color: var(--lagoon); }
:focus-visible { outline-color: var(--lagoon); }

/* Use only the image layer so status, destructive and checked controls retain
   their existing background colours. This also covers dynamically built menus. */
:root :is(button,[role="button"],select,.btn,.sb-item,.launcher .tile,.launcher .go) {
  background-image: var(--button-image,var(--control-sheen)) !important;
}
:root .sb-item { --button-image: var(--menu-fill); }
:root .sb-item:is(:hover,.active) {
  --button-image: var(--menu-active);
  color: var(--ink);
  border-color: var(--lagoon-line);
}
:root :is(.add-btn,.btn.primary,.btn.accent,button.primary,button.accent,button.now,.seg .tab.active),
.launcher .tile .go {
  --button-image: var(--primary-fill);
  color: var(--on-primary) !important;
  border-color: transparent;
}
.launcher .tile .go, .launcher .tile:hover .go {
  background: var(--primary-fill);
  box-shadow: 0 4px 12px color-mix(in srgb,var(--lagoon) 22%,transparent);
}
:root :is(.add-btn,.btn.primary,.btn.accent,button.now,.launcher .tile .go):hover {
  filter: brightness(.95);
}
.app .perf-strip button.is-active {
  border-color: var(--lagoon);
  box-shadow: 0 0 0 2px var(--lagoon-bg);
}
.app .perf-strip button.is-active::after { background: var(--lagoon); }
@media (forced-colors:active) {
  :root :is(button,[role="button"],select,.btn,.sb-item,.launcher .tile,.launcher .tile .go) { background-image: none !important; }
}

.suite-version { display:inline-block; vertical-align:middle; white-space:nowrap; padding:.2em .55em; border:1px solid currentColor; border-radius:999px; color:var(--muted,inherit); font:600 12px/1.2 system-ui,sans-serif; letter-spacing:.025em; }

.app :is(.btn,.now,.modal-f button,.dispatch-tabs button,.dispatch-manifest button){border-radius:12px;font-weight:650}.app :is(.btn,.modal-f button):not(.primary):not([aria-selected=true]){background-image:linear-gradient(145deg,transparent,color-mix(in srgb,var(--muted) 8%,transparent))}.app .sb-nav .sb-item:focus-visible,.app button:focus-visible{outline:2px solid var(--lagoon);outline-offset:2px}

.metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px;margin-bottom:18px}.metric-grid>div{display:grid;gap:6px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.metric-grid strong{font-size:24px}.metric-grid progress{width:100%;accent-color:var(--lagoon,#238a96)}.metric-grid small{color:var(--muted)}
