/*
  Matrix of Destiny · Fox constellation identity
  The reference informs hierarchy and density; the visual language belongs to this product.
*/

:root {
  --brand-void:#030718;
  --brand-night:#070d29;
  --brand-panel:#0c1234;
  --brand-panel-soft:rgba(15,21,58,.82);
  --brand-line:rgba(151,158,208,.16);
  --brand-gold:#e1b663;
  --brand-gold-bright:#ffd986;
  --brand-violet:#9b75ed;
  --brand-starlight:#f3f0ff;
  --brand-mist:#9298b8;
  --brand-danger:#e97582;
  --brand-success:#73d5b4;
  --brand-radius:12px;
}

body {
  background:
    radial-gradient(circle at 51% 17%,rgba(76,48,148,.18),transparent 31%),
    radial-gradient(circle at 85% 54%,rgba(32,58,121,.13),transparent 28%),
    linear-gradient(145deg,var(--brand-void),#050a22 48%,#07061e);
}

#stars { opacity:.68; }

/* ── Main-site navigation retained inside the matrix ─────── */
#site-shell-header {
  position:sticky;
  top:0;
  z-index:120;
  order:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  width:100%;
  min-height:64px;
  padding:8px clamp(18px,2.1vw,34px);
  border-bottom:1px solid rgba(212,175,55,.14);
  background:rgba(10,10,10,.97);
  box-shadow:0 12px 34px rgba(0,0,0,.24);
  backdrop-filter:blur(18px);
  text-align:left;
}
.site-shell-brand {
  flex:0 0 auto;
  color:#d4af37;
  font:600 22px/1 "Cormorant Garamond",serif;
  letter-spacing:.018em;
  text-decoration:none;
  transition:opacity .2s;
}
.site-shell-brand:hover { opacity:.8; }
.site-shell-nav {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:2px;
  min-width:0;
}
.site-shell-nav a {
  position:relative;
  padding:10px 9px;
  color:#a0a0a0;
  font:400 12px/1.2 Inter,sans-serif;
  text-decoration:none;
  white-space:nowrap;
  transition:color .2s;
}
.site-shell-nav a:hover { color:#f5f5f5; }
.site-shell-nav a.active { color:#d4af37; }
.site-shell-nav a.active::after {
  content:'';
  position:absolute;
  right:9px;
  bottom:1px;
  left:9px;
  height:1px;
  background:#d4af37;
}
#site-shell-menu-toggle {
  display:none;
  width:38px;
  height:38px;
  padding:9px;
  border:0;
  color:#f5f5f5;
  background:transparent;
  cursor:pointer;
}
#site-shell-menu-toggle span {
  display:block;
  width:20px;
  height:1px;
  margin:5px 0;
  background:currentColor;
  transition:transform .2s,opacity .2s;
}
#site-shell-header.site-menu-open #site-shell-menu-toggle span:nth-child(1) { transform:translateY(6px) rotate(45deg); }
#site-shell-header.site-menu-open #site-shell-menu-toggle span:nth-child(2) { opacity:0; }
#site-shell-header.site-menu-open #site-shell-menu-toggle span:nth-child(3) { transform:translateY(-6px) rotate(-45deg); }

/* ── Brand bar ───────────────────────────────────────────── */
#brand-header {
  position:sticky;
  top:64px;
  z-index:80;
  order:1;
  display:grid;
  grid-template-columns:auto minmax(440px,1fr) auto;
  align-items:center;
  gap:26px;
  min-height:74px;
  width:100%;
  padding:9px clamp(18px,2.1vw,34px);
  border-bottom:1px solid rgba(225,182,99,.18);
  background:linear-gradient(180deg,rgba(3,7,24,.97),rgba(5,9,30,.93));
  box-shadow:0 16px 44px rgba(0,0,0,.18);
  backdrop-filter:blur(18px);
  text-align:left;
}

.brand-lockup {
  display:flex;
  align-items:center;
  gap:11px;
  min-width:175px;
  color:var(--brand-starlight);
  text-decoration:none;
}
.brand-lockup img {
  width:50px;
  height:50px;
  object-fit:cover;
  border:1px solid rgba(225,182,99,.38);
  border-radius:50%;
  box-shadow:0 0 28px rgba(142,85,229,.20),inset 0 0 0 1px rgba(255,255,255,.03);
}
.brand-lockup span {
  font:600 15px/1.06 Cinzel,serif;
  letter-spacing:.035em;
  text-shadow:0 0 18px rgba(225,182,99,.16);
}

.brand-primary-nav {
  display:flex;
  align-items:stretch;
  justify-content:center;
  gap:4px;
  min-width:0;
}
.brand-primary-nav button {
  position:relative;
  min-height:44px;
  padding:8px 13px;
  border:0;
  color:rgba(221,219,239,.64);
  background:transparent;
  font:500 10px Raleway,sans-serif;
  white-space:nowrap;
  cursor:pointer;
  transition:color .18s,background .18s;
}
.brand-primary-nav button::after {
  content:'';
  position:absolute;
  right:13px;
  bottom:2px;
  left:13px;
  height:1px;
  background:var(--brand-gold);
  transform:scaleX(0);
  transform-origin:center;
  transition:transform .18s;
}
.brand-primary-nav button:hover,
.brand-primary-nav button.active { color:var(--brand-gold-bright); background:rgba(225,182,99,.035); }
.brand-primary-nav button:hover::after,
.brand-primary-nav button.active::after { transform:scaleX(1); }

.brand-header-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.brand-outline-action {
  min-height:38px;
  padding:8px 12px;
  border:1px solid rgba(155,117,237,.25);
  border-radius:9px;
  color:#cbc6e8;
  background:rgba(155,117,237,.045);
  font:600 9px Raleway,sans-serif;
  white-space:nowrap;
  cursor:pointer;
  transition:transform .18s,border-color .18s,color .18s,background .18s;
}
.brand-outline-action:hover { transform:translateY(-1px); border-color:rgba(155,117,237,.55); color:#fff; background:rgba(155,117,237,.10); }
.brand-outline-action-gold { border-color:rgba(225,182,99,.38); color:var(--brand-gold-bright); background:rgba(225,182,99,.055); }
.brand-outline-action-gold:hover { border-color:rgba(225,182,99,.7); background:rgba(225,182,99,.11); }

#brand-profile-action {
  display:flex;
  align-items:center;
  gap:8px;
  max-width:190px;
  min-height:40px;
  padding:4px 10px 4px 5px;
  border:1px solid transparent;
  border-radius:22px;
  color:#e9e5f9;
  background:rgba(255,255,255,.035);
  cursor:pointer;
}
#brand-profile-action:hover { border-color:rgba(155,117,237,.28); background:rgba(155,117,237,.07); }
#brand-profile-initial {
  display:grid;
  flex:0 0 30px;
  place-items:center;
  width:30px;
  height:30px;
  border:1px solid rgba(225,182,99,.48);
  border-radius:50%;
  color:#171024;
  background:linear-gradient(145deg,#f3d794,#aa7931);
  font:700 11px Cinzel,serif;
  box-shadow:0 0 17px rgba(225,182,99,.14);
}
#brand-header #client-display {
  min-width:0;
  overflow:hidden;
  margin:0;
  color:#d8d3ec;
  font:500 8px/1.35 Raleway,sans-serif;
  letter-spacing:0;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#brand-header #status-info-btn { display:none !important; }
body:not(.has-calculation) #brand-mentor-action,
body:not(.has-calculation) #brand-pdf-action { display:none; }

/* ── Entry and action deck ───────────────────────────────── */
#data-status { order:2; max-width:1480px; }
#mode-select,
#input-bar-single,
#input-bar-compat,
#module-nav {
  width:calc(100% - 40px) !important;
  max-width:1480px !important;
}
#mode-select {
  order:3 !important;
  margin:18px auto 0 !important;
  border-color:var(--brand-line) !important;
  background:rgba(10,16,45,.68) !important;
  box-shadow:inset 0 1px rgba(255,255,255,.025);
}
body.has-calculation:not(.edit-calculation) #mode-select,
body.has-calculation:not(.edit-calculation) #input-bar-single,
body.has-calculation:not(.edit-calculation) #input-bar-compat { display:none !important; }
#input-bar-single,
#input-bar-compat {
  order:4 !important;
  margin:10px auto 0;
  border-color:var(--brand-line);
  background:linear-gradient(135deg,rgba(10,16,45,.92),rgba(8,12,36,.92));
  box-shadow:0 15px 36px rgba(0,0,0,.13),inset 0 1px rgba(255,255,255,.025);
}
#module-nav {
  order:5 !important;
  margin:10px auto 0 !important;
  border-color:rgba(225,182,99,.20);
  background:linear-gradient(100deg,rgba(13,19,52,.96),rgba(8,13,38,.94));
}
.result-actions-intro span { color:var(--brand-gold); }
.result-action-primary { border-color:rgba(155,117,237,.36); color:#cbbaff; background:rgba(155,117,237,.07); }

/* ── Matrix dashboard ────────────────────────────────────── */
#matrix-dashboard {
  position:relative;
  z-index:10;
  order:6;
  display:grid;
  grid-template-columns:214px minmax(560px,1fr) 244px;
  gap:12px;
  width:calc(100% - 40px);
  max-width:1480px;
  margin:12px auto 0;
}
#matrix-dashboard,#full-reading,#annual-forecast-control,.reading-card { scroll-margin-top:156px; }
body:not(.has-calculation) #matrix-dashboard { display:none !important; }

.matrix-side-rail,
.matrix-insight-rail { display:flex; min-width:0; flex-direction:column; gap:10px; }
.dashboard-card {
  border:1px solid var(--brand-line);
  border-radius:var(--brand-radius);
  background:linear-gradient(145deg,rgba(14,20,55,.90),rgba(8,13,39,.86));
  box-shadow:inset 0 1px rgba(255,255,255,.025),0 12px 28px rgba(0,0,0,.11);
}
.dashboard-card-label {
  color:rgba(155,117,237,.78);
  font-size:8px;
  font-weight:600;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.dashboard-profile { padding:16px 15px 14px; }
#dashboard-birth-date { margin-top:7px; color:#b69bf4; font:500 20px Cinzel,serif; }
#dashboard-age { margin-top:9px; color:#d8d3e8; font-size:11px; }
#dashboard-profile-name { margin-top:2px; overflow:hidden; color:var(--brand-mist); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
#dashboard-edit-profile {
  margin-top:12px;
  padding:0;
  border:0;
  color:rgba(225,182,99,.82);
  background:transparent;
  font:600 8px Raleway,sans-serif;
  cursor:pointer;
}
#dashboard-edit-profile:hover { color:var(--brand-gold-bright); }

.dashboard-section-nav { padding:7px; }
.dashboard-section-nav button {
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  align-items:center;
  gap:8px;
  width:100%;
  min-height:45px;
  padding:6px 8px;
  border:1px solid transparent;
  border-radius:8px;
  color:#aeb2c9;
  background:transparent;
  font:500 9px Raleway,sans-serif;
  text-align:left;
  cursor:pointer;
  transition:background .16s,border-color .16s,color .16s;
}
.dashboard-section-nav button:hover,
.dashboard-section-nav button.active {
  border-color:rgba(155,117,237,.14);
  color:#eeeaff;
  background:linear-gradient(90deg,rgba(111,70,205,.23),rgba(111,70,205,.06));
}
.dashboard-section-extra { display:none; }
#matrix-dashboard.sections-expanded .dashboard-section-extra { display:contents; }
.dashboard-section-nav .dashboard-show-more {
  margin-top:4px;
  border-top:1px solid rgba(151,158,208,.10);
  border-radius:0 0 8px 8px;
  color:rgba(225,182,99,.78);
}
.dashboard-section-nav .dashboard-show-more:hover { color:var(--brand-gold-bright); background:rgba(225,182,99,.045); }
.dashboard-section-nav i {
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border:1px solid rgba(155,117,237,.22);
  border-radius:8px;
  color:#bfa7fa;
  background:rgba(155,117,237,.045);
  font:normal 11px Cinzel,serif;
}
.dashboard-mantra {
  position:relative;
  min-height:145px;
  overflow:hidden;
  padding:17px 15px;
}
.dashboard-mantra::after {
  content:'';
  position:absolute;
  right:-13px;
  bottom:-25px;
  width:116px;
  height:116px;
  border-radius:50%;
  background:url('assets/matrix-fox-logo.png') center/cover no-repeat;
  opacity:.28;
  filter:saturate(.8);
  -webkit-mask-image:linear-gradient(135deg,transparent 2%,#000 50%);
  mask-image:linear-gradient(135deg,transparent 2%,#000 50%);
}
.dashboard-mantra strong { display:block; max-width:120px; margin-top:11px; color:#f0e8ff; font:500 17px/1.25 Cinzel,serif; }
.dashboard-mantra p { max-width:145px; margin-top:12px; color:var(--brand-mist); font-size:8px; line-height:1.5; }

.matrix-stage {
  position:relative;
  min-width:0;
  overflow:hidden;
  border:1px solid var(--brand-line);
  border-radius:14px;
  background:
    radial-gradient(circle at 50% 48%,rgba(80,53,151,.16),transparent 37%),
    linear-gradient(155deg,rgba(8,13,40,.83),rgba(3,8,27,.70));
  box-shadow:inset 0 1px rgba(255,255,255,.025),0 18px 44px rgba(0,0,0,.16);
}
.matrix-stage::before {
  content:'';
  position:absolute;
  inset:9% 16%;
  border-radius:50%;
  background:url('assets/matrix-fox-logo.png') center/contain no-repeat;
  opacity:.025;
  pointer-events:none;
}
.matrix-stage-toolbar {
  position:relative;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:48px;
  padding:8px 13px;
  border-bottom:1px solid var(--brand-line);
  background:rgba(9,14,42,.74);
}
.matrix-stage-toolbar span { color:#d9d4eb; font:600 9px Raleway,sans-serif; letter-spacing:.035em; }
.matrix-stage-toolbar small { color:rgba(225,182,99,.74); font-size:8px; }
.matrix-stage-toolbar button {
  min-height:31px;
  padding:6px 10px;
  border:1px solid rgba(225,182,99,.28);
  border-radius:8px;
  color:var(--brand-gold-bright);
  background:rgba(225,182,99,.06);
  font:600 8px Raleway,sans-serif;
  cursor:pointer;
}
.matrix-toolbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:9px; }
.matrix-style-switcher {
  display:flex;
  align-items:center;
  gap:3px;
  padding:3px;
  border:1px solid rgba(151,158,208,.12);
  border-radius:9px;
  background:rgba(3,7,24,.48);
}
.matrix-stage-toolbar .matrix-style-switcher button {
  min-height:25px;
  padding:4px 7px;
  border-color:transparent;
  color:rgba(196,199,222,.56);
  background:transparent;
  font-size:7px;
}
.matrix-stage-toolbar .matrix-style-switcher button:hover { color:#eeeaff; background:rgba(155,117,237,.06); }
.matrix-stage-toolbar .matrix-style-switcher button.active {
  border-color:rgba(155,117,237,.30);
  color:#e2d8fb;
  background:rgba(155,117,237,.12);
  box-shadow:inset 0 1px rgba(255,255,255,.035);
}
#matrix-dashboard #matrix-wrap {
  position:relative;
  width:100%;
  max-width:none;
  margin:0;
  padding:2px clamp(8px,2vw,28px) 0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
#matrix-dashboard #msv { display:block; width:100%; max-height:760px; margin:auto; }
#matrix-dashboard #legend {
  position:relative;
  width:auto;
  max-width:none;
  margin:0 14px 13px;
  padding:9px 10px;
  border:1px solid rgba(151,158,208,.10);
  border-radius:9px;
  background:rgba(9,14,42,.48);
}
#matrix-dashboard #legend .leg-item { font-size:7px; }
#matrix-dashboard #legend .leg-item:last-child { display:none; }

/* ── Three live visual treatments for the natal wheel ────── */
body.matrix-style-cosmic .matrix-stage {
  background:
    radial-gradient(circle at 51% 43%,rgba(91,55,158,.12),transparent 32%),
    radial-gradient(circle at 38% 18%,rgba(55,97,166,.07),transparent 22%),
    radial-gradient(circle at 72% 72%,rgba(116,57,133,.06),transparent 24%),
    linear-gradient(155deg,rgba(5,10,32,.92),rgba(2,6,22,.91));
}
body.matrix-style-cosmic #matrix-dashboard #msv {
  filter:drop-shadow(0 0 42px rgba(116,83,181,.10));
}
body.matrix-style-cosmic #matrix-dashboard .ng:not(.age-node) > circle:nth-of-type(2) {
  fill:rgba(7,12,35,.88) !important;
}
body.matrix-style-cosmic #matrix-dashboard .ng:not(.age-node) > .hl { opacity:.12 !important; }
body.matrix-style-cosmic #matrix-dashboard .ng:not(.age-node) > .rg {
  stroke-width:1.35px !important;
  stroke-opacity:.82 !important;
  filter:drop-shadow(0 0 3px currentColor);
}
body.matrix-style-cosmic #matrix-dashboard .ng:not(.age-node) > .nv {
  fill:#f4f0ff !important;
  stroke:rgba(2,5,18,.92) !important;
  stroke-width:1.35px !important;
}
body.matrix-style-cosmic #matrix-dashboard .ng[data-pos="E"] > circle:nth-of-type(2),
body.matrix-style-cosmic #matrix-dashboard .ng[data-pos="B"] > circle:nth-of-type(2),
body.matrix-style-cosmic #matrix-dashboard .ng[data-pos="D"] > circle:nth-of-type(2) { fill:rgba(92,65,20,.46) !important; }
body.matrix-style-cosmic #matrix-dashboard .ng[data-pos="A"] > circle:nth-of-type(2) { fill:rgba(72,40,122,.46) !important; }
body.matrix-style-cosmic #matrix-dashboard .ng[data-pos="C"] > circle:nth-of-type(2) { fill:rgba(111,31,70,.42) !important; }
body.matrix-style-cosmic #matrix-dashboard .ng:hover { filter:brightness(1.18) drop-shadow(0 0 7px rgba(215,205,255,.22)); }
body.matrix-style-cosmic #matrix-dashboard #msv > g[fill="none"] polygon,
body.matrix-style-cosmic #matrix-dashboard #msv > g[fill="none"] line {
  stroke-width:.85px !important;
  opacity:.62;
}
body.matrix-style-cosmic #matrix-dashboard #msv > line { stroke-width:.75px !important; opacity:.58; }
body.matrix-style-cosmic #matrix-dashboard #msv > circle { opacity:.48; }

body.matrix-style-glow .matrix-stage {
  background:
    radial-gradient(circle at 50% 46%,rgba(97,53,175,.21),transparent 35%),
    radial-gradient(circle at 50% 48%,rgba(225,182,99,.035),transparent 58%),
    linear-gradient(155deg,rgba(8,12,38,.91),rgba(3,7,24,.86));
}
body.matrix-style-glow #matrix-dashboard #msv {
  filter:drop-shadow(0 0 42px rgba(155,117,237,.16)) drop-shadow(0 0 20px rgba(225,182,99,.08));
}

body.matrix-style-contour .matrix-stage {
  background:
    radial-gradient(circle at 50% 47%,rgba(225,182,99,.045),transparent 36%),
    linear-gradient(155deg,rgba(5,10,30,.96),rgba(2,5,18,.94));
}
body.matrix-style-contour #matrix-dashboard .ng:not(.age-node) > circle:nth-of-type(2) { fill:rgba(4,9,27,.92) !important; }
body.matrix-style-contour #matrix-dashboard .ng:not(.age-node) > .hl { opacity:.035 !important; }
body.matrix-style-contour #matrix-dashboard .ng:not(.age-node) > .rg {
  stroke:#c6a25f !important;
  stroke-width:1px !important;
  stroke-opacity:.72 !important;
}
body.matrix-style-contour #matrix-dashboard .ng:not(.age-node) > .nv {
  fill:#eee9fa !important;
  stroke:rgba(2,5,18,.95) !important;
  stroke-width:1.1px !important;
}
body.matrix-style-contour #matrix-dashboard .ng[data-pos="E"] > .rg,
body.matrix-style-contour #matrix-dashboard .ng[data-pos="A"] > .rg,
body.matrix-style-contour #matrix-dashboard .ng[data-pos="B"] > .rg,
body.matrix-style-contour #matrix-dashboard .ng[data-pos="C"] > .rg,
body.matrix-style-contour #matrix-dashboard .ng[data-pos="D"] > .rg { stroke:#efd080 !important; stroke-width:1.6px !important; }
body.matrix-style-contour #matrix-dashboard #msv > g[fill="none"] polygon,
body.matrix-style-contour #matrix-dashboard #msv > g[fill="none"] line,
body.matrix-style-contour #matrix-dashboard #msv > line {
  stroke:rgba(198,162,95,.44) !important;
  stroke-width:.7px !important;
  opacity:.68;
}
body.matrix-style-contour #matrix-dashboard #msv > circle { opacity:.28; }
body.matrix-style-contour #matrix-dashboard #msv { filter:drop-shadow(0 0 34px rgba(225,182,99,.07)); }

.insight-card { padding:15px; }
.insight-key-row { display:grid; grid-template-columns:58px minmax(0,1fr); gap:11px; align-items:center; margin-top:11px; }
#dashboard-key-number {
  display:grid;
  place-items:center;
  width:56px;
  height:56px;
  border:1px solid rgba(225,182,99,.72);
  border-radius:50%;
  color:#fff7df;
  background:radial-gradient(circle at 35% 30%,rgba(255,227,148,.22),rgba(135,87,14,.16) 48%,rgba(7,10,29,.76) 72%);
  box-shadow:0 0 24px rgba(225,182,99,.18),inset 0 0 18px rgba(225,182,99,.10);
  font:600 24px Cinzel,serif;
}
#dashboard-key-name { color:#f1edf9; font:600 10px Cinzel,serif; line-height:1.35; }
#dashboard-key-copy { margin-top:5px; color:var(--brand-mist); font-size:8px; line-height:1.45; }
.insight-link {
  display:inline-block;
  margin-top:13px;
  border:0;
  color:#b79af5;
  background:transparent;
  font:600 8px Raleway,sans-serif;
  cursor:pointer;
}
.insight-list { display:flex; flex-direction:column; gap:10px; margin-top:11px; }
.insight-list-item { display:grid; grid-template-columns:27px minmax(0,1fr); gap:9px; align-items:start; }
.insight-list-item i {
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border:1px solid rgba(225,182,99,.26);
  border-radius:50%;
  color:var(--brand-gold);
  background:rgba(225,182,99,.045);
  font:normal 10px Cinzel,serif;
}
.insight-list-item b { display:block; color:#e7e3f3; font-size:9px; line-height:1.35; }
.insight-list-item small { display:block; margin-top:2px; color:var(--brand-mist); font-size:7.5px; line-height:1.4; }
.growth-card .insight-list-item:nth-child(1) i { border-color:rgba(233,117,130,.35); color:#ef8a96; background:rgba(233,117,130,.05); }
.growth-card .insight-list-item:nth-child(2) i { border-color:rgba(155,117,237,.36); color:#b99bf4; }
.growth-card .insight-list-item:nth-child(3) i { border-color:rgba(115,213,180,.34); color:#80d9bc; background:rgba(115,213,180,.05); }
.period-card { margin-top:auto; }
.period-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:9px; }
#dashboard-period { color:#bca4ef; font:500 13px Cinzel,serif; }
.period-orbit {
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  border:4px solid rgba(155,117,237,.17);
  border-top-color:#b68ef4;
  border-radius:50%;
  color:#cdbaf8;
  font:600 9px Raleway,sans-serif;
}
#dashboard-period-copy { margin-top:8px; color:var(--brand-mist); font-size:8px; line-height:1.45; }

/* ── Long-form report stays generous below the dashboard ─── */
#annual-forecast-control {
  order:7 !important;
  width:calc(100% - 40px);
  max-width:1480px;
  margin:12px auto 0;
}
#full-reading {
  order:8 !important;
  width:calc(100% - 40px);
  max-width:1480px;
  margin:12px auto 0;
  border-color:var(--brand-line);
  background:linear-gradient(145deg,rgba(10,16,45,.94),rgba(7,11,33,.91));
}
#forecast-banner { order:9 !important; width:calc(100% - 40px); max-width:1480px; }
#derived { order:10 !important; width:calc(100% - 40px); max-width:1480px; }
footer { order:11 !important; }
.reading-card { border-color:var(--brand-line); background:rgba(12,18,48,.66); }
.reading-card.featured { border-color:rgba(225,182,99,.25); background:linear-gradient(135deg,rgba(225,182,99,.055),rgba(155,117,237,.038)); }

/* ── Responsive behaviour ────────────────────────────────── */
@media (max-width:1280px) {
  #site-shell-header { gap:14px; padding-inline:18px; }
  .site-shell-brand { font-size:20px; }
  .site-shell-nav a { padding-inline:7px; font-size:11px; }
  #brand-header { grid-template-columns:auto 1fr auto; gap:14px; padding-inline:18px; }
  .brand-lockup { min-width:auto; }
  .brand-primary-nav button { padding-inline:8px; font-size:9px; }
  .brand-outline-action span { display:none; }
  .brand-outline-action { width:38px; padding:7px; }
  #matrix-dashboard { grid-template-columns:190px minmax(520px,1fr) 220px; }
}

@media (max-width:1023px) {
  #site-shell-header { min-height:60px; }
  #site-shell-menu-toggle { display:block; flex:0 0 38px; }
  .site-shell-nav {
    position:absolute;
    top:100%;
    right:0;
    left:0;
    display:none;
    max-height:calc(100vh - 60px);
    overflow-y:auto;
    padding:16px 18px 22px;
    border-top:1px solid rgba(212,175,55,.12);
    border-bottom:1px solid rgba(212,175,55,.18);
    background:rgba(10,10,10,.985);
    box-shadow:0 20px 40px rgba(0,0,0,.35);
  }
  #site-shell-header.site-menu-open .site-shell-nav { display:flex; flex-direction:column; align-items:stretch; }
  .site-shell-nav a { padding:11px 4px; font-size:15px; text-align:center; }
  .site-shell-nav a.active::after { right:34%; left:34%; }
  #brand-header { top:60px; }
  #matrix-dashboard,#full-reading,#annual-forecast-control,.reading-card { scroll-margin-top:148px; }
}

@media (max-width:1060px) {
  #brand-header { grid-template-columns:auto minmax(0,1fr) auto; }
  .brand-primary-nav { justify-content:flex-start; overflow-x:auto; }
  #brand-profile-action { max-width:42px; padding-right:5px; }
  #brand-header #client-display { display:none; }
  #matrix-dashboard { grid-template-columns:185px minmax(0,1fr); }
  .matrix-insight-rail { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,1fr); }
  .period-card { margin-top:0; }
}

@media (max-width:760px) {
  #site-shell-header { min-height:58px; padding:8px 12px; }
  .site-shell-brand { font-size:20px; }
  #brand-header { position:relative; grid-template-columns:1fr auto; min-height:auto; gap:9px; padding:9px 12px; }
  .brand-lockup img { width:42px; height:42px; }
  .brand-lockup span { font-size:12px; }
  .brand-primary-nav { grid-column:1/-1; order:3; padding-top:4px; border-top:1px solid rgba(151,158,208,.10); }
  .brand-primary-nav button { flex:0 0 auto; min-height:35px; }
  .brand-header-actions { grid-column:2; grid-row:1; }
  #brand-profile-action { display:none; }
  #mode-select,#input-bar-single,#input-bar-compat,#module-nav,#matrix-dashboard,#annual-forecast-control,#full-reading,#forecast-banner,#derived { width:calc(100% - 20px) !important; }
  #matrix-dashboard { grid-template-columns:1fr; }
  .matrix-side-rail { display:grid; grid-template-columns:1fr; }
  .dashboard-section-nav { display:flex; overflow-x:auto; }
  .dashboard-section-nav button { flex:0 0 145px; }
  .dashboard-profile,.dashboard-mantra { display:none; }
  .matrix-stage { grid-row:1; }
  .matrix-insight-rail { grid-column:auto; grid-template-columns:1fr; }
  .matrix-stage-toolbar { align-items:flex-start; flex-direction:column; }
  .matrix-toolbar-actions { width:100%; align-items:flex-start; flex-direction:column; }
  .matrix-style-switcher { max-width:100%; overflow-x:auto; }
  #matrix-dashboard #matrix-wrap { padding-inline:0; }
  #matrix-dashboard #legend { display:none; }
}

@media (prefers-reduced-motion:reduce) {
  .brand-primary-nav button::after,.brand-outline-action,.dashboard-section-nav button { transition:none; }
}
