:root {
  color-scheme: light;
  --paper: #eeede7;
  --card: #fbfaf6;
  --ink: #20231f;
  --muted: #686d66;
  --forest: #173f35;
  --want: #b9dcc5;
  --interesting: #ecd98b;
  --reject: #e7b3a8;
  --misleading: #c9cbd1;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100%; margin: 0; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 50% -20%, #f8f7f1 0, var(--paper) 50%); }
.stage-gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: radial-gradient(circle at 50% 10%, #315f50 0, #10271f 48%, #07100d 100%); }
.stage-card { position: relative; width: min(600px, calc(100vw - 36px)); min-width: 0; padding: clamp(28px, 7vw, 68px); overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 26px; color: #f8faf7; background: rgba(17,35,28,.82); box-shadow: 0 30px 90px rgba(0,0,0,.42); backdrop-filter: blur(18px); }
.stage-card .eyebrow { color: #bcd9ca; }
.stage-card h2 { position: relative; max-width: 12ch; margin: 24px 0 12px; font: 500 clamp(38px,8vw,72px)/.96 Georgia,serif; letter-spacing: -.04em; }
.stage-card p:not(.eyebrow) { position: relative; max-width: 48ch; margin: 0; overflow-wrap: anywhere; color: #d5e2db; font-size: 15px; line-height: 1.55; }
.stage-number { position: absolute; top: -30px; right: 14px; color: rgba(255,255,255,.06); font: 500 clamp(130px,32vw,260px)/1 Georgia,serif; }
.stage-actions { position: relative; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.stage-actions button { min-width: 150px; min-height: 50px; }
.stage-actions .record { color: #173f35; background: #d6e8dd; border-color: #d6e8dd; }
.approval-status { margin: 7px 0 0; color: #cbd8d1; font-size: 11px; text-align: center; }
button, select, input, textarea { font: inherit; }
button, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  padding: 22px clamp(16px, 4vw, 54px) 18px;
  border-bottom: 1px solid #cdcec6;
  background: rgba(235, 233, 225, .92);
  backdrop-filter: blur(14px);
}
.eyebrow { margin: 0 0 5px; color: var(--forest); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 48px); font-weight: 500; letter-spacing: -.03em; }
.header-progress { width: min(320px, 36vw); font-size: 12px; font-weight: 750; }
.progress-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 10px; background: #d2d2ca; }
#progressBar { width: 0; height: 100%; background: var(--forest); transition: width .25s ease; }
.learning-loop-status { display: block; margin-top: 7px; color: #53635a; font-size: 9px; font-weight: 750; line-height: 1.3; }
.presentation-toggle { min-height: 34px; margin-top: 9px; padding: 5px 9px; border: 1px solid #aeb4ad; border-radius: 8px; color: var(--forest); background: rgba(255,255,255,.55); font-size: 10px; font-weight: 850; }

main { width: min(980px, 100%); margin: 0 auto; padding: 14px 16px max(40px, env(safe-area-inset-bottom)); }
.deck-toolbar { display: flex; gap: 8px; align-items: end; margin-bottom: 12px; overflow-x: auto; padding-bottom: 3px; }
.deck-toolbar label { display: grid; flex: 0 0 auto; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.deck-toolbar select, .deck-toolbar input, .deck-toolbar button { height: 42px; min-height: 42px; border: 1px solid #c9cac1; border-radius: 9px; background: #faf9f5; color: var(--ink); }
.deck-toolbar select { min-width: 160px; padding: 0 30px 0 10px; }
.deck-toolbar input { width: 130px; padding: 0 10px; }
.deck-toolbar button { flex: 0 0 auto; }
.mode-link { display: grid; place-items: center; min-height: 42px; padding: 0 12px; text-decoration: none; white-space: nowrap; }
.more-menu { position: relative; flex: 0 0 auto; }
.more-menu > summary { display: grid; place-items: center; min-height: 42px; padding: 0 14px; border: 1px solid #c9cac1; border-radius: 9px; background: #faf9f5; font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > div { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; display: flex; gap: 7px; align-items: end; padding: 10px; border: 1px solid #c9cac1; border-radius: 12px; background: rgba(250,249,245,.97); box-shadow: 0 14px 34px rgba(25,35,29,.18); backdrop-filter: blur(14px); }

.partner-panel { margin: 0 0 12px; padding: 12px; border: 1px solid #bac7bf; border-radius: 14px; background: rgba(247,249,245,.86); box-shadow: 0 8px 28px rgba(30,50,39,.07); }
.partner-controls { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(170px, 1fr) minmax(210px, 1.2fr); gap: 10px; align-items: end; }
.identity-badge { min-height: 42px; padding: 7px 10px; border: 1px solid #b8c8bd; border-radius: 9px; background: #e2ebe5; }
.identity-badge span, .identity-badge strong { display: block; }
.identity-badge span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.identity-badge strong { margin-top: 2px; color: var(--forest); font-size: 15px; }
.partner-controls label, .partner-notes label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.partner-controls select { min-height: 42px; padding: 0 30px 0 10px; border: 1px solid #c9cac1; border-radius: 9px; background: white; }
.partner-progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.partner-progress-grid span { padding: 10px; border-radius: 9px; background: #e6ece7; color: #53635a; font-size: 11px; }
.partner-progress-grid strong { display: block; margin-top: 2px; color: var(--forest); font-size: 15px; }
.partner-notes { margin-top: 9px; border-top: 1px solid #d8ddd8; padding-top: 8px; }
.partner-notes summary { cursor: pointer; color: var(--forest); font-size: 11px; font-weight: 850; }
.partner-notes label { margin-top: 9px; }
.partner-notes textarea { width: 100%; padding: 9px; resize: vertical; border: 1px solid #c9cac1; border-radius: 9px; background: white; color: var(--ink); font-size: 13px; line-height: 1.4; letter-spacing: 0; text-transform: none; }
.partner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.partner-synthesis-summary { margin-top: 9px; padding: 9px 10px; border-radius: 9px; color: #425048; background: #e8ece8; font-size: 11px; line-height: 1.45; }
.synthesis-link { display: inline-grid; place-items: center; min-height: 42px; margin-top: 9px; padding: 8px 12px; border-radius: 10px; color: white; background: var(--forest); font-size: 12px; font-weight: 850; text-decoration: none; }
.briefing-panel { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #c7cdc7; border-radius: 12px; background: rgba(248,248,243,.84); font-size: 12px; line-height: 1.45; }
.briefing-panel summary { color: var(--forest); font-weight: 850; cursor: pointer; }
body.partner-mode #learningLoopStatus { color: #315d4b; }

.synthesis-workspace { width: min(1180px, 100%); margin: 0 auto; padding: 14px max(14px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-bottom)); }
.synthesis-workspace > header { display: flex; align-items: end; justify-content: space-between; gap: 18px; color: white; }
.synthesis-workspace h2 { margin: 0; font: 500 clamp(28px,5vw,52px)/1 Georgia,serif; }
#synthesisProgress { color: #d7dfda; font-size: 13px; font-weight: 850; }
.report-tabs { display: flex; gap: 6px; margin: 12px 0 8px; overflow-x: auto; }
.report-tabs button { flex: 0 0 auto; min-height: 38px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; color: #eef2ef; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 800; }
.report-tabs button.selected { color: #163e33; background: #cde2d4; }
.report-panel { min-height: 72px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; color: #e9eeeb; background: rgba(26,36,31,.66); font-size: 11px; line-height: 1.4; backdrop-filter: blur(12px); }
.report-panel p { margin: 5px 0 0; }
.synthesis-card { overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: #0c100e; }
.synthesis-card img { display: block; width: 100%; max-height: 56dvh; aspect-ratio: 16/9; object-fit: contain; }
.synthesis-card-meta { display: flex; justify-content: space-between; gap: 10px; padding: 8px 11px; color: #d5ddd8; font-size: 11px; }
.synthesis-card-meta strong { color: white; }
.synthesis-decisions { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin-top: 9px; }
.synthesis-decisions button { min-height: 50px; padding: 7px; border: 1px solid #819087; border-radius: 10px; color: #f3f5f3; background: #27362f; font-size: 11px; font-weight: 850; }
.synthesis-decisions button.selected { outline: 3px solid #cde2d4; background: #37634f; }
.synthesis-navigation { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.shared-summary, .transcript-paste { display: grid; gap: 5px; margin-top: 12px; color: #eef2ef; font-size: 11px; font-weight: 800; }
.shared-summary textarea, .transcript-paste textarea { width: 100%; padding: 10px; border: 1px solid #76837c; border-radius: 10px; color: #f5f6f3; background: #1b2621; font-size: 14px; font-weight: 500; line-height: 1.4; }
.transcript-paste summary { cursor: pointer; }
#submitJointSynthesis { width: 100%; min-height: 52px; margin-top: 10px; }

.secure-notice { margin-bottom: 12px; padding: 12px 14px; border: 1px solid #d0b65d; border-radius: 12px; background: #f7eab5; font-size: 12px; line-height: 1.4; }
.secure-notice strong, .secure-notice span { display: block; }
.secure-notice div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.secure-notice small { display: block; max-width: 78ch; margin-top: 9px; color: #3f5149; line-height: 1.45; }
.secure-notice a { padding: 8px 10px; border-radius: 8px; color: white; background: #5b4a18; font-weight: 750; text-decoration: none; }

.deck-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.swipe-card { width: min(780px, 100%); overflow: hidden; border: 1px solid #cfd0c7; border-radius: 18px; background: var(--card); box-shadow: 0 18px 48px rgba(30, 35, 29, .12); transform-origin: 50% 92%; will-change: transform; }
.swipe-card.dragging { transition: none; }
.swipe-card.settling { transition: transform .24s cubic-bezier(.2,.72,.24,1), opacity .24s ease; }
.image-shell { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #d8d7d0; touch-action: pan-y; user-select: none; }
.image-shell img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.image-topline { position: absolute; inset: 10px 10px auto; display: flex; justify-content: space-between; gap: 8px; }
.blind-id, .source-badge { padding: 7px 9px; border-radius: 7px; background: rgba(22, 26, 22, .82); color: white; font-size: 12px; font-weight: 800; letter-spacing: .05em; backdrop-filter: blur(8px); }
.source-badge { background: rgba(244, 242, 234, .88); color: #2f3a33; letter-spacing: 0; }
.swipe-stamp { position: absolute; top: 28%; padding: 10px 13px; border: 4px solid currentColor; border-radius: 10px; font-size: clamp(24px, 5vw, 48px); font-weight: 900; opacity: 0; pointer-events: none; }
.swipe-stamp.reject { left: 7%; color: #a74132; transform: rotate(-10deg); }
.swipe-stamp.want { right: 7%; color: #277052; transform: rotate(10deg); }
.swipe-cue { position: absolute; bottom: 10px; padding: 5px 7px; border-radius: 6px; color: white; background: rgba(32,35,31,.68); font-size: 9px; font-weight: 850; letter-spacing: .04em; pointer-events: none; }
.swipe-cue.reject { left: 10px; }
.swipe-cue.want { right: 10px; }
.annotation-layer { position: absolute; inset: 0; pointer-events: none; }
.image-marker { position: absolute; display: grid; place-items: center; width: 28px; height: 28px; transform: translate(-50%, -50%); border: 2px solid white; border-radius: 50%; color: white; font-size: 11px; font-weight: 900; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.image-marker.keep { background: #217252; }
.image-marker.explore { background: #a77a12; }
.image-marker.avoid { background: #a74132; }
.rated-badge { position: absolute; right: 10px; bottom: 10px; padding: 6px 9px; border-radius: 7px; background: rgba(247,246,240,.9); font-size: 11px; font-weight: 850; }
.overlay-affordance { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 6px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: white; background: rgba(19,25,22,.58); font-size: 9px; font-weight: 850; letter-spacing: .04em; pointer-events: none; backdrop-filter: blur(8px); }
.card-detail { padding: 12px 14px 14px; }
.position-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 750; }
.note-heading { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 10px; font-weight: 800; }
.note-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: stretch; margin-top: 4px; }
.note-row textarea { width: 100%; padding: 9px 10px; resize: vertical; border: 1px solid #d1d2c9; border-radius: 9px; background: white; color: var(--ink); font-size: 13px; line-height: 1.35; }
.reaction-panel, .annotation-tools { margin-top: 10px; padding-top: 9px; border-top: 1px solid #dedfd7; }
.reaction-heading, .annotation-tools > div:first-child { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.reaction-heading strong, .annotation-tools strong { color: var(--ink); }
.reaction-group { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.reaction-group button, .annotation-actions button, .annotation-item { min-height: 32px; padding: 5px 8px; border: 1px solid #ced0c7; border-radius: 999px; color: #3b403a; background: #f3f2ec; font-size: 10px; font-weight: 800; }
.reaction-group.positive button.selected { border-color: #2d7659; color: #174f38; background: #cfe7d7; }
.reaction-group.negative button.selected { border-color: #a64d42; color: #7e2f28; background: #efd0ca; }
.annotation-tools { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; gap: 7px; align-items: end; }
.annotation-tools > div:first-child { grid-column: 1 / -1; }
.annotation-tools > div:first-child span { text-align: right; }
.annotation-tools select { min-height: 36px; padding: 0 25px 0 8px; border: 1px solid #ced0c7; border-radius: 8px; background: white; font-size: 11px; }
.annotation-actions { display: flex; gap: 5px; }
.annotation-actions button.selected { outline: 2px solid var(--forest); background: #dce8e1; }
.annotation-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.annotation-item.keep { background: #d6eadf; }
.annotation-item.explore { background: #f2e4b6; }
.annotation-item.avoid { background: #efd0ca; }
.text-button { border: 0; background: transparent; color: #8a3d33; font-size: 10px; font-weight: 800; }

.rating-controls { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1.15fr; gap: 8px; width: min(780px, 100%); margin: 12px auto 0; }
.rate { padding: 9px 8px; border: 1px solid #c8c9c0; border-radius: 11px; color: #30342f; font-size: 12px; font-weight: 850; }
.rate.reject { background: var(--reject); }
.rate.interesting { background: var(--interesting); }
.rate.misleading { background: var(--misleading); }
.rate.want { background: var(--want); }
.rate.selected { outline: 3px solid var(--forest); outline-offset: 2px; }
.rate span { font-size: 18px; line-height: 0; }
.utility-controls { display: grid; grid-template-columns: 1fr minmax(190px, 2fr) 1fr 1fr; gap: 8px; width: min(780px, 100%); margin: 9px auto 0; }
.quiet, .record { padding: 8px 12px; border: 1px solid #c8c9c0; border-radius: 10px; background: #faf9f5; color: #333832; font-size: 12px; font-weight: 800; }
.record { color: white; background: var(--forest); border-color: var(--forest); }
.gesture-hint { margin: 9px auto 0; color: var(--muted); font-size: 10px; text-align: center; }
.empty-state { width: 100%; padding: 80px 20px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 5px; color: var(--muted); }

.toast { position: fixed; z-index: 40; left: 50%; bottom: 20px; max-width: calc(100vw - 32px); transform: translateX(-50%); padding: 9px 12px; border-radius: 9px; background: #202b25; color: white; font-size: 12px; font-weight: 750; box-shadow: 0 10px 28px rgba(0,0,0,.2); }
.toast[hidden] { display: none; }

.reaction-overlay { position: fixed; z-index: 50; inset: 0; display: grid; pointer-events: none; }
.overlay-scrim { position: absolute; inset: 0; width: 100%; min-height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(3,8,6,.12); pointer-events: auto; }
.overlay-panel { position: relative; align-self: end; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; width: 100%; max-height: min(78dvh, 720px); padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 22px 22px 0 0; color: #f7f7f2; background: rgba(18,27,23,.76); box-shadow: 0 -18px 52px rgba(0,0,0,.28); backdrop-filter: blur(24px) saturate(1.12); -webkit-backdrop-filter: blur(24px) saturate(1.12); pointer-events: auto; }
.overlay-header { display: flex; justify-content: space-between; gap: 14px; align-items: start; padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.16); }
.overlay-header span, .overlay-header strong { display: block; }
.overlay-header span { color: #c9d0cc; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.overlay-header strong { margin-top: 2px; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 500; }
.overlay-close { min-width: 40px; min-height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: white; background: rgba(255,255,255,.09); font-size: 24px; line-height: 1; }
.overlay-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 8px; }
.reaction-overlay .reaction-panel, .reaction-overlay .annotation-tools { margin-top: 10px; padding-top: 9px; border-color: rgba(255,255,255,.16); }
.reaction-overlay .reaction-heading, .reaction-overlay .annotation-tools > div:first-child { color: #c9d0cc; }
.reaction-overlay .reaction-heading strong, .reaction-overlay .annotation-tools strong { color: white; }
.reaction-overlay .reaction-group button, .reaction-overlay .annotation-actions button, .reaction-overlay .annotation-item, .reaction-overlay select, .reaction-overlay .quiet { border-color: rgba(255,255,255,.24); color: #f5f5f0; background: rgba(255,255,255,.10); }
.reaction-overlay .reaction-group.positive button.selected { border-color: #8bd0aa; color: #effff5; background: rgba(47,128,86,.62); }
.reaction-overlay .reaction-group.negative button.selected { border-color: #ef9f91; color: #fff3f0; background: rgba(145,59,48,.64); }
.reaction-overlay .annotation-actions button.selected { outline-color: #9bcbb5; background: rgba(61,116,90,.7); }
.reaction-overlay .annotation-item.keep { background: rgba(47,128,86,.62); }
.reaction-overlay .annotation-item.explore { background: rgba(167,122,18,.68); }
.reaction-overlay .annotation-item.avoid { background: rgba(145,59,48,.64); }
.overlay-rating-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.16); }
.overlay-rating-controls .rate { min-height: 46px; border-color: rgba(255,255,255,.25); }
.overlay-utility-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 7px; }
.overlay-utility-controls .quiet { min-height: 38px; padding: 6px; font-size: 10px; }

body.presentation-mode { height: 100dvh; overflow: hidden; background: #0c100e; }
body.presentation-mode .app-header, body.presentation-mode .deck-toolbar, body.presentation-mode .partner-panel, body.presentation-mode .secure-notice, body.presentation-mode .rating-controls, body.presentation-mode .utility-controls, body.presentation-mode .gesture-hint { display: none; }
body.presentation-mode main { width: 100vw; height: 100dvh; margin: 0; padding: 0; }
body.presentation-mode .deck-stage { width: 100vw; height: 100dvh; }
body.presentation-mode .swipe-card { width: 100vw; height: 100dvh; border: 0; border-radius: 0; background: #0c100e; box-shadow: none; }
body.presentation-mode .image-shell { width: 100%; height: 100%; aspect-ratio: auto; background: #0c100e; touch-action: none; }
body.presentation-mode .image-shell img { object-fit: contain; }
body.presentation-mode .card-detail { display: none; }
body.presentation-mode .image-topline { inset: max(8px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) auto max(9px, env(safe-area-inset-left)); }
body.presentation-mode .source-badge { display: none; }
body.presentation-mode .blind-id { background: rgba(10,15,12,.54); }
body.presentation-mode .rated-badge { right: max(9px, env(safe-area-inset-right)); bottom: max(9px, env(safe-area-inset-bottom)); background: rgba(247,246,240,.72); }
body.presentation-mode .swipe-cue { display: none; }
body.presentation-mode .overlay-affordance { bottom: max(9px, env(safe-area-inset-bottom)); }
body.synthesis-mode { height: auto; min-height: 100dvh; overflow: auto; background: #0c100e; }
body.synthesis-mode main { width: 100%; height: auto; overflow: visible; }
body.synthesis-mode .deck-stage, body.synthesis-mode .rating-controls, body.synthesis-mode .utility-controls, body.synthesis-mode .gesture-hint, body.synthesis-mode .briefing-panel { display: none; }

@media (orientation: portrait) {
  body.presentation-mode.overlay-open .image-shell img { object-position: center top; }
}

@media (orientation: landscape) {
  .overlay-panel { justify-self: end; align-self: stretch; width: min(420px, 38vw); max-height: none; border-radius: 22px 0 0 22px; box-shadow: -18px 0 52px rgba(0,0,0,.28); }
  .overlay-rating-controls { grid-template-columns: repeat(2, 1fr); }
  body.synthesis-mode .synthesis-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(310px,36vw); column-gap: 14px; align-items: start; }
  body.synthesis-mode .synthesis-workspace > header, body.synthesis-mode .report-tabs, body.synthesis-mode .report-panel { grid-column: 1 / -1; }
  body.synthesis-mode .synthesis-card { grid-column: 1; grid-row: 4 / span 6; }
  body.synthesis-mode .synthesis-decisions, body.synthesis-mode .synthesis-navigation, body.synthesis-mode .shared-summary, body.synthesis-mode .transcript-paste, body.synthesis-mode #submitJointSynthesis, body.synthesis-mode #synthesisStatus { grid-column: 2; }
  body.synthesis-mode .synthesis-decisions { grid-template-columns: 1fr; margin-top: 0; }
  body.synthesis-mode .synthesis-card img { max-height: calc(100dvh - 190px); }
}

@media (max-width: 680px) {
  .app-header { flex-direction: column; align-items: stretch; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 14px 12px; }
  .app-header h1 { font-size: 29px; }
  .header-progress { width: 100%; padding-top: 0; text-align: left; }
  main { padding: 10px 12px max(34px, env(safe-area-inset-bottom)); }
  .deck-toolbar { margin-inline: -12px; padding-inline: 12px; }
  .jump-label, #jumpButton, #exportButton { display: none; }
  .swipe-card { border-radius: 14px; }
  .card-detail { padding: 10px 11px 11px; }
  .rating-controls { grid-template-columns: repeat(2, 1fr); }
  .rate { min-height: 46px; }
  .utility-controls { grid-template-columns: .8fr 2fr .8fr; }
  #undoButton { grid-column: 1 / -1; }
  .annotation-tools { grid-template-columns: 1fr; }
  .annotation-tools select, .annotation-actions, .annotation-list { grid-column: 1; }
  .annotation-actions button { flex: 1; }
  .gesture-hint { font-size: 9px; }
  .presentation-toggle { min-height: 32px; }
  .partner-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .partner-controls > * { min-width: 0; }
  .partner-controls select { width: 100%; }
  .partner-progress-grid { grid-column: 1 / -1; }
  .partner-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-height: 760px) and (max-width: 680px) {
  .app-header h1 { font-size: 23px; }
  .eyebrow { display: none; }
  .app-header { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .deck-toolbar { margin-bottom: 7px; }
  .card-detail { padding-block: 7px; }
  .note-row textarea { max-height: 54px; }
  .rating-controls { margin-top: 7px; }
  .utility-controls { margin-top: 6px; }
  .overlay-header strong { font-size: 18px; }
  .reaction-overlay .reaction-group button { min-height: 30px; padding: 4px 7px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
