@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Manrope:wght@600;700;800&display=swap');

:root {
  --bg: #f4f7fb;
  --bg-strong: #eaf0f6;
  --surface: #ffffff;
  --surface-soft: #f8fbfe;
  --surface-muted: #edf3f8;
  --ink: #071c31;
  --text: #12263b;
  --muted: #607086;
  --subtle: #8795a6;
  --line: rgba(15, 41, 67, 0.11);
  --line-strong: rgba(15, 41, 67, 0.18);
  --navy: #082642;
  --navy-2: #0c3558;
  --steel: #2b5f88;
  --blue: #3579b8;
  --blue-soft: #e4f1fb;
  --cyan: #7cc9e8;
  --green: #16734d;
  --green-soft: #dcf3e7;
  --red: #a43c45;
  --red-soft: #fde4e6;
  --amber: #9a681e;
  --amber-soft: #fff0d4;
  --gray: #677789;
  --gray-soft: #e8eef4;
  --shadow-sm: 0 8px 20px rgba(7, 28, 49, 0.06);
  --shadow: 0 18px 50px rgba(7, 28, 49, 0.10);
  --shadow-lg: 0 28px 80px rgba(7, 28, 49, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --container: 1200px;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Manrope", "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 8% -10%, rgba(53, 121, 184, 0.18), transparent 34rem),
    radial-gradient(circle at 96% 8%, rgba(124, 201, 232, 0.14), transparent 30rem),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 46%, #eef4f9 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
strong { color: var(--ink); }
code {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: #eef5fb;
  color: var(--navy);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(var(--container), calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(7, 28, 49, 0.10);
  background: rgba(250, 253, 255, 0.88);
  backdrop-filter: blur(22px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.header-inner,
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-inner { min-height: 76px; }
.brand-lockup {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 260px;
}
.header-mobile-slot {
  display: none;
  flex: 0 0 auto;
}
.brand-logo { display: block; }
.brand-logo-horizontal { width: clamp(168px, 21vw, 250px); }
.brand-logo-square { width: 78px; }

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}
.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.54rem 0.7rem;
  border-radius: 999px;
  color: #56677a;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.main-nav a:hover { color: var(--navy); background: rgba(53, 121, 184, 0.08); transform: translateY(-1px); }
.main-nav a.active { color: var(--navy); background: #e7f1fa; box-shadow: inset 0 0 0 1px rgba(43, 95, 136, 0.10); }
.mobile-nav-toggle {
  display: none !important;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(43, 95, 136, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--navy);
  box-shadow: 0 10px 24px rgba(7, 28, 49, 0.04);
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; flex: 0 0 auto; }
.header-actions .button { padding: 0.72rem 1rem; font-size: 0.8rem; box-shadow: none; }

.page-main { flex: 1; }
.section { padding: 4.6rem 0; }
.section-compact { padding: 2.8rem 0; }
.hero { padding: 5.2rem 0 4.7rem; }

.hero-grid,
.split-grid,
.dashboard-grid,
.admin-grid,
.feature-grid,
.stats-grid,
.cards-grid,
.two-column-grid,
.process-layout,
.risk-layout,
.reporting-layout,
.auth-layout,
.portal-layout {
  display: grid;
  gap: 1.35rem;
}
.hero-grid { grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr); align-items: center; }
.split-grid,
.two-column-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); }
.portal-layout { grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.55fr); align-items: start; }
.feature-grid,
.cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.enterprise-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.enterprise-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.enterprise-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-grid { grid-template-columns: 1fr; }
.process-layout { grid-template-columns: minmax(300px, 0.4fr) minmax(0, 0.6fr); align-items: start; }
.process-left-rail,
.process-main-column,
.process-support-stack {
  display: grid;
  gap: 1.35rem;
}

.process-full-banner {
  grid-column: 1 / -1;
  margin-top: 0;
}
.risk-layout { grid-template-columns: minmax(0, 0.64fr) minmax(300px, 0.36fr); align-items: start; }
.reporting-layout { grid-template-columns: minmax(320px, 0.45fr) minmax(0, 0.55fr); align-items: start; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  width: fit-content;
  padding: 0.42rem 0.74rem;
  border: 1px solid rgba(43, 95, 136, 0.14);
  border-radius: 999px;
  background: linear-gradient(180deg, #edf7ff, #e5f0f8);
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(43, 95, 136, 0.06);
}
.eyebrow::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 0 0 4px rgba(53, 121, 184, 0.10);
}

.hero h1,
.page-title,
.section-title {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -0.052em;
}
.hero h1 { margin-top: 1.15rem; font-size: clamp(2.6rem, 5.4vw, 5.6rem); line-height: 0.94; }
.page-title { margin-top: 1rem; font-size: clamp(2.25rem, 4.6vw, 4.2rem); line-height: 0.98; max-width: 920px; }
.section-title { font-size: clamp(1.85rem, 3vw, 3rem); line-height: 1.02; }
.lead,
.section-intro,
.muted,
.body-copy,
.footer-note,
.helper-text {
  color: var(--muted);
  line-height: 1.72;
}
.lead { max-width: 700px; margin: 1.1rem 0 0; font-size: clamp(1rem, 1.65vw, 1.16rem); }
.body-copy { margin: 0; font-size: 0.96rem; }
.section-header { max-width: 760px; margin-bottom: 2rem; }
.section-header.centered { margin-left: auto; margin-right: auto; text-align: center; display: grid; justify-items: center; }
.section-header.compact { margin-bottom: 1.35rem; }

.hero-card,
.card,
.table-card,
.form-card,
.metric-card,
.faq-item,
.banner,
.empty-state,
.chart-card,
.panel-card,
.timeline-panel,
.risk-panel,
.reporting-panel,
.portal-panel,
.auth-panel,
.cta-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card,
.hero-card,
.form-card,
.metric-card,
.chart-card,
.panel-card,
.timeline-panel,
.risk-panel,
.reporting-panel,
.portal-panel,
.auth-panel,
.cta-panel { padding: 1.55rem; }
.card,
.metric-card,
.chart-card,
.table-card,
.form-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card:hover,
.metric-card:hover,
.chart-card:hover,
.table-card:hover,
.form-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(43, 95, 136, 0.18); }

.hero-card {
  min-height: 430px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(246,250,253,0.92) 55%, rgba(228,241,251,0.72) 100%);
  box-shadow: var(--shadow-lg);
}
.hero-card::before,
.panel-card::before,
.cta-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(53,121,184,0.13), transparent 30%),
    radial-gradient(circle at 90% 14%, rgba(124,201,232,0.18), transparent 15rem);
}
.hero-card > *, .panel-card > *, .cta-panel > * { position: relative; }

.card,
.hero-card,
.table-card,
.form-card,
.metric-card,
.faq-item,
.banner,
.empty-state,
.chart-card,
.panel-card,
.timeline-panel,
.risk-panel,
.reporting-panel,
.process-sidebar,
.risk-sidebar,
.reporting-sidebar,
.enterprise-control-card,
.cta-benefit-card {
  color: var(--ink);
}

.card h1,
.card h2,
.card h3,
.card h4,
.hero-card h1,
.hero-card h2,
.hero-card h3,
.hero-card h4,
.table-card h1,
.table-card h2,
.table-card h3,
.table-card h4,
.form-card h1,
.form-card h2,
.form-card h3,
.form-card h4,
.metric-card h1,
.metric-card h2,
.metric-card h3,
.metric-card h4,
.chart-card h1,
.chart-card h2,
.chart-card h3,
.chart-card h4,
.panel-card h1,
.panel-card h2,
.panel-card h3,
.panel-card h4,
.process-sidebar h1,
.process-sidebar h2,
.process-sidebar h3,
.process-sidebar h4,
.risk-sidebar h1,
.risk-sidebar h2,
.risk-sidebar h3,
.risk-sidebar h4,
.reporting-sidebar h1,
.reporting-sidebar h2,
.reporting-sidebar h3,
.reporting-sidebar h4,
.enterprise-control-card h1,
.enterprise-control-card h2,
.enterprise-control-card h3,
.enterprise-control-card h4,
.cta-benefit-card h1,
.cta-benefit-card h2,
.cta-benefit-card h3,
.cta-benefit-card h4,
.cta-benefit-card strong {
  color: var(--ink);
}

.card p,
.card .body-copy,
.card .section-intro,
.card .helper-text,
.card li,
.hero-card p,
.hero-card .body-copy,
.hero-card .section-intro,
.hero-card .helper-text,
.hero-card li,
.table-card p,
.table-card .body-copy,
.table-card .section-intro,
.table-card .helper-text,
.table-card li,
.form-card p,
.form-card .body-copy,
.form-card .section-intro,
.form-card .helper-text,
.form-card li,
.metric-card p,
.metric-card .body-copy,
.metric-card .section-intro,
.metric-card .helper-text,
.metric-card li,
.chart-card p,
.chart-card .body-copy,
.chart-card .section-intro,
.chart-card .helper-text,
.chart-card li,
.panel-card p,
.panel-card .body-copy,
.panel-card .section-intro,
.panel-card .helper-text,
.panel-card li,
.process-sidebar p,
.process-sidebar .body-copy,
.process-sidebar .section-intro,
.process-sidebar .helper-text,
.process-sidebar li,
.risk-sidebar p,
.risk-sidebar .body-copy,
.risk-sidebar .section-intro,
.risk-sidebar .helper-text,
.risk-sidebar li,
.reporting-sidebar p,
.reporting-sidebar .body-copy,
.reporting-sidebar .section-intro,
.reporting-sidebar .helper-text,
.reporting-sidebar li,
.enterprise-control-card p,
.enterprise-control-card .body-copy,
.enterprise-control-card .section-intro,
.enterprise-control-card .helper-text,
.enterprise-control-card li,
.cta-benefit-card p,
.cta-benefit-card .body-copy,
.cta-benefit-card .section-intro,
.cta-benefit-card .helper-text,
.cta-benefit-card li,
.cta-benefit-card span {
  color: var(--muted);
}

.card .metric-label,
.hero-card .metric-label,
.table-card .metric-label,
.form-card .metric-label,
.metric-card .metric-label,
.chart-card .metric-label,
.panel-card .metric-label,
.process-sidebar .metric-label,
.risk-sidebar .metric-label,
.reporting-sidebar .metric-label,
.enterprise-control-card .metric-label,
.cta-benefit-card .metric-label {
  color: var(--subtle);
}

.card a:not(.button),
.hero-card a:not(.button),
.table-card a:not(.button),
.form-card a:not(.button),
.metric-card a:not(.button),
.chart-card a:not(.button),
.panel-card a:not(.button),
.process-sidebar a:not(.button),
.risk-sidebar a:not(.button),
.reporting-sidebar a:not(.button),
.enterprise-control-card a:not(.button),
.cta-benefit-card a:not(.button),
.card .button-link,
.hero-card .button-link,
.table-card .button-link,
.form-card .button-link,
.metric-card .button-link,
.chart-card .button-link,
.panel-card .button-link,
.process-sidebar .button-link,
.risk-sidebar .button-link,
.reporting-sidebar .button-link,
.enterprise-control-card .button-link,
.cta-benefit-card .button-link {
  color: var(--steel);
}

.card h3,
.faq-item h3,
.table-card h3,
.form-card h3,
.chart-card h3,
.panel-card h3 {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.18;
  letter-spacing: -0.026em;
}
.card h3::after,
.panel-card h3::after {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), transparent);
}

.button-row {
  display: flex;
  gap: 0.85rem;
  column-gap: 0.85rem;
  row-gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.65rem;
  align-items: center;
}
.button-row > * {
  margin: 0 !important;
}
.button,
button,
input[type="submit"] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.86rem 1.18rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.button:hover,
button:hover,
input[type="submit"]:hover { transform: translateY(-1px); }
.button-primary,
button,
input[type="submit"] {
  color: #fff;
  background: linear-gradient(135deg, #061d33 0%, #0c3558 58%, #27618e 100%);
  box-shadow: 0 14px 28px rgba(8, 38, 66, 0.18);
}
.site-header .mobile-nav-toggle {
  display: none !important;
}
.button-secondary {
  color: var(--navy);
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(15, 41, 67, 0.15);
  box-shadow: 0 10px 24px rgba(7, 28, 49, 0.04);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #781b2b 0%, #a7283d 58%, #cf4459 100%);
  box-shadow: 0 14px 28px rgba(167, 40, 61, 0.24);
}
.button-link { color: var(--steel); font-weight: 850; }

.trust-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; margin-top: 1.65rem; }
.trust-pill,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5faff, #eaf3fa);
  border: 1px solid rgba(43, 95, 136, 0.10);
  color: var(--navy-2);
  font-size: 0.78rem;
  font-weight: 800;
}
.trust-pill { padding: 0.95rem; border-radius: 15px; line-height: 1.25; }
.pill-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill { padding: 0.54rem 0.75rem; }

.metric-card { overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(249,252,255,0.92)); }
.metric-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -2.3rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: rgba(53, 121, 184, 0.08);
}
.metric-label { color: var(--subtle); text-transform: uppercase; letter-spacing: 0.13em; font-size: 0.68rem; font-weight: 900; }
.metric-value { margin: 0.32rem 0 0.18rem; color: var(--ink); font-family: var(--font-heading); font-size: clamp(1.55rem, 2.3vw, 2.1rem); font-weight: 850; line-height: 1; letter-spacing: -0.045em; }
.metric-subtle { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

.enterprise-grid-compact .metric-card {
  min-height: 232px;
  padding: 1.45rem 1.35rem 1.5rem;
}

.enterprise-grid-compact .metric-value {
  font-size: clamp(1.12rem, 1.65vw, 1.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.enterprise-grid-compact .metric-subtle {
  max-width: none;
  font-size: 0.8rem;
  line-height: 1.5;
}

.enterprise-control-card {
  position: relative;
  overflow: hidden;
  min-height: 196px;
  padding: 1.4rem 1.35rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,252,255,0.92));
  box-shadow: var(--shadow-sm);
}

.enterprise-control-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -2.3rem;
  width: 6rem;
  height: 6rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(53,121,184,0.08), rgba(53,121,184,0));
}

.enterprise-control-card h3 {
  margin: 0.55rem 0 0;
  max-width: 15ch;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.7vw, 1.78rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.enterprise-control-card p {
  margin: 0.7rem 0 0;
  max-width: 30ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.34rem 0.66rem;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-positive { background: var(--green-soft); color: var(--green); }
.badge-negative { background: var(--red-soft); color: var(--red); }
.badge-neutral { background: var(--blue-soft); color: var(--steel); }
.badge-muted { background: var(--gray-soft); color: var(--gray); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }

.list-clean { margin: 0; padding-left: 1.1rem; color: var(--muted); line-height: 1.75; }
.list-clean li + li { margin-top: 0.45rem; }

.banner,
.empty-state { padding: 1.15rem 1.25rem; }
.banner {
  border-left: 4px solid var(--blue);
  background: linear-gradient(90deg, rgba(228,241,251,0.86), rgba(255,255,255,0.92));
}
.empty-state {
  color: var(--muted);
  background: linear-gradient(180deg, rgba(249,252,255,0.95), rgba(241,247,252,0.95));
  border-style: dashed;
}
.success-banner { border-radius: 14px; background: var(--green-soft); color: var(--green); padding: 1rem 1.2rem; font-weight: 700; }
.error-list { margin-bottom: 1rem; border-radius: 14px; background: var(--red-soft); color: var(--red); padding: 1rem 1.2rem; }

.faq-list {
  display: grid;
  gap: 1rem;
  max-width: 900px;
}

.faq-accordion {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.92));
  box-shadow: 0 16px 34px rgba(7, 28, 49, 0.08);
  overflow: hidden;
}

.faq-accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.3;
}

.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-question {
  display: block;
  max-width: calc(100% - 3rem);
}

.faq-accordion summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e7f1fa;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(43, 95, 136, 0.1);
}

.faq-accordion[open] summary::after {
  content: "−";
}

.faq-accordion[open] summary::after {
  content: "−";
}

.faq-accordion[open] summary {
  border-bottom: 1px solid rgba(15, 41, 67, 0.08);
}

.faq-answer {
  padding: 1rem 1.35rem 1.3rem;
  color: var(--muted);
  line-height: 1.72;
  font-size: 0.95rem;
}

.faq-answer p {
  margin: 0;
}

/* Legal pages */
.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(280px, 0.32fr);
  gap: 1.35rem;
  align-items: start;
}

.legal-content {
  display: grid;
  gap: 1rem;
}

.legal-summary,
.legal-section,
.legal-sidebar {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.legal-summary,
.legal-section {
  padding: 1.55rem;
}

.legal-summary {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(247,251,255,0.96) 65%, rgba(228,241,251,0.78) 100%);
}

.legal-summary p:last-child,
.legal-section p:last-child,
.legal-sidebar p:last-child {
  margin-bottom: 0;
}

.legal-alert {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(164, 60, 69, 0.14);
  background: linear-gradient(180deg, rgba(253,228,230,0.78), rgba(255,255,255,0.92));
  color: var(--red);
}

.legal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.legal-stat {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(43, 95, 136, 0.12);
  background: rgba(255,255,255,0.78);
}

.legal-stat-label {
  display: block;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 900;
}

.legal-stat strong {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  line-height: 1.2;
}

.legal-section h2,
.legal-sidebar h3 {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
}

.legal-section h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.legal-section p,
.legal-sidebar p {
  color: var(--muted);
  line-height: 1.72;
}

.legal-list {
  margin: 0.85rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.72;
}

.legal-list li + li {
  margin-top: 0.45rem;
}

.legal-sidebar {
  position: relative;
  top: auto;
  padding: 1.4rem;
  overflow: hidden;
  background: linear-gradient(145deg, #082642 0%, #123d61 60%, #245d87 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-lg);
}

.legal-sidebar::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(124, 201, 232, 0.18);
  right: -90px;
  top: -90px;
}

.legal-sidebar > * {
  position: relative;
}

.legal-sidebar .metric-label,
.legal-sidebar p,
.legal-sidebar a {
  color: rgba(255,255,255,0.8);
}

.legal-sidebar .metric-label {
  display: block;
  margin-bottom: 0.5rem;
}

.legal-sidebar-list {
  display: grid;
  gap: 0.72rem;
  margin-top: 1rem;
}

.legal-sidebar-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

.legal-sidebar-item:last-child {
  border-bottom: 0;
}

.legal-sidebar-item strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fff;
}

.legal-contact-box {
  margin-top: 1.1rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
}

.legal-contact-box a {
  color: #fff;
  font-weight: 800;
}

/* Distinct public page treatments */
.process-timeline { display: grid; gap: 0.9rem; counter-reset: step; }
.process-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-sm);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--steel));
  font-weight: 900;
}
.step-content h3 { margin: 0 0 0.32rem; color: var(--ink); font-size: 1rem; }
.step-content p { margin: 0; color: var(--muted); line-height: 1.62; font-size: 0.92rem; }
.process-sidebar,
.risk-sidebar,
.reporting-sidebar {
  position: relative;
  top: auto;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(247,251,255,0.95) 58%, rgba(228,241,251,0.8) 100%);
  color: var(--text);
  border: 1px solid rgba(43, 95, 136, 0.14);
  border-radius: var(--radius-xl);
  padding: 1.55rem;
  box-shadow: var(--shadow);
}
.process-sidebar .metric-label,
.risk-sidebar .metric-label,
.reporting-sidebar .metric-label { color: var(--steel); }
.process-sidebar h2,
.risk-sidebar h2,
.reporting-sidebar h2 { margin: 0.5rem 0 0.8rem; font-family: var(--font-heading); letter-spacing: -0.04em; color: var(--ink); }
.process-sidebar p,
.risk-sidebar p,
.reporting-sidebar p { color: var(--muted); line-height: 1.7; }

.risk-matrix { display: grid; gap: 0.85rem; }
.risk-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.36fr) minmax(0, 0.64fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow-sm);
}
.risk-row h3 { margin: 0; font-size: 0.98rem; color: var(--ink); }
.risk-row p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 0.9rem; }
.control-list { display: grid; gap: 0.72rem; margin-top: 1rem; }
.control-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid rgba(43,95,136,0.12); }
.control-item:last-child { border-bottom: 0; }
.control-item span:first-child { color: var(--steel); }
.control-item span:last-child { color: var(--ink); font-weight: 850; }

.process-sidebar .control-item span:first-child,
.risk-sidebar .control-item span:first-child,
.reporting-sidebar .control-item span:first-child,
.performance-source-panel .control-item span:first-child {
  color: var(--steel) !important;
}

.process-sidebar .control-item span:last-child,
.risk-sidebar .control-item span:last-child,
.reporting-sidebar .control-item span:last-child,
.performance-source-panel .control-item span:last-child {
  color: var(--ink) !important;
}

.reporting-dashboard { display: grid; gap: 1rem; }
.report-module { padding: 1.15rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.88); box-shadow: var(--shadow-sm); }
.report-module-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.reporting-dashboard-upgrade { gap: 1.1rem; }
.performance-snapshot-module {
  padding: clamp(1.2rem, 2.4vw, 1.65rem);
  background:
    radial-gradient(circle at 90% 12%, rgba(53, 121, 184, 0.08), transparent 16rem),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,250,254,0.96));
}
.performance-snapshot-module h3,
.reporting-mini-grid .report-module h3 {
  margin: 0;
  color: var(--ink);
}
.performance-snapshot-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.68;
}
.home-performance-period-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.home-performance-period-panel {
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(15, 41, 67, 0.08);
  background: rgba(251,253,255,0.9);
  box-shadow: 0 12px 30px rgba(8, 30, 51, 0.05);
}
.home-performance-period-panel h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}
.home-performance-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0.9rem 0 0;
}
.performance-snapshot-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.performance-mini-stat {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 41, 67, 0.08);
  background: rgba(255,255,255,0.88);
}
.performance-mini-stat strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  letter-spacing: -0.04em;
}
.performance-snapshot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  gap: 1rem;
}
.performance-snapshot-card {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(15, 41, 67, 0.08);
  background: rgba(251,253,255,0.95);
}
.performance-snapshot-card h4 {
  margin: 0.28rem 0 0.85rem;
  color: var(--ink);
  font-size: 1.03rem;
}
.snapshot-line-chart {
  width: 100%;
  height: 170px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(220,243,231,0.72), rgba(255,255,255,0.35)),
    linear-gradient(180deg, rgba(244,248,252,0.96), rgba(235,242,248,0.9));
  border: 1px solid rgba(15, 41, 67, 0.06);
  padding: 0.65rem;
}
.snapshot-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  min-height: 170px;
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 41, 67, 0.06);
  background:
    linear-gradient(180deg, rgba(244,248,252,0.96), rgba(235,242,248,0.9));
}
.snapshot-bar-group {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  align-self: end;
}
.snapshot-bar {
  width: min(92px, 100%);
  min-height: 52px;
  border-radius: 18px 18px 8px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem 0.55rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.snapshot-bar span {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.15;
}
.snapshot-bar-positive {
  background: linear-gradient(180deg, #63c18d, #16734d);
}
.snapshot-bar-strong {
  background: linear-gradient(180deg, #4d8fc9, #123d61);
}
.snapshot-bar-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.reporting-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cta-panel-upgrade {
  overflow: hidden;
  padding: clamp(1.6rem, 3vw, 2.35rem);
  border-radius: 32px;
  background:
    radial-gradient(circle at 6% 18%, rgba(53, 121, 184, 0.10), transparent 18rem),
    radial-gradient(circle at 92% 16%, rgba(124, 201, 232, 0.20), transparent 16rem),
    linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(247,251,255,0.95) 58%, rgba(236,245,251,0.92) 100%);
  box-shadow: var(--shadow-lg);
}

.cta-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 1.7rem;
  align-items: stretch;
}

.cta-panel-copy {
  display: grid;
  align-content: start;
  gap: 1.3rem;
}

.cta-panel-copy .section-header {
  max-width: none;
  margin-bottom: 0;
}

.cta-panel-header .section-intro {
  max-width: 50rem;
}

.cta-panel-copy .section-title {
  max-width: 15ch;
}

.cta-copy-intro {
  max-width: 46rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid rgba(43, 95, 136, 0.18);
  background: rgba(255,255,255,0.46);
  border-radius: 0 18px 18px 0;
}

.cta-copy-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.cta-actions-block {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.15rem;
}

.cta-benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0;
}

.cta-benefit-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-height: 100%;
  padding: 1.15rem 1.1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgba(43, 95, 136, 0.12);
  background: rgba(255,255,255,0.74);
  box-shadow: 0 14px 28px rgba(7, 28, 49, 0.05);
}

.cta-benefit-card strong {
  display: block;
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.cta-benefit-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.58;
}

.cta-helper {
  margin: 0;
  max-width: 34rem;
  font-size: 0.86rem;
  line-height: 1.62;
}

.cta-proof-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.55rem;
  border-radius: 28px;
  background: linear-gradient(145deg, #082642 0%, #123d61 58%, #245d87 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-lg);
  color: #eef4fb;
}

.cta-proof-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(124, 201, 232, 0.16);
  right: -88px;
  top: -92px;
}

.cta-proof-card > * {
  position: relative;
}

.cta-proof-card .metric-label {
  color: rgba(255,255,255,0.68);
}

.cta-proof-card h3 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  max-width: 18ch;
}

.cta-proof-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0;
}

.cta-proof-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 1rem 1rem 1rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
}

.cta-proof-item:last-child {
  margin-bottom: 0;
}

.cta-proof-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 0.48rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.74);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.cta-proof-content {
  min-width: 0;
}

.cta-proof-content strong {
  display: block;
  margin-top: 0.1rem;
  color: #ffffff;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.cta-proof-content p {
  margin: 0.38rem 0 0;
  color: rgba(255,255,255,0.78);
  line-height: 1.58;
  font-size: 0.92rem;
}

.cta-proof-note {
  margin-top: 0.15rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
}

.cta-proof-note strong,
.cta-proof-note a {
  color: #ffffff;
}

.cta-proof-note a {
  font-weight: 850;
}

.report-module h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.report-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.45rem; align-items: end; min-height: 92px; }
.report-bar { border-radius: 10px 10px 5px 5px; min-height: 22px; background: linear-gradient(180deg, var(--cyan), var(--blue)); }
.report-bar.muted-bar { background: linear-gradient(180deg, #d5e4ef, #b5c9da); }
.report-table-preview { display: grid; gap: 0.5rem; }
.report-line { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.report-line:last-child { border-bottom: 0; }
.report-line strong { color: var(--ink); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: 0.42rem; }
.field-full { grid-column: 1 / -1; }
label { color: var(--navy); font-size: 0.78rem; font-weight: 850; letter-spacing: -0.01em; }
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(15, 41, 67, 0.14);
  border-radius: 13px;
  background: rgba(255,255,255,0.94);
  color: var(--text);
  padding: 0.76rem 0.86rem;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  color-scheme: light;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
select,
select option,
select optgroup {
  background: #ffffff;
  color: var(--navy);
}
textarea { min-height: 140px; resize: vertical; }
input:focus,
select:focus,
textarea:focus { border-color: rgba(53, 121, 184, 0.55); box-shadow: 0 0 0 4px rgba(53, 121, 184, 0.11); background: #fff; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.95rem; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.checkbox-row input { width: auto; min-height: auto; margin-top: 0.2rem; }
.auth-helper-row { display: flex; justify-content: flex-end; }
.auth-panel { overflow: hidden; max-width: 780px; margin: 0 auto; }
.auth-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--navy), var(--blue), var(--cyan)); }
.auth-brand { width: 92px; margin-bottom: 1.2rem; }

/* Tables and data surfaces */
.table-card { overflow: auto; background: rgba(255,255,255,0.9); }
.table-card h3 { padding: 1.1rem 1.25rem 0.8rem; margin: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 680px; }
th,
td { text-align: left; padding: 0.86rem 1rem; border-bottom: 1px solid rgba(15,41,67,0.08); font-size: 0.86rem; vertical-align: top; }
th { color: #728196; background: rgba(246,250,253,0.88); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.66rem; font-weight: 900; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(239,247,253,0.55); }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.table-actions .button,
.table-actions button { min-height: 36px; padding: 0.54rem 0.76rem; font-size: 0.75rem; }
.mini-form { display: flex; flex-wrap: wrap; gap: 0.48rem; align-items: center; }
.mini-form input,
.mini-form select { width: auto; min-width: 110px; max-width: 160px; min-height: 36px; padding: 0.52rem 0.62rem; border-radius: 10px; font-size: 0.78rem; }
.mini-form label { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.72rem; }
.mini-form input[type="checkbox"] { width: 16px; min-width: 16px; min-height: 16px; }
.settings-form { display: grid; gap: 0.95rem; }
.settings-form label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.78rem; }
.settings-form input,
.settings-form select { width: 100%; max-width: none; min-width: 0; }
.account-action-cell { min-width: 360px; }
.account-size-current { display: block; margin-bottom: 0.22rem; }
.account-settings-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.account-settings-form input,
.account-settings-form select { min-width: 102px; max-width: 138px; }
.account-action-buttons { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.account-action-buttons .account-enable-button {
  color: #ffffff !important;
  background: linear-gradient(135deg, #16734d 0%, #1f9b69 58%, #39c287 100%) !important;
  box-shadow: 0 14px 28px rgba(31, 155, 105, 0.24) !important;
}
.account-action-buttons .account-disable-button {
  color: #ffffff !important;
  background: linear-gradient(135deg, #781b2b 0%, #a7283d 58%, #cf4459 100%) !important;
  box-shadow: 0 14px 28px rgba(167, 40, 61, 0.24) !important;
}
.account-inline-feedback { display: block; margin-top: 0.55rem; font-weight: 700; }
.account-inline-feedback-success { color: var(--green); }
.account-inline-feedback-error { color: var(--red); }
.dashboard-account-filter { margin-bottom: 0.95rem; }
.dashboard-account-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 1.35rem;
}
.dashboard-account-toolbar .dashboard-account-filter {
  flex: 1 1 auto;
  margin-bottom: 0;
}
.dashboard-account-actions-cell {
  min-width: 250px;
}
.dashboard-account-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}
.dashboard-account-row-actions .button {
  min-width: 132px;
  justify-content: center;
}
.dashboard-account-feedback {
  display: block;
  margin-top: 0.55rem;
  font-weight: 700;
}
.dashboard-account-feedback-success {
  color: var(--green);
}
.dashboard-account-feedback-error {
  color: var(--red);
}

/* Charts */
.chart-card { overflow: hidden; }
.chart-card svg { width: 100%; height: 220px; }
.chart-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(36px, 1fr)); gap: 0.65rem; align-items: end; min-height: 220px; }
.chart-bar-wrap { display: grid; gap: 0.5rem; justify-items: center; }
.chart-bar { width: 100%; border-radius: 12px 12px 6px 6px; background: var(--surface-muted); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0.45rem; color: #fff; font-size: 0.72rem; font-weight: 800; }
.chart-bar-positive { background: linear-gradient(180deg, #64b985, var(--green)); }
.chart-bar-negative { background: linear-gradient(180deg, #d67980, var(--red)); }
.chart-bar-neutral { background: linear-gradient(180deg, #88a9c4, var(--steel)); }
.chart-label { color: var(--muted); font-size: 0.74rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.55rem; }
.calendar-cell { min-height: 96px; padding: 0.75rem; border-radius: 16px; border: 1px solid rgba(21, 50, 75, 0.08); background: #fff; }
.calendar-cell.positive { background: var(--green-soft); }
.calendar-cell.negative { background: var(--red-soft); }
.calendar-cell.neutral { background: var(--blue-soft); }

.performance-filter-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.performance-filter-form label {
  grid-column: 1 / -1;
}

.performance-filter-form select,
.performance-filter-form input,
.performance-filter-form button {
  width: 100%;
  max-width: none;
}

.performance-note {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.88rem;
}

.performance-chart-grid {
  align-items: stretch;
}

.performance-value-positive {
  color: var(--green) !important;
}

.performance-value-negative {
  color: var(--red) !important;
}

.performance-portal-header {
  margin-bottom: 1.65rem;
}

.performance-portal-panel {
  align-self: stretch;
}

.performance-portal-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.95rem;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.performance-portal-form > * {
  margin: 0 !important;
}

.performance-portal-form label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
}

.performance-portal-account-row,
.performance-portal-form > .performance-portal-dates,
.performance-portal-form > .performance-portal-actions {
  width: 100%;
}

.performance-portal-account-row select,
.performance-portal-form input[type="date"] {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy);
  box-shadow: none;
}

.performance-portal-account-row select:focus,
.performance-portal-form input[type="date"]:focus {
  outline: none;
  border-color: rgba(124, 201, 232, 0.9);
  box-shadow: 0 0 0 3px rgba(124, 201, 232, 0.18);
}

.performance-portal-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem !important;
  column-gap: 0.95rem !important;
  row-gap: 0.95rem !important;
  width: 100%;
}

.performance-portal-date-field {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.performance-portal-form input[type="date"] {
  min-width: 0 !important;
  display: block;
  width: 100% !important;
}

.performance-portal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.95rem !important;
  column-gap: 0.95rem !important;
  row-gap: 0.95rem !important;
  width: 100%;
  margin-top: 0.15rem;
  align-items: stretch;
}

.performance-portal-actions > * {
  margin: 0 !important;
  min-width: 0;
}

.performance-portal-form button,
.performance-export-button {
  width: 100%;
  min-height: 44px;
  white-space: nowrap;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(7, 28, 49, 0.08);
}

.performance-portal-form button:hover,
.performance-export-button:hover {
  background: #ffffff;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
  padding: 0.5rem 0 0;
}

.chart-card-wide .chart-container {
  height: 300px;
}

.line-chart {
  display: block;
  width: 100%;
  height: 260px;
  padding: 0.65rem 0 0.15rem;
}

.line-chart-positive {
  background: linear-gradient(180deg, rgba(220,243,231,0.38), rgba(255,255,255,0));
}

.line-chart-negative {
  background: linear-gradient(180deg, rgba(253,228,230,0.38), rgba(255,255,255,0));
}

.monthly-chart-bars .chart-label {
  font-size: 0.68rem;
}

.performance-calendar-card {
  padding: 1.15rem 1.2rem 1.25rem;
}

.performance-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.performance-calendar-header h3 {
  margin: 0.35rem 0 0;
  padding: 0;
}

.performance-calendar-actions {
  margin-top: 0;
}

.performance-weekdays {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.performance-weekdays div {
  padding: 0.4rem 0.2rem;
  color: var(--subtle);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.66rem;
  font-weight: 900;
}

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

.performance-calendar-cell {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.performance-calendar-cell.empty,
.performance-calendar-cell.calendar-outside {
  background: rgba(239, 245, 251, 0.68);
}

.performance-calendar-cell.calendar-today {
  box-shadow: inset 0 0 0 2px rgba(43, 95, 136, 0.24);
}

.performance-calendar-day {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.performance-calendar-pnl {
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.calendar-outside .performance-calendar-day,
.calendar-outside .helper-text {
  opacity: 0.58;
}

/* Footer */
.footer { margin-top: 3rem; border-top: 1px solid rgba(7,28,49,0.10); background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(245,249,252,0.95)); }
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 2rem; padding: 2.25rem 0; }
.footer-brand { display: grid; gap: 0.8rem; justify-items: start; }
.brand-kicker { color: var(--steel); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.68rem; font-weight: 900; }
.brand-name { color: var(--ink); font-family: var(--font-heading); font-size: 1.15rem; font-weight: 850; letter-spacing: -0.03em; }
.footer h3 { margin: 0 0 0.85rem; color: var(--ink); font-size: 0.92rem; }
.footer-links { display: grid; gap: 0.52rem; }
.footer-links a { color: var(--muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--navy); }
.footer-bottom { border-top: 1px solid rgba(7,28,49,0.08); padding: 1rem 0 1.6rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1120px) {
  .header-inner { align-items: flex-start; flex-wrap: wrap; padding: 0.85rem 0; }
  .main-nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 980px) {
  .hero-grid,
  .split-grid,
  .two-column-grid,
  .dashboard-grid,
  .feature-grid,
  .cards-grid,
  .enterprise-grid,
  .stats-grid,
  .footer-grid,
  .process-layout,
  .risk-layout,
  .reporting-layout,
  .portal-layout,
  .legal-layout { grid-template-columns: 1fr; }
  .process-sidebar,
  .risk-sidebar,
  .reporting-sidebar,
  .legal-sidebar { position: relative; top: auto; }
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .legal-summary-grid { grid-template-columns: 1fr; }
  .cta-panel-grid,
  .cta-benefit-grid { grid-template-columns: 1fr; }
  .cta-panel-copy .section-title,
  .cta-proof-card h3,
  .cta-copy-intro,
  .cta-helper { max-width: none; }
  .enterprise-control-grid { grid-template-columns: 1fr; }
  .enterprise-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .container { width: min(var(--container), calc(100% - 1.1rem)); }
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }
  .footer-top { align-items: flex-start; flex-direction: column; }
  .brand-lockup {
    min-width: 0;
    max-width: calc(100% - 8.25rem);
    flex: 0 1 auto;
  }
  .header-mobile-slot {
    display: flex;
    margin-left: auto;
    align-items: center;
    justify-content: flex-end;
  }
  .brand-logo-horizontal { width: min(210px, 100%); }
  .site-header .mobile-nav-toggle {
    display: inline-flex !important;
    margin-left: 0;
  }
  .header-actions {
    order: 4;
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }
  .header-actions .button { flex: 1 1 auto; }
  .main-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.7rem;
    border-radius: 18px;
    border: 1px solid rgba(43, 95, 136, 0.12);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
  }
  .site-header.nav-open .main-nav { display: flex; }
  .main-nav a {
    width: 100%;
    justify-content: flex-start;
    padding: 0.78rem 0.9rem;
    border-radius: 14px;
    font-size: 0.86rem;
  }
  .trust-strip,
  .calendar-grid { grid-template-columns: 1fr; }
  .enterprise-grid,
  .enterprise-grid-compact,
  .enterprise-control-grid { grid-template-columns: 1fr; }
  .hero { padding: 3.7rem 0 3.2rem; }
  .section { padding: 3.3rem 0; }
  .hero h1 { font-size: clamp(2.4rem, 14vw, 4rem); }
  .page-title { font-size: clamp(2.05rem, 11vw, 3.25rem); }
  .risk-row { grid-template-columns: 1fr; }
  .cta-proof-item { grid-template-columns: 1fr; }
  .cta-proof-step { justify-self: start; }
  table { min-width: 620px; }
  .performance-calendar-header { flex-direction: column; align-items: flex-start; }
  .performance-portal-dates {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .performance-portal-actions {
    grid-template-columns: 1fr;
  }
}

/* Polished authenticated and account-access layouts */
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.65rem;
}

.portal-panel,
.auth-brand-panel {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(145deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: clamp(1.35rem, 2.5vw, 2rem);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.portal-panel::after,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(77, 145, 188, 0.22);
  right: -90px;
  top: -90px;
}

.portal-panel h3,
.auth-brand-panel h1 {
  color: #fff;
  margin: 0.35rem 0 0.75rem;
}

.portal-panel .portal-status-positive {
  color: var(--green) !important;
}

.portal-panel .portal-status-negative {
  color: var(--red) !important;
}

.portal-panel p,
.auth-brand-panel p {
  color: rgba(255,255,255,0.76);
}

.portal-panel,
.auth-brand-panel,
.legal-sidebar,
.process-sidebar,
.risk-sidebar,
.reporting-sidebar {
  color: #eef4fb;
}

.portal-panel h1,
.portal-panel h2,
.portal-panel h3,
.portal-panel h4,
.auth-brand-panel h1,
.auth-brand-panel h2,
.auth-brand-panel h3,
.auth-brand-panel h4,
.legal-sidebar h1,
.legal-sidebar h2,
.legal-sidebar h3,
.legal-sidebar h4,
.process-sidebar h1,
.process-sidebar h2,
.process-sidebar h3,
.process-sidebar h4,
.risk-sidebar h1,
.risk-sidebar h2,
.risk-sidebar h3,
.risk-sidebar h4,
.reporting-sidebar h1,
.reporting-sidebar h2,
.reporting-sidebar h3,
.reporting-sidebar h4 {
  color: var(--ink);
}

.portal-panel h1,
.portal-panel h2,
.portal-panel h3,
.portal-panel h4,
.auth-brand-panel h1,
.auth-brand-panel h2,
.auth-brand-panel h3,
.auth-brand-panel h4 {
  color: #ffffff;
}

.portal-panel p,
.portal-panel .body-copy,
.portal-panel .helper-text,
.portal-panel li,
.portal-panel span,
.auth-brand-panel p,
.auth-brand-panel .body-copy,
.auth-brand-panel .helper-text,
.auth-brand-panel li,
.auth-brand-panel span,
.legal-sidebar p,
.legal-sidebar .body-copy,
.legal-sidebar .helper-text,
.legal-sidebar .metric-label,
.legal-sidebar li,
.legal-sidebar span,
.process-sidebar p,
.process-sidebar .body-copy,
.process-sidebar .helper-text,
.process-sidebar .metric-label,
.process-sidebar li,
.process-sidebar span,
.risk-sidebar p,
.risk-sidebar .body-copy,
.risk-sidebar .helper-text,
.risk-sidebar .metric-label,
.risk-sidebar li,
.risk-sidebar span,
.reporting-sidebar p,
.reporting-sidebar .body-copy,
.reporting-sidebar .helper-text,
.reporting-sidebar .metric-label,
.reporting-sidebar li,
.reporting-sidebar span {
  color: var(--muted);
}

.portal-panel p,
.portal-panel .body-copy,
.portal-panel .helper-text,
.portal-panel li,
.portal-panel span,
.auth-brand-panel p,
.auth-brand-panel .body-copy,
.auth-brand-panel .helper-text,
.auth-brand-panel li,
.auth-brand-panel span {
  color: rgba(255,255,255,0.78);
}

.portal-panel .metric-label,
.auth-brand-panel .metric-label {
  color: rgba(255,255,255,0.68);
}

.portal-panel strong,
.portal-panel b,
.auth-brand-panel strong,
.auth-brand-panel b,
.legal-sidebar strong,
.legal-sidebar b,
.process-sidebar strong,
.process-sidebar b,
.risk-sidebar strong,
.risk-sidebar b,
.reporting-sidebar strong,
.reporting-sidebar b {
  color: var(--ink);
}

.portal-panel strong,
.portal-panel b,
.auth-brand-panel strong,
.auth-brand-panel b {
  color: #ffffff;
}

.portal-panel a:not(.button),
.auth-brand-panel a:not(.button),
.legal-sidebar a:not(.button),
.process-sidebar a:not(.button),
.risk-sidebar a:not(.button),
.reporting-sidebar a:not(.button),
.portal-panel .button-link,
.auth-brand-panel .button-link,
.legal-sidebar .button-link,
.process-sidebar .button-link,
.risk-sidebar .button-link,
.reporting-sidebar .button-link {
  color: var(--steel);
}

.portal-panel .button-row,
.auth-brand-panel .button-row {
  position: relative;
  z-index: 1;
}

.auth-brand-panel .control-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  border-bottom-color: rgba(255,255,255,0.08);
}

.auth-brand-panel .control-item > span:first-child {
  color: rgba(230, 238, 248, 0.72) !important;
  min-width: 0;
}

.auth-brand-panel .control-item > span:last-child {
  color: #ffffff !important;
  display: block;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.auth-brand-panel .control-item > span:last-child a {
  color: #ffffff !important;
  overflow-wrap: anywhere;
}

.auth-section {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.auth-shell {
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 0.7fr);
  gap: 1.35rem;
  align-items: stretch;
}

.auth-shell-single {
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr);
}

.auth-card {
  margin: 0;
}

.table-card h3 {
  padding: 1.15rem 1.2rem 0;
  margin-bottom: 0.6rem;
}

.admin-shell {
  display: grid;
  gap: 1.75rem;
}

.admin-section-group {
  margin-top: 0;
}

.admin-panel-grid .panel-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-panel-grid .button-row {
  margin-top: auto;
}

.admin-table-card {
  overflow: hidden;
}

.admin-table-card-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.2rem 0.95rem;
  border-bottom: 1px solid rgba(15, 41, 67, 0.08);
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.95), rgba(245, 249, 253, 0.9));
}

.admin-table-card-header h3 {
  margin: 0;
  padding: 0;
}

.admin-table-card-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 48rem;
}

.admin-table-card table {
  margin-top: 0;
}

.admin-control-panel .button-row {
  margin-top: 1rem;
}

.admin-control-row-tight {
  margin-top: 0.85rem !important;
}

@media (max-width: 920px) {
  .portal-layout,
  .auth-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    display: block;
  }
  .auth-brand-panel {
    margin-bottom: 1rem;
    padding: 1.2rem 1rem;
  }
  .auth-brand-panel .control-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }
  .auth-brand-panel .control-item > span:last-child {
    text-align: left;
  }
}

/* Admin control refinement */
.admin-action-cell {
  min-width: 460px;
}
.admin-client-editor {
  display: grid;
  gap: 0.75rem;
}
.admin-client-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(136px, 1fr));
  gap: 0.7rem;
  align-items: start;
}
.admin-client-form input,
.admin-client-form select {
  width: 100%;
  max-width: none;
}
.admin-client-form label {
  min-height: 34px;
  padding: 0.42rem 0.5rem;
  border-radius: 10px;
  background: rgba(246, 250, 253, 0.84);
  border: 1px solid rgba(15, 41, 67, 0.08);
}
.admin-client-form .admin-client-field {
  display: grid;
  gap: 0.35rem;
  align-items: start;
}
.admin-client-form .admin-client-field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.admin-client-form .helper-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.admin-toggle-field {
  display: grid !important;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center !important;
  gap: 0.8rem !important;
  min-height: 84px !important;
  min-width: 0;
  padding: 0.9rem 1.05rem !important;
  border-radius: 18px !important;
  background: rgba(246, 250, 253, 0.94) !important;
  border: 1px solid rgba(15, 41, 67, 0.08) !important;
  cursor: pointer;
  position: relative;
  user-select: none;
  overflow: hidden;
}
.admin-toggle-switch-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-block !important;
  flex: 0 0 50px;
  position: relative;
  width: 50px !important;
  min-width: 50px !important;
  height: 28px;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 999px;
  border: 1px solid rgba(15, 41, 67, 0.12) !important;
  background: linear-gradient(180deg, #d9e3ed 0%, #c3d1df 100%);
  box-shadow: inset 0 1px 2px rgba(7, 28, 49, 0.12);
  cursor: pointer;
  outline: none;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.admin-toggle-switch-input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(7, 28, 49, 0.16);
  transition: transform 0.18s ease;
}
.admin-toggle-switch-input:checked {
  background: linear-gradient(135deg, #16865c 0%, #25aa72 58%, #43c98f 100%);
  border-color: rgba(22, 134, 92, 0.28) !important;
  box-shadow: 0 10px 22px rgba(22, 134, 92, 0.22);
}
.admin-toggle-switch-input:checked::after {
  transform: translateX(22px);
}
.admin-toggle-switch-input:focus-visible {
  box-shadow: 0 0 0 4px rgba(53, 121, 184, 0.18);
}
.admin-toggle-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.admin-toggle-copy strong {
  color: var(--ink);
  display: block;
  max-width: 100%;
  font-size: 0.76rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}
.admin-toggle-copy span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}
.admin-client-form button {
  min-height: 38px;
  justify-self: stretch;
}
.admin-client-actions {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  flex-wrap: nowrap !important;
  width: auto !important;
  max-width: none !important;
  min-width: max-content;
  justify-self: start;
}
.admin-client-actions > button,
.admin-client-actions > form,
.admin-client-actions > form > button {
  flex: 0 0 auto !important;
}
.admin-client-save-button,
.admin-client-delete-form,
.admin-client-delete-form button,
.admin-client-delete-button {
  width: auto !important;
  inline-size: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: nowrap !important;
}
.admin-client-save-button {
  display: inline-flex !important;
  justify-content: center;
  padding-inline: 1.25rem !important;
  flex: 0 0 auto !important;
}
.admin-client-delete-form-hidden {
  display: none !important;
}
.admin-client-delete-button {
  display: inline-flex !important;
  justify-content: center;
  width: auto !important;
  padding-inline: 1.25rem !important;
  border: 0 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #7a1829 0%, #ad2440 58%, #d94a62 100%) !important;
  background-image: linear-gradient(135deg, #7a1829 0%, #ad2440 58%, #d94a62 100%) !important;
  box-shadow: 0 14px 28px rgba(167, 40, 61, 0.24) !important;
  flex: 0 0 auto !important;
}
@media (max-width: 900px) {
  .admin-client-form {
    grid-template-columns: 1fr;
  }
  .admin-client-actions {
    flex-wrap: wrap;
  }
}
.admin-reply-form {
  display: grid;
  gap: 0.75rem;
}
.admin-reply-form textarea {
  min-height: 180px;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  resize: vertical;
  line-height: 1.65;
}
.admin-message-reply-card .button-row {
  margin-top: 0.1rem;
}
.admin-messages-table {
  min-width: 0;
  table-layout: fixed;
}
.admin-messages-table th:nth-child(1),
.admin-messages-table td:nth-child(1) {
  width: 108px;
}
.admin-messages-table th:nth-child(2),
.admin-messages-table td:nth-child(2) {
  width: 88px;
}
.admin-messages-table th:nth-child(3),
.admin-messages-table td:nth-child(3) {
  width: 200px;
}
.admin-messages-table th:nth-child(5),
.admin-messages-table td:nth-child(5) {
  width: 140px;
}
.admin-messages-table th:nth-child(6),
.admin-messages-table td:nth-child(6) {
  width: 132px;
}
.admin-message-from,
.admin-message-preview-cell {
  min-width: 0;
}
.admin-message-preview {
  display: grid;
  gap: 0.35rem;
}
.admin-message-preview strong {
  display: block;
  color: var(--ink);
}
.admin-message-preview-body {
  margin: 0;
  display: block;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}
.admin-message-preview-body-full {
  color: var(--ink);
}
.admin-message-error {
  margin: 0;
  color: #b42318;
}
.admin-message-actions,
.admin-message-delete-form {
  justify-content: flex-start;
}
.admin-message-delete-form {
  margin-top: 0.65rem;
}
.admin-message-delete-form button,
.admin-message-actions button {
  width: 100%;
}
.admin-message-modal-card {
  width: min(920px, 100%);
  padding: 1.6rem;
}
.admin-message-modal-title {
  margin-bottom: 1.1rem;
}
.admin-message-modal-layout {
  display: grid;
  gap: 1rem;
}
.admin-message-meta-card,
.admin-message-modal-message-card,
.admin-message-reply-card {
  padding: 1.15rem 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(15, 41, 67, 0.09);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 28px rgba(15, 41, 67, 0.05);
}
.admin-message-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.admin-message-meta-item {
  display: grid;
  gap: 0.35rem;
}
.admin-message-meta-value {
  color: var(--ink);
  line-height: 1.55;
}
.admin-message-modal-body {
  display: grid;
  gap: 0.65rem;
}
.admin-message-full-text {
  min-height: 0;
  max-height: min(42vh, 420px);
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(15, 41, 67, 0.1);
  background: rgba(245, 249, 252, 0.96);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  line-height: 1.72;
}
.admin-json-block {
  margin: 0;
  padding: 1rem;
  border-radius: 16px;
  background: #0d2741;
  color: #eaf3fb;
  font-size: 0.78rem;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(7, 28, 49, 0.62);
  backdrop-filter: blur(6px);
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  width: min(560px, 100%);
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,249,253,0.96));
  box-shadow: var(--shadow-lg);
}
.modal-card-wide { width: min(760px, 100%); }
.account-modal-detail-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1fr);
  border: 1px solid rgba(15, 41, 67, 0.1);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.96);
}
.account-modal-detail-grid > div {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(15, 41, 67, 0.08);
}
.account-modal-detail-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.account-modal-detail-label {
  background: rgba(240, 247, 252, 0.92);
  color: #728196;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.66rem;
  font-weight: 900;
}
@media (max-width: 760px) {
  .admin-action-cell { min-width: 360px; }
  .admin-client-form { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .account-action-cell { min-width: 320px; }
  .account-settings-form { align-items: stretch; }
  .account-action-buttons { width: 100%; }
  .modal-card-wide { width: min(620px, 100%); }
  .admin-message-modal-card { width: min(680px, 100%); }
  .account-modal-detail-grid { grid-template-columns: 1fr; }
  .admin-message-meta-grid { grid-template-columns: 1fr; }
  .admin-messages-table th:nth-child(1),
  .admin-messages-table td:nth-child(1),
  .admin-messages-table th:nth-child(2),
  .admin-messages-table td:nth-child(2),
  .admin-messages-table th:nth-child(3),
  .admin-messages-table td:nth-child(3),
  .admin-messages-table th:nth-child(5),
  .admin-messages-table td:nth-child(5),
  .admin-messages-table th:nth-child(6),
  .admin-messages-table td:nth-child(6) {
    width: auto;
  }
  .performance-snapshot-metric-grid,
  .reporting-mini-grid,
  .performance-snapshot-grid {
    grid-template-columns: 1fr;
  }
  .snapshot-bars {
    min-height: 148px;
  }
}

/* Native backtest performance reporting */
.performance-hero-section {
  padding-bottom: 2.25rem;
}

.performance-hero-grid,
.platform-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.55fr);
  gap: clamp(1.4rem, 3vw, 2.4rem);
  align-items: start;
}

.performance-source-panel,
.platform-dashboard-panel {
  position: relative;
  top: auto;
  padding: 1.45rem;
  border-radius: 26px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(53, 121, 184, 0.16), transparent 34%),
    radial-gradient(circle at 90% 14%, rgba(124, 201, 232, 0.2), transparent 15rem),
    linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(247,251,255,0.95) 60%, rgba(228,241,251,0.82) 100%);
  border: 1px solid rgba(43, 95, 136, 0.14);
  box-shadow: var(--shadow);
}

.performance-source-panel h2,
.platform-dashboard-panel h2 {
  margin: 0.45rem 0 0.8rem;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.performance-source-panel p,
.platform-dashboard-panel p {
  margin: 0 0 1.05rem;
  color: var(--muted);
  line-height: 1.7;
}

.performance-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.performance-balance-control {
  display: grid;
  gap: 0.42rem;
}

.performance-balance-control label {
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.performance-balance-control input {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(43, 95, 136, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  font-size: 0.98rem;
  font-weight: 850;
}

.performance-balance-control input:focus {
  outline: none;
  border-color: rgba(53, 121, 184, 0.58);
  box-shadow: 0 0 0 4px rgba(124, 201, 232, 0.2);
}

.performance-source-panel .metric-label,
.platform-dashboard-panel .metric-label {
  color: var(--steel);
}

.performance-source-panel strong,
.performance-source-panel b,
.performance-source-panel .banner strong,
.process-sidebar .banner strong,
.risk-sidebar .banner strong {
  color: var(--ink);
}

.performance-source-panel .banner span,
.performance-source-panel .banner .body-copy,
.performance-source-panel .banner .helper-text,
.process-sidebar .banner span,
.process-sidebar .banner .body-copy,
.process-sidebar .banner .helper-text,
.risk-sidebar .banner span,
.risk-sidebar .banner .body-copy,
.risk-sidebar .banner .helper-text {
  color: var(--muted);
}

.section-tight-top {
  padding-top: 1rem;
}

.backtest-stack {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
}

.backtest-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.1rem, 2.3vw, 1.55rem);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,251,255,0.94));
  border: 1px solid rgba(149, 164, 183, 0.35);
  box-shadow: var(--shadow-lg);
}

.backtest-card.featured {
  border-color: rgba(53, 121, 184, 0.24);
}

.backtest-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(53,121,184,0.95), rgba(124,201,232,0.78));
}

.backtest-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.backtest-card-header h2 {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 2.6vw, 2.3rem);
  letter-spacing: -0.055em;
  color: var(--ink);
}

.backtest-card-header p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.6;
}

.backtest-card-actions {
  margin-top: 1.35rem;
  margin-bottom: 0.35rem;
}

.backtest-period-pill {
  flex: 0 0 auto;
  min-width: min(100%, 280px);
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(236,245,252,0.98), rgba(225,239,249,0.94));
  color: var(--ink);
  border: 1px solid rgba(43,95,136,0.14);
  box-shadow: var(--shadow-sm);
}

.backtest-period-pill span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.backtest-period-pill strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}

.backtest-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.backtest-metric {
  min-height: 106px;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(149, 164, 183, 0.3);
  box-shadow: 0 12px 30px rgba(8, 30, 51, 0.06);
}

.backtest-metric.primary {
  background:
    radial-gradient(circle at 10% 0%, rgba(53, 121, 184, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(242,248,253,0.98), rgba(228,241,251,0.94));
  color: var(--ink);
  border-color: rgba(53, 121, 184, 0.24);
}

.backtest-metric span {
  display: block;
  color: var(--subtle);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.backtest-metric.primary span {
  color: var(--steel);
}

.backtest-metric strong {
  display: block;
  margin-top: 0.38rem;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.backtest-metric.primary strong {
  color: var(--green);
}

.backtest-metric small {
  display: block;
  margin-top: 0.42rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.backtest-metric.primary small {
  color: var(--muted);
}

.backtest-chart-shell {
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 14% 0%, rgba(53, 121, 184, 0.18), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(124, 201, 232, 0.18), transparent 15rem),
    linear-gradient(180deg, rgba(251,253,255,0.98), rgba(237,245,251,0.95));
  border: 1px solid rgba(43,95,136,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 12px 30px rgba(8, 30, 51, 0.06);
}

.backtest-chart-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.05rem 0.2rem;
  color: var(--ink);
}

.backtest-chart-topline h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.backtest-chart-topline span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.backtest-chart {
  position: relative;
  width: 100%;
  min-height: 290px;
}

.backtest-svg {
  display: block;
  width: 100%;
  height: auto;
}

.backtest-chart-bg {
  fill: transparent;
}

.backtest-grid-line {
  stroke: rgba(18, 38, 59, 0.1);
  stroke-width: 1;
}

.backtest-grid-line.starting-balance {
  stroke: rgba(53, 121, 184, 0.46);
  stroke-width: 1.4;
  stroke-dasharray: 6 6;
}

.backtest-axis-line {
  stroke: rgba(18, 38, 59, 0.16);
  stroke-width: 1;
}

.backtest-area {
  stroke: none;
}

.backtest-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.backtest-volume.gain {
  fill: rgba(20, 184, 166, 0.64);
}

.backtest-volume.loss {
  fill: rgba(239, 68, 68, 0.58);
}

.backtest-y-label,
.backtest-x-label {
  fill: #718397;
  font-size: 13px;
  font-weight: 750;
}

.backtest-end-dot {
  fill: var(--green);
  stroke: #ffffff;
  stroke-width: 2;
}

.backtest-end-label rect {
  fill: var(--green);
}

.backtest-end-label text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.backtest-hover-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.backtest-hover-layer.is-visible {
  opacity: 1;
}

.backtest-hover-line {
  stroke: rgba(255,255,255,0.62);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.backtest-hover-dot {
  fill: var(--green);
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 8px 16px rgba(20, 184, 166, 0.32));
}

.backtest-hover-capture {
  cursor: crosshair;
  pointer-events: all;
}

.backtest-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 224px;
  max-width: min(272px, calc(100% - 1.5rem));
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.96));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.38), inset 0 1px 0 rgba(255,255,255,0.08);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 0.75rem));
  transition: opacity 150ms ease, transform 150ms ease;
}

.backtest-tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 1rem));
}

.backtest-tooltip strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.94rem;
  letter-spacing: -0.02em;
}

.backtest-tooltip span {
  display: block;
  margin-top: 0.2rem;
  color: rgba(255,255,255,0.62);
  font-size: 0.76rem;
  font-weight: 750;
}

.backtest-tooltip dl {
  display: grid;
  gap: 0.42rem;
  margin: 0.75rem 0 0;
}

.backtest-tooltip dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: baseline;
}

.backtest-tooltip dt {
  color: rgba(255,255,255,0.58);
  font-size: 0.74rem;
  font-weight: 760;
}

.backtest-tooltip dd {
  margin: 0;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.backtest-tooltip dd.positive {
  color: #2dd4bf;
}

.backtest-tooltip dd.negative {
  color: #f87171;
}

.performance-disclaimer-panel {
  margin-top: 1.35rem;
  padding: 1.1rem 1.25rem;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.performance-disclaimer-panel h3 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 1rem;
}

.performance-disclaimer-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.platform-dashboard-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.platform-dashboard-modules .report-module.wide {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .backtest-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .performance-hero-grid,
  .platform-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .performance-source-panel,
  .platform-dashboard-panel {
    position: relative;
    top: auto;
  }

  .backtest-card-header {
    display: grid;
  }

  .backtest-period-pill {
    width: 100%;
  }

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

@media (max-width: 680px) {
  .performance-input-grid,
  .backtest-metrics-grid,
  .platform-dashboard-modules {
    grid-template-columns: 1fr;
  }

  .home-performance-metrics-grid {
    grid-template-columns: 1fr;
  }

  .backtest-chart-topline {
    display: grid;
  }

  .backtest-y-label,
  .backtest-x-label {
    font-size: 11px;
  }
}

.backtest-period-pill strong,
.performance-source-panel strong,
.platform-dashboard-panel strong {
  color: var(--ink);
}

.backtest-metric.primary strong {
  color: var(--blue);
}

/* ── Home page mini performance section ─────────────────────────────────── */
.home-perf-section {
  background: linear-gradient(180deg, rgba(245,249,253,0.6) 0%, rgba(255,255,255,0) 100%);
}

.home-perf-section .container {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.home-perf-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.home-perf-header .section-title {
  margin: 0.35rem 0 0;
}

/* Toggle pill container — extra vertical breathing room */
.home-perf-period-toggle {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(43,95,136,0.12);
  border-radius: 999px;
  padding: 0.6rem 0.6rem;
  box-shadow: 0 6px 18px rgba(7,28,49,0.06);
  margin-top: 0.75rem;
}

.home-perf-toggle-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.92rem 1.45rem;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  color: var(--muted);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  min-height: 0;
  box-shadow: none;
  white-space: nowrap;
}

.home-perf-toggle-btn:hover {
  color: var(--navy);
  background: rgba(53,121,184,0.07);
  transform: none;
}

.home-perf-toggle-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #061d33 0%, #0c3558 58%, #27618e 100%);
  box-shadow: 0 6px 16px rgba(8,38,66,0.22);
}

.home-perf-panel {
  display: grid;
  gap: 1.35rem;
}

.home-perf-controls-shell {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
}

.home-perf-input-card {
  display: block;
  width: min(100%, 540px) !important;
  max-width: 540px !important;
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(149,164,183,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(247,251,255,0.92));
  box-shadow: 0 8px 28px rgba(8,30,51,0.07);
}

.home-perf-input-card > * {
  margin: 0 !important;
}

.home-perf-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.95rem !important;
  column-gap: 0.95rem !important;
  row-gap: 0.95rem !important;
  align-items: end;
  justify-content: start;
  width: 100% !important;
  max-width: 460px;
  margin-top: 0.9rem;
}

.home-perf-input-card .performance-balance-control {
  width: 100%;
  min-width: 0;
}

.home-perf-input-card .performance-balance-control input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Horizontal stacked metric cards — all 6 in a single row */
.home-perf-metrics-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(149,164,183,0.22);
  box-shadow: 0 8px 28px rgba(8,30,51,0.07);
}

.home-perf-metrics-row .backtest-metric {
  min-height: 0;
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(149,164,183,0.18);
  box-shadow: none;
  padding: 1.05rem 1.1rem;
  background: #fff;
}

.home-perf-metrics-row .backtest-metric:last-child {
  border-right: none;
}

.home-perf-metrics-row .backtest-metric.primary {
  background:
    radial-gradient(circle at 10% 0%, rgba(20,184,166,0.18), transparent 48%),
    linear-gradient(180deg, rgba(7,28,47,0.97), rgba(8,30,51,0.94));
  border-right-color: rgba(20,184,166,0.22);
  color: #ffffff;
}

.home-perf-metrics-row .backtest-metric.primary span,
.home-perf-metrics-row .backtest-metric.primary strong,
.home-perf-metrics-row .backtest-metric.primary small {
  color: #ffffff;
}

.home-perf-metrics-row .backtest-metric strong {
  font-size: clamp(0.95rem, 1.4vw, 1.25rem);
}

.home-perf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(43,95,136,0.09);
}

.home-perf-footer .helper-text {
  max-width: 640px;
}

/* Responsive: wrap to 3-col grid on medium screens */
@media (max-width: 1100px) {
  .home-perf-input-card {
    width: min(100%, 540px) !important;
    max-width: 540px !important;
  }
  .home-perf-metrics-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 18px;
  }
  .home-perf-metrics-row .backtest-metric {
    border-right: 1px solid rgba(149,164,183,0.18);
    border-bottom: 1px solid rgba(149,164,183,0.18);
  }
  /* Remove right border on every 3rd card */
  .home-perf-metrics-row .backtest-metric:nth-child(3n) {
    border-right: none;
  }
  /* Remove bottom border on last row */
  .home-perf-metrics-row .backtest-metric:nth-last-child(-n+3) {
    border-bottom: none;
  }
}

@media (max-width: 720px) {
  .home-perf-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-perf-period-toggle {
    margin-top: 0.9rem;
  }
  .home-perf-metrics-row .backtest-metric {
    min-width: 0;
  }
  .home-perf-metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-perf-metrics-row .backtest-metric:nth-child(3n) {
    border-right: 1px solid rgba(149,164,183,0.18);
  }
  .home-perf-metrics-row .backtest-metric:nth-child(2n) {
    border-right: none;
  }
  .home-perf-metrics-row .backtest-metric:nth-last-child(-n+3) {
    border-bottom: 1px solid rgba(149,164,183,0.18);
  }
  .home-perf-metrics-row .backtest-metric:nth-last-child(-n+2) {
    border-bottom: none;
  }
  .home-perf-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  .home-perf-input-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  .home-perf-input-grid {
    grid-template-columns: 1fr !important;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .home-perf-period-toggle {
    width: 100%;
    justify-content: center;
    padding: 0.68rem;
  }
  .home-perf-toggle-btn {
    flex: 1 1 0;
    justify-content: center;
  }
  .home-perf-metrics-row {
    grid-template-columns: 1fr;
  }
  .home-perf-metrics-row .backtest-metric {
    border-right: none;
    border-bottom: 1px solid rgba(149,164,183,0.18);
  }
  .home-perf-metrics-row .backtest-metric:last-child {
    border-bottom: none;
  }
}

.home-perf-panel[hidden] { display: none !important; }

/* ─── Mock Dashboard Browser Preview ─────────────────────────────────────── */
.mock-browser {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(15,41,67,0.18), 0 2px 12px rgba(15,41,67,0.10);
  border: 1px solid rgba(15,41,67,0.12);
  background: #f4f7fb;
}

.mock-browser-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  background: #e8edf3;
  border-bottom: 1px solid rgba(15,41,67,0.10);
}

.mock-browser-dots {
  display: flex;
  gap: 0.38rem;
  flex-shrink: 0;
}

.mock-browser-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d0d6df;
  display: block;
}

.mock-browser-dots span:nth-child(1) { background: #f4827a; }
.mock-browser-dots span:nth-child(2) { background: #f9c24a; }
.mock-browser-dots span:nth-child(3) { background: #5ac87a; }

.mock-browser-url {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid rgba(15,41,67,0.10);
  font-family: var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-browser-badge { flex-shrink: 0; }

.mock-browser-body {
  padding: clamp(1rem, 2.5vw, 1.75rem);
  background: var(--surface);
  display: grid;
  gap: 1.35rem;
}

/* Portal header inside mock browser */
.mock-portal-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 1.35rem;
  align-items: start;
  background: linear-gradient(135deg, var(--navy) 0%, #0e2d4a 100%);
  border-radius: 16px;
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.mock-portal-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(43,95,136,0.35) 0%, transparent 60%);
  pointer-events: none;
}

.mock-portal-panel {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  position: relative;
  z-index: 1;
}

/* Mock buttons (non-interactive look-alike) */
.mock-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-heading);
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.18);
  cursor: default;
  user-select: none;
  white-space: nowrap;
}

.mock-btn.mock-btn-muted {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.55);
}

/* Stats grid inside mock browser */
.mock-stats-grid {
  gap: 1.35rem;
  margin: 0;
}

.mock-stats-grid .metric-card,
.mock-browser-body .chart-card,
.mock-browser-body .panel-card,
.mock-browser-body .table-card {
  padding: 1.35rem;
}

/* Accounts section inside mock browser */
.mock-accounts-section {
  margin-top: 1.25rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15,41,67,0.10);
}

.mock-accounts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: linear-gradient(135deg, var(--navy) 0%, #0e2d4a 100%);
  flex-wrap: wrap;
}

.mock-account-card {
  background: #fff;
  padding: 1.25rem 1.35rem;
}

.mock-account-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15,41,67,0.08);
  margin-bottom: 1rem;
}

.mock-account-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mock-account-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2b5f88, #1e4a6e);
  color: #fff;
  font-weight: 900;
  font-size: 1.2rem;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mock-account-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15,41,67,0.08);
  margin-bottom: 1rem;
}

.mock-account-stat .metric-value {
  font-size: 1.05rem;
}

.mock-account-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Calendar grid override for mock (7-col) */
.mock-calendar-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

/* Responsive */
@media (max-width: 900px) {
  .mock-portal-header {
    grid-template-columns: 1fr;
  }
  .mock-account-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mock-calendar-grid .calendar-cell {
    min-height: 72px;
  }
}

@media (max-width: 600px) {
  .mock-account-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mock-browser-url { display: none; }
  .mock-calendar-grid .calendar-cell {
    min-height: 54px;
    padding: 0.45rem;
  }
  .performance-calendar-pnl { font-size: 0.78rem; }
}

/* Refined platform preview and mobile navigation overrides */
.platform-preview-header {
  margin-bottom: 1.65rem;
}

.mock-browser-body {
  background:
    radial-gradient(circle at top right, rgba(124, 201, 232, 0.08), transparent 24rem),
    linear-gradient(180deg, #f6f9fc 0%, #f1f5f9 100%);
}

.mock-portal-header {
  background:
    radial-gradient(circle at 82% 16%, rgba(76, 144, 197, 0.34), transparent 24%),
    linear-gradient(135deg, #071d33 0%, #0c3558 58%, #144b75 100%);
  border-radius: 20px;
  padding: clamp(1.2rem, 2.6vw, 1.85rem);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 44px rgba(7, 28, 49, 0.16);
}

.mock-portal-header::before {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), transparent 35%),
    radial-gradient(ellipse at 80% 20%, rgba(43,95,136,0.35) 0%, transparent 60%);
}

.mock-portal-pill,
.mock-btn {
  position: relative;
  z-index: 1;
}

.mock-portal-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.48rem 0.86rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  color: #d9ebfb;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mock-portal-title {
  margin: 0.8rem 0 0.55rem;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.mock-portal-copy {
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-size: 0.94rem;
  line-height: 1.68;
  max-width: 680px;
  position: relative;
  z-index: 1;
}

.mock-portal-panel {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 1.1rem 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.mock-portal-panel .metric-label {
  color: rgba(255,255,255,0.62);
}

.mock-panel-account {
  margin-top: 0.35rem;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.mock-panel-period {
  margin-top: 0.28rem;
  color: rgba(255,255,255,0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mock-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.mock-btn {
  border-radius: 11px;
}

.mock-btn.mock-btn-surface {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.performance-calendar-actions .mock-btn {
  color: var(--navy);
}

.mock-portal-header,
.mock-portal-header .metric-label,
.mock-portal-header .mock-panel-account,
.mock-portal-header .mock-panel-period,
.mock-portal-header .mock-btn,
.mock-portal-header .mock-btn.mock-btn-surface,
.mock-portal-header .mock-portal-pill,
.mock-portal-header .mock-portal-title,
.mock-portal-header .mock-portal-copy,
.mock-portal-header h1,
.mock-portal-header h2,
.mock-portal-header h3,
.mock-portal-header h4,
.mock-portal-header p,
.mock-portal-header span,
.mock-portal-header div {
  color: #ffffff !important;
}

.mock-portal-header .mock-btn {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.2);
}

.mock-portal-header .mock-btn.mock-btn-surface {
  color: rgba(255,255,255,0.78);
}

.mock-preview-spacing {
  margin-top: 0;
}

.mock-equity-card .mock-axis-chart {
  min-height: 340px;
}

.mock-equity-chart {
  overflow: visible;
}

.mock-axis-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.9rem;
}

.mock-axis-grid {
  stroke: rgba(18, 38, 59, 0.11);
  stroke-width: 1;
}

.mock-axis-line {
  stroke: rgba(18, 38, 59, 0.2);
  stroke-width: 1.3;
}

.mock-axis-area {
  fill: url(#mock-equity-fill);
}

.mock-axis-plot-underlay {
  fill: none;
  stroke: rgba(31, 159, 104, 0.13);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mock-axis-plot {
  fill: none;
  stroke: url(#mock-equity-stroke);
  stroke-width: 4.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#mock-equity-glow);
}

.mock-axis-plot.negative {
  stroke: var(--red);
}

.mock-axis-point {
  fill: #eefcf6;
  stroke: #1fb778;
  stroke-width: 2.4;
  filter: drop-shadow(0 0 5px rgba(31, 159, 104, 0.12));
}

.mock-axis-point.end {
  fill: #ffffff;
  stroke-width: 3;
}

.mock-axis-label,
.mock-axis-date {
  fill: #718397;
  font-size: 12px;
  font-weight: 800;
}

.mock-axis-label {
  text-anchor: end;
}

.mock-axis-date {
  text-anchor: middle;
}

.mock-axis-ylabel {
  fill: #5e7084;
  font-size: 11.5px;
  font-weight: 800;
  text-anchor: end;
}

.mock-axis-date-angled {
  fill: #718397;
  font-size: 11px;
  font-weight: 800;
  text-anchor: end;
}

.mock-bar-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.9rem;
}

.mock-bar-positive-fill {
  fill: #1fb778;
}

.mock-bar-negative-fill {
  fill: #f24646;
}

.mock-bar-positive-fill.sharp,
.mock-bar-negative-fill.sharp {
  rx: 0;
  ry: 0;
}

.mock-bar-x {
  fill: #718397;
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
}

.performance-weekdays {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.85rem 0 0.55rem;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mock-calendar-grid-workweek {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.platform-preview-footnote {
  text-align: center;
  margin-top: 1.1rem;
}

.platform-preview-actions {
  text-align: center;
  margin-top: 1rem;
}

.platform-preview-actions .button + .button {
  margin-left: 0.6rem;
}

@media (max-width: 900px) {
  .mock-calendar-grid-workweek .calendar-cell {
    min-height: 72px;
  }
}

@media (max-width: 600px) {
  .mock-calendar-grid-workweek .calendar-cell {
    min-height: 54px;
    padding: 0.45rem;
  }

  .performance-weekdays {
    font-size: 0.68rem;
  }

  .platform-preview-actions .button + .button {
    margin-left: 0;
    margin-top: 0.6rem;
  }
}

@media (max-width: 720px) {
  .mock-equity-card .mock-axis-chart {
    min-height: 290px;
  }

  .mock-axis-label {
    font-size: 11px;
  }

  .mock-axis-ylabel,
  .mock-axis-date,
  .mock-axis-date-angled,
  .mock-bar-x {
    font-size: 10px;
  }

  .performance-calendar-card {
    padding: 0.9rem 0.75rem 1rem;
    overflow: hidden;
  }

  .performance-calendar-header {
    gap: 0.7rem;
    margin-bottom: 0.8rem;
  }

  .performance-calendar-header h3 {
    font-size: 1.02rem;
    line-height: 1.08;
  }

  .performance-calendar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .performance-calendar-actions .button,
  .performance-calendar-actions .mock-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 0.64rem 0.4rem;
    font-size: 0.69rem;
    line-height: 1.1;
  }

  .performance-weekdays,
  .performance-calendar-grid,
  .mock-calendar-grid-workweek {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0.28rem;
  }

  .performance-weekdays {
    margin: 0 0 0.38rem;
  }

  .performance-weekdays div {
    padding: 0.22rem 0.05rem;
    font-size: 0.54rem;
    letter-spacing: 0.06em;
  }

  .performance-calendar-cell {
    min-height: clamp(58px, 15vw, 72px);
    padding: 0.34rem;
    gap: 0.18rem;
    border-radius: 12px;
  }

  .performance-calendar-day {
    font-size: 0.68rem;
  }

  .performance-calendar-pnl {
    font-size: clamp(0.52rem, 2.2vw, 0.7rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .performance-calendar-cell .helper-text {
    font-size: 0.5rem;
    line-height: 1.1;
  }
}
