:root {
  color-scheme: light;
  --paper: #f6f6f3;
  --surface: #fff;
  --ink: #242623;
  --muted: #74796f;
  --line: #e2e4dd;
  --accent: #a96943;
  --canvas: #191b19;
  --serif: 'Iowan Old Style', 'Baskerville', 'Songti SC', 'STSong', Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .35; }
button { transition: transform .2s, background .2s, color .2s, opacity .2s, box-shadow .2s; }
button:active:not(:disabled) { transform: scale(.96); }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); font-size: .875rem; }
.accent { color: var(--accent); }
.app-shell { max-width: 1640px; margin: auto; padding: 0 64px; }
.site-header { height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: flex; }
.brand-mark svg { width: 32px; height: 32px; stroke-width: 1.25; }
.brand-mark svg rect:first-child { fill: var(--paper); }
.brand-mark svg rect:last-child { fill: #fff; }
.brand>span:last-child { font-family: var(--serif); font-size: 1.375rem; letter-spacing: .035em; font-weight: 500; }
.brand small { display: block; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: .75rem; letter-spacing: .15em; margin-top: 5px; color: var(--muted); font-weight: 400; }
.header-right { display: flex; align-items: center; gap: 22px; }
.save-status { font-size: .75rem; color: var(--muted); }
.save-status.error { color: #b14c51; }
.role-switch { border: 1px solid var(--line); background: #fff; border-radius: 32px; padding: 7px 13px 7px 7px; display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.role-switch .mini-avatar { display: flex; align-items: center; justify-content: center; border-radius: 50%; width: 30px; height: 30px; font: 1rem var(--serif); }
.role-switch svg { width: 14px; height: 14px; margin-left: 2px; color: var(--muted); }
.navigation { display: flex; gap: 4px; padding: 5px; border: 1px solid #e2e4de; background: #edeee8; border-radius: 36px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 10px 22px; font-size: .875rem; color: #777b73; border-radius: 30px; transition: color .15s, background .15s; }
.nav-item.active { color: var(--ink); background: #fff; box-shadow: 0 2px 6px #31392c0b; }
.nav-item:disabled, .role-switch:disabled { opacity: 1; }
.nav-count { padding: 2px 6px; font-size: .75rem; color: var(--accent); border-radius: 20px; background: #f4ece6; }
.eyebrow { color: #8b8e86; font-size: .75rem; font-weight: 500; letter-spacing: .15em; margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }
.edition-line { display: inline-block; width: 32px; height: 1px; background: var(--accent); }
.entrance { display: grid; grid-template-columns: 1.08fr 1fr; gap: clamp(50px,7vw,112px); min-height: calc(100svh - 155px); padding: 60px 24px 70px; align-items: center; }
.entrance-copy { grid-column: 2; grid-row: 1; max-width: 540px; }
.entrance h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.25rem,3.2vw,3.25rem); line-height: 1.55; letter-spacing: -.035em; margin: 28px 0 0; }
.entrance h1 em { font-family: 'Baskerville', Georgia, serif; font-size: 1.5em; font-weight: 400; color: var(--accent); line-height: .8; }
.entrance-caption { color: #888b84; font-size: .9375rem; margin: 25px 0 40px; letter-spacing: .03em; line-height: 1.8; }
.role-choices { display: flex; flex-direction: column; gap: 14px; max-width: 415px; }
.role-choice { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-align: left; padding: 20px 23px; box-shadow: 0 4px 16px #39412b03; transition: transform .2s, box-shadow .2s, border-color .2s; }
.role-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: #b8bcb2; box-shadow: 0 7px 24px #343c2c0b; }
.role-monogram { font: italic 1.6rem var(--serif); width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.pipi { background: #edf0e9; color: #637257; }
.baobao { background: #f7eeea; color: #aa745f; }
.role-choice strong { font-size: 1rem; font-weight: 500; letter-spacing: .05em; }
.role-choice small { display: block; margin-top: 7px; color: var(--muted); font-size: .875rem; }
.role-enter { margin-left: auto; color: var(--muted); font-size: .8125rem; }
.entrance-steps { margin-top: 34px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; color: #777c72; font-size: .8125rem; }
.entrance-steps b { font: 1rem var(--serif); font-weight: 400; color: var(--accent); margin-right: 7px; }
.step-divider { display: inline-block; width: 12px; height: 1px; background: #c9cdc2; }
.local-note { font-size: .75rem; color: #969b8e; display: flex; align-items: center; gap: 6px; margin: 27px 0 0; }
.local-note svg { width: 13px; height: 13px; }
.photo-collage { grid-column: 1; grid-row: 1; height: 570px; position: relative; isolation: isolate; }
.photo-collage::before { content: ''; position: absolute; width: 81%; height: 83%; top: 8%; left: 5%; background: #e7e9e0; border-radius: 170px 170px 6px 6px; }
.collage-photo { position: absolute; padding: 10px 10px 18px; background: #fff; box-shadow: 0 14px 50px #2c362525; }
.collage-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collage-photo small { display: block; color: #93988c; font: .75rem var(--serif); letter-spacing: .15em; text-align: center; margin-top: 14px; }
.collage-photo:nth-child(1) { z-index: 2; width: 85%; left: 1%; top: 14%; transform: rotate(-5deg); }
.collage-photo:nth-child(1) img { height: 305px; }
.collage-photo:nth-child(2) { z-index: 3; width: 31%; top: 0; right: 6%; transform: rotate(8deg); padding: 7px 7px 12px; }
.collage-photo:nth-child(2) img { height: 200px; }
.collage-photo:nth-child(3) { z-index: 4; width: 35%; bottom: 0; right: 1%; transform: rotate(5deg); padding: 7px 7px 12px; }
.collage-photo:nth-child(3) img { height: 235px; }
.collage-photo:nth-child(n+2) small { margin-top: 9px; font-size: .75rem; letter-spacing: .1em; }
.workspace, .gallery-view { max-width: 1232px; margin: auto; padding: 28px 0 20px; }
.entrance, .workspace, .gallery-view { animation: surface-enter .38s cubic-bezier(.22,1,.36,1) both; }
@keyframes surface-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.workspace-heading .eyebrow { margin-bottom: 8px; font-size: .75rem; }
.workspace-heading h1 { font-family: var(--serif); font-size: 1.875rem; line-height: 1.35; letter-spacing: .035em; font-weight: 500; margin: 0; }
.stage-progress { text-align: right; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.stage-progress strong { font: 1.9rem var(--serif); color: var(--ink); margin-right: 3px; }
.stage-progress>span { display: block; font-size: .75rem; margin-top: 3px; }
.progress-track { width: 150px; height: 3px; border-radius: 4px; background: #e0e3d9; overflow: hidden; margin-top: 7px; }
.progress-fill { height: 100%; background: #919d82; transition: width .25s; }
.screen-controls, .review-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.segmented { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.segmented button { font-size: .875rem; color: #91948c; padding: 9px 16px; border-radius: 25px; transition: background .15s, color .15s; }
.segmented button.active { color: #394032; background: #e9ece3; }
.segmented button:disabled { opacity: .85; }
.segmented button span { color: #7e8873; font-variant-numeric: tabular-nums; font-size: .75rem; margin-left: 6px; }
.gesture-guide { color: #999f93; font-size: .75rem; }
.review-controls label { display: flex; align-items: center; gap: 10px; color: #969b90; font-size: .875rem; }
.review-controls select { appearance: auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 9px 13px 9px 15px; color: #545b4f; font-size: .875rem;; }
.review-controls>.text-button { margin-right: auto; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .8125rem; color: #858c7c; padding: 8px 0; }
.text-button:hover:not(:disabled) { color: var(--ink); }
.review-layout { display: flex; gap: 24px; align-items: flex-start; }
.viewer { min-width: 0; flex: 1; display: flex; gap: 12px; position: relative; overflow: clip; overflow-clip-margin: 12px; }
.photo-deck { position: relative; width: 100%; height: clamp(290px,calc(100svh - 386px),640px); isolation: isolate; container-type: size; --deck-space-x: 60px; --deck-space-y: 32px; --image-space-x: 18px; --image-space-y: 40px; }
/* Fit the frame to the complete photo, with only a narrow edge and caption. */
.photo-card { position: absolute; inset: 7px 0 25px; margin: auto; width: min(calc(100cqw - var(--deck-space-x)),calc((100cqh - var(--deck-space-y) - var(--image-space-y)) * var(--photo-aspect,1.5) + var(--image-space-x))); height: min(calc(100cqh - var(--deck-space-y)),calc((100cqw - var(--deck-space-x) - var(--image-space-x)) / var(--photo-aspect,1.5) + var(--image-space-y))); background: var(--canvas); border-radius: 18px; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; border: 1px solid #ffffffc4; padding: 0; box-shadow: 0 12px 28px #27352424, 0 2px 6px #27352415; z-index: 3; transform-origin: 50% 75%; will-change: transform; }
.photo-card.next-card { z-index: 2; pointer-events: none; transform: translate3d(-15px,12px,0) rotate(-3deg) scale(.98); }
.photo-card { container: photo-frame / inline-size; }
.photo-card.far-card { z-index: 1; pointer-events: none; transform: translate3d(16px,25px,0) rotate(3deg) scale(.95); }
.photo-card>.card-ambient { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); display: block; object-fit: cover; filter: blur(22px) brightness(.65) saturate(.85); pointer-events: none; }
.photo-card::after { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg,#111c1d12 60%,#101a19b0); pointer-events: none; }
.photo-card>.photo-image, .photo-card>.photo-placeholder { position: absolute; top: 8px; left: 8px; width: calc(100% - 16px); height: calc(100% - 38px); object-fit: contain; display: block; z-index: 1; pointer-events: none; }
.photo-card>.photo-image { opacity: 0; }
.photo-card.has-preview>.photo-image { opacity: 1; }
.photo-card.has-preview>.photo-placeholder { opacity: 0; }
.photo-card.next-card>.photo-image, .photo-card.far-card>.photo-image { opacity: 0; }
.photo-card.next-card>.photo-placeholder, .photo-card.far-card>.photo-placeholder { opacity: 1; filter: blur(3px) brightness(.82); }
.photo-card.next-card .photo-caption, .photo-card.far-card .photo-caption { opacity: 0; }
.photo-card:focus-visible { outline: 2px solid #788f8270; outline-offset: 3px; }
.photo-card:active { cursor: grabbing; }
.photo-loading { position: absolute; bottom: 45px; left: 50%; transform: translateX(-50%); z-index: 2; border-radius: 20px; background: #191b19bd; padding: 7px 12px; color: #c0c6b8; font-size: .75rem; white-space: nowrap; pointer-events: none; }
.photo-tools { position: absolute; z-index: 3; top: 16px; right: 16px; display: flex; gap: 7px; }
.photo-tools button { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border: 1px solid #ffffff45; border-radius: 25px; color: #fff; background: #172220b8; font-size: .8125rem; }
.photo-tools svg { width: 17px; height: 17px; }
.photo-tools button.active { background: #dcd4ba; color: #444638; border-color: #dcd4ba; }
.photo-caption { position: absolute; bottom: 9px; left: 14px; right: 14px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #d1d5ca; font-size: .75rem; letter-spacing: .04em; pointer-events: none; }
.photo-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-index { flex: none; }
.photo-caption span:last-child { color: #c1cdc7; font-size: .75rem; }
.swipe-label { position: absolute; top: 52px; left: 35px; z-index: 4; border: 2px solid currentColor; border-radius: 8px; padding: 10px 22px; color: #d8efc2; background: #1a241ac2; font-size: 1.75rem; font-weight: 600; opacity: 0; transform: rotate(-12deg); pointer-events: none; }
.swipe-label.keep { color: #adf2d3; background: #0f5b43cf; }
.swipe-label.skip { color: #ffd3cf; background: #a03739cf; left: auto; right: 35px; transform: rotate(12deg); }
.decision-actions { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 22px 0 6px; }
.decision { display: flex; gap: 10px; align-items: center; justify-content: center; border-radius: 36px; min-width: 140px; height: 52px; padding: 12px 23px; border: 1px solid #dde2d6; background: #fff; box-shadow: 0 3px 7px #2c352105; font-size: .9375rem; transition: transform .15s, box-shadow .15s; }
.decision:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px #2c352112; }
.decision-icon { display: flex; align-items: center; }
.decision-icon svg { width: 22px; height: 22px; }
.decision-copy, .action-copy { display: flex; align-items: center; justify-content: center; gap: 14px; white-space: nowrap; }
.decision kbd, .final-actions kbd { display: inline-flex; justify-content: center; align-items: center; min-width: 28px; height: 26px; padding: 2px 7px; border: 1px solid #d8ddd1; border-bottom-width: 2px; border-radius: 6px; background: #f3f5ee; color: #59634f; font: 500 .75rem -apple-system, sans-serif; }
.action-shortcuts { display: inline-flex; align-items: center; gap: 5px; }
.action-shortcuts>span { color: #959d89; font-size: .75rem; }
.decision.reject { background: #d94e55; border-color: #d94e55; color: #fff; box-shadow: 0 5px 15px #d94e5526; }
.decision.keep { background: #20835e; border-color: #20835e; color: #fff; box-shadow: 0 5px 15px #20835e26; }
.decision.reject kbd, .decision.keep kbd, .final-actions #add-final kbd { color: #fff; border-color: #ffffff66; background: #ffffff1c; }
.decision.is-feedback, .final-actions .is-feedback { transform: scale(.95); opacity: 1; }
.decision.reject.is-feedback { box-shadow: 0 0 0 5px #d94e5520; }
.decision.keep.is-feedback { box-shadow: 0 0 0 5px #20835e20; }
.workspace[data-motion=exiting] .decision:disabled:not(.is-feedback), .workspace[data-motion=entering] .decision:disabled { opacity: .75; }
.undo-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #92998a; font-size: .8125rem; padding: 12px; }
.undo-button svg { width: 18px; height: 18px; }
.keyboard-hint { display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center; font-size: .75rem; line-height: 1.6; color: #68715f; margin: 12px 0 0; }
.keyboard-hint>svg { width: 17px; height: 17px; color: #7b866e; }
.hint-extra { color: #949d88; }
.primary, .secondary { border-radius: 30px; padding: 13px 24px; font-size: .875rem; font-weight: 500; min-height: 46px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; transition: transform .15s, background .15s; }
.primary { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.primary:hover:not(:disabled) { background: #40483a; }
.secondary { background: #fff; color: #707a63; border: 1px solid #dce1d5; }
.secondary:hover:not(:disabled) { background: #eef1e8; }
.final-panel { order: 2; flex: none; width: 254px; background: #fff; border: 1px solid #e3e7dc; border-radius: 16px; padding: 20px; }
.final-panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; font-size: .75rem; letter-spacing: .08em; color: #92998a; }
.final-panel-title>span small { display: block; font-size: .9375rem; letter-spacing: .03em; color: #4a5440; margin-top: 7px; }
.final-panel-title strong { font: 2.25rem var(--serif); color: var(--ink); letter-spacing: -.04em; white-space: nowrap; }
.final-panel-title strong small { font: .75rem -apple-system, sans-serif; color: #9ca393; letter-spacing: 0; }
.nine-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.nine-slot { aspect-ratio: 1; border: 1px dashed #d7ddd0; border-radius: 7px; background: #f7f8f3; position: relative; overflow: hidden; color: #c0c8b6; font: italic 1.3rem var(--serif); padding: 0; display: flex; align-items: center; justify-content: center; }
.nine-slot.filled { border: 0; }
.nine-slot:disabled { opacity: 1; }
.nine-slot-view { width: 100%; height: 100%; padding: 0; border-radius: inherit; overflow: hidden; }
.nine-slot-view:disabled { opacity: 1; }
.nine-slot-view:focus-visible { outline-offset: -3px; }
.nine-slot-remove { position: absolute; top: 2px; right: 2px; z-index: 1; width: 24px; height: 24px; padding: 5px; border: 1px solid #ffffff66; border-radius: 50%; background: #161f15b3; color: #fff; display: flex; align-items: center; justify-content: center; }
.nine-slot-remove svg { width: 12px; height: 12px; flex: none; }
.nine-slot-remove:hover:not(:disabled) { background: #b94747; }
.nine-slot-remove:focus-visible { outline-color: #fff; outline-offset: -3px; }
.nine-slot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.nine-slot-view:hover img { transform: scale(1.06); }
.nine-slot.filled span { position: absolute; left: 4px; bottom: 4px; background: #161f1599; color: #fff; font: .75rem var(--serif); border-radius: 3px; padding: 2px 4px; }
.final-panel-info p { font-size: .8125rem; line-height: 1.7; color: #7e8973; margin: 17px 0 14px; }
.export-button { width: 100%; padding: 12px 8px; font-size: .875rem; }
.final-panel-info>.text-button { display: flex; width: 100%; font-size: .75rem; margin-top: 5px; }
.other-progress { font-size: .75rem; color: #849276; line-height: 1.8; padding-top: 14px; border-top: 1px solid var(--line); margin: 14px 0 0; }
.photo-opinions { display: flex; justify-content: center; gap: 10px; margin-top: 15px; }
.opinion-chip { font-size: .75rem; color: #98a18d; padding: 5px 11px; border-radius: 20px; background: #edeFE7; }
.opinion-chip.keep { color: #6d7d59; background: #e6eddf; }
.final-actions { display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: 16px; }
.final-actions .primary, .final-actions .secondary { min-width: 155px; }
.final-actions #review-next { background: #e8edff; border-color: #cdd7f6; color: #415695; }
.final-actions #review-next kbd { background: #ffffff9c; border-color: #bdc9ee; color: #415695; }
.final-actions #add-final { background: #20835e; border-color: #20835e; color: #fff; box-shadow: 0 5px 15px #20835e20; }
.final-actions #add-final:hover:not(:disabled) { background: #1a7351; }
.workspace[data-mode=final] .photo-opinions, .workspace[data-mode=final] .keyboard-hint, .workspace[data-mode=final] .final-actions, .workspace[data-mode=final] .candidate-strip { width: calc(100% - 278px); }
.candidate-strip { display: flex; gap: 7px; overflow-x: auto; padding: 8px 3px 10px; margin-top: 18px; scrollbar-width: thin; scrollbar-color: #cbd4bf transparent; }
.strip-photo { width: 54px; height: 68px; flex: none; padding: 0; border-radius: 5px; overflow: hidden; position: relative; opacity: .65; border: 2px solid transparent; }
.strip-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-photo.active { opacity: 1; border-color: #7e8e6b; box-shadow: 0 0 0 2px #e0e7d6; }
.strip-photo.selected { opacity: 1; }
.strip-photo:disabled { opacity: .65; }
.strip-photo.active:disabled, .strip-photo.selected:disabled { opacity: 1; }
.strip-photo.selected::after { content: '✓'; position: absolute; bottom: 3px; right: 3px; display: flex; align-items: center; justify-content: center; width: 17px; height: 17px; font-size: .75rem; border-radius: 50%; background: #f4f6eb; color: #5a6b47; }
.compare-area { width: calc(50% - 6px); height: clamp(290px,calc(100svh - 386px),640px); background: var(--canvas); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid #777e68; }
.viewer.comparing .photo-deck { width: calc(50% - 6px); }
.compare-label { display: flex; justify-content: space-between; align-items: center; color: #bec8ad; padding: 10px 16px; font-size: .75rem; flex: none; }
.compare-label button { display: flex; padding: 3px; color: #a5b88c; }
.compare-image-button { flex: 1; min-height: 0; height: 0; padding: 0 12px; overflow: hidden; }
.compare-image-button img { width: 100%; height: 100%; display: block; object-fit: contain; }
.compare-filename { padding: 12px 16px; font-size: .75rem; letter-spacing: .04em; color: #c3ceb6; flex: none; }
.empty-state { width: 100%; height: clamp(290px,calc(100svh - 410px),640px); min-height: 300px; display: flex; align-items: center; justify-content: center; flex-direction: column; background: #edeee8; border-radius: 16px; padding: 30px; text-align: center; }
.empty-mark { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; background: #e0e7d5; color: #87996d; border-radius: 50%; margin-bottom: 10px; }
.empty-mark svg { width: 24px; height: 24px; }
.empty-state h2 { font: 1.6rem var(--serif); font-weight: 500; margin: 12px 0 0; }
.empty-state p { color: #929b85; font-size: .875rem; line-height: 1.9; max-width: 430px; margin: 16px 0 24px; }
#empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 26px; }
.search-field { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 10px 15px; color: #a3aa99; }
.search-field svg { width: 17px; height: 17px; }
.search-field input { background: none; border: 0; outline: 0; color: var(--ink); width: 175px; font-size: .875rem; min-width: 0; }
.search-field input::placeholder { color: #a4ac99; }
.gallery-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 25px 18px; }
.gallery-photo { padding: 0; text-align: left; min-width: 0; }
.gallery-image { position: relative; aspect-ratio: 4/5; overflow: hidden; border-radius: 9px; background: #e7eadd; }
.gallery-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery-photo:hover img { transform: scale(1.025); }
.gallery-badge { position: absolute; top: 9px; right: 9px; border-radius: 20px; padding: 5px 9px; font-size: .75rem; color: #fff; background: #27351ed6; backdrop-filter: blur(6px); }
.gallery-badge.final { color: #fff; background: #97744fdd; }
.gallery-photo>span { display: block; margin-top: 10px; font-size: .8125rem; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #657256; }
.gallery-photo small { display: block; font-size: .75rem; color: #9aa58b; margin-top: 5px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); min-height: 58px; gap: 12px; font-size: .75rem; color: #a1ac94; }
.site-footer .text-button { font-size: .75rem; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); max-width: min(92%,600px); border-radius: 12px; z-index: 100; background: #2e3b23; color: #f6f8ef; box-shadow: 0 5px 25px #1c271d30; padding: 15px 23px; font-size: .875rem; line-height: 1.6; }
.toast.error { background: #7f4f48; }
dialog { border: 0; color: var(--ink); background: #f8f9f4; padding: 0; border-radius: 20px; max-width: 95vw; box-shadow: 0 20px 100px #0915033d; }
dialog::backdrop { background: #10180eda; backdrop-filter: blur(8px); }
dialog[open] { animation: dialog-enter .26s cubic-bezier(.22,1,.36,1); }
dialog[open]::backdrop { animation: backdrop-enter .25s ease-out; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
.app-shell { touch-action: pan-x pan-y; }
.zoom-dialog[open] { display: flex; flex-direction: column; }
.zoom-dialog { touch-action: pan-x pan-y; width: 96vw; height: 94svh; max-width: 1700px; max-height: 94svh; background: #171e13; color: #e8efdc; overflow: hidden; }
.zoom-toolbar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; height: 72px; border-bottom: 1px solid #ffffff14; }
.zoom-heading { min-width: 0; display: grid; gap: 4px; }
.zoom-heading strong { font-size: .875rem; font-weight: 500; }
.zoom-heading>span { font-size: .75rem; color: #a9b898; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-actions { display: flex; flex: none; gap: 9px; }
.zoom-toolbar .secondary { background: #243019; border-color: #3b4a2d; color: #c9d7b5; font-size: .8125rem; min-height: 38px; padding: 9px 14px; }
.zoom-toolbar svg { width: 17px; height: 17px; }
.zoom-scroll { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden; touch-action: none; overscroll-behavior: none; user-select: none; }
.zoom-scroll img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; object-fit: contain; transform: translate(-50%,-50%); transform-origin: center; pointer-events: none; }
.zoom-scroll.zoomed { cursor: grab; }
.zoom-scroll.gesturing { cursor: grabbing; }
.original-tools { position: absolute; left: 50%; bottom: max(14px,env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 28px); }
.original-button { min-height: 34px; padding: 7px 12px; border: 1px solid #ffffffd9; border-radius: 7px; background: #152012a6; color: #fff; font-size: .75rem; line-height: 1.5; backdrop-filter: blur(6px); }
.original-button:disabled { opacity: .8; cursor: default; }
.original-progress { width: 200px; max-width: 100%; padding: 10px 12px; border: 1px solid #ffffff3d; border-radius: 8px; background: #152012e6; color: #fff; font-size: .7rem; line-height: 1.6; }
.original-progress.error { color: #ffcdc5; }
.original-progress progress { display: block; width: 100%; height: 5px; margin-top: 7px; accent-color: #fff; }
.original-progress progress::-webkit-progress-bar { background: #ffffff30; border-radius: 4px; }
.original-progress progress::-webkit-progress-value { background: #fff; border-radius: 4px; }
.original-progress progress::-moz-progress-bar { background: #fff; border-radius: 4px; }
.photo-tap-hint { display: none; position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 5px 10px; border-radius: 20px; background: #192214b8; color: #e8efdc; font-size: .7rem; white-space: nowrap; pointer-events: none; }
.zoom-note { flex: none; font-size: .75rem; color: #8b9c71; margin: 0; padding: 6px 12px; height: 38px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.zoom-note button { font-size: .75rem; color: #c1ceb2; padding: 5px 8px; border-radius: 6px; }
.zoom-note button:hover:not(:disabled) { background: #ffffff10; }
.slot-dialog { width: 430px; padding: 28px; max-height: 90svh; overflow: auto; }
.dialog-close { position: absolute; top: 14px; right: 14px; display: flex; padding: 5px; color: #909e7e; }
.slot-dialog>img { width: 100%; height: 40svh; object-fit: contain; display: block; margin: 18px 0; background: #192214; border-radius: 9px; }
.slot-dialog h2 { font-size: 1rem; font-weight: 500; letter-spacing: .03em; }
.slot-actions { display: flex; flex-direction: column; gap: 11px; margin-top: 18px; }
.fatal-error { position: fixed; z-index: 200; inset: 0; background: var(--paper); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 35px; text-align: center; }
.fatal-error h2 { font: 1.75rem var(--serif); }
.fatal-error p { max-width: 550px; font-size: .9375rem; color: #8d9d7c; line-height: 1.9; margin-bottom: 25px; }
@media (min-width:1100px) {
  .workspace[data-mode=final] .photo-deck, .workspace[data-mode=final] .empty-state, .workspace[data-mode=final] .compare-area { height: clamp(280px,calc(100svh - 465px),600px); }
}
@media (max-width:1100px) {
  .app-shell { padding: 0 32px; }
  .entrance { padding: 50px 0; gap: 48px; }
  .entrance h1 { font-size: 2.35rem; }
  .photo-collage { height: 490px; }
  .collage-photo:nth-child(1) img { height: 260px; }
  .collage-photo:nth-child(2) img { height: 170px; }
  .collage-photo:nth-child(3) img { height: 190px; }
  .nav-item { padding: 10px 17px; }
  .save-status { display: none; }
  .final-panel { width: 220px; padding: 16px; }
  .workspace[data-mode=final] .photo-opinions, .workspace[data-mode=final] .keyboard-hint, .workspace[data-mode=final] .final-actions, .workspace[data-mode=final] .candidate-strip { width: calc(100% - 244px); }
  .gallery-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .photo-tap-hint { display: block; }
  .app-shell { padding: 0 20px; }
  .site-header { height: 76px; gap: 12px; position: relative; }
  .brand { gap: 9px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .brand>span:last-child { font-size: 1.125rem; }
  .brand small { font-size: .75rem; letter-spacing: .08em; margin-top: 4px; }
  .header-right { gap: 0; }
  .role-switch { padding: 5px 9px 5px 5px; gap: 5px; font-size: .8125rem; }
  .role-switch .mini-avatar { width: 25px; height: 25px; font-size: .875rem; }
  .role-switch svg { width: 12px; height: 12px; }
  .navigation { position: absolute; top: 85px; left: 0; right: 0; z-index: 8; height: 43px; padding: 4px; gap: 2px; }
  .nav-item { flex: 1; justify-content: center; padding: 7px 8px; font-size: .875rem; white-space: nowrap; }
  .nav-count { font-size: .75rem; padding: 2px 5px; }
  .app-shell.entered .site-header { margin-bottom: 55px; }
  .eyebrow { font-size: .75rem; letter-spacing: .12em; }
  .entrance { display: flex; flex-direction: column; gap: 0; min-height: 0; padding: 0 0 40px; }
  .entrance-copy { display: contents; }
  .entrance-copy>.eyebrow { order: 1; width: 100%; margin: 32px 0 0; }
  .entrance h1 { order: 2; width: 100%; font-size: 1.875rem; line-height: 1.5; margin: 16px 0 0; }
  .entrance h1 em { font-size: 1.45em; }
  .entrance-caption { order: 3; width: 100%; font-size: .875rem; margin: 18px 0 0; }
  .photo-collage { order: 4; width: 100%; max-width: 420px; height: 250px; margin: 26px 0 25px; }
  .photo-collage::before { width: 85%; height: 90%; top: 0; left: 1%; border-radius: 100px 100px 5px 5px; }
  .collage-photo:nth-child(1) { width: 78%; left: 2%; top: 0; padding: 7px 7px 12px; }
  .collage-photo:nth-child(1) img { height: 160px; }
  .collage-photo:nth-child(1) small { font-size: .75rem; margin-top: 10px; }
  .collage-photo:nth-child(2) { width: 25%; right: 0; top: 17px; padding: 5px 5px 10px; }
  .collage-photo:nth-child(2) img { height: 110px; }
  .collage-photo:nth-child(2) small { display: none; }
  .collage-photo:nth-child(3) { width: 27%; right: 11%; bottom: 0; padding: 5px 5px 10px; }
  .collage-photo:nth-child(3) img { height: 125px; }
  .collage-photo:nth-child(3) small { display: none; }
  .role-choices { order: 5; width: 100%; max-width: 420px; gap: 11px; }
  .role-choice { padding: 15px 18px; gap: 14px; border-radius: 13px; }
  .role-monogram { width: 44px; height: 44px; font-size: 1.4rem; }
  .role-choice strong { font-size: .9375rem; }
  .role-choice small { font-size: .8125rem; margin-top: 5px; }
  .role-enter { font-size: .8125rem; }
  .entrance-steps { order: 6; width: 100%; justify-content: center; margin-top: 27px; gap: 10px; font-size: .75rem; }
  .entrance-steps b { font-size: .875rem; margin-right: 4px; }
  .step-divider { width: 8px; }
  .local-note { order: 7; justify-content: center; margin-top: 20px; font-size: .75rem; }
  .workspace, .gallery-view { padding-top: 13px; padding-bottom: 20px; }
  .workspace-heading { gap: 12px; margin-bottom: 14px; align-items: center; }
  .workspace-heading .eyebrow { display: none; }
  .workspace-heading h1 { font-size: 1.375rem; letter-spacing: .015em; line-height: 1.35; }
  .stage-progress { font-size: .75rem; }
  .stage-progress strong { font-size: 1.5rem; }
  .progress-track { width: 85px; height: 2px; margin-top: 5px; }
  .stage-progress>span { font-size: .75rem; margin-top: 0; }
  .workspace[data-mode=final] .stage-progress { display: none; }
  .screen-controls, .review-controls { gap: 7px; margin-bottom: 13px; }
  .screen-controls .segmented { gap: 2px; }
  .segmented button { padding: 8px 12px; font-size: .875rem; }
  .segmented button span { margin-left: 4px; font-size: .75rem; }
  .gesture-guide { display: none; }
  .review-controls label { font-size: .875rem; gap: 7px; }
  .review-controls select { font-size: .875rem; padding: 8px 10px 8px 12px; }
  .review-controls .text-button { margin: 0 0 0 auto; font-size: .8125rem; }
  #review-pool-count { display: none; }
  .review-layout { flex-direction: column; gap: 14px; }
  .viewer { width: 100%; }
  .photo-deck { height: clamp(230px,calc(100svh - 369px),550px); min-height: 0; --deck-space-x: 38px; --deck-space-y: 39px; --image-space-x: 16px; }
  .photo-card { inset: 7px 0 32px; padding: 0; border-radius: 17px; box-shadow: 0 8px 18px #27352425; }
  .photo-card>.photo-image, .photo-card>.photo-placeholder { top: 7px; left: 7px; width: calc(100% - 14px); height: calc(100% - 38px); }
  .swipe-label { font-size: 1.3rem; padding: 8px 15px; left: 22px; top: 52px; }
  .swipe-label.skip { right: 22px; }
  .photo-tools { top: 10px; right: 10px; gap: 5px; }
  .photo-tools button { padding: 8px; border-radius: 50%; height: 34px; width: 34px; }
  .photo-tools button span { display: none; }
  .photo-tools svg { width: 17px; height: 17px; }
  .photo-caption { font-size: .75rem; bottom: 10px; left: 13px; right: 13px; letter-spacing: .04em; }
  .photo-caption span:last-child { font-size: .75rem; }
  .decision-actions { gap: 9px; padding: 18px 0 5px; }
  .decision { flex: 1; min-width: 0; height: 56px; padding: 7px 10px; font-size: .875rem; gap: 7px; box-shadow: none; }
  .decision-icon svg { width: 19px; height: 19px; }
  .decision-copy, .action-copy { flex-direction: column; gap: 4px; }
  .decision kbd, .final-actions kbd { height: 19px; min-width: 23px; padding: 0 5px; border-radius: 4px; font-size: .65rem; }
  .undo-button { padding: 10px 3px; flex: none; }
  .undo-button>span { display: none; }
  .undo-button svg { width: 20px; height: 20px; }
  .keyboard-hint { margin-top: 9px; font-size: .65rem; gap: 5px; min-height: 22px; }
  .keyboard-hint>svg { width: 15px; height: 15px; }
  .hint-extra { display: none; }
  .final-panel { order: 0; width: 100%; display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 0 16px; border-radius: 12px; padding: 13px; }
  .nine-grid { grid-row: 1/3; grid-column: 1; gap: 4px; }
  .nine-grid { width: 104px; height: 104px; align-self: center; }
  .nine-slot { border-radius: 4px; font-size: 1rem; }
  .nine-slot.filled span { display: none; }
  .final-panel-title { grid-column: 2; margin: 0 0 7px; font-size: .75rem; letter-spacing: .06em; gap: 5px; }
  .final-panel-title>span { font-size: 0; }
  .final-panel-title>span small { font-size: .875rem; letter-spacing: 0; margin-top: 0; }
  .final-panel-title strong { font-size: 1.875rem; line-height: 1; }
  .final-panel-title strong small { font-size: .75rem; }
  .final-panel-info { grid-column: 2; }
  .final-panel-info p { font-size: .75rem; line-height: 1.6; margin: 0 0 9px; }
  .export-button { min-height: 33px; padding: 7px 10px; font-size: .8125rem; }
  .final-panel-info>.text-button, .other-progress { display: none; }
  .workspace[data-mode=final] .photo-deck, .workspace[data-mode=final] .empty-state { height: clamp(170px,calc(100svh - 549px),380px); min-height: 0; }
  .workspace[data-mode=final] .photo-opinions, .workspace[data-mode=final] .keyboard-hint, .workspace[data-mode=final] .final-actions, .workspace[data-mode=final] .candidate-strip { width: 100%; }
  .photo-opinions { margin-top: 10px; gap: 8px; }
  .opinion-chip { font-size: .75rem; padding: 4px 10px; }
  .final-actions { margin-top: 9px; gap: 9px; }
  .final-actions .primary, .final-actions .secondary { min-width: 0; flex: 1; font-size: .875rem; padding: 7px 8px; min-height: 56px; height: 56px; }
  .action-copy { line-height: 1.2; }
  .candidate-strip { margin-top: 16px; gap: 6px; padding: 5px 2px 9px; }
  .strip-photo { width: 42px; height: 54px; }
  .strip-photo.selected::after { width: 15px; height: 15px; right: 2px; bottom: 2px; }
  .viewer.comparing { flex-direction: column; }
  .viewer.comparing .photo-deck { width: 100%; height: 31svh; min-height: 190px; }
  .compare-area { width: 100%; height: 28svh; min-height: 180px; border-radius: 12px; }
  .compare-label { padding: 6px 11px; }
  .compare-label svg { width: 16px; height: 16px; }
  .compare-filename { padding: 7px 12px; }
  .empty-state { height: clamp(250px,calc(100svh - 370px),540px); min-height: 230px; padding: 24px; border-radius: 12px; }
  .empty-state h2 { font-size: 1.375rem; }
  .empty-state p { font-size: .875rem; line-height: 1.7; }
  .gallery-toolbar { gap: 15px; margin-bottom: 22px; }
  .gallery-toolbar .segmented { gap: 0; width: 100%; }
  .gallery-toolbar .segmented button { font-size: .875rem; padding: 7px 9px; }
  .search-field { width: 100%; padding: 10px 14px; }
  .search-field input { width: 100%; }
  .gallery-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 9px; }
  .gallery-image { border-radius: 6px; }
  .gallery-photo>span { font-size: .75rem; margin-top: 7px; }
  .gallery-photo small { font-size: .75rem; }
  .gallery-badge { top: 5px; right: 5px; padding: 3px 5px; font-size: .75rem; }
  .site-footer { font-size: .75rem; padding-bottom: env(safe-area-inset-bottom); min-height: 55px; }
  .site-footer .text-button { font-size: .75rem; }
  .toast { font-size: .8125rem; padding: 13px 19px; bottom: calc(18px + env(safe-area-inset-bottom)); }
  .zoom-toolbar { height: 63px; padding: 10px 12px; }
  .zoom-heading strong { font-size: .8125rem; }
  .zoom-toolbar .secondary { padding: 8px 11px; font-size: .75rem; }
  .zoom-toolbar .secondary svg { width: 15px; height: 15px; }
  .zoom-note { flex: none; font-size: .75rem; line-height: 1.5; padding: 5px; height: 42px; gap: 5px; }
  .zoom-note>span { font-size: .65rem; }
  .zoom-note button { padding: 5px; }
  .slot-dialog { padding: 23px; max-width: 90vw; }
}
@media (max-width:360px) {
  .app-shell { padding: 0 16px; }
  .brand>span:last-child { font-size: 1rem; }
  .brand small { font-size: .75rem; letter-spacing: .025em; }
  .role-switch .mini-avatar { display: none; }
  .role-switch { padding: 8px 10px; }
  .navigation { gap: 0; }
  .nav-item { font-size: .8125rem; padding: 8px 5px; gap: 5px; }
  .nav-count { font-size: .75rem; }
  .entrance h1 { font-size: 1.65rem; }
  .photo-collage { height: 220px; }
  .collage-photo:nth-child(1) img { height: 135px; }
  .collage-photo:nth-child(2) img { height: 95px; }
  .collage-photo:nth-child(3) img { height: 110px; }
  .entrance-steps { gap: 7px; }
  .workspace-heading h1 { font-size: 1.25rem; }
  .workspace-heading .eyebrow { font-size: .75rem; letter-spacing: 0; }
  .stage-progress strong { font-size: 1.375rem; }
  .progress-track { width: 73px; }
  .segmented button { padding: 8px 10px; }
  .decision-actions { gap: 7px; }
  .decision { font-size: .875rem; padding: 7px 8px; gap: 5px; }
  .decision-icon svg { width: 17px; height: 17px; }
  .final-panel { grid-template-columns: 94px minmax(0,1fr); gap: 0 12px; padding: 11px; }
  .nine-grid { width: 94px; height: 94px; }
  .final-panel-title { font-size: .75rem; }
  .final-panel-title strong { font-size: 1.55rem; }
  .final-panel-title>span small { font-size: .8125rem; }
  .final-panel-info p { margin-bottom: 6px; }
  .review-controls label { font-size: .8125rem; gap: 5px; }
  .review-controls select { padding-left: 10px; font-size: .8125rem; }
  .review-controls .text-button { font-size: .8125rem; }
  .workspace[data-mode=final] .photo-deck, .workspace[data-mode=final] .empty-state { height: max(170px,calc(100svh - 539px)); }
  .gallery-toolbar .segmented button { padding: 7px 7px; font-size: .8125rem; }
}
@media (min-width:761px) {
  .workspace[data-mode=final] { display: grid; grid-template-columns: minmax(0,1fr) 254px; column-gap: 24px; }
  .workspace[data-mode=final]>.workspace-heading, .workspace[data-mode=final]>.review-controls { grid-column: 1 / -1; }
  .workspace[data-mode=final]>.review-layout { display: contents; }
  .workspace[data-mode=final] .final-panel { grid-column: 2; grid-row: 3 / 8; align-self: start; }
  .workspace[data-mode=final] .viewer { grid-column: 1; grid-row: 3; }
  .workspace[data-mode=final] .photo-opinions { grid-column: 1; grid-row: 4; }
  .workspace[data-mode=final] .keyboard-hint { grid-column: 1; grid-row: 5; }
  .workspace[data-mode=final] .final-actions { grid-column: 1; grid-row: 6; }
  .workspace[data-mode=final] .candidate-strip { grid-column: 1; grid-row: 7; min-width: 0; }
  .workspace[data-mode=final] .photo-opinions, .workspace[data-mode=final] .keyboard-hint, .workspace[data-mode=final] .final-actions, .workspace[data-mode=final] .candidate-strip { width: 100%; }
}
@media (min-width:761px) and (max-width:1100px) {
  .workspace[data-mode=final] { grid-template-columns: minmax(0,1fr) 220px; }
  .workspace[data-mode=final] .photo-deck, .workspace[data-mode=final] .compare-area { height: clamp(240px,calc(100svh - 445px),520px); }
}
/* Keep the photograph in the space between two compact toolbars. */
.app-shell:is([data-mode=screen],[data-mode=final]) { height: 100dvh; max-width: none; padding-inline: clamp(12px,2vw,32px); display: flex; flex-direction: column; }
.app-shell.entered .site-header { height: 48px; flex: none; gap: 16px; margin-bottom: 0; }
.app-shell.entered .brand { gap: 9px; }
.app-shell.entered .brand-mark svg { width: 24px; height: 24px; }
.app-shell.entered .brand>span:last-child { font-size: 1.1rem; }
.app-shell.entered .brand small { display: none; }
.app-shell.entered .navigation { padding: 3px; }
.app-shell.entered .nav-item { padding: 6px 16px; }
.app-shell.entered .header-right { gap: 12px; }
.app-shell.entered .role-switch { padding: 4px 10px 4px 4px; }
.app-shell.entered .role-switch .mini-avatar { width: 26px; height: 26px; }
.backup-button { padding: 6px; }
.backup-button svg { width: 17px; height: 17px; }
.app-shell:is([data-mode=screen],[data-mode=final]) main { flex: 1; min-height: 0; }
.app-shell:is([data-mode=screen],[data-mode=final]) .site-footer { display: none; }
.app-shell .workspace { position: relative; height: 100%; max-width: none; margin: 0; padding: 4px 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: 32px minmax(0,1fr) 48px; gap: 4px 16px; animation: none; }
.workspace-toolbar { grid-column: 1 / -1; grid-row: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-shell .workspace-heading { margin: 0; gap: 14px; min-width: 0; }
.app-shell .workspace-heading .eyebrow { display: none; }
.app-shell .workspace-heading h1 { font-size: 1rem; line-height: 1.3; letter-spacing: 0; white-space: nowrap; }
.app-shell .stage-progress { font-size: .75rem; }
.app-shell .stage-progress strong { font: 1rem -apple-system, sans-serif; }
.app-shell .progress-track { display: none; }
.app-shell .screen-controls, .app-shell .review-controls { margin: 0; gap: 10px; min-width: 0; }
.app-shell .screen-controls .segmented button { padding: 5px 10px; }
.app-shell .gesture-guide, .app-shell #back-gallery { display: none !important; }
.app-shell .review-controls select { padding: 5px 10px; }
.app-shell .review-controls .text-button { margin: 0; padding: 5px 0; }
.app-shell .workspace .review-layout { display: contents; }
.app-shell .workspace .viewer { grid-column: 1; grid-row: 2; width: 100%; height: 100%; min-height: 0; overflow: hidden; overflow-clip-margin: 0; }
.app-shell .workspace .photo-deck, .app-shell .workspace .compare-area { height: 100%; min-height: 0; }
.app-shell .workspace .photo-deck { --deck-space-x: 32px; --deck-space-y: 16px; --image-space-x: 14px; --image-space-y: 34px; }
.app-shell .workspace .photo-card { inset: 4px 0 12px; border-radius: 14px; }
.app-shell .workspace .photo-card>.photo-image, .app-shell .workspace .photo-card>.photo-placeholder { top: 6px; left: 6px; width: calc(100% - 12px); height: calc(100% - 32px); }
.app-shell .workspace .photo-caption { bottom: 7px; left: 12px; right: 12px; font-size: .75rem; }
.app-shell .workspace .photo-tools { top: 10px; right: 10px; }
.app-shell .workspace .empty-state { height: 100%; min-height: 0; }
.app-shell .workspace .keyboard-hint { position: absolute; grid-area: auto; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; padding: 0; }
.app-shell .workspace .decision-actions, .app-shell .workspace .final-actions { grid-column: 1; grid-row: 3; width: 100%; height: 48px; margin: 0; padding: 0; gap: 12px; }
.app-shell .workspace .decision { height: 44px; padding: 7px 20px; }
.app-shell .workspace .decision-copy, .app-shell .workspace .action-copy { flex-direction: row; gap: 10px; }
.app-shell .workspace .final-actions .primary, .app-shell .workspace .final-actions .secondary { height: 44px; min-height: 44px; padding: 7px 16px; }
.app-shell .workspace .photo-opinions { position: absolute; grid-area: auto; top: 46px; left: 8px; z-index: 5; margin: 0; width: auto; }
.app-shell .opinion-chip { font-size: .7rem; padding: 4px 8px; background: #f6f6f3e8; }
.app-shell .opinion-chip.keep { background: #e6eddfeb; }
.final-panel-content { display: contents; }
.final-panel-toggle { display: none; }
.app-shell .workspace[data-mode=final] { grid-template-columns: minmax(0,1fr) 220px; }
.app-shell .workspace[data-mode=final] .final-panel { grid-column: 2; grid-row: 2; align-self: start; width: 100%; max-height: 100%; overflow-y: auto; padding: 16px; }
.app-shell .workspace[data-mode=final] .candidate-strip { grid-column: 2; grid-row: 3; align-self: center; width: 100%; height: 48px; min-width: 0; margin: 0; padding: 2px 0; }
.app-shell .workspace .strip-photo { width: 32px; height: 44px; }
.app-shell[data-mode=final] .stage-progress { display: none; }
.app-shell .workspace .viewer.comparing .photo-deck { width: calc(50% - 6px); height: 100%; }
.app-shell .toast { bottom: 64px; pointer-events: none; }
@media (max-width:1100px) {
  .app-shell .workspace-heading h1 { font-size: .875rem; }
  .app-shell #review-pool-count { display: none; }
}
@media (max-width:760px) {
  .app-shell.entered .site-header { height: 80px; flex-wrap: wrap; align-content: center; gap: 4px 12px; padding: 4px 0 6px; }
  .app-shell.entered .brand>span:last-child { font-size: 1rem; }
  .app-shell.entered .header-right { margin-left: auto; gap: 6px; }
  .app-shell.entered .role-switch { padding: 4px 8px; height: 30px; }
  .app-shell.entered .role-switch .mini-avatar { display: none; }
  .app-shell.entered .navigation { position: static; order: 2; flex-basis: 100%; height: 32px; padding: 3px; }
  .app-shell.entered .nav-item { padding: 4px 8px; font-size: .8125rem; }
  .backup-button>span { display: none; }
  .app-shell .workspace-toolbar { gap: 8px; }
  .app-shell .workspace-heading { display: contents; }
  .app-shell .workspace-heading>div:first-child { display: none; }
  .app-shell .stage-progress { order: 2; font-size: .7rem; }
  .app-shell .stage-progress strong { font-size: .875rem; }
  .app-shell .screen-controls { flex: 1; }
  .app-shell .screen-controls .segmented button { padding: 5px 8px; font-size: .8125rem; }
  .app-shell .workspace .photo-deck { --deck-space-x: 18px; }
  .app-shell .workspace .decision-actions, .app-shell .workspace .final-actions { gap: 8px; }
  .app-shell .workspace .decision { flex: 0 1 150px; min-width: 0; padding: 7px 12px; }
  .app-shell .workspace .decision-copy, .app-shell .workspace .action-copy { gap: 6px; }
  .app-shell .workspace .final-actions .primary, .app-shell .workspace .final-actions .secondary { padding: 6px 8px; font-size: .8125rem; }
  .app-shell .workspace[data-mode=final] { grid-template-columns: minmax(0,1fr); grid-template-rows: 32px minmax(0,1fr) 48px 46px; }
  .app-shell .review-controls { flex: 1; padding-right: 88px; gap: 7px; }
  .app-shell .review-controls label { font-size: 0; gap: 0; }
  .app-shell .review-controls select { font-size: .8125rem; padding: 5px 7px; }
  .app-shell .review-controls .text-button { font-size: .75rem; white-space: nowrap; margin-left: auto; }
  .app-shell .workspace[data-mode=final] .final-panel { position: absolute; grid-area: auto; top: 4px; right: 0; z-index: 15; width: auto; max-height: none; padding: 0; border: 0; background: none; display: block; overflow: visible; }
  .final-panel-toggle { display: flex; align-items: center; justify-content: center; gap: 5px; height: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 20px; background: #fff; font-size: .75rem; }
  .final-panel-toggle svg { width: 13px; height: 13px; }
  .final-panel.expanded .final-panel-toggle svg { transform: rotate(180deg); }
  .app-shell .final-panel-content { display: none; }
  .app-shell .final-panel.expanded .final-panel-content { display: block; position: absolute; top: 36px; right: 0; width: min(300px,calc(100vw - 24px)); max-height: calc(100dvh - 172px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 40px #27352428; }
  .app-shell .final-panel .final-panel-title { margin: 0 0 12px; }
  .app-shell .final-panel .nine-grid { width: 100%; height: auto; aspect-ratio: 1; gap: 6px; }
  .app-shell .final-panel .nine-slot { font-size: 1.2rem; }
  .app-shell .final-panel .final-panel-info p { margin: 12px 0 9px; }
  .app-shell .final-panel .final-panel-info>.text-button, .app-shell .final-panel .other-progress { display: block; }
  .app-shell .workspace[data-mode=final] .candidate-strip { grid-column: 1; grid-row: 4; height: 46px; }
  .app-shell .workspace .viewer.comparing { flex-direction: column; }
  .app-shell .workspace .viewer.comparing .photo-deck, .app-shell .workspace .viewer.comparing .compare-area { flex: none; width: 100%; height: calc(50% - 6px); min-height: 0; }
}
@media (max-height:520px) and (min-width:761px) {
  .app-shell.entered .site-header { height: 40px; }
  .app-shell .workspace { grid-template-rows: 28px minmax(0,1fr) 40px; gap: 3px 12px; }
  .app-shell .workspace .decision-actions, .app-shell .workspace .final-actions { height: 40px; }
  .app-shell .workspace .decision, .app-shell .workspace .final-actions .primary, .app-shell .workspace .final-actions .secondary { height: 36px; min-height: 36px; }
  .app-shell .workspace[data-mode=final] .candidate-strip { height: 40px; }
  .app-shell .workspace .strip-photo { height: 36px; width: 28px; }
}
@media (max-height:520px) and (max-width:760px) {
  .app-shell.entered .site-header { height: 40px; flex-wrap: nowrap; gap: 8px; padding: 0; }
  .app-shell.entered .brand { display: none; }
  .app-shell.entered .navigation { order: 0; flex: 1; height: 30px; min-width: 0; }
  .app-shell.entered .nav-item { font-size: .7rem; padding: 3px 4px; gap: 3px; }
  .app-shell.entered .nav-count { font-size: .65rem; padding: 1px 4px; }
  .app-shell.entered .header-right { margin-left: 0; gap: 4px; }
  .app-shell .workspace { grid-template-rows: 28px minmax(0,1fr) 40px; gap: 3px 8px; }
  .app-shell .workspace[data-mode=final] { grid-template-rows: 28px minmax(0,1fr) 40px 32px; }
  .app-shell .workspace .decision-actions, .app-shell .workspace .final-actions { height: 40px; }
  .app-shell .workspace .decision, .app-shell .workspace .final-actions .primary, .app-shell .workspace .final-actions .secondary { height: 36px; min-height: 36px; }
  .app-shell .workspace[data-mode=final] .candidate-strip { height: 32px; }
  .app-shell .workspace .strip-photo { height: 28px; width: 22px; }
  .final-panel-toggle { height: 28px; }
}
@media (max-height:520px) and (max-width:760px) and (orientation:landscape) {
  .app-shell .workspace, .app-shell .workspace[data-mode=final] { grid-template-columns: minmax(0,1fr) 116px; grid-template-rows: 28px minmax(0,1fr) 32px; }
  .app-shell .workspace .viewer { grid-column: 1; grid-row: 2 / 4; }
  .app-shell .workspace .decision-actions, .app-shell .workspace .final-actions { grid-column: 2; grid-row: 2; align-self: center; height: auto; flex-direction: column; gap: 6px; }
  .app-shell .workspace .decision, .app-shell .workspace .final-actions .primary, .app-shell .workspace .final-actions .secondary { flex: none; width: 100%; height: 48px; }
  .app-shell .workspace .action-copy { flex-direction: column; gap: 3px; }
  .app-shell .workspace .undo-button { order: 3; padding: 4px; }
  .app-shell .workspace[data-mode=final] .candidate-strip { grid-column: 2; grid-row: 3; }
}
@container photo-frame (max-width:300px) {
  .photo-tools button { padding: 8px; border-radius: 50%; height: 34px; width: 34px; }
  .photo-tools button span { display: none; }
  .photo-tools { top: 10px; right: 10px; gap: 5px; }
}
@container photo-frame (max-width:180px) {
  .photo-tools { top: 6px; right: 6px; gap: 4px; }
  .photo-tools button { padding: 4px; width: 24px; height: 24px; }
  .photo-tools svg { width: 14px; height: 14px; }
  .photo-caption { left: 8px; right: 8px; font-size: .65rem; letter-spacing: 0; }
  .photo-index { display: none; }
}
@media (max-width:760px), (hover:none) and (pointer:coarse) {
  .zoom-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .zoom-dialog[open] { animation: backdrop-enter .16s ease-out; }
  .zoom-toolbar { height: calc(64px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left)); }
  .zoom-note { height: calc(48px + env(safe-area-inset-bottom)); padding: 5px max(5px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left)); gap: 5px; }
  .zoom-note>span { font-size: .65rem; text-align: center; }
  .zoom-note button { padding: 5px; white-space: nowrap; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .workspace, .entrance, .gallery-toolbar, .navigation, .toast { display: none !important; }
  .gallery-view { display: block !important; }
  .gallery-grid { grid-template-columns: repeat(3,1fr); }
  .gallery-photo { break-inside: avoid; }
  .gallery-badge, .gallery-photo small { display: none; }
  .gallery-photo>span { color: #111; }
  .app-shell { padding: 0; }
}
