/* TKB Command theme, adapted from missionchief-toolkit-assets at
 * fc18098630d6f27efd474a3d79b3bbd6685265b5:
 * extension/current/{surface-theme,command-ui,workspace}.css.
 * Presentation only: status colours, chart series and visibility belong to
 * their components. html specificity also covers injected Control Centre CSS.
 */
html:root {
  color-scheme: dark;
  --tkb-bg: #090b0c;
  --tkb-panel: linear-gradient(125deg, #141719, #0c0e0f 70%);
  --tkb-control: linear-gradient(135deg, #171c1e, #0b0d0f);
  --tkb-border: #41484c;
  --tkb-text: #f4f5f6;
  --tkb-muted: #b3bbc2;
  --tkb-red: #ed2727;
  --tkb-selected: linear-gradient(105deg, #a51518, #350c0e);
  --tkb-depth: inset 0 1px #ffffff15, 0 4px 12px #0004;
  --bg: var(--tkb-bg);
  --bg-elevated: #101416;
  --sidebar: #0c0e0f;
  --panel: #141719;
  --panel-2: #1b2023;
  --panel-strong: #1b2023;
  --panel-soft: #101416;
  --panel-deep: #0c0e0f;
  --border: var(--tkb-border);
  --line: var(--tkb-border);
  --line-strong: #667178;
  --text: var(--tkb-text);
  --muted: var(--tkb-muted);
  --muted-strong: #dbe2e7;
  --accent: var(--tkb-red);
  --accent-strong: #ff9696;
  --accent-soft: #350c0e;
  --cc3-ink-0: var(--tkb-bg);
  --cc3-ink-1: var(--tkb-bg);
  --cc3-ink-2: #141719;
  --cc3-ink-3: #1b2023;
  --cc3-ink-4: #242b2f;
  --cc3-line: var(--tkb-border);
  --cc3-line-strong: #667178;
  --cc3-text: var(--tkb-text);
  --cc3-text-soft: #dbe2e7;
  --cc3-muted: var(--tkb-muted);
  --cc3-accent: #ff9696;
  --cc3-accent-strong: #ffb0b0;
  --cc3-accent-soft: #350c0e;
  --cc3-radius-sm: 4px;
  --cc3-radius: 6px;
  --cc3-radius-lg: 7px;
  --cc3-shadow-sm: var(--tkb-depth);
  --cc3-gutter: clamp(14px, 1.6vw, 24px);
  --auth-bg: var(--tkb-bg);
  --auth-panel: #141719;
  --auth-line: var(--tkb-border);
  --auth-text: var(--tkb-text);
  --auth-soft: #dbe2e7;
  --auth-muted: var(--tkb-muted);
  --auth-accent: #ff9696;
  --members-bg: var(--tkb-bg);
  --members-panel: #141719;
  --members-panel-strong: #1b2023;
  --members-border: var(--tkb-border);
  --members-text: var(--tkb-text);
  --members-muted: var(--tkb-muted);
  --lb-bg: var(--tkb-bg);
  --lb-panel: #141719;
  --lb-panel-strong: #1b2023;
  --lb-border: var(--tkb-border);
  --lb-text: var(--tkb-text);
  --lb-muted: var(--tkb-muted);
  --diet-bg: var(--tkb-bg);
  --diet-panel: #141719;
  --diet-panel-strong: #1b2023;
  --diet-line: var(--tkb-border);
  --diet-text: var(--tkb-text);
  --diet-muted: var(--tkb-muted);
  --void: var(--tkb-bg);
  --void-soft: #101416;
  --wb2-bg: var(--tkb-bg);
  --wb2-bg-soft: #101416;
  --wb2-panel: #141719;
  --wb2-panel-raised: #1b2023;
  --wb2-line: var(--tkb-border);
  --wb2-line-strong: #667178;
  --wb2-text: var(--tkb-text);
  --wb2-muted: var(--tkb-muted);
  --wb2-radius: 7px;
  --wb2-radius-small: 5px;
  --wb2-shadow: var(--tkb-depth);
  background: var(--tkb-bg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html body.tkb-theme {
  background: var(--tkb-bg);
  color: var(--tkb-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* Decorative layers only; renderer-owned canvases and animations stay intact. */
html body.tkb-theme::before,
html body.tkb-theme .watchboard-ambient,
html body.tkb-theme .issue-log-ambient,
html body.tkb-theme .diet-command-deck::after,
html body.tkb-theme .members-hero::before,
html body.tkb-theme .members-hero::after,
html body.tkb-theme .lb-hero::before { display: none; }

html body.tkb-theme :is(h1, h2, h3) {
  color: var(--tkb-text);
  font-family: "Arial Narrow", system-ui, sans-serif;
  letter-spacing: .045em;
  line-height: 1.3;
}
html body.tkb-theme :is(h1, h2) { text-transform: uppercase; }
html body.tkb-theme h1 { font-size: clamp(22px, 2.3vw, 30px); }
html body.tkb-theme h2 { font-size: 18px; }
html body.tkb-theme :is(.eyebrow, .members-eyebrow, .lb-eyebrow, .watchboard-kicker, .issue-log-kicker) {
  color: var(--tkb-muted);
  letter-spacing: .09em;
}

html body.tkb-theme :is(.cc-sidebar, .app-sidebar, .workspace-bar, .cc-workspace-bar,
  .cc-guide-drawer, .cc3-command-dialog, .cc3-command-results, dialog) {
  background: #101416;
  border-color: var(--tkb-border);
}
html body.tkb-theme :is(.cc-brand, .sidebar-brand) { background: transparent; min-height: 78px; }
html body.tkb-theme :is(.brand-mark, .cc-brand-mark, .members-brand-mark, .lb-brand-mark) {
  background: var(--tkb-selected);
  border: 1px solid var(--tkb-red);
  border-radius: 6px;
  color: var(--tkb-text);
  box-shadow: var(--tkb-depth);
}
html body.tkb-theme :is(.cc-nav-item, .app-sidebar .nav-item) { border-radius: 4px; min-height: 44px; }
html body.tkb-theme :is(.cc-nav-label, .nav-label) { color: var(--tkb-muted); }
html body.tkb-theme :is(.cc-nav-item[aria-current="page"], .app-sidebar .nav-item.active,
  .members-top-link.active, .lb-top-link.active, .lb-tab.active) {
  background: var(--tkb-selected);
  border-color: var(--tkb-red);
  color: #fff;
  box-shadow: inset 3px 0 #ff3535;
}
html body.tkb-theme :is(.cc-nav-item[aria-current="page"] .cc-nav-icon,
  .app-sidebar .nav-item.active > svg, .app-sidebar .nav-item.active .cc-nav-icon) {
  background: #ffffff0a;
  border-color: #ffffff30;
  color: #fff;
}

html body.tkb-theme :is(.card, .executive-panel, .feature-panel, .github-hub-card,
  .github-hub-table-card, .monitor-form-panel, .monitor-inventory-panel,
  .monitor-alert-panel, .watchboard-admin-panel, .monitor-evidence-panel,
  .executive-metric, .metric-card, .feature-stat, .auth-card,
  .members-hero, .members-control-deck, .member-card, .members-stat,
  .members-state, .members-privacy-note, .lb-hero, .lb-panel, .lb-board,
  .lb-podium-card, .lb-profile-hero, .lb-kpi, .lb-badge,
  .diet-panel, .diet-kpi, .diet-command-deck, .diet-setup, .diet-loading,
  .watchboard-header, .watchboard-summary-card, .watchboard-primary-services,
  .watchboard-lock-panel, .issue-log-header, .issue-log-panel, .issue-log-summary > article) {
  background: var(--tkb-panel);
  border-color: var(--tkb-border);
  border-radius: 6px;
  box-shadow: var(--tkb-depth);
}
html body.tkb-theme :is(.section-head, .cc-page-intro, .feature-workspace-hero, .executive-hero) {
  background: var(--tkb-panel);
  border: 1px solid var(--tkb-border);
  border-top: 2px solid var(--tkb-red);
  border-radius: 7px;
  padding: clamp(14px, 1.8vw, 22px);
  box-shadow: var(--tkb-depth);
}
html body.tkb-theme :is(.members-hero, .lb-hero, .diet-command-deck, .auth-card, .watchboard-header) {
  border-top: 2px solid var(--tkb-red);
}
html body.tkb-theme :is(.members-hero, .lb-hero, .diet-command-deck) { padding: clamp(18px, 2.5vw, 30px); }
html body.tkb-theme .auth-card { padding: 28px 24px; }
html body.tkb-theme .auth-card::after { color: var(--tkb-muted); }
html body.tkb-theme .watchboard-header::before { background: var(--tkb-red); }
html body.tkb-theme :is(.members-hero h1, .lb-hero h1, .diet-header h1, .lb-profile-name h1) {
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: .025em;
  line-height: 1.2;
}

/* Controls keep native semantics and component-owned dimensions/layout. */
html body.tkb-theme :is(button, .members-top-link, .lb-top-link, .button-link) {
  min-height: 40px;
  border: 1px solid #495258;
  border-radius: 4px;
  background: var(--tkb-control);
  color: var(--tkb-text);
  box-shadow: inset 0 1px #ffffff0a;
  font: inherit;
}
html body.tkb-theme :is(button.primary, a.primary, .auth-card button.primary) {
  background: var(--tkb-selected);
  color: #fff;
  border-color: var(--tkb-red);
}
html body.tkb-theme :is(button.danger, .danger-outline) {
  background: #3b1823;
  border-color: #ff8792;
  color: #ffbcc3;
}
html body.tkb-theme :is(button, .members-top-link, .lb-top-link):hover:not(:disabled) {
  border-color: #a6b0b7;
  filter: none;
  transform: none;
}
html body.tkb-theme :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  background: #101416;
  color: var(--tkb-text);
  border: 1px solid #667178;
  border-radius: 4px;
  min-height: 40px;
  font: inherit;
}
html body.tkb-theme :is(input, textarea)::placeholder { color: var(--tkb-muted); }
html body.tkb-theme :is(input[type="checkbox"], input[type="radio"], progress) { accent-color: var(--tkb-red); }
html body.tkb-theme :focus-visible {
  outline: 2px solid #eef3f5;
  outline-offset: 3px;
}
html body.tkb-theme :is(input, select, textarea):focus {
  border-color: #a6b0b7;
  box-shadow: none;
}
html body.tkb-theme button:disabled { opacity: .45; cursor: not-allowed; }
html body.tkb-theme :is(code, pre, .operations-log) { background: #0c0e0f; color: #dbe2e7; border-color: var(--tkb-border); }
html body.tkb-theme th { background: #101416; color: #e5ebef; }

html body.tkb-theme :is(.member-kpi, .member-details, .member-profile-item,
  .members-chip, .member-game:not(.active), .lb-stat, .diet-section-nav,
  .diet-momentum-card, .diet-data-drawer, .diet-source-card,
  .diet-logging-summary article, .diet-activity-kpis article,
  .watchboard-category, .watchboard-monitor, .watchboard-deck-bar,
  .watchboard-footer, .core-panel, .core-card) {
  background: #101416;
  border-radius: 6px;
}
html body.tkb-theme :is(.member-avatar-fallback, .lb-avatar-fallback) {
  background: var(--tkb-control);
  border-color: var(--tkb-border);
}
html body.tkb-theme :is(.members-stat small, .member-details summary, .lb-stat small,
  .watchboard-primary-header > span, .watchboard-supporting-heading > span) { color: var(--tkb-muted); }
html body.tkb-theme .diet-section-nav a:first-child {
  background: var(--tkb-selected);
  color: #fff;
  box-shadow: inset 3px 0 var(--tkb-red);
}
html body.tkb-theme .diet-chart-controls button.active {
  background: var(--tkb-selected);
  color: #fff;
  border-color: var(--tkb-red);
}
/* The authenticated sidebar reduces available width below viewport breakpoints. */
html body.tkb-theme .diet-focus-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html body.tkb-theme .diet-command-deck {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  gap: 16px;
}
html body.tkb-theme .diet-command-deck::before { display: none; }
html body.tkb-theme .diet-hero-topline { flex-wrap: wrap; }
html body.tkb-theme .diet-loss-lockup strong { font-size: clamp(48px, 5vw, 76px); }
html body.tkb-theme [data-weight-range].active {
  background: var(--tkb-selected);
  border-color: var(--tkb-red);
  color: #fff;
}
html body.tkb-theme :is(.auth-orientation, .cc-page-guide-summary) {
  background: #101416;
  border: 1px solid var(--tkb-border);
  border-radius: 6px;
}
html body.tkb-theme .auth-orientation li::before {
  background: #350c0e;
  color: #ffb0b0;
  border-radius: 4px;
}
/* Inline emphasis must remain in the sentence, not become another grid cell. */
html body.tkb-theme .auth-orientation.compact li {
  position: relative;
  display: block;
  padding-inline-start: 37px;
  min-height: 28px;
}
html body.tkb-theme .auth-orientation.compact li::before {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
}
html body.tkb-theme .auth-card :focus-visible {
  outline: 2px solid #eef3f5;
  outline-offset: 3px;
}
html body.tkb-theme :is(.cc-nav-item, .app-sidebar .nav-item):not(.active):not([aria-current="page"]) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
html body.tkb-theme .executive-hero::before { display: none; }
html body.tkb-theme .executive-hero.posture-healthy { border-color: #246e5d; }
html body.tkb-theme .executive-hero.posture-attention { border-color: #735323; }
html body.tkb-theme .executive-hero.posture-critical { border-color: #743449; }
html body.tkb-theme :is(.workspace-bar, .cc-workspace-bar) { flex-wrap: wrap; gap: 12px; }
html body.tkb-theme :is(.workspace-status, .cc-workspace-actions) { flex-wrap: wrap; }
@media (max-width: 1100px) {
  html body.tkb-theme .diet-focus-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Always outrank grid/flex panel rules, including authenticated shell styles. */
html body.tkb-theme [hidden] { display: none !important; }

@media (pointer: coarse) {
  html body.tkb-theme :is(button, input:not([type="checkbox"]):not([type="radio"]), select,
    summary, .members-top-link, .lb-top-link) { min-height: 44px; }
}
@media (max-width: 600px) {
  html body.tkb-theme :is(.members-topbar, .lb-topbar) { flex-wrap: wrap; }
  html body.tkb-theme :is(.members-top-links, .lb-top-links) { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html body.tkb-theme *, html body.tkb-theme *::before, html body.tkb-theme *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
