:root {
  --crust: #181926;
  --mantle: #1e2030;
  --base: #24273a;
  --surface0: #363a4f;
  --surface1: #494d64;
  --text: #cad3f5;
  --subtext: #a5adcb;
  --lavender: #b7bdf8;
  --blue: #8aadf4;
  --sapphire: #7dc4e4;
  --sky: #91d7e3;
  --teal: #8bd5ca;
  --green: #a6da95;
  --yellow: #eed49f;
  --peach: #f5a97f;
  --red: #ed8796;
  --pink: #f5bde6;
  --mauve: #c6a0f6;
  --outline: #0f111b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(145, 215, 227, 0.15) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(198, 160, 246, 0.15) 0 1px, transparent 1px), var(--crust);
  background-size: 12px 12px, 16px 16px, auto;
  padding: 1.2rem;
}

.panel {
  border: 3px solid var(--outline);
  border-radius: 14px;
  background: var(--base);
  box-shadow: 8px 8px 0 var(--outline);
}

.banner {
  padding: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}
/* Banner text block takes all available width before user-badge */
.banner > p, .banner > h1 {
  flex-basis: 100%;
}

.banner h1 {
  margin: 0.2rem 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
  letter-spacing: 0.06em;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--outline);
}

.subtitle {
  margin: 0;
  color: var(--sky);
  font-weight: 700;
}

.tagline,
.mvp-note {
  margin: 0.35rem 0;
  color: var(--subtext);
}

.main-nav {
  padding: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.nav-btn,
button {
  border: 3px solid var(--outline);
  border-radius: 12px;
  background: var(--blue);
  color: var(--crust);
  font-weight: 800;
  padding: 0.55rem 0.8rem;
  box-shadow: 4px 4px 0 var(--outline);
  cursor: pointer;
}

.nav-btn.active {
  background: var(--yellow);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.grid {
  display: grid;
  gap: 0.8rem;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── Mission Control ── */

.mc-feed-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 0.8rem 0;
}

.feed-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--lavender);
}

.heroes-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.status-chip {
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--outline);
  cursor: pointer;
  transition: transform 0.08s;
}

.status-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--outline);
}

.section-label {
  margin: 1rem 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtext);
}

.compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.compact-list li {
  font-size: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ── Heroes layout ── */

.heroes-intro {
  color: var(--subtext);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}

.heroes-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.8rem;
  align-items: start;
}

.heroes-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem;
}

.hero-nav-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.6rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: none;
  cursor: pointer;
}

.hero-nav-btn:hover {
  background: var(--surface0);
  border-color: var(--outline);
}

.hero-nav-active {
  background: var(--surface1) !important;
  border-color: var(--outline) !important;
  box-shadow: 3px 3px 0 var(--outline);
}

.hero-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--outline);
  flex-shrink: 0;
}

.hero-detail-panel {
  padding: 1rem;
}

.hero-detail-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.hero-detail-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

/* ── Hero tabs ── */

.hero-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--surface1);
  padding-bottom: 0.5rem;
  margin-bottom: 0.8rem;
}

.hero-tab {
  border: 2px solid var(--surface1);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  background: var(--surface0);
  color: var(--subtext);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  box-shadow: none;
  cursor: pointer;
}

.hero-tab.active {
  background: var(--base);
  color: var(--text);
  border-color: var(--outline);
}

.tab-count {
  background: var(--surface1);
  border-radius: 999px;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.hero-tab-pane {
  display: none;
}

.hero-tab-pane.active {
  display: block;
}

.hero-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0.6rem 0;
}

.hero-dl dt {
  color: var(--subtext);
  font-size: 0.85rem;
}

.hero-dl dd {
  margin: 0;
  font-size: 0.9rem;
}

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.kpi-pill {
  border: 2px solid var(--outline);
  border-radius: 10px;
  background: var(--surface0);
  padding: 0.35rem 0.6rem;
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  box-shadow: 3px 3px 0 var(--outline);
}

.kpi-pill-label {
  color: var(--subtext);
  font-size: 0.75rem;
}

.kpi-pill-value {
  color: var(--teal);
  font-weight: 700;
}

.doc-link {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  margin-top: 0.5rem;
  box-shadow: 4px 4px 0 var(--outline);
}

.doc-link:hover {
  background: var(--surface0);
}

/* ── Feed items (heroes tabs + news flash) ── */

.feed-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface0);
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-item-header {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.3rem;
}

/* ── News Flash page ── */

.news-topic-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
}

.news-type-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.news-aux-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.aux-select {
  width: auto;
  min-width: 160px;
}

.aux-search {
  flex: 1;
  min-width: 180px;
}

.topic-pill,
.type-pill {
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface0);
  color: var(--text);
  box-shadow: 2px 2px 0 var(--outline);
  cursor: pointer;
}

.topic-pill.active {
  background: var(--mauve);
  color: var(--crust);
}

.type-pill.active {
  background: var(--blue);
  color: var(--crust);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.feed-entry {
  padding: 0.85rem;
}

.feed-entry-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.feed-date {
  margin-left: auto;
}

.feed-entry-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.feed-entry-summary {
  margin: 0 0 0.5rem;
  color: var(--subtext);
  font-size: 0.9rem;
}

.feed-entry-details summary {
  font-size: 0.85rem;
  color: var(--blue);
  cursor: pointer;
}

.feed-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 0.8rem;
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
}

.feed-dl dt {
  color: var(--subtext);
}

.feed-dl dd {
  margin: 0;
}

.no-results {
  padding: 1.5rem;
  text-align: center;
}

/* ── Chips ── */

.chip {
  display: inline-block;
  border: 1.5px solid var(--outline);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.chip-announcement { background: var(--blue);   color: var(--crust); }
.chip-changelog    { background: var(--teal);   color: var(--crust); }
.chip-roadmap      { background: var(--mauve);  color: var(--crust); }
.chip-incident     { background: var(--red);    color: var(--crust); }
.chip-topic        { background: var(--surface1); color: var(--text); }

.chip-priority-high   { background: var(--red);    color: var(--crust); }
.chip-priority-medium { background: var(--yellow); color: var(--crust); }
.chip-priority-low    { background: var(--green);  color: var(--crust); }

/* ── Control Room tabs ── */

.cr-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--surface1);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.cr-pane {
  display: none;
}

.cr-pane.active {
  display: block;
}

/* ── Manage Heroes grid ── */

.heroes-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem;
}

.manage-hero-card {
  padding: 0.8rem;
}

.manage-hero-name {
  font-weight: 800;
  margin-bottom: 0.15rem;
}

.manage-hero-meta {
  font-size: 0.8rem;
  color: var(--subtext);
  margin-bottom: 0.6rem;
}

.status-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.status-pick-btn {
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--outline);
  cursor: pointer;
  opacity: 0.45;
}

.status-pick-btn.active {
  opacity: 1;
  box-shadow: 3px 3px 0 var(--outline);
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid var(--outline);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--surface0);
  color: var(--text);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

label {
  font-size: 0.9rem;
  color: var(--subtext);
  display: block;
  margin-bottom: 0.3rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.sticker {
  background: var(--peach);
}

.kpi-card,
.hero-card,
.feed-card,
.form-panel,
.preview-panel {
  padding: 0.85rem;
}

.status-badge {
  display: inline-block;
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-new          { background: var(--mauve);  color: var(--crust); }
.status-healthy      { background: var(--green);  color: var(--crust); }
.status-watch        { background: var(--yellow); color: var(--crust); }
.status-deprecated   { background: var(--surface1); color: var(--subtext); }

/* legacy aliases kept for chips */
.healthy    { background: var(--green);  color: var(--crust); }
.watch      { background: var(--yellow); color: var(--crust); }

.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.8rem;
}

.preview-box {
  white-space: pre-wrap;
  background: var(--mantle);
  border: 2px dashed var(--mauve);
  border-radius: 10px;
  padding: 0.8rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--subtext);
}

.kpi-callout {
  margin: 0;
  color: var(--pink);
  font-weight: 900;
}

.kpi-value {
  margin: 0.5rem 0 0;
  color: var(--teal);
  font-size: 1.5rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .heroes-layout {
    grid-template-columns: 1fr;
  }
  .heroes-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .mc-feed-row {
    grid-template-columns: 1fr;
  }
  .split {
    grid-template-columns: 1fr;
  }
}

/* -- Status badges � full model -- */
.status-healthy    { background: var(--green);  color: #1a1a2e; }
.status-new        { background: var(--sky);    color: #1a1a2e; }
.status-attention  { background: var(--yellow); color: #1a1a2e; }
.status-critical   { background: var(--red);    color: #fff;    }
.status-watch      { background: var(--peach);  color: #1a1a2e; }
.status-deprecated { background: var(--surface1); color: var(--subtext); }

/* -- Portfolio Health panels -- */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.ph-panel {
  padding: 1rem;
}

.ph-title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
  color: var(--lavender);
}

.ph-kpis { display: flex; flex-direction: column; gap: 0.45rem; }

.ph-kpi {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.ph-kpi-label {
  font-size: 0.82rem;
  color: var(--subtext);
  flex: 1;
}

.ph-kpi-value {
  font-weight: 900;
  font-size: 1.05rem;
}

.ph-kpi-target {
  font-size: 0.75rem;
  color: var(--subtext);
}

.trend-up   { color: var(--green);  }
.trend-down { color: var(--red);    }
.trend-flat { color: var(--yellow); }

.kpi-good     { border-left: 4px solid var(--green);  }
.kpi-warn     { border-left: 4px solid var(--yellow); }
.kpi-critical { border-left: 4px solid var(--red);    }
.kpi-neutral  { border-left: 4px solid var(--surface1); }
.kpi-progress { border-left: 4px solid var(--blue);   }

/* -- Mission Control KPI row -- */
.mc-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.mc-kpi-row .kpi-card {
  flex: 1 1 160px;
  min-width: 140px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--subtext);
  font-weight: 400;
  display: block;
  margin-top: 0.2rem;
}

/* -- Current Mission -- */
.cm-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

.cm-sprint-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cm-goal {
  font-style: italic;
  color: var(--subtext);
  font-size: 0.9rem;
}

.cm-progress-bar-wrap {
  background: var(--surface0);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  border: 2px solid var(--outline);
}

.cm-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s;
}

.cm-objectives-card {
  padding: 1rem;
}

.cm-objective {
  margin-bottom: 0.8rem;
}

.cm-obj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.cm-obj-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.cm-obj-bar-wrap {
  background: var(--surface0);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--outline);
  margin-bottom: 0.15rem;
}

.cm-obj-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
}

.cm-obj-bar.at-risk {
  background: var(--yellow);
}

/* -- Portfolio latest snippets -- */
.portfolio-latest {
  margin: 0.4rem 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* -- Responsive: Current Mission -- */
@media (max-width: 900px) {
  .cm-layout {
    grid-template-columns: 1fr;
  }
}

/* -- Mission Control Data editors (Control Room tab 3) -- */
.md-section {
  padding: 1rem;
  margin-bottom: 1rem;
}

.md-section-title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lavender);
  margin-bottom: 0.8rem;
}

.md-form { display: flex; flex-direction: column; gap: 0.6rem; }

.md-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.md-row label,
.md-form > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--subtext);
  flex: 1 1 160px;
}

.md-form input[type="range"] {
  width: 100%;
  margin-top: 0.25rem;
  accent-color: var(--blue);
}

/* Objectives editor rows */
.md-obj-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--surface0);
}

.md-obj-row:last-child { border-bottom: none; }

.md-obj-name {
  flex: 1 1 160px;
  font-weight: 700;
  font-size: 0.85rem;
}

.md-obj-prog {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: var(--subtext);
  flex: 1 1 140px;
}

.obj-status-select {
  flex: 0 0 auto;
  min-width: 120px;
}

/* Health KPI editor */
.md-health-domain {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--surface0);
}

.md-domain-title {
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--lavender);
  margin-bottom: 0.5rem;
}

.md-kpi-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.md-kpi-label {
  flex: 1 1 160px;
  font-size: 0.82rem;
  color: var(--subtext);
}

.md-kpi-value,
.md-kpi-target {
  flex: 0 0 100px;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
}

.md-kpi-trend {
  flex: 0 0 90px;
  font-size: 0.82rem;
}

/* Toast notification */
.saved-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--green);
  color: #1a1a2e;
  font-weight: 900;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 3px solid var(--outline);
  box-shadow: 4px 4px 0 var(--outline);
  z-index: 9999;
  animation: toast-in 0.15s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- Portfolio item tabs (ptab � scoped to avoid CR tab conflicts) -- */
.portfolio-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }

.ptab {
  background: var(--surface0);
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text);
  box-shadow: 2px 2px 0 var(--outline);
  transition: background 0.15s;
}

.ptab.active {
  background: var(--lavender);
  color: var(--crust);
  box-shadow: 3px 3px 0 var(--outline);
}

.ptab-pane { display: none; padding-top: 0.5rem; }
.ptab-pane.active { display: block; }

/* -- Contacts block in Field Guide tab -- */
.contacts-block {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--surface0);
}

.contacts-block h4 {
  font-weight: 900;
  margin-bottom: 0.4rem;
  color: var(--lavender);
}

/* =====================================================
   Current Mission � Jira CSV sprint view
   ===================================================== */

/* Sprint header card */
.cm-sprint-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.cm-sprint-meta { flex: 2; min-width: 200px; }
.cm-sprint-meta h3 { font-size: 1.5rem; font-weight: 900; margin: 0 0 .3rem; }
.cm-theme, .cm-goal { margin: .25rem 0; color: var(--subtext); }
.cm-sprint-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  flex: 1;
  min-width: 180px;
}
.cm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .4rem .7rem;
  border: 2px solid var(--surface0);
  border-radius: 6px;
  min-width: 56px;
}
.cm-stat-value { font-size: 1.4rem; font-weight: 900; }
.cm-stat-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--subtext); }
.cm-stat.kpi-good   { border-color: var(--green);  color: var(--green);  }
.cm-stat.kpi-progress { border-color: var(--sky);  color: var(--sky);    }
.cm-stat.kpi-warn   { border-color: var(--yellow); color: var(--yellow); }
.cm-stat.kpi-neutral { border-color: var(--surface1); }

/* Sprint progress bar */
.cm-sprint-bar-wrap {
  flex-basis: 100%;
  background: var(--surface0);
  border-radius: 4px;
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--text);
}
.cm-progress-bar {
  height: 100%;
  background: var(--green);
  transition: width .4s;
}
.cm-source { color: var(--subtext); font-size: .75rem; }

/* Attention banner */
.cm-attention-banner {
  background: var(--surface0);
  border: 2px solid var(--yellow);
  border-radius: 6px;
  padding: .6rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

/* Portfolio groups grid */
.cm-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cm-group-card { padding: 1rem; }
.cm-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}
.cm-group-name { font-weight: 900; font-size: 1rem; }
.cm-group-bar-wrap {
  background: var(--surface0);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--text);
  margin-bottom: .4rem;
}
.cm-group-bar {
  height: 100%;
  background: var(--green);
  transition: width .4s;
}
.cm-group-bar.kpi-warn     { background: var(--yellow); }
.cm-group-bar.kpi-critical { background: var(--red);    }
.cm-group-counts { margin-bottom: .5rem; }
.cm-objectives-list {
  list-style: disc;
  padding-left: 1.2rem;
  margin: .3rem 0;
  font-size: .9rem;
}
.cm-objectives-list li { margin-bottom: .25rem; }
.cm-issue-keys { margin-top: .6rem; font-size: .8rem; }
.cm-issue-keys summary { cursor: pointer; color: var(--subtext); }
.cm-keys-list { margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .3rem; }

/* Unmapped issues */
.cm-unmapped {
  margin-top: 1.5rem;
  border: 2px dashed var(--yellow);
  padding: 1rem;
}
.cm-unmapped summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--yellow);
}
.cm-unmapped-list {
  list-style: none;
  padding: 0;
  margin-top: .5rem;
}
.cm-unmapped-list li {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .25rem 0;
  border-bottom: 1px solid var(--surface1);
}

/* Issue key code badge */
code.issue-key {
  background: var(--surface1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .8rem;
  font-family: monospace;
}

/* Section label */
.section-label { margin: 1.5rem 0 .7rem; font-size: 1rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--lavender); }

/* Mission Control feed row � 2-column when wide */
.mc-feed-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .mc-feed-row { grid-template-columns: 1fr; }
}
.cm-preview-panel {}
.cm-focus-list { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.chip-sm { font-size: .7rem; padding: 2px 6px; }
.cm-attention-flag { color: var(--yellow); font-weight: 700; }

/* Sprint Communication preview */
.sc-preview-box { white-space: pre-wrap; }

/* =====================================================
   Authentication & RBAC UI
   ===================================================== */

/* Login screen */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--crust);
  background-image: radial-gradient(circle, var(--surface0) 1px, transparent 1px);
  background-size: 20px 20px;
}
.login-card {
  max-width: 440px;
  width: 90%;
  text-align: center;
  padding: 2.5rem;
}
.login-card h1 {
  font-family: "Bangers", "Impact", cursive;
  font-size: 2.8rem;
  letter-spacing: 0.1em;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--text);
  margin: 0.5rem 0;
}
.login-subtitle { font-weight: 700; color: var(--lavender); margin-bottom: 0.2rem; }
.login-tagline  { color: var(--subtext); font-style: italic; margin-bottom: 1rem; }
.login-desc     { margin-bottom: 1.5rem; }
.login-btn {
  display: inline-block;
  background: var(--blue);
  color: var(--crust);
  font-weight: 900;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  border: 3px solid var(--text);
  box-shadow: 4px 4px 0 var(--text);
  transition: transform 0.1s, box-shadow 0.1s;
}
.login-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--text);
}
.login-note { margin-top: 1rem; font-size: 0.75rem; color: var(--subtext); }

/* User badge in header */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  background: var(--surface0);
  border: 2px solid var(--surface1);
  border-radius: 6px;
  font-size: 0.85rem;
}
.user-name { font-weight: 700; color: var(--text); }
.role-chip {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 2px solid currentColor;
}
.badge-admin       { color: var(--red);     border-color: var(--red);     background: color-mix(in srgb, var(--red) 15%, transparent); }
.badge-owner       { color: var(--yellow);  border-color: var(--yellow);  background: color-mix(in srgb, var(--yellow) 15%, transparent); }
.badge-contributor { color: var(--green);   border-color: var(--green);   background: color-mix(in srgb, var(--green) 15%, transparent); }
.badge-visitor     { color: var(--subtext); border-color: var(--subtext); background: transparent; }
.logout-link {
  color: var(--subtext);
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0 0.3rem;
}
.logout-link:hover { color: var(--red); }

/* Control Room access notices */
.cr-access-notice, .cr-readonly-banner {
  background: color-mix(in srgb, var(--yellow) 12%, var(--surface0));
  border: 2px solid var(--yellow);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.cr-readonly-banner { border-color: var(--surface1); background: var(--surface0); color: var(--subtext); }

/* Control Room tables (Access Management, Contributors, Ownership) */
.cr-table-wrap { overflow-x: auto; }
.cr-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.cr-table th, .cr-table td {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--surface1);
  text-align: left;
}
.cr-table th { background: var(--surface0); font-weight: 900; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cr-input, .cr-select {
  background: var(--surface0);
  color: var(--text);
  border: 2px solid var(--surface1);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  width: 100%;
  font-size: 0.85rem;
}
.cr-textarea { min-height: 54px; resize: vertical; font-family: inherit; }
.cr-del-btn {
  background: transparent;
  border: 2px solid var(--red);
  color: var(--red);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: 900;
}
.cr-del-btn:hover { background: var(--red); color: var(--crust); }

/* Updates management table */
.updates-mgmt-table { width: 100%; font-size: 0.85rem; }
.updates-mgmt-table th { white-space: nowrap; }
.updates-mgmt-table td { vertical-align: middle; }
.update-actions-cell { white-space: nowrap; }
.update-action-btn {
  margin-right: 0.35rem;
  border: 2px solid var(--outline);
  border-radius: 8px;
  padding: 0.2rem 0.55rem;
  background: var(--surface0);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}
.published-update-detail {
  background: var(--mantle);
  border: 2px dashed var(--lavender);
  border-radius: 12px;
  padding: 0.85rem;
}
.published-update-detail p {
  margin: 0 0 0.55rem;
}
.btn-danger { background: var(--red); color: var(--crust); border: none; border-radius: 4px; padding: 0.2rem 0.5rem; cursor: pointer; font-size: 0.8rem; }
.btn-danger:hover { opacity: 0.8; }
.priority-high { color: var(--red); font-weight: 700; }
.priority-medium { color: var(--yellow); font-weight: 600; }
.priority-low { color: var(--green); }

/* Editable portfolio workspace */
.workspace-editor {
  margin-top: 1rem;
  padding: 1rem;
  border: 2px dashed var(--lavender);
}

.workspace-read-card {
  margin-top: 1rem;
}

.workspace-read-card h4,
.workspace-read-card h5 {
  margin-bottom: 0.35rem;
}

.workspace-list {
  margin: 0.4rem 0 0.8rem 1.1rem;
}

.workspace-list li {
  margin-bottom: 0.25rem;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.portfolio-assignment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.workspace-links-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.workspace-kpi-grid {
  margin-bottom: 1rem;
}

.workspace-kpi-editor {
  display: grid;
  gap: 0.75rem;
}

.workspace-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  padding: 0.8rem;
  border: 2px solid var(--surface1);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: color-mix(in srgb, var(--surface0) 65%, transparent);
}

.workspace-kpi-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.workspace-kpi-row input,
.workspace-kpi-row textarea,
.workspace-kpi-row select,
.workspace-editor input,
.workspace-editor textarea,
.workspace-editor select {
  background: var(--surface0);
  color: var(--text);
  border: 2px solid var(--surface1);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.workspace-kpi-row textarea,
.workspace-editor textarea {
  min-height: 88px;
  resize: vertical;
}
