:root {
  --ink: #182522;
  --muted: #68736f;
  --line: #dce5e1;
  --panel: #ffffff;
  --page: #ffffff;
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --accent-soft: #ecfeff;
  --coral: #f97316;
  --sand: #f2c978;
  --mint: #a8cbc0;
  --warning: #c2410c;
  --warning-soft: #fff0dc;
  --ok: #1f6f4d;
  --charcoal: #5f6a64;
  --shadow: 0 12px 30px rgba(24, 37, 34, 0.08);
  --glc-line: var(--line);
  --glc-muted: var(--muted);
  --glc-accent: var(--accent);
  --glc-accent-dark: var(--accent-dark);
  --glc-accent-soft: var(--accent-soft);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto 40px;
}

.topbar {
  min-height: 96px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 24px rgba(24, 37, 34, 0.07);
}

.topbar-inner {
  width: min(1320px, calc(100vw - 48px));
  min-height: 96px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 220px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}

.site-context {
  margin-right: auto;
  padding-left: 16px;
  border-left: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.875rem;
  white-space: nowrap;
}

.builder-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.builder-nav a {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.builder-nav a:hover,
.builder-nav a:focus-visible,
.nav-menu summary:hover,
.nav-menu summary:focus-visible,
.nav-menu.active > summary {
  color: var(--accent-dark);
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  display: block;
  color: #374151;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  list-style: none;
  white-space: nowrap;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: " ▾";
  font-size: 0.7em;
}

.nav-menu-items {
  position: absolute;
  z-index: 30;
  top: calc(100% + 14px);
  left: -16px;
  display: grid;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(24, 37, 34, 0.14);
}

.nav-menu:not([open]) .nav-menu-items {
  display: none;
}

.nav-menu-items a {
  padding: 9px 10px;
  border-radius: 7px;
}

.nav-menu-items a:hover,
.nav-menu-items a:focus-visible,
.nav-menu-items a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-menu-right {
  right: -16px;
  left: auto;
}

.builder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2.5rem 0 1.5rem;
}

.builder-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.builder-heading-actions button {
  width: auto;
}

.start-over-button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--muted);
}

.start-over-button:hover:not(:disabled),
.start-over-button:focus-visible:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
  color: var(--ink);
}

.local-draft-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.local-draft-status span {
  color: var(--muted);
  font-size: 0.86rem;
}

.local-draft-status button {
  width: auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: clamp(1.7rem, 2.6vw, 3rem);
  line-height: 1;
}

h2 {
  font-size: 1rem;
}

.schema-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(47, 141, 160, 0.26);
  background: linear-gradient(135deg, rgba(242, 201, 120, 0.32), rgba(168, 203, 192, 0.28));
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.schema-pill:hover,
.schema-pill:focus-visible {
  border-color: rgba(47, 141, 160, 0.5);
  box-shadow: 0 8px 18px rgba(47, 141, 160, 0.12);
  color: var(--coral);
}

.title-beta-badge {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid rgba(47, 141, 160, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint), var(--accent-soft));
  color: #123b36;
  box-shadow: 0 6px 14px rgba(47, 141, 160, 0.16);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) minmax(380px, 0.95fr);
  gap: 8px;
  align-items: start;
}

.workspace.start-mode {
  grid-template-columns: 176px minmax(0, 1fr);
}

.workspace.start-mode .preview-panel {
  display: none;
}

.progress-panel,
.builder-panel,
.preview-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.progress-panel {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.progress-panel ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.progress-panel li {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 14px;
  border-left: 3px solid var(--line);
}

.progress-panel li.active {
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 700;
}

.progress-panel .progress-subnav {
  list-style: none;
  display: grid;
  gap: 3px;
  margin: 7px 0 0;
  padding: 0;
}

.progress-panel .progress-subnav li {
  border: 0;
  padding: 0;
  font-size: inherit;
  font-weight: 400;
}

.progress-panel .progress-subnav button {
  appearance: none;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 2px 0;
  text-align: left;
}

.progress-panel .progress-subnav button:hover,
.progress-panel .progress-subnav button:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#study-details,
#study-contributors,
#participant-roster,
#participant-characteristics,
#device-inventory,
#device-datasheets {
  scroll-margin-top: 20px;
}

.builder-panel,
.preview-panel {
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}

.preview-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  min-height: 0;
}

.form-section {
  border-bottom: 1px solid var(--line);
  padding: 0 0 22px;
  margin-bottom: 22px;
}

.form-section:last-of-type {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.section-heading span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.section-heading p,
.preview-heading p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

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

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

.modality-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
}

.modality-options legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.modality-options label {
  display: flex;
  gap: 7px;
  align-items: center;
}

.modality-options input {
  width: 18px;
  height: 18px;
  margin: 0;
}

@media (max-width: 720px) {
  .modality-options {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.required {
  color: #b33b2e;
  font-weight: 800;
  display: inline;
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
}

.concept-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  background: linear-gradient(135deg, rgba(228, 241, 237, 0.95), rgba(242, 201, 120, 0.12));
  padding: 14px 16px;
  margin: 12px 0 18px;
}

.concept-card h3 {
  margin: 0 0 7px;
  font-size: 1rem;
}

.concept-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.concept-card p + p {
  margin-top: 7px;
}

.start-guide {
  display: grid;
  gap: 18px;
}

.guide-hero,
.guide-section {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #fffefa;
}

.guide-hero {
  border-left: 6px solid var(--accent);
  background: linear-gradient(135deg, rgba(230, 247, 247, 0.84), rgba(255, 253, 248, 0.96));
}

.welcome-eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.guide-hero h2 {
  max-width: 780px;
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
  line-height: 1.08;
}

.guide-hero > p,
.guide-section-heading p {
  max-width: 820px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.guide-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.guide-section-heading h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1.15rem;
}

.guide-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.guide-grid div,
.metadata-file-list div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: rgba(245, 250, 248, 0.72);
  padding: 11px 12px;
}

.guide-grid strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.guide-grid span,
.metadata-file-list span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.36;
}

.glc-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  align-items: center;
}

.glc-flow span {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid rgba(47, 141, 160, 0.26);
  background: rgba(245, 250, 248, 0.9);
  color: var(--ink);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.glc-flow span:not(:last-child)::after {
  content: "↓";
  position: absolute;
  right: -22px;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 900;
  transform: rotate(-90deg);
}

.builder-flow-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: builder-flow;
}

.builder-flow-list li {
  counter-increment: builder-flow;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(245, 250, 248, 0.72);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.builder-flow-list li::before {
  content: counter(builder-flow);
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fffefa;
  font-size: 0.78rem;
  font-weight: 900;
}

.guide-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.package-details > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.resource-callout {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(47, 141, 160, 0.2);
  background: rgba(230, 247, 247, 0.54);
  padding: 12px 14px;
}

.resource-callout .resource-links {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.folder-tree {
  margin: 0;
  max-height: none;
  border-left: 5px solid var(--mint);
  background: #f5faf8;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}

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

.metadata-file-list code {
  justify-self: start;
}

.privacy-note {
  max-width: 780px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
}

.start-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.start-actions button {
  min-width: 150px;
}

.journey-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.journey-list div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fffefa;
}

.journey-list strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.journey-list span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.package-folder-upload {
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
}

.existing-work-heading {
  margin-top: 34px;
  margin-bottom: 16px;
}

.new-package-heading {
  margin-top: 0;
  margin-bottom: 14px;
}

.new-package-heading,
.existing-work-heading {
  padding-left: 13px;
  border-left: 4px solid var(--accent);
}

.new-package-heading h3,
.existing-work-heading h3 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.new-package-heading p,
.existing-work-heading p {
  margin-bottom: 0;
}

.existing-work-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.existing-work-option {
  min-width: 0;
}

.existing-work-option h4 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.existing-work-option > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.project-backup-import {
  display: grid;
  gap: 8px;
}

.file-drop.package-folder-upload {
  padding: 0;
  border: 0;
  background: #fff;
}

@media (max-width: 720px) {
  .existing-work-options {
    grid-template-columns: 1fr;
  }
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.resource-links a {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--ink);
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.linked-dataset-field {
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(245, 250, 248, 0.72);
  padding: 10px 12px 12px;
}

.linked-dataset-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.dataset-select-label {
  display: block;
  margin-top: 10px;
}

.selected-dataset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.selected-dataset-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(47, 141, 160, 0.26);
  background: #fffefa;
  color: var(--ink);
  padding: 6px 8px 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.selected-dataset-list li.missing-selection {
  border-color: rgba(180, 83, 9, 0.28);
  background: var(--warning-soft);
  color: var(--warning);
}

.selected-dataset-list li.empty-selection {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding-left: 0;
  font-weight: 600;
}

.remove-selected-dataset {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--warning);
  padding: 0;
  border: 1px solid rgba(180, 83, 9, 0.24);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.remove-selected-dataset:hover,
.remove-selected-dataset:focus-visible {
  background: var(--warning-soft);
}

.checkbox-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 34px;
  margin: 0;
  border: 1px solid rgba(47, 141, 160, 0.22);
  background: #fffefa;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0.78;
}

.checkbox-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.checkbox-option.selected {
  border-color: rgba(47, 141, 160, 0.5);
  background: rgba(228, 241, 237, 0.95);
  opacity: 1;
}

.checkbox-option.missing-choice {
  border-color: rgba(180, 83, 9, 0.28);
  background: var(--warning-soft);
  color: var(--warning);
  opacity: 1;
}

.empty-choice-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.choice-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.warning-note {
  color: var(--warning);
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--ink);
  font: inherit;
  padding: 10px 11px;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #edf0ed;
  color: #8a948f;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

.file-drop {
  display: grid;
  gap: 10px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
}

.file-drop p {
  color: var(--muted);
  font-size: 0.9rem;
}

.file-warning {
  padding: 12px 14px;
  border-left: 5px solid var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.file-warning::before {
  content: "Warning: ";
  font-weight: 700;
}

.file-warning[hidden] {
  display: none;
}

.file-group-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.file-groups-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  min-width: 0;
}

.file-group-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  background: #edf2ef;
}

.file-group-chip.active {
  background: var(--accent);
}

.file-group-button {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.file-group-chip.active .file-group-button {
  color: white;
}

.remove-file-group {
  background: var(--charcoal);
  padding-inline: 10px;
  font-size: 0.78rem;
}

.remove-file-group:disabled {
  display: none;
}

.datetime-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fffefa;
}

.datetime-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.datetime-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.validation-summary {
  padding: 10px 12px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  color: var(--muted);
  margin-bottom: 12px;
}

.validation-summary.warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: var(--warning);
}

.validation-summary.ok {
  color: var(--ok);
}

.section-validation-panel,
.export-validation-panel {
  border: 1px solid var(--line);
  background: #fffefa;
  padding: 14px;
  margin: 0 0 16px;
}

.section-validation-panel {
  margin-top: 18px;
}

.section-validation-panel.ok,
.export-validation-panel.ok {
  border-left: 5px solid var(--ok);
  background: #edf8f0;
}

.section-validation-panel.warning,
.export-validation-panel.warning {
  border-left: 5px solid var(--warning);
  background: var(--warning-soft);
}

.section-validation-panel h3,
.export-validation-panel h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.section-validation-panel p,
.export-validation-panel p {
  margin: 0;
  color: var(--muted);
}

.section-validation-panel ul,
.export-validation-panel ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.section-validation-panel li,
.export-validation-panel li {
  margin: 5px 0;
  line-height: 1.35;
}

.section-validation-panel strong,
.export-validation-panel strong {
  color: var(--ink);
}

.variables-table {
  display: grid;
  gap: 8px;
}

.terms-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.term-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.term-header {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.variable-row {
  display: grid;
  grid-template-columns: 100px 220px 220px 120px 180px 220px 190px;
  gap: 12px;
  align-items: start;
  padding: 8px;
  background: #fffefa;
  border: 1px solid var(--line);
  min-width: 1320px;
}

.variable-row.schema-3-variable-row {
  grid-template-columns: 100px 220px 220px 320px 120px 180px 140px 280px 220px 190px;
  min-width: 2140px;
}

.description-input,
.factor-levels-input {
  min-height: 72px;
  resize: vertical;
}

.variable-header {
  background: #edf2ef;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  align-items: center;
  min-height: 52px;
}

.variable-header span {
  display: block;
  white-space: normal;
}

.variable-row strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.variables-table {
  overflow-x: auto;
  padding-bottom: 4px;
}

.variable-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

button {
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 600;
  padding: 11px 14px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button,
.remove-term {
  background: var(--charcoal);
}

.preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

pre {
  flex: 1;
  min-height: 320px;
  margin: 0;
  overflow: auto;
  background: #14211e;
  color: #d9fff4;
  padding: 16px;
  font-size: 0.82rem;
  line-height: 1.45;
}

#json-preview {
  flex: 0 0 auto;
  width: 100%;
  height: calc(100vh - 130px);
  min-height: 0;
  overflow-x: auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

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

  .progress-panel {
    position: static;
  }

  .preview-panel {
    position: static;
    height: auto;
  }

  #json-preview {
    height: 60vh;
    min-height: 320px;
  }

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 24px, 1480px);
    margin: 16px auto;
  }

  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    width: min(230px, 72vw);
  }

  .grid,
  .glc-flow,
  .guide-grid,
  .journey-list,
  .metadata-file-list,
  .term-row,
  .progress-panel ol {
    grid-template-columns: 1fr;
  }

  .glc-flow span:not(:last-child)::after {
    bottom: -25px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.builder-step {
  display: none;
}

.builder-step.active {
  display: block;
}

.progress-panel li {
  cursor: pointer;
}

code {
  background: #edf2ef;
  border: 1px solid var(--line);
  padding: 1px 5px;
  font-size: 0.9em;
}

.compact-heading {
  margin-top: 24px;
}

.subsection-heading {
  margin: 22px 0 12px;
}

.prominent-subsection {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-left: 5px solid var(--coral);
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(242, 201, 120, 0.2));
}

.subsection-heading.prominent-subsection h3 {
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.subsection-heading.prominent-subsection p {
  color: var(--charcoal);
  font-weight: 600;
}

.subsection-heading h3,
.file-group-terms h3,
.record-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.subsection-heading p,
.file-group-terms p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.table-builder,
.card-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.table-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.compact-participants {
  grid-template-columns: minmax(130px, 1fr) 90px minmax(110px, 0.8fr) minmax(110px, 0.8fr) auto;
}

.characteristics-grid {
  grid-template-columns: minmax(140px, 0.9fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(90px, 0.7fr) minmax(160px, 1.2fr) auto;
}

.table-header {
  background: #edf2ef;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 10px;
  text-transform: uppercase;
}

.table-row:not(.table-header) {
  border: 1px solid var(--line);
  background: #fffefa;
  padding: 10px;
}

.record-card {
  border: 1px solid var(--line);
  background: #fffefa;
  padding: 16px;
}

.record-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.remove-row {
  background: var(--charcoal);
  white-space: nowrap;
}

.inline-actions {
  margin-top: 18px;
}

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

.zip-download {
  grid-column: 1 / -1;
}

.export-grid button:not(.zip-download) {
  background: var(--charcoal);
}

.file-group-terms {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

@media (max-width: 900px) {
  .journey-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-participants,
  .characteristics-grid,
  .export-grid {
    grid-template-columns: 1fr;
  }
}

.study-groups-grid {
  grid-template-columns: minmax(120px, 0.9fr) minmax(170px, 1.2fr) 80px minmax(160px, 1.1fr) minmax(160px, 1.1fr) auto;
}

.generated-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(47, 141, 160, 0.25);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .study-groups-grid {
    grid-template-columns: 1fr;
  }
}

.compact-upload {
  margin-bottom: 18px;
}

.import-summary.ok {
  color: var(--ok);
  font-weight: 700;
}

.import-summary.warning {
  color: var(--warning);
  font-weight: 800;
}

#study-groups-list {
  overflow-x: auto;
}

.contributor-builder,
#contributors-list {
  display: grid;
  gap: 12px;
}

.contributor-card {
  border: 1px solid var(--line);
  background: #fffefa;
  padding: 14px;
}

.participant-card {
  border: 1px solid var(--line);
  background: #fffefa;
  padding: 14px;
}

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

.small-button {
  justify-self: start;
  padding: 8px 11px;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .contributor-fields,
  .participant-fields {
    grid-template-columns: 1fr;
  }
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-button {
  background: var(--coral);
}

#clear-contributors-import,
#remove-participants-import,
#remove-characteristics-import,
#remove-devices-import,
#remove-datasheets-import,
#remove-dataset-import {
  background: transparent;
  border-color: rgba(95, 106, 100, 0.38);
  color: var(--charcoal);
}

.danger-button,
.remove-row,
.remove-file-group,
.remove-term {
  background: transparent;
  border-color: rgba(223, 115, 93, 0.5);
  color: #a95747;
}

.danger-button:hover,
.remove-row:hover,
.remove-file-group:hover,
.remove-term:hover {
  background: rgba(223, 115, 93, 0.12);
}

#clear-contributors-import:hover,
#remove-participants-import:hover,
#remove-characteristics-import:hover,
#remove-devices-import:hover,
#remove-datasheets-import:hover,
#remove-dataset-import:hover {
  background: rgba(95, 106, 100, 0.08);
}

.nested-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  overflow: visible;
}

.nested-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.nested-grid {
  display: grid;
  gap: 10px;
  align-items: start;
}

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

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

.nested-grid-header {
  display: none;
}

.nested-row {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffefa;
}

.nested-row label {
  display: block;
  margin: 0;
}

.nested-row input,
.nested-row select {
  margin-top: 5px;
  min-width: 0;
}

.nested-row .remove-row {
  justify-self: start;
}

.nested-grid-two.nested-row .remove-row,
.nested-grid-four.nested-row .remove-row {
  grid-column: 1 / -1;
}

.sr-only {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  .nested-grid-two,
  .nested-grid-four {
    grid-template-columns: 1fr;
  }
}

.import-file-label {
  display: inline-block;
  width: fit-content;
  padding: 6px 9px;
  background: var(--accent-soft);
  border: 1px solid rgba(47, 141, 160, 0.25);
  color: var(--accent);
  font-weight: 600;
}

.import-file-label[hidden] {
  display: none;
}

.metadata-actions,
.schema-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.metadata-actions {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.metadata-actions button {
  background: var(--accent);
}

.primary-import-button {
  background: var(--ok);
  border-color: rgba(31, 111, 77, 0.18);
  box-shadow: 0 8px 18px rgba(31, 111, 77, 0.22);
}

.primary-import-button:hover {
  background: #185d40;
}

.schema-actions {
  margin-top: 8px;
}

.bottom-schema-actions {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .metadata-actions,
  .schema-actions {
    justify-content: flex-start;
  }
}

.help-marker {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  font-size: 0.64rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
}

.help-marker:focus-visible {
  outline: 3px solid rgba(47, 141, 160, 0.32);
  outline-offset: 2px;
}

.help-tooltip {
  position: absolute;
  z-index: 20;
  width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(24, 37, 34, 0.16);
  background: #fffefa;
  box-shadow: 0 14px 32px rgba(24, 37, 34, 0.18);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.help-tooltip[hidden] {
  display: none;
}
.template-tools {
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line, #d8d4c8);
  border-bottom: 1px solid var(--line, #d8d4c8);
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.template-actions button {
  width: auto;
}

.field-action {
  display: flex;
  align-items: end;
}

.template-participant-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.template-participant-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px 12px;
  min-height: 44px;
  max-height: 150px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.template-participant-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.template-participant-options input {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Shared GLC visual identity */
.progress-panel,
.builder-panel,
.preview-panel,
.guide-hero,
.guide-section,
.journey-list div,
.checkbox-option,
.selected-dataset-list li,
.help-tooltip,
input,
textarea,
select {
  background-color: #fff;
}

.progress-panel,
.builder-panel,
.preview-panel,
.guide-hero,
.guide-section {
  border-radius: 0.8rem;
}

.builder-panel,
.preview-panel {
  padding: 24px;
}

.builder-panel {
  padding-right: 10px;
}

.preview-panel {
  padding-left: 10px;
}

.guide-hero {
  border-left: 0;
  background: #fff;
}

.app-shell,
.builder-heading,
.workspace,
.start-guide {
  background: #fff;
}

.concept-card {
  background: #fff;
}

/* Use spacing, typography, and restrained separators instead of nested cards. */
.progress-panel,
.builder-panel,
.preview-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.guide-hero,
.guide-section {
  padding-right: 0;
  padding-left: 0;
  border: 0;
  border-radius: 0;
}

.guide-section + .guide-section {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.guide-grid div,
.metadata-file-list div,
.builder-flow-list li,
.journey-list div {
  border: 0;
  border-radius: 0;
  background: #fff;
}

.guide-grid div,
.metadata-file-list div {
  padding: 10px 0;
}

.builder-flow-list li,
.journey-list div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.glc-flow span {
  border: 0;
  background: var(--accent-soft);
}

.resource-callout {
  padding-right: 0;
  padding-left: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.concept-card {
  border: 0;
  border-left: 3px solid var(--accent);
}

.guide-hero h2,
.section-heading h2 {
  letter-spacing: -0.02em;
}

.section-heading > span,
.builder-flow-list li::before {
  border-radius: 999px;
}

.progress-panel li {
  border-left-color: #e5e7eb;
}

.progress-panel li.active {
  color: var(--accent-dark);
  border-color: var(--accent);
}

a,
.resource-links a {
  color: var(--accent-dark);
}

a:hover,
a:focus-visible,
.resource-links a:hover,
.resource-links a:focus-visible {
  color: var(--coral);
}

button {
  border-radius: 0.5rem;
  background: var(--accent);
  font-weight: 700;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: var(--accent-dark);
}

.schema-pill,
.title-beta-badge {
  background: var(--accent-soft);
  border-color: #a5f3fc;
  color: var(--accent-dark);
}

.schema-pill.schema-pill-current {
  background: var(--accent-soft);
  border-color: #67e8f9;
  color: var(--accent-dark);
}

.schema-pill.schema-pill-legacy {
  background: #fff7e6;
  border-color: #f2c978;
  color: #8a5214;
}

.schema-pill.schema-pill-legacy:hover,
.schema-pill.schema-pill-legacy:focus-visible {
  border-color: #d89a3a;
  box-shadow: 0 8px 18px rgba(216, 154, 58, 0.16);
  color: #6f3f0d;
}

input,
textarea,
select {
  border-color: #cbd5e1;
  border-radius: 0.45rem;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(6, 182, 212, 0.16);
}

.folder-tree {
  border-left-color: var(--accent);
  background: #f8fafc;
}

.glc-footer {
  margin-top: 0;
  padding: 0;
  background: #111827;
  color: #d1d5db;
}

.footer-inner {
  width: min(1320px, calc(100vw - 48px));
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr);
  gap: 4rem;
}

.footer-intro > a > img {
  width: 170px;
  height: auto;
  margin-bottom: 0.65rem;
}

.footer-intro p {
  max-width: 470px;
  color: #d1d5db;
  line-height: 1.5;
}

.footer-links h2 {
  margin: 0 0 1rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.glc-footer a {
  color: #d1d5db;
  text-decoration: none;
}

.glc-footer a:hover,
.glc-footer a:focus-visible {
  color: #22d3ee;
}

.footer-affiliation {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  margin: 1.35rem auto 0;
  text-align: center;
}

.footer-affiliation img {
  width: min(280px, 76vw);
  height: auto;
}

.footer-affiliation p {
  margin: 0;
  color: #d1d5db;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.15rem;
  padding-top: 0.8rem;
  border-top: 1px solid #374151;
  color: #9ca3af;
  font-size: 0.875rem;
}

@media (max-width: 900px) {
  .topbar,
  .topbar-inner {
    min-height: 82px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 10px 0;
  }

  .brand-logo {
    width: 180px;
    height: 60px;
  }

  .site-context {
    display: none;
  }

  .builder-nav {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    overflow-x: auto;
  }

  .builder-heading {
    padding-top: 1.75rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar-inner,
  .footer-inner {
    width: min(100vw - 24px, 1320px);
  }

  .builder-nav {
    font-size: 0.8rem;
  }

  .builder-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Shared Global Light Commons footer */
.glc-footer-inner {
  max-width: 1504px;
  margin: 0 auto;
  padding: 3rem 2rem 1.25rem;
}

.glc-footer-top {
  width: min(100%, 1050px);
  margin: 0 auto;
  padding-bottom: 2.75rem;
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(180px, 0.6fr);
  align-items: start;
  justify-content: center;
  gap: 8rem;
}

.glc-footer-brand {
  max-width: 500px;
}

.glc-footer-logo {
  display: block;
  width: 170px;
  height: auto;
  margin-bottom: 1rem;
}

.glc-footer-brand p {
  max-width: 450px;
  margin: 0;
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.6;
}

.glc-footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.glc-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
  font-size: 1.15rem;
  text-decoration: none;
}

.glc-footer-links {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}

.glc-footer-links h3 {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.glc-footer-links a {
  color: #d1d5db;
  font-size: 0.9rem;
  text-decoration: none;
}

.glc-footer-social a:hover,
.glc-footer-social a:focus,
.glc-footer-links a:hover,
.glc-footer-links a:focus,
.glc-footer-legal a:hover,
.glc-footer-legal a:focus {
  color: var(--glc-accent);
}

.glc-footer-affiliation {
  width: 100%;
  padding: 2rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.glc-tscn-logo {
  display: block;
  width: min(220px, 76vw);
  height: auto;
}

.glc-footer-affiliation p {
  max-width: 760px;
  margin: 0;
  color: #d1d5db;
  font-size: 0.85rem;
  line-height: 1.6;
}

.glc-footer-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  font-size: 0.8rem;
}

.glc-footer-legal {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  flex: 0 0 auto;
}

.glc-footer-legal a {
  display: inline-block;
  color: #d1d5db;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .glc-footer-top { width: min(100%, 850px); gap: 4rem; }
}

@media (max-width: 850px) {
  .glc-footer-top {
    width: min(100%, 680px);
    grid-template-columns: minmax(280px, 1fr) minmax(160px, auto);
    gap: 3rem;
  }
}

@media (max-width: 600px) {
  .glc-footer-inner { padding-right: 1.25rem; padding-left: 1.25rem; }
  .glc-footer-top { width: 100%; grid-template-columns: 1fr; gap: 2rem; }
  .glc-footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .glc-footer-legal { justify-content: flex-start; flex-wrap: wrap; }
}
