/* apps/study/css/tokens.css */
:root {
  color-scheme: light;
  --surface-page: oklch(0.985 0.003 95);
  --surface-card: oklch(1 0 0);
  --surface-sunken: oklch(0.965 0.004 95);
  --surface-raised: oklch(0.945 0.005 95);
  --surface-input: oklch(1 0 0);
  --ink: oklch(0.22 0.012 95);
  --ink-2: oklch(0.47 0.012 95);
  --ink-muted: oklch(0.525 0.010 95);
  --border: oklch(0.90 0.006 95);
  --border-strong: oklch(0.62 0.008 95);
  --accent: oklch(0.52 0.17 255);
  --accent-hover: oklch(0.46 0.17 255);
  --buyer: oklch(0.52 0.17 255);
  --seller: oklch(0.55 0.125 52);
  --good: oklch(0.53 0.14 150);
  --warn: oklch(0.56 0.105 75);
  --critical: oklch(0.53 0.19 25);
  --on-accent: oklch(1 0 0);
  --on-good: oklch(1 0 0);
  --on-critical: oklch(1 0 0);
  --on-seller: oklch(1 0 0);
  --tint-accent: oklch(0.52 0.17 255 / 0.10);
  --tint-buyer: oklch(0.52 0.17 255 / 0.10);
  --tint-seller: oklch(0.55 0.125 52 / 0.11);
  --tint-good: oklch(0.53 0.14 150 / 0.10);
  --tint-warn: oklch(0.56 0.105 75 / 0.13);
  --tint-critical: oklch(0.53 0.19 25 / 0.09);
  --shadow-1: 0 1px 2px oklch(0 0 0 / 0.05), 0 1px 3px oklch(0 0 0 / 0.05);
  --shadow-2: 0 1px 2px oklch(0 0 0 / 0.04), 0 6px 16px oklch(0 0 0 / 0.07);
  --shadow-3: 0 2px 4px oklch(0 0 0 / 0.05), 0 16px 40px oklch(0 0 0 / 0.11);
  --scrim: oklch(0.22 0.012 95 / 0.55);
  --scrim-strong: oklch(0 0 0 / 0.88);
  --image-outline: oklch(0 0 0 / 0.1);
  --focus-color: var(--accent);
  --bg: var(--surface-page);
  --panel: var(--surface-card);
  --panel-2: var(--surface-sunken);
  --panel-3: var(--surface-raised);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --dim: var(--ink-muted);
  --muted: var(--ink-muted);
  --bad: var(--critical);
  --info: var(--accent);
  --font-sans:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  --font-mono:
    ui-monospace,
    "SF Mono",
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --leading-heading: 1.15;
  --leading-tight: 1.4;
  --leading-body: 1.55;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semi: 600;
  --weight-bold: 700;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;
  --space-10: 72px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-hover: 120ms;
  --duration-enter: 200ms;
  --duration-exit: 160ms;
  --progress-h: 3px;
  --measure: 62ch;
  --content-max: 72rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --gallery-h: clamp(340px, 56vh, 620px);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}
body {
  background: var(--surface-page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  overflow-x: clip;
}
img,
svg {
  max-width: 100%;
}
::selection {
  background: var(--tint-accent);
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  color: var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  text-decoration: none;
}
.skip-link:focus-visible {
  top: var(--space-3);
}

/* apps/study/css/screens.css */
.app-shell {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--surface-page);
  padding-top: env(safe-area-inset-top, 0px);
}
.app-shell-inner {
  display: none;
}
.app-progress {
  height: var(--progress-h);
  background: var(--surface-sunken);
  overflow: hidden;
}
.app-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
@media (prefers-reduced-motion: no-preference) {
  .app-progress-bar {
    transition: width 320ms var(--ease);
  }
}
main {
  width: min(100% - (var(--gutter) * 2), var(--content-max));
  margin-inline: auto;
  padding-block: var(--space-6) var(--space-10);
}
.screen {
  display: none;
}
.screen.active {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .screen.active {
    animation: screenIn var(--duration-enter) var(--ease) both;
  }
}
@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
html[data-preset-role] #screen-1 {
  display: none !important;
}
.panel {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: clamp(var(--space-5), 3vw, var(--space-7));
  margin-bottom: var(--space-4);
}
.panel:last-child {
  margin-bottom: 0;
}
.panel.reading {
  max-width: var(--measure);
  margin-inline: auto;
}
.panel.narrow {
  max-width: 40rem;
  margin-inline: auto;
}
.panel.medium {
  max-width: 52rem;
  margin-inline: auto;
}
.split {
  display: grid;
  grid-template-columns: var(--split-cols, 1fr 1fr);
  gap: var(--space-4);
  align-items: start;
}
.split.left-bias {
  --split-cols: 1.45fr 1fr;
}
.split.right-bias {
  --split-cols: 1fr 1.45fr;
}
@media (max-width: 60rem) {
  .split {
    grid-template-columns: 1fr;
  }
}
h1,
h2,
h3,
h4 {
  line-height: var(--leading-heading);
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}
h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semi);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}
h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
  margin-bottom: var(--space-2);
}
h4 {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  margin-bottom: var(--space-2);
}
p {
  margin: 0 0 var(--space-3);
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}
strong {
  font-weight: var(--weight-semi);
}
.lede {
  font-size: var(--text-lg);
  color: var(--ink-2);
  line-height: var(--leading-body);
}
.muted {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}
.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 var(--space-2);
}
.num {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}
label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink);
  margin: 0 0 var(--space-2);
}
.field {
  margin-block: var(--space-5);
}
.field-hint {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin: calc(var(--space-2) * -1) 0 var(--space-2);
}
input[type=text],
input[type=number],
select,
textarea {
  width: 100%;
  background: var(--surface-input);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font: inherit;
  font-size: var(--text-base);
  line-height: var(--leading-tight);
  min-height: 44px;
  box-shadow: var(--shadow-1);
}
@media (prefers-reduced-motion: no-preference) {
  input[type=text],
  input[type=number],
  select,
  textarea {
    transition: border-color var(--duration-hover) var(--ease), box-shadow var(--duration-hover) var(--ease);
  }
}
textarea {
  resize: vertical;
  min-height: 140px;
  line-height: var(--leading-body);
  padding: 12px 14px;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-muted);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input[aria-invalid=true],
select[aria-invalid=true],
textarea[aria-invalid=true] {
  border-color: var(--critical);
}
input[readonly] {
  background: var(--surface-sunken);
  cursor: default;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 30rem) {
  .row {
    grid-template-columns: 1fr;
  }
}
.required-mark {
  color: var(--critical);
  font-weight: var(--weight-bold);
  margin-left: 2px;
}
.field-error {
  display: none;
  color: var(--critical);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
  margin-top: var(--space-2);
}
.field-error.show {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.field-error.show::before {
  content: "!";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--critical);
  color: var(--on-critical);
  font-size: 11px;
  font-weight: var(--weight-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.counter.short {
  color: var(--warn);
  font-weight: var(--weight-semi);
}
.counter.met::before {
  content: "\2713";
  margin-right: 6px;
  color: var(--good);
  font-weight: var(--weight-bold);
}
.counter {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-top: var(--space-2);
}
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.radio-grid label.choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 0;
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .radio-grid label.choice {
    transition: border-color var(--duration-hover) var(--ease), background-color var(--duration-hover) var(--ease);
  }
}
.radio-grid label.choice:hover {
  border-color: var(--ink-muted);
}
.radio-grid label.choice:has(input:checked) {
  background: var(--tint-accent);
  border-color: var(--accent);
  font-weight: var(--weight-semi);
}
.radio-grid label.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.radio-grid input[type=radio] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.radio-grid input[type=radio]:focus-visible {
  outline: none;
}
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  line-height: var(--leading-tight);
  min-height: 48px;
  cursor: pointer;
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .btn-primary,
  .btn-secondary {
    transition:
      background-color var(--duration-hover) var(--ease),
      border-color var(--duration-hover) var(--ease),
      box-shadow var(--duration-hover) var(--ease),
      transform var(--duration-hover) var(--ease);
  }
  .btn-primary:active:not(:disabled),
  .btn-secondary:active:not(:disabled) {
    transform: scale(0.96);
  }
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-1);
  width: 100%;
  margin-top: var(--space-6);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--shadow-2);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary {
  background: var(--surface-card);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink-muted);
}
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.continue-prompt .btn-primary,
.continue-prompt .btn-secondary {
  width: auto;
  min-width: 12rem;
  margin-top: 0;
}
.status {
  display: block;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--ink-2);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
.status.error {
  background: var(--tint-critical);
  border-color: var(--critical);
  color: var(--ink);
}
.status.error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
  border-radius: 50%;
  background: var(--critical);
  color: var(--on-critical);
  font-size: 12px;
  font-weight: var(--weight-bold);
}
.status.revise {
  background: var(--tint-warn);
  border-color: var(--warn);
  color: var(--ink);
}
.status.revise .revise-excerpt {
  display: block;
  margin-top: var(--space-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.notice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--tint-warn);
  border: 1px solid var(--warn);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0 var(--space-6);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--ink);
}
.notice::before {
  content: "i";
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--weight-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.spinner-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: var(--space-7);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.spinner-overlay.active {
  display: flex;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
}
.spinner-overlay .label {
  color: var(--ink-2);
  font-size: var(--text-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .spinner {
    animation: spin 900ms linear infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    border-top-color: var(--accent);
    opacity: 0.7;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#screen-prolific.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--progress-h) - var(--space-10) - var(--space-6));
}
#screen-prolific .panel {
  width: min(34rem, 100%);
  margin: 0;
}
#prolific-pid {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}
.role-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.role-tile {
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: var(--shadow-1);
}
@media (prefers-reduced-motion: no-preference) {
  .role-tile {
    transition:
      border-color var(--duration-hover) var(--ease),
      box-shadow var(--duration-hover) var(--ease),
      transform var(--duration-hover) var(--ease);
  }
  .role-tile:active {
    transform: scale(0.96);
  }
}
.role-tile:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--ink-muted);
}
.role-tile h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}
.role-tile p {
  color: var(--ink-2);
  margin: 0;
  font-size: var(--text-sm);
}
.role-tile .role-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-3);
}
.role-tile.active {
  border-width: 2px;
  padding: calc(var(--space-6) - 1px);
}
.role-tile.active.buyer {
  border-color: var(--buyer);
  background: var(--tint-buyer);
}
.role-tile.active.seller {
  border-color: var(--seller);
  background: var(--tint-seller);
}
.consent-form h2 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.consent-form h2:first-of-type {
  margin-top: var(--space-5);
}
.consent-form p,
.consent-form li {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--ink-2);
}
.consent-form ul {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
}
.consent-form strong {
  color: var(--ink);
}
.doc-header {
  margin-bottom: var(--space-4);
}
.doc-org {
  font-weight: var(--weight-semi);
  color: var(--ink);
  font-size: var(--text-sm);
  margin: 0;
}
.doc-sub {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  margin: 0;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  min-height: 28px;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--ink-2);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  font-variant-numeric: tabular-nums;
}
.steps li strong {
  color: var(--ink);
}
.listing {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.gallery-wrap {
  display: grid;
  grid-template-columns: 104px 1fr;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}
.gallery-col {
  position: relative;
  border-right: 1px solid var(--border);
}
.gallery-strip {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  overflow-y: auto;
  max-height: var(--gallery-h);
  scrollbar-width: none;
}
.gallery-strip::-webkit-scrollbar {
  display: none;
}
.thumb {
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
  aspect-ratio: 16 / 10;
  width: 100%;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
}
@media (prefers-reduced-motion: no-preference) {
  .thumb {
    transition:
      border-color var(--duration-hover) var(--ease),
      box-shadow var(--duration-hover) var(--ease),
      transform var(--duration-hover) var(--ease);
  }
  .thumb:hover {
    transform: translateY(-1px);
  }
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}
.thumb:hover {
  border-color: var(--ink-muted);
  box-shadow: var(--shadow-2);
}
.thumb.active {
  border-color: var(--accent);
}
.gallery-arrow {
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: var(--ink);
  cursor: pointer;
  font-size: var(--text-xs);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .gallery-arrow {
    transition: opacity var(--duration-hover) var(--ease);
  }
}
.gallery-arrow.visible {
  opacity: 1;
  pointer-events: auto;
}
.gallery-arrow.up {
  top: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: linear-gradient(var(--surface-sunken) 55%, transparent);
}
.gallery-arrow.down {
  bottom: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: linear-gradient(transparent, var(--surface-sunken) 45%);
}
.gallery {
  position: relative;
  background: var(--surface-sunken);
  height: var(--gallery-h);
}
.gallery-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}
.gallery-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}
@media (prefers-reduced-motion: no-preference) {
  .gallery-main {
    transition: opacity var(--duration-enter) var(--ease);
  }
}
.listing .badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-1);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.listing .photo-count {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  background: var(--surface-card);
  color: var(--ink-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}
.listing-body {
  padding: clamp(var(--space-4), 3vw, var(--space-7));
}
.listing-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
}
.listing-subtitle {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-5);
}
.listing-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.listing-price {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.listing-price-note {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  line-height: var(--leading-tight);
  flex: 1 1 16rem;
}
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}
.spec-label {
  color: var(--ink-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.spec-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  margin-top: 2px;
}
.spec-value-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}
.listing-section {
  margin-top: var(--space-6);
}
.listing-section > h3 {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
}
.listing-section p {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--ink-2);
}
.listing-section ul {
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--ink-2);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-4) var(--space-6);
}
.features-group-label {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--weight-semi);
  margin-bottom: var(--space-2);
}
.features-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--ink-2);
}
.features-list li {
  position: relative;
  padding-left: 20px;
}
.features-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--good);
  font-weight: var(--weight-bold);
}
.history-card {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.history-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.history-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.history-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  margin: 0;
}
.history-brand {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: 1px;
}
.history-brand strong {
  color: var(--ink-2);
}
.history-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: var(--text-sm);
  display: grid;
  gap: var(--space-2);
}
.history-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-2);
}
.history-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: var(--tint-good);
  color: var(--good);
  border-radius: 50%;
  font-size: 11px;
  font-weight: var(--weight-bold);
}
.seller-card {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.seller-card .seller-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.seller-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
}
.seller-stat {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}
.your-info-card {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent);
  background: var(--tint-accent);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--ink);
}
.your-info-card .your-info-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.your-info-card strong {
  font-variant-numeric: tabular-nums;
}
html[data-preset-role=seller] .your-info-card {
  border-color: var(--seller);
  background: var(--tint-seller);
}
html[data-preset-role=seller] .your-info-card .your-info-label {
  color: var(--seller);
}
@media (max-width: 46rem) {
  .gallery-wrap {
    grid-template-columns: 1fr;
  }
  .gallery {
    order: 1;
    height: clamp(220px, 42vh, 380px);
  }
  .gallery-col {
    order: 2;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .gallery-strip {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .gallery-strip .thumb {
    flex: 0 0 84px;
  }
  .gallery-arrow {
    display: none;
  }
}
#screen-2 .consent-form p,
#screen-2 .consent-form li,
#screen-3 .panel p,
#screen-3 .steps li,
#screen-5 .lede,
#screen-5 .muted,
#screen-6 .lede,
#screen-6 .muted {
  max-width: 72ch;
}
#context-text,
#prompt {
  max-height: 24rem;
}
.outcome {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  background: var(--surface-sunken);
}
.outcome.agreed {
  border-left-color: var(--good);
}
.outcome.timeout,
.outcome.deadlock,
.outcome.impasse {
  border-left-color: var(--warn);
}
.outcome.rejected,
.outcome.aborted {
  border-left-color: var(--critical);
}
.outcome .verdict {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  margin: 2px 0 var(--space-2);
}
.outcome.agreed .verdict {
  color: var(--good);
}
.outcome.timeout .verdict,
.outcome.deadlock .verdict,
.outcome.impasse .verdict {
  color: var(--warn);
}
.outcome.rejected .verdict,
.outcome.aborted .verdict {
  color: var(--critical);
}
.outcome .terms {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 var(--space-3);
}
.outcome .term-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.outcome .term-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: var(--ink-muted);
  min-width: 3.5rem;
}
.outcome .term-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.outcome .summary {
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.outcome .surplus {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  margin-top: var(--space-2);
}
.survey-section {
  margin: var(--space-7) 0 var(--space-2);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.survey-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.survey-section-title {
  margin: 0 0 var(--space-1);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.survey-section-sub {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}
.survey-divider {
  margin: var(--space-7) 0 var(--space-4);
  border-top: 1px solid var(--border);
}
#post-survey label {
  margin-top: var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  color: var(--ink);
}
.likert {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  margin-top: var(--space-3);
}
.likert button {
  background: var(--surface-card);
  color: var(--ink-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 0;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  min-height: 44px;
}
@media (prefers-reduced-motion: no-preference) {
  .likert button {
    transition:
      background-color var(--duration-hover) var(--ease),
      border-color var(--duration-hover) var(--ease),
      color var(--duration-hover) var(--ease),
      transform var(--duration-hover) var(--ease);
  }
  .likert button:active {
    transform: scale(0.96);
  }
}
.likert button:hover:not(.active) {
  background: var(--surface-sunken);
  border-color: var(--ink-muted);
  color: var(--ink);
}
.likert button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-1);
}
.likert-labels {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
  color: var(--ink-2);
  font-size: var(--text-xs);
}
.likert-labels span:last-child {
  text-align: right;
}
.likert[aria-invalid=true] button {
  border-color: var(--critical);
}
.likert-error {
  margin-top: var(--space-2);
}
body:has(#screen-8.active) {
  overflow: hidden;
}
body:has(#screen-8.active) main {
  height: calc(100dvh - var(--progress-h));
  max-height: calc(100dvh - var(--progress-h));
  padding-block: var(--space-4) var(--space-5);
  padding-bottom: max(var(--space-5), env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}
body:has(#screen-8.active) #screen-8 {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
body:has(#screen-8.active) #screen-8 > .split {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}
body:has(#screen-8.active) #screen-8 > .split > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}
body:has(#screen-8.active) #screen-8 .panel {
  margin: 0;
}
body:has(#screen-8.active) #screen-8 .panel-transcript {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body:has(#screen-8.active) #transcript-replay {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
body:has(#screen-8.active) #screen-8 .panel-survey {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body:has(#screen-8.active) .survey-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
body:has(#screen-8.active) #btn-8-continue {
  flex: 0 0 auto;
}
@media (max-width: 60rem), (max-height: 46rem) {
  body:has(#screen-8.active) {
    overflow: auto;
  }
  body:has(#screen-8.active) main {
    height: auto;
    max-height: none;
    display: block;
  }
  body:has(#screen-8.active) #screen-8 {
    display: block;
  }
  body:has(#screen-8.active) #screen-8 .panel {
    margin-bottom: var(--space-4);
  }
  body:has(#screen-8.active) #transcript-replay {
    max-height: 26rem;
  }
  body:has(#screen-8.active) .survey-scroll {
    overflow: visible;
  }
}
.thanks-hero {
  text-align: center;
  padding: var(--space-6) 0 var(--space-4);
}
.thanks-hero .check {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  background: var(--good);
  color: var(--on-good);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: var(--weight-bold);
}
.thanks-hero h1 {
  font-size: var(--text-2xl);
}
.thanks-hero p {
  max-width: var(--measure);
  margin-inline: auto;
}
.code-block {
  text-align: center;
}
.completion-code-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}
.completion-code {
  display: inline-block;
  padding: 14px 20px;
  background: var(--surface-sunken);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--ink);
  -webkit-user-select: all;
  user-select: all;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  cursor: pointer;
  box-shadow: var(--shadow-1);
}
@media (prefers-reduced-motion: no-preference) {
  .copy-btn {
    transition:
      background-color var(--duration-hover) var(--ease),
      border-color var(--duration-hover) var(--ease),
      color var(--duration-hover) var(--ease),
      transform var(--duration-hover) var(--ease);
  }
  .copy-btn:active {
    transform: scale(0.96);
  }
}
.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.copy-btn.copied {
  background: var(--tint-good);
  border-color: var(--good);
  color: var(--good);
}
.copy-btn-icon {
  font-size: var(--text-base);
  line-height: 1;
}
.prolific-handoff {
  text-align: center;
  margin-top: var(--space-6);
}
.prolific-handoff .btn-primary {
  width: auto;
  min-width: 16rem;
  text-decoration: none;
}
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: var(--space-6);
  overscroll-behavior: contain;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
  box-shadow: var(--shadow-3);
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox.open img {
    animation: lightboxIn var(--duration-enter) var(--ease);
  }
}
@keyframes lightboxIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.lightbox-close {
  --focus-color: oklch(1 0 0);
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  background: var(--scrim-strong);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: var(--text-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover {
  background: var(--ink);
}
.lightbox-counter {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  color: #ffffffd9;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  background: var(--scrim-strong);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}
body.mobile-blocked .screen {
  display: none !important;
}
body.mobile-blocked main {
  display: none;
}
.mobile-block-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.mobile-block-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  padding: var(--space-7) var(--space-6);
  max-width: 30rem;
  width: 100%;
}
.mobile-block-card h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}
.mobile-block-card p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.panel-trajectory .panel-heading {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--ink-2);
  margin: 0 0 var(--space-2);
}
.traj-svg {
  width: 100%;
  height: auto;
  display: block;
}
.traj-band {
  fill: var(--accent);
  opacity: 0.08;
}
.traj-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.traj-axis {
  font-size: 15px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.traj-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.traj-line.traj-buyer {
  stroke: var(--buyer);
}
.traj-line.traj-seller {
  stroke: var(--seller);
}
.traj-line.traj-you {
  stroke-width: 7.5;
}
.traj-dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.traj-dot.traj-buyer {
  fill: var(--buyer);
}
.traj-dot.traj-seller {
  fill: var(--seller);
}
.traj-dot.traj-you {
  stroke-width: 2.5;
}
.traj-settle {
  stroke: var(--ink-2);
  stroke-width: 2.5;
  stroke-dasharray: 7 6;
}
.traj-legend,
.traj-empty {
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: var(--leading-body);
  margin: var(--space-2) 0 0;
}
body:has(#screen-8.active) #screen-8 > .panel {
  flex: 0 0 auto;
  width: 100%;
  margin-bottom: var(--space-3);
  padding-block: var(--space-3);
}
body:has(#screen-8.active) #screen-8 > .panel-trajectory .traj-svg {
  max-height: 230px;
}
body:has(#screen-8.active) #screen-8 > .panel-trajectory .traj-legend {
  margin-top: var(--space-1);
}
body:has(#screen-8.active) #screen-8 > .panel .outcome {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-5);
}
body:has(#screen-8.active) #screen-8 > .panel .outcome .verdict {
  margin: 0;
}
body:has(#screen-8.active) #screen-8 > .panel .outcome .summary {
  margin-left: auto;
}
body:has(#screen-8.active) #screen-8 > .panel .outcome .terms {
  margin: 0;
}
body:has(#screen-8.active) #screen-8 > .split {
  min-height: 20rem;
}

/* apps/study/css/negotiation.css */
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.stage-header h1 {
  margin: 0;
  font-size: var(--text-xl);
}
.stage-status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
  flex: 0 0 auto;
}
.stage-status-pill[data-state=running] {
  color: var(--good);
  border-color: var(--good);
  background: var(--tint-good);
}
.stage-status-pill[data-state=running] .stage-status-dot {
  background: var(--good);
}
@media (prefers-reduced-motion: no-preference) {
  .stage-status-pill[data-state=running] .stage-status-dot {
    animation: stagePulse 1.6s ease-in-out infinite;
  }
}
.stage-status-pill[data-state=agreed] {
  color: var(--good);
  border-color: var(--good);
  background: var(--tint-good);
}
.stage-status-pill[data-state=agreed] .stage-status-dot {
  background: var(--good);
}
.stage-status-pill[data-state=deadlock],
.stage-status-pill[data-state=impasse],
.stage-status-pill[data-state=timeout] {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--tint-warn);
}
.stage-status-pill[data-state=deadlock] .stage-status-dot,
.stage-status-pill[data-state=impasse] .stage-status-dot,
.stage-status-pill[data-state=timeout] .stage-status-dot {
  background: var(--warn);
}
.stage-status-pill[data-state=rejected],
.stage-status-pill[data-state=aborted],
.stage-status-pill[data-state=error] {
  color: var(--critical);
  border-color: var(--critical);
  background: var(--tint-critical);
}
.stage-status-pill[data-state=rejected] .stage-status-dot,
.stage-status-pill[data-state=aborted] .stage-status-dot,
.stage-status-pill[data-state=error] .stage-status-dot {
  background: var(--critical);
}
.stage-status-pill[data-state=reviewing] {
  color: var(--ink-2);
}
.stage-status-pill[data-state=reviewing] .stage-status-dot {
  background: var(--ink-muted);
}
@keyframes stagePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--tint-good);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}
.price-ticker {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr minmax(9rem, 1.1fr) 1fr;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}
.ticker-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ticker-cell.buyer {
  align-items: flex-start;
  text-align: left;
}
.ticker-cell.seller {
  align-items: flex-end;
  text-align: right;
}
.ticker-cell.spread {
  align-items: center;
  text-align: center;
}
.ticker-you {
  display: none;
  visibility: hidden;
  align-items: center;
  padding: 2px 8px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
html[data-preset-role] .ticker-you {
  display: inline-flex;
}
html[data-preset-role=buyer] .ticker-cell.buyer .ticker-you,
html[data-preset-role=seller] .ticker-cell.seller .ticker-you {
  visibility: visible;
}
html[data-preset-role=buyer] .ticker-cell.buyer .ticker-you {
  background: var(--tint-buyer);
  border-color: var(--buyer);
}
html[data-preset-role=seller] .ticker-cell.seller .ticker-you {
  background: var(--tint-seller);
  border-color: var(--seller);
}
.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
  white-space: nowrap;
}
.ticker-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
}
.ticker-cell.buyer .ticker-chip {
  background: var(--buyer);
  color: var(--on-accent);
}
.ticker-cell.seller .ticker-chip {
  background: var(--seller);
  color: var(--on-seller);
}
.ticker-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  min-height: 1.1em;
  color: var(--ink-muted);
}
@media (prefers-reduced-motion: no-preference) {
  .ticker-value {
    transition: color var(--duration-enter) var(--ease);
  }
}
.ticker-cell.buyer .ticker-value.live {
  color: var(--buyer);
}
.ticker-cell.seller .ticker-value.live {
  color: var(--seller);
}
.ticker-cell.spread .ticker-value {
  font-size: var(--text-lg);
  color: var(--ink);
}
.ticker-gauge {
  margin-top: var(--space-2);
  height: 6px;
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}
.ticker-gauge-buyer {
  flex: 0 0 auto;
  background: var(--buyer);
  width: 0%;
}
.ticker-gauge-seller {
  flex: 0 0 auto;
  background: var(--seller);
  width: 0%;
  margin-left: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .ticker-gauge-buyer,
  .ticker-gauge-seller {
    transition: width 320ms var(--ease);
  }
  .ticker-value.flash {
    animation: flashUpdate 600ms var(--ease);
  }
  .ticker-gauge {
    transition: opacity var(--duration-enter) var(--ease);
  }
}
.ticker-value:not(.live) {
  font-size: var(--text-lg);
}
.ticker-cell.spread .ticker-value:not(.live) {
  font-size: var(--text-base);
  color: var(--ink-muted);
}
.price-ticker:not(.has-offers) .ticker-gauge {
  opacity: 0.25;
}
@keyframes flashUpdate {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 40rem) {
  .price-ticker {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "buyer seller" "spread spread";
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-4);
  }
  .ticker-cell.buyer {
    grid-area: buyer;
  }
  .ticker-cell.seller {
    grid-area: seller;
  }
  .ticker-cell.spread {
    grid-area: spread;
    border-top: 1px solid var(--border);
    padding-top: var(--space-3);
  }
  .ticker-value {
    font-size: var(--text-xl);
  }
  .ticker-cell.spread .ticker-value {
    font-size: var(--text-base);
  }
}
.chat-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-1);
}
.msg-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  max-width: 100%;
}
.msg-row.buyer {
  justify-content: flex-start;
}
.msg-row.seller {
  justify-content: flex-end;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-1);
}
.avatar.buyer {
  background: var(--buyer);
  color: var(--on-accent);
}
.avatar.seller {
  background: var(--seller);
  color: var(--on-seller);
}
.bubble {
  max-width: 34rem;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  min-width: 0;
}
.bubble.buyer {
  background: var(--tint-buyer);
  border-bottom-left-radius: var(--radius-xs);
  border-left: 2px solid var(--buyer);
}
.bubble.seller {
  background: var(--tint-seller);
  border-bottom-right-radius: var(--radius-xs);
  border-right: 2px solid var(--seller);
}
.bubble-meta {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}
.bubble.buyer .bubble-meta {
  color: var(--buyer);
}
.bubble.seller .bubble-meta {
  color: var(--seller);
}
.bubble-time {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.bubble-text {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.bubble-text strong {
  font-weight: var(--weight-semi);
}
.bubble-text em {
  font-style: italic;
}
.bubble-text del {
  color: var(--ink-muted);
  text-decoration: line-through;
}
.bubble-text code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}
.bubble-tool {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: 6px 12px;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  color: var(--ink-2);
}
.bubble.buyer .bubble-tool {
  background: var(--tint-buyer);
}
.bubble.seller .bubble-tool {
  background: var(--tint-seller);
}
.bubble .bubble-tool.action-accept {
  background: var(--tint-good);
}
.tool-action {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bubble.buyer .tool-action {
  color: var(--buyer);
}
.bubble.seller .tool-action {
  color: var(--seller);
}
.bubble .action-accept .tool-action {
  color: var(--good);
}
.tool-price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink);
}
.tool-final {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
}
.msg-row.moderator {
  justify-content: center;
}
.bubble.moderator {
  max-width: 40rem;
  background: var(--tint-warn);
  border: 1px dashed var(--warn);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.bubble.moderator .bubble-meta {
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (prefers-reduced-motion: no-preference) {
  #transcript .msg-row.buyer .bubble {
    animation: slideInLeft var(--duration-enter) var(--ease) 100ms both;
  }
  #transcript .msg-row.seller .bubble {
    animation: slideInRight var(--duration-enter) var(--ease) 100ms both;
  }
  #transcript .msg-row .avatar {
    animation: popIn var(--duration-enter) var(--ease) both;
  }
  #transcript .msg-row.moderator .bubble {
    animation: fadeIn var(--duration-enter) var(--ease) both;
  }
}
@media (prefers-reduced-motion: reduce) {
  #transcript .msg-row .bubble,
  #transcript .msg-row .avatar {
    animation: fadeIn var(--duration-enter) linear both;
  }
}
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.bubble-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.msg-row.buyer .bubble-group {
  align-items: flex-start;
}
.msg-row.seller .bubble-group {
  align-items: flex-end;
}
.bubble-group .bubble.buyer:not(:last-child) {
  border-bottom-left-radius: var(--radius-sm);
}
.bubble-group .bubble.buyer:not(:first-child) {
  border-top-left-radius: var(--radius-sm);
}
.bubble-group .bubble.seller:not(:last-child) {
  border-bottom-right-radius: var(--radius-sm);
}
.bubble-group .bubble.seller:not(:first-child) {
  border-top-right-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: no-preference) {
  #transcript .msg-row .bubble-group .bubble:nth-child(2) {
    animation-delay: 190ms;
  }
  #transcript .msg-row .bubble-group .bubble:nth-child(3) {
    animation-delay: 280ms;
  }
  #transcript .msg-row .bubble-group .bubble:nth-child(n+4) {
    animation-delay: 370ms;
  }
}
.msg-row.typing .bubble {
  padding: var(--space-4);
  display: flex;
  gap: 6px;
  align-items: center;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
  opacity: 0.5;
}
@media (prefers-reduced-motion: no-preference) {
  .typing-dot {
    animation: typingPulse 1.2s infinite;
  }
  .typing-dot:nth-child(2) {
    animation-delay: 0.18s;
  }
  .typing-dot:nth-child(3) {
    animation-delay: 0.36s;
  }
}
@keyframes typingPulse {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  30% {
    opacity: 1;
    transform: scale(1.1);
  }
}
.scroll-latest {
  position: sticky;
  bottom: var(--space-3);
  margin-left: auto;
  margin-right: var(--space-3);
  padding: 8px 14px;
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  z-index: 5;
}
.scroll-latest.visible {
  display: inline-flex;
}
.scroll-latest:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chat-input-panel {
  padding: var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.chat-intent {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink-2);
  margin-bottom: var(--space-3);
  max-width: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .chat-intent {
    transition:
      color var(--duration-hover) var(--ease),
      border-color var(--duration-hover) var(--ease),
      background-color var(--duration-hover) var(--ease);
  }
}
.chat-intent-icon {
  font-size: var(--text-base);
  line-height: 1;
  flex: 0 0 auto;
}
.chat-intent-label {
  min-width: 0;
  overflow-wrap: break-word;
}
.chat-intent[data-action=message] {
  color: var(--ink-2);
}
.chat-intent[data-action=counter] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--tint-accent);
}
.chat-intent[data-action=accept] {
  color: var(--good);
  border-color: var(--good);
  background: var(--tint-good);
}
.chat-intent[data-action=reject] {
  color: var(--critical);
  border-color: var(--critical);
  background: var(--tint-critical);
}
.chat-composer-label {
  margin-bottom: var(--space-2);
  color: var(--ink);
}
.chat-offer-rule {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin: var(--space-3) 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  max-width: var(--measure);
}
.chat-offer-rule strong {
  color: var(--ink);
  font-weight: var(--weight-semi);
}
.chat-offer-rule-icon {
  flex: 0 0 auto;
  line-height: 1.3;
}
.chat-textarea-wrap {
  position: relative;
  width: 100%;
}
#chat-message {
  padding: 14px 60px 14px 16px;
  min-height: 116px;
  font-size: var(--text-base);
}
.chat-submit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-1);
}
.chat-submit::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .chat-submit {
    transition: background-color var(--duration-hover) var(--ease), transform var(--duration-hover) var(--ease);
  }
  .chat-submit:active:not(:disabled) {
    transform: scale(0.96);
  }
}
.chat-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}
.chat-submit:disabled {
  background: var(--surface-raised);
  color: var(--ink-muted);
  cursor: not-allowed;
  box-shadow: none;
}
.chat-submit-icon {
  line-height: 1;
}
.chat-input-status {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}
.chat-quick-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
.quick-btn {
  flex: 1 1 13rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 16px;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .quick-btn {
    transition:
      background-color var(--duration-hover) var(--ease),
      border-color var(--duration-hover) var(--ease),
      transform var(--duration-hover) var(--ease);
  }
  .quick-btn:active:not(:disabled) {
    transform: scale(0.96);
  }
}
.quick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.quick-btn-accept {
  background: var(--tint-good);
  border-color: var(--good);
  color: var(--good);
}
.quick-btn-walk {
  background: var(--tint-critical);
  border-color: var(--critical);
  color: var(--critical);
}
.quick-btn-icon {
  font-size: var(--text-lg);
  line-height: 1;
}
.quick-btn-label {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
body:has(#screen-7.active) {
  overflow: hidden;
}
body:has(#screen-7.active) main {
  height: calc(100dvh - var(--progress-h));
  max-height: calc(100dvh - var(--progress-h));
  padding-block: var(--space-4) var(--space-5);
  padding-bottom: max(var(--space-5), env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}
body:has(#screen-7.active) #screen-7 {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
}
body:has(#screen-7.active) #screen-7 > .panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: var(--space-5);
}
body:has(#screen-7.active) #transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
body:has(#screen-7.active) #chat-input-panel {
  flex-shrink: 0;
  margin-top: var(--space-4);
}
body:has(#screen-7.active) #outcome-banner {
  flex-shrink: 0;
}
@media (max-width: 48rem) {
  body:has(#screen-7.active) .bubble {
    max-width: 82%;
  }
  body:has(#screen-7.active) .bubble-group {
    max-width: 82%;
  }
  body:has(#screen-7.active) .bubble-group .bubble {
    max-width: 100%;
  }
}
@media (max-width: 40rem), (max-height: 40rem) {
  body:has(#screen-7.active) {
    overflow: auto;
  }
  body:has(#screen-7.active) main {
    height: auto;
    max-height: none;
    display: block;
  }
  body:has(#screen-7.active) #screen-7 {
    display: block;
    height: auto;
  }
  body:has(#screen-7.active) #screen-7 > .panel {
    display: block;
  }
  body:has(#screen-7.active) #transcript {
    max-height: 60vh;
    min-height: 12rem;
    overflow-y: auto;
  }
}
.outcome-banner {
  display: none;
  margin-top: var(--space-5);
  padding: var(--space-7) var(--space-6);
  border-radius: var(--radius-xl);
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
}
.outcome-banner.show {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .outcome-banner.show {
    animation: revealOutcome 260ms var(--ease);
  }
  .outcome-banner.show > * {
    animation: fadeIn var(--duration-enter) var(--ease) both;
  }
  .outcome-banner.show > :nth-child(2) {
    animation-delay: 100ms;
  }
  .outcome-banner.show > :nth-child(3) {
    animation-delay: 200ms;
  }
  .outcome-banner.show > :nth-child(4) {
    animation-delay: 300ms;
  }
  .outcome-banner.show > :nth-child(5) {
    animation-delay: 400ms;
  }
  .outcome-banner.show .continue-prompt > * {
    animation: fadeIn var(--duration-enter) var(--ease) both;
  }
}
@media (prefers-reduced-motion: reduce) {
  .outcome-banner.show > * {
    animation: fadeIn var(--duration-enter) linear both;
  }
}
@keyframes revealOutcome {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.outcome-banner.agreed {
  border-color: var(--good);
  background: var(--tint-good);
}
.outcome-banner.deadlock,
.outcome-banner.impasse,
.outcome-banner.timeout {
  border-color: var(--warn);
  background: var(--tint-warn);
}
.outcome-banner.rejected,
.outcome-banner.aborted,
.outcome-banner.error {
  border-color: var(--critical);
  background: var(--tint-critical);
}
.outcome-banner .verdict {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}
.outcome-banner .verdict-big {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.outcome-banner.agreed .verdict-big {
  color: var(--good);
}
.outcome-banner.agreed .verdict-big::before {
  content: "\2713  ";
}
.outcome-banner.deadlock .verdict-big,
.outcome-banner.impasse .verdict-big,
.outcome-banner.timeout .verdict-big {
  color: var(--warn);
}
.outcome-banner.deadlock .verdict-big::before,
.outcome-banner.impasse .verdict-big::before,
.outcome-banner.timeout .verdict-big::before {
  content: "\2014  ";
}
.outcome-banner.rejected .verdict-big,
.outcome-banner.aborted .verdict-big {
  color: var(--critical);
}
.outcome-banner.rejected .verdict-big::before,
.outcome-banner.aborted .verdict-big::before {
  content: "\2715  ";
}
.outcome-banner.error .verdict {
  font-size: var(--text-lg);
  font-weight: var(--weight-semi);
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.outcome-banner .deal-price {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin: var(--space-3) 0 var(--space-2);
}
.outcome-banner .summary {
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  max-width: 46rem;
  margin-inline: auto;
}
.outcome-banner .outcome-gap {
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  max-width: 46rem;
  margin-inline: auto;
  margin-top: var(--space-2);
  font-variant-numeric: tabular-nums;
}
.outcome-banner .continue-prompt {
  margin-top: var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* apps/study/css/study.css */
/*# sourceMappingURL=study.css.map */
