:root {
  --bg: #f5f1e8;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: #fffaf2;
  --stroke: rgba(71, 54, 33, 0.12);
  --stroke-strong: rgba(71, 54, 33, 0.2);
  --text: #2b241a;
  --muted: #6f6658;
  --accent: #c45b35;
  --accent-soft: rgba(196, 91, 53, 0.1);
  --shadow: 0 18px 45px rgba(55, 38, 18, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(196, 91, 53, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(70, 116, 164, 0.12), transparent 24%),
    linear-gradient(180deg, #f8f5ee 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

.auth-gate {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(196, 91, 53, 0.14), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(70, 116, 164, 0.1), transparent 24%),
    linear-gradient(180deg, #fbf8f2 0%, #f4eee3 100%);
  z-index: 80;
  overflow-x: clip;
}

.marketing-shell {
  --landing-hero-shift: 0px;
  --landing-card-a: 0px;
  --landing-card-b: 0px;
  --landing-card-c: 0px;
  --landing-stack-shift: 0px;
  --landing-rigor-rotate: 0deg;
  width: min(1440px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.marketing-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
}

.marketing-brand h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
}

.marketing-topbar-actions,
.marketing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.marketing-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.95fr) minmax(340px, 0.78fr);
  gap: 24px;
  align-items: start;
}

.marketing-hero-copy,
.marketing-stage,
.auth-card-sticky,
.marketing-section {
  min-width: 0;
}

.marketing-hero-copy {
  transform: translateY(var(--landing-hero-shift));
}

.marketing-hero-copy h2,
.marketing-story-intro h2,
.marketing-feature-band-copy h2,
.marketing-rigor-copy h2,
.marketing-final-cta h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.marketing-story-intro h2,
.marketing-feature-band-copy h2,
.marketing-rigor-copy h2,
.marketing-final-cta h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.marketing-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.marketing-stage-window {
  position: sticky;
  top: 24px;
  background:
    radial-gradient(circle at top right, rgba(196, 91, 53, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(61, 42, 25, 0.96), rgba(35, 25, 16, 0.98));
  border-radius: 36px;
  border: 1px solid rgba(255, 244, 231, 0.12);
  box-shadow: 0 28px 60px rgba(49, 33, 17, 0.24);
  padding: 18px 18px 24px;
  color: #fff8f0;
}

.marketing-stage-head {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.marketing-stage-head span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 245, 233, 0.46);
}

.marketing-stage-body {
  position: relative;
  min-height: 520px;
}

.marketing-stage-card {
  border-radius: 28px;
  border: 1px solid rgba(255, 244, 231, 0.12);
  background: rgba(255, 247, 235, 0.08);
  padding: 24px;
  box-shadow: 0 14px 28px rgba(26, 19, 12, 0.18);
}

.marketing-stage-card h3,
.marketing-story-step h3,
.marketing-feature-card h3 {
  margin: 0 0 10px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.02;
}

.marketing-stage-card p,
.marketing-story-step p,
.marketing-feature-card p,
.marketing-rigor-copy p,
.marketing-final-cta p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.marketing-stage-card-main {
  width: min(100%, 460px);
  min-height: 250px;
}

.marketing-stage-card-float {
  position: absolute;
  width: min(82%, 300px);
  backdrop-filter: blur(10px);
}

.marketing-stage-card-a {
  right: 8%;
  top: 10%;
  transform: rotate(-7deg) translateY(var(--landing-card-a));
}

.marketing-stage-card-b {
  left: 8%;
  bottom: 19%;
  transform: rotate(5deg) translateY(var(--landing-card-b));
}

.marketing-stage-card-c {
  right: 12%;
  bottom: 3%;
  transform: rotate(-3deg) translateY(var(--landing-card-c));
}

.auth-card-sticky {
  position: sticky;
  top: 24px;
}

.marketing-section {
  padding: 28px;
  border-radius: 34px;
  border: 1px solid var(--stroke);
  background: rgba(255, 251, 244, 0.86);
  box-shadow: var(--shadow);
}

.marketing-rigor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.8fr);
  gap: 28px;
}

.marketing-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  gap: 32px;
  align-items: start;
}

.marketing-story-intro {
  max-width: 720px;
  margin-bottom: 24px;
}

.marketing-feature-card,
.process-timeline article,
.marketing-feature-card {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: rgba(255, 253, 248, 0.92);
}

.process-timeline {
  margin-top: 28px;
}

.process-timeline ul {
  position: relative;
  margin: 0;
  padding: 0;
}

.process-timeline li {
  list-style: none;
  position: relative;
  width: 6px;
  margin: 0 auto;
  padding-top: 34px;
  background: linear-gradient(180deg, rgba(196, 91, 53, 0.48), rgba(70, 116, 164, 0.26));
}

.process-timeline li::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) rotate(45deg);
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff7eb;
  border: 1px solid rgba(196, 91, 53, 0.35);
  box-shadow: 0 10px 24px rgba(55, 38, 18, 0.12);
  z-index: 2;
}

.process-timeline li article {
  position: relative;
  width: min(430px, calc(50vw - 78px));
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.9fr);
  gap: 14px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 248, 239, 0.98));
  box-shadow: 0 22px 44px rgba(55, 38, 18, 0.12);
  visibility: visible;
  opacity: 1;
  transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
  z-index: 1;
}

.process-timeline li:nth-of-type(odd) > article {
  left: 42px;
}

.process-timeline li:nth-of-type(even) > article {
  left: calc(-1 * min(430px, calc(50vw - 78px)) - 36px);
}

@supports (animation-timeline: view()) {
  .process-timeline li article {
    opacity: 0.25;
    transform: translateY(36px) scale(0.96);
    animation: processReveal linear both;
    animation-timeline: view(block);
    animation-range: entry 8% cover 42%;
  }

  .process-timeline li:nth-of-type(odd) > article {
    transform: translate3d(64px, 24px, 0) rotate(4deg) scale(0.96);
  }

  .process-timeline li:nth-of-type(even) > article {
    transform: translate3d(-64px, 24px, 0) rotate(-4deg) scale(0.96);
  }

  .process-timeline li::after {
    animation: processMarker linear both;
    animation-timeline: view(block);
    animation-range: entry 12% cover 36%;
  }
}

@keyframes processReveal {
  from {
    opacity: 0.2;
    box-shadow: 0 10px 24px rgba(55, 38, 18, 0.08);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    box-shadow: 0 32px 70px rgba(55, 38, 18, 0.18);
  }
}

@keyframes processMarker {
  from {
    background: #fff7eb;
    border-color: rgba(196, 91, 53, 0.35);
    box-shadow: 0 10px 24px rgba(55, 38, 18, 0.12);
  }
  to {
    background: linear-gradient(135deg, rgba(196, 91, 53, 0.95), rgba(255, 247, 235, 0.96));
    border-color: rgba(196, 91, 53, 0.58);
    box-shadow: 0 14px 26px rgba(196, 91, 53, 0.24);
  }
}

.process-step-tag {
  position: absolute;
  top: -16px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(196, 91, 53, 0.94), rgba(161, 81, 49, 0.96));
  color: #fff7ef;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 14px 26px rgba(196, 91, 53, 0.26);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.process-timeline-ready .process-timeline li.is-active .process-step-tag {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 32px rgba(196, 91, 53, 0.32);
  background: linear-gradient(135deg, rgba(196, 91, 53, 1), rgba(145, 64, 36, 0.98));
}

.process-card-block {
  min-width: 0;
}

.process-card-block h3,
.process-card-meta h4 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
  line-height: 1.04;
}

.process-card-meta {
  padding-left: 14px;
  border-left: 1px solid rgba(71, 54, 33, 0.12);
}

.process-card-meta h4 {
  font-size: 0.95rem;
  color: var(--accent);
}

.process-card-meta span {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}

.marketing-showcase {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.marketing-showcase-wide .marketing-showcase-sticky {
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
}

.marketing-showcase-copy h3 {
  margin: 0 0 10px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1.02;
}

.marketing-showcase-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.marketing-showcase-sticky {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
}

.marketing-showcase-steps {
  display: grid;
  gap: 12px;
}

.marketing-showcase-step {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 251, 245, 0.9);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.marketing-showcase-step > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.marketing-showcase-step:hover,
.marketing-showcase-step:focus-visible,
.marketing-showcase-step.is-active {
  border-color: rgba(196, 91, 53, 0.34);
  background: rgba(255, 247, 239, 0.98);
  box-shadow: 0 16px 32px rgba(55, 38, 18, 0.09);
  transform: translateY(-2px);
}

.marketing-showcase-step:focus-visible {
  outline: 2px solid rgba(196, 91, 53, 0.35);
  outline-offset: 2px;
}

.marketing-showcase-step.is-active > span {
  background: linear-gradient(135deg, rgba(196, 91, 53, 0.94), rgba(161, 81, 49, 0.96));
  color: #fff8f0;
  transform: scale(1.04);
}

.marketing-showcase-step h4 {
  margin: 0 0 4px;
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
}

.marketing-showcase-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.marketing-showcase-window {
  border-radius: 30px;
  border: 1px solid rgba(255, 244, 231, 0.12);
  background:
    radial-gradient(circle at top right, rgba(196, 91, 53, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(61, 42, 25, 0.96), rgba(35, 25, 16, 0.98));
  box-shadow: 0 28px 60px rgba(49, 33, 17, 0.24);
  padding: 18px;
  color: #fff8f0;
}

.marketing-showcase-head {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.marketing-showcase-head span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 245, 233, 0.46);
}

.marketing-showcase-stage {
  position: relative;
  min-height: 520px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 248, 237, 0.06);
}

.showcase-panel {
  position: absolute;
  inset: 0;
  padding: 22px;
  display: grid;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.985);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.showcase-panel-code {
  grid-template-columns: minmax(0, 1.25fr) minmax(170px, 0.8fr);
}

.showcase-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.showcase-document,
.showcase-board,
.showcase-dimension-stack,
.showcase-panel-visual {
  border-radius: 22px;
  border: 1px solid rgba(255, 244, 231, 0.14);
  background: rgba(255, 250, 243, 0.92);
  color: var(--text);
}

.showcase-document {
  position: relative;
  min-height: 340px;
  overflow: hidden;
}

.showcase-document::before {
  content: "";
  position: absolute;
  inset: 26px 20px auto;
  height: 12px;
  background: rgba(71, 54, 33, 0.08);
  box-shadow:
    0 34px 0 rgba(71, 54, 33, 0.08),
    0 68px 0 rgba(71, 54, 33, 0.08),
    0 102px 0 rgba(71, 54, 33, 0.08),
    0 136px 0 rgba(71, 54, 33, 0.08),
    0 170px 0 rgba(71, 54, 33, 0.08);
}

.showcase-highlight {
  position: absolute;
  left: 28px;
  right: 110px;
  height: 22px;
  border-radius: 999px;
  background: rgba(196, 91, 53, 0.24);
}

.showcase-highlight-a {
  top: 78px;
}

.showcase-highlight-b {
  top: 146px;
  right: 68px;
  background: rgba(103, 164, 129, 0.24);
}

.showcase-sidecard {
  align-self: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 250, 243, 0.12);
  border: 1px solid rgba(255, 244, 231, 0.14);
}

.showcase-sidecard h4 {
  margin: 0 0 10px;
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
}

.showcase-sidecard span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 248, 240, 0.82);
}

.showcase-board,
.showcase-dimension-stack,
.showcase-panel-visual {
  padding: 26px;
}

.showcase-board {
  display: grid;
  align-content: center;
  gap: 14px;
}

.showcase-chip,
.showcase-theme-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(196, 91, 53, 0.12);
  font-weight: 700;
}

.showcase-theme-box,
.showcase-dimension-box {
  margin-top: 10px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(71, 54, 33, 0.06);
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  line-height: 1.15;
}

.showcase-dimension-stack {
  display: grid;
  align-content: center;
  gap: 16px;
}

.showcase-panel-visual {
  display: grid;
  place-items: center;
}

.showcase-visual-box {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid rgba(71, 54, 33, 0.14);
  background: #fffaf2;
  color: var(--text);
  font-family: "Fraunces", serif;
  box-shadow: 0 16px 34px rgba(55, 38, 18, 0.12);
}

.showcase-visual-code {
  left: 36px;
  top: 172px;
  width: 168px;
  height: 104px;
  border-radius: 18px;
}

.showcase-visual-theme {
  left: 50%;
  top: 132px;
  width: 214px;
  height: 116px;
  border-radius: 22px;
  transform: translateX(-50%);
}

.showcase-visual-dimension {
  right: 34px;
  top: 96px;
  width: 182px;
  height: 182px;
  border-radius: 999px;
}

.marketing-feature-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
}

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

.marketing-rigor-panel {
  position: sticky;
  top: 24px;
  min-height: 420px;
  border-radius: 32px;
  background:
    radial-gradient(circle at center, rgba(196, 91, 53, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(61, 42, 25, 0.94), rgba(41, 29, 18, 0.96));
  border: 1px solid rgba(255, 244, 231, 0.12);
  overflow: hidden;
}

.marketing-rigor-panel::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 28px;
  border: 1px solid rgba(255, 244, 231, 0.05);
  pointer-events: none;
}

.marketing-rigor-orbit {
  position: absolute;
  border: 1px solid rgba(255, 244, 231, 0.14);
  border-radius: 999px;
  transform: rotate(var(--landing-rigor-rotate));
  transform-origin: center;
}

.marketing-rigor-orbit-a {
  inset: 48px;
}

.marketing-rigor-orbit-b {
  inset: 94px;
}

.marketing-rigor-node {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.12);
  color: #fff8f0;
  border: 1px solid rgba(255, 244, 231, 0.14);
  font-weight: 700;
}

.marketing-rigor-node-center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(196, 91, 53, 0.72);
}

.marketing-rigor-node-1 {
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.marketing-rigor-node-2 {
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
}

.marketing-rigor-node-3 {
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.marketing-rigor-node-4 {
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
}

.marketing-check-list {
  margin: 20px 0 0;
  padding-left: 18px;
  line-height: 1.9;
}

.marketing-final-cta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.marketing-footer {
  padding: 8px 4px 28px;
  color: var(--muted);
  font-size: 0.94rem;
}

.marketing-footer p {
  margin: 0;
}

.marketing-under-construction {
  margin-top: 1.5rem;
  padding: 2rem 2.25rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: rgba(255, 251, 244, 0.88);
  box-shadow: 0 22px 50px rgba(64, 41, 18, 0.08);
}

.marketing-under-construction h3 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.landing-copy {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (prefers-reduced-motion: no-preference) {
  .marketing-hero-copy,
  .marketing-stage-card-float,
  .marketing-stack-card,
  .marketing-rigor-orbit {
    transition: transform 220ms ease-out;
  }
}

.app-shell.hidden {
  display: none;
}

.auth-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.auth-card p {
  margin-top: 0;
}

.auth-help {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-error {
  color: #a12b40;
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  padding: 28px 22px;
  background: rgba(50, 36, 22, 0.92);
  color: #f7efe3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  height: auto;
  overflow: hidden;
  transition: opacity 180ms ease, padding 220ms ease;
}

.app-shell.sidebar-collapsed .sidebar {
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  pointer-events: none;
}

.sidebar-toggle-button {
  position: fixed;
  top: 24px;
  left: 298px;
  z-index: 90;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fffaf2;
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  transition: left 220ms ease, transform 180ms ease, background 180ms ease;
}

.sidebar-toggle-button:hover {
  background: #fff3e4;
  transform: scale(1.04);
}

.app-shell.sidebar-collapsed .sidebar-toggle-button {
  left: 14px;
}

.brand-block h1,
.topbar h2,
.panel h3,
.panel h4,
.hero-card h3 {
  font-family: "Fraunces", serif;
  margin: 0;
  letter-spacing: -0.02em;
}

.brand-copy,
.sidebar-card,
.meta-row,
.viewer-hint {
  color: rgba(247, 239, 227, 0.8);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: inherit;
  opacity: 0.74;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  background: transparent;
  color: #f7efe3;
  transition: 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 245, 231, 0.12);
}

.nav-group-toggle {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(247, 239, 227, 0.78);
}

.nav-group-chevron {
  font-size: 0.9rem;
  line-height: 1;
}

.research-rigor-subnav {
  display: grid;
  gap: 8px;
}

.nav-subitem {
  padding-left: 28px;
}

.sidebar-card {
  background: rgba(255, 244, 231, 0.08);
  border: 1px solid rgba(255, 244, 231, 0.12);
  border-radius: 20px;
  padding: 18px;
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #fff6eb;
}

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

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

.stat-tile {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 244, 231, 0.1);
}

.stat-tile strong {
  display: block;
  font-size: 1.4rem;
  color: #fff;
}

.portfolio-stats-grid .stat-tile {
  background: #fff7ed;
  border: 1px solid var(--stroke);
}

.portfolio-stats-grid .stat-tile span {
  color: var(--muted);
}

.portfolio-stats-grid .stat-tile strong {
  color: var(--text);
}

.project-portfolio-list {
  display: grid;
  gap: 14px;
}

.transcription-job-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.transcription-job-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: #fffaf2;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.transcription-job-card h4 {
  margin: 0;
}

.transcription-job-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.transcription-progress-bar {
  margin-top: 12px;
  height: 12px;
  border-radius: 999px;
  background: #efe5d7;
  overflow: hidden;
}

.transcription-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #c45b35, #db8352);
  transition: width 240ms ease;
}

.process-card ol {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.copyright-card p {
  margin: 0;
  color: rgba(247, 239, 227, 0.82);
  font-size: 0.92rem;
  font-weight: 600;
}

.main-content {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.topbar-actions,
.filter-row,
.hero-actions,
.inline-fields,
.dialog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.project-switch-label {
  min-width: 220px;
}

.project-switch-shell {
  position: relative;
  min-width: 0;
}

.project-switch-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 220px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
}

.project-switch-button::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.project-switch-button-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-switch-button:disabled {
  color: var(--muted);
}

.project-switch-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 140;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: #fffaf2;
  box-shadow: var(--shadow);
}

.project-switch-option {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.project-switch-option:hover,
.project-switch-option.active {
  background: rgba(196, 91, 53, 0.1);
}

.codes-filter-row {
  flex: 1;
  justify-content: flex-end;
  align-items: center;
}

.codes-filter-row .secondary-button {
  flex: 0 0 auto;
}

.codes-filter-row .select-input {
  width: auto;
  min-width: 180px;
  flex: 0 1 200px;
}

.codes-filter-row .text-input {
  width: auto;
  min-width: 220px;
  flex: 1 1 260px;
}

.language-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
  align-self: flex-start;
}

.language-switch-compact {
  min-width: 56px;
}

.language-switch-compact .select-input {
  width: 72px;
  padding-left: 12px;
  padding-right: 12px;
}

.language-switch-audio {
  min-width: 150px;
}

.audio-transcription-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.audio-upload-panel {
  margin-bottom: 18px;
}

.audio-drop-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 130px;
  padding: 22px;
  border-radius: 24px;
  border: 2px dashed rgba(196, 91, 53, 0.34);
  background:
    radial-gradient(circle at left top, rgba(196, 91, 53, 0.08), transparent 36%),
    #fffdfa;
}

.audio-drop-zone.dragover {
  border-color: rgba(196, 91, 53, 0.8);
  background:
    radial-gradient(circle at left top, rgba(196, 91, 53, 0.16), transparent 40%),
    #fff7ef;
}

.audio-drop-copy strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.05rem;
}

.audio-drop-copy p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.6;
}

.audio-input-hidden {
  display: none;
}

#undoButton[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

#undoButton,
#settingsMenuButton {
  align-self: flex-end;
  min-height: 43px;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.topbar-actions {
  justify-content: flex-end;
}

.export-menu-shell,
.settings-menu-shell {
  position: relative;
  align-self: flex-end;
}

.export-menu-dropdown,
.settings-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: #fffaf2;
  box-shadow: var(--shadow);
  z-index: 120;
}

.settings-menu-dropdown {
  min-width: 220px;
}

.settings-menu-language {
  min-width: 0;
  width: 100%;
  padding: 4px 2px 8px;
}

.settings-menu-language .select-input {
  width: 100%;
}

.settings-menu-action {
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  padding: 12px 14px;
}

.upload-button,
.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 16px;
}

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

.text-input,
.select-input,
textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #fffdfa;
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

#newCodeName {
  min-height: 108px;
  font-size: 1rem;
}

.code-similarity-list {
  display: grid;
  gap: 10px;
}

.code-similarity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255, 250, 242, 0.92);
}

.code-similarity-copy {
  min-width: 0;
}

.code-similarity-name {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.code-similarity-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.code-similarity-action {
  flex: 0 0 auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.upload-button {
  padding: 12px 18px;
  font-weight: 700;
}

.primary-button,
.upload-button {
  background: linear-gradient(135deg, #c45b35, #db8352);
  color: white;
  box-shadow: var(--shadow);
}

.secondary-button {
  background: #ece2d1;
  color: var(--text);
  border: 1px solid var(--stroke);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
}

.upload-button input {
  display: none;
}

.hero-card,
.panel,
.dialog-header,
.entity-dialog::backdrop {
  backdrop-filter: blur(12px);
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.hero-card {
  position: relative;
  z-index: 20;
  overflow: visible;
  padding: 24px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.hero-card p {
  max-width: 700px;
  line-height: 1.6;
}

.panel-grid {
  display: grid;
  gap: 18px;
}

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

.coder-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.95fr);
  align-items: stretch;
}

.coder-layout.viewer-layout-wide {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 22px;
}

.coder-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  min-width: 0;
}

.panel-header.wrap {
  flex-wrap: wrap;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}

.meta-badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: #efe7d9;
  color: var(--text);
  font-size: 0.8rem;
}

.viewer-hint {
  margin-bottom: 14px;
  color: var(--muted);
}

.viewer-mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: #efe7d9;
}

.viewer-top-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.viewer-title-compact {
  min-width: 120px;
}

.viewer-title-compact .eyebrow {
  margin-bottom: 4px;
}

.viewer-title-compact h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.05;
}

#documentSelect {
  flex: 1;
  min-width: 260px;
}

#viewerView .viewer-mode-switch {
  flex-shrink: 0;
}

.viewer-mode-button {
  padding: 9px 14px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.viewer-mode-button.active {
  background: #fffdfa;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(55, 38, 18, 0.08);
}

.save-transcript-button {
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e9f5f, #4fbe7a);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(30, 159, 95, 0.22);
}

.save-transcript-button:hover {
  filter: brightness(1.03);
}

.document-viewer {
  flex: 0 0 auto;
  min-height: 520px;
  max-height: 72vh;
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(254, 249, 241, 0.95));
  border: 1px solid var(--stroke);
  line-height: 1.9;
  white-space: pre-wrap;
}

.transcript-editor-panel {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: #fffaf4;
}

.transcript-audio-player {
  width: 100%;
  margin-bottom: 14px;
}

.transcript-playback-marker {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #efe7d9;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.transcript-segment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.transcript-speaker-field {
  display: grid;
  gap: 6px;
}

.transcript-speaker-row {
  min-width: 220px;
  flex: 1;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: #fffdfa;
}

.transcript-document-viewer {
  outline: none;
  border-color: rgba(196, 91, 53, 0.28);
  box-shadow: inset 0 0 0 1px rgba(196, 91, 53, 0.06);
  white-space: normal;
}

.transcript-document-viewer:focus {
  border-color: rgba(196, 91, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(196, 91, 53, 0.1);
}

.transcript-doc-segment {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 18px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.transcript-doc-segment.active {
  background: rgba(196, 91, 53, 0.08);
  box-shadow: inset 0 0 0 1px rgba(196, 91, 53, 0.16);
}

.transcript-doc-speaker {
  display: inline-block;
  margin-right: 8px;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.transcript-doc-header {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: 8px;
}

.transcript-doc-speaker-button,
.transcript-doc-time-button {
  padding: 0;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-weight: 800;
  line-height: inherit;
  cursor: pointer;
}

.transcript-doc-speaker-button:hover,
.transcript-doc-time-button:hover {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.transcript-doc-speaker-select {
  width: auto;
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 12px;
}

.transcript-doc-speaker:hover {
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent);
}

.transcript-doc-text {
  outline: none;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  white-space: pre-wrap;
}

.transcript-doc-text * {
  color: var(--text) !important;
  background: transparent !important;
  -webkit-text-fill-color: var(--text);
}

.transcript-document-viewer ::selection {
  background: rgba(47, 111, 237, 0.24);
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
}

.document-viewer.empty-state,
.empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--stroke);
  background: #f4ede0;
  padding: 10px 12px;
  border-radius: 999px;
}

.subpanel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}

.document-list,
.summary-list,
.fragment-list,
.card-column,
.drop-board,
.card-grid {
  display: grid;
  gap: 14px;
}

.document-card,
.summary-card,
.fragment-card,
.code-card,
.theme-card,
.dimension-card,
.gioia-card {
  background: var(--panel-strong);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 16px;
}

.fragment-jump-card {
  cursor: pointer;
}

.fragment-jump-card:hover {
  border-color: rgba(196, 91, 53, 0.35);
  box-shadow: 0 12px 28px rgba(55, 38, 18, 0.08);
}

.fragment-missing {
  border-color: rgba(161, 43, 64, 0.28);
  background: #fff5f4;
}

.fragment-missing-pill {
  background: #f6d7d9;
  color: #8f2436;
  font-weight: 800;
}

.document-card {
  display: grid;
  gap: 12px;
}

.card-row,
.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag,
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #efe7d9;
  color: var(--text);
  font-size: 0.85rem;
}

.summary-card p,
.document-card p,
.fragment-card p,
.code-card p,
.theme-card p,
.dimension-card p,
.gioia-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

details.fragment-details {
  margin-top: 12px;
}

details.fragment-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.clickable-fragment-preview {
  cursor: pointer;
}

.clickable-fragment-preview:hover {
  color: var(--text);
}

.viewer-highlight {
  border-radius: 0.4em;
  padding: 0.08em 0.04em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.viewer-highlight:hover {
  outline: 2px solid rgba(43, 36, 26, 0.22);
}

.viewer-highlight.active-jump {
  outline: 3px solid rgba(196, 91, 53, 0.9);
  box-shadow: 0 0 0 4px rgba(196, 91, 53, 0.14);
}

.highlight-tooltip {
  position: fixed;
  z-index: 20;
  max-width: 320px;
  background: rgba(33, 26, 20, 0.95);
  color: white;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  pointer-events: none;
  font-size: 0.86rem;
  line-height: 1.4;
}

.card-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.draggable {
  cursor: grab;
}

.drop-zone {
  min-height: 68px;
  border: 1.5px dashed rgba(71, 54, 33, 0.25);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 251, 243, 0.72);
}

.drop-zone.dragover {
  background: rgba(196, 91, 53, 0.08);
  border-color: rgba(196, 91, 53, 0.62);
}

.entity-actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.small-button {
  padding: 9px 12px;
  border-radius: 12px;
  background: #efe7d9;
  color: var(--text);
  border: 1px solid var(--stroke);
}

.visibility-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.visibility-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #f4ede0;
  color: var(--text);
}

.structure-reorder-tools {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

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

.structure-reorder-card {
  background: #fffaf2;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 16px;
}

.structure-reorder-card h4 {
  margin: 0 0 12px;
  font-family: "Fraunces", serif;
}

.structure-sort-list {
  display: grid;
  gap: 10px;
}

.structure-sort-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
  cursor: grab;
}

.structure-sort-item.dragover {
  border-color: rgba(196, 91, 53, 0.62);
  background: rgba(196, 91, 53, 0.08);
}

.sort-handle {
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.sort-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  flex: 0 0 auto;
}

.gioia-card h5 {
  margin: 0 0 8px;
}

.connector-label {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--stroke);
  font-size: 0.9rem;
}

.visualization-canvas {
  overflow: auto;
  border-radius: 26px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #fffdfa, #f7efe3);
  padding: 12px;
}

@media (max-width: 960px) {
  .structure-reorder-grid {
    grid-template-columns: 1fr;
  }
}

.quality-report {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.quality-section {
  background: #fffaf2;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 16px;
}

.quality-section h4 {
  margin: 0 0 12px;
  font-family: "Fraunces", serif;
}

.quality-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.quality-warning {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(209, 73, 91, 0.1);
  border: 1px solid rgba(209, 73, 91, 0.2);
  color: #7c2030;
}

.quality-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.quality-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 14px;
}

.quality-card h5 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.metadata-editor {
  margin-top: 10px;
  border-top: 1px solid var(--stroke);
  padding-top: 10px;
}

.metadata-editor summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
}

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

.metadata-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.pattern-support-hint {
  color: var(--muted);
  margin-bottom: 18px;
}

.pattern-support-matrix-wrap {
  overflow-x: auto;
}

.pattern-support-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--stroke);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
}

.pattern-support-table th,
.pattern-support-table td {
  position: relative;
  border-bottom: 1px solid var(--stroke);
  border-right: 1px solid var(--stroke);
  padding: 14px 16px;
  font-size: 0.92rem;
  text-align: left;
  white-space: nowrap;
}

.pattern-support-table thead th {
  background: #f8f0e4;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.pattern-support-table tbody th {
  max-width: 320px;
  white-space: normal;
  font-weight: 700;
}

.pattern-support-table tr:last-child th,
.pattern-support-table tr:last-child td {
  border-bottom: 0;
}

.pattern-support-table th:last-child,
.pattern-support-table td:last-child {
  border-right: 0;
}

.matrix-cell-fill {
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  background: #c45b35;
  opacity: 0;
}

.matrix-cell-text {
  position: relative;
  z-index: 1;
  font-weight: 700;
  color: var(--text);
}

.participant-table-preview {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 18, 10, 0.58);
}

.tour-highlight {
  position: fixed;
  border-radius: 20px;
  border: 3px solid #f6c16f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 2001;
}

.tour-target-active {
  position: relative;
  z-index: 2001;
  filter: none !important;
}

.tour-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #fffdfa, #f8f0e4);
  box-shadow: 0 28px 60px rgba(46, 29, 14, 0.24);
  padding: 22px;
  z-index: 2002;
}

.tour-card.centered {
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.tour-card h3 {
  margin: 0 0 10px;
}

.tour-body {
  margin: 0;
  color: var(--muted);
}

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.tour-actions-right {
  display: flex;
  gap: 10px;
}

.export-subnav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  min-width: 0;
  flex: 1 1 560px;
}

.export-subnav-button {
  min-width: 0;
  flex: 1 1 220px;
}

.apa-zoom-controls {
  flex: 0 1 auto;
}

#tableExportMenuButton {
  max-width: 100%;
}

.participant-export-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.participant-column-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.participant-column-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.participant-column-row .text-input {
  flex: 1;
}

.apa-generator-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.apa-table-preview-card {
  width: 1400px;
  min-width: 1400px;
  max-width: 1400px;
  padding-top: 8px;
  background: #ffffff;
}

.apa-preview-stage {
  display: inline-block;
  min-width: 100%;
  transform-origin: top left;
}

.apa-preview-stage.is-zoomed {
  margin-bottom: 12px;
}

.apa-preview-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.apa-table-number,
.apa-table-title,
.apa-participant-table {
  color: #000000;
  font-family: "Times New Roman", Times, serif;
}

.apa-table-number {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
  font-weight: 700;
}

.apa-table-title {
  margin: 12px 0 24px;
  font-size: 1.8rem;
  line-height: 1.15;
  font-style: italic;
}

.apa-table-scroll {
  overflow-x: auto;
}

.apa-participant-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  border-top: 5px solid #000000;
  border-bottom: 5px solid #000000;
}

.apa-participant-table th:nth-child(1),
.apa-participant-table td:nth-child(1) {
  width: 12%;
}

.apa-participant-table th:nth-child(2),
.apa-participant-table td:nth-child(2) {
  width: 21%;
}

.apa-participant-table th:nth-child(3),
.apa-participant-table td:nth-child(3) {
  width: 18%;
}

.apa-participant-table th:nth-child(4),
.apa-participant-table td:nth-child(4) {
  width: 12%;
}

.apa-participant-table th:nth-child(5),
.apa-participant-table td:nth-child(5) {
  width: 15%;
}

.apa-participant-table th:nth-child(6),
.apa-participant-table td:nth-child(6),
.apa-participant-table th:nth-child(7),
.apa-participant-table td:nth-child(7) {
  width: 11%;
}

.apa-participant-table thead th {
  border-bottom: 5px solid #000000;
  padding: 10px 14px 14px;
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.apa-data-table th:nth-child(1),
.apa-data-table td:nth-child(1) {
  width: 48%;
}

.apa-data-table th:nth-child(2),
.apa-data-table td:nth-child(2) {
  width: 22%;
}

.apa-data-table th:nth-child(3),
.apa-data-table td:nth-child(3) {
  width: 30%;
}

.apa-dimension-header {
  border-bottom: none !important;
  padding-top: 14px !important;
  padding-bottom: 12px !important;
  font-size: 1.8rem !important;
  line-height: 1.15 !important;
}

.apa-data-table thead tr:last-child th {
  border-top: 5px solid #000000;
}

.apa-data-table tbody td {
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.apa-participant-table tbody td {
  padding: 16px 14px;
  font-size: 1.5rem;
  line-height: 1.15;
  text-align: center;
  vertical-align: middle;
}

.apa-row-number {
  text-align: center;
  font-weight: 700;
}

.apa-inline-input {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #000000;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.5rem;
  line-height: 1.15;
  text-align: center;
  outline: none;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 1.2em;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.apa-inline-input::placeholder {
  color: #000000;
  opacity: 1;
}

@media (max-width: 720px) {
  .tour-card {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

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

  .tour-actions-right {
    width: 100%;
  }

  .tour-actions-right button,
  .tour-actions > button {
    width: 100%;
  }
}

.method-report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.method-stat-card {
  background: linear-gradient(180deg, #fffdfa, #f8f0e4);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 16px;
}

.method-stat-card span,
.method-report-label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.method-stat-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
}

.method-stat-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.method-report-warnings {
  margin-bottom: 16px;
}

.method-alert-panel {
  display: grid;
  gap: 10px;
}

.method-report-shell {
  border: 1px solid var(--stroke);
  border-radius: 24px;
  background: #fff;
  padding: 16px;
}

.method-report-text {
  width: 100%;
  min-height: 620px;
  margin-top: 12px;
  border: none;
  resize: vertical;
  outline: none;
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.7;
  background: transparent;
}

.visualization-svg {
  width: 100%;
  min-width: 1180px;
  height: auto;
  display: block;
  transform: scale(var(--viz-scale, 1));
  transform-origin: top left;
}

.viz-title {
  font-family: "Fraunces", serif;
  font-size: 24px;
  fill: #2b241a;
  font-weight: 700;
}

.viz-box {
  fill: #fff;
  stroke: #8f826e;
  stroke-width: 1.5;
}

.viz-code-box {
  fill: #fffdfa;
}

.viz-theme-box {
  fill: #fffaf4;
}

.viz-dimension-box {
  fill: #fffdf7;
}

.viz-line {
  stroke: #4f463a;
  stroke-width: 1.7;
  fill: none;
  marker-end: url(#arrowhead);
}

.viz-text {
  fill: #2b241a;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.viz-small {
  fill: #6f6658;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.entity-dialog {
  width: min(520px, calc(100vw - 24px));
  border: none;
  border-radius: 28px;
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entity-dialog::backdrop {
  background: rgba(30, 20, 10, 0.34);
}

.entity-dialog form {
  padding: 22px;
}

@media (max-width: 1180px) {
  .marketing-shell {
    gap: 24px;
  }

  .marketing-topbar {
    flex-wrap: wrap;
  }

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

  .marketing-story-grid,
  .marketing-rigor-grid,
  .marketing-feature-band {
    grid-template-columns: 1fr;
  }

  .auth-card-sticky {
    grid-column: 1 / -1;
    position: relative;
    top: 0;
  }

  .marketing-showcase-sticky {
    position: relative;
    top: 0;
  }

  .marketing-showcase-wide .marketing-showcase-sticky {
    grid-template-columns: 1fr;
  }

  .process-timeline li article {
    width: min(520px, calc(100vw - 180px));
    grid-template-columns: 1fr;
  }

  .process-timeline li:nth-of-type(even) > article {
    left: calc(-1 * min(520px, calc(100vw - 180px)) - 36px);
  }

  .marketing-rigor-panel,
  .marketing-stage-window {
    position: relative;
    top: 0;
  }

  .marketing-showcase-window {
    padding: 14px;
  }

  .marketing-showcase-stage {
    min-height: 460px;
  }

  .showcase-panel-code {
    grid-template-columns: 1fr;
  }

  .showcase-sidecard {
    align-self: stretch;
  }

  .marketing-final-cta {
    align-items: start;
    flex-direction: column;
  }

  .auth-landing-shell {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .panel-grid.two-col,
  .coder-layout,
  .gioia-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .auth-gate {
    padding: 18px;
  }

  .marketing-hero {
    grid-template-columns: 1fr;
  }

  .marketing-stage-body {
    min-height: 440px;
  }

  .marketing-stage-card-main {
    width: 100%;
    min-height: 220px;
  }

  .marketing-story-intro h2,
  .marketing-feature-band-copy h2,
  .marketing-rigor-copy h2,
  .marketing-final-cta h2 {
    max-width: 16ch;
  }
}

@media (max-width: 720px) {
  .auth-gate {
    padding: 14px;
  }

  .marketing-shell {
    gap: 18px;
  }

  .marketing-topbar-actions,
  .marketing-hero-actions {
    width: 100%;
  }

  .marketing-topbar-actions > *,
  .marketing-hero-actions > * {
    flex: 1 1 100%;
  }

  .marketing-stage-window,
  .marketing-section,
  .auth-card {
    border-radius: 24px;
    padding: 20px;
  }

  .marketing-section {
    padding: 20px;
  }

  .marketing-stage-body,
  .marketing-stage-card-main,
  .marketing-stage-card-float {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none !important;
  }

  .marketing-stage-body,
  .marketing-feature-grid {
    display: grid;
    gap: 14px;
  }

  .marketing-showcase-step {
    grid-template-columns: 1fr;
  }

  .marketing-showcase-step > span {
    width: 38px;
    height: 38px;
  }

  .marketing-showcase-stage {
    min-height: 400px;
  }

  .showcase-panel,
  .showcase-board,
  .showcase-dimension-stack,
  .showcase-panel-visual {
    padding: 18px;
  }

  .showcase-visual-code {
    left: 16px;
    top: 170px;
    width: 132px;
  }

  .showcase-visual-theme {
    width: 168px;
    height: 98px;
  }

  .showcase-visual-dimension {
    right: 16px;
    width: 132px;
    height: 132px;
  }

  .marketing-feature-grid {
    grid-template-columns: 1fr;
  }

  .marketing-rigor-panel {
    min-height: 360px;
  }

  .marketing-rigor-orbit-a {
    inset: 36px;
  }

  .marketing-rigor-orbit-b {
    inset: 78px;
  }

  .marketing-rigor-node {
    min-width: 92px;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .marketing-rigor-node-2,
  .marketing-rigor-node-4 {
    top: auto;
    bottom: 28px;
    transform: none;
  }

  .marketing-rigor-node-2 {
    right: 18px;
  }

  .marketing-rigor-node-4 {
    left: 18px;
  }

  .process-timeline li {
    margin-left: 24px;
    width: 4px;
  }

  .process-timeline li::after {
    left: 24px;
    transform: translateX(-50%) rotate(45deg);
  }

  .process-timeline li article,
  .process-timeline li:nth-of-type(even) > article,
  .process-timeline li:nth-of-type(odd) > article {
    position: relative;
    left: 30px;
    right: auto;
    width: calc(100vw - 112px);
    max-width: none;
    transform: none;
    visibility: visible;
    opacity: 1;
  }

  .process-timeline article {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .process-card-meta {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(71, 54, 33, 0.12);
    padding-top: 12px;
  }

  .main-content {
    padding: 16px;
  }

  .topbar,
  .hero-card {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions > * {
    max-width: 100%;
  }

  .project-switch-button {
    min-width: 0;
    width: 100%;
  }

  .panel-header.wrap {
    flex-direction: column;
  }

  .panel-header.wrap > * {
    width: 100%;
    min-width: 0;
  }

  .export-subnav {
    width: 100%;
    flex: 1 1 100%;
    margin-bottom: 12px;
  }

  .export-subnav-button {
    flex: 1 1 100%;
  }

  .zoom-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .export-menu-shell,
  .settings-menu-shell {
    align-self: flex-start;
  }

  #tableExportMenuButton,
  #undoButton,
  #settingsMenuButton {
    max-width: 100%;
  }

  .search-shell {
    min-width: 100%;
  }

  .panel {
    padding: 18px;
  }
}
