@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/plex-ar-400-14eeccba.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/plex-ar-600-cf7c9232.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
}

/* Font Awesome Free 5.15.1 by Fonticons, Inc. — fonts licensed under SIL OFL 1.1. */
@font-face {
  font-family: "Workspace Icons";
  src: url("/assets/fa-solid-900-164cbff4.woff2") format("woff2");
  font-style: normal;
  font-weight: 900;
  font-display: block;
}

:root {
  color-scheme: light;
  --canvas: #fff;
  --surface: #fff;
  --ink: #2d2c30;
  --muted: #6b6b6e;
  --border: #ececeb;
  --green: #f7b918;
  --lime: #fddc4e;
  --lavender: #45434a;
  --blue: #c5e7ee;
  --chart-track: #ececeb;
  --deep-green: #2d2c30;
  --dark-green: #2d2c30;
  --radius: 19px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background-color: var(--surface); scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body { font-family: "Plex Arabic", Tahoma, sans-serif; line-height: 1.6; }
[dir="rtl"] .directional, [dir="rtl"] .breadcrumbs .icon { transform: scaleX(-1); }
[hidden] { display: none !important; }

.research-diagram {
  --diagram-path: #247450;
  --diagram-moderator: #7546a8;
  --diagram-control: #8c592a;
  min-width: 0;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfcfa;
}

.research-diagram > .panel-heading { margin-block-end: 14px; flex-wrap: wrap; }
.research-diagram > .panel-heading h3 { font-size: 17px; }
.research-diagram > .panel-heading .field { min-width: min(180px, 100%); }
.diagram-approve { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diagram-approve .diagram-approved { border-color: #e8e8e6; color: #2d2c30; }
.diagram-save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #e8e8e6;
  border-radius: 999px;
  background: #e7f3ea;
  color: #2d2c30;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.diagram-save-status::before { content: "\2713"; font-weight: 700; }
.diagram-save-status.is-visible { opacity: 1; transform: none; }
.diagram-save-status--error { border-color: #f2c4c4; background: #fdecec; color: #a12a2a; }
.diagram-save-status--error::before { content: "!"; }
.research-diagram-viewport {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e1e8df;
  border-radius: 13px;
  background: radial-gradient(circle, #dbe5da 1px, transparent 1px) 0 0 / 16px 16px #f4f8f3;
}

.research-diagram-canvas { position: relative; }
.research-diagram-scroll-hint { display: none; margin-block-start: 7px; color: var(--muted); font-size: 12px; }
.research-diagram-overflow .research-diagram-scroll-hint { display: block; }
.research-diagram-lines { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.diagram-edge { stroke: var(--edge-color); stroke-width: 1.75; fill: none; }
.diagram-guide { stroke: #64907a; stroke-width: 1; stroke-dasharray: 5 5; opacity: .55; }
.diagram-edge--path, .diagram-arrow--path, .research-diagram-label--path { --edge-color: var(--diagram-path); }
.diagram-edge--mediation, .diagram-edge--mediation-direct,
.diagram-arrow--mediation, .diagram-arrow--mediation-direct,
.research-diagram-label--mediation, .research-diagram-label--mediation-direct { --edge-color: var(--diagram-path); }
.diagram-edge--moderator, .diagram-arrow--moderator, .research-diagram-label--moderator { --edge-color: var(--diagram-moderator); }
.diagram-edge--control, .diagram-arrow--control, .research-diagram-label--control { --edge-color: var(--diagram-control); }
.diagram-edge--mediation, .diagram-edge--mediation-direct { stroke-dasharray: 6 4; }
.diagram-edge--control { stroke-dasharray: 2 4; }
.research-diagram-lines marker { fill: var(--edge-color); }

.research-diagram-node {
  --role-background: #edf1ed;
  --role-ink: #46544b;
  position: absolute;
  z-index: 1;
  cursor: grab;
  touch-action: none;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 4px;
  width: 184px;
  padding: 10px 12px 12px;
  border: 1px solid #d5e0d5;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 10px #1536270d;
  overflow-wrap: anywhere;
}

.research-diagram-node:active { cursor: grabbing; z-index: 3; }

.diagram-port {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--diagram-path);
  border-radius: 999px;
  background: var(--surface);
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
  z-index: 2;
}
.research-diagram-node.ports-on .diagram-port,
.research-diagram-ports-visible .diagram-port { opacity: 1; }
.diagram-mid-dot, .diagram-end-dot {
  fill: var(--diagram-path);
  stroke: #fff;
  stroke-width: 1;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.diagram-mid-dot.dot-on, .diagram-end-dot.dot-on,
.research-diagram-ports-visible .diagram-mid-dot {
  opacity: 1;
  pointer-events: all;
  cursor: move;
  touch-action: none;
}
.diagram-port.port-live {
  opacity: 1;
  background: var(--diagram-path);
  box-shadow: 0 0 0 4px rgba(39, 130, 83, .22);
}
.diagram-port[data-side="top"] { top: -5px; left: 50%; margin-left: -4.5px; }
.diagram-port[data-side="bottom"] { bottom: -5px; left: 50%; margin-left: -4.5px; }
.diagram-port[data-side="left"] { left: -5px; top: 50%; margin-top: -4.5px; }
.diagram-port[data-side="right"] { right: -5px; top: 50%; margin-top: -4.5px; }

.research-diagram-node[data-role="independent"] { --role-background: #d9f2e3; --role-ink: #175740; }
.research-diagram-node[data-role="dependent"] { --role-background: #dceef8; --role-ink: #255676; }
.research-diagram-node[data-role="mediator"] { --role-background: #f1eafa; --role-ink: #66418c; }
.research-diagram-node[data-role="moderator"] { --role-background: #f4e5f7; --role-ink: #6e3e80; }
.research-diagram-node[data-role="control"] { --role-background: #faecd8; --role-ink: #795527; }
.research-diagram-role {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--role-background);
  color: var(--role-ink);
  font-size: 11px;
  font-weight: 650;
}

.research-diagram-node strong { font-size: 14px; line-height: 1.35; }
.research-diagram-measurement { font-size: 11px; color: var(--muted); }
.research-diagram-node .measurement-dimensions {
  width: 100%;
  margin-block-start: 5px;
  border-block-start-color: var(--role-background);
}

.research-diagram-node .measurement-dimensions-title { font-size: 10px; color: var(--role-ink); }
.research-diagram-node .measurement-dimension-list > li {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 4px 6px;
  border-color: var(--role-background);
  background: color-mix(in srgb, var(--role-background), white 66%);
  font-size: 11px;
}

.research-diagram-node .dimension-code { background: var(--role-background); color: var(--role-ink); }

.research-diagram-node--dimension { padding: 8px 11px 10px; }
.research-diagram-node--dimension .dimension-code {
  justify-self: start;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.research-diagram-label {
  position: absolute;
  z-index: 3;
  max-width: 145px;
  padding: 1px 6px;
  border: 1px solid #d8e5d9;
  border-radius: 6px;
  direction: ltr;
  background: #fff;
  color: var(--edge-color);
  font: 700 11px/1.35 var(--font);
  text-align: center;
  pointer-events: none;
}

.diagram-edge-hit {
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 16;
  fill: none;
  pointer-events: stroke;
  cursor: move;
  touch-action: none;
}
.research-diagram-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 13px 0; list-style: none; color: var(--muted); font-size: 12px; }
.research-diagram-toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.research-diagram-legend li { display: inline-flex; align-items: center; gap: 6px; }
.diagram-swatch { width: 22px; border-block-start: 2px solid var(--diagram-path); }
.diagram-swatch--mediation { border-color: var(--diagram-path); border-block-start-style: dashed; }
.diagram-swatch--moderator { border-color: var(--diagram-moderator); }
.diagram-swatch--control { border-color: var(--diagram-control); border-block-start-style: dotted; }
.research-diagram-hypotheses { display: grid; gap: 7px; }
.research-diagram-hypotheses details { padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.research-diagram-hypotheses summary { cursor: pointer; overflow-wrap: anywhere; }
.research-diagram-hypotheses .hypothesis-number { display: inline-block; min-width: 26px; height: auto; margin-inline: 5px; padding: 3px; text-align: center; }
.research-diagram-paths { margin-block: 8px; padding-inline-start: 24px; }

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, input[type="submit"] { cursor: pointer; }
strong, b { font-weight: 650; }
:focus-visible { outline: 2px solid #279562; outline-offset: 3px; }

.icon {
  display: inline-block;
  flex: none;
  font: normal 900 0.93em/1 "Workspace Icons";
  text-align: center;
}

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

.sidebar {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 34px;
  height: 100dvh;
  padding: 28px 16px 22px;
  border-inline-end: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-toggle {
  position: absolute;
  inset-inline-end: -13px;
  inset-block-end: 24px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  z-index: 5;
}

.sidebar-toggle:hover { color: var(--deep-green); background: #f1f4ef; }
.sidebar-toggle .icon { width: 10px; transition: transform .18s ease; transform: scaleX(-1); }
[dir="rtl"] .sidebar-toggle .icon { transform: scaleX(1); }
html.nav-collapsed .sidebar-toggle .icon { transform: scaleX(1); }
[dir="rtl"] html.nav-collapsed .sidebar-toggle .icon { transform: scaleX(-1); }

/* Manual collapse keeps the icon-only rail at any width. */
html.nav-collapsed .app-shell { grid-template-columns: 60px minmax(0, 1fr); }
html.nav-collapsed .sidebar { z-index: 80; padding-inline: 8px; gap: 23px; align-items: center; }
/* The icon rail fits without scrolling; keep hover tooltips unclipped. */
html.nav-collapsed .sidebar-panels { overflow: visible; }
html.nav-collapsed .brand { margin-inline: 0; }
html.nav-collapsed .brand > span:nth-child(2),
html.nav-collapsed .nav-heading { display: none; }
html.nav-collapsed .sidebar :is(a, button).nav-link { position: relative; justify-content: center; padding-inline: 9px; gap: 0; }
/* Instant, styled tooltip replaces the visually hidden label when collapsed. */
html.nav-collapsed .sidebar :is(a, button).nav-link > span:not(.icon) {
  position: absolute;
  inset-inline-start: calc(100% + 10px);
  inset-block-start: 50%;
  z-index: 9999;
  width: max-content;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #2d2c30;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity .08s ease, transform .08s ease, visibility .08s;
  box-shadow: 0 8px 20px -10px rgba(45, 44, 48, .5);
}
html.nav-collapsed .sidebar :is(a, button).nav-link:hover > span:not(.icon),
html.nav-collapsed .sidebar :is(a, button).nav-link:focus-visible > span:not(.icon) {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-inline: 9px;
  color: #15251c;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.05em;
  direction: ltr;
}

[dir="rtl"] .brand { align-self: flex-start; }
.brand-period { color: #29935a; }

.brand-mark {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2.6px;
  inline-size: 35px;
  block-size: 35px;
  padding-block-end: 9px;
  border-radius: 10px;
  background: var(--deep-green);
}

.brand-mark i { inline-size: 4px; border-radius: 5px; background: var(--lime); }
.brand-mark i:nth-child(1) { block-size: 8px; }
.brand-mark i:nth-child(2) { block-size: 13px; }
.brand-mark i:nth-child(3) { block-size: 17px; }

.sidebar-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 34px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cfd7cf transparent;
  overscroll-behavior: contain;
}
.sidebar-panels::-webkit-scrollbar { width: 6px; }
.sidebar-panels::-webkit-scrollbar-thumb { border-radius: 999px; background: #cfd7cf; }
.sidebar-panels::-webkit-scrollbar-track { background: transparent; }
.sidebar-navigation, .sidebar-bottom { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 0; }
.sidebar-bottom { margin-block-start: auto; border-block-start: 1px solid var(--border); padding-block-start: 13px; }
.nav-heading { font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #2d2c30; padding-inline: 12px; margin-block-end: 4px; margin-block-start: 20px; border-block-start: 1px solid var(--border); padding-block-start: 12px; }
[dir="rtl"] .nav-heading { letter-spacing: normal; font-size: 12px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  width: 100%;
  min-width: 0;
  padding: 9px 12px 9px 28px;
  border: 0;
  border-radius: 10px;
  text-align: start;
  background: transparent;
  color: #535e55;
  font-weight: 550;
  white-space: nowrap;
}

.nav-link .icon { width: 16px; height: 16px; flex: none; }
.nav-link > span:not(.icon) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { color: var(--deep-green); background: #f1f4ef; }
.nav-link.active { color: #fff; background: #2d2c30; box-shadow: none; font-weight: 700; }
.nav-link.active .icon { color: #f7b918; }

.main-shell { min-width: 0; }
.topbar {
  min-height: 79px;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-block-end: 1px solid var(--border);
  background: var(--surface);
}

.breadcrumbs, .topbar-actions, .profile { display: flex; align-items: center; gap: 13px; }
.breadcrumbs { flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.breadcrumbs strong { color: var(--ink); }
.breadcrumbs .icon { font-size: 8px; color: #828f83; }
.topbar-actions { gap: 18px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7f8f6;
  color: #68726b;
  padding-inline: 12px;
  min-height: 41px;
}

.search-box input { background: transparent; border: 0; width: clamp(125px, 16vw, 230px); min-width: 0; color: var(--ink); font-size: 13px; }
.search-box input:focus-visible { outline-offset: 2px; }

.profile { gap: 8px; }
.profile-name { font-size: 12px; font-weight: 650; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: inline-grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 50%;
  background: #e0eced;
  color: #284139;
  font-size: 13px;
  font-weight: 750;
}

.main-content { max-width: 1530px; margin-inline: auto; padding: 28px 32px 38px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-block-end: 21px; }
.page-title h1, .auth-panel h1 { font-size: clamp(28px, 3vw, 41px); line-height: 1.13; letter-spacing: -.055em; font-weight: 740; overflow-wrap: anywhere; }
.page-title p, .auth-panel > p { color: var(--muted); margin-block-start: 8px; }
[dir="rtl"] .page-title h1, [dir="rtl"] .auth-panel h1 { letter-spacing: normal; line-height: 1.35; }

.button {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 41px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
  white-space: nowrap;
}

.button-primary { background: #1b4d35; color: #fff; }
.button-primary:hover { background: #143c29; }
.button-secondary { color: #274133; border-color: #dbe4dc; background: #fff; }
.button-secondary:hover { background: #eff6ef; }
.button-danger { color: #fff; background: #9a313a; }
.button-danger:hover { background: #80252d; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 215px;
  padding: 27px 32px;
  margin-block-end: 18px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #112c21;
  background-image: radial-gradient(ellipse at 81% 50%, #305d35 0%, transparent 62%),
    repeating-linear-gradient(90deg, transparent 0 40px, #e0ffd609 40px 41px),
    repeating-linear-gradient(0deg, transparent 0 40px, #e0ffd609 40px 41px);
  color: #fff;
}

.hero-content { position: relative; z-index: 1; max-width: 53%; }
.hero h2 { font-size: clamp(31px, 3.5vw, 48px); line-height: 1.05; letter-spacing: -.065em; font-weight: 750; text-wrap: balance; }
.hero h2 span { color: var(--lime); }
.hero p { max-width: 412px; margin-block: 12px 17px; color: #e1eee5; font-size: 14px; }
[dir="rtl"] .hero h2 { letter-spacing: normal; line-height: 1.25; }
[dir="rtl"] .hero h2 span { display: none; }
.button-hero { background: var(--lime); color: #1d311d; min-height: 38px; border-radius: 8px; }
.button-hero:hover { background: #f0ffab; }

.hero-graphic { width: 49%; max-width: 530px; position: absolute; inset-block: 0; inset-inline-end: 0; pointer-events: none; }
.orbit { position: absolute; display: block; inline-size: 360px; block-size: 100px; border: 1px solid #c6ffbd51; border-radius: 50%; inset: 54% auto auto 54%; }
.orbit-a { transform: translate(-50%, -50%) rotate(-22deg); }
.orbit-b { transform: translate(-50%, -50%) rotate(20deg); }
.orbit-c { transform: translate(-50%, -50%) rotate(-6deg) scale(1.16); border-color: #c6ffbd2e; }
.orbit-dot { position: absolute; inline-size: 7px; block-size: 7px; border-radius: 50%; background: #eafc96; box-shadow: 0 0 13px #d9fc9373; }
.dot-a { inset: 22% auto auto 24%; }
.dot-b { inset: 74% auto auto 74%; }
.dot-c { inset: 26% auto auto 89%; inline-size: 4px; block-size: 4px; }

.hero-plot {
  position: absolute;
  inset: 50% auto auto 54%;
  display: flex;
  flex-direction: column;
  width: min(60%, 243px);
  height: 133px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid #d3f2ac65;
  border-radius: 13px;
  background: linear-gradient(135deg, #4f7854e8, #1e4434ec);
  box-shadow: 0 13px 30px #081e1490, inset 0 1px 0 #e2ffcc2c;
  transform: translate(-50%, -50%) rotate(-11deg);
}

.hero-plot-top { display: flex; gap: 3px; margin-block-end: 14px; }
.hero-plot-top i { width: 4px; height: 4px; border-radius: 50%; background: #b5dbae; }
.hero-bars { display: flex; align-items: end; flex: 1; gap: 6px; background: repeating-linear-gradient(to top, #ecffe426 0 1px, transparent 1px 21px); }
.hero-bars i { flex: 1; height: 37%; border-radius: 5px 5px 1px 1px; background: #91dba1b8; }
.hero-bars i:nth-child(2) { height: 56%; }
.hero-bars i:nth-child(3) { height: 47%; }
.hero-bars i:nth-child(4) { height: 68%; background: #a1e7a9; }
.hero-bars i:nth-child(5) { height: 59%; }
.hero-bars i:nth-child(6) { height: 84%; background: #e6f987; }
.hero-bars i:nth-child(7) { height: 74%; }

.hero-symbol {
  position: absolute;
  inset: 25% 16% auto auto;
  transform: rotate(12deg);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #d6ffb960;
  border-radius: 12px;
  background: #a9dea3;
  color: #28533a;
  box-shadow: 0 6px 18px #0e281d57;
  font-size: 18px;
}

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-block-end: 18px; }
.metric { display: flex; flex-direction: column; align-items: start; border-radius: 15px; padding: 14px 16px 15px; min-width: 0; }
.metric-green { background: #ddf4e4; color: #184333; }
.metric-violet { background: #ede7fa; color: #433363; }
.metric-lime { background: #eff6cf; color: #394321; }
.metric-blue { background: #e0eff4; color: #254857; }
.metric-top { display: flex; align-items: center; gap: 8px; }
.metric-icon { display: grid; place-items: center; inline-size: 30px; block-size: 30px; border-radius: 9px; background: #ffffffa4; flex: none; }
.metric-label { font-size: 12px; line-height: 1.25; font-weight: 650; }
.metric strong { font-size: 31px; line-height: 1.07; font-weight: 750; letter-spacing: -.055em; margin-block: 8px 2px; }
.metric-note { font-size: 11px; opacity: .87; }

.dashboard-charts { display: grid; grid-template-columns: 1.62fr 1fr; gap: 16px; align-items: stretch; margin-block-end: 18px; }
.panel { min-width: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-block-end: 16px; }
.research-model-heading { flex-wrap: wrap; }
.panel-heading h2 { font-size: 17px; font-weight: 730; line-height: 1.25; letter-spacing: -.035em; }
.panel-heading p { font-size: 12px; color: var(--muted); margin-block-start: 4px; }
[dir="rtl"] .panel-heading h2 { letter-spacing: normal; }
.panel-icon, .file-icon { display: inline-grid; place-items: center; flex: none; border-radius: 9px; inline-size: 32px; block-size: 32px; background: #edf5eb; color: #27704b; }
.subtle-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 7px; background: #f0f3ee; color: #445344; font-size: 11px; font-weight: 650; white-space: nowrap; }

.activity-chart { height: 154px; display: grid; grid-template-columns: 25px 1fr; gap: 2px; padding-inline-end: 2px; }
.chart-axis { height: calc(100% - 22px); display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 10px; padding-block: 0 2px; }
.chart-grid { position: relative; min-width: 0; }
.chart-lines { inset: 6px 0 27px; position: absolute; display: flex; flex-direction: column; justify-content: space-between; }
.chart-lines i { height: 1px; background: #edf0eb; }
.chart-bars { position: absolute; inset: 6px 0 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.chart-column { display: grid; grid-template-rows: minmax(0, 1fr) 27px; align-items: end; justify-items: center; min-width: 0; }
.bar-area { display: flex; align-items: end; justify-content: center; height: 100%; width: 100%; }
.bar { display: block; height: var(--bar-height); width: clamp(14px, 52%, 35px); border-radius: 6px 6px 2px 2px; background: #d4eedc; }
.bar-highlight { background: #50bd7e; }
.chart-label { color: var(--muted); font-size: 10px; padding-block-end: 3px; }

.status-content { display: flex; align-items: center; gap: clamp(13px, 1.5vw, 25px); min-height: 154px; }
.donut { width: clamp(98px, 11vw, 135px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--donut-background); }
.donut > div { width: 73%; aspect-ratio: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 50%; background: #fff; text-align: center; }
.donut strong { font-size: 29px; font-weight: 750; letter-spacing: -.055em; line-height: 1; }
.donut span { font-size: 9px; color: var(--muted); margin-block-start: 5px; }
.status-legend { list-style: none; margin: 0; padding: 0; width: 100%; min-width: 0; }
.status-legend li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; margin-block: 9px; }
.status-legend li i { inline-size: 8px; block-size: 8px; border-radius: 3px; }
.status-legend b { color: var(--ink); }
.legend-ready { background: var(--green); }
.legend-mapping { background: var(--lime); }
.legend-modeling { background: var(--lavender); }
.legend-draft { background: var(--chart-track); }

.projects-panel .panel-heading { align-items: center; margin-block-end: 9px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: #246843; font-size: 12px; font-weight: 680; }
.text-link:hover { text-decoration: underline; }

.table-scroll { width: 100%; overflow: auto; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 12px 4px; }
.figure-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 12px 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { font-size: 11px; color: #657069; font-weight: 650; white-space: nowrap; }
.data-table th, .data-table td { padding: 10px; text-align: start; border-block-end: 1px solid #edf0ec; vertical-align: middle; }
.data-table tr:last-child td { border-block-end: 0; }
.data-table :is(th, td):first-child { padding-inline-start: 1px; }
.data-table :is(th, td):last-child { padding-inline-end: 1px; }
.project-link { display: inline-flex; align-items: center; gap: 9px; min-width: 220px; }
.project-link:hover strong { color: #246843; text-decoration: underline; }
.project-link .file-icon { inline-size: 29px; block-size: 29px; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 6px; white-space: nowrap; font-size: 11px; font-weight: 680; }
.status-ready { background: #e0f5e7; color: #236b46; }
.status-mapping { background: #f0f4cf; color: #4e5c23; }
.status-modeling { background: #efe9fa; color: #634793; }
.status-draft { background: #eef1ed; color: #5a655d; }

.empty { color: var(--muted); padding: 14px 0; }
.muted { color: var(--muted); font-size: 12px; }
.notice { display: flex; align-items: center; gap: 9px; margin-block-end: 15px; padding: 11px 14px; border-radius: 10px; background: #e5f4e8; color: #22573a; font-weight: 550; }
.notice-status { background: #e5f4e8; }
.notice-alert { background: #fff1da; color: #754b13; }
ul.notice { display: block; padding-inline-start: 30px; }

.form-panel { padding: 21px; }
.main-content > .form-panel { max-width: 720px; }
.auth-panel { max-width: 465px; padding: 29px; margin: 32px auto; }
.auth-panel > p { margin-block-end: 19px; }
.auth-panel .form-stack { margin-block-end: 13px; }
.auth-demo-action { margin-block-start: 22px; padding-block-start: 18px; border-block-start: 1px solid var(--border); }
.auth-demo-action p { margin-block-end: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-demo-action .button { inline-size: 100%; justify-content: center; }
.form-stack { display: grid; gap: 13px; justify-items: start; }
.form-stack > :not(.button) { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; gap: 5px; }
.field label, .path-fieldset legend { font-weight: 680; font-size: 12px; }
.field small { color: var(--muted); font-size: 11px; }

:is(.field, .dimension-form, .path-fieldset, .data-table) :is(input:not([type="submit"], [type="checkbox"]), select, textarea) {
  width: 100%;
  min-height: 41px;
  padding: 8px 10px;
  border: 1px solid #d8e1d8;
  border-radius: 8px;
  background: #fafbf9;
  color: var(--ink);
}

.field textarea { resize: vertical; }
.field input[type="file"] { padding: 5px; }
.field input::file-selector-button { border: 0; border-radius: 6px; padding: 6px; margin-inline-end: 8px; color: #205137; background: #e4f2e8; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.pls-export { margin-block-end: 16px; }
.pls-export .form-actions { align-items: end; }
.project-title h1 { margin-block-start: 8px; }
.project-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.section-navigation { display: flex; flex-wrap: wrap; gap: 7px; margin-block-end: 15px; }
.text-danger { color: #a1352c; }
.text-danger:hover { color: #7c231b; }
.text-restore { color: #278253; }
button.text-restore { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.section-form { border-block-start: 1px solid var(--border); padding-block-start: 14px; margin-block-start: 15px; }

.variable-list, .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.variable-card, .hypothesis-card, .dataset-tile { border: 1px solid var(--border); border-radius: 11px; background: #fbfcfa; padding: 12px; }
.variable-title { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.variable-title h3, .hypothesis-card h3, .variable-card h3 { font-size: 14px; overflow-wrap: anywhere; }
.variable-title .subtle-chip { flex: none; }
.variable-measurement { margin-block-start: 2px; color: var(--muted); font-size: 12px; }
.measurement-dimensions { margin-block-start: 10px; padding-block-start: 8px; border-block-start: 1px solid var(--border); }
.measurement-dimensions-title { display: block; margin-block-end: 6px; color: #4d6354; font-size: 11px; font-weight: 700; }
.measurement-dimension-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.measurement-dimension-list > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid #dce6dd;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}
.dimension-code {
  min-width: 24px;
  padding: 3px 4px;
  border-radius: 4px;
  background: #e7f2e9;
  color: #24593d;
  font: 700 10px/1.2 var(--font);
  text-align: center;
}
.dimension-name { justify-self: start; overflow-wrap: anywhere; }
.dimension-actions { display: flex; align-items: center; gap: 2px; }
.dimension-action { display: grid; place-items: center; inline-size: 28px; block-size: 28px; border-radius: 5px; color: #275941; }
.dimension-action:hover { background: #edf4ee; }
.model-delete-link { color: #94383f; }
.model-delete-link:hover { color: #782730; background: #f8ecec; }
.variable-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 10px; font-size: 12px; }
.archived-hypotheses { margin-block-start: 12px; }
.archived-hypotheses summary { margin-block-end: 8px; cursor: pointer; color: var(--muted); }
.dimension-form { display: flex; gap: 6px; margin-block-start: 10px; }
.dimension-form input[type="text"] { min-width: 0; }
.dimension-form .button { padding-inline: 8px; }
.hypothesis-card { display: flex; align-items: start; gap: 9px; margin-block-end: 7px; }
.hypothesis-number { font-size: 11px; font-weight: 700; border-radius: 6px; color: #1c5c3a; background: #e6f3e8; padding: 3px 6px; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-block: 5px; font-size: 13px; color: #45584a; }
.path-fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.path-fieldset legend { padding-inline: 5px; }
.path-fieldset .button { margin-block-start: 8px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 9px; }
.checkbox-group label { display: flex; align-items: center; gap: 5px; }

.dataset-tile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block-end: 12px; }
.dataset-tile div { flex: 1; min-width: 0; }
.dataset-tile .dataset-tile-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.dataset-tile strong { display: block; overflow-wrap: anywhere; }
.dataset-tile div span { color: var(--muted); font-size: 12px; }
.upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.data-table select { min-width: 142px; }
.table-scroll + .button { margin-block-start: 12px; }
.summary-values { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: 12px; margin-block: 7px; }
.summary-values dt { color: var(--muted); overflow-wrap: anywhere; }
.summary-values dd { margin-inline: 0; font-weight: 650; }
.variable-summary-totals { margin-block-end: 12px; }
.variable-summary-totals summary { cursor: pointer; font-weight: 650; }
.variable-summary-table th[scope="rowgroup"] { vertical-align: top; }
.summary-number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.variable-summary-categories { margin-block-start: 16px; }
.variable-summary-categories h3 { margin-block-end: 8px; font-size: 15px; }
.variable-summary-categories .muted { margin-block: 4px 8px; font-size: 12px; }
.study-report-section .table-scroll + .table-scroll { margin-block-start: 14px; }
.study-report-section caption { text-align: start; padding-block: 4px; font-weight: 650; }
.study-report-chart { margin: 15px 0 0; padding: 14px; border: 1px solid var(--border); border-radius: 11px; }
.study-report-chart figcaption { margin-block-end: 8px; font-weight: 700; }
.study-report-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 1fr) auto; align-items: center; gap: 10px; margin-block: 6px; }
.study-report-bar bdi { justify-self: start; overflow-wrap: anywhere; }
.study-report-bar-track { position: relative; height: 14px; background: #eff5ef; border-radius: 4px; }
.study-report-bar-track::after { content: ""; position: absolute; inset: 0 auto 0 var(--chart-origin); border-left: 1px solid #8ca597; }
.study-report-bar-track i { position: absolute; inset: 2px auto 2px var(--bar-start); width: var(--bar-length); background: #2d2c30; border-radius: 3px; }

@media (min-width: 1450px) {
  .main-content { padding-inline: 43px; }
  .topbar { padding-inline: 43px; }
  .hero { min-height: 240px; }
  .panel { padding: 20px 23px; }
}

@media (max-width: 1140px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .topbar, .main-content { padding-inline: 21px; }
  .sidebar { padding-inline: 12px; }
}

.mobile-sidebar-heading, .mobile-sidebar-backdrop { display: none; }
@media (max-width: 800px) {
  .app-shell { display: flex; flex-direction: column; }
  html.nav-expanded, html.nav-expanded body { overflow: hidden; }
  .sidebar {
    position: sticky;
    inset-block-start: 0;
    z-index: 60;
    height: auto;
    width: 100%;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border);
  }
  .brand { order: 1; margin-inline: 0; }
  .brand > span:nth-child(2) { display: inline; font-size: 18px; }
  [dir="rtl"] .sidebar .brand { align-self: center; }
  .sidebar .sidebar-toggle { display: none; }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(34, 34, 43, .42);
    transition: opacity .22s ease, visibility .22s;
  }
  .sidebar .sidebar-panels {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 7;
    inline-size: min(21rem, calc(100% - 44px));
    max-block-size: none;
    gap: 12px;
    padding-block: calc(14px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-bottom, 0px));
    padding-inline: max(14px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    border-inline-end: 1px solid var(--workspace-line);
    background: var(--surface);
    box-shadow: 0 8px 30px rgba(34, 34, 43, .20);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .22s ease, visibility .22s;
  }
  [dir="rtl"] .sidebar .sidebar-panels { transform: translateX(100%); }
  html.nav-expanded .sidebar .sidebar-panels { visibility: visible; transform: none; }
  html.nav-expanded .mobile-sidebar-backdrop { visibility: visible; opacity: 1; }
  .mobile-sidebar-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-block-end: 12px;
    border-block-end: 1px solid var(--workspace-line);
  }
  .mobile-sidebar-heading .button { inline-size: 44px; min-block-size: 44px; padding: 0; }
  @media (prefers-reduced-motion: reduce) {
    .sidebar .sidebar-panels, .mobile-sidebar-backdrop { transition: none; }
  }
  .sidebar-panels .sidebar-navigation,
  .sidebar-panels .sidebar-bottom { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .sidebar-panels .nav-heading { display: block; margin-block-start: 12px; }
  .sidebar-panels .nav-link {
    min-height: 40px;
    justify-content: flex-start;
    gap: 12px;
    padding-inline: 12px;
  }
  .sidebar-panels .nav-link > span:not(.icon) {
    position: static;
    width: auto;
    height: auto;
    overflow: hidden;
    clip-path: none;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .sidebar-panels .sidebar-bottom { margin-block-start: 8px; padding-block-start: 10px; border-block-start: 1px solid var(--border); }
  .topbar, .main-content { padding-inline: 13px; }
  .topbar { min-height: 52px; padding-block: 6px; }
  .topbar .search-box { display: none; }
  .breadcrumbs { gap: 7px; }
  .avatar { width: 28px; height: 28px; }
  .main-content { padding-block: 18px; }
  .page-title { align-items: flex-start; flex-wrap: wrap; gap: 9px; margin-block-end: 13px; }
  .page-title p { font-size: 12px; margin-block-start: 5px; }
  .page-title h1 { font-size: 29px; }
  .hero { min-height: 180px; padding: 16px; margin-block-end: 11px; }
  .hero h2 { font-size: 27px; }
  .hero p { font-size: 11px; margin-block: 8px 10px; }
  .hero-content { max-width: 66%; }
  .hero-graphic { width: 42%; opacity: .73; }
  .hero-plot { width: 100px; height: 77px; padding: 8px; }
  .hero-plot-top { margin-block-end: 6px; }
  .hero-bars { gap: 3px; }
  .hero-symbol { transform: scale(.7) rotate(12deg); right: 1%; top: 19%; }
  .orbit { width: 154px; height: 60px; overflow: hidden; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block-end: 11px; }
  .metric { padding: 9px; border-radius: 12px; }
  .metric-icon { width: 24px; height: 24px; }
  .metric strong { font-size: 24px; }
  .metric-label, .metric-note { font-size: 10px; }
  .dashboard-charts { grid-template-columns: 1fr; gap: 10px; margin-block-end: 11px; }
  .panel { padding: 13px; border-radius: 14px; }
  .status-content { min-height: 105px; }
  .status-legend { max-width: 221px; }
  .form-grid-three { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding: 7px; }
  .project-link { min-width: 150px; }
  .auth-panel { margin: 10px auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.hypothesis-analysis-link { margin-block-start: 7px; }
.analysis-guide { color: var(--muted); font-size: 13px; margin-block: 6px 11px; }
.analysis-control-group { padding: 8px 0; }
.analysis-control-group .checkbox-group { margin-block-start: 5px; }
.analysis-bulk { margin-block: 8px 4px; }
.analysis-history { margin: 0; padding: 0; list-style: none; }
.analysis-history li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px; min-height: 96px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: none; }
.analysis-history li:last-child { border: 1px solid var(--border); }
.analysis-history time { color: var(--muted); font-size: 12px; }
.analysis-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.analysis-metrics div { padding: 10px 13px; border-radius: 9px; background: #eff6ef; }
.analysis-metrics dt { font-size: 12px; color: var(--muted); }
.analysis-metrics dd { margin: 3px 0 0; font-size: 18px; font-weight: 700; }
.analysis-table tr > th[scope="row"] { white-space: normal; font-size: 13px; color: var(--ink); }
.analysis-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.analysis-table .directional { margin-inline: 4px; font-size: .8em; }
.equation-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.measurement-quality { margin-block-start: 20px; }
.measurement-quality h3 { margin-block: 0 6px; }
.analysis-source { padding-inline-start: 21px; overflow-wrap: anywhere; }
.moderated-links { display: grid; gap: 8px; margin-block-start: 10px; }
.latent-factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.latent-factors fieldset { margin: 0; }
.analysis-plan-methods { margin-block: 12px 16px; }
.analysis-plan-methods h3 { font-size: 14px; }
.latent-factors > .expanded-measurement { grid-column: 1 / -1; }
.latent-factors [data-pls-flat], .latent-factors [data-pls-dimensions] { margin-block-start: 10px; }
.latent-options { display: grid; gap: 5px; }
.latent-options label { display: flex; align-items: baseline; gap: 6px; overflow-wrap: anywhere; }
.sem-syntax { overflow: auto; padding: 10px; border-radius: 8px; background: var(--canvas); }

/* ---------- Project workspace: a livelier surface ---------- */

body {
  background:
    radial-gradient(1200px 620px at 86% -10%, #d9f2e3 0%, rgba(217, 242, 227, 0) 62%),
    radial-gradient(900px 560px at -6% 2%, #e2ecfa 0%, rgba(226, 236, 250, 0) 58%),
    linear-gradient(180deg, #f3f8f3 0%, #edf4ee 55%, #eaf2f0 100%);
  background-attachment: fixed;
}

/* Project header becomes a deep-green hero band. */
.project-title {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: center;
  padding: 26px 28px;
  margin-block-end: 20px;
  border-radius: 22px;
  color: #f2fbf5;
  background:
    radial-gradient(560px 280px at 84% 6%, rgba(150, 240, 178, .4), transparent 64%),
    radial-gradient(430px 280px at 4% 112%, rgba(124, 199, 255, .3), transparent 62%),
    linear-gradient(132deg, #0e3527 0%, #12533a 52%, #1a7350 100%);
  box-shadow: 0 30px 58px -36px rgba(8, 43, 28, .95), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.project-title::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(88% 130% at 78% 18%, #000 0%, transparent 76%);
}

.project-title::after {
  content: "";
  position: absolute;
  inset-block-start: -110px;
  inset-inline-end: -70px;
  z-index: -1;
  inline-size: 300px;
  block-size: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 255, 205, .55), transparent 68%);
}

.project-title h1 { color: #fff; margin-block-start: 10px; text-wrap: balance; }
.project-title p { max-width: 780px; color: #c9e8d4; }
.project-title .status-pill {
  border-radius: 999px;
  background: linear-gradient(135deg, #ecffab, #c8ef79);
  color: #233f1a;
  font-weight: 760;
  box-shadow: 0 12px 24px -14px rgba(200, 239, 121, .9);
}
.project-title .button-secondary {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .14);
  color: #f2fff6;
  backdrop-filter: none;
}
.project-title .button-secondary:hover { background: rgba(255, 255, 255, .24); }

/* Numbered progress rail. */
.section-navigation { counter-reset: step; gap: 8px; margin-block-end: 18px; }
.nav-step {
  counter-increment: step;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-block: 6px;
  padding-inline: 8px 14px;
  border: 1px solid #ecdcb9;
  border-radius: 999px;
  background: #fffaf0;
  color: #7c2d12;
  font-size: 12.5px;
  font-weight: 680;
  box-shadow: 0 12px 22px -20px rgba(120, 53, 15, .85);
}
.nav-step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 50%;
  background: linear-gradient(140deg, #f59e0b, #fbbf24);
  color: #3b2a08;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 6px 12px -8px rgba(245, 158, 11, .95);
}
.nav-step-locked { border-style: dashed; background: #f7f2e7; color: #a08f70; box-shadow: none; }
.nav-step-locked::before { background: #e9e2d0; color: #b0a282; box-shadow: none; }

/* Section panels: elevated cards with a colour-coded edge. */
.project-sections { gap: 18px; }
.project-sections > .panel {
  position: relative;
  padding: 22px 24px 24px;
  border: 1px solid #dfe9e1;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfefc 64%, #f7fbf8 100%);
  box-shadow: 0 26px 50px -40px rgba(12, 50, 33, .9), inset 0 1px 0 #fff;
  animation: project-panel-in .42s ease both;
}
.project-sections > .panel:nth-child(2) { animation-delay: .07s; }
.project-sections > .panel:nth-child(3) { animation-delay: .14s; }
.project-sections > .panel::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--panel-accent, #2ea36a), var(--panel-accent-alt, #a7e6bb));
}
#model { --panel-accent: #1c7a4d; --panel-accent-alt: #86dfae; --panel-tint: #e7f7ee; }
#hypotheses { --panel-accent: #6a4cc2; --panel-accent-alt: #b8a2f0; --panel-tint: #f0ebff; }
#responses { --panel-accent: #1e7f9f; --panel-accent-alt: #93d7e8; --panel-tint: #e8f6fb; }

@keyframes project-panel-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.panel-heading { align-items: flex-start; gap: 13px; margin-block-end: 18px; }
.panel-heading-text { flex: 1 1 auto; min-width: 0; }
.panel-heading h2 { font-size: 19px; font-weight: 760; letter-spacing: -.025em; }
.panel-icon {
  inline-size: 38px;
  block-size: 38px;
  border: 1px solid var(--panel-tint, #e2efe6);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--panel-tint, #eaf6ee), #fff);
  color: var(--panel-accent, #1f7a4d);
  box-shadow: 0 10px 18px -14px rgba(15, 60, 38, .7);
}

/* Buttons gain depth and lift. */
.button { border-radius: 11px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.button-primary {
  background: linear-gradient(135deg, #1f7f50 0%, #14603e 100%);
  box-shadow: 0 14px 24px -16px rgba(20, 96, 62, .95);
}
.button-primary:hover { background: linear-gradient(135deg, #25945c 0%, #157046 100%); transform: translateY(-1px); }
.button-secondary { border-color: #d6e4d8; background: #fff; color: #1f4a35; }
.button-secondary:hover { border-color: #b9dcc3; background: #eef8f0; }

.subtle-chip {
  border: 1px solid #d4ebda;
  border-radius: 999px;
  background: linear-gradient(135deg, #e9f8ee, #f6fcf7);
  color: #1a6641;
}

/* Hypothesis cards carry the colour of their relationship kind. */
.hypothesis-card {
  --hyp-accent: #2a9a63;
  --hyp-tint: #eef9f2;
  position: relative;
  margin-block-end: 9px;
  padding: 13px 15px;
  border: 1px solid #e4ece5;
  border-inline-start: 3px solid var(--hyp-accent);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--hyp-tint) 220%);
  box-shadow: 0 12px 24px -24px rgba(12, 50, 33, .8);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.hypothesis-card[data-kind="mediation"] { --hyp-accent: #6a4cc2; --hyp-tint: #f3efff; }
.hypothesis-card[data-kind="moderation"] { --hyp-accent: #b4761d; --hyp-tint: #fdf6e8; }
.hypothesis-card[data-kind="control"] { --hyp-accent: #9a6a24; --hyp-tint: #fdf7ec; }
.hypothesis-card .hypothesis-number {
  border-radius: 8px;
  padding: 4px 7px;
  background: var(--hyp-accent, #2a9a63);
  color: #fff;
  box-shadow: 0 8px 14px -12px var(--hyp-accent, #2a9a63);
}
.hypothesis-card[data-kind="mediation"] .text-link:not(.text-danger) { color: #5b3fb4; }
.hypothesis-card[data-kind="moderation"] .text-link:not(.text-danger) { color: #8f5b12; }
.text-link { color: #b45309; }
.text-link:hover { color: #92400e; }

/* Variable cards pick up their role colour. */
.variable-list { gap: 12px; }
.variable-card {
  --role-accent: #2a9a63;
  --role-tint: #eff9f3;
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid #e4ece5;
  border-radius: 14px;
  background: linear-gradient(165deg, #fff 0%, var(--role-tint) 240%);
  box-shadow: 0 14px 26px -26px rgba(12, 50, 33, .8);
  transition: transform .16s ease, box-shadow .16s ease;
}
.variable-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -26px rgba(12, 50, 33, .85); }
.variable-card::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  background: linear-gradient(90deg, var(--role-accent), transparent 78%);
  opacity: .8;
}
.variable-card[data-role="dependent"] { --role-accent: #2a6f9a; --role-tint: #edf6fc; }
.variable-card[data-role="mediator"] { --role-accent: #6a4cc2; --role-tint: #f4f0ff; }
.variable-card[data-role="moderator"] { --role-accent: #b0488e; --role-tint: #fdf0f9; }
.variable-card[data-role="control"] { --role-accent: #a8762a; --role-tint: #fdf6e8; }
.variable-card .subtle-chip { border-color: transparent; background: var(--role-tint); color: var(--role-accent); }

/* Data panel. */
.dataset-tile {
  padding: 14px;
  border-color: #dcebec;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #eef8fa);
  box-shadow: 0 14px 26px -26px rgba(12, 50, 33, .8);
}
.file-icon { background: linear-gradient(145deg, #dff3f8, #f5fdff); color: #1e7f9f; }
.project-sections .empty {
  padding: 18px;
  border: 1px dashed #d7e5d9;
  border-radius: 12px;
  background: #f8fcf8;
  text-align: center;
}

/* Diagram surface. */
.research-diagram {
  border-color: #dfece2;
  background: linear-gradient(180deg, #fff, #f7fbf8);
  box-shadow: inset 0 1px 0 #fff;
}
.research-diagram-viewport {
  border-color: #d9e8de;
  background:
    radial-gradient(circle, #d6e6d9 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(160deg, #f8fcf8, #eef8f2);
}
.research-diagram-hypotheses details { border-color: #e4ece5; transition: border-color .16s ease, box-shadow .16s ease; }
.research-diagram-hypotheses details:hover { border-color: #cfe4d5; box-shadow: 0 10px 20px -20px rgba(12, 50, 33, .8); }

@media (max-width: 680px) {
  .project-title { padding: 18px; border-radius: 18px; }
  .project-title h1 { font-size: 26px; }
  .project-sections > .panel { padding: 16px 14px; border-radius: 16px; }
  .project-sections > .panel::before { border-radius: 16px 16px 0 0; }
  .panel-icon { inline-size: 32px; block-size: 32px; border-radius: 10px; }
  .nav-step { padding-inline: 7px 11px; font-size: 11.5px; }
  .nav-step::before { inline-size: 19px; block-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-sections > .panel { animation: none; }
  .hypothesis-card, .variable-card, .button { transition: none; }
}

/* Small touches that carry the same energy into the chrome. */
.nav-link.active { color: #fff; background: #2d2c30; box-shadow: none; }
.nav-link.active .icon { color: #f7b918; }
.topbar { box-shadow: 0 14px 26px -28px rgba(12, 50, 33, .7); }
.search-box { background: #f8f3ea; border-color: #e7dcc8; }
.search-box:focus-within { border-color: #f0c48a; background: #fff; box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.research-diagram { background: linear-gradient(180deg, #ffffff, #f3faf6); }

/* ---------- Comfort pass: calmer rhythm, clearer grouping, easier scanning ---------- */

/* The step rail doubles as navigation, so it reads as a set of controls. */
.section-navigation {
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  border: 1px solid #e2ece5;
  border-radius: 999px;
  background: #f9fcf9;
  box-shadow: 0 16px 30px -30px rgba(12, 50, 33, .8);
}
.section-navigation a.nav-step {
  border-color: #ecd9b8;
  background: #fffaf0;
  color: #7c2d12;
  font-weight: 680;
  box-shadow: 0 10px 18px -20px rgba(120, 53, 15, .85);
}
.section-navigation a.nav-step:hover {
  border-color: #f59e0b;
  background: #fff3e0;
  transform: translateY(-1px);
}
.section-navigation a.nav-step:active { transform: none; }
.section-navigation .nav-step-locked { cursor: default; }
.section-navigation .nav-step-locked:hover { transform: none; border-color: #d8e6db; background: #f5f8f4; }

/* Panel intros read as supporting copy, not headlines. */
.panel-heading { flex-wrap: wrap; }
.panel-heading p { max-width: 68ch; font-size: 13px; line-height: 1.6; }
.panel-heading .form-actions { margin-inline-start: auto; }
.project-sections > .panel[id] { scroll-margin-block-start: 18px; }

/* Softer elevation: depth without the page feeling busy. */
.project-sections > .panel {
  box-shadow: 0 18px 36px -34px rgba(12, 50, 33, .78), inset 0 1px 0 #fff;
}
.variable-card:hover { transform: translateY(-1px); }

/* Hypotheses: kind becomes an eyebrow, the path is the content. */
.hypothesis-card { padding: 14px 16px; }
.hypothesis-card h3 {
  color: var(--hyp-accent, #2a9a63);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .05em;
  line-height: 1.3;
  text-transform: uppercase;
}
.hypothesis-card .path { margin-block-start: 4px; font-size: 14px; font-weight: 600; color: #2c4134; }
.hypothesis-card > div > p:not(.muted) { margin-block-start: 6px; color: #4a5b4f; line-height: 1.65; }
.hypothesis-card .muted { margin-block-start: 4px; font-size: 12px; }

/* Group the follow-up actions instead of one long run of links. */
.hypothesis-analysis-link {
  gap: 4px 16px;
  margin-block-start: 11px;
  padding-block-start: 11px;
  border-block-start: 1px dashed #e3ece5;
  font-size: 12.5px;
}
.hypothesis-analysis-link .text-link { padding-block: 2px; }
.hypothesis-analysis-link .text-danger { margin-inline-start: auto; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* Variables: a readable title block with the role chip aligned. */
.variable-card { padding: 15px; }
.variable-card h3 { font-size: 15px; }
.variable-measurement { margin-block-start: 3px; font-size: 12.5px; color: var(--muted); }
.variable-card .subtle-chip { font-size: 11px; }
.measurement-dimensions { margin-block-start: 12px; padding-block-start: 10px; }
.measurement-dimensions-title { font-size: 11.5px; letter-spacing: .01em; color: #5b6c5f; }
.measurement-dimension-list { gap: 6px; }
.measurement-dimension-list > li { min-height: 30px; }
.variable-actions { gap: 16px; padding-block-start: 10px; border-block-start: 1px dashed #e6eee7; }
.variable-actions .text-link { font-size: 12.5px; }

/* The diagram's hypothesis list should feel tappable and airy. */
.research-diagram-hypotheses details { padding: 10px 13px; border-color: #e2ece5; }
.research-diagram-hypotheses details[open] { background: #fbfefc; }
.research-diagram-hypotheses summary { font-size: 13px; line-height: 1.55; }
.research-diagram-scroll-hint { font-size: 12.5px; line-height: 1.55; }

/* Data panel: the upload reads as one calm block. */
.upload-form {
  gap: 12px;
  padding: 14px;
  border: 1px dashed #d7e5d9;
  border-radius: 14px;
  background: #f8fcf8;
}
.upload-form .field { flex: 1 1 250px; }
.upload-form .button { align-self: end; }
.dataset-tile { padding: 15px; }

/* Motion stays gentle, and disappears for people who ask for less of it. */
.section-navigation a.nav-step { transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }

@media (max-width: 900px) {
  .section-navigation { gap: 5px; padding: 5px; }
  .panel-heading .form-actions { margin-inline-start: 0; width: 100%; }
  .hypothesis-analysis-link .text-danger { margin-inline-start: 0; }
}

@media (max-width: 680px) {
  .section-navigation { width: 100%; border-radius: 16px; }
  .nav-step { padding-inline: 7px 11px; font-size: 11.5px; }
  .hypothesis-card { padding: 12px 13px; }
  .hypothesis-analysis-link { gap: 4px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section-navigation a.nav-step,
  .hypothesis-card,
  .variable-card,
  .button { transition: none; }
  .section-navigation a.nav-step:hover,
  .variable-card:hover { transform: none; }
}

/* On phones, keep controls thumb-friendly and stop iOS from zooming on focus. */
@media (max-width: 680px) {
  :is(.field, .dimension-form, .path-fieldset, .search-box)
    :is(input:not([type="submit"], [type="checkbox"]), select, textarea) { font-size: 16px; }
  .field label { font-size: 12.5px; }
  .hypothesis-analysis-link { font-size: 13px; }
  .hypothesis-analysis-link .text-link,
  .variable-actions .text-link { padding-block: 7px; }
  .nav-step { padding-block: 7px; }
  .nav-step::before { inline-size: 24px; block-size: 24px; font-size: 12px; }
  .research-diagram { padding: 12px; }
  .research-diagram > .panel-heading { row-gap: 8px; }
  .dataset-tile .dataset-tile-actions { width: 100%; }
  .dataset-tile .dataset-tile-actions .button { flex: 1 1 auto; }
}

/* ---------- Construct type guidance modal ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(10, 30, 20, .45);
  backdrop-filter: blur(4px);
}
.modal-backdrop:not([hidden]) { display: grid; }
.modal-panel {
  position: relative;
  width: min(540px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px 22px 20px;
  border: 1px solid #dfe9e1;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8fcf9);
  box-shadow: 0 36px 70px -34px rgba(8, 43, 28, .9);
}
.modal-close {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.modal-close:hover { background: #eef4ef; color: var(--ink); }

/* ---------- Results notes sheet ---------- */
.result-notes-button { display: inline-flex; align-items: center; gap: 7px; }
.result-notes-panel {
  width: min(1120px, 100%);
  max-height: 92vh;
  padding: 26px 24px 20px;
  background: linear-gradient(180deg, #fff, #fbfcfb);
}
.result-notes-panel h2 { margin: 0 40px 4px 0; font-size: 1.3rem; }
.result-notes-subtitle { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }
.result-notes-panel .analysis-guide { margin-block: 0 10px; }
.result-notes-discussion { margin-block: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.result-notes-discussion summary { cursor: pointer; font-weight: 700; }
.result-notes-discussion p { margin-block: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.result-notes-reference {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-inline-start: 3px solid var(--accent, #d4a72c);
  background: #f8f8f5;
  font-size: .84rem;
  line-height: 1.7;
}
.result-notes-reference strong { margin-inline-end: 6px; }
.result-notes-scroll { max-height: 54vh; overflow: auto; border: 1px solid #e4e9e5; border-radius: 12px; }
.result-notes-table { width: 100%; min-width: 830px; font-size: .85rem; }
.result-notes-table th, .result-notes-table td {
  vertical-align: top;
  text-align: start;
  padding: 9px 10px;
  border-bottom: 1px solid #ecefec;
}
.result-notes-table thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: #f1f4f1;
  box-shadow: 0 1px 0 #dfe6df;
}
.result-notes-table tbody tr:nth-child(even) { background: #fbfcfb; }
.result-notes-table td:nth-child(1) { white-space: nowrap; color: var(--muted); }
.result-notes-table td:nth-child(3) { direction: ltr; text-align: start; }
.result-notes-table td:nth-child(4) { color: var(--muted); font-size: .8rem; }
.result-notes-table td[contenteditable="true"] {
  min-width: 190px;
  background: #fffdf6;
  box-shadow: inset 0 0 0 1px #f0e4c2;
  cursor: text;
}
.result-notes-table td[contenteditable="true"]:focus { outline: 2px solid var(--accent, #d4a72c); background: #fff; }
.result-notes-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 14px; }
.result-notes-actions .button { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 640px) {
  .result-notes-panel { padding: 22px 14px 16px; }
  .result-notes-scroll { max-height: 60vh; }
}
.construct-type-block {
  margin-block: 10px;
  padding: 12px 14px;
  border: 1px solid #e4ece5;
  border-inline-start: 3px solid var(--panel-accent, #2a9a63);
  border-radius: 12px;
  background: #f8fcf8;
}
.construct-type-block h3 { margin-block-end: 6px; font-size: 15px; color: var(--panel-accent, #2a9a63); }
.construct-type-block p { margin-block: 4px 0; font-size: 13px; line-height: 1.6; }
.construct-type-block--formative { --panel-accent: #6a4cc2; background: #f4f0ff; border-color: #e6dff6; }
.construct-type-block--direct { --panel-accent: #1e7f9f; background: #eef7fa; border-color: #d8ecf2; }
.construct-type-reminder {
  display: grid;
  gap: 4px;
  margin-block: 12px 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0f6f1;
  font-size: 13px;
  line-height: 1.55;
}
.construct-type-guidance { margin-block-start: 8px; font-size: 12.5px; line-height: 1.6; }
.construct-type-guidance strong { display: block; margin-block-end: 2px; }
@media (max-width: 680px) {
  .modal-panel { padding: 20px 16px 16px; border-radius: 16px; }
  .construct-type-guidance { font-size: 13px; }
}

/* ---------- Academic theme: navy, indigo and warm gold ---------- */

:root {
  --joy-indigo: #4f46e5;
  --joy-violet: #7c3aed;
  --joy-teal: #0f766e;
  --joy-amber: #2d2c30;
  --joy-rose: #e11d48;
  --joy-sky: #0284c7;
  --joy-paper: #faf8f3;
  --joy-ink: #1e2a44;
}

body {
  background:
    radial-gradient(1100px 620px at 92% -8%, rgba(245, 158, 11, .18), transparent 60%),
    radial-gradient(900px 520px at -6% 4%, rgba(79, 70, 229, .16), transparent 58%),
    radial-gradient(700px 420px at 40% 112%, rgba(15, 118, 110, .12), transparent 60%),
    linear-gradient(180deg, #faf6ee 0%, #f4eee1 55%, #eee5d3 100%);
  background-attachment: fixed;
}

/* Joyful, scholarly hero */
.project-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: flex-start;
  gap: 22px;
  padding: 30px 32px 26px;
  margin-block-end: 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px;
  color: #f8f6ef;
  background:
    radial-gradient(620px 320px at 88% 0%, rgba(251, 191, 36, .55), transparent 62%),
    radial-gradient(460px 320px at 6% 112%, rgba(129, 140, 248, .26), transparent 62%),
    radial-gradient(400px 260px at 52% 22%, rgba(45, 212, 191, .16), transparent 60%),
    linear-gradient(135deg, #2a231c 0%, #3d3227 46%, #4c3d2b 100%);
  box-shadow: 0 34px 64px -36px rgba(23, 18, 12, .95), inset 0 1px 0 rgba(255,255,255,.16);
}
.project-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(90% 120% at 80% 10%, #000 0%, transparent 78%);
}
.project-hero::after {
  content: "";
  position: absolute;
  inset-block-start: -90px;
  inset-inline-end: -60px;
  z-index: -1;
  inline-size: 320px;
  block-size: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 230, 138, .5), rgba(251, 191, 36, 0) 70%);
}
.project-hero-body { flex: 1 1 auto; min-width: 0; }
.project-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-end: 10px; }
.project-hero-discipline {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #e9e5d8;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
}
.project-hero h1 {
  color: #fff;
  margin-block: 2px 8px;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.12;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.project-hero p { max-width: 780px; color: #efe6d8; font-size: 14px; line-height: 1.7; }
.project-hero .status-pill {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #3b2a08;
  font-weight: 760;
  box-shadow: 0 12px 24px -14px rgba(245, 158, 11, .95);
}
.project-hero .project-hero-action {
  flex: none;
  align-self: flex-start;
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.14);
  color: #f8f6ef;
  backdrop-filter: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.project-hero .project-hero-action:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.45); transform: translateY(-1px); }

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 10px;
  margin-block-start: 18px;
}
.project-stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  backdrop-filter: none;
}
.project-stat-icon {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(253,230,138,.95), rgba(251,191,36,.85));
  color: #3b2a08;
  box-shadow: 0 10px 18px -14px rgba(251,191,36,.9);
}
.project-stats .project-stat:nth-child(2) .project-stat-icon { background: linear-gradient(145deg, #c4b5fd, #a78bfa); color: #2e1065; }
.project-stats .project-stat:nth-child(3) .project-stat-icon { background: linear-gradient(145deg, #99f6e4, #5eead4); color: #134e4a; }
.project-stat strong { display: block; color: #fff; font-size: 18px; line-height: 1.1; font-weight: 780; letter-spacing: -.02em; }
.project-stat span { display: block; color: #dbe4f5; font-size: 11.5px; font-weight: 600; }

/* Cheerful connected stepper */
.project-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  padding: 10px 12px;
  margin-block-end: 20px;
  border: 1px solid #e3e0d6;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fbfaf6);
  box-shadow: 0 18px 34px -30px rgba(30, 42, 68, .35);
}
.project-stepper .step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 680;
  box-shadow: none;
  text-align: center;
}
.project-stepper .step::before { content: none !important; }
.project-stepper .step:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-end: -2px;
  inset-block-start: 50%;
  inline-size: 24px;
  block-size: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, #e2e8f0, #e2e8f0);
  transform: translateY(-50%);
  z-index: 1;
}
.project-stepper .step-index {
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #d8dee9;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 10px -8px rgba(30,42,68,.5);
}
.project-stepper .step-label { line-height: 1.3; }
.project-stepper a.step:hover { background: #fff7ed; color: #b45309; }
.project-stepper .step-done .step-index {
  border-color: transparent;
  background: linear-gradient(140deg, #f59e0b, #fbbf24);
  color: #3b2a08;
  box-shadow: 0 8px 16px -10px rgba(245, 158, 11, .95);
}
.project-stepper .step-done .step-index::after { content: ""; }
.project-stepper .step-done { color: #92400e; }
.project-stepper .step-done:not(:last-child)::after { background: linear-gradient(90deg, #fcd34d, #fbbf24); }
.project-stepper .step-current .step-index {
  border-color: #f59e0b;
  background: linear-gradient(140deg, #fde68a, #fbbf24);
  color: #78350f;
}
.project-stepper .step-current { color: #92400e; background: #fffbeb; }
.project-stepper .nav-step-locked.step { color: #94a3b8; opacity: .95; }
.project-stepper .nav-step-locked .step-index { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; box-shadow: none; }

/* Panels: elegant academic cards */
.project-sections { gap: 20px; }
.project-sections > .project-panel {
  position: relative;
  padding: 22px 24px 24px;
  border: 1px solid #e5e1d8;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fefdfb 70%, #faf8f3 100%);
  box-shadow: 0 22px 44px -36px rgba(30, 42, 68, .35), inset 0 1px 0 #fff;
}
.project-sections > .project-panel::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 18px;
  block-size: 4px;
  border-radius: 0 0 99px 99px;
  background: linear-gradient(90deg, var(--panel-accent, #4f46e5), var(--panel-accent-alt, #a5b4fc));
}
#model.project-panel { --panel-accent: #4f46e5; --panel-accent-alt: #f59e0b; --panel-tint: #eef2ff; }
#hypotheses.project-panel { --panel-accent: #7c3aed; --panel-accent-alt: #f472b6; --panel-tint: #f5f3ff; }
#responses.project-panel { --panel-accent: #0f766e; --panel-accent-alt: #38bdf8; --panel-tint: #ecfeff; }

.panel-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-end: 4px;
  color: var(--panel-accent, #4f46e5);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
[dir="rtl"] .panel-eyebrow { letter-spacing: 0; }
.panel-icon {
  inline-size: 42px;
  block-size: 42px;
  border: 1px solid var(--panel-tint, #eef2ff);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--panel-tint, #eef2ff), #fff);
  color: var(--panel-accent, #4f46e5);
  box-shadow: 0 12px 20px -16px rgba(30,42,68,.4);
}
.panel-heading h2 { color: var(--joy-ink); font-size: 20px; letter-spacing: -.02em; }
.panel-heading p { color: #64748b; }

/* Buttons and chips */
.button { border-radius: 12px; }
.button-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #2d2c30 100%);
  color: #3b2a08;
  box-shadow: 0 14px 26px -18px rgba(217, 119, 6, .95);
}
.button-primary:hover { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); transform: translateY(-1px); }
.button-secondary { border-color: #ddd9ce; color: #334155; background: #fff; }
.button-secondary:hover { border-color: #f5c98b; background: #fff7ec; color: #92400e; }
.subtle-chip {
  border: 1px solid #e0ddd2;
  border-radius: 999px;
  background: linear-gradient(135deg, #fdf3e3, #fffdf7);
  color: #b45309;
}

/* Hypothesis & variable cards */
.hypothesis-card {
  --hyp-accent: #4f46e5;
  --hyp-tint: #f5f3ff;
  border: 1px solid #e8e4da;
  border-inline-start: 4px solid var(--hyp-accent);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, var(--hyp-tint) 260%);
}
.hypothesis-card[data-kind="mediation"] { --hyp-accent: #7c3aed; --hyp-tint: #f5f3ff; }
.hypothesis-card[data-kind="moderation"] { --hyp-accent: #2d2c30; --hyp-tint: #fffbeb; }
.hypothesis-card[data-kind="control"] { --hyp-accent: #0f766e; --hyp-tint: #f0fdfa; }
.hypothesis-card .hypothesis-number { background: var(--hyp-accent); color: #fff; }
.hypothesis-card h3 { color: var(--hyp-accent); }
.hypothesis-card .path { color: #334155; }
.text-link { color: #b45309; }
.text-link:hover { color: #92400e; }

.variable-card { --role-accent: #4f46e5; --role-tint: #eef2ff; border-color: #e8e4da; border-radius: 16px; }
.variable-card[data-role="dependent"] { --role-accent: #0f766e; --role-tint: #ecfeff; }
.variable-card[data-role="mediator"] { --role-accent: #7c3aed; --role-tint: #f5f3ff; }
.variable-card[data-role="moderator"] { --role-accent: #db2777; --role-tint: #fdf2f8; }
.variable-card[data-role="control"] { --role-accent: #2d2c30; --role-tint: #fffbeb; }
.variable-card .subtle-chip { background: var(--role-tint); color: var(--role-accent); border: 0; }

/* Data & diagram */
.dataset-tile { border-color: #d9ebe8; background: linear-gradient(135deg, #fff, #f0fdfa); }
.file-icon { background: linear-gradient(145deg, #ccfbf1, #f0fdfa); color: #0f766e; }
.upload-form { border-color: #d9ebe8; background: #f4fbf9; }
.project-sections .empty { border-color: #ddd9ce; background: #faf8f3; }
.research-diagram { background: linear-gradient(180deg, #fff, #f8f6ff); border-color: #e3e0f0; }
.research-diagram-viewport {
  background:
    radial-gradient(circle, #ddd8ee 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(160deg, #fdfcff, #f5f3ff);
}

/* Modal accents */
.construct-type-block--reflective { --panel-accent: #4f46e5; background: #eef2ff; border-color: #c7d2fe; }
.construct-type-block--formative { --panel-accent: #7c3aed; background: #f5f3ff; border-color: #ddd6fe; }
.construct-type-block--direct { --panel-accent: #0f766e; background: #f0fdfa; border-color: #99f6e4; }

@media (max-width: 900px) {
  .project-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .project-stepper .step:not(:last-child)::after { display: none; }
}
@media (max-width: 680px) {
  .project-hero { padding: 20px 18px; border-radius: 20px; }
  .project-stats { grid-template-columns: 1fr; }
  .project-stepper { grid-template-columns: 1fr; padding: 8px; }
  .project-stepper .step { justify-content: flex-start; text-align: start; }
  .project-sections > .project-panel { padding: 16px 14px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .project-hero .project-hero-action:hover,
  .button-primary:hover { transform: none; }
}

/* ---------- elearn-style light redesign: white, ink, yellow ---------- */

:root {
  --ink: #2d2c30;
  --muted: #6b6b6e;
  --border: #ececeb;
  --canvas: #fff;
  --surface: #fff;
  --yellow: #f7b918;
  --yellow-soft: #fddc4e;
  --dark: #2d2c30;
  --card-gray: #f4f4f3;
  --deep-green: #2d2c30;
  --dark-green: #2d2c30;
  --green: #f7b918;
  --lime: #fddc4e;
  --lavender: #45434a;
  --chart-track: #ececeb;
}

/* Pure white canvas, flat like the reference. */
body {
  background: #fff;
  color: var(--ink);
}

:focus-visible { outline: 2px solid #2d2c30; outline-offset: 3px; }

/* ---------- Sidebar: white rail, dark active pill, yellow accents ---------- */
.sidebar { background: #fff; border-inline-end: 0; }
.brand { color: #2d2c30; }
.brand-period { color: #f7b918; }
.brand-mark { background: #2d2c30; }
.brand-mark i { background: #f7b918; }
.sidebar-toggle { border-color: #ececeb; background: #fff; color: #6b6b6e; }
.sidebar-toggle:hover { color: #2d2c30; background: #f4f4f3; }
.nav-heading { color: #2d2c30; }
.nav-link { color: #6b6b6e; }
.nav-link:hover { color: #2d2c30; background: #f4f4f3; }
.nav-link.active { color: #fff; background: #2d2c30; box-shadow: none; font-weight: 700; }
.nav-link.active .icon { color: #f7b918; }

/* ---------- Topbar: plain white chrome ---------- */
.topbar { background: #fff; border-block-end: 1px solid #f4f4f3; box-shadow: none; }
.breadcrumbs { color: #6b6b6e; }
.breadcrumbs strong { color: #2d2c30; }
.breadcrumbs .icon { color: #c9c9c8; }
.search-box { border: 0; background: #f4f4f3; color: #6b6b6e; box-shadow: none; }
.search-box input { color: #2d2c30; }
.search-box:focus-within { background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(247, 185, 24, .4); }
.avatar { background: #f7b918; color: #2d2c30; }
.profile-name { color: #2d2c30; }

/* ---------- Buttons, links, chips ---------- */
.button { border-radius: 12px; }
.button-primary { background: #2d2c30; color: #fff; box-shadow: none; }
.button-primary:hover { background: #45444a; transform: none; }
.button-secondary { color: #2d2c30; border-color: #e3e3e1; background: #fff; }
.button-secondary:hover { background: #f4f4f3; border-color: #dcdcdb; }
.button-danger { background: #9a313a; }
.text-link { color: #2d2c30; font-weight: 680; }
.text-link:hover {
  color: #2d2c30;
  text-decoration: underline;
  text-decoration-color: #f7b918;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 4px;
}
.subtle-chip { border: 0; border-radius: 999px; background: #f4f4f3; color: #6b6b6e; }
/* Numeric summaries on result pages use the active ink/yellow palette. */
.result-tab-panel .panel-heading .subtle-chip,
.result-tab-panel .analysis-guide .subtle-chip,
.result-tab-panel .model-fit-group .subtle-chip {
  border: 0;
  background: #2d2c30;
  color: #f7b918;
  font-weight: 720;
}
.status-ready { background: #fdeea8; color: #7a5b00; }
.status-mapping { background: #ececeb; color: #6b6b6e; }
.status-modeling { background: #2d2c30; color: #fff; }
.status-draft { background: #fff; border: 1px solid #e3e3e1; color: #6b6b6e; }
.notice { background: #fdf3d7; color: #6b4d00; }
.notice-status { background: #fdf3d7; }
.notice-alert { background: #fde68a; color: #5b4400; }
.text-restore { color: #2d2c30; }

/* ---------- Forms and tables ---------- */
:is(.field, .dimension-form, .path-fieldset, .data-table) :is(input:not([type="submit"], [type="checkbox"]), select, textarea) {
  border: 1px solid #e3e3e1;
  background: #fff;
}
.field input::file-selector-button { color: #2d2c30; background: #f7b918; }
.path-fieldset { border-color: #e3e3e1; background: #fff; }
.section-form { border-block-start-color: #ececeb; }
.data-table th { color: #6b6b6e; }
.data-table th, .data-table td { border-block-end-color: #f0f0ef; }
.project-link:hover strong { color: #2d2c30; }
.analysis-history li { border-block-end-color: #f0f0ef; }
.analysis-metrics div { background: #f4f4f3; }
.sem-syntax { background: #f7f7f6; }
.study-report-bar-track { background: #f4f4f3; }
.study-report-bar-track i { background: #2d2c30; }
.study-report-bar-track::after { border-left-color: #c9c9c8; }
.dimension-code { background: #fdf3d7; color: #7a5b00; }
.measurement-dimensions { border-block-start-color: #ececeb; }
.measurement-dimensions-title { color: #6b6b6e; }
.measurement-dimension-list > li { border-color: #ececeb; background: #fff; }
.dimension-action { color: #2d2c30; }
.dimension-action:hover { background: #f4f4f3; }
.variable-actions { border-block-start-color: #ececeb; }
.empty { border: 1px dashed #e0e0de; background: #fafafa; color: #6b6b6e; }

/* ---------- Project header: big ink title on white, like "Courses" ---------- */
.project-hero {
  padding: 6px 0 2px;
  margin-block-end: 16px;
  border: 0;
  border-radius: 0;
  color: #2d2c30;
  background: transparent;
  box-shadow: none;
}
.project-hero::before, .project-hero::after { content: none; }
.project-hero h1 { color: #2d2c30; letter-spacing: -.045em; font-size: clamp(20px, 2.6vw, 34px); line-height: 1.15; }
.project-hero p { color: #6b6b6e; }
.project-hero-meta { gap: 8px; }
.project-hero .status-pill {
  border-radius: 999px;
  background: #f7b918;
  color: #2d2c30;
  font-weight: 740;
  box-shadow: none;
}
.project-hero-discipline {
  border: 0;
  background: #f4f4f3;
  color: #6b6b6e;
}
.project-hero .project-hero-action {
  border: 1px solid #2d2c30;
  background: #2d2c30;
  color: #fff;
  backdrop-filter: none;
  box-shadow: none;
}
.project-hero .project-hero-action:hover { background: #2d2c30; border-color: #2d2c30; }
.project-hero-actions { flex: 1 0 100%; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; margin-block-start: 10px; }
.project-actions-menu { position: relative; display: block; margin-inline-start: 8px; }
.project-actions-menu-trigger {
  display: grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  border: 1px solid #2d2c30;
  border-radius: 10px;
  background: #2d2c30;
  color: #fff;
  cursor: pointer;
  list-style: none;
}
.project-actions-menu-trigger::-webkit-details-marker { display: none; }
.project-actions-menu-trigger .icon { margin: 0; }
.project-actions-menu:not([open]) > .project-actions-menu-panel { display: none; }
.project-actions-menu-panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 50;
  display: grid;
  min-width: 220px;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e3e3e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgba(45, 44, 48, .5);
}
.project-actions-menu-panel .project-hero-action { inline-size: 100%; justify-content: center; margin: 0; }

.project-stats { gap: 10px; margin-block-start: 16px; }
.project-stat { border: 0; border-radius: 16px; background: #f4f4f3; backdrop-filter: none; }
.project-stat-icon { background: #f7b918; color: #2d2c30; box-shadow: none; }
.project-stats .project-stat:nth-child(2) .project-stat-icon { background: #f7b918; color: #2d2c30; }
.project-stats .project-stat:nth-child(3) .project-stat-icon { background: #f7b918; color: #2d2c30; }
.project-stat strong { color: #2d2c30; }
.project-stat span { color: #6b6b6e; }

/* ---------- Steps become text tabs with a yellow underline ---------- */
.project-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 30px;
  width: 100%;
  padding: 2px 0 10px;
  margin-block-end: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.project-stepper .nav-step.step {
  min-height: 0;
  padding: 8px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b6b6e;
  font-size: 14px;
  font-weight: 650;
  box-shadow: none;
}
.project-stepper .step-index { display: none; }
.project-stepper .step:not(:last-child)::after { content: none; }
.project-stepper a.nav-step.step:hover { background: transparent; color: #2d2c30; }
.project-stepper .nav-step.step-done { color: #2d2c30; }
.project-stepper .nav-step.step-current { color: #2d2c30; background: transparent; }
.project-stepper .nav-step.nav-step-locked.step { color: #6b6b6e; opacity: 1; }
.project-stepper .nav-step.step.step-current::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  inline-size: auto;
  block-size: 3px;
  border-radius: 99px;
  background: #f7b918;
  transform: none;
  z-index: 1;
}

/* ---------- Sections: flat light-gray cards like the course list ---------- */
.project-sections { gap: 18px; }
.project-sections > .project-panel {
  padding: 22px 24px 24px;
  border: 0;
  border-radius: 24px;
  background: #f4f4f3;
  box-shadow: none;
}
.project-sections > .project-panel::before { content: none; }
.panel-eyebrow { color: #a16200; letter-spacing: .08em; }
.panel-icon {
  border: 0;
  background: #f7b918;
  color: #2d2c30;
  box-shadow: none;
}
.panel-heading h2 { color: #2d2c30; letter-spacing: -.03em; }
.panel-heading p { color: #6b6b6e; }

/* ---------- Cards on the gray panels: white, soft shadow, no accent bars ---------- */
.variable-card, .hypothesis-card, .dataset-tile {
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px -22px rgba(45, 44, 48, .35);
}
.hypothesis-card { border-inline-start: 0; background: #fff; }
.variable-card { overflow: hidden; border: 1px solid #dcdcda; box-shadow: none; }
.variable-card::after { content: none; }
.variable-card:hover { box-shadow: 0 16px 32px -22px rgba(45, 44, 48, .45); }
.hypothesis-card h3 { color: #6b6b6e; }
.hypothesis-card .path { color: #2d2c30; font-weight: 700; }
.hypothesis-card > div > p:not(.muted) { color: #6b6b6e; }
.hypothesis-card .hypothesis-number {
  background: #f7b918;
  color: #2d2c30;
  box-shadow: none;
}
.hypothesis-number { background: #f7b918; color: #2d2c30; }
.hypothesis-card[data-kind="mediation"] .text-link:not(.text-danger) { color: #2d2c30; }
.hypothesis-card[data-kind="moderation"] .text-link:not(.text-danger) { color: #2d2c30; }
.hypothesis-analysis-link { border-block-start-color: #ececeb; }
.variable-card h3 { color: #2d2c30; }
.variable-card[data-role="independent"] .subtle-chip { background: #fdf3d8; color: #7a5b00; }
.variable-card[data-role="dependent"] .subtle-chip { background: #e3eef5; color: #2b5a76; }
.variable-card[data-role="mediator"] .subtle-chip { background: #efe9f8; color: #5b3fa8; }
.variable-card[data-role="moderator"] .subtle-chip { background: #f7e3ec; color: #8f3f68; }
.variable-card[data-role="control"] .subtle-chip { background: #fdeea8; color: #7a5b00; }
.dataset-tile { box-shadow: 0 10px 26px -22px rgba(45, 44, 48, .35); }
.file-icon { background: #f7b918; color: #2d2c30; }
.upload-form { border: 1px dashed #e0e0de; background: #fafafa; }

/* ---------- Diagram on white ---------- */
.research-diagram {
  --diagram-path: #2d2c30;
  --diagram-moderator: #2d2c30;
  --diagram-control: #6b6b6e;
  border: 1px solid #ececeb;
  background: #fff;
}
.research-diagram-viewport {
  border-color: #e3e3e1;
  background: radial-gradient(circle, #d6d6d4 1px, transparent 1px) 0 0 / 16px 16px #efefee;
}
.diagram-guide { stroke: #a5a5a8; }
.diagram-port.port-live { box-shadow: 0 0 0 4px rgba(45, 44, 48, .18); }
.research-diagram-node {
  border: 1.5px solid #d4d4d2;
  background: #fff;
  box-shadow: 0 8px 20px rgba(45, 44, 48, .16), 0 2px 6px rgba(45, 44, 48, .08);
}
.research-diagram-node[data-role="independent"] { --role-background: #fde68a; --role-ink: #78350f; }
.research-diagram-node[data-role="dependent"] { --role-background: #bfdbfe; --role-ink: #1e3a8a; }
.research-diagram-node[data-role="mediator"] { --role-background: #ddd6fe; --role-ink: #4c1d95; }
.research-diagram-node[data-role="moderator"] { --role-background: #fbcfe8; --role-ink: #831843; }
.research-diagram-node[data-role="control"] { --role-background: #fde68a; --role-ink: #78350f; }
.research-diagram-node strong { color: #1a1a1a; }
.research-diagram-node .measurement-dimension-list > li { border-color: #d8d8d6; background: #fafafa; }
.research-diagram-label { border-color: #ececeb; }
.research-diagram-hypotheses details { border-color: #ececeb; background: #fff; }
.research-diagram-hypotheses details:hover { border-color: #dcdcdb; box-shadow: 0 10px 22px -20px rgba(45, 44, 48, .5); }
.diagram-save-status { border-color: #f3ddb8; background: #fdf6e3; color: #7a5b00; }
.diagram-save-status--error { border-color: #f2c4c4; background: #fdecec; color: #a12a2a; }
.diagram-approve .diagram-approved { border-color: #f3ddb8; color: #7a5b00; }

/* ---------- Guidance modal on white ---------- */
.modal-backdrop { background: rgba(45, 44, 48, .5); }
.modal-panel { border-color: #ececeb; border-radius: 20px; background: #fff; box-shadow: 0 40px 80px -40px rgba(45, 44, 48, .8); }
.modal-close:hover { background: #f4f4f3; color: #2d2c30; }
.construct-type-block { border-color: #ececeb; background: #fafafa; }
.construct-type-block--reflective { --panel-accent: #2d2c30; background: #fdf6e3; border-color: #f3ddb8; }
.construct-type-block--formative { --panel-accent: #2d2c30; background: #f4f4f3; border-color: #ececeb; }
.construct-type-block--direct { --panel-accent: #2b5a76; background: #eef5f9; border-color: #d8e6ee; }
.construct-type-reminder { background: #f4f4f3; }

/* ---------- Dashboard: flat light hero, uniform tiles, yellow accents ---------- */
.hero {
  background: #f4f4f3;
  background-image: none;
  color: #2d2c30;
  box-shadow: none;
}
.hero h2 span { color: #2d2c30; }
.hero p { color: #6b6b6e; }
.button-hero { background: #2d2c30; color: #fff; }
.button-hero:hover { background: #45444a; }
.orbit { border-color: rgba(247, 185, 24, .4); }
.orbit-c { border-color: rgba(247, 185, 24, .22); }
.orbit-dot { background: #f7b918; box-shadow: 0 0 13px rgba(247, 185, 24, .55); }
.hero-plot {
  border-color: rgba(255, 255, 255, .08);
  background: linear-gradient(135deg, #35343a, #2d2c30);
  box-shadow: 0 16px 34px rgba(35, 34, 39, .35);
}
.hero-plot-top i { background: #f7b918; }
.hero-bars { background: repeating-linear-gradient(to top, rgba(255, 255, 255, .06) 0 1px, transparent 1px 21px); }
.hero-bars i, .hero-bars i:nth-child(2), .hero-bars i:nth-child(3), .hero-bars i:nth-child(5), .hero-bars i:nth-child(7) { background: rgba(253, 220, 78, .5); }
.hero-bars i:nth-child(4), .hero-bars i:nth-child(6) { background: #f7b918; }
.hero-symbol { border-color: rgba(45, 44, 48, .08); background: #f7b918; color: #2d2c30; box-shadow: 0 10px 24px rgba(35, 34, 39, .25); }

.metric-green, .metric-violet, .metric-lime, .metric-blue { background: #f4f4f3; color: #2d2c30; }
.metric-icon { background: #f7b918; color: #2d2c30; }
.chart-lines i { background: #f0f0ef; }
.bar { background: #ececeb; }
.bar-highlight { background: #f7b918; }
.legend-ready { background: #f7b918; }
.legend-mapping { background: #d9d9d8; }
.legend-modeling { background: #2d2c30; }
.legend-draft { background: #ececeb; }

/* ---------- Small chrome touches ---------- */
.research-diagram { box-shadow: none; }
.file-icon { box-shadow: none; }
a.nav-step, .nav-step { transition: background .16s ease, color .16s ease; }
.project-stepper .nav-step.nav-step-locked.step-current { color: #2d2c30; }

/* Hypothesis rows in the diagram list: variable-name rectangles with arrows */
.research-diagram-hypotheses summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.research-diagram-hypotheses summary > bdi:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.diagram-flow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
  flex: 0 0 auto;
}
.diagram-flow .icon { color: #2d2c30; font-size: 11px; }
.diagram-flow-node {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: #f7b918;
  color: #2d2c30;
  font-size: 12.5px;
  font-weight: 700;
}
.diagram-flow-node { min-width: 28px; text-align: center; padding: 7px 10px; }

/* ---------- Project tabs: one section per page ---------- */
.project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
  margin-block: 4px 18px;
  padding-block: 0 10px;
  border-block-end: 1px solid #ececeb;
}
.project-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  color: #6b6b6e;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color .16s ease;
}
.project-tab:hover { color: #2d2c30; }
.project-tab-active { color: #2d2c30; }
.project-tab-active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -11px;
  block-size: 3px;
  border-radius: 99px;
  background: #f7b918;
}
.project-tab-locked { color: #c9c9c8; cursor: default; }
.project-tab-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f4f4f3;
  color: #6b6b6e;
  font-size: 11px;
  font-weight: 650;
}
.project-tab-active .project-tab-badge { background: #fdf3d8; color: #7a5b00; }
.project-hero { flex-wrap: wrap; }
.project-hero .project-stats { margin-inline-start: auto; margin-block-start: 0; align-self: center; }
.project-stats-end { margin-block-start: 18px; }
.project-action-row { margin-block: 0 14px; }
.project-action-full { width: 100%; justify-content: center; }
.project-tab-action {
  margin-inline-start: auto;
  padding: 8px 18px;
  border-radius: 999px;
  background: #2d2c30;
  color: #fff;
  font-weight: 700;
}
.project-tab-action:hover { background: #45444a; color: #fff; }
.project-stat-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.project-stat-icon .icon {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  margin: 0;
}
.panel-icon, .file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.panel-icon .icon, .file-icon .icon {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  margin: 0;
}

/* Study report tabs: match the project tab bar */
.section-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
  margin-block: 4px 18px;
  padding: 0 0 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ececeb;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.section-navigation a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 10px 2px;
  color: #6b6b6e;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color .16s ease;
}
.section-navigation a:hover { color: #2d2c30; }
.section-navigation a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -11px;
  block-size: 3px;
  border-radius: 99px;
  background: transparent;
  transition: background .16s ease;
}
.section-navigation a:hover::after { background: #f7b918; }
.section-navigation a:first-child::after { background: #f7b918; }
.section-navigation a:first-child { color: #2d2c30; }
.nav-link.nav-link-locked { color: #b5b4b7; cursor: default; }
.nav-link.nav-link-locked:hover { background: transparent; color: #b5b4b7; }
form[data-analysis-form] .button-primary { width: 100%; justify-content: center; }

/* ---------- Study report display tables ---------- */
.study-report-display th { vertical-align: middle; text-align: start; }
.study-report-display tbody td { vertical-align: middle; }
.study-report-display tbody tr.dimension-group-start > td {
  border-block-start: 3px solid #aebfd4;
}
.study-report-display tbody tr.dimension-group-start:first-child > td {
  border-block-start-width: 1px;
}
.study-report-display .summary-row { background: #fafafa; }
.study-report-display .summary-cell { font-weight: 700; }
.study-report-display .group-row :is(td, th) { background: #e9f1ec; font-weight: 700; border-top: 2px solid #9db4d8; }
.study-report-display .group-row:first-child :is(td, th) { border-top: 0; }
.study-report-display .highlight-high { background: #fdf3d8; }
.study-report-display .highlight-low { background: #e7f3ea; }
.study-report-display tfoot td { font-weight: 700; background: #fafafa; }
.study-report-display caption { font-weight: 700; padding-block: 6px 2px; }

/* ---------- Report pages: flat elearn cards ---------- */
/* Report cards lose the green accent bar and green gradient: white, soft
   shadow, rounded corners, like the course cards. */
.project-sections > .panel {
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 30px -26px rgba(45, 44, 48, .5);
}
.project-sections > .panel::before,
.project-sections > .panel::after { content: none; }
.project-sections > .panel .panel-icon {
  border: 0;
  background: #f7b918;
  color: #2d2c30;
  box-shadow: none;
}

/* Tables inside report cards: gray header band, light separators, tabular numbers. */
.project-sections > .panel .data-table th {
  background: #f4f4f3;
  color: #6b6b6e;
  font-weight: 650;
}
.project-sections > .panel .data-table thead th:first-child { border-start-start-radius: 10px; }
.project-sections > .panel .data-table thead th:last-child { border-start-end-radius: 10px; }
.project-sections > .panel .data-table th,
.project-sections > .panel .data-table td { padding: 11px 14px; }
.project-sections > .panel .data-table tbody tr:hover td { background: #fafafa; }
.project-sections > .panel .data-table td { font-variant-numeric: tabular-nums; }

/* Correlation matrix: fixed column widths keep the grid predictable on wide
   screens; long score labels are abbreviated in the view with the full text in
   the header's title/aria-label. */
.study-report-display.fixed-columns { table-layout: fixed; width: max-content; }
.study-report-display.fixed-columns :is(th, td) {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  overflow-wrap: anywhere;
}
.study-report-display.fixed-columns :is(th, td):first-child {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
}
.study-report-display.fixed-columns th { white-space: normal; }
.study-report-display.fixed-columns .group-row td { width: auto; min-width: 100%; max-width: none; }

/* Diagrams and charts become quiet gray sub-cards inside the white card. */
.study-report-path-figure,
.study-report-chart {
  border: 0;
  border-radius: 14px;
  background: #f4f4f3;
}
.study-report-path-figure {
  margin: 18px 0 0;
  padding: 18px;
  border: 0;
  border-radius: 14px;
  background: #f4f4f3;
}
.study-report-path-figure svg { display: block; width: 100%; height: auto; }
.study-report-path-figure figcaption { display: grid; gap: 4px; margin-block-start: 10px; font-weight: 650; }

/* ---------- Generous vertical spacing between every page section ---------- */
/* Applied last so it wins over the older, tighter per-page overrides. */
.page-title { margin-block-end: 34px; }
.project-sections { row-gap: 36px; }
.panel + .panel:not(.project-sections > .panel),
section + section:not(.project-sections > section) { margin-block-start: 30px; }
.study-report-section .analysis-guide { margin-block-start: 12px; }
.study-report-section .table-scroll { margin-block-start: 28px; }
.study-report-section .study-report-path-figure,
.study-report-section .study-report-chart { margin-block-start: 28px; }

/* Every active sidebar link — whatever its markup — is highlighted in black. */
.sidebar :is(a, button).nav-link.active,
.sidebar :is(a, button).nav-link[aria-current="page"] {
  color: #fff;
  background: #2d2c30;
  box-shadow: none;
  font-weight: 700;
}
.sidebar :is(a, button).nav-link.active .icon,
.sidebar :is(a, button).nav-link[aria-current="page"] .icon { color: #f7b918; }

/* Breathing room between the sidebar rail and page content at mid widths. */
@media (min-width: 681px) and (max-width: 1140px) {
  .main-content, .topbar { padding-inline: 30px; }
}

/* Research diagram: controls live in a compact three-dot menu at the top end. */
.research-diagram > .research-diagram-heading { align-items: flex-start; gap: 16px; }
.research-diagram-heading-copy { min-width: 0; }
.research-diagram-heading-copy h3 { margin: 0; }
.research-diagram-menu { position: relative; flex: none; margin-inline-start: auto; }
.research-diagram-menu-trigger {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e3e3e1;
  border-radius: 9px;
  background: #fff;
  color: #2d2c30;
  cursor: pointer;
  list-style: none;
}
.research-diagram-menu-trigger::-webkit-details-marker { display: none; }
.research-diagram-menu-trigger:hover,
.research-diagram-menu[open] .research-diagram-menu-trigger { background: #f4f4f3; }
.research-diagram-menu-trigger .icon { margin: 0; }
.research-diagram-menu-panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 20;
  display: grid;
  gap: 12px;
  min-width: 280px;
  padding: 14px;
  border: 1px solid #e3e3e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgba(45, 44, 48, .45);
}
.research-diagram-menu-heading {
  margin: 0;
  color: #6b6b6e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.research-diagram-menu-panel .field { gap: 3px; min-width: 0; }
.research-diagram-menu-panel .field label { color: #6b6b6e; font-size: 11px; font-weight: 700; }
.research-diagram-menu-panel select { min-height: 36px; }
.research-diagram-menu-panel .research-diagram-toggle {
  padding: 7px 10px;
  border: 1px solid #e6e6e4;
  border-radius: 9px;
  background: #fafafa;
}
.research-diagram-menu-panel .diagram-export {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-block-start: 12px;
  border-block-start: 1px solid #ececeb;
}
.research-diagram-menu-panel .diagram-export-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2d2c30;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.research-diagram-menu-panel .diagram-export-link:hover { color: #2d2c30; }
.research-diagram-menu-panel .diagram-export-link:disabled { opacity: .55; cursor: wait; }
.research-diagram-menu-panel .diagram-export-status {
  font-size: 11px;
  color: #2d2c30;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .18s ease, transform .18s ease;
}
.research-diagram-menu-panel .diagram-export-status.is-visible { opacity: 1; transform: none; }
.research-diagram-menu-panel .diagram-export-status--error { color: #a12a2a; }
.research-diagram-menu-panel .diagram-approve {
  padding-block-start: 12px;
  border-block-start: 1px solid #ececeb;
}

/* Subscription approval workflow */
.status-pending {
  background: #fff8e6;
  border-inline-start: 3px solid #d99a13;
  color: #6d4a05;
}
.status-rejected {
  background: #fdeeee;
  border-inline-start: 3px solid #b43a3a;
  color: #8a2222;
}
.approval-panel { margin-block-end: 18px; }
.approval-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-block-start: 14px;
}
.approval-actions .form-stack { gap: 8px; }
.approval-actions .button { width: 100%; }
.data-table .text-link { margin-inline-end: 8px; white-space: nowrap; }

/* Back arrow alongside the breadcrumbs, available on every page. */
.breadcrumb-back {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 28px;
  block-size: 28px;
  border: 1px solid #e3e3e1;
  border-radius: 8px;
  background: #fff;
  color: #2d2c30;
  text-decoration: none;
}
.breadcrumb-back:hover { background: #f4f4f3; border-color: #dcdcdb; }
.breadcrumb-back .icon { font-size: 12px; color: #2d2c30; transform: scaleX(-1); }
[dir="rtl"] .breadcrumb-back .icon { transform: none; }

/* Responsive containment: wide diagrams and action rows scroll instead of
   pushing the whole page sideways on phones and tablets. */
@media (max-width: 1100px) {
  .research-diagram-viewport { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .research-diagram-canvas { width: max-content; }
  .dataset-tile .dataset-tile-actions { flex: 1 1 100%; }
  .dataset-tile .dataset-tile-actions .button { flex: 1 1 auto; }
}
.panel-heading .form-actions { min-width: 0; max-width: 100%; }
.form-actions > * { min-width: 0; }
.run-approval-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }

/* Project stats are hidden on phones; header actions stay compact everywhere. */
@media (max-width: 680px) {
  .project-stats { display: none; }
}

/* ---------- Collapsible sidebar sections and quieter link typography ---------- */
.nav-section { min-width: 0; }

.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
}
.nav-section-toggle:hover { background: #f4f4f3; }
.nav-section-toggle .nav-heading {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-block: 12px 2px;
  padding-inline: 0;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.nav-section-toggle > .icon {
  flex: none;
  margin-inline-start: auto;
  color: #6b6b6e;
  transform: rotate(90deg);
  transition: transform .18s ease;
}
[dir="rtl"] .nav-section-collapsed .nav-section-toggle > .icon { transform: scaleX(-1); }
.nav-section-collapsed .nav-section-toggle > .icon { transform: none; }

.nav-section-links { display: grid; min-width: 0; gap: 2px; }
.nav-section-links[hidden] { display: none; }

.sidebar .nav-link {
  font-size: 12px;
  font-weight: 400;
  min-height: 34px;
  padding-block: 7px;
}
.sidebar .nav-link > span:not(.icon) { font-size: 12px; }
.sidebar :is(a, button, span).nav-link.active,
.sidebar :is(a, button, span).nav-link[aria-current="page"] { font-weight: 400; }

/* The three-dot panel must escape the hero's clipping and stacking context. */
.project-hero { overflow: visible; isolation: auto; }

/* The icon-only rail has no headings to toggle and shows every link. */
html.nav-collapsed .nav-section-toggle { display: none; }
html.nav-collapsed .nav-section-links,
html.nav-collapsed .nav-section-links[hidden] { display: grid !important; }
html.nav-collapsed .sidebar .nav-link { padding-inline: 9px; }

/* ---------- Account dropdown in the top bar ---------- */
.profile-menu { position: relative; display: inline-flex; gap: 8px; }
.profile-summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.profile-summary::-webkit-details-marker { display: none; }
.profile-summary > .icon { flex: none; font-size: 8px; color: #6b6b6e; transition: transform .18s ease; }
.profile-menu[open] .profile-summary > .icon { transform: rotate(90deg); }
.profile-menu-panel {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 60;
  display: grid;
  min-width: 230px;
  gap: 4px;
  padding: 8px;
  border: 1px solid #e3e3e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgba(45, 44, 48, .5);
}
.profile-menu:not([open]) > .profile-menu-panel { display: none; }
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2d2c30;
  font-size: 12px;
  font-weight: 400;
  text-align: start;
  text-decoration: none;
}
.profile-menu-item:hover { background: #f4f4f3; color: #2d2c30; }
.profile-menu-item .icon { flex: none; width: 14px; height: 14px; color: #6b6b6e; }
.profile-menu-panel form { margin: 0; }

/* Project action menu entries read as plain links, not dark buttons. */
.project-actions-menu-panel .project-hero-action {
  inline-size: 100%;
  justify-content: flex-start;
  margin: 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #2d2c30;
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
  backdrop-filter: none;
}
.project-actions-menu-panel .project-hero-action:hover {
  background: #f4f4f3;
  border-color: transparent;
  color: #2d2c30;
  transform: none;
  box-shadow: none;
}

/* ---------- Admin subscription portfolio ---------- */
.plan-chip {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 7px;
  background: #edf2ee;
  color: #30483b;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sub-status-pending { background: #fff3d4; color: #7a5605; }
.sub-status-active { background: #e2f5e9; color: #216241; }
.sub-status-expired { background: #eef0ee; color: #5f6a62; }
.sub-status-rejected,
.sub-review-rejected { background: #fdeaea; color: #8a2f2f; }
.sub-review-pending { background: #fff3d4; color: #7a5605; }
.sub-review-approved { background: #e2f5e9; color: #216241; }

/* ---------- Admin subscription details ---------- */
.main-content > .admin-approval-panel,
.main-content > .admin-subscription-details-panel {
  max-width: none;
  padding: 22px;
  border-color: #d7e4d9;
  background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%);
  box-shadow: 0 18px 45px -34px rgba(13, 60, 48, .55);
}
.admin-details-heading {
  flex-wrap: wrap;
  align-items: center;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--border);
}
.detail-heading-badges { display: flex; flex-wrap: wrap; gap: 7px; }

.subscription-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.detail-card {
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid #e2eae3;
  border-radius: 14px;
  background: #fff;
}
.detail-card h3 {
  margin: 0 0 12px;
  padding-block-end: 9px;
  border-block-end: 1px solid #edf1ed;
  color: #294c3a;
  font-size: 13px;
  font-weight: 750;
}
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0;
}
.detail-list > div {
  min-width: 0;
  padding-block: 8px;
  border-block-end: 1px dashed #edf0ec;
}
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
  overflow-wrap: anywhere;
}
.detail-list dd .text-link { font-size: 13px; }
.detail-list dd small { display: block; margin-block-start: 2px; }
.detail-card .analysis-guide { margin-block: 10px 0; font-size: 11px; }
.detail-note {
  margin-block-start: 11px;
  padding: 9px 11px;
  border-inline-start: 3px solid #bcd8c7;
  border-radius: 8px;
  background: #f6faf7;
  color: #3b4b42;
  font-size: 12px;
  line-height: 1.7;
}
.detail-note.status-rejected { border-inline-start-color: #d58b8b; background: #fff5f5; }
.admin-subscription-details-panel > .form-actions {
  margin-block-start: 16px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--border);
}

@media (max-width: 900px) {
  .subscription-detail-grid { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
}

/* ---------- Admin Ruby error page ---------- */
.main-content > .admin-error-panel {
  max-width: none;
  padding: 22px;
  border-color: #d7e4d9;
  background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%);
  box-shadow: 0 18px 45px -34px rgba(13, 60, 48, .55);
}
.admin-error-heading { flex-wrap: wrap; align-items: center; padding-block-end: 16px; border-block-end: 1px solid var(--border); }
.errors-table { min-width: 900px; font-size: 12px; }
.errors-table thead th { background: #f7f7f6; border-block-end: 1px solid #e8e8e6; color: #6b6b6e; }
.errors-table td { vertical-align: top; }
.error-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fdeaea;
  color: #8a2f2f;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.errors-table code {
  display: grid;
  gap: 2px;
  color: #52645a;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .errors-table { min-width: 0; }
  .errors-table thead { display: none; }
  .errors-table, .errors-table tbody, .errors-table tr, .errors-table td { display: block; width: 100%; }
  .errors-table tr { margin-block-end: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
  .errors-table td { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 10px; padding: 7px 0; border-block-end: 1px dashed #edf0ec; }
  .errors-table td:last-child { border-block-end: 0; }
  .errors-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 650; }
}

/* ---------- Installable web app (PWA) ---------- */
[data-install-app] { color: var(--deep-green); }
[data-install-app] .icon { color: var(--deep-green); }
.install-modal .modal-panel { width: min(460px, 100%); }
.install-steps { display: grid; gap: 10px; margin-block: 14px 6px; }
.install-steps p {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--deep-green);
  border-radius: 11px;
  background: #f7faf7;
  font-size: 13px;
  line-height: 1.65;
}
.install-steps strong { color: var(--deep-green); }

/* ---------- Startup splash (yellow mark on ink) ---------- */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #2d2c30;
  opacity: 1;
  visibility: visible;
  transition: opacity .38s ease, visibility .38s ease;
}
.app-splash[hidden] { display: none !important; }
.app-splash.is-ready { opacity: 0; visibility: hidden; pointer-events: none; }
.app-splash-inner {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
}
.app-splash-mark { display: flex; align-items: end; gap: 6px; height: 50px; }
.app-splash-mark i {
  width: 10px;
  height: 0;
  border-radius: 5px;
  background: #f7b918;
  animation: splash-bar .55s cubic-bezier(.2, .8, .2, 1) forwards;
}
.app-splash-mark i:nth-child(1) { --bar-target: 22px; animation-delay: .04s; }
.app-splash-mark i:nth-child(2) { --bar-target: 34px; animation-delay: .13s; }
.app-splash-mark i:nth-child(3) { --bar-target: 50px; animation-delay: .22s; }
@keyframes splash-bar { to { height: var(--bar-target); } }
.app-splash-name {
  color: #fff;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.05em;
  opacity: 0;
  transform: translateY(6px);
  animation: splash-name .42s ease .36s forwards;
}
.app-splash-period { color: #f7b918; }
@keyframes splash-name { to { opacity: 1; transform: none; } }

/* ---------- Charts move in on load ---------- */
.chart-bars .bar, .hero-bars i {
  transform-origin: bottom;
  animation: chart-bar-in .68s cubic-bezier(.2, .85, .25, 1) both;
  animation-delay: calc(var(--bar-index, 0) * 65ms);
}
@keyframes chart-bar-in {
  from { transform: scaleY(0); opacity: .35; }
  to { transform: scaleY(1); opacity: 1; }
}
.hero-bars i:nth-child(1) { --bar-index: 0; }
.hero-bars i:nth-child(2) { --bar-index: 1; }
.hero-bars i:nth-child(3) { --bar-index: 2; }
.hero-bars i:nth-child(4) { --bar-index: 3; }
.hero-bars i:nth-child(5) { --bar-index: 4; }
.hero-bars i:nth-child(6) { --bar-index: 5; }
.hero-bars i:nth-child(7) { --bar-index: 6; }
.donut { animation: chart-donut-in .75s cubic-bezier(.2, .85, .25, 1) both; }
@keyframes chart-donut-in {
  from { transform: scale(.82) rotate(-18deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .app-splash-mark i, .app-splash-name,
  .chart-bars .bar, .hero-bars i, .donut { animation: none !important; }
  .app-splash-mark i { height: var(--bar-target); }
  .app-splash-name { opacity: 1; transform: none; }
  .chart-bars .bar, .hero-bars i { transform: none !important; opacity: 1 !important; }
}

/* Installed PWA on iOS/iPadOS (viewport-fit=cover) paints into the status-bar
   and home-indicator bands. Reserve them with an opaque surface so no blurred
   content can show behind the time/battery icons or the bottom gesture bar. */
.app-shell {
  padding-block-start: env(safe-area-inset-top, 0px);
  padding-block-end: env(safe-area-inset-bottom, 0px);
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  block-size: env(safe-area-inset-top, 0px);
  background: var(--surface);
  pointer-events: none;
  z-index: 100;
}
.app-shell > .sidebar { inset-block-start: env(safe-area-inset-top, 0px); }
@media (min-width: 801px) {
  .app-shell > .sidebar { height: calc(100dvh - env(safe-area-inset-top, 0px)); }
}

/* iPadOS can blur a band deeper than the reported status-bar inset.
   Clip the workspace scrollport below that band, including while scrolling. */
@media screen and (display-mode: standalone) and (min-width: 801px) {
  @supports (-webkit-touch-callout: none) {
    .app-shell {
      --status-bar-clearance: max(72px, env(safe-area-inset-top, 0px));
      position: fixed;
      inset: var(--status-bar-clearance) 0 0;
      min-height: 0;
      padding-block-start: 0;
      overflow: auto;
      overscroll-behavior: contain;
      scroll-padding-top: 24px;
    }
    .app-shell > .sidebar {
      inset-block-start: 0;
      height: calc(100dvh - var(--status-bar-clearance) - env(safe-area-inset-bottom, 0px));
    }
  }
}

/* Keep the top edge opaque throughout the compact navigation layout. */
@media (max-width: 800px) {
  html { background-color: #fff; }
  .sidebar,
  .topbar {
    background: #fff;
    box-shadow: none;
    opacity: 1;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- Subscription page: plan hero, cards and usage meters ---------- */
.subscription-page { display: grid; gap: 20px; }
.subscription-timeline progress {
  display: block;
  inline-size: 100%;
  block-size: 12px;
  accent-color: var(--workspace-accent);
}
.subscription-timeline dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
}
.subscription-timeline dt { color: var(--workspace-muted); font-size: .875rem; }
.subscription-timeline dd { margin: 2px 0 0; font-weight: 700; }
.subscription-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border: 1px solid #ececeb;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff 0%, #fff 58%, #fff8e4 100%);
  box-shadow: 0 12px 30px rgba(45, 44, 48, .045);
}
.subscription-hero-copy { max-inline-size: 62ch; }
.subscription-eyebrow {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: #fdf3d7;
  color: #7a5b00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.subscription-hero h1 {
  margin: 14px 0 7px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: -.05em;
  font-weight: 760;
}
.subscription-hero p { margin: 0; color: var(--muted); line-height: 1.6; }
.subscription-hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.subscription-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 13px;
  background: #2d2c30;
  color: #fff;
  font-size: 18px;
  font-weight: 760;
  box-shadow: 0 8px 20px rgba(45, 44, 48, .18);
}
.subscription-plan-chip::before {
  content: "";
  inline-size: 9px;
  block-size: 9px;
  border-radius: 50%;
  background: #f7b918;
}
.subscription-state-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}
.subscription-state-chip.is-active { background: #fdf3d7; color: #7a5b00; }
.subscription-state-chip.is-limited { background: #fde68a; color: #5b4400; }

.subscription-proof {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid #ececeb;
  border-radius: 15px;
  background: #fff;
}
.subscription-proof-icon {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 38px;
  block-size: 38px;
  border-radius: 11px;
  background: #fdf3d7;
  font-size: 19px;
}
.subscription-proof > div { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.subscription-proof-title { font-weight: 720; }
.subscription-proof .text-link { margin-inline-start: auto; white-space: nowrap; }
.subscription-resubmit {
  margin-block-start: 4px;
  padding: 16px;
  border: 1px solid #ececeb;
  border-radius: 15px;
  background: #fafafa;
}

.subscription-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.subscription-card {
  min-inline-size: 0;
  padding: 22px;
  border: 1px solid #ececeb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(45, 44, 48, .035);
}
.subscription-card-usage,
.subscription-card-defaults { grid-column: 1 / -1; }
.subscription-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 18px;
}
.subscription-card-head h2 { margin: 0; font-size: 17px; font-weight: 760; letter-spacing: -.025em; }
.subscription-card-mark {
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 9px;
  background: #f7b918;
  color: #2d2c30;
  font-weight: 850;
}
.subscription-card-caption { font-size: 12px; color: var(--muted); }

.subscription-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.subscription-facts > div { padding: 11px 13px; border-radius: 12px; background: #f4f4f3; }
.subscription-facts dt { margin-block-end: 4px; font-size: 12px; color: var(--muted); }
.subscription-facts dd { margin: 0; font-size: 15px; font-weight: 720; overflow-wrap: anywhere; }
.subscription-facts-plain > div { background: #fbfbfa; border: 1px solid #f0f0ef; }
.subscription-card .analysis-guide { margin-block: 14px 0; }

.subscription-meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.subscription-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 9px;
  font-size: 13px;
}
.subscription-meter-head dt { color: #6b6b6e; font-weight: 620; }
.subscription-meter-head dd { margin: 0; font-size: 15px; font-weight: 720; font-variant-numeric: tabular-nums; }
.subscription-meter-track {
  block-size: 8px;
  border-radius: 999px;
  background: #ececeb;
  overflow: hidden;
}
.subscription-meter-track i {
  display: block;
  block-size: 100%;
  inline-size: var(--meter-fill, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #f7b918, #ffd772);
  animation: subscription-meter-in .7s cubic-bezier(.2, .85, .25, 1) both;
  animation-delay: calc(var(--meter-index, 0) * 90ms);
}
@keyframes subscription-meter-in { from { inline-size: 0; } }
.subscription-meter small { display: block; margin-block-start: 7px; font-size: 11px; color: var(--muted); }
.subscription-description {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-inline-start: 3px solid #f7b918;
  border-radius: 0 10px 10px 0;
  background: #fafafa;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .subscription-grid { grid-template-columns: 1fr; }
  .subscription-card-usage,
  .subscription-card-defaults { grid-column: auto; }
  .subscription-meters { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .subscription-hero { gap: 14px; padding: 16px; border-radius: var(--workspace-card-radius); }
  .subscription-hero .subscription-eyebrow { display: none; }
  .subscription-hero h1 { margin-block: 0 6px; font-size: 1.5rem; }
  .subscription-hero-copy p { font-size: .875rem; }
  .subscription-hero-side {
    flex: 1 1 100%;
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
    padding-block-start: 12px;
    border-block-start: 1px solid var(--workspace-line);
  }
  .subscription-hero .subscription-plan-chip {
    padding: 6px 10px;
    border-radius: 9px;
    font-size: .875rem;
    box-shadow: none;
  }
  .subscription-hero-side .button {
    flex: 1 1 100%;
    min-block-size: 44px;
    white-space: normal;
    text-align: center;
  }
  .subscription-card { padding: 17px; }
  .subscription-facts { grid-template-columns: 1fr; }
  .subscription-proof { flex-wrap: wrap; }
  .subscription-proof .text-link { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .subscription-meter-track i { animation: none; }
}

/* In-page tabs shared by analysis result views and study reports. */
.result-tab-strip {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin: 0 0 18px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e4e8e2;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(10, 10, 10, 0.04);
  scrollbar-width: thin;
}
.result-tab-button {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f4f6f2;
  color: #4f5a52;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.result-tab-button:hover { background: #fff5cc; color: #2d2c30; }
.result-tab-button:focus-visible { outline: 2px solid #f7b918; outline-offset: 2px; }
.result-tab-button.active {
  background: #2d2c30;
  border-color: #2d2c30;
  color: #f7b918;
}
.result-tab-panel[hidden] { display: none; }
.result-tab-panel > .panel-heading:first-child { margin-top: 0; }
.inner-panel { margin-bottom: 18px; }
.inner-panel:last-child { margin-bottom: 0; }
.study-report-table-block { margin: 0 0 24px; padding: 0 0 20px; border-bottom: 1px solid #e4e8e2; }
.study-report-table-block:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

/* Effect estimates are split into titled tables so every effect type and
   moderator stays distinguishable on screen and in the exports. */
.effect-group + .effect-group { margin-block-start: 22px; padding-block-start: 20px; border-block-start: 1px solid #e8e8e6; }
.effect-group-title { margin: 0 0 10px; font-size: 15px; font-weight: 730; color: #2d2c30; overflow-wrap: anywhere; }
.effect-group .table-actions { margin-block-end: 8px; }

/* Figures follow the available content width, but stay readable on small
   screens: once the viewport is narrower than --figure-min-width the media
   keeps that width and scrolls inside its own container instead of shrinking
   to a few pixels or pushing the whole page sideways. */
.figure-scroll {
  --figure-min-width: 720px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #cfd7cf transparent;
}
.figure-scroll:focus-visible { outline: 2px solid #f7b918; outline-offset: 2px; }
.study-report-path-figure .figure-scroll > :is(svg, img) {
  display: block;
  max-width: none;
  height: auto;
}
.study-report-path-figure .figure-scroll > svg { width: 100%; min-width: var(--figure-min-width); }
.study-report-path-figure .figure-scroll > img { width: auto; }

/* Report and statistical output tables */
.results-page-title { gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.results-page-title > div:first-child { flex: 1 1 340px; min-width: 0; }
.results-page-title p { overflow-wrap: anywhere; }
.results-page-title .form-actions { margin: 0; flex: 0 1 auto; }
.results-reading-guide { margin-block-end: 18px; padding: 10px 14px; border: 1px solid #e5e9ed; border-radius: 10px; background: #f7f9fb; }
.results-reading-guide summary { cursor: pointer; font-weight: 650; }
.results-table-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-block-end: 12px; }
.results-table-header h2 { flex: 1 1 230px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.results-table-header .table-actions { margin: 0; }
.results-table-header .button, .study-report-section .figure-actions .button { min-height: 36px; padding-block: 7px; font-size: 12px; }
.results-accessible-caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.study-report-section .table-scroll,
.table-scroll:has(> .analysis-table),
:is(#variable-summary, #correlations) .table-scroll {
  position: relative;
  margin-block-start: 0;
  border: 1px solid #e8e8e6;
  border-radius: 10px;
  scrollbar-color: #bdbdbb #f4f4f3;
}
.study-report-section .table-scroll:focus-visible,
.table-scroll:has(> .analysis-table):focus-visible { outline-offset: 3px; }
:is(.study-report-section .data-table, .analysis-table, #variable-summary .data-table, #correlations .data-table) {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.55;
  --result-header: #f4f4f3;
  --result-alternate: #fbfbfb;
}
:is(.study-report-section .data-table, .analysis-table, #variable-summary .data-table, #correlations .data-table) thead th {
  color: #2d2c30;
  background: var(--result-header);
  white-space: normal;
  text-wrap: pretty;
  min-inline-size: 74px;
  font-size: 12px;
  border-radius: 0;
  border-block-end: 1px solid #e8e8e6;
}
.project-sections :is(.study-report-section .data-table, .analysis-table, #variable-summary .data-table, #correlations .data-table) :is(th, td) {
  padding: 9px 12px;
  border-block-end-color: #e8edf2;
}
:is(.study-report-section .data-table, .analysis-table, #variable-summary .data-table, #correlations .data-table) tbody tr:nth-child(even):not(.group-row, .summary-row) > :is(th, td):not(.highlight-high, .highlight-low) { background-color: var(--result-alternate); }
:is(.study-report-section .data-table, .analysis-table, #variable-summary .data-table, #correlations .data-table) tbody tr:hover:not(.group-row, .summary-row) > :is(th, td):not(.highlight-high, .highlight-low) { background-color: #fff8e1; }
.study-report-display .group-row .group-cell { background: #f4f4f3; border-block-start: 1px solid #e8e8e6; color: #2d2c30; }
.study-report-display .results-row-label { position: sticky; inset-inline-start: 0; z-index: 1; background: white; border-inline-end: 1px solid #e8e8e6; min-inline-size: 150px; }
.study-report-display thead .results-row-label { z-index: 2; }
.study-report-display.fixed-columns .results-row-label { width: 160px; min-width: 160px; max-width: 160px; }
.results-number, .results-matrix-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.study-report-section td.results-number { text-align: start; }
.results-matrix-value { display: grid; justify-items: start; gap: 2px; }
.results-matrix-value small { color: #6b6b6e; font-size: 11px; }
.result-tab-strip { max-inline-size: 100%; }
@media (max-width: 670px) {
  .results-page-title > div:first-child { flex-basis: 100%; }
  .results-table-header { align-items: flex-start; }
  .study-report-display .results-row-label { min-inline-size: 120px; }
  .study-report-display.fixed-columns .results-row-label { width: 124px; min-width: 124px; max-width: 124px; }
}

.table-download { position: relative; }
.table-download > summary { list-style: none; gap: 6px; cursor: pointer; }
.table-download > summary::-webkit-details-marker { display: none; }
.table-download-options {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  inset-inline-end: 0;
  z-index: 3;
  display: grid;
  gap: 4px;
  padding: 5px;
  inline-size: max-content;
  border: 1px solid var(--line, #dce2e8);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgb(20 34 52 / 12%);
}

.analysis-engine-picker,
.analysis-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  margin-block-end: 16px;
}

.analysis-engine-option,
.analysis-context-item {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 13px 16px;
  border: 1px solid var(--line, #dedfe3);
  border-radius: 12px;
  min-inline-size: 0;
}

.analysis-engine-option { color: inherit; text-decoration: none; }
.analysis-engine-option:hover,
.analysis-engine-option[aria-current="page"] { background: #f4f4f3; border-color: #bdbdbb; }
.analysis-engine-option:focus-visible,
.analysis-options summary:focus-visible { outline: 2px solid #2d2c30; outline-offset: 3px; }
.analysis-engine-option span,
.analysis-context-item > span,
.analysis-context-item small { color: #535c56; font-size: .875rem; }
.analysis-context-item { background: #f8f9fa; overflow-wrap: anywhere; }
.analysis-context-item strong .icon { margin-inline: 4px; }

.analysis-options {
  border: 1px solid var(--line, #dedfe3);
  border-radius: 12px;
  padding: 12px;
}
.analysis-options summary { cursor: pointer; font-weight: 650; }
.analysis-options[open] summary { margin-block-end: 12px; }
.analysis-selection-count { color: #46534b; font-size: .875rem; margin-block: 0 8px; }
.analysis-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-block-start: 1px solid var(--line, #dedfe3);
  padding-block-start: 12px;
}
.analysis-submit p { margin: 0; }
.analysis-history .analysis-history-entry { flex-wrap: wrap; gap: 10px; }
.analysis-plan-progress { inline-size: min(100%, 340px); accent-color: #2d2c30; }
.analysis-plan-methods [data-analysis-state="ready"],
.analysis-plan-methods [data-analysis-state="completed"] { background: #fff3c4; color: #2d2c30; }
.analysis-plan-methods [data-analysis-state="blocked"],
.analysis-plan-methods [data-analysis-state="failed"] { background: #f8e9e7; color: #8f3028; }

.analysis-preflight {
  margin-block-end: 16px;
  padding: 16px;
  border: 1px solid #8aa995;
  border-radius: 12px;
  background: #f4f4f3;
}
.analysis-preflight[data-analysis-review="warning"] { border-color: #c4a363; background: #fff8e8; }
.analysis-preflight[data-analysis-review="blocked"] { border-color: #c28b87; background: #fff3f2; }
.analysis-preflight ul { margin-block: 8px 14px; padding-inline-start: 22px; }
.analysis-preflight .form-actions { justify-content: flex-start; }

.workspace-global-links { margin-block-end: 10px; }
.workflow-sidebar-stage { margin-block-start: 16px; }
.workflow-sidebar-stage + .workflow-sidebar-stage { padding-block-start: 14px; border-block-start: 1px solid #edf0ed; }
.workflow-sidebar-stage .nav-section-toggle { padding-block: 8px; }
.workflow-sidebar-stage .nav-section-toggle .nav-heading {
  margin: 0;
  padding-block: 0;
  line-height: 1.4;
  text-transform: none;
}
.workflow-sidebar-stage[data-workflow-current="true"] > .nav-section-toggle {
  background: #f4f4f3;
  color: #2d2c30;
}

.workflow-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: #edf0ed;
  color: #46534b;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.breadcrumbs { min-inline-size: 0; row-gap: 5px; color: #626866; }
.breadcrumbs .breadcrumb-location { color: inherit; font-weight: 550; }
.breadcrumbs .breadcrumb-location:hover { text-decoration: underline; }
.breadcrumb-project {
  min-inline-size: 0;
  max-inline-size: min(28vw, 28ch);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-sidebar-stage[data-workflow-current="true"] .workflow-number { background: #2d2c30; color: #fff; }

.workflow-engine-card,
.workflow-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-block: 14px;
}
.workflow-engine-card + .workflow-engine-card { border-block-start: 1px solid #e4e9e5; }
.workflow-engine-card h3,
.workflow-engine-card p,
.workflow-next-action p { margin: 0; }
.workflow-engine-card .analysis-engine-picker { grid-column: 1 / -1; margin-block-end: 0; }
.workflow-manual-engines { grid-column: 1 / -1; min-width: 0; }
.workflow-manual-engines summary, .workspace-disclosure > summary, .hypothesis-more-actions > summary {
  cursor: pointer; color: #2d2c30; font-weight: 700; line-height: 1.5;
}
.workflow-manual-engines summary { padding: 9px 12px; border: 1px solid #e8e8e6; border-radius: 9px; background: #f7f7f6; }
.workflow-manual-engines[open] summary { margin-block-end: 12px; }
.workspace-disclosure { margin-block-start: 20px; padding-block-start: 16px; border-block-start: 1px solid #e5ebe6; }
.workspace-disclosure > summary { font-size: 1rem; }
.workspace-disclosure[open] > summary { margin-block-end: 14px; }
.hypothesis-more-actions { margin-block-start: 10px; }
.hypothesis-more-actions[open] > summary { margin-block-end: 8px; }
.automatic-analysis-entry { border: 1px solid #e8e8e6; background: #f4f4f3; }
.automatic-analysis-entry p { max-width: 65ch; line-height: 1.6; }
.project-sections > .panel { min-width: 0; }
.page-title p, .panel-heading p { overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .sidebar-panels .sidebar .nav-link, .sidebar-panels .nav-link { min-height: 44px; }
  .sidebar-panels .nav-section-toggle { min-height: 44px; }
  .breadcrumbs .breadcrumb-project { max-inline-size: 34vw; }
}

.diagram-edit-toolbar, .diagram-edit-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.diagram-edit-toolbar { margin-block: 4px 10px; }
.diagram-edit-actions[hidden] { display: none; }
.research-diagram-node { cursor: default; touch-action: auto; }
.diagram-layout-editing .research-diagram-node { cursor: grab; touch-action: none; }
.diagram-layout-editing .research-diagram-node:active { cursor: grabbing; }
.diagram-edge.is-selected { stroke: #256854; stroke-width: 2.8; }
.diagram-mid-dot.dot-on[data-axis="x"] { cursor: ew-resize; }
.diagram-mid-dot.dot-on[data-axis="y"] { cursor: ns-resize; }
.diagram-layout-editing .research-diagram-canvas { user-select: none; }

/* Workbook review and bulk column mapping */
.dataset-review-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; margin-block-end: 18px; border: 1px solid #e8e8e6; border-radius: 14px; background: #f4f4f3; }
.dataset-review-intro p, .dataset-mapping-actions p { margin: 5px 0 0; color: #59675e; line-height: 1.6; }
.dataset-mapping-toolbar, .dataset-bulk-map { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-block: 16px; }
.dataset-mapping-toolbar label, .dataset-bulk-map > label:not(.dataset-select-all) { display: grid; gap: 6px; font-size: .85rem; font-weight: 650; }
.dataset-search { flex: 1 1 230px; }
.dataset-filter, .dataset-bulk-map > label:not(.dataset-select-all) { flex: 1 1 190px; }
.dataset-mapping-toolbar input, .dataset-mapping-toolbar select, .dataset-bulk-map select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #e8e8e6; border-radius: 8px; background: #fff; font: inherit; }
.dataset-mapping-count { margin: 0; padding: 10px 12px; border-radius: 9px; background: #f4f4f3; color: #2d2c30; font-weight: 700; }
.dataset-bulk-map { padding: 14px; border: 1px solid #e8e8e6; border-radius: 12px; background: #f7f7f6; }
.dataset-select-all { display: flex; align-items: center; gap: 8px; min-height: 42px; font-weight: 650; }
.dataset-bulk-hint { flex-basis: 100%; color: #6b6b6e; font-size: .82rem; }
.dataset-mapping input[type="checkbox"] { inline-size: 18px; block-size: 18px; accent-color: #2d2c30; }
.dataset-column-number { display: inline-grid; place-items: center; min-width: 27px; height: 27px; margin-inline-end: 5px; border-radius: 7px; background: #f4f4f3; color: #6b6b6e; font-size: .75rem; }
.dataset-ranges summary { cursor: pointer; color: #2d2c30; font-weight: 700; }
.dataset-mapping-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-block-start: 18px; padding-block-start: 16px; border-block-start: 1px solid #e4e9e5; }
@media (max-width: 680px) {
  .dataset-review-intro { align-items: stretch; flex-direction: column; }
  .dataset-mapping-actions .button { width: 100%; justify-content: center; }
  .dataset-bulk-map > .button { width: 100%; justify-content: center; }
}

/* Keep the current task visible above the fold on small screens. */
@media (max-width: 680px) {
  .topbar { gap: 8px; min-height: 50px; }
  .breadcrumbs { flex: 1 1 auto; flex-wrap: nowrap; overflow: hidden; }
  .breadcrumbs > .breadcrumb-location, .breadcrumbs > .icon { display: none; }
  .breadcrumbs > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .profile-summary .profile-name { display: none; }
  .page-title { margin-block-end: 20px; }
  .page-title h1 { font-size: clamp(22px, 6vw, 27px); line-height: 1.35; }
  .project-hero { gap: 10px; margin-block-end: 18px; }
  .project-hero h1 { font-size: 21px; }
  .project-hero p { font-size: 12px; line-height: 1.5; }
  .project-hero-actions { margin-block-start: 0; }
  .project-sections { row-gap: 20px; }
  .study-report-section .table-scroll { margin-block-start: 16px; }
  .form-panel { padding: 16px; }
}

.automatic-analysis-entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.automatic-analysis-entry h2, .automatic-analysis-entry p { margin-block: 0 4px; }
.automatic-analysis-progress progress { inline-size: min(100%, 600px); block-size: 16px; accent-color: #2d2c30; }
.automatic-analysis-settings summary { cursor: pointer; font-weight: 700; }

/* ---------- unified result/navigation system ---------- */
.result-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block-end: 10px; }
.result-method { background: #fff3c4; color: #6b4d00; }
.result-page-header h1 { overflow-wrap: anywhere; }

.project-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 18px;
  padding-block-end: 4px;
}
.project-section-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #e8e8e6;
  border-radius: 999px;
  color: #6b6b6e;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.project-section-link:hover { background: #f4f4f3; color: #2d2c30; }
.project-section-link[aria-current="page"] { border-color: #2d2c30; background: #2d2c30; color: #fff; }

.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu .table-download-options { min-inline-size: 210px; }
.export-menu[open] > summary { box-shadow: 0 0 0 3px rgba(247, 185, 24, .35); }

.analysis-progress progress { inline-size: min(100%, 620px); accent-color: #2d2c30; }
.analysis-progress-message { color: #6b6b6e; }

.workspace-disclosure > summary { color: #2d2c30; }
.workspace-disclosure > summary::marker { color: #f7b918; }
.workspace-disclosure > summary:hover { text-decoration: underline; text-decoration-color: #f7b918; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.table-scroll:focus-visible { outline: 2px solid #2d2c30; outline-offset: 3px; }
.table-actions-inline .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }

/* One button size everywhere, including hero and compact table actions. */
.button,
.button-hero,
.results-table-header .button,
.study-report-section .figure-actions .button,
.hero .button {
  min-height: 41px;
  padding: 9px 15px;
  font-size: 13px;
}

@media (max-width: 800px) {
  .results-page-title > div:first-child { flex-basis: 100%; }
  .results-table-header { align-items: flex-start; }
  .project-hero { gap: 10px; }
  .project-hero h1 { font-size: 21px; }
  .project-hero p { font-size: 12px; }
  .form-panel { padding: 16px; }
  .project-section-nav { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 8px; }
  .project-section-link { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .result-tab-button { transition: none; }
}

/* Workspace theme: shared surfaces and controls for research and administration. */
:root {
  --workspace-ink: #29292f;
  --workspace-muted: #616168;
  --workspace-accent: #f7b918;
  --workspace-line: #e7e7eb;
  --workspace-soft: #f5f5f7;
  --workspace-card-radius: 18px;
  --workspace-card-shadow: 0 8px 26px rgba(34, 34, 43, .06);
}

body { color: var(--workspace-ink); }
.sidebar { border-inline-end: 1px solid var(--workspace-line); }
.topbar { border-block-end-color: var(--workspace-line); }
.page-title p, .panel-heading p, .project-hero p { color: var(--workspace-muted); }
.panel:not(.study-report-section), .project-sections > .panel:not(.study-report-section) {
  border: 1px solid var(--workspace-line);
  border-radius: var(--workspace-card-radius);
  box-shadow: var(--workspace-card-shadow);
}
:is(.dataset-tile, .variable-card, .hypothesis-card, .analysis-context, .analysis-engine-option, .dataset-bulk-map, .dataset-review-intro) {
  background: var(--workspace-soft);
  border-color: var(--workspace-line);
}
.automatic-analysis-entry { background: #fffbef; }
.button-primary, .project-actions-menu-trigger { background: var(--workspace-ink); color: white; }
.button-secondary { border-color: var(--workspace-line); }

.analysis-profile-list { display: grid; gap: 16px; }
.analysis-profile-card { min-inline-size: 0; padding: clamp(16px, 3vw, 26px); }
.analysis-profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.analysis-profile-identity {
  display: flex;
  flex: 1 1 16rem;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.analysis-profile-identity .panel-icon {
  inline-size: 44px;
  block-size: 44px;
  background: var(--workspace-accent);
  color: var(--workspace-ink);
}
.analysis-profile-identity h2 { margin: 0; font-size: 1.25rem; }
.analysis-profile-identity p { margin: 4px 0 0; color: var(--workspace-muted); font-size: .875rem; }
.analysis-profile-header .button { max-inline-size: 100%; white-space: normal; }
.analysis-profile-defaults {
  margin-block-start: 20px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--workspace-line);
}
.analysis-profile-defaults h3 { margin: 0 0 10px; font-size: .875rem; }
.analysis-profile-analyses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 8px;
  margin: 0;
}
.analysis-profile-analyses > div {
  padding: 10px 12px;
  border: 1px solid var(--workspace-line);
  border-radius: 10px;
  background: var(--workspace-soft);
  overflow-wrap: anywhere;
}
.analysis-profile-analyses dt { color: var(--workspace-muted); font-size: .8125rem; }
.analysis-profile-analyses dd { margin: 3px 0 0; font-size: .875rem; font-weight: 650; }

.admin-subscription-list { display: grid; gap: 16px; margin-block-start: 16px; }
.admin-subscription-overview, .admin-subscription-card {
  min-inline-size: 0;
  padding: clamp(16px, 3vw, 24px);
}
.admin-subscription-heading, .admin-subscription-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-subscription-overview .panel-icon, .admin-subscription-card .panel-icon {
  inline-size: 42px;
  block-size: 42px;
  background: var(--workspace-accent);
  color: var(--workspace-ink);
}
.admin-subscription-heading h2, .admin-subscription-identity h2 { margin: 0; font-size: 1.125rem; }
.admin-subscription-identity {
  flex: 1 1 16rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.admin-subscription-identity p { margin: 3px 0 0; color: var(--workspace-muted); font-size: .875rem; }
.admin-subscription-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-subscription-actions .button { max-inline-size: 100%; white-space: normal; }
.admin-subscription-summary, .admin-subscription-meta, .admin-subscription-usage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 10px;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}
.admin-subscription-meta {
  padding-block-start: 14px;
  border-block-start: 1px solid var(--workspace-line);
}
.admin-subscription-summary > div, .admin-subscription-usage > div {
  padding: 10px 12px;
  border: 1px solid var(--workspace-line);
  border-radius: 10px;
  background: var(--workspace-soft);
}
.admin-subscription-summary dt, .admin-subscription-meta dt, .admin-subscription-usage dt {
  color: var(--workspace-muted);
  font-size: .8125rem;
}
.admin-subscription-summary dd, .admin-subscription-meta dd, .admin-subscription-usage dd {
  margin: 4px 0 0;
  font-size: .875rem;
}
.admin-subscription-summary dd { font-size: 1.5rem; font-weight: 750; }
.admin-subscription-usage dd span { color: var(--workspace-muted); }
.admin-subscription-meta .plan-chip { background: var(--workspace-soft); color: var(--workspace-ink); }

.analysis-presets {
  display: grid;
  gap: 16px;
  min-inline-size: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--workspace-line);
  border-radius: var(--workspace-card-radius);
  background: var(--workspace-soft);
}
.analysis-presets-header { display: flex; align-items: flex-start; gap: 12px; }
.analysis-presets-header .panel-icon { background: var(--workspace-accent); color: var(--workspace-ink); }
.analysis-presets-header h3 { margin: 0; font-size: 1rem; }
.analysis-presets-header .analysis-guide { margin: 4px 0 0; color: var(--workspace-muted); }
.analysis-preset-rows { display: grid; gap: 10px; container-type: inline-size; }
.analysis-preset-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px 12px;
  padding: 14px;
  border: 1px solid var(--workspace-line);
  border-radius: 12px;
  background: var(--surface);
}
.analysis-preset-row[hidden] { display: none; }
.analysis-preset-row .field { min-inline-size: 0; }
.analysis-preset-remove {
  grid-column: 1 / -1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  min-block-size: 32px;
  padding-inline: 6px;
  color: var(--workspace-muted);
  font-size: .8125rem;
  cursor: pointer;
}
.analysis-preset-remove input { accent-color: var(--workspace-ink); }
@container (max-width: 28rem) {
  .analysis-preset-row { grid-template-columns: minmax(0, 1fr); }
}
@container (min-width: 60rem) {
  .analysis-preset-row { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
  .analysis-preset-remove { grid-column: auto; align-self: center; margin-block-start: 20px; }
}

.sidebar :is(a, button).nav-link[aria-current="page"],
.sidebar :is(a, button).nav-link.active { background: var(--workspace-ink); }
.workflow-sidebar-stage[data-workflow-current="true"] > .nav-section-toggle { background: var(--workspace-soft); color: var(--workspace-ink); }
.workflow-sidebar-stage[data-workflow-current="true"] .workflow-number { background: var(--workspace-ink); color: #fff; }
.result-tab-strip { background: transparent; border: 0; box-shadow: none; }
.result-tab-button { background: transparent; color: var(--workspace-muted); border-radius: 0; }
.result-tab-button.active {
  background: transparent;
  border-color: transparent;
  border-block-end: 3px solid var(--workspace-accent);
  color: var(--workspace-ink);
}
:is(.button, .nav-link, .project-section-link, summary):focus-visible {
  outline: 2px solid #916500;
  outline-offset: 3px;
}
.mobile-primary-nav { display: none; }
@media screen and (max-width: 800px) {
  .app-shell { padding-block-end: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .mobile-primary-nav {
    position: fixed;
    inset-inline: max(12px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    inset-block-end: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 55;
    display: flex;
    gap: 4px;
    max-inline-size: 30rem;
    margin-inline: auto;
    padding: 5px;
    border: 1px solid var(--workspace-line);
    border-radius: var(--workspace-card-radius);
    background: var(--surface);
    box-shadow: 0 6px 24px rgba(34, 34, 43, .14);
  }
  .mobile-primary-nav .nav-link {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-inline-size: 0;
    min-block-size: 48px;
    padding: 5px;
    border-radius: 12px;
    font-size: .75rem;
    line-height: 1.2;
    text-align: center;
  }
  .mobile-primary-nav .nav-link > span:not(.icon) { max-inline-size: 100%; }
  .mobile-profile-menu { flex: 1 1 0; min-inline-size: 0; }
  .mobile-profile-menu summary { list-style: none; cursor: pointer; }
  .mobile-profile-menu summary::-webkit-details-marker { display: none; }
  .mobile-profile-menu[open] summary { background: var(--workspace-soft); color: var(--workspace-ink); }
  .mobile-profile-menu > .profile-menu-panel {
    inset-block: auto calc(100% + 8px);
    min-inline-size: 0;
    inline-size: min(100%, 16rem);
    max-block-size: 50dvh;
    overflow-y: auto;
  }
  .mobile-profile-name {
    margin: 0;
    padding: 8px 10px;
    border-block-end: 1px solid var(--workspace-line);
    font-weight: 700;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 800px) {
  .sidebar { border-inline-end: 0; }
  .results-table-header .table-actions { flex-wrap: wrap; }
}

/* Shared hierarchy for dashboard cards, setup pages and analysis forms. */
.hero, .metric, .workflow-manual-engines summary, .upload-form {
  background: var(--workspace-soft);
  border: 1px solid var(--workspace-line);
  border-radius: var(--workspace-card-radius);
}
.hero .button-hero { background: var(--workspace-ink); color: white; }
:is(.workflow-manual-engines, .workspace-disclosure, .hypothesis-more-actions) > summary {
  color: var(--workspace-ink);
}
:is(.workflow-manual-engines, .workspace-disclosure, .hypothesis-more-actions) > summary::marker {
  color: #916500;
}
.analysis-engine-option[aria-current="page"], .analysis-engine-option:hover {
  background: #fffaeb;
  border-color: #dfaa1d;
}
.project-section-link[aria-current="page"] {
  background: var(--workspace-ink);
  box-shadow: inset 0 -3px var(--workspace-accent);
}
.workflow-next-action > :first-child { min-inline-size: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .workflow-engine-card, .workflow-next-action { grid-template-columns: minmax(0, 1fr); }
  .workflow-engine-card > .button, .workflow-next-action > .button { justify-self: start; }
  .hero-content { min-inline-size: 0; }
}
.dashboard-charts > .panel { margin-block-start: 0; }
@media (max-width: 800px) {
  .project-section-nav { flex-wrap: wrap; overflow: visible; }
  .project-section-link { white-space: normal; }
}

/* Double the breathing room above hypothesis cards (9px gap -> 18px). */
.hypothesis-card { margin-block-start: 18px; }

/* Hero secondary actions stayed white-on-white from the old green theme.
   Keep them visible at rest with the active ink/yellow palette. */
.project-title .button-secondary,
.project-hero .project-hero-actions .button-secondary {
  color: #2d2c30;
  background: #fff;
  border-color: #e3e3e1;
}
.project-title .button-secondary:hover,
.project-hero .project-hero-actions .button-secondary:hover {
  color: #2d2c30;
  background: #f4f4f3;
  border-color: #dcdcdb;
}

/* Roomier vertical rhythm for every workspace block. */
:root { --workspace-block-gap: 20px; }
.project-sections { row-gap: 48px; }
:is(.variable-card, .hypothesis-card, .dataset-tile, .analysis-engine-option,
    .workflow-engine-card, .workspace-disclosure, .dataset-review-intro,
    .dataset-bulk-map, .automatic-analysis-entry, .results-reading-guide) {
  margin-block: var(--workspace-block-gap);
}
.hypothesis-card {
  margin-block: 18px;
  box-shadow: none;
  transition: none;
}
@media (max-width: 680px) {
  :root { --workspace-block-gap: 16px; }
  .project-sections { row-gap: 28px; }
}

#responses .attached-workbook {
  display: grid;
  gap: 14px;
  background: #fffbef;
  border: 1px solid #ead9a5;
  border-inline-start: 4px solid var(--workspace-accent);
}
.attached-workbook-header { display: flex; align-items: center; gap: 12px; }
#responses .attached-workbook-label { color: #714d00; font-size: .85rem; font-weight: 750; }
.attached-workbook-header strong { margin-block: 3px; font-size: 1rem; }

/* Hypothesis analysis choices stay grouped with the path they apply to. */
#engines .engine-hypothesis-list { display: grid; gap: 10px; }
#engines .workflow-engine-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  padding: 14px 16px;
  border: 1px solid var(--workspace-line);
  border-radius: 14px;
  background: var(--workspace-soft);
}
#engines .engine-measurement-card {
  margin-block-end: 16px;
  background: #fffbef;
  border-inline-start: 4px solid var(--workspace-accent);
}
.engine-hypothesis-number {
  display: inline-block;
  padding: 3px 7px;
  margin-inline-end: 5px;
  border-radius: 6px;
  background: #ffe6a4;
  color: #382b0b;
  font-size: .8em;
}
#engines .path { margin-block-start: 5px; flex-wrap: wrap; overflow-wrap: anywhere; }
#engines .workflow-manual-engines summary {
  display: inline list-item;
  padding: 8px 12px;
  background: #fff;
}
#engines .workflow-manual-engines[open] .analysis-engine-picker { margin-block-start: 10px; }
@media (max-width: 600px) {
  #engines .workflow-engine-card { grid-template-columns: minmax(0, 1fr); }
}

.observed-analysis-header { margin-block-end: 16px; }
.observed-engine-options {
  margin-block: 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--workspace-line);
  border-radius: 12px;
  background: var(--workspace-soft);
}
.observed-engine-options .analysis-engine-picker { margin-block-end: 0; }
#analysis-engine-settings .observed-column-settings { background: var(--workspace-soft); }
#analysis-engine-settings .observed-missing-policy { max-inline-size: 34rem; }
#analysis-engine-settings .analysis-submit {
  padding: 14px;
  border: 1px solid #ead9a5;
  border-radius: 12px;
  background: #fffbef;
}
.observed-run-history > summary { cursor: pointer; font-weight: 700; }
.observed-run-history[open] > summary { margin-block-end: 12px; }

.observed-level-options .checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px;
}
.observed-level-options .checkbox-group label {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  padding: 8px 12px;
  border: 1px solid var(--workspace-line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
}
.observed-level-options label:has(input:checked) {
  border-color: #dfaa1d;
  background: #fffaeb;
}
.observed-column-role {
  display: inline-block;
  margin-inline-start: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #ffe6a4;
  color: #382b0b;
  font-size: .8em;
}
#analysis-engine-settings .observed-missing-policy { margin-block: 0; }
.observed-missing-policy > summary { cursor: pointer; font-weight: 650; }
.observed-missing-policy[open] > summary { margin-block-end: 10px; }

.model-fit-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}
.model-fit-group {
  padding: 16px;
  border: 1px solid var(--workspace-line);
  border-radius: 14px;
  background: var(--workspace-soft);
}
.model-fit-group h3 {
  margin: 0 0 8px;
  padding-inline-start: 9px;
  border-inline-start: 3px solid var(--workspace-accent);
  font-size: 1rem;
}
.model-fit-group dl { margin: 0; }
.model-fit-metric {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  padding-block: 10px;
}
.model-fit-metric + .model-fit-metric { border-block-start: 1px solid var(--workspace-line); }
.model-fit-metric dt { color: var(--workspace-muted); }
.model-fit-metric dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }

.study-report-section .data-table .report-path-outcome-start > td {
  border-block-start: 2px solid #bbc8d7;
}
.study-report-section .data-table .report-path-method-start > td {
  border-block-start: 3px solid #96701a;
}

.result-chart-panel { margin-block-end: 18px; }
.result-chart-panel > summary { display: inline-flex; cursor: pointer; list-style: none; }
.result-chart-panel > summary::-webkit-details-marker { display: none; }
.result-chart-panel[open] > summary { border-color: #dfaa1d; background: #fffaeb; }
.result-chart-gallery .study-report-chart {
  padding: 16px;
  border: 1px solid var(--workspace-line);
  background: var(--workspace-soft);
}
.result-chart-gallery .study-report-bar { grid-template-columns: minmax(0, 2fr) minmax(60px, 3fr) auto; gap: 8px; }
.result-chart-gallery .study-report-bar > bdi { overflow-wrap: anywhere; }
.result-chart-gallery .study-report-bar-track { background: #e7e7eb; }
.result-chart-gallery .study-report-bar-track i { background: var(--workspace-ink); }
.result-chart-gallery .study-report-bar-track::after { border-left-color: #916500; }

.result-dot-track { position: relative; block-size: 24px; margin-inline: 6px; }
.result-dot-track::before {
  content: ""; position: absolute; inset: 50% 0 auto; border-block-start: 1px solid #c9c9cd;
}
.result-dot-track::after {
  content: ""; position: absolute; inset: 1px auto 1px var(--zero); border-inline-start: 1px dashed #777780;
}
.result-dot-interval {
  position: absolute; inset: calc(50% - 2px) calc(100% - var(--upper)) auto var(--lower);
  block-size: 4px; border-radius: 4px; background: var(--workspace-ink);
}
.result-dot-marker {
  position: absolute; z-index: 1; top: 50%; left: var(--point); transform: translate(-50%, -50%);
  inline-size: 12px; block-size: 12px; border: 2px solid var(--workspace-ink);
  border-radius: 50%; background: var(--workspace-accent);
}
.result-dot-value small { display: block; color: var(--workspace-muted); }
@media (max-width: 600px) {
  .result-chart-gallery .result-dot-plot .study-report-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .result-dot-plot .study-report-bar > bdi:first-child { grid-column: 1 / -1; }
}

.onboarding-demo, .onboarding-payment, .onboarding-selection {
  padding: 16px;
  margin-block-end: 18px;
  border: 1px solid var(--workspace-line);
  border-radius: 14px;
  background: #fffbef;
}
.onboarding-demo, .onboarding-selection { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.onboarding-demo p, .onboarding-payment p { margin: 6px 0 0; }
.guest-workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-end: 20px;
  padding: 14px 16px;
  border: 1px solid var(--workspace-line);
  border-inline-start: 4px solid var(--workspace-accent);
  border-radius: 12px;
  background: #fffbef;
}
.guest-workspace-bar p { margin: 4px 0 0; color: var(--workspace-muted); font-size: .875rem; }
.onboarding-payment-instructions { white-space: pre-wrap; overflow-wrap: anywhere; }
.onboarding-plans-title p { max-inline-size: 72ch; }
.onboarding-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 16px;
}
.onboarding-plans > .panel.onboarding-plan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-block: 0;
  padding: clamp(16px, 2.4vw, 24px);
}
.onboarding-plans > .panel.onboarding-plan + .onboarding-plan { margin-block-start: 0; }
.onboarding-plan-heading { display: flex; align-items: center; gap: 10px; }
.onboarding-plan-heading .panel-icon {
  inline-size: 40px;
  block-size: 40px;
  background: var(--workspace-accent);
  color: var(--workspace-ink);
}
.onboarding-plan-heading h2 { margin: 0; font-size: 1.2rem; }
.onboarding-plan-price {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--workspace-soft);
  font-size: 1rem;
  font-weight: 700;
}
.onboarding-plan ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--workspace-muted);
  font-size: .875rem;
}
.onboarding-plan li { display: flex; align-items: baseline; gap: 8px; }
.onboarding-plan li .icon { flex: none; color: var(--workspace-ink); font-size: .875rem; }
.onboarding-plan-actions { display: grid; gap: 10px; margin-block-start: auto; text-align: center; }

.project-report-card {
  padding: clamp(14px, 2.4vw, 22px);
  border: 1px solid #ead9a5;
  border-inline-start: 4px solid var(--workspace-accent);
  border-radius: 14px;
  background: #fffbef;
}
.project-report-card-header, .project-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.project-report-card-header { justify-content: space-between; }
.project-report-card-header h3, .project-report-card-header p { margin: 0; }
.project-report-card-header p { margin-block-start: 4px; color: var(--workspace-muted); overflow-wrap: anywhere; }
.project-report-actions { margin-block-start: 14px; gap: 8px; }
@media (max-width: 520px) {
  .project-report-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .project-report-actions > .export-menu, .project-report-actions > .result-notes-button { grid-column: 1 / -1; }
  .project-report-actions .button { justify-content: center; text-align: center; }
  .project-report-actions > .export-menu > summary { inline-size: 100%; }
}
