@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: #f5f6f4;
  --surface: #fff;
  --ink: #171d19;
  --muted: #606961;
  --border: #e7eae5;
  --green: #66d792;
  --lime: #e7fa84;
  --lavender: #cfc1f1;
  --blue: #c5e7ee;
  --chart-track: #e6eae5;
  --deep-green: #112b20;
  --dark-green: #104f36;
  --radius: 19px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { 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: #bfdcc8; color: #1f6a45; }
.diagram-save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #bfdcc8;
  border-radius: 999px;
  background: #e7f3ea;
  color: #1f6a45;
  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: #000000; 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: #000; 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; }
.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; }
.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: #277457; 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: 192px minmax(0, 1fr); }
  .topbar, .main-content { padding-inline: 21px; }
  .sidebar { padding-inline: 12px; }
  .status-panel .panel-icon { display: none; }
}

@media (max-width: 680px) {
  .app-shell { display: flex; flex-direction: column; }
  .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: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    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-toggle {
    order: 2;
    position: static;
    inset: auto;
    margin-inline-start: auto;
    inline-size: 38px;
    block-size: 38px;
    border-radius: 10px;
  }
  .sidebar-toggle .icon { display: none; }
  .sidebar-toggle::before {
    content: "";
    display: block;
    inline-size: 16px;
    block-size: 2px;
    background: #2d2c30;
    box-shadow: 0 -5px 0 #2d2c30, 0 5px 0 #2d2c30;
  }
  .sidebar-panels {
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    display: none;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    padding: 10px 12px 14px;
    border-block-end: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 18px 32px -20px rgba(45, 44, 48, .45);
  }
  html.nav-expanded .sidebar-panels { display: flex; }
  .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:hover { transform: translateY(-2px); border-color: #d9e6dc; box-shadow: 0 18px 30px -24px rgba(12, 50, 33, .85); }
.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: #000; 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;
}
.hypothesis-card:hover,
.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,
  .hypothesis-card: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); }
.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: #d97706;
  --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%, #d97706 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: #d97706; --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: #d97706; --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: #232227;
  --muted: #8a8a8e;
  --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 #d97706; outline-offset: 3px; }

/* ---------- Sidebar: white rail, dark active pill, yellow accents ---------- */
.sidebar { background: #fff; border-inline-end: 0; }
.brand { color: #0a0a0a; }
.brand-period { color: #f7b918; }
.brand-mark { background: #0a0a0a; }
.brand-mark i { background: #f7b918; }
.sidebar-toggle { border-color: #ececeb; background: #fff; color: #8a8a8e; }
.sidebar-toggle:hover { color: #2d2c30; background: #f4f4f3; }
.nav-heading { color: #000000; }
.nav-link { color: #6b6b6e; }
.nav-link:hover { color: #2d2c30; background: #f4f4f3; }
.nav-link.active { color: #fff; background: #000; 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: #a3a2a3; }
.breadcrumbs strong { color: #2d2c30; }
.breadcrumbs .icon { color: #c9c9c8; }
.search-box { border: 0; background: #f4f4f3; color: #8a8a8e; 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: #5f5e60; }
.status-ready { background: #fdeea8; color: #7a5b00; }
.status-mapping { background: #ececeb; color: #5f5e60; }
.status-modeling { background: #2d2c30; color: #fff; }
.status-draft { background: #fff; border: 1px solid #e3e3e1; color: #8a8a8e; }
.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: #8a8a8e; }
.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: #8a8a8e; }

/* ---------- 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: #8a8a8e; }
.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: #5f5e60;
}
.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: #000; border-color: #000; }
.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: #8a8a8e; }

/* ---------- 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: #a3a2a3;
  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: #a3a2a3; 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: #8a8a8e; }

/* ---------- 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; }
.hypothesis-card:hover, .variable-card:hover { box-shadow: 0 16px 32px -22px rgba(45, 44, 48, .45); }
.hypothesis-card h3 { color: #8a8a8e; }
.hypothesis-card .path { color: #2d2c30; font-weight: 700; }
.hypothesis-card > div > p:not(.muted) { color: #5f5e60; }
.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: #d97706;
  --diagram-control: #8a8a8e;
  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: #d97706; 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: #d97706; }
.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, #232227);
  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: #a3a2a3;
  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: #a3a2a3;
  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 .summary-row { background: #fafafa; }
.study-report-display .summary-cell { font-weight: 700; }
.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; }

/* 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: #000;
  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: #000; }
.research-diagram-menu-panel .diagram-export-link:disabled { opacity: .55; cursor: wait; }
.research-diagram-menu-panel .diagram-export-status {
  font-size: 11px;
  color: #1f6a45;
  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: #8a8a8e;
  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: #8a8a8e; 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: #000; }
.profile-menu-item .icon { flex: none; width: 14px; height: 14px; color: #8a8a8e; }
.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: #000;
  transform: none;
  box-shadow: none;
}

/* ---------- Admin subscription portfolio ---------- */
.main-content > .admin-subscriptions-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-subscriptions-heading {
  flex-wrap: wrap;
  align-items: center;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--border);
}
.subscription-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.summary-pill b { font-size: 14px; }
.summary-total { background: #eef2ef; color: #37463d; }
.summary-pending { background: #fff4d8; border-color: #f1d9a0; color: #7a5605; }
.summary-active { background: #e2f5e9; border-color: #c3e6d0; color: #216241; }
.summary-rejected { background: #fdeaea; border-color: #f2cccc; color: #8a2f2f; }

.subscriptions-table { min-width: 1180px; }
.subscriptions-table thead th {
  background: #f5f8f5;
  border-block-end: 1px solid #e1e8e2;
  color: #44534a;
  font-weight: 700;
}
.subscriptions-table tbody tr { transition: background .15s ease; }
.subscriptions-table tbody tr:hover { background: #f8fbf8; }
.subscriptions-table tbody tr.row-pending { background: #fffcf3; }
.subscriptions-table td { padding-block: 12px; }

.researcher-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; color: inherit; text-decoration: none; }
.researcher-cell:hover { text-decoration: none; }
.researcher-cell:hover strong { color: #1f6444; text-decoration: underline; }
.researcher-cell:hover .researcher-avatar { background: #cfe8d8; }
.researcher-avatar {
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 10px;
  background: #e4f2ea;
  color: #1f6245;
  font-weight: 750;
  flex: none;
}
.researcher-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.researcher-id small { font-size: 11px; }
.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; }

.proof-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 7px;
  background: #eef5f1;
  color: #1f6444;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.proof-link:hover { background: #dceee3; text-decoration: none; }

.usage-figure { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.usage-figure b { color: var(--ink); font-size: 14px; }
.usage-figure span { color: var(--muted); font-size: 11px; }
.table-actions-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.table-action {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #3c4d43;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.table-action:hover { border-color: #a9c8b5; color: #1f6444; text-decoration: none; }
.table-action-primary { border-color: #1f6444; background: #1f6444; color: #fff; }
.table-action-primary:hover { background: #164d34; color: #fff; }

@media (max-width: 900px) {
  .subscriptions-table { min-width: 0; }
  .subscriptions-table thead { display: none; }
  .subscriptions-table,
  .subscriptions-table tbody,
  .subscriptions-table tr,
  .subscriptions-table td { display: block; width: 100%; }
  .subscriptions-table tr {
    margin-block-end: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
  }
  .subscriptions-table tr.row-pending { border-color: #e8cb86; background: #fffdf7; }
  .subscriptions-table td {
    display: grid;
    grid-template-columns: minmax(110px, 42%) 1fr;
    gap: 10px;
    padding: 7px 0;
    border-block-end: 1px dashed #edf0ec;
  }
  .subscriptions-table td:last-child { border-block-end: 0; }
  .subscriptions-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
  }
  .subscriptions-table td[data-label=""]::before { display: none; }
  .researcher-cell { min-width: 0; }
  .subscription-summary { inline-size: 100%; }
}

/* ---------- 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: #f5f8f5; border-block-end: 1px solid #e1e8e2; color: #44534a; }
.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 black) ---------- */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #0a0a0a;
  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; }
.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; }
}

/* ---------- Solid mobile header (no translucent blur at the top) ----------
   On a phone the sidebar becomes the sticky top bar. Keep it fully opaque so
   scrolling content never shows through behind it — that transparency reads
   as a blurry strip at the very top, especially in the installed PWA. This
   mirrors the fix used in the other Rails apps: solid background, opacity 1,
   and explicitly no CSS/WebKit filters on the header. */
@media (max-width: 680px) {
  .sidebar,
  .topbar {
    background: #fff;
    opacity: 1;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
