/*
 * MARA UI — visual system overrides
 * Loaded after the legacy inline styles so existing screens inherit the
 * redesign without requiring a wholesale template rewrite.
 */

:root {
  --mara-canvas: #F3F3F3;
  --mara-surface: #ffffff;
  --mara-ink: #171526;
  --mara-ink-soft: #363149;
  --mara-muted: #726d82;
  --mara-rule: #e4e2ec;
  --mara-ash: #eeedf4;
  --mara-primary: #0453A2;
  --mara-primary-strong: #063E78;
  --mara-primary-soft: #E8F1FB;
  --mara-primary-ring: rgba(4, 83, 162, 0.2);
  --mara-grad-from: #0453A2;
  --mara-grad-mid: #1E66C8;
  --mara-grad-to: #2D7BE0;
  --shadow-sm: 0 1px 2px rgba(25, 20, 45, 0.04), 0 6px 18px rgba(25, 20, 45, 0.035);
  --shadow-md: 0 1px 2px rgba(25, 20, 45, 0.04), 0 18px 44px -22px rgba(58, 43, 108, 0.24);
  --shadow-lg: 0 24px 70px -32px rgba(49, 34, 104, 0.42);

  /* One typography and spacing contract for every page hero. */
  --hero-title-size: clamp(2.5rem, 4vw, 3.5rem);
  --hero-title-weight: 700;
  --hero-title-leading: 1.03;
  --hero-title-tracking: -0.045em;
  --hero-copy-size: 15px;
  --hero-copy-leading: 1.7;
  --hero-kicker-size: 10px;
  --hero-radius: 26px;
  --hero-padding-y: 2.25rem;
  --hero-padding-x: 2.5rem;
  --hero-min-height: 210px;

  /* Button typography: hierarchy comes from colour and size, not heavy type. */
  --button-font-weight: 500;
  --button-font-size-sm: 12px;
  --button-font-size-md: 13px;
  --button-font-size-lg: 14px;
  --button-line-height: 1.2;
}

html {
  background: var(--mara-canvas);
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 88% -10%, rgba(4, 83, 162, 0.06), transparent 30rem),
    radial-gradient(circle at 18% 28%, rgba(72, 187, 190, 0.045), transparent 28rem),
    var(--mara-canvas);
  color: var(--mara-ink);
}

::selection {
  background: #CFE0F5;
  color: #0B2A4A;
}

h1,
h2,
h3,
h4 {
  color: var(--mara-ink);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* App shell */
.app-main {
  margin-left: 84px;
}

.sidebar {
  --sb-rail: 84px;
  width: 84px;
  background: #FFFFFF;
  border-right: 1px solid #ECECEF;
  box-shadow: 6px 0 28px rgba(20, 20, 30, 0.05);
}

.sidebar:hover,
.sidebar:focus-within {
  width: 268px;
  box-shadow: 16px 0 46px rgba(20, 20, 30, 0.10);
}

.sidebar-brand {
  min-height: 72px;
  padding: 1.1rem 1.25rem 1rem 1.55rem;
  border-color: #ECECEF;
  color: #1B1726;
}

/* Coloured logo (no invert) that rotates a quarter-turn on hover. */
.sidebar-brand img.logo {
  width: 34px;
  height: 34px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo turns a quarter-turn as the rail slides open / closed. */
.sidebar:hover img.logo,
.sidebar:focus-within img.logo {
  transform: rotate(90deg);
}

.sidebar-brand .name {
  color: #1B1726;
  font-size: 14px;
}

.sidebar-brand .sub,
.sidebar-section {
  color: #8A8595;
}

.sidebar-nav {
  padding: 0.9rem 0.7rem 1.2rem;
}

.sidebar-link {
  min-height: 42px;
  padding: 0.64rem 0.75rem;
  border-radius: 12px;
  color: #3F4654;
  font-weight: 550;
}

.sidebar-link .sb-icon {
  color: #6B7280;
  font-size: 14px;
}

.sidebar-link:hover {
  background: #F3F4F6;
  color: #1B1726;
}

.sidebar-link:hover .sb-icon {
  color: #1B1726;
}

.sidebar-link.is-active {
  background: #EDF1F7;
  color: #1B1726;
  box-shadow: none;
}

.sidebar-link.is-active .sb-icon {
  color: #1B1726;
}

.sidebar-child-link {
  min-height: 34px;
  margin-left: 0.65rem;
  padding-block: 0.46rem;
  font-size: 12px;
  font-weight: 500;
  border-left: 1px solid #ECECEF;
  border-radius: 0 10px 10px 0;
}

.sidebar-child-link .sb-icon {
  font-size: 12px;
}

.sidebar:not(:hover):not(:focus-within) .sidebar-child-link {
  margin-left: 0;
  border-left-color: transparent;
}

.sidebar > .border-t,
.sidebar-help {
  border-color: #ECECEF !important;
}

.sidebar > .border-t a:hover {
  background: #F3F4F6;
}

.sidebar .sb-usermeta {
  color: #1B1726;
}

.sidebar-help {
  background: linear-gradient(135deg, var(--mara-grad-from), var(--mara-grad-to));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 14px 34px -22px rgba(4, 83, 162, 0.65);
}

.sidebar-help a {
  color: #fff;
  text-decoration: none;
}

.sidebar-help .sidebar-help-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-help .sidebar-help-cta:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Top navigation */
.topbar {
  background: rgba(248, 248, 252, 0.8);
  border-bottom-color: rgba(220, 217, 231, 0.8);
  backdrop-filter: saturate(165%) blur(18px);
  -webkit-backdrop-filter: saturate(165%) blur(18px);
}

.topbar > div:first-child {
  min-height: 68px;
}

.entity-switch {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.82);
  border-color: #e2dfea;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.entity-switch .avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #27203d, #171426);
}

.search-box input {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.72);
  border-color: #e2dfea;
  border-radius: 13px;
}

.search-box input:focus {
  background: white;
}

.top-icon-btn,
.top-avatar {
  width: 40px;
  height: 40px;
}

.top-icon-btn {
  border: 1px solid transparent;
}

.top-icon-btn:hover {
  background: white;
  border-color: #e2dfea;
  box-shadow: var(--shadow-sm);
}

.aasb-pill {
  min-height: 34px;
  padding-inline: 12px;
  background: #ecfbf4;
  border-color: #bcebd3;
  color: #087150;
}

.stepper {
  padding: 11px 32px;
  background: rgba(255, 255, 255, 0.58);
}

.step {
  min-height: 32px;
  border-radius: 10px;
}

.step.is-active {
  box-shadow: 0 7px 20px rgba(91, 57, 225, 0.22);
}

main.flex-1 {
  width: 100%;
  max-width: 1560px;
  margin-inline: auto;
  padding: 2.25rem 2.5rem 3.5rem;
}

/* Page-level composition */
.page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: white;
  background:
    radial-gradient(circle at 87% 20%, rgba(255, 255, 255, 0.15), transparent 17rem),
    radial-gradient(circle at 68% 135%, rgba(59, 224, 192, 0.12), transparent 22rem),
    linear-gradient(125deg, #0453A2 0%, #905AE2 100%);
  box-shadow: 0 22px 58px -30px rgba(44, 29, 99, 0.54);
}

.page-hero::before,
.mara-gradient-panel::after,
.auth-brand::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  right: -80px;
  top: -115px;
  box-shadow:
    0 0 0 40px rgba(255, 255, 255, 0.035),
    0 0 0 85px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.page-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.hero-actions .btn {
  min-height: 46px;
  padding-inline: 18px;
}

.hero-actions .btn-primary {
  background: white;
  color: #3d258e;
  box-shadow: 0 12px 30px rgba(30, 18, 72, 0.24);
}

.hero-actions .btn-primary:hover {
  background: #faf9ff;
}

.hero-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: white;
  backdrop-filter: blur(8px);
}

.hero-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.34);
}

.content-heading {
  margin-bottom: 1.5rem;
}

.content-heading h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.content-heading p {
  max-width: 760px;
  margin-top: 0.5rem;
  color: var(--mara-muted);
  line-height: 1.7;
}

.app-page-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 87% 20%, rgba(255, 255, 255, 0.15), transparent 17rem),
    radial-gradient(circle at 68% 135%, rgba(59, 224, 192, 0.12), transparent 22rem),
    linear-gradient(125deg, #0453A2 0%, #905AE2 100%);
  color: white;
  box-shadow: 0 22px 58px -30px rgba(44, 29, 99, 0.54);
}

.app-page-header::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -75px;
  top: -130px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.03), 0 0 0 82px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

.app-page-header > * {
  position: relative;
  z-index: 1;
}

.app-page-header > div:first-child > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-family: var(--font-mono);
  font-size: 9px !important;
  font-weight: 700;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
}

.app-page-header > div:first-child > div:first-child::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.app-page-header > div:first-child > div:first-child > span.w-7 {
  display: none;
}

.app-page-header > a,
.app-page-header > div:last-child:not(:first-child) a,
.app-page-header > div:last-child:not(:first-child) button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: none;
  backdrop-filter: blur(9px);
}

.app-page-header > a:hover,
.app-page-header > div:last-child:not(:first-child) a:hover,
.app-page-header > div:last-child:not(:first-child) button:hover {
  border-color: rgba(255, 255, 255, 0.36) !important;
  background: rgba(255, 255, 255, 0.18) !important;
}

.app-page-header > div:last-child:not(:first-child) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* Panels and cards */
.panel,
.panel-flush,
.panel-soft,
section.bg-white.border,
div.bg-white.border {
  border-color: var(--mara-rule);
}

.panel,
.panel-flush,
.panel-soft {
  border-radius: 20px;
}

.panel,
.panel-flush {
  box-shadow: var(--shadow-md);
}

.panel:hover {
  border-color: #d8d2e8;
}

.panel-head {
  min-height: 72px;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(180deg, #fff, #fdfcff);
}

.panel-head h2,
.panel-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.panel-head-icon,
.section-head-icon {
  color: #44474F;
  background: #ECECF0;
}

.mara-gradient-panel {
  min-height: 220px;
  padding: 1.85rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 5%, rgba(255, 255, 255, 0.2), transparent 18rem),
    linear-gradient(135deg, #3e26b0 0%, #7350ed 55%, #a274f0 100%);
  box-shadow: 0 20px 50px -24px rgba(70, 43, 170, 0.56);
}

.mara-gradient-panel h1,
.mara-gradient-panel h2,
.mara-gradient-panel h3,
.mara-gradient-panel h4 {
  color: inherit;
}

.mara-gradient-panel p {
  color: rgba(255, 255, 255, 0.82);
}

.stat-tile {
  min-height: 126px;
  padding: 1.3rem 1.4rem 1.25rem;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 253, 0.96));
  box-shadow: var(--shadow-sm);
}

.stat-tile::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -36px;
  top: -40px;
  border-radius: 50%;
  background: rgba(4, 83, 162, 0.045);
}

.stat-tile-accent::before {
  top: 18px;
  bottom: 18px;
  width: 4px;
}

.stat-tile-label {
  color: var(--mara-muted);
  letter-spacing: 0.09em;
}

.stat-tile-value {
  margin-top: 10px;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.form-section {
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--mara-rule);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(253, 252, 255, 0.96));
  box-shadow: var(--shadow-sm);
}

.form-section-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.form-section-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  color: #5c3ccc;
  background: var(--mara-primary-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.form-section-head h2 {
  font-size: 1rem;
  font-weight: 700;
}

.form-section-head p {
  margin-top: 0.28rem;
  color: var(--mara-muted);
  font-size: 12px;
  line-height: 1.55;
}

/* Forms */
.form-label {
  margin-bottom: 7px;
  color: var(--mara-ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.form-input,
.form-select,
.form-textarea,
.auth-input {
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #dcd9e5;
  border-radius: 13px;
  background-color: #fbfbfd;
  color: var(--mara-ink);
  font-size: 14px;
  box-shadow: inset 0 1px 1px rgba(30, 22, 55, 0.025);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.auth-input:hover {
  border-color: #bdb5d2;
  background-color: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.auth-input:focus {
  border-color: var(--mara-primary);
  background-color: white;
  box-shadow: 0 0 0 4px var(--mara-primary-ring), 0 8px 22px -14px rgba(69, 43, 171, 0.5);
}

.form-input-sm,
.form-select.form-input-sm,
select.form-input-sm,
input.form-input-sm {
  min-height: 36px;
  padding-block: 7px;
}

.form-help {
  margin-top: 6px;
  color: var(--mara-muted);
}

.form-card {
  min-height: 62px;
  padding: 13px 14px;
  border-color: #dfdce8;
  border-radius: 14px;
  background: #fcfcfe;
}

.form-card:hover {
  border-color: #9b87eb;
  background: #faf8ff;
  box-shadow: 0 8px 24px -18px rgba(76, 48, 181, 0.42);
}

.form-card:has(input:checked) {
  border-color: #0453A2;
  background: linear-gradient(145deg, #f6f3ff, #efebff);
  box-shadow: inset 0 0 0 1px #0453A2, 0 10px 26px -20px rgba(79, 47, 195, 0.5);
}

.form-checkbox,
.form-radio {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border-color: #a9a2b8;
}

.form-card-title {
  font-size: 13px;
  font-weight: 700;
}

.form-card-sub {
  margin-top: 4px;
  color: var(--mara-muted);
  line-height: 1.5;
}

/* Actions */
.btn,
.btn-primary {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 12px;
  font-weight: var(--button-font-weight);
}

.btn-primary {
  background: linear-gradient(135deg, #5c38e5 0%, #805cf5 58%, #9c73ef 100%);
  box-shadow: 0 10px 24px -12px rgba(78, 45, 198, 0.8);
}

.btn-primary:hover {
  filter: saturate(1.08) brightness(1.04);
}

.btn-lg {
  min-height: 46px;
  padding-inline: 20px;
}

.btn-sm {
  min-height: 32px;
  border-radius: 9px;
}

.btn-ghost {
  border-color: #ddd9e7;
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: #bdb3d5;
  background: #faf8ff;
}

/* Tables and filters */
table {
  border-collapse: separate;
  border-spacing: 0;
}

thead.bg-mara-paper,
thead {
  background: #f6f5fa;
}

thead th {
  height: 44px;
  color: #777184 !important;
  letter-spacing: 0.09em !important;
}

tbody tr {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:hover {
  background: #faf9fd !important;
}

tbody td {
  border-color: #eceaf1;
}

.progress-bar {
  height: 7px;
  background: #e8e5ef;
}

.heatmap-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.heatmap-dot::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 1px solid white;
  border-radius: inherit;
  background: var(--heatmap-dot);
  box-shadow: 0 1px 4px rgba(30, 22, 48, 0.2);
}

.heatmap-dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.08);
}

.chip {
  min-height: 29px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(58, 48, 85, 0.08);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.005em;
  box-shadow: 0 4px 12px -9px rgba(35, 27, 64, 0.52);
}

.chip i {
  font-size: 10px;
}

.filter-dock {
  position: relative !important;
  top: auto !important;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(219, 216, 229, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px -24px rgba(40, 28, 82, 0.38);
  backdrop-filter: blur(18px);
}

.filter-dock-label {
  margin: 0 0 8px 2px;
  color: var(--mara-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stream-pill {
  --pill-accent: #0453A2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 8px 7px 13px;
  border: 1px solid #ddd9e7;
  border-radius: 999px;
  background: #f8f7fb;
  color: #464052;
  font-size: 12px;
  font-weight: 750;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.stream-pill:hover {
  border-color: color-mix(in srgb, var(--pill-accent) 48%, white);
  background: white;
  box-shadow: 0 9px 22px -16px var(--pill-accent);
  transform: translateY(-1px);
}

.stream-pill.is-active {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pill-accent) 82%, #171426), var(--pill-accent));
  box-shadow: 0 10px 24px -14px var(--pill-accent);
}

.stream-pill-all { --pill-accent: #29243a; }
.stream-pill-upstream { --pill-accent: #8b5cf6; }
.stream-pill-direct { --pill-accent: #3977e8; }
.stream-pill-downstream { --pill-accent: #119b72; }

.stream-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pill-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pill-accent) 12%, white);
}

.stream-pill.is-active .stream-pill-dot {
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.stream-pill-count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding-inline: 7px;
  border: 1px solid rgba(68, 57, 92, 0.1);
  border-radius: 999px;
  background: white;
  color: #5d566a;
  font-family: var(--font-mono);
  font-size: 10px;
}

.stream-pill.is-active .stream-pill-count {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.17);
  color: white;
}

.filter-dock-secondary form {
  gap: 10px;
}

.filter-dock-secondary .form-select {
  width: auto;
  min-width: 160px;
}

.filter-dock-secondary .form-input[type="search"] {
  width: 224px;
}

.filter-dock-secondary .form-input,
.filter-dock-secondary .form-select {
  min-height: 40px;
}

.vc-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.vc-legend-label {
  margin-right: 2px;
  color: var(--mara-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.vc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #e1deea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #625c6e;
  font-size: 10px;
}

.vc-legend-item strong {
  color: #393344;
  font-weight: 750;
}

.vc-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.vc-legend-upstream .vc-legend-dot { background: #8b5cf6; }
.vc-legend-direct .vc-legend-dot { background: #3977e8; }
.vc-legend-downstream .vc-legend-dot { background: #119b72; }

details {
  border-radius: 16px !important;
}

summary {
  min-height: 48px;
}

dialog {
  border: 0;
  border-radius: 22px !important;
  box-shadow: 0 30px 100px rgba(20, 14, 38, 0.35);
}

/* Authentication */
.auth-brand {
  background:
    radial-gradient(circle at 75% 12%, rgba(255, 255, 255, 0.2), transparent 24rem),
    radial-gradient(circle at 22% 80%, rgba(62, 230, 198, 0.16), transparent 22rem),
    linear-gradient(145deg, #1c1532 0%, #4d30cc 48%, #966bf0 100%) !important;
}

.auth-form-shell {
  position: relative;
  background:
    radial-gradient(circle at 90% 8%, rgba(116, 79, 242, 0.08), transparent 18rem),
    #f8f8fb;
}

.auth-form-card {
  padding: 2.25rem;
  border: 1px solid rgba(222, 218, 234, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 28px 80px -38px rgba(43, 30, 88, 0.44);
  backdrop-filter: blur(16px);
}

/* File dropzones */
.file-dropzone {
  width: 100%;
}

.dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.dropzone-target {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px 20px;
  border: 1.5px dashed #cfc8df;
  border-radius: 17px;
  background:
    radial-gradient(circle at 94% 0%, rgba(4, 83, 162, 0.07), transparent 11rem),
    linear-gradient(145deg, #fdfcff, #f7f5fc);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dropzone-target:hover,
.file-dropzone.is-dragging .dropzone-target {
  border-color: var(--mara-primary);
  background:
    radial-gradient(circle at 94% 0%, rgba(4, 83, 162, 0.13), transparent 12rem),
    linear-gradient(145deg, #fcfaff, #f2eeff);
  box-shadow: 0 16px 34px -24px rgba(78, 49, 185, 0.5);
  transform: translateY(-1px);
}

.dropzone-input:focus-visible + .dropzone-target {
  outline: 3px solid var(--mara-primary-ring);
  outline-offset: 2px;
  border-color: var(--mara-primary);
}

.dropzone-icon,
.dropzone-file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 15px;
  color: #6542d8;
  background: linear-gradient(145deg, #f0ecff, #e4dcff);
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(4, 83, 162, 0.08);
}

.dropzone-copy,
.dropzone-file-copy {
  min-width: 0;
  flex: 1;
}

.dropzone-copy strong,
.dropzone-file-copy strong {
  display: block;
  overflow: hidden;
  color: var(--mara-ink);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-copy span,
.dropzone-file-copy span {
  display: block;
  margin-top: 4px;
  color: var(--mara-muted);
  font-size: 10px;
}

.dropzone-browse,
.dropzone-change {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d9d3e5;
  border-radius: 11px;
  background: white;
  color: #4b4262;
  font-size: 11px;
  font-weight: 750;
  box-shadow: var(--shadow-sm);
}

.dropzone-selection {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 14px 16px;
  border: 1px solid #cfc6ee;
  border-radius: 16px;
  background: linear-gradient(145deg, #f9f7ff, #f0ecff);
  box-shadow: 0 12px 28px -22px rgba(69, 42, 171, 0.48);
}

.dropzone-selection[hidden],
.dropzone-target[hidden],
.dropzone-error[hidden] {
  display: none;
}

.dropzone-file-icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 15px;
}

.dropzone-change,
.dropzone-remove {
  cursor: pointer;
}

.dropzone-remove {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  color: #8a6472;
}

.dropzone-remove:hover {
  background: #fff;
  color: #b91c1c;
}

.dropzone-error {
  margin-top: 7px;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 650;
}

.file-dropzone.has-error .dropzone-target {
  border-color: #d97777;
  background: #fff8f8;
}

.hero-upload-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(320px, 1fr) auto;
  gap: 10px;
  align-items: end;
  width: min(100%, 820px);
  margin-top: 1.5rem;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 17px;
  background: rgba(25, 16, 64, 0.2);
  backdrop-filter: blur(14px);
}

.hero-upload-entity label {
  display: block;
  margin: 0 0 6px 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-upload-entity .form-select {
  min-height: 56px;
  border-color: rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.94);
}

.dropzone-compact .dropzone-target {
  min-height: 56px;
  padding: 7px 9px;
  border-radius: 12px;
}

.dropzone-compact .dropzone-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 11px;
  font-size: 14px;
}

.dropzone-compact .dropzone-browse {
  display: none;
}

.dropzone-compact .dropzone-selection {
  min-height: 56px;
  padding: 7px 9px;
  border-radius: 12px;
}

.dropzone-hero .dropzone-target {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.dropzone-hero .dropzone-target:hover,
.dropzone-hero.is-dragging .dropzone-target {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.17);
}

.dropzone-hero .dropzone-icon {
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.dropzone-hero .dropzone-copy strong,
.dropzone-hero .dropzone-file-copy strong {
  color: white;
}

.dropzone-hero .dropzone-copy span,
.dropzone-hero .dropzone-file-copy span {
  color: rgba(255, 255, 255, 0.62);
}

.dropzone-hero .dropzone-selection {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.13);
}

.dropzone-hero .dropzone-file-icon {
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.dropzone-hero .dropzone-change,
.dropzone-hero .dropzone-remove {
  color: white;
}

.dropzone-hero .dropzone-change {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
}

.hero-upload-button {
  min-height: 56px;
  padding-inline: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: white;
  color: #4528a8;
  font-weight: var(--button-font-weight);
}

.hero-upload-button:hover {
  background: #faf8ff;
}

/* Value-chain workspace */
.vc-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 2.5rem;
  align-items: end;
  margin-bottom: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle at 87% 20%, rgba(255, 255, 255, 0.15), transparent 17rem),
    radial-gradient(circle at 68% 135%, rgba(59, 224, 192, 0.12), transparent 22rem),
    linear-gradient(125deg, #0453A2 0%, #905AE2 100%);
  color: white;
  box-shadow: 0 22px 58px -30px rgba(44, 29, 99, 0.54);
}

.vc-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -95px;
  top: -150px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(255, 255, 255, 0.035), 0 0 0 102px rgba(255, 255, 255, 0.018);
}

.vc-hero > * {
  position: relative;
  z-index: 1;
}

.vc-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.25rem;
}

.vc-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(10px);
}

.vc-meta-pill i {
  color: rgba(255, 255, 255, 0.62);
}

.vc-gate-card {
  padding: 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 19px;
  background: rgba(20, 14, 42, 0.26);
  backdrop-filter: blur(16px);
}

.vc-gate-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vc-gate-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: white;
  color: #063E78;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(25, 15, 62, 0.22);
}

.vc-gate-label {
  color: white;
  font-size: 14px;
  font-weight: 750;
}

.vc-gate-status {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.vc-gate-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.vc-gate-stats div {
  padding: 9px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.vc-gate-stats strong {
  display: block;
  color: white;
  font-family: var(--font-display);
  font-size: 20px;
}

.vc-gate-stats span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.vc-gate-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-top: 8px;
  padding-inline: 7px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 10px;
  font-weight: 700;
}

.vc-setup-panel {
  overflow: hidden;
  border: 1px solid var(--mara-rule);
  border-radius: 19px !important;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.vc-setup-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 14px 20px;
  list-style: none;
  cursor: pointer;
}

.vc-setup-panel > summary::-webkit-details-marker {
  display: none;
}

.vc-setup-panel > summary strong {
  display: block;
  color: var(--mara-ink);
  font-size: 14px;
}

.vc-setup-panel > summary span:not(.vc-setup-icon) {
  display: block;
  margin-top: 3px;
  color: var(--mara-muted);
  font-size: 11px;
}

.vc-setup-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #44474F;
  background: #ECECF0;
}

.vc-setup-chevron {
  color: var(--mara-muted);
  font-size: 11px;
  transition: transform 0.18s ease;
}

.vc-setup-panel[open] .vc-setup-chevron {
  transform: rotate(180deg);
}

.vc-setup-body {
  padding: 1.5rem 1.6rem 1.6rem;
  border-top: 1px solid var(--mara-ash);
}

.vc-ai-panel {
  padding: 1.2rem;
  border: 1px solid #e2dcf5;
  border-radius: 16px;
  background: linear-gradient(145deg, #faf8ff, #f2edff);
}

.vc-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--mara-rule);
  border-radius: 18px;
  background: #ffffff;
  /* Sticks just under the topbar + workflow stepper. */
  position: sticky;
  top: calc(var(--topbar-h, 65px) + var(--stepper-h, 57px) + 10px);
  z-index: 20;
  box-shadow: var(--shadow-md);
}

.vc-context-bar .vc-legend {
  margin-bottom: 10px;
}

.vc-scope-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid #dfdbe8;
  border-radius: 14px;
  background: white;
}

.vc-scope-toggle > div {
  flex: 1;
}

.vc-scope-toggle strong {
  display: block;
  color: var(--mara-ink);
  font-size: 11px;
}

.vc-scope-toggle > div > span {
  display: block;
  margin-top: 2px;
  color: var(--mara-muted);
  font-size: 9px;
}

.vc-scope-toggle > div > span.hidden {
  display: none;
}

.modern-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.modern-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.modern-switch span {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #ddd9e5;
  box-shadow: inset 0 1px 3px rgba(31, 23, 50, 0.12);
  transition: background 0.18s ease;
}

.modern-switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 3px 8px rgba(34, 26, 54, 0.2);
  transition: transform 0.18s ease;
}

.modern-switch input:checked + span {
  background: linear-gradient(135deg, #5b38df, #8c65ee);
}

.modern-switch input:checked + span::after {
  transform: translateX(20px);
}

.modern-switch input:focus-visible + span {
  outline: 3px solid var(--mara-primary-ring);
  outline-offset: 2px;
}

.vc-stream-section {
  --stream-accent: #3977e8;
  overflow: hidden;
  border: 1px solid #dedbe8;
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow-md);
}

.vc-stream-upstream { --stream-accent: #8b5cf6; }
.vc-stream-direct { --stream-accent: #3977e8; }
.vc-stream-downstream { --stream-accent: #119b72; }

.vc-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 100px;
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid #e7e4ed;
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--stream-accent) 12%, transparent), transparent 15rem),
    linear-gradient(180deg, #fff, #fbfaff) !important;
}

.vc-stream-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  color: var(--stream-accent);
  background: color-mix(in srgb, var(--stream-accent) 11%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stream-accent) 13%, white);
}

.vc-stream-header h2,
.vc-stream-header h3 {
  color: var(--mara-ink);
  font-size: 1.25rem;
  font-weight: 750;
}

.vc-stream-header h2 + span,
.vc-stream-header h3 + span {
  display: block;
  margin-top: 3px;
  color: var(--mara-muted);
  font-size: 11px;
}

.vc-stream-counts {
  display: flex;
  gap: 8px;
}

.vc-stream-counts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #e1deea;
  border-radius: 999px;
  background: white;
  color: var(--mara-muted);
  font-size: 10px;
}

.vc-stream-counts strong {
  color: var(--stream-accent);
  font-family: var(--font-display);
  font-size: 13px;
}

.vc-stream-body {
  padding: 1.5rem 1.6rem 1.6rem;
}

.vc-stream-drill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 1rem;
  border: 1px dashed color-mix(in srgb, var(--stream-accent) 34%, #dcd8e5);
  border-radius: 13px;
  color: var(--stream-accent);
  background: color-mix(in srgb, var(--stream-accent) 4%, white);
  font-size: 11px;
  font-weight: 750;
}

.vc-stream-drill:hover {
  border-style: solid;
  background: color-mix(in srgb, var(--stream-accent) 8%, white);
}

.vc-industry-card {
  overflow: hidden;
  border-radius: 17px !important;
  background: white;
  box-shadow: 0 5px 18px -16px rgba(35, 26, 63, 0.46);
}

.vc-industry-card[open] {
  border-color: color-mix(in srgb, var(--stream-accent) 32%, #dedbe8);
  box-shadow: 0 18px 38px -28px color-mix(in srgb, var(--stream-accent) 55%, transparent);
}

.vc-industry-summary {
  padding: 1.45rem 1.5rem;
  list-style: none;
  cursor: pointer;
  transition: background 0.16s ease;
}

.vc-industry-summary::-webkit-details-marker {
  display: none;
}

.vc-industry-summary:hover {
  background: #faf9fc;
}

.vc-industry-chevron {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-top: 1px;
  border-radius: 9px;
  color: var(--stream-accent);
  background: color-mix(in srgb, var(--stream-accent) 9%, white);
  font-size: 9px;
  transition: transform 0.18s ease;
}

.vc-industry-card[open] .vc-industry-chevron {
  transform: rotate(90deg);
}

.vc-sic-badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 11px;
  border: 1px solid #d6d1e0;
  border-radius: 999px;
  color: #464052;
  background: linear-gradient(180deg, #fff, #f5f3f8);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 5px 12px -10px rgba(38, 29, 64, 0.7);
}

.vc-status-badge {
  min-height: 31px;
  padding-inline: 12px;
  font-size: 10px;
}

.vc-industry-name {
  margin-top: 10px;
  color: var(--mara-ink);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.vc-industry-rationale {
  max-width: 900px;
  margin-top: 12px;
  color: var(--mara-muted);
  font-size: 13px;
  line-height: 1.72;
}

.vc-assessment-progress {
  width: 150px;
  flex: 0 0 150px;
  padding: 10px 12px;
  border: 1px solid #e2dfea;
  border-radius: 13px;
  background: #faf9fc;
}

.vc-assessment-progress > div:first-child {
  margin-bottom: 7px;
  color: var(--mara-muted);
  font-size: 10px;
  white-space: nowrap;
}

.vc-assessment-progress strong {
  color: var(--mara-ink);
  font-family: var(--font-display);
  font-size: 13px;
}

.vc-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--mara-rule);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.vc-queue-drawer {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 40;
  min-width: 420px;
  padding: 12px 12px 12px 14px;
  border: 1px solid #ded9ea;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px -26px rgba(35, 23, 79, 0.5);
  backdrop-filter: blur(18px);
}

.vc-queue-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, #0453A2, #8d65eb);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(83, 49, 218, 0.75);
}

/* ============================================================
 * Unified page-hero contract
 * Layout variants may differ, but type, spacing, shape and copy do not.
 * ============================================================ */
.page-hero,
.app-page-header,
.vc-hero,
.app-page-hero {
  min-height: var(--hero-min-height);
  padding: var(--hero-padding-y) var(--hero-padding-x);
  border-radius: var(--hero-radius);
}

/* Documents hero uses mara-gradient-panel (lighter violet); override its
   gradient so it matches the standard app-page-header. Scoped to .app-page-hero
   ONLY — the shared contract above must not set a background. */
.app-page-hero {
  background:
    radial-gradient(circle at 87% 20%, rgba(255, 255, 255, 0.15), transparent 17rem),
    radial-gradient(circle at 68% 135%, rgba(59, 224, 192, 0.12), transparent 22rem),
    linear-gradient(125deg, #0453A2 0%, #905AE2 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 22px 58px -30px rgba(44, 29, 99, 0.54);
}
.app-page-hero::before { display: none; }

.page-hero h1,
.app-page-header h1,
.vc-hero h1,
.app-page-hero h1 {
  max-width: 820px;
  margin: 0;
  color: white;
  font-size: var(--hero-title-size) !important;
  font-weight: var(--hero-title-weight) !important;
  line-height: var(--hero-title-leading) !important;
  letter-spacing: var(--hero-title-tracking) !important;
}

.page-hero p,
.app-page-header p,
.vc-hero p,
.app-page-hero p {
  max-width: 760px;
  margin-top: 0.85rem !important;
  color: rgba(255, 255, 255, 0.76) !important;
  font-size: var(--hero-copy-size) !important;
  line-height: var(--hero-copy-leading) !important;
}

/* Inline dark text utilities used inside a hero must read light on the gradient
   (e.g. <strong class="text-mara-ink"> in copy, or a text-mara-muted kicker). */
.page-hero .text-mara-ink,   .app-page-header .text-mara-ink,   .vc-hero .text-mara-ink,   .app-page-hero .text-mara-ink,
.page-hero .text-mara-ink2,  .app-page-header .text-mara-ink2,  .vc-hero .text-mara-ink2,  .app-page-hero .text-mara-ink2 { color: #fff !important; }
.page-hero .text-mara-muted, .app-page-header .text-mara-muted, .vc-hero .text-mara-muted, .app-page-hero .text-mara-muted { color: rgba(255, 255, 255, 0.72) !important; }
.page-hero strong, .app-page-header strong, .vc-hero strong, .app-page-hero strong,
.page-hero b,      .app-page-header b,      .vc-hero b,      .app-page-hero b { color: #fff; }

.page-kicker,
.app-page-header > div:first-child > div:first-child {
  gap: 0.55rem;
  margin-bottom: 0.85rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-family: var(--font-mono);
  font-size: var(--hero-kicker-size) !important;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.16em !important;
  text-transform: uppercase;
}

.app-page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.app-page-hero > * {
  position: relative;
  z-index: 1;
}

.auth-brand h2 {
  max-width: 820px;
  color: white;
  font-size: var(--hero-title-size);
  font-weight: var(--hero-title-weight);
  line-height: var(--hero-title-leading);
  letter-spacing: var(--hero-title-tracking);
}

.auth-brand p {
  font-size: var(--hero-copy-size);
  line-height: var(--hero-copy-leading);
}

/* ============================================================
 * Unified button typography
 * ============================================================ */
.btn,
.btn-primary,
button.btn,
a.btn,
input[type="submit"].btn {
  font-family: var(--font-body);
  font-size: var(--button-font-size-md) !important;
  font-weight: var(--button-font-weight) !important;
  line-height: var(--button-line-height) !important;
  letter-spacing: 0 !important;
}

.btn-sm,
.btn.btn-sm,
.btn-primary.btn-sm {
  font-size: var(--button-font-size-sm) !important;
}

.btn-lg,
.btn.btn-lg,
.btn-primary.btn-lg {
  font-size: var(--button-font-size-lg) !important;
}

.app-page-header > a,
.app-page-header > div:last-child:not(:first-child) a,
.app-page-header > div:last-child:not(:first-child) button,
.dropzone-browse,
.dropzone-change,
.hero-upload-button,
.vc-gate-link,
.vc-stream-drill {
  font-family: var(--font-body);
  font-size: var(--button-font-size-md) !important;
  font-weight: var(--button-font-weight) !important;
  line-height: var(--button-line-height) !important;
  letter-spacing: 0 !important;
}

.dropzone-compact .dropzone-change,
.dropzone-compact .dropzone-browse {
  font-size: var(--button-font-size-sm) !important;
}

/* Responsive shell */
@media (max-width: 1100px) {
  main.flex-1 {
    padding-inline: 1.5rem;
  }

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

  .vc-hero {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: 72px;
  }

  .app-main {
    margin-left: 0;
  }

  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 68px;
    flex-direction: row;
    border-top: 1px solid #ECECEF;
    border-right: 0;
    box-shadow: 0 -14px 40px rgba(22, 15, 48, 0.12);
  }

  .sidebar-brand,
  .sidebar-section,
  .sidebar-help,
  .sidebar > .border-t {
    display: none !important;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    padding: 7px 8px;
    overflow: hidden;
  }

  .sidebar-nav > .sidebar-link {
    display: none;
  }

  .sidebar-nav > .sidebar-link:nth-of-type(-n + 4) {
    display: flex;
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    margin: 0 2px;
    padding: 5px 3px;
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 9px;
    line-height: 1.1;
  }

  .sidebar-nav > .sidebar-link:nth-of-type(-n + 4) .sb-icon {
    width: auto;
    height: 20px;
    color: currentColor;
    font-size: 15px;
  }

  .sidebar-nav > .sidebar-link.is-active {
    color: white !important;
  }

  .topbar > div:first-child {
    min-height: 60px;
    padding: 9px 14px;
    gap: 8px;
  }

  .entity-switch {
    flex: 1;
    min-width: 0;
  }

  .search-box,
  .aasb-pill,
  .top-icon-btn {
    display: none;
  }

  .stepper {
    padding: 8px 14px;
  }

  .stepper-entity {
    display: none;
  }

  main.flex-1 {
    padding: 1.15rem 1rem 2rem;
  }

  .page-hero,
  .app-page-header,
  .vc-hero,
  .app-page-hero {
    display: block;
    min-height: 0;
    padding: 1.65rem 1.4rem;
    border-radius: 21px;
  }

  .app-page-header > a,
  .app-page-header > div:last-child:not(:first-child) {
    margin-top: 1.2rem;
  }

  .app-page-header > div:last-child:not(:first-child) {
    justify-content: flex-start;
  }

  .page-hero h1,
  .app-page-header h1,
  .vc-hero h1,
  .app-page-hero h1 {
    max-width: none;
    font-size: 2.15rem !important;
    line-height: 1.06 !important;
  }

  .hero-actions {
    justify-content: flex-start;
    margin-top: 1.35rem;
  }

  main .grid-cols-4,
  main .grid-cols-3,
  main .grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-tile {
    min-height: 104px;
  }

  .panel-flush,
  .overflow-hidden.bg-white.border {
    overflow-x: auto;
  }

  table {
    min-width: 760px;
  }

  .form-section {
    padding: 1.25rem;
  }

  footer > div {
    display: block !important;
    padding-inline: 1rem !important;
  }

  footer > div > div + div {
    margin-top: 0.5rem;
  }

  .auth-form-card {
    padding: 1.5rem;
    border-radius: 20px;
  }

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

  .hero-upload-button {
    width: 100%;
    justify-content: center;
  }

  .dropzone-target {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
  }

  .dropzone-browse {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    text-align: center;
  }

  .dropzone-copy strong,
  .dropzone-file-copy strong {
    white-space: normal;
  }

  .dropzone-selection {
    flex-wrap: wrap;
  }

  .vc-gate-card {
    margin-top: 1.25rem;
  }

  .vc-setup-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.25rem;
  }

  .vc-setup-body > .col-span-2 {
    grid-column: auto;
  }

  .vc-context-bar {
    display: block;
  }

  .vc-scope-toggle {
    margin-top: 14px;
  }

  .filter-dock {
    position: static;
  }

  .filter-dock-secondary,
  .filter-dock-secondary form,
  .filter-dock-secondary .form-input,
  .filter-dock-secondary .form-select {
    width: 100%;
  }

  .filter-dock-secondary .form-select,
  .filter-dock-secondary .form-input[type="search"] {
    width: 100%;
  }

  .vc-stream-header {
    align-items: flex-start;
    padding: 1rem;
  }

  .vc-stream-counts {
    display: block;
  }

  .vc-stream-counts span {
    display: flex;
    margin-bottom: 5px;
  }

  .vc-stream-body {
    padding: 0.9rem;
  }

  .vc-industry-summary {
    padding: 1rem;
  }

  .vc-industry-summary > div {
    flex-wrap: wrap;
  }

  .vc-assessment-progress {
    width: 100%;
    flex-basis: 100%;
    margin-left: 42px;
  }

  .vc-page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .vc-page-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .vc-queue-drawer {
    right: 10px;
    bottom: 78px;
    left: 10px;
    min-width: 0;
  }

  .vc-queue-drawer .text-xs {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================================
   DASHBOARD — workflow tracker, home cards, support & tutorials
   (the dashboard is the product's primary surface)
   ===================================================================== */

/* --- Primary-entity context strip above the workflow --- */
.wf-context {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.wf-context-avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(140deg, var(--mara-grad-from), var(--mara-grad-to));
  box-shadow: 0 8px 20px -8px rgba(86, 53, 231, 0.6);
  flex-shrink: 0;
}
.wf-context-name { font-size: 1.05rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.wf-context-sub  { font-size: 12px; color: var(--mara-muted); margin-top: 2px; }
.wf-context-pct  { margin-left: auto; text-align: right; }
.wf-context-pct b { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.03em; }
.wf-context-pct span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--mara-muted); font-family: var(--font-mono); }

/* --- The 9-step workflow track (single row, scrolls if needed) --- */
.wf-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(114px, 1fr);
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.wf-grid::-webkit-scrollbar { height: 6px; }
.wf-grid::-webkit-scrollbar-thumb { background: var(--mara-ash); border-radius: 999px; }

.wf-step {
  position: relative;
  display: block;
  padding: 0.85rem 0.85rem 0.8rem;
  border: 1px solid var(--mara-ash);
  border-radius: 15px;
  background: linear-gradient(160deg, #ffffff, #fcfbff);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
a.wf-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #C9D6EC; }
.wf-step::after { /* faint step number watermark */
  content: attr(data-step);
  position: absolute;
  right: 0.45rem;
  bottom: -0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: rgba(4, 83, 162, 0.06);
  pointer-events: none;
}
.wf-step-head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.7rem; }
.wf-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #44474F;
  background: #ECECF0;
  flex-shrink: 0;
}
.wf-badge {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mara-ash);
  color: var(--mara-muted);
  white-space: nowrap;
}
.wf-step-no { font-size: 9px; font-family: var(--font-mono); color: var(--mara-muted); letter-spacing: 0.1em; }
.wf-step-label { font-size: 0.85rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; margin-top: 1px; }
.wf-step-sub { font-size: 11px; color: var(--mara-muted); margin-top: 2px; line-height: 1.3; }

/* States */
.wf-step.is-done { border-color: #cdeed8; background: linear-gradient(160deg, #ffffff, #f4fcf6); }
.wf-step.is-done .wf-icon { color: #157a3a; background: linear-gradient(145deg, #e3f7e9, #d3f1dc); }
.wf-step.is-done .wf-badge { background: #dcf5e3; color: #157a3a; }

.wf-step.is-active {
  border-color: transparent;
  background: linear-gradient(150deg, var(--mara-grad-from), var(--mara-grad-to));
  box-shadow: 0 18px 40px -18px rgba(86, 53, 231, 0.7);
}
.wf-step.is-active .wf-icon { color: #fff; background: rgba(255, 255, 255, 0.18); }
.wf-step.is-active .wf-badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
.wf-step.is-active .wf-step-label,
.wf-step.is-active .wf-step-no { color: #fff; }
.wf-step.is-active .wf-step-sub { color: rgba(255, 255, 255, 0.82); }
.wf-step.is-active::after { color: rgba(255, 255, 255, 0.12); }

.wf-step.is-locked { opacity: 0.72; background: #fbfafd; }
.wf-step.is-locked .wf-icon { color: var(--mara-muted); background: var(--mara-ash); }

/* --- Home content grid (entry points / support / tutorials) --- */
.home-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .home-grid-2 { grid-template-columns: 1fr; } }

.home-card-title { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.home-card-title .ico {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 19px; color: #44474F; background: #ECECF0; flex-shrink: 0;
}
.home-card-title h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.home-card-title p { font-size: 13px; color: var(--mara-muted); margin-top: 2px; }

/* Support quick-links */
.support-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 0.9rem; border: 1px solid var(--mara-ash); border-radius: 13px;
  background: #fff; transition: all 0.15s ease;
}
.support-item:hover { border-color: #C9D6EC; background: #faf9ff; transform: translateX(2px); }
.support-item .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; color: #fff; flex-shrink: 0; }
.support-item .t { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.support-item .s { font-size: 11.5px; color: var(--mara-muted); margin-top: 1px; }
.support-item .arr { margin-left: auto; color: var(--mara-muted); font-size: 12px; }

/* Tutorials */
.tut-card {
  display: flex; gap: 1rem; align-items: center;
  padding: 0.9rem; border: 1px solid var(--mara-ash); border-radius: 16px; background: #fff;
  transition: all 0.16s ease;
}
.tut-card:hover { border-color: #C9D6EC; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.tut-thumb {
  position: relative; width: 132px; height: 84px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; color: rgba(255,255,255,0.92); font-size: 22px;
  overflow: hidden;
}
.tut-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.28), transparent 60%); }
.tut-thumb .fa-play { position: relative; z-index: 1; }
.tut-dur {
  position: absolute; right: 5px; bottom: 5px; z-index: 2;
  font-size: 9.5px; font-family: var(--font-mono); font-weight: 600;
  background: rgba(0,0,0,0.55); color: #fff; padding: 1px 5px; border-radius: 5px;
}
.tut-body .t { font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.tut-body .s { font-size: 12.5px; color: var(--mara-muted); margin-top: 4px; line-height: 1.4; }
.tut-tag {
  display: inline-block; margin-top: 8px; font-size: 10px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.06em; color: #44474F; background: #ECECF0;
  padding: 2px 7px; border-radius: 6px;
}

.tutorial-placeholder {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px dashed #c7d3e6;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  box-shadow: var(--shadow-sm);
}

.tutorial-placeholder-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  color: #44474F;
  background: #ECECF0;
  font-size: 15px;
}

.tutorial-placeholder h2,
.tutorial-placeholder .t {
  font-size: 14px;
  font-weight: 700;
}

.tutorial-placeholder p,
.tutorial-placeholder .s {
  margin-top: 2px;
  color: var(--mara-muted);
  font-size: 12px;
  line-height: 1.45;
}

.register-landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.register-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--mara-ash);
  border-radius: 16px;
  background: #fff;
  color: var(--mara-ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.register-card:hover {
  border-color: #c9d6ec;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.register-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.register-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: #ECECF0;
  color: #44474F;
  font-size: 15px;
}

.register-card-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--mara-ink);
}

.register-card-title {
  display: block;
  font-size: 15px;
  font-weight: 750;
}

.register-card-sub {
  display: block;
  margin-top: 4px;
  color: var(--mara-muted);
  font-size: 12px;
  line-height: 1.45;
}

.register-card-meta {
  display: block;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--mara-ash);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mara-muted);
}

.rando-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 1rem;
  align-items: stretch;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, #5c38e5 0%, #805cf5 58%, #9c73ef 100%);
  color: #fff;
  box-shadow: 0 22px 50px -26px rgba(92, 56, 229, 0.6);
}

.rando-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 0.4rem 0.25rem 0.35rem 0.35rem;
}

.rando-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}

.rando-panel h2,
.rando-copy h2 {
  margin-top: 0.9rem;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: 0;
  color: #fff;
}

.rando-copy p {
  max-width: 560px;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

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

.rando-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.rando-card:hover {
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-2px);
}

.rando-card-risk { background: rgba(255, 255, 255, 0.1); }
.rando-card-opp  { background: rgba(255, 255, 255, 0.1); }

.rando-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rando-card-opp .rando-label { color: #BEF264; }

.rando-num {
  margin-top: 0.4rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.rando-num-opp {
  color: #BEF264;
}

.rando-card-metric {
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.rando-num-small {
  font-size: 15px;
  font-weight: 750;
  color: #fff;
}

.rando-unit {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  line-height: 1.3;
}

.rando-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
}
.rando-strip strong {
  color: #fff;
  font-family: var(--font-mono);
}

.rando-strip a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.rando-strip a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .rando-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .tutorial-placeholder {
    align-items: flex-start;
  }

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

  .rando-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* gradient palette for thumbnails / support icons */
.grad-violet { background: linear-gradient(140deg, #0453A2, #2D7BE0); }
.grad-teal   { background: linear-gradient(140deg, #0ea5a3, #38d3b6); }
.grad-amber  { background: linear-gradient(140deg, #e08a1e, #f4b73d); }
.grad-rose   { background: linear-gradient(140deg, #e2447e, #f472b6); }
.grad-blue   { background: linear-gradient(140deg, #2f6bff, #5fa8ff); }
.grad-slate  { background: linear-gradient(140deg, #475569, #7689a3); }

/* =====================================================================
   Semantic button variants — soft, consistent with the refined system.
   Used by assessment / decision actions (e.g. activities Gate 2).
   ===================================================================== */
.btn-success {
  background: linear-gradient(135deg, #1f9d52, #15803d);
  color: #fff;
  box-shadow: 0 2px 8px -1px rgba(21, 128, 61, 0.35);
}
.btn-success:hover { filter: brightness(1.05); box-shadow: 0 6px 18px -2px rgba(21, 128, 61, 0.4); transform: translateY(-1px); }

.btn-warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd982;
}
.btn-warn:hover { background: #fde9a8; border-color: #f6c651; transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #d23b3b, #b91c1c);
  color: #fff;
  box-shadow: 0 2px 8px -1px rgba(185, 28, 28, 0.32);
}
.btn-danger:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* Full-width helper for stacked action buttons */
.btn-block { width: 100%; justify-content: center; }

/* =====================================================================
   Hero header (app-page-header) action controls — consistent + aligned.
   The header sits on a dark gradient; normalise ghost buttons and any
   plain text links so icons/text vertically align with the buttons.
   ===================================================================== */
.app-page-header .btn { vertical-align: middle; }
.app-page-header .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
  box-shadow: none;
}
.app-page-header .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.42);
}
.app-page-header .btn-ghost[disabled],
.app-page-header .btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; }
/* Plain links beside buttons in the hero → light, vertically centred so the
   text baseline lines up with the buttons. */
.app-page-header a:not(.btn) {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}
.app-page-header a:not(.btn):hover { color: #fff; text-decoration: underline; }

/* =====================================================================
   Peers screen — hero filter panel, segmented tabs, company logos
   ===================================================================== */
/* Segmented "view" control (Pending / Accepted / Skipped / All) */
.pill-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #E9EEF6; border: 1px solid var(--mara-ash); border-radius: 11px; }
.pill-tabs a { font-size: 12px; font-weight: 600; color: #6b6580; padding: 5px 13px; border-radius: 8px; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: all 0.14s ease; }
.pill-tabs a:hover { color: #1b1726; }
.pill-tabs a.is-active { background: #ffffff; color: #1D4ED8; box-shadow: 0 1px 2px rgba(27, 23, 38, 0.10); }

/* Hero-style filter panel */
.peer-filter {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #FAFBFC 0%, #F1F4F8 100%);
  border: 1px solid var(--mara-ash);
  box-shadow: var(--shadow-sm);
}
.peer-filter .filter-label { font: 700 10px var(--font-mono, monospace); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mara-muted); }

/* Company logo / monogram */
.peer-logo { display: inline-grid; place-items: center; border-radius: 6px; vertical-align: middle; flex-shrink: 0; overflow: hidden; }
img.peer-logo { object-fit: contain; background: #fff; border: 1px solid var(--mara-ash); padding: 2px; }
.peer-logo-mono { font-weight: 700; font-family: var(--font-mono, monospace); letter-spacing: 0.02em; }

/* Peer cohort chips */
.peer-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; background: #fff; border: 1px solid var(--mara-ash); border-radius: 999px; font-size: 12px; font-weight: 600; color: #2b2b2b; }
