:root {
  --bg: #06111f;
  --bg-2: #0a1830;
  --panel: rgba(10, 22, 43, 0.88);
  --panel-2: rgba(8, 18, 34, 0.94);
  --card: rgba(12, 27, 51, 0.92);
  --line: rgba(116, 167, 255, 0.18);
  --line-strong: rgba(68, 204, 255, 0.35);
  --text: #f2f7ff;
  --muted: #9db3cf;
  --accent: #44ccff;
  --accent-2: #00f0a8;
  --accent-3: #ff8f7a;
  --accent-4: #8b7cff;
  --glow: 0 0 0 1px rgba(68, 204, 255, 0.14), 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 18px;
  --sidebar: 300px;
  --sidebar-collapsed: 86px;
  --max: 1660px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(68, 204, 255, 0.16), transparent 26%),
    radial-gradient(circle at 90% 12%, rgba(139, 124, 255, 0.18), transparent 24%),
    radial-gradient(circle at 50% 120%, rgba(0, 240, 168, 0.14), transparent 34%),
    linear-gradient(180deg, #030813 0%, #08111f 35%, #07101d 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 85%);
}

.app-shell {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
  padding: 20px 0 40px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

.sidebar-inner,
.hero,
.section,
.sidebar-metric,
.hero-mini-card,
.metric,
.kpi,
.calc-box,
.provider-card,
.warning-note,
.callout,
.footer-note {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--glow);
  backdrop-filter: blur(12px);
}

.sidebar-inner::after,
.hero::after,
.section::after,
.sidebar-metric::after,
.hero-mini-card::after,
.metric::after,
.kpi::after,
.calc-box::after,
.provider-card::after,
.warning-note::after,
.callout::after,
.footer-note::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(68, 204, 255, 0.04), transparent 30%, rgba(0, 240, 168, 0.02) 65%, transparent 100%);
}

.sidebar {
  min-width: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 24;
  border: 0;
  padding: 0;
  background: rgba(3, 10, 19, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.sidebar-inner {
  position: sticky;
  top: 16px;
  padding: 22px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(68, 204, 255, 0.3) transparent;
}

.sidebar-inner::-webkit-scrollbar {
  width: 8px;
}

.sidebar-inner::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(68, 204, 255, 0.26);
}

.sidebar-inner::-webkit-scrollbar-track {
  background: transparent;
}

.main-content {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(68, 204, 255, 0.22);
  background: rgba(68, 204, 255, 0.09);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  letter-spacing: -0.03em;
}

.sidebar-brand h1 {
  margin-top: 0;
  font-size: clamp(2.2rem, 2vw, 2.9rem);
  line-height: 0.95;
}

.sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand p,
.hero-copy,
.section-head p,
.sidebar-note,
.sidebar-future p,
.hero-side p,
.metric p,
.hero-mini-card p,
.calc-box p,
.warning-note,
.footer-note,
.callout {
  color: var(--muted);
  line-height: 1.7;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.sidebar-nav a.is-active {
  border-color: rgba(68, 204, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(68, 204, 255, 0.12), rgba(68, 204, 255, 0.06)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(68, 204, 255, 0.08);
}

.sidebar-nav a::before {
  content: attr(data-short);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(68, 204, 255, 0.18);
  background: rgba(68, 204, 255, 0.08);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sidebar-nav a.is-active::before {
  border-color: rgba(68, 204, 255, 0.28);
  background: linear-gradient(180deg, rgba(68, 204, 255, 0.2), rgba(0, 240, 168, 0.12));
  color: #e7fbff;
  box-shadow: 0 0 0 4px rgba(68, 204, 255, 0.08);
}

.sidebar-nav a:hover {
  border-color: var(--line-strong);
  background: rgba(68, 204, 255, 0.08);
  transform: translateX(2px);
}

.sidebar-section {
  display: grid;
  gap: 12px;
}

.sidebar-kicker,
.panel-kicker,
.hero-side label,
.metric label,
.hero-mini-card label,
.kpi label,
.field label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scenario-stack {
  display: grid;
  gap: 10px;
}

.scenario-stack-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.scenario-note-inline {
  margin: 0 0 18px;
}

.scenario-button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.scenario-button strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.scenario-button span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.scenario-button:hover,
.scenario-button.is-active {
  border-color: var(--line-strong);
  background: rgba(68, 204, 255, 0.09);
  transform: translateY(-1px);
}

.sidebar-metrics {
  display: grid;
  gap: 10px;
}

.sidebar-metric {
  padding: 14px 16px;
}

.sidebar-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
  line-height: 1.1;
}

.sidebar-future {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-future strong {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 1.15rem;
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.sidebar-toggle:hover {
  border-color: var(--line-strong);
  background: rgba(68, 204, 255, 0.1);
  transform: translateY(-1px);
}

.sidebar-toggle span {
  display: block;
  width: 3px;
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero,
.section {
  padding: 28px;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.82fr);
  gap: 22px;
  align-items: stretch;
}

.hero-main,
.hero-side {
  position: relative;
  z-index: 1;
}

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

.hero-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta-pill,
.hero-health-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-dashboard-title {
  margin-top: 14px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.hero-copy {
  max-width: 60ch;
  margin-top: 18px;
  font-size: 1rem;
}

.hero-overview-grid,
.hero-kpi-grid,
.hero-status-bar {
  display: grid;
  gap: 16px;
}

.hero-overview-grid {
  grid-template-columns: minmax(0, 1.48fr) minmax(360px, 0.72fr);
  gap: 18px;
  margin-top: 20px;
  align-items: start;
  grid-auto-rows: min-content;
}

.hero-side-panel,
.hero-kpi-card,
.hero-projection-panel,
.hero-status-chip {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    linear-gradient(120deg, rgba(68, 204, 255, 0.03), transparent 55%);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-side-panel {
  padding: 18px;
  align-self: start;
}

.hero-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.hero-kpi-card strong,
.hero-projection-head strong,
.hero-status-chip strong {
  display: block;
  margin-top: 8px;
}

.hero-kpi-card strong {
  font-size: 1.6rem;
}

.hero-kpi-card-target strong {
  color: var(--accent);
}

.hero-kpi-card-domains strong {
  color: #8ee8ff;
}

.hero-kpi-card-revenue strong {
  color: var(--accent-2);
}

.hero-kpi-card-cost strong {
  color: var(--accent-3);
}

.hero-kpi-card p,
.hero-projection-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-projection-panel {
  padding: 18px;
  align-self: start;
  height: auto;
}

.hero-projection-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.hero-projection-note {
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: right;
}

.hero-chart-wrap {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top left, rgba(68, 204, 255, 0.05), transparent 32%);
}

.hero-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.hero-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-chart-legend i {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 999px;
}

.legend-send {
  background: linear-gradient(90deg, rgba(68, 204, 255, 0.95), rgba(68, 204, 255, 0.35));
}

.legend-revenue {
  background: linear-gradient(90deg, rgba(0, 240, 168, 0.95), rgba(0, 240, 168, 0.35));
}

.hero-projection-chart {
  display: block;
  width: 100%;
  height: 270px;
}

.hero-projection-footer {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hero-projection-step {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-kpi-card:hover,
.hero-projection-step:hover,
.provider-summary-card:hover,
.domain-summary-card:hover,
.template-summary-card:hover,
.family-summary-card:hover {
  border-color: rgba(68, 204, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018)),
    linear-gradient(120deg, rgba(68, 204, 255, 0.05), transparent 55%);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.hero-projection-step label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-projection-step strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-projection-step span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hero-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.hero-side-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 168, 0.18);
  background: rgba(0, 240, 168, 0.08);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-panel-head strong {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  color: var(--accent-2);
}

.hero-provider-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.hero-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-provider-row:last-child {
  border-bottom: 0;
}

.hero-provider-row span {
  color: var(--muted);
  font-size: 0.94rem;
}

.hero-provider-row strong {
  color: var(--text);
  font-size: 0.96rem;
}

.hero-ops-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-ops-note p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-status-bar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.hero-status-chip {
  display: grid;
  gap: 8px;
}

.hero-status-chip strong {
  margin-top: 0;
  font-size: 1.3rem;
}

.hero-mini-grid,
.grid-4,
.kpi-strip,
.inputs,
.calc-grid,
.provider-grid,
.grid-2,
.domains-grid,
.provider-summary-grid,
.domain-form {
  display: grid;
  gap: 16px;
}

.hero-mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.hero-mini-card,
.metric,
.kpi,
.calc-box,
.provider-card {
  padding: 16px;
}

.hero-mini-card strong,
.metric strong,
.kpi strong,
.calc-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.section-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-top: 14px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.section-head p {
  max-width: 70ch;
  margin: 14px 0 0;
}

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

.callout,
.warning-note,
.footer-note {
  margin-top: 18px;
  padding: 16px 18px;
}

.finance-note-wide {
  position: relative;
  z-index: 1;
}

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

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

input,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  padding: 14px 15px;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  padding: 14px 15px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(68, 204, 255, 0.08);
}

textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(68, 204, 255, 0.08);
}

.calc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

.subsection-title {
  margin-bottom: 16px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.mode-copy,
.mode-helper {
  color: var(--muted);
  line-height: 1.6;
}

.mode-copy {
  margin: 6px 0 0;
}

.mode-helper {
  margin: 0 0 14px;
}

.mode-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.mode-toggle:hover {
  border-color: var(--line-strong);
  background: rgba(68, 204, 255, 0.08);
}

.mode-switch {
  width: 56px;
  height: 30px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.mode-knob {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 10px rgba(0, 240, 168, 0.22);
  transition: transform 0.18s ease;
}

.mode-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.mode-toggle[data-mode="auto"] .mode-knob {
  transform: translateX(26px);
}

.mode-toggle[data-mode="manual"] .mode-label:first-child,
.mode-toggle[data-mode="auto"] .mode-label:last-child {
  color: var(--text);
}

.provider-title {
  margin-top: 18px;
}

.provider-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.domains-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  margin-bottom: 18px;
}

.domain-summary-grid {
  margin-bottom: 16px;
}

.domain-form-card,
.domain-summary-card,
.provider-summary-card,
.template-form-card,
.template-summary-card,
.family-summary-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--glow);
  backdrop-filter: blur(12px);
  padding: 18px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.domain-form-card::after,
.domain-summary-card::after,
.provider-summary-card::after,
.template-form-card::after,
.template-summary-card::after,
.family-summary-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(68, 204, 255, 0.04), transparent 30%, rgba(0, 240, 168, 0.02) 65%, transparent 100%);
}

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

.field-wide {
  grid-column: 1 / -1;
}

.domain-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.primary-button {
  border: 1px solid rgba(68, 204, 255, 0.26);
  background: linear-gradient(180deg, rgba(68, 204, 255, 0.16), rgba(68, 204, 255, 0.08));
  color: var(--text);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.primary-button:hover,
.ghost-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.provider-summary-card {
  padding: 14px;
  display: grid;
  grid-template-rows: 52px auto;
  align-content: start;
}

.provider-summary-card label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
}

.provider-summary-card strong {
  display: block;
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--accent-2);
}

.compact-box strong {
  font-size: 1.8rem;
}

.templates-grid,
.template-form,
.template-summary-grid,
.family-pill-grid {
  display: grid;
  gap: 16px;
}

.templates-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  margin-bottom: 18px;
}

.template-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.domain-checklist {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

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

.check-item {
  display: flex;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 0.95rem;
}

.check-item input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-top: 3px;
  padding: 0;
  box-shadow: none;
}

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

.family-pill {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.family-pill label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-pill strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
  color: var(--accent-2);
}

.family-pill p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.78);
  backdrop-filter: blur(6px);
}

.preview-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 24px auto;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--glow);
  display: grid;
  gap: 16px;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-theme-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.preview-theme-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.preview-theme-button:hover {
  color: var(--text);
}

.preview-theme-button.is-active {
  background: linear-gradient(180deg, rgba(18, 205, 255, 0.24), rgba(18, 205, 255, 0.1));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(18, 205, 255, 0.18);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.preview-head h3 {
  margin-top: 12px;
  font-size: 1.7rem;
}

.preview-meta {
  color: var(--muted);
  line-height: 1.6;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
}

.preview-frame {
  display: block;
  width: min(430px, calc(100vw - 64px));
  min-height: 72vh;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.mini-fields {
  display: grid;
  gap: 8px;
}

.mini-fields label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-fields input {
  padding: 12px 13px;
}

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

.money-good {
  color: var(--accent-2);
}

.money-cost {
  color: var(--accent-3);
}

.table-wrap {
  position: relative;
  z-index: 1;
  overflow: auto;
  margin-top: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(8, 18, 34, 0.72);
}

.table-space-top {
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 940px;
}

th,
td {
  padding: 16px 16px;
  border-bottom: 1px solid rgba(116, 167, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(13, 36, 58, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 rgba(116, 167, 255, 0.12);
}

td {
  color: var(--text);
  line-height: 1.55;
}

.money {
  color: var(--accent-2);
  font-weight: 700;
}

.cost-money {
  color: var(--accent-3);
  font-weight: 700;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-note,
body.sidebar-collapsed .sidebar-future,
body.sidebar-collapsed .sidebar-metrics,
body.sidebar-collapsed .sidebar-kicker,
body.sidebar-collapsed .sidebar-nav a span,
body.sidebar-collapsed .badge {
  display: none;
}

body.sidebar-collapsed .sidebar-inner {
  padding: 18px 12px;
  justify-items: center;
}

body.sidebar-collapsed .sidebar-topbar {
  width: 100%;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sidebar-section {
  width: 100%;
}

body.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .sidebar-toggle span:nth-child(1) {
  transform: translateX(6px);
}

body.sidebar-collapsed .sidebar-toggle span:nth-child(2) {
  opacity: 0.75;
}

body.sidebar-collapsed .sidebar-toggle span:nth-child(3) {
  transform: translateX(-6px);
}

body.layout-compact .app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 16px;
}

body.layout-compact .sidebar-inner {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  padding: 18px;
  justify-items: stretch;
}

body.layout-compact.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

body.layout-compact.sidebar-collapsed .sidebar-brand,
body.layout-compact.sidebar-collapsed .sidebar-note,
body.layout-compact.sidebar-collapsed .sidebar-future,
body.layout-compact.sidebar-collapsed .sidebar-metrics,
body.layout-compact.sidebar-collapsed .sidebar-kicker,
body.layout-compact.sidebar-collapsed .sidebar-nav a span,
body.layout-compact.sidebar-collapsed .badge {
  display: none;
}

body.layout-compact.sidebar-collapsed .sidebar-inner {
  padding: 18px 12px;
  justify-items: center;
}

body.layout-compact.sidebar-collapsed .sidebar-topbar {
  width: 100%;
  justify-content: center;
}

body.layout-compact.sidebar-collapsed .sidebar-nav,
body.layout-compact.sidebar-collapsed .sidebar-section {
  width: 100%;
}

body.layout-compact.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.layout-overlay.sidebar-drawer-open .sidebar-backdrop {
  display: block;
}

body.layout-overlay .app-shell {
  grid-template-columns: 1fr;
  width: min(calc(100% - 18px), var(--max));
}

body.layout-overlay .sidebar {
  position: static;
}

body.layout-overlay .sidebar-inner {
  position: fixed;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: min(320px, calc(100vw - 20px));
  max-height: none;
  padding: 20px;
  transform: translateX(calc(-100% - 18px));
  transition: transform 0.2s ease;
  z-index: 30;
}

body.layout-overlay.sidebar-drawer-open .sidebar-inner {
  transform: translateX(0);
}

body.layout-overlay .main-content {
  min-width: 0;
}

@media (max-width: 1360px) {
  .app-shell {
    width: min(calc(100% - 20px), var(--max));
  }
}

@media (max-width: 1180px) {
  .hero-overview-grid,
  .hero-kpi-grid,
  .hero-dashboard-grid,
  .hero-status-row,
  .finance-grid,
  .grid-4,
  .hero-mini-grid,
  .kpi-strip,
  .inputs,
  .provider-grid,
  .grid-2,
  .domains-grid,
  .provider-summary-grid,
  .domain-form,
  .templates-grid,
  .template-form,
  .template-summary-grid,
  .family-pill-grid,
  .checklist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-bar {
    display: block;
  }

  .mode-toggle {
    margin-top: 14px;
  }

  .hero-projection-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-top: 14px;
  }

  .hero,
  .section,
  .sidebar-inner {
    padding: 20px;
  }

  .sidebar-nav,
  .hero-overview-grid,
  .hero-kpi-grid,
  .hero-dashboard-grid,
  .hero-status-row,
  .hero-mini-grid,
  .grid-4,
  .kpi-strip,
  .inputs,
  .calc-grid,
  .provider-grid,
  .grid-2,
  .domains-grid,
  .provider-summary-grid,
  .domain-form,
  .templates-grid,
  .template-form,
  .template-summary-grid,
  .family-pill-grid,
  .checklist-grid,
  .scenario-stack-inline {
    grid-template-columns: 1fr;
  }

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

  .section-head {
    display: block;
  }

  .hero-dashboard-title {
    font-size: 2.7rem;
  }

  .hero-toolbar,
  .hero-toolbar-meta {
    align-items: start;
    flex-direction: column;
  }
}
