:root {
    --bg: #060a0e; --bg-deep: #030609; --deep: #030609;
    --panel: rgba(6,16,22,.92); --panel-solid: #08151c; --panel-soft: rgba(10,28,36,.76); --panel-2: #0b1b23;
    --line: #315761; --line-soft: rgba(79,139,151,.28); --soft: rgba(79,139,151,.28);
    --teal: #39d8c5; --teal-bright: #a8fff3; --teal-light: #b8fff5; --teal2: #b8fff5;
    --orange: #ff6a1a; --ember: #ffb057; --text: #f4f7f7; --muted: #82939c;
    --success: #6ce6a8; --warning: #ffd166; --danger: #ff766c;
  }
  html[data-theme="command-center"] {
    --bg: #04090d; --bg-deep: #020608; --deep: #020608;
    --panel: rgba(3,15,20,.91); --panel-solid: #06141a; --panel-soft: rgba(6,23,29,.78); --panel-2: #071820;
    --line: #2c6570; --line-soft: rgba(69,146,158,.34); --soft: rgba(69,146,158,.34);
    --teal: #42d8d2; --teal-bright: #b9fff9; --teal-light: #b9fff9; --teal2: #b9fff9;
    --orange: #ff6818; --ember: #ffb04f; --text: #f2f5f4; --muted: #82939a;
  }
  html[data-theme="wasteland-ember"] {
    --bg: #0d0806; --bg-deep: #050302; --deep: #050302;
    --panel: rgba(31, 16, 10, .94); --panel-solid: #211008; --panel-soft: rgba(43, 23, 14, .84); --panel-2: #29150c;
    --line: #855039; --line-soft: rgba(160, 87, 51, .34); --soft: rgba(160, 87, 51, .34);
    --teal: #ff8a42; --teal-bright: #ffe1c2; --teal-light: #ffe1c2; --teal2: #ffe1c2;
    --orange: #e24727; --ember: #ffc06e; --text: #fff6ed; --muted: #b79b8b;
    --success: #9ee57d; --warning: #ffd166; --danger: #ff796f;
  }
  html[data-theme="moonlit-elegy"] {
    --bg: #080817; --bg-deep: #03030b; --deep: #03030b;
    --panel: rgba(17, 16, 42, .94); --panel-solid: #12112d; --panel-soft: rgba(28, 25, 62, .82); --panel-2: #18163b;
    --line: #5d568c; --line-soft: rgba(112, 101, 169, .34); --soft: rgba(112, 101, 169, .34);
    --teal: #a89cff; --teal-bright: #eeeaff; --teal-light: #eeeaff; --teal2: #eeeaff;
    --orange: #d27bff; --ember: #f3b4ff; --text: #f7f5ff; --muted: #a8a3c5;
    --success: #83e7c6; --warning: #ffe18a; --danger: #ff829e;
  }
  html[data-theme="high-contrast"] {
    --bg: #000; --bg-deep: #000; --deep: #000;
    --panel: #050505; --panel-solid: #050505; --panel-soft: #090909; --panel-2: #0a0a0a;
    --line: #fff; --line-soft: rgba(255,255,255,.74); --soft: rgba(255,255,255,.74);
    --teal: #00fff0; --teal-bright: #fff; --teal-light: #fff; --teal2: #fff;
    --orange: #ffdf00; --ember: #ffdf00; --text: #fff; --muted: #e2e2e2;
    --success: #76ff7a; --warning: #ffdf00; --danger: #ff6d6d;
  }
  html[data-theme="command-center"] body {
    background: radial-gradient(circle at 66% -12%, rgba(54,187,183,.09), transparent 32rem), #04090d !important;
  }
  html[data-theme="command-center"] header {
    border-bottom-color: rgba(62,139,151,.36) !important;
    background: rgba(2,7,10,.96) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
  }
  html[data-theme="command-center"] .hero {
    min-height: 900px;
    background-position: center, center, center;
    background-size: auto, auto, cover;
    box-shadow: inset 0 -150px 120px -90px rgba(0,0,0,.92);
  }
  html[data-theme="command-center"] .hero-grid {
    min-height: 590px;
    grid-template-columns: minmax(0,1.36fr) minmax(390px,.74fr);
    gap: clamp(42px,6vw,94px);
    padding: 64px 0 32px;
  }
  html[data-theme="command-center"] .hero-copy { max-width: 820px; }
  html[data-theme="command-center"] h1 {
    max-width: 820px;
    font-size: clamp(4rem,7.2vw,7rem);
    line-height: .9;
    text-shadow: 0 4px 26px rgba(0,0,0,.8);
  }
  html[data-theme="command-center"] .hero-sub,
  html[data-theme="command-center"] .hero-copy > .source-note,
  html[data-theme="command-center"] .secondary-button { display: none; }
  html[data-theme="command-center"] .primary-button {
    min-width: 380px;
    min-height: 66px;
    border-radius: 2px;
    clip-path: polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px);
    font-size: 1.35rem;
  }
  html[data-theme="command-center"] .intel-panel,
  html[data-theme="command-center"] .intel-card,
  html[data-theme="command-center"] .quick-card { border-radius: 2px; }
  html[data-theme="command-center"] .intel-panel {
    padding: 25px;
    border-color: rgba(67,143,155,.74);
    background: rgba(2,14,19,.87);
    box-shadow: 0 28px 58px rgba(0,0,0,.46), inset 0 0 42px rgba(57,216,197,.035);
  }
  html[data-theme="command-center"] .intel-panel::after,
  html[data-theme="command-center"] .quick-card::after {
    position: absolute;
    inset: 8px;
    background:
      linear-gradient(var(--teal),var(--teal)) left top / 20px 1px no-repeat,
      linear-gradient(var(--teal),var(--teal)) left top / 1px 20px no-repeat,
      linear-gradient(var(--teal),var(--teal)) right bottom / 20px 1px no-repeat,
      linear-gradient(var(--teal),var(--teal)) right bottom / 1px 20px no-repeat;
    content: "";
    opacity: .5;
    pointer-events: none;
  }
  html[data-theme="command-center"] .intel-card {
    min-height: 110px;
    border-color: rgba(69,145,158,.55);
    background: linear-gradient(110deg,rgba(4,24,29,.78),rgba(1,10,14,.82));
  }
  html[data-theme="command-center"] .quick-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 18px;
    padding-bottom: 26px;
  }
  html[data-theme="command-center"] .quick-card:nth-child(n+4) { display: none; }
  html[data-theme="command-center"] .quick-card {
    position: relative;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto minmax(38px,1fr) auto;
    align-items: center;
    min-height: 220px;
    padding: 30px;
    overflow: hidden;
    border-color: rgba(73,147,159,.64);
    background:
      radial-gradient(circle at 68% 46%,rgba(53,150,156,.1),transparent 42%),
      linear-gradient(135deg,rgba(4,18,23,.94),rgba(2,10,14,.88));
  }
  html[data-theme="command-center"] .quick-card .tool-icon {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    border-radius: 2px;
  }
  html[data-theme="command-center"] .quick-card > span:nth-child(2) {
    grid-column: 1 / 3;
    grid-row: 3;
    align-self: end;
  }
  html[data-theme="command-center"] .quick-card > .arrow {
    grid-column: 3;
    grid-row: 3;
    align-self: end;
  }
  html[data-theme="command-center"] .quick-card h3 { font-size: clamp(1.7rem,2.6vw,2.3rem); }
  html[data-theme="command-center"] .quick-card p { display: none; }
  html[data-theme="wasteland-ember"] body {
    background: radial-gradient(circle at 72% -10%, rgba(255, 116, 45, .12), transparent 34rem), radial-gradient(circle at 0 72%, rgba(167, 43, 23, .09), transparent 30rem), var(--bg) !important;
  }
  html[data-theme="moonlit-elegy"] body {
    background: radial-gradient(circle at 74% -10%, rgba(153, 130, 255, .16), transparent 35rem), radial-gradient(circle at 0 80%, rgba(202, 98, 255, .08), transparent 32rem), var(--bg) !important;
  }
  html[data-theme="high-contrast"] body { background: #000 !important; font-size: 112%; }
  html[data-theme="wasteland-ember"] header { background: rgba(12, 6, 3, .96) !important; }
  html[data-theme="moonlit-elegy"] header { background: rgba(5, 4, 18, .96) !important; }
  html[data-theme="high-contrast"] header { background: #000 !important; border-color: #fff !important; }
  html[data-theme="high-contrast"] .panel,
  html[data-theme="high-contrast"] .glass-panel,
  html[data-theme="high-contrast"] .intel-card,
  html[data-theme="high-contrast"] .quick-card,
  html[data-theme="high-contrast"] .hero-card,
  html[data-theme="high-contrast"] .guide-card,
  html[data-theme="high-contrast"] .stat-card { border-width: 2px !important; box-shadow: none !important; }
  .theme-picker {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 8px 6px 11px;
    border: 1px solid var(--line, #315761); border-radius: 10px; background: var(--panel, rgba(7,21,28,.96));
    color: var(--muted, #8ea2a9); font: 800 .68rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
    letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 14px 38px rgba(0,0,0,.28);
  }
  .theme-picker select {
    width: auto; min-width: 142px; min-height: 32px; padding: 0 30px 0 9px;
    border: 1px solid var(--line, #315761); border-radius: 7px; background: var(--bg-deep, #030609);
    color: var(--text, #f4f7f7); font: 750 .72rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  }
  .theme-picker.floating { position: fixed; z-index: 95; right: 18px; bottom: 18px; }
  .theme-profile-note { margin: 7px 0 0; color: var(--muted, #8ea2a9); font-size: .66rem; line-height: 1.45; }
  .support-widget-launcher {
    position: fixed; z-index: 102; right: 18px; bottom: 76px;
    display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 17px 6px 7px;
    border: 1px solid color-mix(in srgb, var(--orange, #ff6a1a) 76%, white 8%);
    border-radius: 3px; background: linear-gradient(120deg, rgba(255,106,26,.96), rgba(181,57,10,.96));
    color: #fff; cursor: pointer; box-shadow: 0 16px 42px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.16);
    clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
    font: 900 .72rem/1 Inter,ui-sans-serif,system-ui,sans-serif; letter-spacing: .09em; text-transform: uppercase;
  }
  .support-widget-launcher:hover { filter: brightness(1.08); transform: translateY(-1px); }
  .support-widget-launcher:focus-visible,
  .support-widget-close:focus-visible,
  .support-widget-cta:focus-visible { outline: 3px solid var(--teal-bright, #a8fff3); outline-offset: 3px; }
  .support-widget-signal {
    display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
    border: 1px solid rgba(255,255,255,.46); background: rgba(0,0,0,.18); color: #fff;
    font-size: 1rem; box-shadow: inset 0 0 16px rgba(255,255,255,.06);
  }
  .support-widget-panel {
    position: fixed; z-index: 103; right: 18px; bottom: 136px; width: min(390px,calc(100vw - 36px));
    max-height: calc(100vh - 160px); overflow: auto; padding: 24px;
    border: 1px solid var(--line, #315761); border-radius: 3px;
    background:
      radial-gradient(circle at 90% 4%,color-mix(in srgb,var(--teal, #39d8c5) 13%,transparent),transparent 42%),
      linear-gradient(145deg,var(--panel-solid, #08151c),var(--bg-deep, #030609));
    color: var(--text, #f4f7f7); box-shadow: 0 26px 72px rgba(0,0,0,.62), inset 0 0 42px rgba(57,216,197,.025);
    clip-path: polygon(12px 0,100% 0,100% calc(100% - 12px),calc(100% - 12px) 100%,0 100%,0 12px);
  }
  .support-widget-panel[hidden] { display: none !important; }
  .support-widget-panel::before {
    position: absolute; inset: 8px; content: ""; pointer-events: none; opacity: .74;
    background:
      linear-gradient(var(--teal, #39d8c5),var(--teal, #39d8c5)) left top / 28px 1px no-repeat,
      linear-gradient(var(--teal, #39d8c5),var(--teal, #39d8c5)) left top / 1px 28px no-repeat,
      linear-gradient(var(--orange, #ff6a1a),var(--orange, #ff6a1a)) right bottom / 28px 1px no-repeat,
      linear-gradient(var(--orange, #ff6a1a),var(--orange, #ff6a1a)) right bottom / 1px 28px no-repeat;
  }
  .support-widget-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .support-widget-kicker { margin: 0; color: var(--teal-bright, #a8fff3); font: 900 .61rem/1.2 Inter,ui-sans-serif,system-ui,sans-serif; letter-spacing: .18em; text-transform: uppercase; }
  .support-widget-live { color: var(--ember, #ffb057); }
  .support-widget-live::before { content: "•"; margin-right: 5px; color: var(--orange, #ff6a1a); }
  .support-widget-close {
    display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; padding: 0;
    border: 1px solid var(--line, #315761); border-radius: 2px; background: rgba(0,0,0,.2); color: var(--text, #f4f7f7);
    cursor: pointer; font: 500 1.2rem/1 Arial,sans-serif;
  }
  .support-widget-panel h2 { position: relative; margin: 22px 0 9px; color: var(--text, #f4f7f7); font: 900 1.8rem/.94 "Arial Narrow",Impact,sans-serif; letter-spacing: .02em; text-transform: uppercase; }
  .support-widget-copy { position: relative; margin: 0; color: var(--muted, #82939c); font: 600 .76rem/1.6 Inter,ui-sans-serif,system-ui,sans-serif; }
  .support-widget-status {
    position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0;
  }
  .support-widget-status span { padding: 9px 10px; border: 1px solid var(--line-soft, rgba(79,139,151,.28)); background: rgba(0,0,0,.18); color: var(--muted, #82939c); font: 800 .56rem/1.2 Inter,ui-sans-serif,system-ui,sans-serif; letter-spacing: .08em; text-transform: uppercase; }
  .support-widget-status b { display: block; margin-top: 4px; color: var(--teal-bright, #a8fff3); font-size: .67rem; }
  .support-widget-cta {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 0 16px;
    border: 1px solid color-mix(in srgb,var(--orange, #ff6a1a) 75%,white 8%); border-radius: 2px;
    background: linear-gradient(120deg,color-mix(in srgb,var(--orange, #ff6a1a) 88%,#000),color-mix(in srgb,var(--orange, #ff6a1a) 56%,#411408));
    color: #fff !important; text-decoration: none; font: 900 .72rem/1 Inter,ui-sans-serif,system-ui,sans-serif; letter-spacing: .08em; text-transform: uppercase;
  }
  .support-widget-cta:hover { filter: brightness(1.1); }
  .support-widget-note { position: relative; display: block; margin-top: 12px; color: var(--muted, #82939c); font: 600 .59rem/1.45 Inter,ui-sans-serif,system-ui,sans-serif; }
  @media (max-width: 620px) {
    .theme-picker.floating { right: 10px; bottom: 10px; }
    .theme-picker.floating > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
    .theme-picker select { min-width: 126px; }
    .support-widget-launcher { right: 10px; bottom: 66px; min-height: 44px; padding-right: 13px; }
    .support-widget-launcher > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
    .support-widget-panel { right: 10px; bottom: 122px; width: calc(100vw - 20px); max-height: calc(100vh - 142px); padding: 21px; }
    .support-widget-panel h2 { font-size: 1.55rem; }
  }
  @media (max-width: 1050px) {
    html[data-theme="command-center"] .hero { min-height: auto; }
    html[data-theme="command-center"] .hero-grid { min-height: auto; grid-template-columns: 1fr; }
    html[data-theme="command-center"] .quick-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 620px) {
    html[data-theme="command-center"] h1 { font-size: clamp(3.15rem,16vw,4.7rem); }
    html[data-theme="command-center"] .primary-button { width: 100%; min-width: 0; font-size: 1.08rem; }
    html[data-theme="command-center"] .quick-card { min-height: 174px; }
  }
