:root {
  --bg: #edf4fb;
  --surface: #ffffff;
  --surface-muted: #f7faff;
  --ink: #040918;
  --text: #111827;
  --muted: #66758d;
  --soft: #8491a6;
  --line: #dbe4ef;
  --line-soft: #e7edf5;
  --nav: #050a19;
  --nav-muted: #8b99b1;
  --nav-active: #0e3b58;
  --blue: #21aeea;
  --blue-strong: #0ea5e9;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--nav);
  color: #d7deea;
  padding: 14px 10px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  min-height: 48px;
  align-items: center;
  color: #f8fbff;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 10px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #58d5ff, #138bd9);
  box-shadow: 0 0 0 3px rgba(33, 174, 234, 0.12);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  line-height: 1;
}

.brand small,
.user-chip small {
  margin-top: 5px;
  color: var(--nav-muted);
  font-size: 0.72rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.nav-section-label {
  margin: 30px 0 12px;
  color: var(--nav-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.nav-list a,
.sidebar-note a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #c7d1e0;
  font-weight: 400;
  padding: 0 14px;
  text-decoration: none;
}

.nav-list a span,
.sidebar-note a span {
  width: 22px;
  color: #96a4b8;
  font-size: 1.1rem;
  text-align: center;
}

.nav-list a:hover,
.nav-list .active {
  border-color: rgba(67, 180, 226, 0.38);
  background: var(--nav-active);
  color: #74d4ff;
}

.nav-list .active {
  box-shadow: inset 0 0 0 1px rgba(67, 180, 226, 0.14);
}

.sidebar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin-top: auto;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #26b8f4, #149ddd);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 400;
  box-shadow: 0 14px 30px rgba(20, 157, 221, 0.24);
}

.sidebar-action span {
  font-size: 1.3rem;
  font-weight: 400;
}

.sidebar-note {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 22px;
}

.main-content {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  padding: 0 28px 0 32px;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(330px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f9fbff;
  color: var(--muted);
  padding: 0 14px;
}

.search-shell input {
  min-height: 30px;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

button,
.details-button,
.launch-primary {
  min-height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.icon-action {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #344258;
  font-size: 1.1rem;
}

.icon-action:hover {
  background: var(--surface-muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--line);
  margin-left: 8px;
  padding-left: 18px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dff8ff, #c7f5da);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
}

.user-chip strong {
  display: block;
}

.command-hero,
.workspace-grid,
.analytics-section {
  width: min(100%, 1728px);
  margin: 0 auto;
}

.command-hero {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.58fr);
  padding: 26px 28px 0;
}

.hero-copy {
  min-height: 112px;
  border-radius: 24px 0 0 24px;
  background:
    radial-gradient(circle at 88% 20%, rgba(33, 174, 234, 0.12), transparent 26%),
    linear-gradient(135deg, #050916 0%, #050817 64%, #06101f 100%);
  color: #ffffff;
  padding: 16px 22px;
}

.hero-kickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-kickers span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d9e4f3;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0 10px;
}

.hero-copy h1 {
  max-width: 680px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-copy p {
  max-width: 660px;
  margin: 10px 0 0;
  color: #b9c5d8;
  font-size: 0.92rem;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-primary {
  gap: 10px;
  min-height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #42c6f4, #159fe0);
  box-shadow: 0 20px 42px rgba(33, 174, 234, 0.28);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 400;
  padding: 0 14px;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 400;
  padding: 0 14px;
  text-decoration: none;
}

.readiness-panel {
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.readiness-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.readiness-heading strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
}

.readiness-panel > p {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.4;
}

.readiness-ring {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 10px solid #e2e8f3;
  border-radius: 50%;
  color: var(--text);
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #f8fafc;
  padding: 8px;
}

.metric-card p,
.metric-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.metric-card p {
  font-weight: 700;
  font-size: 0.7rem;
}

.metric-card strong {
  display: block;
  margin: 5px 0 0;
  font-size: 1rem;
  line-height: 1;
}

.metric-card span {
  display: none;
}

.metric-card.blue {
  border-color: #bae6fd;
}

.metric-card.green {
  border-color: #bbf7d0;
}

.metric-card.amber {
  border-color: #fde68a;
}

.metric-card.red {
  border-color: #fecaca;
}

.workspace-grid {
  display: grid;
  gap: 24px;
  padding: 26px 28px 0;
}

.work-panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.portfolio-heading {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
  padding: 24px 24px 20px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.portfolio-heading h1 {
  font-size: 1.7rem;
  line-height: 1.1;
}

.summary {
  max-width: 520px;
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.45;
}

.toolbar {
  display: grid;
  grid-template-columns: 154px 154px auto;
  align-items: end;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.label {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  color: var(--text);
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.view-toggle button {
  min-width: 54px;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: #eef2f7;
  color: #334155;
}

.view-toggle .active {
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
}

.project-grid {
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
}

.project-card {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) minmax(300px, 1.45fr) 120px;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.project-card.selected {
  border-color: #bae6fd;
  outline: 2px solid rgba(33, 174, 234, 0.22);
  background: linear-gradient(90deg, #ffffff, #fbfdff);
}

.project-card > * {
  border-right: 1px solid var(--line-soft);
  padding: 30px 24px;
}

.project-card > *:last-child {
  border-right: 0;
}

.initiative-status {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.initiative-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  border-radius: 10px;
  background: #e2e8f0;
  color: var(--text);
  font-weight: 800;
}

.initiative-icon.critical {
  background: #111827;
  color: #34d399;
}

.initiative-icon.healthy {
  background: #e2e8f0;
  color: var(--text);
}

.initiative-icon.at-risk {
  background: #fff7ed;
  color: #c2410c;
}

.initiative-icon.complete {
  background: #86efac;
  color: #064e3b;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0 9px;
  text-transform: uppercase;
}

.health-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  margin-right: 5px;
}

.health-badge.critical {
  background: var(--red);
}

.health-badge.healthy {
  background: var(--green);
}

.health-badge.at-risk {
  background: var(--amber);
}

.health-badge.complete {
  background: var(--blue);
}

.initiative-name {
  display: grid;
  align-content: center;
}

.project-title {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.25;
  padding: 0;
  text-align: left;
}

.initiative-name span {
  margin-top: 8px;
  color: var(--muted);
}

.initiative-name small {
  margin-top: 6px;
  color: #52627a;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.initiative-progress {
  display: grid;
  align-content: center;
  gap: 12px;
}

.initiative-progress p {
  max-width: 340px;
  margin: 0;
  overflow: hidden;
  color: #28364c;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-label strong {
  color: var(--text);
  font-size: 0.78rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.progress-track .critical {
  background: #111827;
}

.progress-track .healthy {
  background: var(--green);
}

.progress-track .at-risk {
  background: var(--amber);
}

.progress-track .complete {
  background: var(--blue);
}

.assignees {
  display: flex;
  align-items: center;
  min-height: 22px;
}

.assignees span,
.assignees em {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #dbeafe;
  color: #0f172a;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  margin-right: -5px;
}

.assignees span:nth-child(2) {
  background: #cffafe;
}

.assignees em {
  background: #f1f5f9;
}

.initiative-actions {
  position: relative;
  min-height: 100%;
  background: #fbfdff;
}

.action-controls {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  justify-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1;
  padding: 0;
  text-decoration: none;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover {
  background: #eef6ff;
  color: #0369a1;
}

.launch-primary {
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.ghost-action,
.danger-action,
.primary-action,
.secondary-action {
  min-height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 650;
  padding: 0 10px;
}

.ghost-action {
  border: 0;
  background: transparent;
  color: var(--text);
}

.danger-action {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

.danger-action:hover {
  background: #fff1f2;
  color: #be123c;
}

.environment-links {
  display: grid;
  align-items: center;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  gap: 0;
  justify-items: stretch;
  width: auto;
}

.environment-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  padding: 0 12px;
  text-decoration: none;
  text-transform: uppercase;
}

.environment-links a:nth-child(1) {
  background: #eff6ff;
}

.environment-links a:nth-child(2) {
  background: #f5f3ff;
}

.environment-links a:nth-child(3) {
  background: #ecfdf5;
}

.environment-links a:hover {
  filter: saturate(1.08) brightness(0.98);
  color: var(--text);
}

.primary-action,
.secondary-action {
  border: 0;
  background: var(--ink);
  color: #ffffff;
}

.primary-action.hero-primary {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #42c6f4, #159fe0);
  box-shadow: 0 20px 42px rgba(33, 174, 234, 0.28);
  font-weight: 400;
}

.strategy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 132px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 42, 64, 0.92)),
    repeating-linear-gradient(90deg, rgba(96, 165, 250, 0.14) 0 1px, transparent 1px 30px);
  box-shadow: var(--shadow);
  color: #ffffff;
  padding: 28px 30px;
}

.strategy-banner strong,
.strategy-banner span {
  display: block;
}

.strategy-banner span {
  margin-top: 8px;
  color: #b7c3d6;
}

.strategy-banner button {
  min-width: 128px;
  border: 0;
  background: #ffffff;
  color: var(--text);
  font-weight: 650;
}

.empty-card {
  display: grid;
  min-height: 160px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.portfolio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  border-top: 1px solid var(--line-soft);
  color: #334155;
  padding: 18px 22px 20px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination button {
  min-width: 32px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.pagination .active {
  background: var(--ink);
  color: #ffffff;
}

.analytics-section {
  display: grid;
  gap: 24px;
  margin: 0 auto;
  padding: 24px 28px 34px;
}

.detail-panel,
.risk-panel {
  padding: 24px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 24px;
  margin-bottom: 24px;
}

.split-grid .work-panel {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.label {
  margin: 0 0 8px;
}

.stage-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill.low,
.stage-pill.launch-ready {
  background: #dcfce7;
  color: #047857;
}

.status-pill.medium,
.stage-pill.user-testing {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.high {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill.neutral,
.stage-pill.discovery,
.stage-pill.build {
  background: #e2e8f0;
  color: #334155;
}

.detail-copy {
  margin: 16px 0;
  color: var(--muted);
  line-height: 1.6;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-stats div {
  min-height: 92px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #f8fafc;
  padding: 14px;
}

.detail-stats span,
.detail-stats small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-stats strong {
  display: block;
  margin: 4px 0;
  line-height: 1.35;
}

.action-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.action-stack a,
.action-stack button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-weight: 650;
  padding: 0 12px;
  text-decoration: none;
}

.action-stack a::after {
  content: "↗";
  color: var(--blue);
}

.action-stack button {
  background: var(--ink);
  color: #ffffff;
}

.kpi-list,
.timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.kpi-row,
.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fbfdff;
  padding: 14px;
}

.kpi-row span,
.timeline-item span {
  color: var(--muted);
}

.kpi-row em {
  color: var(--green);
  font-style: normal;
  font-weight: 650;
}

.timeline-item {
  grid-template-columns: 126px minmax(0, 1fr);
}

.timeline-item time {
  color: var(--blue);
  font-weight: 650;
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item span {
  margin-top: 4px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.risk-card {
  border: 1px solid var(--line-soft);
  border-top-width: 4px;
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
}

.risk-card span {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
}

.risk-card strong {
  display: block;
  margin-top: 8px;
}

.risk-card p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.4;
}

.risk-card small {
  color: var(--muted);
}

.risk-card.low {
  border-top-color: var(--green);
}

.risk-card.medium {
  border-top-color: var(--amber);
}

.risk-card.high {
  border-top-color: var(--red);
}

.project-dialog,
.confirm-dialog {
  width: min(880px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
  padding: 0;
}

.confirm-dialog {
  width: min(520px, calc(100% - 32px));
}

.project-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(17, 24, 39, 0.44);
}

.project-dialog form,
.confirm-dialog form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.modal-heading,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-actions {
  justify-content: end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.spinning {
  animation: spin 500ms ease;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .command-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .readiness-panel {
    border-radius: 22px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-action {
    margin-top: 24px;
  }

  .sidebar-note {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card {
    grid-template-columns: 150px minmax(180px, 1fr) minmax(260px, 1.4fr) 112px;
  }

  .detail-stats,
  .action-stack,
  .risk-grid,
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar,
  .portfolio-heading,
  .portfolio-footer {
    align-items: stretch;
    display: grid;
  }

  .topbar {
    padding: 14px;
  }

  .sidebar {
    padding: 16px 10px;
  }

  .nav-section-label {
    margin-top: 20px;
  }

  .sidebar-action {
    margin-top: 18px;
  }

  .nav-list,
  .sidebar-note {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-hero,
  .workspace-grid,
  .analytics-section {
    padding: 18px;
  }

  .hero-copy {
    min-height: auto;
    padding: 26px;
  }

  .hero-copy h1 {
    font-size: 2.1rem;
  }

  .readiness-panel {
    min-height: auto;
    padding: 22px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .search-shell {
    width: 100%;
  }

  .toolbar,
  .split-grid,
  .risk-grid,
  .detail-stats,
  .action-stack,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card > * {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 18px;
  }

  .project-card > *:last-child {
    border-bottom: 0;
  }

  .initiative-actions {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 14px;
  }

  .action-controls,
  .environment-links {
    display: flex;
    position: static;
    transform: none;
    justify-content: flex-start;
    width: 100%;
  }

  .initiative-progress p {
    white-space: normal;
  }

  .initiative-actions {
    justify-items: stretch;
  }

  .details-button,
  .launch-primary {
    width: 100%;
  }

  .strategy-banner {
    display: grid;
  }

  .strategy-banner button {
    width: 100%;
  }

  .modal-heading,
  .form-actions {
    align-items: stretch;
    display: grid;
  }
}
