:root {
  --bg0: #dfe7f7;
  --bg1: #ebe5f6;
  --surface: rgba(255, 255, 255, 0.6);
  --text: #1f2430;
  --muted: #5b6475;
  --accent: #5067d6;
  --accent2: #7a6bd6;
  --brand: #4b3bbd;
  --heading: #20335a;
  --border: rgba(60, 70, 90, 0.12);

  /* Spacing scale (Tailwind-ish) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-7: 2rem;
  --s-8: 2.5rem;
  --s-9: 3rem;

  /* Radius scale */
  --r-1: 14px;
  --r-2: 20px;
  --r-3: 28px;

  /* Panel Spacing */
  --panel-pad-y: clamp(1.75rem, 3vw, 2.5rem);
  --panel-pad-x: clamp(1.25rem, 2.5vw, 2.22rem);

  /* Shadow scale */
  --shadow-1: 0 10px 30px rgba(43, 49, 66, 0.1);
  --shadow-2: 0 18px 50px rgba(43, 49, 66, 0.12);

  /* Typography */
  --lh: 1.65;
  --content: 62ch;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Inter", "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, var(--bg1), transparent 60%),
    radial-gradient(circle at bottom right, #d5e6ff, transparent 55%),
    var(--bg0);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

body.splash-active .protocol-stage {
  pointer-events: none;
}

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, var(--bg1), transparent 60%),
    radial-gradient(circle at bottom right, #d5e6ff, transparent 55%),
    var(--bg0);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.splash-overlay.is-visible {
  opacity: 1;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.splash-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--heading);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.splash-by {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.splash-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

p,
li {
  line-height: var(--lh);
  margin: 0 0 0.6rem;
}

ul {
  padding-left: 1.2rem;
  margin: 0 0 0.8rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.site-nav {
  display: flex;
  gap: 0.75rem;
}

.button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: var(--s-2) var(--s-4);
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #f7f7ff;
  border: none;
  box-shadow: var(--shadow-1);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.45);
}

.button.danger {
  background: rgba(214, 80, 103, 0.12);
  border-color: rgba(214, 80, 103, 0.3);
  color: #a3374a;
}

.button:focus-visible,
.icon-button:focus-visible,
.chip:focus-visible,
.segmented__tab:focus-visible,
select:focus-visible,
summary:focus-visible,
input[type="file"]:focus-visible,
.site-footer__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 6rem 1.5rem 6rem;
  position: relative;
}

/* PWA install promo */
.install-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem auto 1rem;
  max-width: 720px;

  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;

  font-size: 0.9rem;
}

.install-promo__actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .install-promo {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .install-promo__actions {
    justify-content: center;
  }
}

.site-footer {
  padding: 1.25rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer__right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

@media (max-width: 520px) {
  .site-footer__inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .site-footer__right {
    justify-content: center;
    flex-wrap: wrap;
  }
}

.site-footer__link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.site-footer__sep {
  color: var(--muted);
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(18, 24, 37, 0.45);
  transition: opacity 0.25s ease, visibility 0.25s ease;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bottom-sheet {
  width: min(680px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--r-2) var(--r-2) 0 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.25s ease;
}

.modal-backdrop.is-hidden .bottom-sheet {
  transform: translateY(20px);
}

.bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bottom-sheet__title {
  font-weight: 600;
  color: var(--heading);
}

.bottom-sheet__close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: var(--muted);
  cursor: pointer;
}

.bottom-sheet__content {
  padding: 1rem 1.25rem 1.5rem;
  overflow: auto;
  color: var(--text);
}

.aopl-preamble {
  color: var(--heading);
}

.protocol-stage {
  min-height: 100vh;
  padding: 7rem 1.5rem 5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.protocol-view {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.protocol-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
}

.protocol-header h1 {
  color: var(--heading);
  margin-bottom: var(--s-2);
}

.protocol-hint {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.protocol-orientation {
  padding: var(--s-2) var(--s-3);
  font-size: 0.9rem;
}

.protocol-banner {
  border-radius: var(--r-2);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-1);
  display: grid;
  gap: var(--s-3);
}

.protocol-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.protocol-map {
  position: relative;
  display: grid;
  gap: var(--s-4);
  padding: var(--s-4) 0;
}

.protocol-map::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(32, 51, 90, 0.12);
  transform: translateX(-50%);
  z-index: 0;
}

.protocol-node {
  position: relative;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  padding: var(--s-4) var(--s-5);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  display: grid;
  gap: var(--s-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1;
}

.protocol-node__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.protocol-node__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--heading);
}

.protocol-node__desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.overlay[hidden] {
  display: none;
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 37, 0.45);
}

.overlay-card {
  position: relative;
  width: min(560px, 90vw);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  padding: var(--s-6);
  z-index: 1;
  display: grid;
  gap: var(--s-4);
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.overlay.is-visible .overlay-card {
  transform: translateY(0);
  opacity: 1;
}

.overlay-close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}

.overlay-body p {
  margin: 0 0 var(--s-3);
  color: var(--text);
}

.install-steps {
  margin: 0;
  padding-left: 1.2rem;
}

.install-steps li {
  margin: 0 0 0.5rem;
}

.phase-description {
  margin: 0;
  color: var(--text);
}

.phase-instructions {
  display: grid;
  gap: var(--s-3);
}

.phase-instructions__toggle {
  justify-self: flex-start;
}

.phase-instructions__content {
  display: grid;
  gap: var(--s-4);
  padding-top: var(--s-2);
}

.phase-instructions__title {
  font-size: 1rem;
  color: var(--heading);
  margin: 0 0 var(--s-2);
}

.phase-instructions__list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.phase-instructions__list li {
  margin: 0 0 var(--s-2);
}

.overlay-muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
}

.overlay-actions--between {
  justify-content: space-between;
  align-items: center;
}

@media (hover: hover) and (pointer: fine) {
  .protocol-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(43, 49, 66, 0.18);
  }
}

@media (max-width: 720px) {
  .protocol-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .protocol-map::before {
    left: 24px;
  }

  .protocol-node {
    padding-left: calc(var(--s-5) + 12px);
  }

  .protocol-node::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent2);
    transform: translateY(-50%);
  }

  .phase-overlay {
    align-items: flex-end;
  }

  .phase-overlay .overlay-card {
    width: 100%;
    border-radius: var(--r-2) var(--r-2) 0 0;
    padding: var(--s-5) var(--s-5) var(--s-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .protocol-node,
  .overlay-card,
  .splash-overlay {
    transition: none;
  }
}

.panel {
  max-width: 760px;
  width: 100%;
  padding: var(--panel-pad-y) var(--panel-pad-x);
  border-radius: var(--r-3);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(10px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  transform: translateZ(0);
  /* Fix border-radius clipping */
}

.panel-inner {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.panel h1,
.panel-title {
  color: var(--heading);
}

.panel-title {
  text-align: center;
  margin-bottom: var(--s-4);
}

.panel-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 auto var(--s-5);
  max-width: var(--content);
}

.panel-body {
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.prose {
  line-height: var(--lh);
}

.prose p {
  margin: 0;
}

.prose p+p {
  margin-top: var(--s-3);
}

.prose ul {
  margin: var(--s-3) 0 0;
  padding-left: 1.1rem;
}

.prose li {
  margin: 0;
}

.prose li+li {
  margin-top: var(--s-2);
}

.about-signup {
  margin-top: var(--s-4);
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.about-signup:hover,
.about-signup:focus-within {
  opacity: 1;
}

.about-signup__note {
  margin-bottom: var(--s-2);
}

.about-signup__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}

.about-signup__field {
  flex: 1 1 200px;
  min-width: 180px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-size: 0.95rem;
}

.about-signup__field::placeholder {
  color: var(--muted);
}

.about-signup__field:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.about-signup__button {
  font-size: 0.9rem;
  white-space: nowrap;
}

.about-signup__status {
  min-height: 1.2em;
  margin-top: var(--s-2);
  font-size: 0.85rem;
}

.about-signup__status.is-success {
  color: var(--accent);
}

.about-signup__status.is-error {
  color: #b05a6a;
}

.about-signup__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.panel-grid {
  display: grid;
  gap: var(--s-6);
  align-items: center;
}

.panel-media {
  width: 100%;
  display: flex;
  justify-content: center;
}

.panel-media img,
.panel-media svg {
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: var(--r-2);
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.stack>*+* {
  margin-top: var(--s-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.panel-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: var(--s-3);
}

.panel-bleed-image {
  display: block;
  width: 100%;
  height: auto;
}

.panel--bleed {
  padding: 0;
}

.panel--bleed .panel-inner {
  padding: var(--panel-pad-y) var(--panel-pad-x) 0;
}

.panel--bleed .panel-bleed-image {
  width: calc(100% + var(--panel-pad-x) * 2);
  margin: var(--s-6) calc(var(--panel-pad-x) * -1) 0;
  max-width: none;
  object-fit: cover;
}

.panel-count {
  padding-top: 0.5rem;
  margin: 0 0 var(--s-4);
  font-size: 0.85rem;
  color: var(--muted);
}

.panel-progress {
  position: absolute;
  top: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 80vw);
  height: 4px;
  background: rgba(90, 102, 126, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.panel-progress__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  border-radius: 999px;
}

.panel-controls {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: var(--s-2) var(--s-3);
  backdrop-filter: blur(12px);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.6);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button .icon-play,
.icon-button .icon-replay,
.icon-button .icon-pause {
  display: none;
  stroke: none;
  fill: var(--text);
}

.icon-button.is-playing .icon-pause {
  display: block;
}

.icon-button.is-paused .icon-play {
  display: block;
}

.icon-button.is-replay .icon-replay {
  display: block;
}

.app-shell {
  padding: 7rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  justify-content: center;
}

/* Practice page header (matches Protocol heading layout, sits above .surface) */
.app-header {
  width: min(860px, 100%);
}

.surface {
  width: min(860px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  padding: var(--s-7);
  backdrop-filter: blur(12px);
}

#installPromo {
  width: min(860px, 100%);
}

.segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: var(--s-1);
  gap: 0.2rem;
  margin-bottom: var(--s-6);
  border: 1px solid var(--border);
}

.segmented__tab {
  border: none;
  background: transparent;
  padding: var(--s-2) var(--s-4);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.segmented__tab.is-active {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(43, 49, 66, 0.1);
}

.view-title {
  margin: 0;
  color: var(--heading);
}

.view-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.practice-screen {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.practice-center {
  align-items: center;
  text-align: center;
}

.practice-prompt {
  color: var(--muted);
  margin-top: -0.2rem;
}

.session-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.session-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(80, 103, 214, 0.55);
  box-shadow: 0 0 0 6px rgba(80, 103, 214, 0.1);
}

.timer {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 1.2rem;
}

.timer-value {
  font-size: 2.6rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.button-row .button {
  flex: 0 0 auto;
  min-width: 160px;
}

.session-circle {
  width: min(280px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: #f7f7ff;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 20px 40px rgba(80, 103, 214, 0.25);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.session-circle:active {
  transform: scale(0.98);
  box-shadow: 0 12px 30px rgba(80, 103, 214, 0.2);
}

.session-circle.is-pulsing {
  animation: pulse var(--pulse-duration, 4.5s) ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 20px 40px rgba(80, 103, 214, 0.25);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 26px 60px rgba(80, 103, 214, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 20px 40px rgba(80, 103, 214, 0.25);
  }
}

@media (max-width: 520px) {
  .button-row {
    flex-wrap: wrap;
  }

  .button-row .button {
    flex: 1 1 160px;
  }
}

.protocol {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  background: rgba(255, 255, 255, 0.5);
}

.protocol summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: var(--s-3);
}

.protocol-grid {
  display: grid;
  gap: var(--s-4);
}

.protocol-grid article {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(80, 90, 110, 0.08);
}

.field {
  margin-top: 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: var(--s-2) var(--s-4);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.chip.is-selected {
  background: rgba(80, 103, 214, 0.18);
  border-color: rgba(80, 103, 214, 0.4);
  color: #2f3f82;
}

.review-list {
  margin: 0;
  display: grid;
  gap: var(--s-2);
}

.review-list div {
  display: grid;
  grid-template-columns: minmax(0, 160px) 1fr;
  gap: var(--s-3);
  font-size: 0.95rem;
}

.review-list dt {
  font-weight: 600;
  color: var(--muted);
}

.review-list dd {
  margin: 0;
}

.filters {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}

.filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 0.4rem;
}

select {
  border-radius: 12px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}

.history-list {
  display: grid;
  gap: var(--s-3);
}

.history-card {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: rgba(255, 255, 255, 0.6);
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  color: var(--muted);
  font-size: 0.9rem;
}

.history-meta--secondary {
  font-size: 0.85rem;
  color: rgba(91, 100, 117, 0.9);
}

.history-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.carryover-form,
.context-form {
  padding-top: var(--s-2);
  border-top: 1px solid rgba(60, 70, 90, 0.12);
}

.context-form .field:last-of-type {
  margin-bottom: var(--s-3);
}

.carryover-form .history-card__actions {
  margin-top: var(--s-3);
}

.context-form .history-card__actions {
  margin-top: var(--s-3);
}

.file-input {
  position: relative;
  overflow: hidden;
}

.file-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .panel {
    padding: 2rem 1.5rem;
    min-height: 520px;
  }

  .panel--bleed {
    padding: 0;
  }

  .panel--bleed .panel-inner {
    padding: 2rem 1.5rem 0;
  }

  .panel--bleed .panel-bleed-image {
    width: calc(100% + 3rem);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .surface {
    padding: var(--s-6);
  }
}

@media (min-width: 900px) {
  .panel-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .panel {
    min-height: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
