/* Travel language only. Existing brand/appearance tokens supply every color. */
body[data-language-view] :is(.masthead,.mobile-nav,.footer){border:0}
body[data-language-view] :is(.j-series-nav,.frame-tools){border:0!important}
body[data-language-view] .shell{max-width:1180px}
body[data-language-view] :is(.j-breadcrumb,.frame-tools){max-width:1040px;margin-inline:auto}
body[data-language-view=unit] .frame-tools{align-items:center;margin-block:24px 30px}
body[data-language-view=unit] .frame-tools h1{font-size:clamp(32px,4.5vw,48px);margin:0;flex:1}
body[data-language-view] .frame-tools button{border-radius:var(--ptj-control-radius,9999px);flex:none}
body[data-language-view=unit] .unit-frame{border:0;border-radius:0;background:transparent;min-height:300px}
body[data-language-view=unit] #frame-host{max-width:1040px;margin-inline:auto}
body[data-language-view=language] .j-language-intro{padding-block:24px}
body[data-language-view=language] .j-language-intro .copy{margin-bottom:0}
body[data-language-view=language] .count{position:static;display:block;font-size:14px;margin-top:12px}
body[data-language-view=language] .count strong{display:inline;font:inherit;margin-right:6px}
body[data-language-view=language] .language-catalog{padding-top:8px}
body[data-language-view=language] .search{max-width:640px;margin-block:0 20px}
body[data-language-view=language] .search input{border-radius:var(--ptj-control-radius,9999px)}
body[data-language-view=language] .filters{gap:8px;padding:0;margin-bottom:30px}
body[data-language-view=language] .section-line{margin-block:0 20px}
body[data-language-view=language] .card{border:0;border-radius:16px}
body[data-language-view=language] .cards{gap:24px}
body[data-language-view=recap] :is(.panel,.panel-head,.recap-list li){border:0}
body[data-language-view=recap] .panel{border-radius:18px}
body[data-language-view=recap] .recap-list li+li{margin-top:18px}
body[data-language-view=recap] .actions{justify-content:flex-start}
body[data-language-view=recap] .actions>*{flex:0 1 auto;border-radius:999px;text-align:center}
.travel-unit-layout body{min-height:0!important}
.travel-catalog-unit :is(body>.shell,.cafe-page){width:100%;max-width:1040px;margin-inline:auto;padding-inline:0}
.travel-catalog-unit .unit-duplicate-title{display:none!important}
.travel-catalog-unit header:has(>.unit-duplicate-title):not(:has(button)){display:none!important}
.travel-unit-layout footer:not(.travel-unit-footer):not(:has(button,details)){display:none!important}
.travel-unit-layout :is(.small-rule,.interaction>.small-rule){display:none!important}
.travel-unit-layout :is(.mode-tabs,.scene-tabs,.chapters,.activity-nav){display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;margin-block:0 24px;padding:0;border:0!important}
.travel-unit-layout :is(.mode-tabs,.scene-tabs,.chapters,.activity-nav) :is(button,a){border-radius:var(--ptj-control-radius,9999px)!important;min-height:44px}
/* Scene and dialogue choices share one row instead of separate navigation blocks. */
html.travel-unit-layout .scene-mode-tabs button{flex:0 0 auto;white-space:nowrap}
html.travel-unit-layout body[data-travel-unit-family="supermarket"] .chapters button{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:6px}
html.travel-unit-layout body[data-travel-unit-family="supermarket"] .chapters span{font:inherit;margin:0}
@media(max-width:600px){
 html.travel-unit-layout .scene-mode-tabs{gap:6px}
 html.travel-unit-layout body[data-travel-unit-family="timeline"] .scene-tabs.scene-mode-tabs button{min-width:44px;padding-inline:6px!important;font-size:14px}
 html.travel-unit-layout body[data-travel-unit-family="supermarket"] nav.chapters{gap:6px}
 html.travel-unit-layout body[data-travel-unit-family="supermarket"] nav.chapters button[data-chapter]{min-width:44px;flex:1 1 0;padding-inline:6px!important;font-size:14px}
}
.travel-unit-layout :is(.masthead,.topbar,.menu-footer,.cafe-footer,.greeting-footer,main+footer,body>.shell>footer,.footer-tools,.ptj-unit-tools){border-top:0!important;border-bottom:0!important}
.travel-unit-layout :is(.masthead,.topbar):has(>a[hidden]):not(:has(>button)):not(:has(.tools)):not(:has(h1:not(.unit-duplicate-title))){display:none}
.travel-unit-layout .travel-unit-footer{box-sizing:border-box;position:static;inset:auto;display:grid!important;gap:24px;width:min(100%,620px);margin:24px auto 0;padding:0 16px 28px!important;border:0!important;text-align:left;color:var(--ptj-reading-ink);font:15px/1.6 'PingFang TC','Noto Sans TC',system-ui,sans-serif}
.travel-unit-layout .travel-unit-sources{display:grid;gap:16px;font-size:14px}
.travel-unit-layout .travel-unit-sources[hidden]{display:none}
.travel-unit-layout .travel-unit-sources :is(details,button){margin:0!important;padding-block:10px!important;border:0!important;background:transparent!important;color:inherit!important;text-align:left;min-height:44px}
.travel-unit-layout .travel-unit-sources details{padding:0!important}
.travel-unit-layout .travel-unit-sources summary{min-height:44px;align-content:center;cursor:pointer}
.travel-unit-layout .travel-return{display:block;margin:0;padding:0;border:0}
@media(max-width:620px){body[data-language-view] .shell{padding-inline:20px}body[data-language-view=unit] .frame-tools{gap:16px;align-items:flex-start}body[data-language-view=unit] .frame-tools h1{flex-basis:100%}body[data-language-view=language] .card-body{padding:18px 16px}body[data-language-view=language] .section-line{gap:12px;flex-wrap:wrap}body[data-language-view=language] .section-line>span{display:block}body[data-language-view=recap] .actions>*{flex:auto}.travel-unit-layout .travel-unit-footer{padding-inline:12px!important}}

/* Shared registered-unit layout. Existing appearance and learning tokens are unchanged. */
html.travel-unit-layout body .ptj-learning-controls{
 width:100%;margin:16px auto;padding:0;border:0;border-radius:0;
 background:none;color:var(--ptj-reading-ink);box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;gap:12px;
}
html.travel-unit-layout .ptj-learning-controls .lc-extensions:empty{display:none;min-height:0}
html.travel-unit-layout .ptj-learning-controls .lc-tray{max-width:100%}
html.travel-unit-layout.travel-catalog-unit body{padding-bottom:0!important}
html.travel-unit-layout .ptj-learning-controls :is(.audio-status,.audio-note,.cafe-playback-status){margin:0;color:inherit}
html.travel-unit-layout body[data-travel-unit-family="cafe"] .cafe-mode{gap:12px;padding-top:8px}
html.travel-unit-layout body[data-travel-unit-family="cafe"] .cafe-mode>.ptj-learning-controls{flex-basis:100%;max-width:620px;margin-block:4px 16px}
html.travel-unit-layout body[data-travel-unit-family="cafe"] .ptj-learning-controls .lc-owner-controls{display:flex!important;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px}
html.travel-unit-layout body[data-travel-unit-family="cafe"] .ptj-learning-controls .lc-player{width:auto}
html.travel-unit-layout body[data-travel-unit-family="cafe"] .ptj-learning-controls .cafe-playback-status{flex-basis:100%;min-height:0;margin:0}
html.travel-unit-layout body[data-travel-unit-family="cafe"] .ptj-learning-controls .cafe-playback-status:empty{display:none}
/* Coffee choices are the cup and its name, with no frame in any state.
   Match the real page ID to outrank legacy controls.css :is(#play,...) rules. */
html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option{
 background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
 color:inherit!important;min-height:44px;min-width:44px;translate:none!important;
}
html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option::after{content:none!important;display:none!important}
html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option .coffee-cup{transform:translateY(0);transition:transform .2s,filter .2s}
html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option:is(:hover,:focus-visible,[aria-pressed="true"]) .coffee-cup{
 transform:translateY(-3px);filter:brightness(1.06) drop-shadow(0 0 10px color-mix(in srgb,var(--ptj-interaction-light) 25%,transparent));
}
html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option:active .coffee-cup{transform:translateY(-1px) scale(.98)}
/* A self-sizing catalog frame must derive its scene height from width, not svh.
   The original owner still supplies the camera's inline walk transform. */
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="cafe"] .cafe-page{min-height:0!important;height:auto}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="cafe"] .cafe-view{width:100%;height:auto!important;min-height:0!important;aspect-ratio:12/7}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="cafe"] .camera{position:absolute;inset:0;width:100%;height:100%;margin:0}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="cafe"] .cafe-illustration{width:100%;height:100%}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="cafe"] .cafe-page[data-stage="menu"]{padding-bottom:0}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="cafe"] .menu-order-dock{position:static;inset:auto;margin-top:24px}
html.travel-unit-layout body[data-travel-unit-family="restaurant"] .menu-heading{padding-block:16px 24px}
html.travel-unit-layout body[data-travel-unit-family="restaurant"] .menu-heading>.ptj-learning-controls{width:fit-content;margin:16px auto 0}
/* Inputs yield space to their complete action label and wrap at narrow widths. */
html.travel-unit-layout body[data-travel-unit-family="restaurant"] .input-row{flex-wrap:wrap;gap:8px}
html.travel-unit-layout body[data-travel-unit-family="restaurant"] .input-row input{flex:1 1 160px;width:auto;min-width:0;max-width:100%}
html.travel-unit-layout body[data-travel-unit-family="restaurant"] .input-row button{flex:0 0 auto;width:max-content;min-width:max-content;max-width:100%;margin-inline-start:auto;white-space:nowrap;padding-inline:18px!important}
html.travel-unit-layout body[data-travel-unit-family="phrase"] .interaction>.ptj-learning-controls{margin:18px 0;max-width:100%;justify-items:start}
html.travel-unit-layout body[data-travel-unit-family="phrase"] .interaction>.ptj-learning-controls .lc-player{justify-items:start}
html.travel-unit-layout body[data-travel-unit-family="phrase"] .heading{margin-block:0 18px}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="phrase"] .heading{padding-block:0 12px;margin-block:0 8px}
html.travel-unit-layout .travel-unit-footer{margin-top:16px;gap:16px;padding-bottom:8px!important}
html.travel-unit-layout.travel-catalog-unit .travel-unit-footer:has(.travel-unit-sources[hidden]){display:none!important}
html.travel-unit-layout .travel-unit-navigation{display:flex;flex-wrap:wrap;gap:10px}
.travel-unit-followup{display:flex;align-items:stretch;gap:10px;margin-inline-start:auto}
.travel-unit-followup>*{flex:0 1 auto;white-space:nowrap}
html.travel-unit-layout dialog.travel-semantic-dialog{max-height:var(--travel-semantic-max-height,85dvh);overflow:auto}
html.travel-unit-layout .travel-semantic-content>summary[hidden]{display:none!important}
html.travel-unit-layout body .travel-unit-navigation .travel-return-link{
 display:inline-flex;justify-content:center;min-height:44px;padding:10px 16px!important;
 border:1px solid var(--glass-border)!important;border-radius:var(--ptj-control-radius,9999px)!important;
 background:var(--glass-bg)!important;color:var(--glass-ink)!important;box-shadow:var(--glass-shadow);
}
@media(max-width:620px){
 html.travel-unit-layout body[data-travel-unit-family="cafe"] .cafe-mode{padding-inline:12px}
 html.travel-unit-layout body[data-travel-unit-family="restaurant"] .menu-heading{padding-block:12px 20px}
 html.travel-unit-layout body[data-travel-unit-family="restaurant"] .categories{
  display:flex;flex-flow:row nowrap;position:static;min-width:0;max-width:100%;max-height:none;
  overflow-x:auto;overscroll-behavior-inline:contain;gap:8px;margin:0 0 20px;padding:0 0 12px;
 }
 html.travel-unit-layout body[data-travel-unit-family="restaurant"] .categories button{
  flex:0 0 auto;width:auto;min-width:130px;max-width:240px;white-space:normal;
 }
 html.travel-unit-layout .travel-unit-navigation{display:grid;grid-template-columns:1fr 1fr}
 html.travel-unit-layout .travel-unit-navigation .travel-unit-followup{grid-column:1/-1;margin-inline-start:0;display:flex}
 html.travel-unit-layout .travel-unit-navigation .travel-unit-followup>*{flex:1 1 0;min-width:0}
}
@media(prefers-reduced-motion:reduce){
 html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option .coffee-cup{transform:none!important;transition:none!important}
}


/* Hidden owner modes remain hidden even when a shared layout uses grid/flex. */
html.travel-unit-layout [hidden],html.travel-unit-layout body .ptj-learning-controls[hidden]{display:none!important}
html.travel-unit-layout body[data-travel-unit-family="cafe"] #cafe-page button.coffee-option :is(.coffee-name,.coffee-meaning,.coffee-alias){max-width:100%;min-width:0;white-space:normal!important;overflow-wrap:anywhere}
html.travel-unit-layout .travel-unit-navigation .travel-unit-next-button:disabled{opacity:.48;cursor:not-allowed}
html.travel-unit-layout body[data-travel-unit-family="timeline"] .caption{min-height:0;padding-block:16px 8px}
html.travel-unit-layout body[data-travel-unit-family="timeline"] #dialogue-panel>.ptj-learning-controls{max-width:680px}
html.travel-unit-layout body[data-travel-unit-family="timeline"] #practice-panel>.ptj-learning-controls{margin:16px 0;justify-items:start}
html.travel-unit-layout body[data-travel-unit-family="timeline"] #practice-panel>.ptj-learning-controls .lc-tray{margin:0}
html.travel-unit-layout body[data-travel-unit-family="directions"] .ptj-learning-controls{margin-block:16px}
html.travel-unit-layout body[data-travel-unit-family="places"] .practice-writing>.ptj-learning-controls{margin:0 0 16px}
/* Remove frame-height feedback from older scenes while preserving their art. */
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="name"] .scene{height:clamp(330px,45vw,510px)}
html.travel-unit-layout.travel-catalog-unit body[data-travel-unit-family="supermarket"] .stage{height:clamp(295px,50vw,590px)}
html.travel-unit-layout body[data-travel-unit-family="greeting"] .greeting{min-height:0!important;height:auto}
html.travel-unit-layout body[data-travel-unit-family="greeting"] .travel-scene-surface{position:relative;height:clamp(330px,42vw,440px);width:100%}
html.travel-unit-layout body[data-travel-unit-family="greeting"] .question-panel{padding:24px 20px 20px}
html.travel-unit-layout body[data-travel-unit-family="greeting"] .scene-control{position:static;inset:auto;margin:16px auto;text-align:center}
html.travel-unit-layout body[data-travel-unit-family="greeting"] .greeting:is([data-stage="question"],[data-stage="choices"],[data-stage="feedback"]) .travel-scene-surface{display:none}

/* Shared outer unit navigation: existing visual tokens stay in force. */
body[data-language-view] :is(.j-utilities,#mobile-nav) [data-library]{display:none}
body[data-language-view=unit] .j-utilities,
body[data-language-view=unit] #mobile-nav [data-action="recap"]{display:none}
body[data-language-view=unit] .frame-tools{margin-block:18px 24px;padding-bottom:0}
body[data-language-view=unit] .frame-tools h1{line-height:1.35}
body[data-language-view=unit] .travel-unit-navigation{max-width:1040px;margin:28px auto 0}
body[data-language-view=unit] .travel-unit-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:flex-start}
body[data-language-view=unit] .travel-unit-actions button{min-height:48px}
body[data-language-view=unit] .travel-unit-actions .travel-unit-followup{margin-inline-start:auto}
/* Appearance stays fixed at the shared bottom-right position on every unit. */
body[data-language-view=unit]>.shell>.footer{max-width:1040px;margin-inline:auto;margin-top:24px;padding-bottom:0}
body[data-language-view=unit]>.shell{padding-bottom:20px}
@media(max-width:620px){
 body[data-language-view=unit] .frame-tools{margin-block:16px 20px}
 body[data-language-view=unit] .travel-unit-navigation{margin-top:24px}
 body[data-language-view=unit] .travel-unit-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 body[data-language-view=unit] .travel-unit-actions button{width:100%;min-width:0;text-align:center;padding-inline:10px}
 body[data-language-view=unit] .travel-unit-actions .travel-unit-followup{grid-column:1/-1;margin-inline-start:0;display:flex}
 body[data-language-view=unit] .travel-unit-actions .travel-unit-followup button{flex:1 1 0;min-width:0}
}


/* Naked control groups use the reader ink; playback capsules keep their palette. */
html.travel-unit-layout body .ptj-learning-controls :is(.lc-position,.lc-switch,.lc-extensions>details,.lc-extensions>details :is(summary,p,li,ol,ul,span,strong,em)){
 color:var(--ptj-reading-ink)!important;
}
html.travel-unit-layout body .ptj-learning-controls .lc-extensions>details>summary{max-width:100%}
/* Match the legacy shared control rule's ID specificity for every real switch. */
html.travel-unit-layout body[data-ptj-reader-kind=activity] .ptj-learning-controls :is(#recorded-sound,#sound,button.lc-switch[data-learning-switch]).lc-switch{color:var(--ptj-reading-ink)!important}
/* Place illustrations and their sentences are unframed content choices. */
html.travel-unit-layout body[data-travel-unit-family="places"] #placesGrid button.place-choice{
 background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
 color:inherit!important;padding:0 0 16px!important;min-height:44px;min-width:0;white-space:normal;
}
html.travel-unit-layout body[data-travel-unit-family="places"] #placesGrid button.place-choice :is(.place-name,.card-sentence,.card-state){max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}

/* Dialogue belongs in document flow after the animation, as in luggage. */
html.travel-unit-layout .ptj-dialogue-caption{position:static;inset:auto;transform:none;width:100%;max-width:1040px;min-height:0;margin:0 auto;padding:16px 16px 8px;text-align:center;box-sizing:border-box;overflow-wrap:anywhere}
html.travel-unit-layout .ptj-dialogue-caption p{margin:4px 0}
html.travel-unit-layout .ptj-dialogue-caption [lang="pt-PT"]{font-size:clamp(1.25rem,2.7vw,1.65rem);line-height:1.5;white-space:normal}
html.travel-unit-layout .ptj-dialogue-caption [lang="zh-Hant-TW"]{display:block;font-size:1rem;line-height:1.6}
html.travel-unit-layout .ptj-dialogue-caption .ptj-scene-hint{margin-top:8px;font-size:1rem;line-height:1.6}
html.travel-unit-layout body[data-travel-unit-family="directions"] #scene{bottom:0}
html.travel-unit-layout body[data-travel-unit-family="name"] #scene-art{inset:22px 0}
/* Several existing information controls can share the space before next. */
.travel-unit-followup{flex-wrap:wrap}
.travel-unit-followup>*{min-width:0;white-space:normal;text-align:center}
@media(max-width:620px){
 .travel-unit-followup:has(> :not([hidden]) ~ :not([hidden]) ~ :not([hidden]))>:is(button,a){font-size:14px;padding-inline:4px!important}
}

html.travel-unit-layout .ptj-review-panel{position:static;inset:auto;max-width:1040px;margin:0 auto;padding:20px 16px;text-align:center;overflow-wrap:anywhere}
html.travel-unit-layout .ptj-review-panel h1{font-size:clamp(1.25rem,2.7vw,1.65rem);line-height:1.5;font-weight:500;margin:0}
html.travel-unit-layout .ptj-review-panel :is(.review-note,.review-answer){font-size:1rem;line-height:1.6;margin-block:12px 0;min-height:0}
/* Standalone filming entry also keeps external captions and information reachable. */
html.film-mode.travel-unit-layout body{overflow:auto}
html.film-mode.travel-unit-layout .film{width:100%;height:auto;aspect-ratio:16/9}
html.film-mode.travel-unit-layout .controls:not([hidden]){display:flex!important}
html.film-mode.travel-unit-layout :is(.audio-note,.practice,.transcript):not([hidden]){display:block!important}
/* Keep the existing three playback actions inside the narrow activity frame. */
@media(max-width:380px){
 html.travel-unit-layout body[data-travel-unit-family="timeline"] .lc-player{min-width:0;width:100%}
 html.travel-unit-layout body[data-travel-unit-family="timeline"] #dialogue-panel .lc-tray{width:100%;min-width:0;gap:4px;padding:6px}
 html.travel-unit-layout body[data-travel-unit-family="timeline"] #dialogue-panel .lc-tray :is(#previous,#next){min-width:44px;padding-inline:8px!important}
 html.travel-unit-layout body[data-travel-unit-family="timeline"] #dialogue-panel .lc-tray #play{min-width:0;flex:1 1 auto;padding-inline:8px!important;gap:6px;font-size:14px!important}
}
