/* Daedalus webui design system.
 *
 * Tokens — kept in CSS variables so a future theme switcher can override
 * without touching utility classes.  Palette favors deep blue-charcoal
 * with warm bronze accents (the mythological craftsman) and a cool iris
 * for "knowledge" surfaces.  Inter for UI, Fraunces for the wordmark.
 */

:root {
  /* Surface elevation — warm near-black (shifted from cool blue-black
     in 2026-06 so the dark dashboard relates to the cream marketing
     site instead of feeling like a different product).  Bronze accent
     reads like firelight on warm wood now, not tarnished metal on a
     server rack.  Iris stays cool so it pops against the warm base. */
  --d-bg:        #181612;
  --d-bg-soft:   #1f1b15;
  --d-surface:   #2a241c;
  --d-raised:    #332c22;
  --d-line:      #3d3527;
  --d-line-soft: #2a2419;

  /* Text — slight warm tilt to match the new surfaces */
  --d-text:      #efeae0;
  --d-text-mute: #b0a896;
  --d-text-dim:  #7a7261;

  /* Brand accents — bronze now reads against warm dark; iris still
     cool so it carries call-to-action with high contrast. */
  --d-bronze:        #d9b76e;
  --d-bronze-hi:     #ecc785;
  --d-bronze-dim:    #8a7548;
  --d-iris:          #8c9eff;
  --d-iris-hi:       #b3c0ff;
  --d-iris-dim:      #4d5ba8;

  /* Status — slightly warmer pos/crit for visual harmony with the new bg */
  --d-pos:  #7adfa8;
  --d-warn: #f0c168;
  --d-crit: #ef7c6a;

  /* shape */
  --d-radius-sm: 6px;
  --d-radius:    10px;
  --d-radius-lg: 14px;
  --d-radius-xl: 20px;

  /* motion */
  --ease-out:   cubic-bezier(0.21, 0.61, 0.35, 1);
  --ease-in:    cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --ease-soft:  cubic-bezier(0.4, 0, 0.2, 1);

  /* type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}


/* ──────────────────────────────────────────────────────────────────
   Light operator mode — opt-in via `<html data-theme="light">`.
   Inherits the marketing palette so the signed-in dashboard feels
   like the same product as the public site.  Set by
   webui/assets/theme.js based on user_preferences.theme or OS pref.
   ────────────────────────────────────────────────────────────────── */

html[data-theme="light"] {
  /* Surfaces — same cream + paper-card system the marketing site uses */
  --d-bg:        #fbf9f4;          /* page cream */
  --d-bg-soft:   #f1ecdf;
  --d-surface:   #ffffff;          /* cards */
  --d-raised:    #fcf8ee;          /* hover / elevated cards */
  --d-line:      rgba(0, 0, 0, 0.12);
  --d-line-soft: rgba(0, 0, 0, 0.06);

  /* Text — warm-black hierarchy, AA-passing dim */
  --d-text:      #1f1c18;
  --d-text-mute: #4a4438;
  --d-text-dim:  #5e564a;

  /* Brand accents — slightly deeper bronze for legibility on cream */
  --d-bronze:        #b48a4a;
  --d-bronze-hi:     #d9a960;
  --d-bronze-dim:    #6b4a1f;
  /* Iris reused for "call to action" + "knowledge surfaces"; tuned
     for cream contrast */
  --d-iris:          #5a6cd8;
  --d-iris-hi:       #4453b8;
  --d-iris-dim:      #b0bbf0;

  /* Status — same hues as dark mode, tuned darker for AA on cream */
  --d-pos:  #2b8a5e;
  --d-warn: #b07a1f;
  --d-crit: #b13a3a;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--d-bg);
  color: var(--d-text);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* layered background — flat charcoal with a faint vignette so the
   * eye reads center-weight without any glow distractions */
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%,
      rgba(140, 158, 255, 0.06) 0%,
      rgba(140, 158, 255, 0) 50%),
    radial-gradient(ellipse 70% 50% at 50% 120%,
      rgba(201, 169, 110, 0.04) 0%,
      rgba(201, 169, 110, 0) 60%),
    var(--d-bg);
  min-height: 100vh;
}

a { color: var(--d-iris-hi); text-decoration: none; }
a:hover { color: var(--d-bronze-hi); }

::selection { background: rgba(201, 169, 110, 0.35); color: var(--d-text); }

/* ---------- typography ---------- */

.d-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  letter-spacing: -0.012em;
  line-height: 1.05;
}

.d-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.d-overline {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--d-text-dim);
  font-weight: 500;
}

.d-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.d-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.d-header {
  border-bottom: 1px solid var(--d-line-soft);
  background: linear-gradient(180deg,
    rgba(20, 27, 46, 0.7) 0%,
    rgba(20, 27, 46, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}

.d-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}

.d-brand {
  display: flex; align-items: baseline; gap: 14px;
}

.d-brand-mark {
  font-size: 1.4rem;
  background: linear-gradient(120deg, var(--d-bronze-hi) 0%, var(--d-iris-hi) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.d-brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--d-text-dim);
  text-transform: uppercase;
}

.d-crumbs {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.84rem; color: var(--d-text-mute);
}
.d-crumbs a { color: var(--d-text-mute); }
.d-crumbs a:hover { color: var(--d-bronze-hi); }
.d-crumbs .sep { color: var(--d-text-dim); }

.d-status-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--d-pos);
  box-shadow: 0 0 0 3px rgba(111, 223, 178, 0.16);
  display: inline-block; margin-right: 8px;
  transition: background 200ms var(--ease-soft), box-shadow 200ms var(--ease-soft);
}
.d-status-dot.warn { background: var(--d-warn); box-shadow: 0 0 0 3px rgba(233, 185, 100, 0.16); }
.d-status-dot.crit { background: var(--d-crit); box-shadow: 0 0 0 3px rgba(229, 120, 120, 0.16); }
.d-status-dot.idle { background: var(--d-text-dim); box-shadow: 0 0 0 3px rgba(95, 103, 126, 0.16); }

/* ---------- cards / surfaces ---------- */

.d-card {
  background: var(--d-surface);
  border: 2px solid var(--d-line);
  border-radius: var(--d-radius-lg);
  position: relative;
  transition: border-color 240ms var(--ease-soft),
              background 240ms var(--ease-soft),
              transform 240ms var(--ease-soft);
}

.d-card.elevated {
  background: var(--d-raised);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 1px 0 rgba(0, 0, 0, 0.3);
}

.d-card.hairline {
  background: var(--d-bg-soft);
  border-color: var(--d-line-soft);
}

.d-card.interactive {
  cursor: pointer;
}
.d-card.interactive:hover {
  border-color: rgba(201, 169, 110, 0.4);
  background: linear-gradient(180deg,
    rgba(201, 169, 110, 0.05) 0%,
    var(--d-surface) 70%);
}

/* etched headline strip — subtle bronze hairline above section headings */
.d-rule {
  height: 1px;
  background: linear-gradient(90deg,
    rgba(201, 169, 110, 0) 0%,
    rgba(201, 169, 110, 0.4) 30%,
    rgba(201, 169, 110, 0.4) 70%,
    rgba(201, 169, 110, 0) 100%);
  margin: 16px 0;
}

/* ---------- buttons ---------- */

.d-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 9px 16px;
  border-radius: var(--d-radius);
  border: 2px solid var(--d-line);
  background: var(--d-raised);
  color: var(--d-text);
  cursor: pointer;
  transition: all 180ms var(--ease-soft);
  display: inline-flex; align-items: center; gap: 8px;
}
.d-btn:hover {
  border-color: rgba(201, 169, 110, 0.4);
  background: rgba(201, 169, 110, 0.08);
  color: var(--d-bronze-hi);
}
.d-btn.primary {
  background: linear-gradient(135deg, var(--d-bronze) 0%, #b3915d 100%);
  border-color: var(--d-bronze);
  color: #1a1408;
  font-weight: 600;
}
.d-btn.primary:hover {
  background: linear-gradient(135deg, var(--d-bronze-hi) 0%, var(--d-bronze) 100%);
  color: #1a1408;
}
.d-btn.ghost {
  background: transparent;
  border-color: var(--d-line-soft);
  color: var(--d-text-mute);
}
.d-btn.ghost:hover {
  color: var(--d-bronze-hi);
  border-color: rgba(201, 169, 110, 0.4);
  background: rgba(201, 169, 110, 0.04);
}

.d-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- inputs ---------- */

.d-input {
  font: inherit;
  background: var(--d-bg-soft);
  color: var(--d-text);
  border: 2px solid var(--d-line);
  border-radius: var(--d-radius);
  padding: 9px 14px;
  width: 100%;
  transition: border-color 200ms var(--ease-soft), background 200ms var(--ease-soft);
}
.d-input::placeholder { color: var(--d-text-dim); }
.d-input:focus {
  outline: none;
  border-color: var(--d-bronze);
  background: var(--d-surface);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}

/* ---------- chips / badges ---------- */

.d-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--d-bg-soft);
  border: 2px solid var(--d-line);
  color: var(--d-text-mute);
}
.d-chip.bronze {
  background: rgba(201, 169, 110, 0.08);
  border-color: rgba(201, 169, 110, 0.3);
  color: var(--d-bronze-hi);
}
.d-chip.iris {
  background: rgba(140, 158, 255, 0.08);
  border-color: rgba(140, 158, 255, 0.3);
  color: var(--d-iris-hi);
}
.d-chip.pos  { background: rgba(111, 223, 178, 0.08); border-color: rgba(111, 223, 178, 0.3); color: var(--d-pos); }
.d-chip.warn { background: rgba(233, 185, 100, 0.08); border-color: rgba(233, 185, 100, 0.3); color: var(--d-warn); }
.d-chip.crit { background: rgba(229, 120, 120, 0.08); border-color: rgba(229, 120, 120, 0.3); color: var(--d-crit); }

.d-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--d-bg);
  border: 2px solid var(--d-line);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  color: var(--d-text-mute);
  letter-spacing: 0;
}

/* ---------- tiles (pillar cards) ---------- */

.d-tile {
  display: block;
  padding: 28px 26px;
  border-radius: var(--d-radius-xl);
  background: var(--d-surface);
  border: 2px solid var(--d-line);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 280ms var(--ease-soft),
    transform 280ms var(--ease-soft),
    background 280ms var(--ease-soft);
}
.d-tile::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 100% 0%,
    rgba(201, 169, 110, 0.06) 0%,
    rgba(201, 169, 110, 0) 70%);
  opacity: 0;
  transition: opacity 320ms var(--ease-soft);
  pointer-events: none;
}
.d-tile:hover {
  border-color: rgba(201, 169, 110, 0.4);
  transform: translateY(-2px);
}
.d-tile:hover::before { opacity: 1; }

.d-tile-key {
  position: absolute; top: 18px; right: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--d-text-dim);
  letter-spacing: 0.1em;
}

.d-tile-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.005em;
  color: var(--d-text);
  margin: 0 0 8px;
}

.d-tile-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--d-text-mute);
  max-width: 38ch;
}

.d-tile-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.12) 0%, rgba(140, 158, 255, 0.12) 100%);
  border: 2px solid var(--d-line);
  margin-bottom: 18px;
  color: var(--d-bronze-hi);
}

/* ---------- secondary tool rail ---------- */

.d-tool {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--d-radius);
  background: var(--d-bg-soft);
  border: 2px solid var(--d-line-soft);
  color: var(--d-text);
  text-decoration: none;
  transition: all 200ms var(--ease-soft);
}
.d-tool:hover {
  border-color: rgba(140, 158, 255, 0.35);
  background: rgba(140, 158, 255, 0.04);
  color: var(--d-iris-hi);
}
.d-tool-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--d-surface);
  border: 2px solid var(--d-line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--d-iris-hi);
  flex-shrink: 0;
}
.d-tool-body { flex: 1; min-width: 0; }
.d-tool-title { font-weight: 500; font-size: 0.95rem; color: var(--d-text); }
.d-tool-desc  { font-size: 0.78rem; color: var(--d-text-dim); margin-top: 2px; }

/* ---------- health gauge ---------- */

.d-gauge {
  --val: 0;
  --size: 120px;
  --thick: 9px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background:
    conic-gradient(
      var(--gauge-col, var(--d-pos)) calc(var(--val) * 1%),
      var(--d-line-soft) calc(var(--val) * 1%)
    );
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.d-gauge::after {
  content: "";
  position: absolute; inset: var(--thick);
  border-radius: 50%;
  background: var(--d-surface);
}
.d-gauge-inner {
  position: relative; z-index: 1;
  text-align: center;
}
.d-gauge-val {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--d-text);
  line-height: 1;
}
.d-gauge-lbl {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--d-text-dim);
  margin-top: 4px;
}

/* ---------- tables ---------- */

.d-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.d-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--d-text-dim);
  padding: 12px 14px;
  border-bottom: 1px solid var(--d-line);
}
.d-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--d-line-soft);
  vertical-align: middle;
}
.d-table tbody tr:last-child td { border-bottom: none; }
.d-table tbody tr:hover { background: rgba(140, 158, 255, 0.025); }

/* ---------- progress meter ---------- */

.d-meter {
  width: 100%;
  height: 6px;
  background: var(--d-line-soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.d-meter > .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--d-bronze) 0%, var(--d-bronze-hi) 100%);
  border-radius: 999px;
  transition: width 600ms var(--ease-soft);
}
.d-meter.warn > .fill { background: linear-gradient(90deg, var(--d-warn) 0%, #f1c97f 100%); }
.d-meter.crit > .fill { background: linear-gradient(90deg, var(--d-crit) 0%, #f29494 100%); }
.d-meter.pos  > .fill { background: linear-gradient(90deg, var(--d-pos)  0%, #9aebca 100%); }

/* ---------- brand logo ----------
 *
 * The prototype mark — labyrinth + wings — lives at
 * webui/assets/brand/protologo.png as a transparent PNG (alpha extracted
 * from the source JPG via `tools/make_logo_transparent.py`).  Drops
 * cleanly onto any background, light or dark, no blend mode needed.
 */

.d-logo {
  display: inline-block;
  object-fit: contain;
  /* gentle harmonization with the bronze/iris accent palette without
     repainting — preserves silver detail, just lifts contrast a touch */
  filter: contrast(1.04) brightness(1.02);
  vertical-align: middle;
  user-select: none;
  -webkit-user-drag: none;
}

.d-logo.mark   { width: 28px;  height: 28px;  margin-right: 10px; }
.d-logo.hero   { width: 132px; height: 132px; margin: 0 auto 18px; display: block;
                 animation: d-logo-breathe 9s ease-in-out infinite; }
.d-logo.splash { width: 220px; height: 220px; display: block; margin: 0 auto; }

/* Very subtle breathing on the hero placement — slow, no glow.  Settles. */
@keyframes d-logo-breathe {
  0%, 100% { transform: scale(1);    filter: contrast(1.05) brightness(1.03); }
  50%      { transform: scale(1.018); filter: contrast(1.05) brightness(1.08); }
}

/* ---------- ornament: subtle labyrinth motif behind hero ---------- */

.d-labyrinth {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image:
    radial-gradient(circle at 50% 50%, var(--d-bronze) 0.5px, transparent 1.5px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 70%);
}

/* ---------- scrollbar ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--d-bg); }
::-webkit-scrollbar-thumb {
  background: var(--d-line);
  border-radius: 999px;
  border: 2px solid var(--d-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--d-line-soft); background-color: #3a466a; }

/* ---------- motion ---------- */

.d-fade-up {
  animation: d-fade-up 460ms var(--ease-out) both;
}
@keyframes d-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.d-fade-in {
  animation: d-fade-in 260ms var(--ease-soft) both;
}
@keyframes d-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* stagger by setting --i on children */
.d-stagger > * { animation-delay: calc(var(--i, 0) * 60ms); }

/* faint pulsing ring used on live-data + connecting states */
.d-pulse {
  position: relative;
}
.d-pulse::before {
  content: "";
  position: absolute; inset: -3px;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0.4;
  animation: d-pulse 1.8s var(--ease-soft) infinite;
}
@keyframes d-pulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ---------- utility ---------- */

.d-grid          { display: grid; gap: 18px; }
.d-grid.cols-2   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-grid.cols-3   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-grid.cols-4   { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 880px) {
  .d-grid.cols-2, .d-grid.cols-3, .d-grid.cols-4 { grid-template-columns: 1fr; }
}

.d-row     { display: flex; align-items: center; gap: 12px; }
.d-col     { display: flex; flex-direction: column; gap: 12px; }
.d-spacer  { flex: 1; }
.d-mute    { color: var(--d-text-mute); }
.d-dim     { color: var(--d-text-dim); }
.d-text-sm { font-size: 0.84rem; }
.d-text-xs { font-size: 0.74rem; }
.d-loading {
  color: var(--d-text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 48px 0;
}

/* hide things visually but keep them accessible */
.d-sr {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ====================================================================
   Hub landing page — condensed, no-scroll, brushed-steel aesthetic
   ====================================================================
   Single-screen layout used by /ui/index.html.  Cool greys + blues +
   subtle metallic sheen.  The brand emblem becomes a watermark inside
   each pillar; a slow diagonal sheen sweeps across on hover. */

body.d-hub-page {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* Ambient blue/steel wash across the whole body so the tiles sit on
     something with depth, not a flat black */
  background:
    radial-gradient(ellipse 1100px 700px at 50% -15%,
        rgba(140, 158, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 900px 500px at 50% 115%,
        rgba(201, 169, 110, 0.04) 0%, transparent 60%),
    var(--d-bg);
}

/* Faint film-grain noise everywhere — gives the dark surfaces a
   tactile, textured feel without being distracting. */
body.d-hub-page::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.6  0 0 0 0 0.65  0 0 0 0 0.75  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.d-hub-main, .d-hub-footer, #hdr { position: relative; z-index: 1; }

.d-hub-main {
  flex: 1;
  min-height: 0;
  display: grid;
  /* Hero · Pillars (flex) · Launchers · Tools */
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  padding: 18px 32px 14px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Hero strip (mark + wordmark + tagline) ───────────────────────── */
.d-hub-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 4px;
}
.d-hub-hero .d-logo.mark {
  width: 46px;
  height: 46px;
  margin: 0;
  flex-shrink: 0;
  /* slow breathing glow on the mark — barely perceptible motion */
  animation: d-mark-breath 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 10px rgba(140, 158, 255, 0.18));
}
@keyframes d-mark-breath {
  0%, 100% { filter: drop-shadow(0 2px 10px rgba(140, 158, 255, 0.18))
                     brightness(1.0); }
  50%      { filter: drop-shadow(0 2px 14px rgba(140, 158, 255, 0.28))
                     brightness(1.06); }
}
.d-hub-hero-text { display: flex; flex-direction: column; }
.d-hub-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.55rem, 2.2vw, 1.95rem);
  letter-spacing: -0.005em;
  margin: 0;
  background: linear-gradient(180deg,
      #f4f6fb 0%, #c8d0e0 70%, #9aa3ba 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.d-hub-tagline {
  margin-left: auto;
  font-size: 0.86rem;
  color: var(--d-text-mute);
  text-align: right;
  max-width: 420px;
  line-height: 1.5;
}
@media (max-width: 720px) {
  .d-hub-tagline { display: none; }
}

/* ── Pillar row — Maintenance + Diagnostics ───────────────────────── */
.d-hub-pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  min-height: 0;
}
@media (max-width: 720px) {
  .d-hub-pillars { grid-template-columns: 1fr; }
}

/* ── Launcher rectangles — Shop + Fleet ───────────────────────────── */
.d-hub-launchers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 720px) {
  .d-hub-launchers { grid-template-columns: 1fr; }
}

.d-launcher {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--d-radius-lg);
  text-decoration: none;
  color: var(--d-text);
  background:
    linear-gradient(120deg,
      rgba(26, 34, 56, 0.85) 0%,
      rgba(15, 20, 34, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.30);
  transition:
    border-color 280ms var(--ease-soft),
    transform    280ms var(--ease-soft),
    box-shadow   280ms var(--ease-soft);
}
.d-launcher::after {
  /* same metallic sheen sweep as the pillars, slightly tighter */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg,
    transparent 35%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
  transition: transform 800ms var(--ease-soft);
}
.d-launcher:hover {
  border-color: rgba(201, 169, 110, 0.45);
  transform: translateY(-2px);
  color: var(--d-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.30),
    0 6px 18px rgba(0, 0, 0, 0.30);
}
.d-launcher:hover::after { transform: translateX(110%); }

/* Per-launcher accent tint (subtle radial in the corner) */
.d-launcher[data-launcher="shop"]::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 55% 75% at 95% 50%,
      rgba(201, 169, 110, 0.10) 0%, transparent 70%);
}
.d-launcher[data-launcher="fleet"]::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 55% 75% at 5% 50%,
      rgba(111, 223, 178, 0.09) 0%, transparent 70%);
}

.d-launcher-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg,
      rgba(140, 158, 255, 0.16) 0%,
      rgba(201, 169, 110, 0.10) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: var(--d-iris-hi);
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.d-launcher-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; position: relative; z-index: 1; }
.d-launcher-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  background: linear-gradient(180deg, #f4f6fb 0%, #c8d0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.d-launcher-sub {
  font-size: 0.78rem;
  color: var(--d-text-mute);
  line-height: 1.35;
}
.d-launcher-port {
  font-size: 0.72rem;
  color: var(--d-text-dim);
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  position: relative; z-index: 1;
}

/* ── Pillar tile — the centerpiece ────────────────────────────────── */
.d-tile.compact {
  position: relative;
  isolation: isolate;        /* contain pseudo-element stacking */
  overflow: hidden;
  padding: 28px 22px;
  border-radius: var(--d-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;       /* CENTER everything horizontally */
  justify-content: center;   /* CENTER everything vertically */
  text-align: center;
  gap: 10px;

  /* Cool steel gradient — blues + greys, hint of warm */
  background:
    linear-gradient(160deg,
      #1c2440 0%,
      #161d33 45%,
      #11172a 100%);

  /* Inset depth: top-edge sheen + bottom-edge shadow */
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.25);

  transition:
    border-color 320ms var(--ease-soft),
    transform    320ms var(--ease-soft),
    box-shadow   320ms var(--ease-soft);
}

/* Pillar imagery: each tile carries its own thematic background.
   Defined in three layers via ::before — a colored accent radial,
   then a themed SVG pattern (concentric arcs / waveform / dots),
   then a vignette fade to blend it into the steel gradient. */

.d-tile.compact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-repeat: no-repeat;
  background-position: center center;
  filter: brightness(1.05);
  opacity: 0.9;
  pointer-events: none;
  transition:
    opacity 380ms var(--ease-soft),
    transform 600ms var(--ease-soft);
}

/* Default fallback (used if data-app-id doesn't match) — keep the
   brand mark as a faint watermark. */
.d-tile.compact:not([data-app-id])::before,
.d-tile.compact[data-app-id=""]::before {
  background-image: url("/ui/assets/brand/protologo.png");
  background-position: center 110%;
  background-size: 230px auto;
  filter: grayscale(1) brightness(1.4) contrast(0.95);
  opacity: 0.07;
}

/* ── Maintenance: concentric machined arcs + warm bronze accent ─── */
.d-tile.compact[data-app-id="maintenance"] {
  --tile-accent: rgba(201, 169, 110, 0.10);
}
.d-tile.compact[data-app-id="maintenance"]::before {
  background-image:
    /* concentric arcs sweeping up from below — turned-steel feel */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'><g fill='none' stroke='%23ffffff' stroke-width='1'><circle cx='200' cy='320' r='80'  stroke-opacity='0.05'/><circle cx='200' cy='320' r='120' stroke-opacity='0.045'/><circle cx='200' cy='320' r='160' stroke-opacity='0.04'/><circle cx='200' cy='320' r='200' stroke-opacity='0.035'/><circle cx='200' cy='320' r='240' stroke-opacity='0.03'/><circle cx='200' cy='320' r='280' stroke-opacity='0.022'/><circle cx='200' cy='320' r='320' stroke-opacity='0.016'/></g></svg>"),
    /* warm bronze tint, bottom-center */
    radial-gradient(ellipse 85% 70% at 50% 100%,
        var(--tile-accent) 0%, transparent 70%);
  background-position: center center, center center;
  background-size: 100% 100%, 100% 100%;
}
.d-tile.compact[data-app-id="maintenance"]:hover::before {
  transform: scale(1.04) translateY(-2px);
  opacity: 1;
}

/* ── Diagnostics: oscilloscope waveform + dashed gridlines + iris ─ */
.d-tile.compact[data-app-id="diagnostics"] {
  --tile-accent: rgba(140, 158, 255, 0.12);
}
.d-tile.compact[data-app-id="diagnostics"]::before {
  background-image:
    /* waveform trace + dashed timing grid */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'><g stroke='%23ffffff' fill='none'><line x1='0'  y1='60'  x2='400' y2='60'  stroke-opacity='0.04' stroke-dasharray='2 5'/><line x1='0'  y1='120' x2='400' y2='120' stroke-opacity='0.045' stroke-dasharray='2 5'/><line x1='0'  y1='180' x2='400' y2='180' stroke-opacity='0.04' stroke-dasharray='2 5'/></g><g stroke='%238c9eff' fill='none' stroke-width='1.2'><path d='M0,170 L40,170 L40,90 L80,90 L80,170 L130,170 L130,60 L165,60 L165,170 L210,170 L210,110 L250,110 L250,170 L300,170 L300,80 L340,80 L340,170 L400,170' stroke-opacity='0.13'/></g><g stroke='%238c9eff' fill='none' stroke-width='0.8'><path d='M0,200 Q30,180 60,200 T120,200 T180,200 T240,200 T300,200 T360,200 T420,200' stroke-opacity='0.08'/></g></svg>"),
    /* iris-blue tint, top-right where signals come in */
    radial-gradient(ellipse 75% 70% at 80% 25%,
        var(--tile-accent) 0%, transparent 65%);
  background-position: center center, center center;
  background-size: 100% 100%, 100% 100%;
}
.d-tile.compact[data-app-id="diagnostics"]:hover::before {
  transform: translateX(4px);
  opacity: 1;
}

/* ── Fleet: scattered dot constellation + cool teal accent ──────── */
.d-tile.compact[data-app-id="fleet"] {
  --tile-accent: rgba(111, 223, 178, 0.08);
}
.d-tile.compact[data-app-id="fleet"]::before {
  background-image:
    /* dots laid out like vehicles plotted on a map, with a few
       lit connections suggesting fleet links */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240'><g stroke='%236fdfb2' stroke-opacity='0.07' fill='none' stroke-width='0.8'><line x1='60'  y1='60'  x2='160' y2='110'/><line x1='160' y1='110' x2='260' y2='75'/><line x1='160' y1='110' x2='220' y2='180'/><line x1='220' y1='180' x2='330' y2='160'/></g><g fill='%23ffffff' fill-opacity='0.06'><circle cx='60'  cy='60'  r='1.6'/><circle cx='110' cy='40'  r='1.2'/><circle cx='160' cy='110' r='1.8'/><circle cx='90'  cy='160' r='1.2'/><circle cx='220' cy='180' r='1.6'/><circle cx='260' cy='75'  r='1.6'/><circle cx='300' cy='130' r='1.2'/><circle cx='330' cy='160' r='1.6'/><circle cx='370' cy='100' r='1.2'/><circle cx='40'  cy='210' r='1.2'/><circle cx='190' cy='40'  r='1.2'/></g><g fill='%236fdfb2' fill-opacity='0.18'><circle cx='160' cy='110' r='2.6'/><circle cx='220' cy='180' r='2.6'/></g></svg>"),
    /* cool teal accent in the corner */
    radial-gradient(ellipse 60% 60% at 30% 30%,
        var(--tile-accent) 0%, transparent 60%);
  background-position: center center, center center;
  background-size: 100% 100%, 100% 100%;
}
.d-tile.compact[data-app-id="fleet"]:hover::before {
  transform: scale(1.03);
  opacity: 1;
}

/* When any pillar is hovered the metallic sheen still sweeps;
   the per-tile imagery only shifts/scales slightly so it stays calm. */

/* Diagonal metallic sheen — sits on top of everything, sweeps on
   hover to suggest brushed steel catching a light. */
.d-tile.compact::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.05) 48%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.05) 52%,
    transparent 70%);
  transform: translateX(-110%);
  pointer-events: none;
  transition: transform 900ms var(--ease-soft);
}

.d-tile.compact:hover {
  border-color: rgba(140, 158, 255, 0.35);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(140, 158, 255, 0.08);
}
.d-tile.compact:hover::before {
  opacity: 0.11;
  background-position: center 95%;
}
.d-tile.compact:hover::after {
  transform: translateX(110%);
}

/* Tile content — everything centered + above the pseudo layers */
.d-tile.compact > * { position: relative; z-index: 1; }

.d-tile.compact .d-tile-icon {
  width: 52px;
  height: 52px;
  margin: 0 0 6px;
  border-radius: 12px;
  background:
    linear-gradient(135deg,
      rgba(140, 158, 255, 0.18) 0%,
      rgba(201, 169, 110, 0.10) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--d-iris-hi);
}
.d-tile.compact .d-tile-title {
  font-size: 1.32rem;
  margin: 4px 0 4px;
  background: linear-gradient(180deg,
      #f4f6fb 0%, #d4dbeb 70%, #b6bfd6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.d-tile.compact .d-tile-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--d-text-mute);
  max-width: 28ch;
  margin: 0;
}
.d-tile.compact .d-tile-key {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  color: var(--d-text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

/* ── "Coming soon" haze ────────────────────────────────────────────
   Reusable treatment for features that are visible in the UI but not
   fully wired yet.  Apply [data-coming-soon] OR the .d-coming-soon
   class to any tile / button / panel / menu item.  Effect:
     · subtle desaturation + reduced opacity (still readable)
     · "COMING SOON" badge in the top-right corner
     · pointer-events blocked on the inner content (the wrapper itself
       stays event-aware so callers can intercept the click for a toast)
     · cursor: not-allowed on hover
   Use Daedalus.markComingSoon(el) for the standard treatment;
   inline-applies the class + (optionally) intercepts clicks. */
.d-coming-soon, [data-coming-soon] {
  position: relative;
  opacity: 0.55;
  filter: grayscale(0.35);
  cursor: not-allowed !important;
  transition: opacity 160ms;
}
.d-coming-soon:hover, [data-coming-soon]:hover {
  opacity: 0.62;
}
.d-coming-soon > *, [data-coming-soon] > * {
  pointer-events: none;
}
.d-coming-soon::before, [data-coming-soon]::before {
  content: "COMING SOON";
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(201, 169, 110, 0.18);
  color: var(--d-bronze-hi, #c9a96e);
  border: 1px solid rgba(201, 169, 110, 0.35);
  pointer-events: none;
  /* Stay above tile content + pseudo layers */
  opacity: 1 !important;
  filter: none;
}
/* Inline / tool-chip variant — smaller, no badge, just dim + cursor */
.d-coming-soon-inline {
  opacity: 0.55;
  filter: grayscale(0.35);
  cursor: not-allowed !important;
}
.d-coming-soon-inline::after {
  content: " · soon";
  font-size: 0.66rem;
  opacity: 0.7;
  letter-spacing: 0.04em;
  margin-left: 4px;
  color: var(--d-bronze-hi, #c9a96e);
}

/* ── Live preview slot inside a pillar tile (Maintenance) ─────────── */
.d-tile-preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
}
.d-preview-head {
  margin-bottom: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.d-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--d-text-mute);
}
.d-preview-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-preview-val {
  color: var(--d-text);
  font-family: var(--d-mono, ui-monospace, "JetBrains Mono", monospace);
  font-size: 0.84rem;
}
.d-preview-row.d-preview-alert {
  color: var(--d-warn, #e9c46a);
}
.d-preview-row.d-preview-alert .d-preview-val {
  color: var(--d-warn, #e9c46a);
}

/* ── Tools panel ──────────────────────────────────────────────────── */
.d-hub-tools-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg,
      rgba(28, 36, 64, 0.7) 0%,
      rgba(17, 23, 42, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  border-radius: var(--d-radius-lg);
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Brushed-metal horizontal grain on the tools panel */
.d-hub-tools-panel::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 5px);
}

.d-hub-tools-header {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}
.d-hub-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}
@media (max-width: 960px) {
  .d-hub-tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .d-hub-tools-grid { grid-template-columns: repeat(2, 1fr); }
}

.d-tool-chip {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background:
    linear-gradient(180deg,
      rgba(26, 34, 56, 0.7) 0%,
      rgba(15, 20, 34, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  color: var(--d-text);
  text-decoration: none;
  transition:
    border-color 220ms var(--ease-soft),
    transform    220ms var(--ease-soft),
    box-shadow   220ms var(--ease-soft);
  min-width: 0;
}
/* Sheen on hover for chips, gentler than the pillars */
.d-tool-chip::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg,
    transparent 35%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
  transition: transform 700ms var(--ease-soft);
}
.d-tool-chip:hover {
  border-color: rgba(140, 158, 255, 0.4);
  transform: translateY(-1px);
  color: var(--d-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 4px 14px rgba(0, 0, 0, 0.25);
}
.d-tool-chip:hover::after { transform: translateX(110%); }

.d-tool-chip-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background:
    linear-gradient(135deg,
      rgba(140, 158, 255, 0.14) 0%,
      rgba(201, 169, 110, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--d-iris-hi);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.d-tool-chip-label {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}
/* Legacy key slot — chips no longer render the letter, but keep the
   rule so the .d-tool-chip-key class doesn't leak into other styles
   if someone manually re-adds it.  Hidden in case it does appear. */
.d-tool-chip-key {
  display: none;
}

/* ── Slim footer ──────────────────────────────────────────────────── */
.d-hub-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 32px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  color: var(--d-text-dim);
}

/* ── Verbose-mode toggle ─────────────────────────────────────────────
   Elements tagged [data-verbose-only] are hidden in clean mode and
   revealed only when the user enables Verbose mode in Settings.  The
   `daedalus-verbose` class is toggled on <body> by prefs.js.  Use
   `revert` not `inline` / `block` so the element regains its
   default display value (some are inline spans, some are blocks).
   ──────────────────────────────────────────────────────────────── */
[data-verbose-only] { display: none !important; }
body.daedalus-verbose [data-verbose-only] { display: revert !important; }

/* Inverse: elements that are ONLY visible in clean mode (e.g. a friendly
   summary that the verbose view replaces with raw detail). */
body.daedalus-verbose [data-clean-only] { display: none !important; }
