:root { font-family: "Noto Sans SC", system-ui, sans-serif; color: #263d34; background: #f7f3eb; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:active:not(:disabled) { filter: brightness(.92); }
#guide-status.has-feedback { color: #34543f; font-weight: 650; }
button:focus-visible, input:focus-visible { outline: 3px solid #da8a49; outline-offset: 4px; }
.simple-header { height: 76px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #dcded5; font-size: 14px; }
.simple-brand { font-weight: 700; letter-spacing: .05em; color: #426853; }
.header-home { display: flex; align-items: center; gap: 18px; }
.header-actions { display: flex; align-items: center; flex-shrink: 0; }
.lottery-dialog { width: min(400px, 90vw); }
.home-button { padding: 9px 12px; border: 1px solid #cbd4c3; border-radius: 7px; background: #fffcf6; color: #456d55; white-space: nowrap; font-size: 14px; }
.home-button:disabled { opacity: .5; cursor: wait; }
.quiet-button { border: 0; background: transparent; color: #72796c; font-size: 13px; padding: 10px; }
.simple-progress { display: flex; justify-content: center; gap: 48px; padding: 20px; color: #92988b; font-size: 15px; }
.simple-progress .current { color: #41684f; font-weight: 700; border-bottom: 2px solid #41684f; padding-bottom: 8px; }
.simple-stage { height: calc(100dvh - 257px); min-height: 360px; display: grid; place-items: center; padding: 14px 6vw 28px; }
.center-copy { text-align: center; max-width: 980px; max-height: 100%; overflow: auto; }
.stage-eyebrow { font-size: 16px !important; color: #74816e; letter-spacing: .15em; }
h1 { font: 700 clamp(30px, 3.7vw, 52px)/1.5 "Noto Serif SC", serif; margin: 20px 0; }
.center-copy > p { max-width: 880px; margin: 16px auto; font-size: clamp(20px, 2vw, 28px); line-height: 1.9; }
.simple-footer { position: fixed; bottom: 0; width: 100%; min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 18px 4vw; border-top: 1px solid #deded3; background: #fffcf6; }
.little-guide { display: flex; gap: 16px; align-items: center; }
.guide-face { flex-shrink: 0; width: 66px; height: 66px; border-radius: 50%; background: #f4c9a0; border: 5px solid #50705b; display: grid; place-items: center; font-size: 23px; }
.little-guide p { margin: 0; font-size: 17px; line-height: 1.7; }
.little-guide b { display: block; font-size: 13px; color: #5d795e; }
.main-next { display: flex; align-items: center; justify-content: space-between; gap: 42px; border: 0; background: #456d55; color: white; border-radius: 10px; padding: 18px 30px; font-size: 22px; min-width: 200px; flex-shrink: 0; }
.main-next:disabled { opacity: .5; cursor: wait; }
.scene-simple { position: relative; height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; }
.scene-simple h1 { margin: 0 0 14px; font-size: 28px; }
.scene-simple img { min-height: 0; width: auto; max-width: 100%; height: calc(100% - 60px); object-fit: contain; border-radius: 8px; }
.picture-frame { position: relative; aspect-ratio: 1.5; width: min(100%, calc((100dvh - 360px) * 1.5)); height: auto; flex: 0 0 auto; }
.scene-simple .picture-frame img { display: block; width: 100%; height: 100%; cursor: pointer; object-fit: fill; }
.scene-simple h1 small { font: 400 15px system-ui; margin-left: 18px; color: #6f806b; }
.found-mark { position: absolute; transform: translate(-50%, -50%); padding: 3px 9px; border-radius: 50%; background: #456d55; color: white; pointer-events: none; }
.target-hint { position: absolute; border: 4px solid #ffe17a; border-radius: 50%; box-shadow: 0 0 0 6px #fff8; pointer-events: none; }
.game-feedback { margin: 12px 0 0; font-size: 20px; text-align: center; }
.object-discussion { text-align: center; max-width: 960px; }
.object-discussion h2 { font: 600 clamp(24px, 3vw, 36px)/1.7 "Noto Serif SC", serif; }
.object-discussion p { font-size: 19px; line-height: 1.8; }
.object-era { color: #6b7c61; }
.navigation-buttons { display: flex; gap: 16px; align-items: center; }
.back-button { border: 1px solid #bdc9b5; background: transparent; border-radius: 8px; padding: 15px 20px; font-size: 17px; color: #456d55; white-space: nowrap; }
.saved-group-label { display: grid; gap: 12px; font-size: 17px; }
.reset-group-button { margin-left: 10px; font-size: 12px; color: #8b7867; text-decoration: underline; text-underline-offset: 3px; }
.reset-group-notice { margin-top: 12px; font-size: 13px; line-height: 1.7; color: #6d7d61; }
.saved-group-label select { font: inherit; font-size: 22px; color: #263d34; background: #fffcf6; border: 1px solid #cfd5c6; padding: 18px; border-radius: 9px; width: 100%; }
.hint-text { position: absolute; bottom: 20px; padding: 12px 24px; background: #fffcf6; box-shadow: 0 4px 20px #0002; font-size: 22px; border-radius: 8px; }
.prior-memory, .saved-summary { margin: 24px auto; padding: 20px 30px; max-width: 760px; background: #e9eee3; border-radius: 12px; font-size: 21px; line-height: 1.7; }
.prior-memory small, .saved-summary small { color: #64735e; font-size: 14px; }
.shared-words { max-height: 26vh; overflow: auto; font-size: 24px; line-height: 1.8; }
blockquote { padding: 12px 22px; margin: 10px; border-left: 3px solid #809b74; background: #edf0e7; text-align: left; }
.setup-page { max-width: 1100px; margin: 0 auto; padding: 7vh 30px; }
.setup-heading h1 { margin: 18px 0 8px; font-size: 38px; }
.setup-heading > p { color: #747c6e; margin-bottom: 34px; }
.setup-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.setup-fields label { display: grid; gap: 10px; font-size: 17px; font-weight: 600; }
.setup-fields input { padding: 17px; width: 100%; background: #fffcf6; border: 1px solid #cfd5c6; border-radius: 9px; font-size: 20px; color: #263d34; }
fieldset { margin: 30px 0; padding: 0; border: 0; }
legend { font-weight: 600; margin-bottom: 14px; font-size: 17px; }
.activity-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.activity-options label { position: relative; cursor: pointer; }
.activity-options input { position: absolute; top: 12px; right: 10px; accent-color: #456d55; }
.activity-options span { display: block; border: 1px solid #d6dbcd; border-radius: 10px; padding: 22px 16px; background: #fffcf6; }
.activity-options input:checked + span { border: 2px solid #456d55; padding: 21px 15px; background: #e7eddf; }
.activity-options small, .activity-options strong { display: block; }
.activity-options small { color: #7c8574; font-size: 13px; margin-bottom: 14px; }
.activity-options strong { font-size: 18px; }
.setup-note { font-size: 12px; color: #83887d; margin-top: 20px; }
.directory-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.setup-fields.location-fields { grid-template-columns: minmax(0, 1fr) minmax(110px, 18%); margin-top: 30px; }
.location-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.location-field { display: grid; gap: 10px; min-width: 0; }
.location-picker { position: relative; min-width: 0; }
.location-picker input { padding-right: 48px; height: 100%; }
.location-picker input:disabled { background: #eeeadd; opacity: 1; }
.location-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 42px; border: 0; border-radius: 7px; background: transparent; color: #426853; font-size: 23px; }
.location-options { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20; max-height: 280px; overflow-y: auto; background: #fffcf6; border: 1px solid #cfd5c6; border-radius: 9px; padding: 6px; box-shadow: 0 10px 24px #263d3420; }
.location-options[hidden] { display: none; }
.location-options button { display: block; width: 100%; text-align: left; padding: 12px; border: 0; border-radius: 5px; background: transparent; color: #263d34; font-size: 18px; }
.location-options button:hover, .location-options button:focus-visible, .location-options button[aria-selected=true] { background: #e7eddf; }
.location-empty { margin: 12px; font-size: 15px; color: #72796c; }
@media (max-width: 560px) {
  .setup-fields.location-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .location-pair { gap: 10px; }
  .location-field label { font-size: 14px; }
  .location-picker input { padding: 10px 34px 10px 10px; min-height: 44px; font-size: 16px; }
  .location-toggle { width: 30px; }
  .setup-count { max-width: 130px; }
}
.activity-options label:focus-within span { outline: 3px solid #da8a49; outline-offset: 3px; }
.directory-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 10px; color: #7c8574; font-size: 12px; }
.participant-settings { margin-top: 24px; padding: 20px; border: 1px solid #d6ddcd; border-radius: 10px; background: #eef1e7; }
.participant-settings > label { font-weight: 600; }
.participant-control { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.participant-control input { width: 100px; padding: 10px 14px; font-size: 24px; border: 1px solid #cbd5c2; border-radius: 8px; background: #fffdf8; color: #263d34; }
.participant-control span, .participant-settings small { color: #77836b; font-size: 12px; }
#plan-preview { font-size: 14px; line-height: 1.9; }
.activity-select { width: 100%; font: inherit; font-size: 20px; padding: 16px; background: #fffdf8; border: 1px solid #cbd5c2; border-radius: 9px; color: #263d34; }
.setup-error { color: #a13e32; font-size: 14px; }
.invitation-panel { margin-top: 12px; border: 1px solid #d3dbc8; padding: 12px 14px; border-radius: 12px; background: #edf1e5; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.invitation-panel > span, .invitation-panel > small { font-size: 11px; color: #79866b; display: block; line-height: 1.8; }
.invitation-panel button { padding: 10px 14px; border: 1px solid #c3cfb5; border-radius: 7px; background: #fffaf0; color: #456d55; font: inherit; font-size: 14px; }
.invitation-panel button:disabled { opacity: .5; cursor: default; }
.ticket-number { font: 600 54px/1.1 "Noto Serif SC", serif; margin: 0; min-width: 70px; font-variant-numeric: tabular-nums; }
.ticket-number small { font: 400 12px system-ui; margin-left: 8px; }
.ticket-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.invitation-panel #draw-ticket { color: #fffaf0; background: #426853; border-color: #426853; }
.invitation-panel #skip-ticket { border: 0; background: transparent; padding: 10px 6px; }
.is-drawing #ticket-value { display: inline-block; animation: ticket-roll .12s ease-in-out infinite alternate; }
.is-revealed #ticket-value { display: inline-block; animation: ticket-reveal .45s ease-out; }
@keyframes ticket-roll { from { transform: translateY(-3px); opacity: .45; } to { transform: translateY(3px); opacity: 1; } }
@keyframes ticket-reveal { 0% { transform: scale(.65); opacity: .4; } 65% { transform: scale(1.14); } 100% { transform: scale(1); opacity: 1; } }
@media(prefers-reduced-motion: reduce) { .is-drawing #ticket-value, .is-revealed #ticket-value { animation: none; } }
@media(max-width: 750px) { .directory-fields { grid-template-columns: 1fr; } }
.staff-dialog { position: fixed; inset: 6vh 5vw auto auto; z-index: 50; width: min(660px, 90vw); max-height: 85vh; overflow: auto; border: 1px solid #cdd6c5; border-radius: 14px; padding: 28px; background: #fffcf6; box-shadow: 0 20px 100px #263d3455; margin: 0; font-size: 14px; }
.tool-heading { display: flex; justify-content: space-between; align-items: center; }
.tool-heading h2 { font-size: 21px; }
.staff-dialog button { padding: 10px 16px; border: 1px solid #cdd6c5; background: #eef1e7; border-radius: 6px; }
.tool-buttons { display: flex; gap: 10px; margin-bottom: 20px; }
.staff-dialog small { display: block; color: #7c8574; line-height: 1.8; margin-top: 20px; }
.invitation-panel .ticket-number small { display: inline; margin: 0 0 0 8px; }
.staff-dialog pre { white-space: pre-wrap; word-break: break-word; font-size: 11px; }
.staff-dialog audio { max-width: 100%; vertical-align: middle; }
.staff-dialog a { margin-left: 10px; color: #456d55; }
.recording-row { border-bottom: 1px solid #dce1d5; padding: 12px 0 18px; }
.recording-row p small { display: inline; margin: 0 0 0 12px; font-size: 11px; }
.staff-dialog .delete-recording { display: block; margin-top: 10px; color: #a13e32; border-color: #d9b6ae; background: #fff4ef; }
.street-status { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 4vw; color: #77816c; font-size: 13px; }
.street-status span:first-child { color: #456d55; }
#app:has(.street-stage) { height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
#app:has(.street-stage) > .simple-footer { position: static; }
.simple-stage.street-stage { height: auto; min-height: 0; padding: 6px 3vw 16px; }
.street-world { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; height: 100%; min-height: 0; width: 100%; }
.street-visual { min-width: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.street-image-wrap { position: relative; aspect-ratio: 1.5; width: min(100%, calc((100dvh - 300px) * 1.5)); overflow: hidden; border-radius: 12px; box-shadow: 0 9px 28px #50392126; background: #d2b985; flex-shrink: 0; }
.street-image-wrap > img { width: 100%; height: 100%; display: block; cursor: pointer; }
.market-picture { isolation: isolate; cursor: pointer; }
.simple-stage.wrap-stage { display: block; height: auto; min-height: calc(100dvh - 250px); padding: 22px 4vw 155px; }
.questionnaire-page { width: min(1100px, 100%); margin: 0 auto; }
.questionnaire-page h1 { font-size: clamp(28px, 3.4vw, 44px); }
.finale-display { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; min-height: min(600px, 60dvh); align-items: stretch; }
.finale-image { background: #ebe9dc; border: 1px solid #d7decb; border-radius: 16px; display: grid; place-items: center; overflow: hidden; min-height: 360px; }
.finale-image img { display: block; width: 100%; max-height: 68dvh; object-fit: contain; }
.finale-image.is-preset { grid-template-rows: minmax(0, 1fr) auto; }
.finale-preset-caption { margin: 4px 10px; color: #536750; font-size: 14px; line-height: 1.5; }
.finale-summary > .finale-preset-caption { margin-inline: 0; }
.finale-placeholder { text-align: center; padding: 30px; color: #738268; }
.finale-placeholder > span { font-size: 70px; }
.finale-placeholder h1 { font-size: 30px; }
.finale-placeholder p { font-size: 18px; line-height: 1.8; }
.finale-summary { border-left: 1px solid #d8ddce; padding: 16px 0 16px 26px; }
.finale-summary h2 { font: 600 30px/1.7 'Noto Serif SC', serif; }
.finale-summary-text { font-size: clamp(19px, 1.6vw, 25px); line-height: 2; white-space: pre-line; overflow-wrap: anywhere; }
.finale-speech-status { color: #7b8571; font-size: 14px; line-height: 1.8; }
.questionnaire-page > p { font-size: 20px; line-height: 1.9; }
.questionnaire-page > p strong { display: block; color: #456d55; }
.questionnaire-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.questionnaire-grid article, .photo-add { padding: 14px; border: 1px solid #d5ddc9; border-radius: 12px; background: #fffcf6; }
.questionnaire-grid img { width: 100%; height: 220px; object-fit: contain; background: #eeeade; }
.questionnaire-grid p { font-size: 16px; line-height: 1.8; }
.photo-add { min-height: 260px; display: grid; align-content: center; justify-items: center; font-size: 46px; color: #66805b; }
.photo-add span { font-size: 19px; margin-top: 16px; }
.resume-page > p { font-size: 22px; line-height: 1.8; color: #7b8571; }
.resume-page select { display: block; margin: 16px 0; font: inherit; padding: 16px; max-width: 100%; border: 1px solid #cbd4c2; border-radius: 10px; background: #fffcf6; }
.resume-page .main-next { margin: 30px 0 12px; }
@media(max-width: 800px) { .finale-display { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; } .finale-summary { padding-left: 16px; } .review-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width: 550px) { .simple-stage.wrap-stage { padding: 16px 18px 220px; } .finale-display { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; } .finale-summary { padding-left: 10px; } .finale-summary h2 { font-size: 20px; } .finale-summary-text { font-size: 16px; line-height: 1.9; } .finale-image { min-height: 260px; } .questionnaire-grid, .review-card-grid { grid-template-columns: 1fr; } }
.result-error { color: #964c35; line-height: 1.8; }
.result-help { color: #7a846f; font-size: 14px; line-height: 1.8; }
#app:has(.finale-display) { height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
#app:has(.finale-display) > .simple-footer { position: static; }
.simple-stage.wrap-stage:has(.finale-display) { min-height: 0; height: auto; padding: 12px 3vw 20px; }
.finale-display { min-height: 0; height: 100%; }
.finale-display .finale-image { min-height: 0; }
.finale-display .finale-image img { height: 100%; max-height: 100%; min-height: 0; }
.finale-summary { min-height: 0; overflow-y: auto; }
.street-status.finale-heading { padding-inline: 3vw; }
.finale-regenerate { padding: 4px 9px; min-height: 28px; border: 1px solid #cbd4c2; border-radius: 6px; background: #fffcf6; color: #34543f; font-size: 12px; line-height: 1.3; }
.finale-regenerate:disabled { opacity: .45; cursor: default; }
.market-picture > .market-background { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.market-picture > .market-sticker { position: absolute; display: block; pointer-events: none; filter: saturate(.72) contrast(.94) sepia(.06); }
.market-contact-shadow { position: absolute; height: 1.15%; transform: translateY(-28%); border-radius: 50%; background: radial-gradient(ellipse, #4c3c285c 12%, #4c3c2800 72%); pointer-events: none; }
.market-contact-shadow.counter-shadow { height: .4%; background: #4c3c2824; filter: blur(1px); }
.market-keyboard-target { position: absolute; z-index: 60; border: 0; padding: 0; background: transparent; pointer-events: none; }
.market-keyboard-target:focus-visible { outline: 3px solid #ffe17a; outline-offset: 0; border-radius: 8px; }
.market-picture .object-spotlight { z-index: 50; }
.market-picture .focus-label, .market-picture .street-memory-pin, .market-picture .target-hint { z-index: 51; }
.object-spotlight { pointer-events: none; position: absolute; border: 3px solid #ffe9a4; border-radius: 10px; box-shadow: 0 0 0 1500px #192c2052; z-index: 1; }
.focus-label { pointer-events: none; position: absolute; z-index: 3; background: #fff7e5; color: #3e5a42; border-radius: 5px; padding: 4px 10px; font-size: 13px; font-weight: 700; }
.street-memory-pin { pointer-events: none; position: absolute; z-index: 2; transform: translate(-50%, -50%); border-radius: 6px; color: #fff; background: #42644eee; padding: 5px 8px; box-shadow: 0 3px 10px #0003; }
.street-memory-pin b { font-size: 11px; display: block; }
.street-memory-pin > span { display: block; font-size: 9px; opacity: .8; }
.street-memory-pin.pin-active { opacity: .2; }
.street-feedback { text-align: center; font-size: 16px; color: #596b50; min-height: 25px; margin: 14px 0 0; }
.street-panel { min-height: 0; overflow: auto; padding: 20px 18px 20px 0; align-self: stretch; border-left: 1px solid #dbdfd1; padding-left: 24px; }
.street-panel h1 { font-size: 29px; line-height: 1.55; margin: 16px 0; }
.street-panel h2 { font: 600 22px/1.8 "Noto Serif SC", serif; }
.street-panel p { font-size: 16px; line-height: 1.9; }
.street-panel .stage-eyebrow { font-size: 12px !important; letter-spacing: .06em; }
.street-panel .object-era { font-size: 13px; border-bottom: 1px solid #dce0d2; padding-bottom: 16px; }
.live-memory { padding: 10px 0; border-top: 1px dashed #cbd3bf; }
.street-panel .conversation-cue { font-size: 12px; color: #7e8775; }
.memory-empty { color: #87917e; font-size: 13px !important; }
.memory-keywords { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }
.memory-keywords li { padding: 4px 9px; border-radius: 6px; background: #e7eddf; color: #34543f; font-size: 15px; line-height: 1.4; }
.street-panel small { color: #7c8872; font-size: 11px; }
.memory-shelf { margin-top: 30px; }
.memory-shelf h2 { font: 600 13px system-ui; color: #79866b; }
.memory-shelf article { padding: 14px 0; border-bottom: 1px solid #dbe0d2; }
.memory-shelf strong { font-size: 16px; }
.review-memory { border-bottom: 1px solid #d5ddc9; padding: 12px 0; }
.review-memory > button { display: flex; width: 100%; justify-content: space-between; gap: 8px; align-items: center; border: 0; background: transparent; padding: 6px 0; color: #3c6247; font-size: 18px; text-align: left; }
.review-memory > button > span { font-size: 11px; color: #8a957b; }
.review-memory > button.selected-memory { font-weight: 700; }
.old-street-note, .review-corrections { padding: 12px 16px; background: #e9eede; border-radius: 8px; }
@media(min-width: 1600px) { .street-world { grid-template-columns: minmax(0, 1fr) 390px; gap: 36px; } .street-panel h1 { font-size: 36px; } .street-panel h2 { font-size: 28px; } }
@media(max-width: 900px) { .street-world { grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; } .street-panel { padding-left: 14px; } .street-panel h1 { font-size: 23px; } .street-panel h2 { font-size: 18px; } .street-memory-pin b { font-size: 9px; } }
@media(max-width: 750px) { .simple-header { font-size: 11px; padding: 0 15px; } .simple-progress { gap: 18px; font-size: 12px; } .simple-footer { gap: 12px; padding: 15px; } .little-guide p { font-size: 13px; } .guide-face { width: 45px; height: 45px; font-size: 18px; } .main-next { min-width: 130px; gap: 10px; padding: 16px 20px; font-size: 18px; } .activity-options { grid-template-columns: repeat(2, 1fr); } .setup-fields { grid-template-columns: 1fr; } }
@media(max-width: 650px) {
  #app:has(.street-stage) { display: block; height: auto; min-height: 100dvh; }
  .simple-header { height: auto; min-height: 76px; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 16px; }
  .simple-header > span { grid-column: 1 / -1; grid-row: 2; line-height: 1.6; }
  .header-home .simple-brand { display: none; }
  .simple-header .quiet-button { font-size: 12px; }
  .street-status { padding: 14px 16px; height: auto; gap: 12px; }
  .simple-stage.street-stage { height: auto; min-height: 0; padding: 8px 16px 20px; }
  .street-world { display: flex; flex-direction: column; height: auto; gap: 16px; }
  .street-image-wrap { width: 100%; }
  .street-feedback { font-size: 14px; }
  .street-panel { border-left: 0; border-top: 1px solid #dbe0d2; padding: 14px 0; overflow: visible; }
  .street-panel h1 br { display: none; }
  .street-panel h1 { font-size: 25px; margin: 8px 0; }
  .simple-footer { position: sticky; bottom: 0; flex-wrap: wrap; gap: 12px; }
  .little-guide { width: 100%; gap: 12px; }
  .little-guide p { flex: 1; min-width: 0; }
  .navigation-buttons { width: 100%; justify-content: space-between; gap: 10px; }
  .main-next { min-width: 0; font-size: 16px; }
  .back-button { padding: 14px; font-size: 15px; }
  .memory-shelf { margin-top: 16px; }
}

/* Xiaoyi is anchored to the guide area; the enlarged figure can rise above its white bar. */
.xiaoyi-pet { width: 98px; height: 98px; flex: 0 0 98px; padding: 0; border: 0; border-radius: 16px; background: transparent; cursor: pointer; touch-action: manipulation; }
.xiaoyi-pet:focus-visible { outline: 3px solid #d38e42; outline-offset: 3px; }
.xiaoyi-sprite { display: block; width: 100%; height: 100%; background: url('../assets/mascot/xiaoyi-actions-v1.png') 0 0 / 300% 200% no-repeat; transform-origin: 50% 92%; animation: xiaoyi-idle 7s ease-in-out infinite; }
.xiaoyi-pet[data-mascot-mode="listening"] .xiaoyi-sprite { background-position: 50% 0; animation: xiaoyi-listen 4.8s ease-in-out infinite; }
.xiaoyi-pet[data-mascot-mode="speaking"] .xiaoyi-sprite { background-position: 100% 0; animation: xiaoyi-talk 1.8s ease-in-out infinite; }
.xiaoyi-pet[data-mascot-mode="thinking"] .xiaoyi-sprite { background-position: 0 100%; animation: xiaoyi-think 4s ease-in-out infinite; }
.xiaoyi-pet[data-mascot-mode="celebrate"] .xiaoyi-sprite { background-position: 50% 100%; animation: xiaoyi-cheer 3s ease-in-out infinite; }
.xiaoyi-pet[data-mascot-mode="artwork"] .xiaoyi-sprite { background-position: 100% 100%; }
.xiaoyi-pet.pet-greeting .xiaoyi-sprite { background-position: 0 0; animation: xiaoyi-greet .4s ease-in-out 4; }
.setup-actions {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; column-gap: clamp(10px, 2vw, 26px);
  padding-inline-end: clamp(16px, 6vw, 72px);
}
.setup-action-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.setup-action-controls .setup-note { margin: 0; }
.setup-mascot {
  --welcome-pet-size: clamp(125px, 20vw, 210px);
  width: var(--welcome-pet-size); text-align: center;
  translate: 0 clamp(8px, 2.7dvh, 22px);
}
.setup-mascot > .xiaoyi-pet { display: block; width: 100%; height: var(--welcome-pet-size); }
.setup-mascot-status { margin: 2px 0 0; font-size: 12px; color: #964c35; }
.setup-mascot-status:empty { display: none; }
@media (orientation: portrait) and (max-width: 550px) {
  .setup-actions { padding-inline-end: 8px; }
  .setup-mascot { --welcome-pet-size: clamp(92px, 26vw, 125px); }
}
@keyframes xiaoyi-idle { 0%, 50%, 100% { transform: translateY(0) rotate(0); } 18% { transform: translateY(-2px) scale(1.015); } 65% { transform: rotate(-2deg); } 76% { transform: rotate(2deg); } }
@keyframes xiaoyi-listen { 0%, 60%, 100% { transform: rotate(0); } 25%, 40% { transform: rotate(-4deg) translateY(-1px); } }
@keyframes xiaoyi-talk { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-3px) rotate(-1deg); } 70% { transform: rotate(1deg); } }
@keyframes xiaoyi-think { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg) translateY(-2px); } }
@keyframes xiaoyi-cheer { 0%, 20%, 100% { transform: translateY(0); } 10% { transform: translateY(-5px); } }
@keyframes xiaoyi-greet { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-3px); } }
@media(max-width: 750px) { .xiaoyi-pet { width: 72px; height: 72px; flex-basis: 72px; } .little-guide { min-width: 0; } }
@media(prefers-reduced-motion: reduce) { .xiaoyi-pet .xiaoyi-sprite, .xiaoyi-pet.pet-greeting .xiaoyi-sprite { animation: none; } }

/* Keep the footer compact while letting Xiaoyi stand above its top edge. */
.simple-footer { overflow: visible; z-index: 10; }
.simple-footer .little-guide { position: relative; min-height: 76px; padding-left: 190px; min-width: 0; }
.simple-footer .little-guide > .xiaoyi-pet { position: absolute; left: -22px; bottom: -10px; width: 220px; height: 220px; }
.simple-footer .little-guide > p { position: relative; min-width: 0; }
@media(max-width: 750px) {
  .simple-footer .little-guide { padding-left: 140px; min-height: 64px; }
  .simple-footer .little-guide > .xiaoyi-pet { left: -15px; bottom: -8px; width: 165px; height: 165px; }
}
@media(max-width: 380px) {
  .simple-footer .little-guide { padding-left: 114px; }
  .simple-footer .little-guide > .xiaoyi-pet { width: 140px; height: 140px; }
}

/* A phone in landscape has more room side to side than top to bottom. */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 600px) {
  #app {
    --landscape-gutter: clamp(12px, 2.6vw, 28px);
    --landscape-pet-size: clamp(68px, 19dvh, 90px);
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
      env(safe-area-inset-bottom) env(safe-area-inset-left);
    min-height: 100dvh;
  }

  .setup-page { padding: 8px var(--landscape-gutter) 12px; }
  .setup-heading h1, .setup-page > h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; }
  .setup-mascot { --welcome-pet-size: clamp(102px, 33dvh, 166px); }
  @media (max-height: 340px) {
    .setup-mascot { --welcome-pet-size: 100px; translate: 0 2px; }
  }
  .setup-fields.location-fields { grid-template-columns: minmax(0, 1fr) minmax(85px, 18%); gap: 12px; margin-top: 6px; }
  .location-pair { gap: 12px; }
  .setup-fields label { gap: 4px; font-size: 14px; }
  .location-field { gap: 4px; }
  .setup-fields input { padding: 8px 12px; min-height: 44px; font-size: 16px; }
  .location-picker input { padding-right: 38px; }
  .location-toggle { width: 34px; }
  .location-options { max-height: min(44dvh, 220px); }
  .location-options button { padding: 10px; font-size: 16px; }
  #activity-options { min-width: 0; margin: 8px 0 0; }
  #activity-options legend { margin-bottom: 6px; font-size: 14px; }
  .activity-options { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .activity-options span, .activity-options input:checked + span {
    display: grid; align-content: center; gap: 4px; height: 100%; min-height: 66px;
    padding: 7px 5px; border-width: 2px; text-align: center;
  }
  .activity-options input { top: 5px; right: 4px; margin: 0; width: 12px; height: 12px; }
  .activity-options small { font-size: 11px; margin: 0; }
  .activity-options strong { font-size: clamp(14px, 2vw, 18px); line-height: 1.25; text-wrap: balance; }
  #plan-preview, .setup-note, .setup-error { margin: 6px 0; font-size: 12px; line-height: 1.4; }
  .setup-error:empty { display: none; }
  .setup-note { margin: 0; }

  #app:has(> .simple-header) {
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .simple-header {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 0; height: auto; gap: 8px; padding: 0 var(--landscape-gutter); font-size: 12px;
  }
  .simple-header > span { grid-area: auto; min-width: 0; text-align: center; line-height: 1.35; overflow-wrap: anywhere; }
  .simple-header button { min-height: 44px; padding: 4px 7px; font-size: 12px; }
  .street-status { height: auto; padding: 4px var(--landscape-gutter); font-size: 12px; }
  .street-status.finale-heading { padding-inline: var(--landscape-gutter); }
  .simple-progress { padding: 5px var(--landscape-gutter); gap: clamp(12px, 4vw, 35px); font-size: 12px; }
  .simple-progress .current { padding-bottom: 2px; }
  .simple-stage, .simple-stage.street-stage, .simple-stage.wrap-stage,
  .simple-stage.wrap-stage:has(.finale-display) {
    min-height: 0; height: auto; padding: 6px var(--landscape-gutter) 8px; overflow: auto;
  }
  .simple-stage.wrap-stage,
  .simple-stage.wrap-stage:has(.finale-display) {
    padding-bottom: calc(var(--landscape-pet-size) - 40px);
  }
  .center-copy { width: 100%; }
  .center-copy h1 { margin: 4px 0; font-size: clamp(23px, 4vw, 34px); line-height: 1.25; }
  .center-copy h1 br { display: none; }
  .center-copy > p { margin: 6px auto; font-size: clamp(16px, 2.5vw, 22px); line-height: 1.45; }
  .center-copy .stage-eyebrow { font-size: 12px !important; }
  .prior-memory, .saved-summary { margin: 8px auto; padding: 8px 12px; font-size: 14px; }
  .shared-words { font-size: 16px; }

  .street-world {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, 33%);
    height: 100%; gap: 12px;
  }
  .street-visual { min-height: 0; container-type: size; }
  .street-image-wrap {
    width: min(100%, calc((100cqh - 24px) * 1.5)); min-width: 0;
    height: auto; aspect-ratio: 1.5; border-radius: 8px;
  }
  .street-feedback { margin: 3px 0 0; min-height: 0; font-size: 12px; line-height: 1.3; }
  .street-panel { overflow: auto; border-top: 0; border-left: 1px solid #dbdfd1; padding: 0 2px 0 10px; }
  .street-panel h1, .street-panel h2 { margin: 4px 0; font-size: clamp(17px, 2.7vw, 22px); line-height: 1.35; }
  .street-panel p { margin: 4px 0; font-size: 13px; line-height: 1.5; }
  .street-panel .object-era { padding-bottom: 5px; }
  .street-panel .stage-eyebrow, .street-panel .conversation-cue { font-size: 11px !important; }
  .live-memory { padding: 5px 0; }
  .memory-shelf { margin-top: 8px; }

  .finale-display {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr); gap: 10px;
  }
  .finale-placeholder { padding: 8px; }
  .finale-placeholder > span { font-size: 24px; }
  .finale-placeholder h1, .finale-summary h2 { margin: 4px 0; font-size: 20px; line-height: 1.3; }
  .finale-placeholder p, .finale-speech-status { margin: 4px 0; font-size: 13px; line-height: 1.4; }
  .finale-image { overflow: auto; }
  .finale-summary { padding: 0 3px 0 10px; }
  .finale-summary-text { font-size: 15px; line-height: 1.55; }
  .questionnaire-page h1 { margin: 2px 0 4px; font-size: 25px; line-height: 1.3; }
  .questionnaire-page > p { margin: 4px 0; font-size: 14px; line-height: 1.5; }
  .questionnaire-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .questionnaire-grid article, .photo-add { padding: 6px; }
  .questionnaire-grid img { height: clamp(56px, 21dvh, 110px); }
  .questionnaire-grid p { margin: 3px 0; font-size: 12px; line-height: 1.35; }
  .photo-add { min-height: 95px; font-size: 28px; }
  .photo-add span { margin-top: 4px; font-size: 14px; }

  #app > .simple-footer {
    position: static; min-height: 0; flex-wrap: nowrap; gap: 8px;
    padding: 3px var(--landscape-gutter);
  }
  .simple-footer .little-guide {
    width: auto; flex: 1; min-height: 44px; padding-left: calc(var(--landscape-pet-size) + 7px);
  }
  .simple-footer .little-guide > .xiaoyi-pet {
    position: absolute; left: 0; bottom: -2px;
    width: var(--landscape-pet-size); height: var(--landscape-pet-size);
  }
  .little-guide p { font-size: 12px; line-height: 1.35; }
  .little-guide b { font-size: 11px; }
  .navigation-buttons { width: auto; flex-shrink: 0; gap: 6px; }
  .main-next, .back-button { min-height: 44px; min-width: 0; padding: 6px 10px; font-size: 15px; white-space: nowrap; }
  .main-next { gap: 8px; }
  .staff-dialog {
    inset: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) auto auto;
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px));
    padding: 12px; border-radius: 10px;
  }
  .tool-heading h2 { margin: 4px 0; font-size: 18px; }
  .tool-buttons { flex-wrap: wrap; margin-bottom: 6px; }
  .staff-dialog small { margin-top: 6px; }
}

#skip-speech { margin-top: 4px; font-size: inherit; white-space: nowrap; }

.questionnaire-camera-preview { margin: 10px 0 0; scroll-margin-block: 8px; }
.questionnaire-camera-preview video { display: block; width: 100%; max-height: min(40dvh, 340px); object-fit: contain; background: #222; }
.camera-controls, .photo-add { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.camera-controls { margin-top: 8px; }
.photo-add { min-height: 0; font-size: inherit; }
#read-portrait { margin-top: 8px; }

.photo-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.photo-section { min-width: 0; border: 1px solid #ccd6c6; border-radius: 14px; padding: clamp(12px, 2.5vw, 20px); background: #fffcf6; }
.photo-section-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.photo-section h2 { margin: 0; font-size: clamp(19px, 3.6vw, 26px); }
.photo-section-header p { margin: 0; color: #456d55; font-variant-numeric: tabular-nums; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-action {
  min-height: 52px; padding: 10px 18px; border: 2px solid #456d55; border-radius: 9px;
  font-size: clamp(16px, 2.5vw, 19px); font-weight: 700; text-align: center;
}
.photo-action-camera { background: #456d55; color: #fff; }
.photo-action-album { background: #edf3e9; color: #284c39; }
.photo-action:disabled { opacity: .55; }
.photo-action:focus-visible { outline: 3px solid #be7135; outline-offset: 2px; }
.photo-section .questionnaire-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 115px), 1fr)); margin-top: 10px; }
.photo-section .questionnaire-grid:empty { display: none; }
@media (max-width: 550px) and (orientation: portrait) {
  .photo-action { flex: 1 1 135px; padding-inline: 10px; }
  #app > .simple-footer .main-next { flex-shrink: 1; text-align: left; }
  #app > .simple-footer .back-button { flex-shrink: 0; }
  .simple-stage.wrap-stage:has(.questionnaire-page) { padding: 16px 14px 24px; }
  #app:has(.questionnaire-page) > .simple-footer { position: static; }
}
