:root {
  --bg: #000000;
  --ink: #161412;
  --muted: #61584d;
  --card: rgba(255, 255, 255, 0.88);
  --stroke: rgba(22, 20, 18, 0.08);
  --accent: #0f7b6c;
  --warn: #d9822b;
  --danger: #cb2f2f;
  --shadow-ambient: 0 24px 60px rgba(42, 34, 25, 0.14);
  --shadow-tight: 0 14px 34px rgba(32, 25, 18, 0.12);
  --mono: "IBM Plex Mono", monospace;
  --sans: "Space Grotesk", "Trebuchet MS", sans-serif;
  --dashboard-font-scale: 1;
  --dashboard-density-scale: 1;
  --cockpit-bg-image: none;
  --cockpit-bg-opacity: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  margin-left: 0;
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.bg-photo {
  position: fixed;
  inset: 0;
  left: 0;
  bottom: 0;
  width: 100vw;
  pointer-events: none;
  height: 100vh;
  z-index: -4;
  background-image: var(--cockpit-bg-image);
  background-position: center, center, center;
  background-size: cover, cover, cover;
  background-repeat: no-repeat;
  opacity: var(--cockpit-bg-opacity);
  filter: saturate(1.06) contrast(1.02);
}

/* Layout Studio: destaque de labels ao focar no input correspondente */
.layout-studio .admin-form .login-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.2rem;
  color: var(--color-text, #222);
  transition: color 0.2s;
}

.layout-studio .admin-form .login-input:focus + .stream-meta,
.layout-studio .admin-form .login-input:focus {
  outline: none;
}

.layout-studio .admin-form .login-input:focus ~ .login-label,
.layout-studio .admin-form .login-input:focus + label,
.layout-studio .admin-form .login-input:focus ~ label,
.layout-studio .admin-form .login-input:focus-visible ~ .login-label {
  color: var(--color-accent, #1e90ff);
  font-weight: 700;
}

/* Espacamento consistente entre label e input */
.layout-studio .admin-form .login-input,
.layout-studio .admin-form select.login-input {
  margin-top: 0.1rem;
  margin-bottom: 0.7rem;
}

/* Espaco extra entre grupos de controles */
.layout-studio .admin-form label.login-label:not(:first-child) {
  margin-top: 0.6rem;
}

/* Ajuste para session-actions dentro do form */
.layout-studio .admin-form .session-actions {
  margin-top: 1.1rem;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  display: none;
}

body::after {
  display: none;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(22, 20, 18, 0.96);
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translateY(-180%);
  transition: transform 160ms ease;
  z-index: 40;
}

.skip-link:focus {
  transform: translateY(0);
}

.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: stretch;
}

.login-copy,
.login-card {
  border: 1px solid var(--stroke);
  border-radius: 22px;
  backdrop-filter: blur(10px);
}

.login-copy {
  padding: 1.4rem;
  background: linear-gradient(135deg, rgba(18, 16, 13, 0.9), rgba(51, 46, 41, 0.92));
  color: #f9f3e7;
}

.login-copy .muted {
  color: rgba(249, 243, 231, 0.78);
}

.login-card {
  background: rgba(255, 255, 255, 0.86);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.login-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.85rem 0 0.32rem;
}

.login-input {
  border: 1px solid rgba(22, 20, 18, 0.14);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.95);
}

.login-submit {
  width: 100%;
  margin-top: 1rem;
}

.bg-glow {
  position: fixed;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(52px);
  z-index: -1;
  opacity: 0.33;
}
.bg-glow { display: none; }
.bg-glow-a { background: #ffad42; top: -14rem; left: -8rem; }
.bg-glow-b { background: #36a68d; right: -10rem; bottom: -14rem; }

.layout {
  --layout-studio-width-collapsed: 4.6rem;
  --layout-studio-width-expanded: clamp(22rem, 24vw, 26rem);
  --studio-shift-duration: 400ms;
  --studio-shift-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  width: calc(100% - 1rem);
  max-width: 100%;
  margin: 0.5rem auto 0.9rem;
  padding: 0.45rem;
  border: 1px solid rgba(22, 20, 18, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  position: relative;
  z-index: 1;
  transition: margin-left var(--studio-shift-duration) var(--studio-shift-ease), width var(--studio-shift-duration) var(--studio-shift-ease);
}

.layout.has-layout-studio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  width: calc(100% - 1rem);
  margin-left: auto;
  margin-right: auto;
}

.layout.has-layout-studio.layout-studio-expanded {
  grid-template-columns: 1fr;
  width: calc(100% - 1rem);
  margin-left: auto;
}

.layout.has-layout-studio > :not(.layout-studio) {
  grid-column: 1;
}

.layout.has-layout-studio > .layout-studio {
  grid-column: 1;
  grid-row: 1 / span 999;
}

.ops-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 240px;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.8rem;
  transition: grid-template-columns var(--studio-shift-duration) var(--studio-shift-ease), gap var(--studio-shift-duration) var(--studio-shift-ease);
}

.ops-brand,
.ops-search,
.ops-meta {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  min-height: 4rem;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-tight);
}

.ops-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.ops-mark {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.8rem;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #161412, #2f2923);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.ops-eyebrow {
  margin: 0 0 0.18rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ops-search {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.ops-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

#liveStatus.is-live { color: var(--accent); }
#liveStatus.is-warn { color: var(--warn); }
#liveStatus.is-danger { color: var(--danger); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(clamp(14rem, 22vw, 18rem), 0.78fr) auto;
  grid-template-areas: "copy actions pulse";
  gap: 0.85rem;
  align-items: stretch;
  margin-bottom: 0.95rem;
  transition: grid-template-columns var(--studio-shift-duration) var(--studio-shift-ease), gap var(--studio-shift-duration) var(--studio-shift-ease);
}

.hero,
.hero-copy,
.hero-actions,
.hero-priority,
.hero-project,
.hero-session,
.hero-edit-toggle {
  transition:
    grid-template-columns var(--studio-shift-duration) var(--studio-shift-ease),
    grid-template-areas var(--studio-shift-duration) var(--studio-shift-ease),
    gap var(--studio-shift-duration) var(--studio-shift-ease),
    padding var(--studio-shift-duration) var(--studio-shift-ease),
    border-radius var(--studio-shift-duration) var(--studio-shift-ease),
    width var(--studio-shift-duration) var(--studio-shift-ease),
    min-height var(--studio-shift-duration) var(--studio-shift-ease);
}

.hero-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(22, 20, 18, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-ambient);
}

.hero-copy h1 {
  margin: 0.12rem 0 0;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  max-width: 20ch;
}

.hero-copy .muted {
  max-width: 48ch;
  line-height: 1.45;
  margin-top: 0.32rem;
}

.hero-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "project"
    "session"
    "menu";
  align-items: stretch;
  align-content: start;
  justify-content: stretch;
  gap: 0.8rem;
  transition: gap var(--studio-shift-duration) var(--studio-shift-ease);
}

.hero-edit-toggle {
  grid-area: menu;
  grid-column: auto;
  justify-self: start;
}

.hero-project { grid-area: project; }

.hero-session {
  grid-area: session;
  min-width: 0;
  width: 100%;
}

.hero-priority,
.session-card,
.project-control {
  box-shadow: var(--shadow-ambient);
}

.hero-priority {
  grid-area: pulse;
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(22, 20, 18, 0.1);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.72), transparent 40%),
    linear-gradient(145deg, rgba(24, 22, 19, 0.94), rgba(58, 49, 39, 0.92));
  color: #fbf6ec;
}

.hero-priority::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.4rem;
  background: linear-gradient(180deg, #58dcc3, #ffbe65);
}

.hero-priority.is-warn::before {
  background: linear-gradient(180deg, #ffde91, #d9822b);
}

.hero-priority.is-danger::before {
  background: linear-gradient(180deg, #ffc2ae, #cb2f2f);
}

.priority-label,
.priority-copy,
.priority-stat span {
  font-family: var(--mono);
}

.priority-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(251, 246, 236, 0.68);
}

.priority-title {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(1.05rem, 2.1vw, 1.55rem);
  line-height: 1.1;
}

.priority-copy {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(251, 246, 236, 0.78);
}

.priority-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.priority-stat {
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
}

.priority-stat span {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(251, 246, 236, 0.66);
}

.priority-stat strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.2rem;
}

.priority-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.session-card {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
  transition: padding var(--studio-shift-duration) var(--studio-shift-ease), border-radius var(--studio-shift-duration) var(--studio-shift-ease);
}

.session-eyebrow,
.session-meta {
  display: block;
  font-family: var(--mono);
  color: var(--muted);
}

.session-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.session-user {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.session-meta {
  margin-top: 0.16rem;
  font-size: 0.68rem;
  line-height: 1.35;
}

.session-detail {
  display: block;
  margin-top: 0.18rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  line-height: 1.35;
}

.session-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.command-bar {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 1fr;
  gap: calc(0.7rem * var(--dashboard-density-scale));
  margin-bottom: 0.85rem;
  transition: grid-template-columns var(--studio-shift-duration) var(--studio-shift-ease), gap var(--studio-shift-duration) var(--studio-shift-ease);
}

.command-pill {
  background: rgba(18, 16, 13, 0.82);
  color: #f5efe4;
  border-radius: 16px;
  padding: 0.8rem 0.95rem;
  box-shadow: var(--shadow-tight);
}

.command-pill-wide {
  min-width: 0;
}

.command-label {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: rgba(245, 239, 228, 0.66);
  margin-bottom: 0.28rem;
}

.command-subline {
  display: block;
  margin-top: 0.34rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(245, 239, 228, 0.68);
}

.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.3rem;
  font-size: 0.74rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1;
}

.muted { color: var(--muted); margin: 0.4rem 0 0; font-size: 0.9rem; }
.hero-scope { max-width: 42rem; }
.feedback {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  font-family: var(--mono);
  min-height: 1.1rem;
  color: var(--muted);
}

.feedback.is-success { color: var(--accent); }
.feedback.is-error { color: var(--danger); }
  .button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #161412, #332e29);
  color: #fff;
  font-family: var(--sans);
  padding: 0.68rem 1.05rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 8px 24px rgba(17, 15, 12, 0.25);
}
.button:hover { transform: translateY(-1px); }
.button.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid rgba(22, 20, 18, 0.1);
  box-shadow: none;
}

.button,
.action-btn {
  font-family: var(--sans);
}

.button:focus-visible,
.action-btn:focus-visible,
.project-select:focus-visible,
.login-input:focus-visible,
.menu-item:focus-visible {
  outline: 2px solid rgba(15, 123, 108, 0.5);
  outline-offset: 2px;
}

.project-control {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
  transition: padding var(--studio-shift-duration) var(--studio-shift-ease), border-radius var(--studio-shift-duration) var(--studio-shift-ease);
}

.project-label,
.project-hint {
  display: block;
  font-family: var(--mono);
}

.project-label {
  margin-bottom: 0.42rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.project-select {
  width: 100%;
  border: 1px solid rgba(22, 20, 18, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
}

.project-hint {
  margin: 0.48rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.45;
}

.menu {
  display: flex;
  gap: 0.45rem;
  width: 100%;
  max-width: 74rem;
  margin: 0 auto 0.9rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.45rem;
  border: 1px solid rgba(22, 20, 18, 0.08);
  border-radius: 18px;
  background: rgba(249, 244, 235, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-tight);
  position: sticky;
  top: 0.9rem;
  z-index: 20;
  min-height: 3.1rem;
  transition: max-height 220ms ease, opacity 180ms ease, margin 180ms ease, padding 180ms ease, border-width 180ms ease;
}

.layout.menu-collapsed .menu {
  opacity: 1;
  margin-bottom: 0.9rem;
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
  border-width: 1px;
  gap: 0.3rem;
  overflow-x: auto;
  overflow-y: visible;
}

.layout.menu-collapsed .menu-item {
  padding: 0.32rem 0.56rem;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
}

.layout.menu-collapsed .menu-cluster-label {
  opacity: 0.55;
  font-size: 0.6rem;
}

.layout.menu-collapsed .menu-bg-control {
  gap: 0.3rem;
  margin-left: 0.35rem;
}

.layout.menu-collapsed .menu-bg-label {
  display: none;
}

.layout.menu-collapsed .menu-bg-url {
  width: 8rem;
}

.layout.menu-collapsed .menu-bg-select,
.layout.menu-collapsed .menu-bg-url,
.layout.menu-collapsed .menu-bg-apply {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  font-size: 0.66rem;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu-item {
  flex: 0 0 auto;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  transition: padding 180ms ease, font-size 180ms ease, color 180ms ease;
}

.menu-item.is-active {
  background: linear-gradient(135deg, #161412, #332e29);
  color: #fff;
}

.menu-bg-control {
  margin-left: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.5rem;
  border-top: 0;
}

.menu-bg-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-bg-select,
.menu-bg-url {
  border: 1px solid rgba(22, 20, 18, 0.12);
  border-radius: 999px;
  padding: 0.38rem 0.65rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.menu-bg-select {
  min-width: 8.8rem;
}

.menu-bg-url {
  width: 12rem;
}

.menu-bg-url[disabled] {
  opacity: 0.55;
}

.menu-bg-apply {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
}

.menu-bg-apply:hover {
  background: #fff;
}

.screen {
  display: none;
  animation: reveal 220ms ease;
}

.screen.is-active {
  display: block;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(0.8rem * var(--dashboard-density-scale));
  margin-bottom: 0.9rem;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0.8rem;
  backdrop-filter: blur(8px);
}
.kpi .label { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi .value { font-size: 2rem; font-weight: 700; line-height: 1; margin-top: 0.3rem; }
.kpi.is-danger .value { color: var(--danger); }
.kpi.is-warn .value { color: var(--warn); }
.kpi.is-good .value { color: var(--accent); }

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(0.8rem * var(--dashboard-density-scale));
}

.content-grid.one-col {
  grid-template-columns: 1fr;
}

.users-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: calc(0.95rem * var(--dashboard-density-scale));
  box-shadow: var(--shadow-tight);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.panel:hover,
.executive-card:hover,
.session-card:hover,
.project-control:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(42, 34, 25, 0.16);
}

.panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.panel-tag {
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  background: rgba(15, 123, 108, 0.1);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-wide {
  grid-column: 1 / -1;
}

.war-room-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: calc(0.8rem * var(--dashboard-density-scale));
}

.war-room-grid-v2 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.panel-span-4 { grid-column: span 4; }
.panel-span-5 { grid-column: span 5; }
.panel-span-6 { grid-column: span 6; }
.panel-span-7 { grid-column: span 7; }
.panel-span-12 { grid-column: 1 / -1; }

.panel-war-room {
  min-height: 100%;
}

.panel-briefing {
  background:
    linear-gradient(135deg, rgba(18, 16, 13, 0.9), rgba(51, 46, 41, 0.92)),
    radial-gradient(circle at top right, rgba(15, 123, 108, 0.28), transparent 45%);
  color: #f9f3e7;
  border-color: rgba(255, 255, 255, 0.08);
}

.panel-briefing .panel-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #f9f3e7;
}

.briefing-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.briefing-card {
  border-radius: 14px;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.briefing-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.briefing-meta {
  margin-top: 0.28rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(249, 243, 231, 0.8);
}

.briefing-card span {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(249, 243, 231, 0.72);
}

.briefing-card strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.55rem;
}

.briefing-card.is-danger strong { color: #ff8f8f; }
.briefing-card.is-warn strong { color: #ffca7a; }
.briefing-card.is-live strong { color: #7be5d2; }
.briefing-card.is-good strong { color: #f9f3e7; }

.executive-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.executive-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.7rem;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.9rem;
  min-height: 7rem;
}

.executive-card.tone-live {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(227, 245, 241, 0.88));
}

.executive-card.tone-warn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 242, 225, 0.92));
}

.executive-card.tone-danger {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 233, 233, 0.92));
}

.executive-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.executive-label,
.executive-delta {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.executive-label { color: var(--muted); }
.executive-delta { color: var(--muted); }

.executive-value {
  font-size: 1.45rem;
  line-height: 1;
}

.sparkline {
  width: 5.4rem;
  min-width: 5.4rem;
  height: 3.5rem;
  align-self: center;
}

.sparkline polyline {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-good polyline { stroke: #0f7b6c; }
.sparkline-live polyline { stroke: #169b88; }
.sparkline-warn polyline { stroke: #d9822b; }
.sparkline-danger polyline { stroke: #cb2f2f; }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.pipeline-stage {
  border-radius: 14px;
  background: rgba(18, 16, 13, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.8rem;
}

.pipeline-headline {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.pipeline-headline strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.pipeline-rail {
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(18, 16, 13, 0.08);
  overflow: hidden;
}

.pipeline-rail span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #109fdb, #365dd9);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.signal-card {
  border-radius: 14px;
  padding: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.8);
}

.signal-card span,
.signal-card small {
  display: block;
  font-family: var(--mono);
}

.signal-card span {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--muted);
}

.signal-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.1rem;
}

.signal-card small {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.signal-card.is-danger { background: rgba(255, 235, 235, 0.92); }
.signal-card.is-warn { background: rgba(255, 244, 230, 0.92); }
.signal-card.is-live { background: rgba(232, 247, 243, 0.92); }

.metric-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  padding-bottom: 0.3rem;
}
.metric-row strong { font-family: var(--mono); }

.stream {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stream li {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.74);
}
.stream .title { font-size: 0.86rem; font-weight: 600; }
.stream .meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.2rem; font-family: var(--mono); }

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(22, 20, 18, 0.14);
  background: rgba(255, 255, 255, 0.52);
}

.empty-state strong {
  font-size: 0.84rem;
}

.empty-state span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

.empty-state-row {
  list-style: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.48rem;
  font-size: 0.68rem;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 0.35rem;
}

.status-chip.is-danger {
  background: rgba(203, 47, 47, 0.12);
  color: var(--danger);
}

.status-chip.is-warn {
  background: rgba(217, 130, 43, 0.12);
  color: var(--warn);
}

.status-chip.is-live {
  background: rgba(15, 123, 108, 0.14);
  color: var(--accent);
}

.status-chip.is-good {
  background: rgba(22, 20, 18, 0.08);
  color: var(--ink);
}

.chain-list,
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.chain-row strong,
.chain-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
}

.chain-row span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.16rem;
}

.alert-card {
  border-radius: 14px;
  padding: 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.alert-card.is-danger {
  background: linear-gradient(135deg, rgba(203, 47, 47, 0.14), rgba(255, 255, 255, 0.9));
  border-color: rgba(203, 47, 47, 0.2);
}

.alert-card.is-warn {
  background: linear-gradient(135deg, rgba(217, 130, 43, 0.16), rgba(255, 255, 255, 0.9));
  border-color: rgba(217, 130, 43, 0.22);
}

.alert-card.is-live {
  background: linear-gradient(135deg, rgba(15, 123, 108, 0.16), rgba(255, 255, 255, 0.9));
  border-color: rgba(15, 123, 108, 0.22);
}

.alert-card.is-good {
  background: linear-gradient(135deg, rgba(22, 20, 18, 0.06), rgba(255, 255, 255, 0.92));
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.readiness-card {
  border-radius: 14px;
  padding: 0.95rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 240, 230, 0.88));
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.readiness-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.readiness-metrics div {
  border-radius: 12px;
  background: rgba(18, 16, 13, 0.06);
  padding: 0.55rem 0.65rem;
}

.readiness-metrics span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.menu-cluster-label {
  flex: 0 0 auto;
  align-self: center;
  padding: 0.2rem 0.15rem 0.2rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.9;
}

.admin-hub-copy {
  margin-bottom: 1rem;
  max-width: 72ch;
}

.layout-studio {
  display: block;
  position: relative;
  left: auto;
  top: 0;
  bottom: auto;
  align-self: start;
  width: 100%;
  height: auto;
  z-index: 35;
  transition: none;
  will-change: auto;
}

.layout-studio.is-expanded {
  width: 100%;
}

.layout-studio-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(250, 247, 241, 0.96), rgba(245, 239, 227, 0.94));
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: var(--shadow-tight);
  overflow: hidden;
  max-height: 100%;
  transition: padding 220ms ease, border-radius 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.layout-studio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(250, 247, 241, 0.98), rgba(250, 247, 241, 0.92));
}

.layout-studio-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  position: sticky;
  top: 4.1rem;
  z-index: 2;
  background: linear-gradient(180deg, rgba(250, 247, 241, 0.98), rgba(247, 242, 232, 0.94));
  padding-bottom: 0.45rem;
}

.layout-studio-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(22, 20, 18, 0.12);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.layout-studio-nav-item:hover {
  transform: translateX(2px);
  border-color: rgba(15, 123, 108, 0.36);
  background: rgba(255, 255, 255, 0.92);
}

.layout-studio-nav-icon {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  border: 1px solid rgba(22, 20, 18, 0.16);
  background: rgba(18, 16, 13, 0.86);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
}

.layout-studio-nav-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.layout-studio-nav-label {
  white-space: nowrap;
  transition: opacity 180ms ease, transform 220ms ease, width 220ms ease;
  opacity: 1;
  width: auto;
  transform: none;
  overflow: visible;
}

@media (hover: hover) and (pointer: fine) {
  .layout-studio:not(.is-expanded) .layout-studio-shell {
    padding: 0.55rem 0.45rem;
    transform: translateX(-2px);
    box-shadow: 0 8px 18px rgba(9, 8, 7, 0.14);
  }

  .layout-studio.is-expanded .layout-studio-shell {
    transform: translateX(0);
  }

  .layout-studio:not(.is-expanded) .layout-studio-body {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    gap: 0;
    transition-delay: 100ms;
  }

  .layout-studio:not(.is-expanded) .layout-studio-head {
    margin-bottom: 0;
    justify-content: center;
  }

  .layout-studio:not(.is-expanded) .layout-studio-head > div {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .layout-studio:not(.is-expanded) .layout-studio-nav-label {
    opacity: 0;
    width: 0;
    transform: translateX(-8px);
    overflow: hidden;
  }
}

@media (min-width: 981px) {
  .layout.has-layout-studio {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 1rem - var(--layout-studio-width-collapsed));
    margin-left: calc(0.5rem + var(--layout-studio-width-collapsed));
    margin-right: 0.5rem;
  }

  .layout.has-layout-studio.layout-studio-expanded {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 1rem - var(--layout-studio-width-expanded));
    margin-left: calc(0.5rem + var(--layout-studio-width-expanded));
  }

  .layout-studio {
    position: fixed;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    height: calc(100dvh - 1rem);
    width: var(--layout-studio-width-collapsed);
    transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: width;
    z-index: 48;
  }

  .layout-studio.is-expanded {
    width: var(--layout-studio-width-expanded);
  }

  .layout-studio .layout-studio-shell {
    transform: none !important;
  }

  .layout-studio .layout-studio-body {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    max-height: 100% !important;
    overflow-y: auto !important;
  }

  .layout-studio .layout-studio-head {
    margin-bottom: 1rem !important;
    justify-content: space-between !important;
  }

  .layout-studio .layout-studio-head > div,
  .layout-studio .layout-studio-nav-label {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    transform: none !important;
  }

  .layout-studio-nav {
    grid-template-columns: 1fr;
  }

  /* Compact desktop phase when Studio is expanded: keep Hero readable in reduced usable width. */
  .layout.has-layout-studio.layout-studio-expanded .hero {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.95fr);
    grid-template-areas:
      "copy actions"
      "pulse pulse";
    gap: 0.7rem;
  }

  .layout.has-layout-studio.layout-studio-expanded .hero-copy {
    align-items: flex-start;
    text-align: left;
    padding: 0.72rem 0.8rem;
    min-width: 0;
  }

  .layout.has-layout-studio.layout-studio-expanded .hero-copy h1 {
    font-size: clamp(1.3rem, 2.1vw, 1.9rem);
    line-height: 1.06;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .layout.has-layout-studio.layout-studio-expanded .hero-copy .muted,
  .layout.has-layout-studio.layout-studio-expanded .hero-scope,
  .layout.has-layout-studio.layout-studio-expanded .feedback {
    max-width: 100%;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .layout.has-layout-studio.layout-studio-expanded .hero-actions {
    gap: 0.6rem;
  }

  .layout.has-layout-studio.layout-studio-expanded .session-card,
  .layout.has-layout-studio.layout-studio-expanded .project-control {
    padding: 0.68rem 0.74rem;
    border-radius: 14px;
  }

  .layout.has-layout-studio.layout-studio-expanded .hero-priority {
    min-height: 0;
    padding: 0.8rem 0.88rem;
    border-radius: 16px;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-title {
    font-size: clamp(1rem, 1.7vw, 1.3rem);
    line-height: 1.12;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-copy {
    font-size: 0.68rem;
    line-height: 1.45;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.62rem;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-stat {
    padding: 0.52rem 0.56rem;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-stat strong {
    font-size: 1rem;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-actions {
    margin-top: 0.62rem;
    gap: 0.32rem;
  }

  .layout.has-layout-studio.layout-studio-expanded .priority-actions .action-btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.62rem;
  }
}

.layout-studio-body {
  display: grid;
  min-height: 0;
  max-height: 100%;
  gap: calc(0.8rem * var(--dashboard-density-scale));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 0.35rem;
  transition: opacity 180ms ease, transform 180ms ease, max-height 220ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 123, 108, 0.42) rgba(22, 20, 18, 0.08);
}

.layout-studio-body::-webkit-scrollbar {
  width: 0.6rem;
}

.layout-studio-body::-webkit-scrollbar-track {
  background: rgba(22, 20, 18, 0.06);
  border-radius: 999px;
}

.layout-studio-body::-webkit-scrollbar-thumb {
  background: rgba(15, 123, 108, 0.42);
  border-radius: 999px;
}

.layout-studio-body::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 123, 108, 0.58);
}

.layout-studio.is-expanded .layout-studio-body > .panel {
  transform: translateX(0);
  opacity: 1;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
}

.layout-studio:not(.is-expanded) .layout-studio-body > .panel {
  transform: translateX(-14px);
  opacity: 0;
}

.layout-studio .panel {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(22, 20, 18, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 242, 232, 0.92));
  box-shadow: 0 10px 24px rgba(22, 20, 18, 0.06);
}

.layout-studio .panel-head {
  margin-bottom: 0;
  padding: 0.95rem 1rem 0.78rem;
  align-items: center;
  border-bottom: 1px solid rgba(22, 20, 18, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 236, 0.95));
}

.layout-studio .panel h2 {
  margin: 0;
  line-height: 1.1;
}

.layout-studio .panel-tag {
  flex-shrink: 0;
}

.layout-studio .panel > .stream-meta,
.layout-studio .panel > .admin-form,
.layout-studio .panel > .session-actions,
.layout-studio .panel > .stream {
  padding-left: 1rem;
  padding-right: 1rem;
}

.layout-studio .panel > .stream-meta {
  padding-top: 0.82rem;
}

.layout-studio .panel > .admin-form,
.layout-studio .panel > .stream {
  padding-top: 0.88rem;
  padding-bottom: 1rem;
}

.layout-studio .panel > .session-actions {
  padding-top: 0.25rem;
  padding-bottom: 1rem;
}

.layout-card-selected {
  border-color: rgba(15, 123, 108, 0.55);
  box-shadow: 0 0 0 2px rgba(15, 123, 108, 0.14), var(--shadow-tight);
}

.layout [data-layout-card] {
  position: relative;
  width: calc(100% + var(--layout-width-adjust, 0px));
  max-width: none;
  left: var(--layout-offset-x, 0);
  top: var(--layout-offset-y, 0);
  transition:
    width 180ms ease,
    min-height 180ms ease,
    left 180ms ease,
    top 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.layout-drag-enabled [data-layout-card] {
  cursor: grab;
  z-index: 2;
}

.layout-drag-enabled [data-layout-card]:active {
  cursor: grabbing;
}

[data-layout-card].is-dragging {
  opacity: 0.42;
  z-index: 8;
}

[data-layout-card].is-card-hidden {
  display: none !important;
}

.layout-inline-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.layout-resize-handle {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  width: 1rem;
  height: 1rem;
  border: 0;
  border-radius: 0.35rem;
  background: linear-gradient(135deg, rgba(15, 123, 108, 0.85), rgba(89, 183, 255, 0.9));
  box-shadow: 0 6px 18px rgba(15, 123, 108, 0.22);
  cursor: nwse-resize;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.layout-drag-enabled [data-layout-card]:hover .layout-resize-handle,
.layout-drag-enabled [data-layout-card].layout-card-selected .layout-resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.layout-resize-handle:hover {
  transform: scale(1.08);
}

.metric-list.is-chart-bar,
.metric-list.is-chart-pie {
  display: grid;
  gap: 0.6rem;
}

.metric-row-bar {
  display: grid;
  gap: 0.35rem;
}

.metric-row-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.metric-row-bar-track {
  position: relative;
  overflow: hidden;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(19, 16, 13, 0.08);
}

.metric-row-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #59b7ff);
  transition: width 180ms ease;
}

.metric-pie-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
}

.metric-pie-chart {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(18, 16, 13, 0.06);
}

.metric-pie-legend {
  display: grid;
  gap: 0.45rem;
}

.metric-pie-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.metric-pie-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
}

.readiness-metrics strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
}

.mobile-ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.mobile-ops-card {
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.76);
  padding: 0.95rem;
}

.mobile-ops-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.96rem;
}

.mobile-ops-highlight {
  background: linear-gradient(135deg, rgba(15, 123, 108, 0.14), rgba(255, 255, 255, 0.88));
  border-color: rgba(15, 123, 108, 0.18);
}

.compact-list {
  margin: 0.55rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.compact-list li + li {
  margin-top: 0.35rem;
}

.mono-line {
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.inline-link:hover {
  text-decoration: underline;
}

.agent-card {
  border-radius: 14px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 240, 230, 0.84));
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.agent-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.agent-id {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.agent-role {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.18rem;
}

.agent-line,
.agent-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.55rem;
}

.agent-counts {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.agent-counts span {
  border-radius: 999px;
  background: rgba(18, 16, 13, 0.08);
  padding: 0.18rem 0.48rem;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.agent-mission {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.actions-row {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.4rem;
}

.action-btn {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 0.24rem 0.55rem;
  cursor: pointer;
}

.action-btn.approve {
  border-color: rgba(15, 123, 108, 0.3);
  color: var(--accent);
}

.action-btn.reject {
  border-color: rgba(203, 47, 47, 0.3);
  color: var(--danger);
}

.toggle-switch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.6rem;
  padding-right: 2rem;
  font-weight: 600;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.toggle-switch-btn::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #c5c1ba;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, background-color 180ms ease;
}

.toggle-switch-btn.is-on {
  background: rgba(15, 123, 108, 0.18);
  border-color: rgba(15, 123, 108, 0.36);
  color: #0f7b6c;
}

.toggle-switch-btn.is-on::after {
  background: #0f7b6c;
  transform: scale(1.05);
}

.toggle-switch-btn.is-off {
  background: rgba(22, 20, 18, 0.08);
  border-color: rgba(22, 20, 18, 0.16);
  color: var(--muted);
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-form {
  display: flex;
  flex-direction: column;
}

.memory-controls-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.memory-controls-form .session-actions {
  grid-column: 1 / -1;
}

.memory-decision-form {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.danger-zone {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.stream-meta {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
}

.planning-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: end;
}

.planning-create-form .session-actions {
  grid-column: 1 / -1;
}

.planning-inline-editor {
  display: none;
  margin-top: 0.8rem;
  padding: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.planning-inline-editor.is-open {
  display: block;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.planning-master-controls {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr 1fr auto auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.planning-action-strip {
  display: grid;
  grid-template-columns: 1.35fr 1.1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 239, 229, 0.92));
}

.planning-strip-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.planning-strip-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.planning-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.planning-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.planning-bulk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.65rem;
  align-items: end;
}

.planning-strip-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.filter-chip {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0.45rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.filter-chip strong {
  margin-left: 0.35rem;
}

.filter-chip.is-active {
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
}

.planning-inline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.planning-inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.planning-inline-field span {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.planning-inline-actions {
  margin-top: 0.75rem;
}

.planning-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.planning-task-headline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.planning-task-select {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.planning-root-card {
  border: 1px solid rgba(22, 20, 18, 0.08);
  border-left: 5px solid rgba(22, 20, 18, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 240, 227, 0.9));
}

.planning-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: rgba(22, 20, 18, 0.05);
  border: 1px solid rgba(22, 20, 18, 0.07);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.planning-group-header strong {
  color: var(--ink);
}

.planning-group-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  color: var(--ink);
  font-size: 0.68rem;
}

.planning-group-note {
  color: var(--muted);
  font-size: 0.68rem;
}

.briefing-card.is-owner-focus {
  background: linear-gradient(180deg, rgba(22, 20, 18, 0.08), rgba(255, 255, 255, 0.92));
}

.briefing-card.is-risk {
  background: linear-gradient(180deg, rgba(217, 130, 43, 0.15), rgba(255, 255, 255, 0.94));
}

.briefing-card.is-flow {
  background: linear-gradient(180deg, rgba(15, 123, 108, 0.12), rgba(255, 255, 255, 0.94));
}

.planning-subtask-card {
  border: 1px solid rgba(15, 123, 108, 0.16);
  border-left: 5px solid rgba(15, 123, 108, 0.58);
  background: linear-gradient(180deg, rgba(15, 123, 108, 0.1), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 0 0 1px rgba(15, 123, 108, 0.06);
}

.planning-subtask-card .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.planning-subtask-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.planning-subtask-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 123, 108, 0.14);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.planning-root-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(22, 20, 18, 0.08);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.planning-task-priorityline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.42rem;
}

.planning-priority-pill {
  border-radius: 10px;
  padding: 0.42rem 0.5rem;
  background: rgba(22, 20, 18, 0.06);
  border: 1px solid rgba(22, 20, 18, 0.06);
}

.planning-priority-pill span {
  display: block;
  font-family: var(--mono);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.planning-priority-pill strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink);
}

.planning-priority-pill.is-owner {
  background: rgba(22, 20, 18, 0.08);
}

.planning-priority-pill.is-due {
  background: rgba(217, 130, 43, 0.12);
}

.planning-priority-pill.is-approver {
  background: rgba(15, 123, 108, 0.12);
}

.planning-bulk-meta {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.76rem;
}

.master-briefing {
  white-space: pre-wrap;
}

.security-access-banner {
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 248, 219, 0.85);
  color: var(--ink);
  line-height: 1.5;
}

.security-access-banner.is-success {
  background: rgba(205, 254, 212, 0.85);
}

.user-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.users-empty {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

body.is-ready [data-reveal] {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition:
    opacity 420ms ease,
    transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--reveal-index, 0) * 45ms);
}

body.is-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.is-loading .ops-brand,
body.is-loading .ops-search,
body.is-loading .ops-meta,
body.is-loading .session-card,
body.is-loading .project-control,
body.is-loading .hero-priority,
body.is-loading .command-pill,
body.is-loading .panel {
  position: relative;
  overflow: hidden;
}

body.is-loading .ops-brand > *,
body.is-loading .ops-search > *,
body.is-loading .ops-meta > *,
body.is-loading .session-card > *,
body.is-loading .project-control > *,
body.is-loading .hero-priority > *,
body.is-loading .command-pill > *,
body.is-loading .panel > * {
  opacity: 0;
}

body.is-loading .ops-brand::after,
body.is-loading .ops-search::after,
body.is-loading .ops-meta::after,
body.is-loading .session-card::after,
body.is-loading .project-control::after,
body.is-loading .hero-priority::after,
body.is-loading .command-pill::after,
body.is-loading .panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 15%, rgba(255, 255, 255, 0.76) 48%, transparent 82%),
    rgba(255, 255, 255, 0.34);
  transform: translateX(-100%);
  animation: shimmer 1.25s linear infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@media (max-width: 980px) {
  :root {
    --cockpit-bg-opacity: 0;
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas:
      "copy pulse"
      "actions actions";
    gap: 0.72rem;
  }
  .hero-copy {
    padding: 0.8rem 0.85rem;
  }
  .hero-copy h1 {
    font-size: clamp(1.4rem, 3.7vw, 2rem);
    max-width: 17ch;
  }
  .hero-copy .muted,
  .hero-scope {
    max-width: 34ch;
    font-size: 0.82rem;
    line-height: 1.38;
  }
  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "project session"
      "menu menu";
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.65rem;
  }
  .hero-project,
  .hero-session {
    min-width: 0;
    width: 100%;
  }
  .session-card,
  .project-control {
    padding: 0.72rem 0.78rem;
    border-radius: 14px;
  }
  .session-user {
    font-size: 0.9rem;
  }
  .session-meta,
  .session-detail,
  .project-hint {
    font-size: 0.64rem;
  }
  .hero-priority {
    min-height: 100%;
    padding: 0.88rem 0.9rem;
    border-radius: 18px;
  }
  .priority-title {
    font-size: clamp(0.96rem, 2vw, 1.2rem);
  }
  .priority-copy {
    font-size: 0.68rem;
  }
  .priority-stats {
    gap: 0.45rem;
  }
  .priority-stat {
    padding: 0.56rem 0.58rem;
  }
  .priority-actions {
    margin-top: 0.7rem;
    gap: 0.35rem;
  }
  .hero-edit-toggle {
    justify-self: stretch;
  }
  .ops-shell {
    grid-template-columns: 1fr;
  }
  .layout {
    width: calc(100% - 1rem);
    margin: 0.5rem auto 0.9rem;
  }
  .layout.has-layout-studio {
    grid-template-columns: 1fr;
    width: calc(100% - 1rem);
    margin-left: auto;
    margin-right: auto;
  }
  .layout.has-layout-studio.layout-studio-expanded {
    grid-template-columns: 1fr;
    width: calc(100% - 1rem);
    margin-left: auto;
  }
  .layout.has-layout-studio.layout-studio-collapsed {
    grid-template-columns: 1fr;
  }
  .layout.has-layout-studio > .layout-studio {
    grid-column: 1;
    grid-row: auto;
  }
  .layout-studio {
    position: relative;
    left: auto;
    top: 0;
    bottom: auto;
    width: 100%;
    transition: none;
    will-change: auto;
  }
  .layout-studio-shell {
    max-height: none;
    padding: 0.9rem;
  }
  .layout-studio .layout-studio-body {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    max-height: none;
    overflow: visible;
    margin: 0;
  }
  .layout-studio .layout-studio-head,
  .layout-studio .layout-studio-nav {
    position: static;
    top: auto;
    background: transparent;
  }
  .layout-studio .layout-studio-head {
    margin-bottom: 1rem;
    justify-content: space-between;
  }
  .layout-studio .layout-studio-head > div {
    opacity: 1;
    width: auto;
    overflow: visible;
  }
  .layout-studio .layout-studio-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .layout-studio .layout-studio-nav-label {
    opacity: 1;
    width: auto;
    transform: none;
    overflow: visible;
  }
  .menu-bg-control {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px dashed rgba(22, 20, 18, 0.14);
  }
  .menu-bg-url {
    flex: 1 1 12rem;
    min-width: 9rem;
  }
  .command-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .executive-strip,
  .pipeline-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid, .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-controls-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-master-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-action-strip { grid-template-columns: 1fr; }
  .planning-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-bulk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .users-grid { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .war-room-grid,
  .war-room-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-span-4,
  .panel-span-5,
  .panel-span-6,
  .panel-span-7,
  .panel-span-12 { grid-column: auto; }
  .briefing-stack,
  .mobile-ops-grid,
  .signal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --cockpit-bg-opacity: 0;
  }
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "pulse"
      "actions";
    gap: 0.62rem;
    margin-bottom: 0.72rem;
  }
  .hero-copy {
    align-items: flex-start;
    text-align: left;
    padding: 0.72rem 0.74rem;
    border-radius: 12px;
  }
  .hero-copy h1 {
    font-size: clamp(1.26rem, 7vw, 1.56rem);
    max-width: 100%;
  }
  .hero-copy .muted,
  .hero-scope,
  .feedback {
    max-width: 100%;
    font-size: 0.76rem;
    line-height: 1.4;
  }
  .hero-actions {
    width: 100%;
    grid-template-columns: 1fr;
    grid-template-areas:
      "project"
      "session"
      "menu";
    gap: 0.54rem;
  }
  .hero-project,
  .hero-session,
  .hero-edit-toggle {
    width: 100%;
  }
  .session-card,
  .project-control,
  .hero-priority {
    border-radius: 12px;
  }
  .session-card,
  .project-control {
    padding: 0.64rem 0.68rem;
  }
  .session-actions,
  .priority-actions {
    width: 100%;
    flex-direction: column;
  }
  .session-actions .action-btn,
  .priority-actions .action-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-priority {
    padding: 0.74rem 0.76rem;
  }
  .priority-title {
    font-size: 1.02rem;
    line-height: 1.2;
  }
  .priority-copy,
  .priority-label {
    font-size: 0.66rem;
  }
  .priority-stat strong {
    font-size: 1rem;
  }
  .project-control { width: 100%; min-width: 0; }
  .command-bar { grid-template-columns: 1fr; }
  .executive-strip,
  .pipeline-board {
    grid-template-columns: 1fr;
  }
  .kpi-grid, .content-grid { grid-template-columns: 1fr; }
  .planning-create-form { grid-template-columns: 1fr; }
  .memory-controls-form { grid-template-columns: 1fr; }
  .planning-inline-grid { grid-template-columns: 1fr; }
  .planning-master-controls { grid-template-columns: 1fr; }
  .planning-task-priorityline { grid-template-columns: 1fr; }
  .planning-control-grid { grid-template-columns: 1fr; }
  .planning-bulk-row { grid-template-columns: 1fr; }
  .users-grid { grid-template-columns: 1fr; }
  .war-room-grid,
  .war-room-grid-v2 { grid-template-columns: 1fr; }
  .chain-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .briefing-stack,
  .readiness-metrics,
  .mobile-ops-grid {
    grid-template-columns: 1fr;
  }
  .priority-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
