/* v0.80.220 — Five-environment responsive foundation.
   Profiles are assigned by js/responsive-profile.js.
   The goal is not scale-to-fit; it is stable reading width, reachable actions,
   and intentional information density in every supported environment. */

html[data-responsive-profile]{
  --rf-touch:48px;
  --rf-edge:14px;
  --rf-gap:12px;
  --rf-reading:42rem;
  --rf-modal-max:760px;
  --rf-modal-radius:24px;
  --rf-body-size:15px;
  --rf-body-leading:1.78;
  --rf-hud-height:58px;
  --rf-action-height:74px;
  --rf-story-image:34dvh;
  --rf-immersive-max:980px;
}
html[data-responsive-profile] body,
html[data-responsive-profile] button,
html[data-responsive-profile] input,
html[data-responsive-profile] select,
html[data-responsive-profile] textarea{writing-mode:horizontal-tb;text-orientation:mixed}
html[data-responsive-profile] .modal-card p,
html[data-responsive-profile] .modal-card li{line-height:var(--rf-body-leading)}
html[data-responsive-profile] #modal:not(.landmark-scene-modal) #modalContent{min-width:0;max-width:100%}
html[data-responsive-profile] #modal:not(.landmark-scene-modal) .modal-card{box-sizing:border-box;max-width:var(--rf-modal-max)}
html[data-responsive-profile] .modal-card button,
html[data-responsive-profile] .action-btn,
html[data-responsive-profile] .nav-btn{min-height:var(--rf-touch)}
html[data-responsive-profile] .quiet-activity-card h3,
html[data-responsive-profile] .quiet-activity-card p,
html[data-responsive-profile] .quiet-activity-card button,
html[data-responsive-profile] .mailbox-panel *,
html[data-responsive-profile] .chapel-record-panel *{writing-mode:horizontal-tb!important;text-orientation:mixed!important;word-break:normal;overflow-wrap:break-word}

/* Mobile portrait — one task at a time, thumb reachable, full-width reading. */
html[data-responsive-profile="mobile-portrait"]{
  --rf-touch:48px;--rf-edge:8px;--rf-gap:9px;--rf-reading:100%;--rf-modal-max:100%;
  --rf-modal-radius:22px;--rf-body-size:14px;--rf-body-leading:1.74;--rf-hud-height:56px;
  --rf-story-image:34dvh;
}
html[data-responsive-profile="mobile-portrait"] .pc-sidebar,
html[data-responsive-profile="mobile-portrait"] .pc-sidebar-restore-button,
html[data-responsive-profile="mobile-portrait"] .keyboard-help-button{display:none!important}
html[data-responsive-profile="mobile-portrait"] .game-stage{display:flex!important;grid-template-columns:none!important;padding-bottom:0!important}
html[data-responsive-profile="mobile-portrait"] #modal:not(.landmark-scene-modal){padding:var(--rf-edge)!important;place-items:center!important}
html[data-responsive-profile="mobile-portrait"] #modal:not(.landmark-scene-modal) .modal-card{width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;border-radius:var(--rf-modal-radius)!important}
html[data-responsive-profile="mobile-portrait"] .quiet-activity-grid{grid-template-columns:1fr!important}
html[data-responsive-profile="mobile-portrait"] .mailbox-panel,
html[data-responsive-profile="mobile-portrait"] .chapel-record-panel{display:flex!important;flex-direction:column!important;gap:10px!important}

/* Mobile landscape — preserve vertical space, use two panes only when it reduces scrolling. */
html[data-responsive-profile="mobile-landscape"]{
  --rf-touch:44px;--rf-edge:6px;--rf-gap:8px;--rf-reading:38rem;--rf-modal-max:920px;
  --rf-modal-radius:18px;--rf-body-size:13px;--rf-body-leading:1.62;--rf-hud-height:48px;
  --rf-action-height:56px;--rf-story-image:100%;
}
html[data-responsive-profile="mobile-landscape"] .pc-sidebar,
html[data-responsive-profile="mobile-landscape"] .pc-sidebar-restore-button,
html[data-responsive-profile="mobile-landscape"] .keyboard-help-button{display:none!important}
html[data-responsive-profile="mobile-landscape"] .game-stage{display:flex!important;grid-template-columns:none!important;padding-bottom:0!important}
html[data-responsive-profile="mobile-landscape"] .hud.hud-single-row{height:var(--rf-hud-height)!important;min-height:var(--rf-hud-height)!important;padding-block:2px!important}
html[data-responsive-profile="mobile-landscape"] .hud.hud-single-row .hud-pill,
html[data-responsive-profile="mobile-landscape"] .hud.hud-single-row .hud-icon-button{height:40px!important;min-height:40px!important}
html[data-responsive-profile="mobile-landscape"] #modal:not(.landmark-scene-modal){padding:6px!important}
html[data-responsive-profile="mobile-landscape"] #modal:not(.landmark-scene-modal) .modal-card{width:min(calc(100vw - 12px),920px)!important;max-height:calc(100dvh - 12px)!important;border-radius:18px!important;padding-top:16px!important;padding-bottom:12px!important}
html[data-responsive-profile="mobile-landscape"] .quiet-activity-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
html[data-responsive-profile="mobile-landscape"] .quiet-activity-card{min-width:0!important}
html[data-responsive-profile="mobile-landscape"] .mailbox-panel,
html[data-responsive-profile="mobile-landscape"] .chapel-record-panel{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:10px!important;align-items:start!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .modal-card{width:calc(100vw - 12px)!important;height:calc(100dvh - 12px)!important;max-height:calc(100dvh - 12px)!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-longform-shell{display:grid!important;grid-template-columns:minmax(240px,42%) minmax(0,1fr)!important;grid-template-rows:1fr!important;gap:0!important;padding:0 14px 58px 0!important;height:100%!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-panel-scene-wrap{grid-column:1!important;grid-row:1!important;width:100%!important;height:100%!important;margin:0!important;border-radius:18px 0 0 18px!important;flex:none!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-panel-copy{grid-column:2!important;grid-row:1!important;padding:14px 16px 4px!important;overflow:hidden!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-panel-portrait-wrap{display:none!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-panel-title{font-size:clamp(20px,4.1vw,27px)!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-panel-text{font-size:13.5px!important;line-height:1.68!important}
html[data-responsive-profile="mobile-landscape"] #modal.story-longform-modal .story-panel-next{left:auto!important;right:16px!important;bottom:8px!important;width:min(48%,260px)!important;height:44px!important;min-height:44px!important}

/* Tablet portrait — generous one-column reading, larger touch targets. */
html[data-responsive-profile="tablet-portrait"]{
  --rf-touch:52px;--rf-edge:18px;--rf-gap:14px;--rf-reading:44rem;--rf-modal-max:760px;
  --rf-modal-radius:26px;--rf-body-size:15px;--rf-body-leading:1.82;--rf-hud-height:62px;
  --rf-story-image:32dvh;
}
html[data-responsive-profile="tablet-portrait"] .pc-sidebar,
html[data-responsive-profile="tablet-portrait"] .pc-sidebar-restore-button,
html[data-responsive-profile="tablet-portrait"] .keyboard-help-button{display:none!important}
html[data-responsive-profile="tablet-portrait"] .game-stage{display:flex!important;grid-template-columns:none!important}
html[data-responsive-profile="tablet-portrait"] #modal:not(.landmark-scene-modal) .modal-card{width:min(calc(100vw - 36px),760px)!important;max-height:calc(100dvh - 36px)!important}
html[data-responsive-profile="tablet-portrait"] .quiet-activity-grid{grid-template-columns:1fr!important;gap:12px!important}
html[data-responsive-profile="tablet-portrait"] .mailbox-panel,
html[data-responsive-profile="tablet-portrait"] .chapel-record-panel{display:flex!important;flex-direction:column!important;gap:12px!important}
html[data-responsive-profile="tablet-portrait"] #modal.story-longform-modal .modal-card{width:min(calc(100vw - 36px),760px)!important}

/* Tablet landscape — wide canvas, touch-first. Use balanced panes, never desktop sidebar density. */
html[data-responsive-profile="tablet-landscape"]{
  --rf-touch:50px;--rf-edge:16px;--rf-gap:14px;--rf-reading:46rem;--rf-modal-max:960px;
  --rf-modal-radius:24px;--rf-body-size:14px;--rf-body-leading:1.76;--rf-hud-height:58px;
  --rf-story-image:100%;--rf-immersive-max:1100px;
}
html[data-responsive-profile="tablet-landscape"] .pc-sidebar,
html[data-responsive-profile="tablet-landscape"] .pc-sidebar-restore-button,
html[data-responsive-profile="tablet-landscape"] .keyboard-help-button{display:none!important}
html[data-responsive-profile="tablet-landscape"] .game-stage{display:flex!important;grid-template-columns:none!important;padding-bottom:0!important}
html[data-responsive-profile="tablet-landscape"] #modal:not(.landmark-scene-modal):not(.story-longform-modal) .modal-card{width:min(calc(100vw - 32px),960px)!important;max-height:calc(100dvh - 32px)!important}
html[data-responsive-profile="tablet-landscape"] .quiet-activity-grid{grid-template-columns:1fr!important;gap:10px!important}
html[data-responsive-profile="tablet-landscape"] .quiet-activity-card{grid-template-columns:52px minmax(0,1fr) auto!important;grid-template-areas:"icon title button" "icon copy button"!important;column-gap:12px!important;min-width:0!important}
html[data-responsive-profile="tablet-landscape"] .quiet-activity-card button{max-width:180px!important}
html[data-responsive-profile="tablet-landscape"] .mailbox-panel,
html[data-responsive-profile="tablet-landscape"] .chapel-record-panel{display:flex!important;flex-direction:column!important;gap:12px!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .modal-card{width:min(calc(100vw - 32px),1100px)!important;height:min(calc(100dvh - 32px),760px)!important;max-height:calc(100dvh - 32px)!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-longform-shell{display:grid!important;grid-template-columns:minmax(340px,46%) minmax(0,1fr)!important;grid-template-rows:1fr!important;gap:0!important;padding:0 24px 72px 0!important;height:100%!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-panel-scene-wrap{grid-column:1!important;grid-row:1!important;width:100%!important;height:100%!important;margin:0!important;border-radius:24px 0 0 24px!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-panel-portrait-wrap{display:none!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-panel-copy{grid-column:2!important;grid-row:1!important;padding:22px 26px 6px!important;overflow:hidden!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-panel-title{font-size:clamp(26px,3vw,34px)!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-panel-text{font-size:15.5px!important;line-height:1.86!important}
html[data-responsive-profile="tablet-landscape"] #modal.story-longform-modal .story-panel-next{right:24px!important;bottom:14px!important;width:min(42%,300px)!important}
html[data-responsive-profile="tablet-landscape"] #modal.landmark-scene-modal .modal-card{width:min(calc(100vw - 24px),var(--rf-immersive-max))!important;max-width:var(--rf-immersive-max)!important;height:min(calc(100dvh - 24px),820px)!important;max-height:calc(100dvh - 24px)!important}

/* PC landscape — world + contextual sidebar, mouse/keyboard affordances, bounded reading line length. */
html[data-responsive-profile="pc-landscape"]{
  --rf-touch:44px;--rf-edge:20px;--rf-gap:16px;--rf-reading:48rem;--rf-modal-max:1040px;
  --rf-modal-radius:26px;--rf-body-size:15px;--rf-body-leading:1.8;--rf-hud-height:60px;
  --rf-story-image:40%;--rf-immersive-max:1200px;
}
html[data-responsive-profile="pc-landscape"] .game-stage:not(.pc-sidebar-collapsed){display:grid!important;grid-template-columns:minmax(0,1fr) clamp(310px,22vw,380px)!important}
/* Defensive layout: even if a device is treated as PC, sidebar children may
   never fall back to the browser's default horizontal flex direction. */
html[data-responsive-profile="pc-landscape"] .pc-sidebar{display:flex;flex-direction:column;min-width:0;overflow-y:auto}
html[data-responsive-profile="tablet-landscape"] .game-stage>.world{flex:1 1 auto;width:100%;min-width:0}
html[data-responsive-profile="pc-landscape"] #modal:not(.landmark-scene-modal):not(.story-longform-modal) .modal-card{width:min(calc(100vw - 48px),1040px)!important;max-height:calc(100dvh - 48px)!important}
html[data-responsive-profile="pc-landscape"] .quiet-activity-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
html[data-responsive-profile="pc-landscape"] .mailbox-panel,
html[data-responsive-profile="pc-landscape"] .chapel-record-panel{max-width:920px;margin-inline:auto}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .modal-card{width:min(calc(100vw - 56px),1180px)!important;height:min(calc(100dvh - 56px),820px)!important;max-height:calc(100dvh - 56px)!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-longform-shell{display:grid!important;grid-template-columns:minmax(420px,48%) minmax(0,1fr)!important;grid-template-rows:1fr!important;gap:0!important;padding:0 30px 76px 0!important;height:100%!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-panel-scene-wrap{grid-column:1!important;grid-row:1!important;width:100%!important;height:100%!important;margin:0!important;border-radius:26px 0 0 26px!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-panel-portrait-wrap{display:none!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-panel-copy{grid-column:2!important;grid-row:1!important;padding:28px 30px 8px!important;overflow:hidden!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-panel-title{font-size:clamp(28px,2.5vw,38px)!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-panel-text{font-size:16px!important;line-height:1.92!important;max-width:42em!important}
html[data-responsive-profile="pc-landscape"] #modal.story-longform-modal .story-panel-next{right:30px!important;bottom:16px!important;min-width:210px!important}
html[data-responsive-profile="pc-landscape"] #modal.landmark-scene-modal .modal-card{width:min(calc(100vw - 40px),var(--rf-immersive-max))!important;max-width:var(--rf-immersive-max)!important;height:min(calc(100dvh - 40px),860px)!important;max-height:calc(100dvh - 40px)!important}

/* Shared safeguards: no accidental vertical Japanese layout; no narrow overflow columns. */
html[data-responsive-profile] .quiet-activity-grid,
html[data-responsive-profile] .mailbox-panel,
html[data-responsive-profile] .chapel-record-panel,
html[data-responsive-profile] .story-panel-copy,
html[data-responsive-profile] .story-panel-text{min-width:0!important}
html[data-responsive-profile] .story-panel-title,
html[data-responsive-profile] .story-panel-text,
html[data-responsive-profile] .quiet-activity-card,
html[data-responsive-profile] .mailbox-panel,
html[data-responsive-profile] .chapel-record-panel{writing-mode:horizontal-tb!important;text-orientation:mixed!important}
@media(prefers-reduced-motion:reduce){html[data-responsive-profile] *{scroll-behavior:auto!important}}

/* Title-screen composition follows the same five profiles. */
html[data-responsive-profile="mobile-portrait"] #titleScreen .title-controls{width:min(88vw,390px)!important;max-width:390px!important}
html[data-responsive-profile="mobile-portrait"] #titleScreen .title-main-actions{width:100%!important;display:flex!important;flex-direction:column!important;gap:10px!important}
html[data-responsive-profile="mobile-portrait"] #titleScreen .title-main-actions .primary,
html[data-responsive-profile="mobile-portrait"] #titleScreen .title-main-actions .secondary{width:100%!important;min-height:50px!important}
html[data-responsive-profile="mobile-landscape"] #titleScreen .title-layout{align-items:flex-end!important;padding-bottom:max(8px,env(safe-area-inset-bottom) + 4px)!important}
html[data-responsive-profile="mobile-landscape"] #titleScreen .title-controls{max-width:86vw!important}
html[data-responsive-profile="mobile-landscape"] #titleScreen .title-main-actions{display:flex!important;flex-direction:row!important;gap:10px!important}
html[data-responsive-profile="mobile-landscape"] #titleScreen .title-main-actions .primary,
html[data-responsive-profile="mobile-landscape"] #titleScreen .title-main-actions .secondary{width:min(38vw,260px)!important;min-height:42px!important;font-size:13px!important;padding-block:8px!important}
html[data-responsive-profile="tablet-portrait"] #titleScreen .title-controls{width:min(72vw,520px)!important}
html[data-responsive-profile="tablet-portrait"] #titleScreen .title-main-actions{display:flex!important;flex-direction:column!important;width:100%!important;gap:12px!important}
html[data-responsive-profile="tablet-portrait"] #titleScreen .title-main-actions .primary,
html[data-responsive-profile="tablet-portrait"] #titleScreen .title-main-actions .secondary{width:100%!important;min-height:54px!important}
html[data-responsive-profile="tablet-landscape"] #titleScreen .title-controls{max-width:min(760px,78vw)!important}
html[data-responsive-profile="tablet-landscape"] #titleScreen .title-main-actions{display:flex!important;flex-direction:row!important;gap:14px!important}
html[data-responsive-profile="tablet-landscape"] #titleScreen .title-main-actions .primary,
html[data-responsive-profile="tablet-landscape"] #titleScreen .title-main-actions .secondary{width:min(30vw,310px)!important;min-height:52px!important}
html[data-responsive-profile="pc-landscape"] #titleScreen .title-controls{max-width:min(820px,70vw)!important}
html[data-responsive-profile="pc-landscape"] #titleScreen .title-main-actions{display:flex!important;flex-direction:row!important;gap:16px!important}
html[data-responsive-profile="pc-landscape"] #titleScreen .title-main-actions .primary,
html[data-responsive-profile="pc-landscape"] #titleScreen .title-main-actions .secondary{width:clamp(240px,22vw,320px)!important;min-height:54px!important}

/* v0.80.220 — Organ practice unified responsive flow
   Song -> Voice -> Performance -> Result -> Song must render identically regardless of entry path. */
html[data-responsive-profile] #modal.practice-quick-modal .practice-quick-shell,
html[data-responsive-profile] #modal.practice-voice-modal .practice-voice-shell{
  width:100%!important;min-width:0!important;height:auto!important;min-height:0!important;
  display:grid!important;grid-template-rows:auto auto auto!important;align-content:start!important;
  gap:clamp(8px,1.3dvh,14px)!important;
}
html[data-responsive-profile] #modal.practice-quick-modal .practice-quick-song,
html[data-responsive-profile] #modal.practice-voice-modal .practice-voice-stage{
  width:100%!important;min-width:0!important;min-height:0!important;
}
html[data-responsive-profile] #modal.practice-quick-modal .practice-quick-actions,
html[data-responsive-profile] #modal.practice-voice-modal .practice-voice-actions{
  width:min(100%,620px)!important;margin-inline:auto!important;
}
html[data-responsive-profile] #modal.practice-quick-modal .practice-quick-song-card,
html[data-responsive-profile] #modal.practice-voice-modal .practice-voice-card{
  min-width:0!important;box-sizing:border-box!important;
}
html[data-responsive-profile] #modal.practice-quick-modal .practice-quick-arrow,
html[data-responsive-profile] #modal.practice-voice-modal .practice-voice-arrow{
  flex:0 0 auto!important;touch-action:manipulation!important;
}

/* Performance chrome is flow-based, not absolutely overlaid on the title. */
html[data-responsive-profile] #modal.practice-streamlined-modal #modalContent{
  width:100%!important;height:100%!important;min-height:0!important;
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:clamp(4px,.8dvh,8px)!important;overflow:hidden!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal #modalTitle{
  position:static!important;flex:0 0 auto!important;
  margin:0 clamp(54px,8vw,76px) 0!important;padding:0!important;
  min-height:1.25em!important;max-width:none!important;
  font-size:clamp(17px,2.25dvh,25px)!important;line-height:1.2!important;
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  text-align:center!important;text-wrap:balance!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .practice-mode-chip{
  position:static!important;flex:0 0 auto!important;align-self:center!important;
  margin:0!important;padding:3px 9px!important;font-size:clamp(7px,1.05dvh,10px)!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .practice-organ-registration{
  position:static!important;flex:0 0 auto!important;align-self:center!important;
  width:auto!important;max-width:calc(100% - 36px)!important;margin:0!important;padding:3px 9px!important;
  font-size:clamp(7px,1.05dvh,10px)!important;line-height:1.25!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .rhythm-stage{
  flex:1 1 auto!important;width:100%!important;min-width:0!important;min-height:0!important;
  height:auto!important;max-width:none!important;margin:0!important;box-sizing:border-box!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .rhythm-keys{
  flex:0 0 auto!important;width:100%!important;min-width:0!important;margin:0!important;
  gap:clamp(3px,.75vw,7px)!important;box-sizing:border-box!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .rhythm-key{
  min-width:0!important;overflow:hidden!important;padding-inline:2px!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .rhythm-key b,
html[data-responsive-profile] #modal.practice-streamlined-modal .rhythm-key small{
  max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
html[data-responsive-profile] #modal.practice-streamlined-modal .practice-status{
  flex:0 0 auto!important;min-height:1.35em!important;margin:0!important;
}

/* Mobile portrait — one calm column and stable performance proportions. */
html[data-responsive-profile="mobile-portrait"] #modal.practice-quick-modal .modal-card,
html[data-responsive-profile="mobile-portrait"] #modal.practice-voice-modal .modal-card{
  width:calc(100vw - 16px)!important;height:auto!important;max-height:calc(100dvh - 16px)!important;
  padding:clamp(16px,2dvh,22px) 14px max(16px,env(safe-area-inset-bottom))!important;overflow:auto!important;
}
html[data-responsive-profile="mobile-portrait"] #modal.practice-quick-modal .practice-quick-song-card,
html[data-responsive-profile="mobile-portrait"] #modal.practice-voice-modal .practice-voice-card{
  min-height:clamp(250px,34dvh,360px)!important;padding:16px 14px!important;
}
html[data-responsive-profile="mobile-portrait"] #modal.practice-streamlined-modal .modal-card{
  width:calc(100vw - 12px)!important;height:calc(100dvh - 12px)!important;max-height:calc(100dvh - 12px)!important;
  padding:12px 10px max(10px,env(safe-area-inset-bottom))!important;overflow:hidden!important;
}
html[data-responsive-profile="mobile-portrait"] #modal.practice-streamlined-modal .rhythm-stage{
  min-height:clamp(250px,48dvh,470px)!important;border-radius:18px!important;
}
html[data-responsive-profile="mobile-portrait"] #modal.practice-streamlined-modal .rhythm-key{
  min-height:clamp(64px,9dvh,86px)!important;border-radius:11px!important;
}
html[data-responsive-profile="mobile-portrait"] #modal.practice-streamlined-modal .rhythm-key b{font-size:clamp(12px,3.3vw,19px)!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-streamlined-modal .rhythm-key small{font-size:clamp(6px,1.7vw,9px)!important}

/* Mobile landscape — stage first, compact chrome. */
html[data-responsive-profile="mobile-landscape"] #modal.practice-quick-modal .practice-quick-shell,
html[data-responsive-profile="mobile-landscape"] #modal.practice-voice-modal .practice-voice-shell{
  grid-template-columns:minmax(0,1fr) minmax(220px,38%)!important;grid-template-rows:auto 1fr!important;
  column-gap:12px!important;row-gap:4px!important;
}
html[data-responsive-profile="mobile-landscape"] #modal.practice-quick-modal .practice-quick-header,
html[data-responsive-profile="mobile-landscape"] #modal.practice-voice-modal .practice-voice-header{grid-column:1/-1!important}
html[data-responsive-profile="mobile-landscape"] #modal.practice-quick-modal .practice-quick-actions,
html[data-responsive-profile="mobile-landscape"] #modal.practice-voice-modal .practice-voice-actions{grid-column:2!important;align-self:center!important}
html[data-responsive-profile="mobile-landscape"] #modal.practice-streamlined-modal #modalTitle{font-size:clamp(14px,3.2dvh,18px)!important}
html[data-responsive-profile="mobile-landscape"] #modal.practice-streamlined-modal .rhythm-stage{min-height:clamp(150px,49dvh,280px)!important}
html[data-responsive-profile="mobile-landscape"] #modal.practice-streamlined-modal .rhythm-key{min-height:clamp(42px,12dvh,62px)!important}

/* Tablet portrait — familiar one-column flow with more breathing room. */
html[data-responsive-profile="tablet-portrait"] #modal.practice-quick-modal .modal-card,
html[data-responsive-profile="tablet-portrait"] #modal.practice-voice-modal .modal-card{width:min(calc(100vw - 36px),760px)!important;height:auto!important;max-height:calc(100dvh - 36px)!important}
html[data-responsive-profile="tablet-portrait"] #modal.practice-streamlined-modal .modal-card{width:min(calc(100vw - 28px),860px)!important;height:min(calc(100dvh - 28px),940px)!important}
html[data-responsive-profile="tablet-portrait"] #modal.practice-streamlined-modal .rhythm-stage{min-height:clamp(330px,50dvh,580px)!important}
html[data-responsive-profile="tablet-portrait"] #modal.practice-streamlined-modal .rhythm-key{min-height:68px!important}

/* Tablet landscape — controlled two-zone picker, stable full-width performance. */
html[data-responsive-profile="tablet-landscape"] #modal.practice-quick-modal .modal-card,
html[data-responsive-profile="tablet-landscape"] #modal.practice-voice-modal .modal-card{width:min(calc(100vw - 32px),980px)!important;height:auto!important;max-height:calc(100dvh - 32px)!important}
html[data-responsive-profile="tablet-landscape"] #modal.practice-quick-modal .practice-quick-shell,
html[data-responsive-profile="tablet-landscape"] #modal.practice-voice-modal .practice-voice-shell{
  grid-template-columns:minmax(0,1fr) minmax(300px,38%)!important;grid-template-rows:auto 1fr!important;column-gap:18px!important;
}
html[data-responsive-profile="tablet-landscape"] #modal.practice-quick-modal .practice-quick-header,
html[data-responsive-profile="tablet-landscape"] #modal.practice-voice-modal .practice-voice-header{grid-column:1/-1!important}
html[data-responsive-profile="tablet-landscape"] #modal.practice-quick-modal .practice-quick-actions,
html[data-responsive-profile="tablet-landscape"] #modal.practice-voice-modal .practice-voice-actions{grid-column:2!important;align-self:center!important}
html[data-responsive-profile="tablet-landscape"] #modal.practice-streamlined-modal .modal-card{width:min(calc(100vw - 28px),1120px)!important;height:min(calc(100dvh - 28px),820px)!important}
html[data-responsive-profile="tablet-landscape"] #modal.practice-streamlined-modal .rhythm-stage{min-height:clamp(270px,51dvh,470px)!important}
html[data-responsive-profile="tablet-landscape"] #modal.practice-streamlined-modal .rhythm-key{min-height:58px!important}

/* PC landscape — same flow, wider content only; no alternate experience. */
html[data-responsive-profile="pc-landscape"] #modal.practice-quick-modal .modal-card,
html[data-responsive-profile="pc-landscape"] #modal.practice-voice-modal .modal-card{width:min(calc(100vw - 56px),1040px)!important;height:auto!important;max-height:calc(100dvh - 56px)!important}
html[data-responsive-profile="pc-landscape"] #modal.practice-quick-modal .practice-quick-shell,
html[data-responsive-profile="pc-landscape"] #modal.practice-voice-modal .practice-voice-shell{
  grid-template-columns:minmax(0,1fr) minmax(320px,36%)!important;grid-template-rows:auto 1fr!important;column-gap:22px!important;
}
html[data-responsive-profile="pc-landscape"] #modal.practice-quick-modal .practice-quick-header,
html[data-responsive-profile="pc-landscape"] #modal.practice-voice-modal .practice-voice-header{grid-column:1/-1!important}
html[data-responsive-profile="pc-landscape"] #modal.practice-quick-modal .practice-quick-actions,
html[data-responsive-profile="pc-landscape"] #modal.practice-voice-modal .practice-voice-actions{grid-column:2!important;align-self:center!important}
html[data-responsive-profile="pc-landscape"] #modal.practice-streamlined-modal .modal-card{width:min(calc(100vw - 50px),1180px)!important;height:min(calc(100dvh - 50px),860px)!important}
html[data-responsive-profile="pc-landscape"] #modal.practice-streamlined-modal .rhythm-stage{min-height:clamp(300px,52dvh,520px)!important}
html[data-responsive-profile="pc-landscape"] #modal.practice-streamlined-modal .rhythm-key{min-height:62px!important}

/* v0.80.220 — Result experience across the five responsive profiles. */
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .modal-card{
  width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important;border-radius:24px!important;
}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-hero{grid-template-columns:1fr!important;min-height:0!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-art{min-height:0!important;aspect-ratio:16/9!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-art:after{background:linear-gradient(180deg,transparent 62%,rgba(248,243,233,.94) 100%)!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-summary{padding:16px 17px 14px!important;gap:8px!important;text-align:center!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-summary h2{font-size:clamp(25px,7.4vw,34px)!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-copy{font-size:11.5px!important;line-height:1.65!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-metrics{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-metrics>span{padding:7px 3px!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-metrics small{font-size:6px!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-metrics b{font-size:12px!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-world{text-align:left!important}
html[data-responsive-profile="mobile-portrait"] .practice-result-v2-lower{padding:10px 14px max(14px,env(safe-area-inset-bottom))!important}

html[data-responsive-profile="mobile-landscape"] #modal.practice-result-v2-modal .modal-card{
  width:min(calc(100vw - 12px),980px)!important;height:calc(100dvh - 12px)!important;max-height:calc(100dvh - 12px)!important;border-radius:19px!important;
}
html[data-responsive-profile="mobile-landscape"] #modal.practice-result-v2-modal #modalContent{height:100%!important;overflow:auto!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-hero{grid-template-columns:minmax(0,55%) minmax(260px,45%)!important;min-height:min(74dvh,480px)!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-art{min-height:100%!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-summary{padding:20px 22px 16px!important;gap:7px!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-summary h2{font-size:clamp(24px,5dvh,34px)!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-copy{font-size:10px!important;line-height:1.55!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-metrics{gap:4px!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-metrics>span{padding:6px 7px!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-world{padding:8px 9px!important}
html[data-responsive-profile="mobile-landscape"] .practice-result-v2-lower{padding:8px 14px 12px!important}

html[data-responsive-profile="tablet-portrait"] #modal.practice-result-v2-modal .modal-card{
  width:min(calc(100vw - 30px),820px)!important;max-height:calc(100dvh - 30px)!important;border-radius:28px!important;
}
html[data-responsive-profile="tablet-portrait"] .practice-result-v2-hero{grid-template-columns:1fr!important;min-height:0!important}
html[data-responsive-profile="tablet-portrait"] .practice-result-v2-art{aspect-ratio:16/8.6!important;min-height:0!important}
html[data-responsive-profile="tablet-portrait"] .practice-result-v2-art:after{background:linear-gradient(180deg,transparent 64%,rgba(248,243,233,.93) 100%)!important}
html[data-responsive-profile="tablet-portrait"] .practice-result-v2-summary{padding:22px 28px 20px!important;text-align:center!important}
html[data-responsive-profile="tablet-portrait"] .practice-result-v2-metrics{grid-template-columns:repeat(4,minmax(0,1fr))!important}
html[data-responsive-profile="tablet-portrait"] .practice-result-v2-world{text-align:left!important}

html[data-responsive-profile="tablet-landscape"] #modal.practice-result-v2-modal .modal-card{
  width:min(calc(100vw - 34px),1120px)!important;height:min(calc(100dvh - 34px),760px)!important;max-height:calc(100dvh - 34px)!important;border-radius:28px!important;
}
html[data-responsive-profile="tablet-landscape"] #modal.practice-result-v2-modal #modalContent{height:100%!important}
html[data-responsive-profile="tablet-landscape"] .practice-result-v2-hero{grid-template-columns:minmax(0,57%) minmax(320px,43%)!important;min-height:470px!important}
html[data-responsive-profile="tablet-landscape"] .practice-result-v2-summary{padding:34px 32px 28px!important}
html[data-responsive-profile="tablet-landscape"] .practice-result-v2-lower{padding:12px 20px 18px!important}

html[data-responsive-profile="pc-landscape"] #modal.practice-result-v2-modal .modal-card{
  width:min(calc(100vw - 64px),1180px)!important;height:min(calc(100dvh - 64px),790px)!important;max-height:calc(100dvh - 64px)!important;border-radius:30px!important;
}
html[data-responsive-profile="pc-landscape"] #modal.practice-result-v2-modal #modalContent{height:100%!important}
html[data-responsive-profile="pc-landscape"] .practice-result-v2-hero{grid-template-columns:minmax(0,60%) minmax(340px,40%)!important;min-height:500px!important}
html[data-responsive-profile="pc-landscape"] .practice-result-v2-summary{padding:42px 38px 34px!important}
html[data-responsive-profile="pc-landscape"] .practice-result-v2-lower{padding:13px 24px 20px!important}

/* v0.80.286: Optional single pedal lane stays adjacent to manual keys. */
.practice-pedal{margin:6px 0;padding:8px 10px;border:1px solid #9d8667;border-radius:12px;background:#f5efe4;color:#3e382b}
.practice-pedal label{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:700}
.practice-pedal select{font:inherit;min-height:36px;padding:4px 10px}
.practice-pedal [hidden]{display:none!important}
.practice-pedal p{font-size:11px;margin:5px 0}
.practice-pedal button{width:100%;min-height:64px;touch-action:none;user-select:none;background:#66523b;color:white;border:3px solid transparent;border-radius:9px;display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:6px 12px}
.practice-pedal button small{font-size:11px}.practice-pedal button span{grid-column:1/-1;font-size:13px}
.practice-pedal progress{grid-column:1/-1;width:100%;height:7px;accent-color:#d6bd66}
.practice-pedal button.ready{border-color:#dfbe47}.practice-pedal button.holding{background:#355c48;border-color:#a6d8b0}
.practice-pedal [data-pedal-record]{font-size:11px}.practice-pedal-result{font-size:13px;line-height:1.5}
#modal.practice-live-input .practice-pedal>label{display:none}
#modal.practice-live-input .practice-pedal p{display:none}
#modal.practice-live-input .practice-pedal:not(.pedal-enabled){display:none}
html[data-responsive-profile] #modal.practice-streamlined-modal:has(.pedal-enabled) .rhythm-stage{min-height:140px!important;height:clamp(140px,30dvh,310px)!important}
@media(orientation:landscape) and (max-height:600px){html[data-responsive-profile] #modal.practice-streamlined-modal:has(.pedal-enabled) .rhythm-stage{height:140px!important;min-height:140px!important}.practice-pedal{padding:4px 8px}.practice-pedal button{min-height:50px}}

html[data-responsive-profile] #modal.practice-streamlined-modal .practice-pedal{flex:0 0 auto!important;box-sizing:border-box}
html[data-responsive-profile] #modal.practice-streamlined-modal:has(.pedal-enabled) #modalContent{overflow-y:auto!important}

/* v0.80.286: Keep the pre-play mode choice and start button reachable. */
html[data-responsive-profile] #modal.practice-streamlined-modal:not(.practice-live-input):has(#practicePedal) #modalContent{overflow-y:auto!important}
html[data-responsive-profile] #modal.practice-streamlined-modal:not(.practice-live-input):has(#practicePedal) .rhythm-stage{flex:0 0 190px!important;min-height:190px!important;height:190px!important}
.practice-pedal button:disabled{opacity:.65}
/* v0.80.286: A moving blue ribbon shows the pedal hold. */
.practice-pedal{padding:6px!important;border:0!important;background:transparent!important;margin:3px 0!important}
.practice-pedal [data-pedal-intro]{margin:5px 0;font-size:12px;text-align:center}
.practice-pedal.pedal-started [data-pedal-intro]{display:none}
.practice-pedal button{position:relative;display:block!important;min-height:110px!important;height:110px;padding:0!important;overflow:hidden;border:2px solid #789cad!important;border-radius:14px;background:linear-gradient(#274554,#172e39)!important;color:#fff;box-shadow:0 5px 0 #142630;transition:box-shadow .12s,background .12s}
.practice-pedal .pedal-heading{position:absolute;top:5px;left:12px;font-size:12px;color:#dceff4;z-index:3}
.practice-pedal .pedal-pc-hint{font-size:10px;margin-left:8px;opacity:.65}
.practice-pedal .pedal-track{display:block;position:absolute;inset:22px 10px 20px;overflow:hidden}
.practice-pedal .pedal-strike-line{position:absolute;top:72%;height:3px;left:0;right:0;background:#b6edf9;box-shadow:0 0 8px #7bd8ee;z-index:2}
.practice-pedal .pedal-note-band{display:block;position:absolute;left:20%;width:60%;border-radius:7px;background:linear-gradient(90deg,#348cae,#83def3,#348cae);border-bottom:4px solid #e7fbff;box-sizing:border-box;box-shadow:0 0 12px #5cc6e766;min-height:6px}
.practice-pedal .pedal-note-band.sounding{background:#d9f8ff;box-shadow:0 0 18px #8de5ff}
.practice-pedal .pedal-note-band.missed{opacity:.25}
.practice-pedal button.holding{border-color:#d4f8ff!important;background:linear-gradient(#39748b,#254e62)!important;box-shadow:0 2px 0 #142630,0 0 24px #56bfd899,inset 0 0 24px #b2eaff44}
.practice-pedal button.ready{border-color:#bdefff!important}
.practice-pedal [data-pedal-cue]{position:absolute;bottom:3px;left:0;right:0;font-size:12px!important;line-height:16px}
.practice-pedal .pedal-demo-band{display:none}
.practice-pedal:not(.pedal-started).pedal-enabled .pedal-demo-band{display:block;position:absolute;left:20%;width:60%;height:35%;background:#83def3;border-bottom:4px solid white;border-radius:7px;animation:pedal-guide 2.8s linear infinite}
@keyframes pedal-guide{from{top:-50%}to{top:110%}}
@media(prefers-reduced-motion:reduce){.practice-pedal .pedal-demo-band{animation:none!important;top:37%}}
@media(pointer:coarse){.practice-pedal .pedal-pc-hint{display:none}#modal:has(.pedal-enabled) .rhythm-key small{display:none!important}}
#modal.practice-live-input:has(.pedal-enabled) #practiceRegistrationSummaryChip,#modal.practice-live-input:has(.pedal-enabled) #practiceStatus{display:none!important}
@media(orientation:landscape) and (max-height:600px){.practice-pedal button{height:84px!important;min-height:84px!important}.practice-pedal .pedal-track{inset:18px 10px 18px}}
/* B: a shared organ console; layout remains playable in either orientation. */
#modal:has(.organ-duet) .modal-card{background:#171c1d!important;color:#f4e8c9;border:1px solid #9f8150!important;box-shadow:0 22px 70px #0009!important}
#modal:has(.organ-duet) #modalTitle{color:#efdbb1!important;font-family:serif;font-size:clamp(15px,2.4vw,24px)!important;margin:4px 0!important}
#modal:has(.organ-duet) .modal-card button{touch-action:none}
#modal:has(.organ-duet) .practice-mode-chip,#modal:has(.organ-duet) #practiceRegistrationSummaryChip,#modal:has(.organ-duet) .rhythm-summary,#modal:has(.organ-duet) #practiceStatus,#modal:has(.organ-duet) .practice-piece-source,#modal:has(.organ-duet) .practice-v2-learning-flow,#modal:has(.organ-duet) .practice-phrase-frame,#modal:has(.organ-duet) .practice-input-legend,#modal:has(.organ-duet) .practice-sheet{display:none!important}
.duet-instruction,.duet-orientation-hint{font-size:12px!important;color:#d9caaa!important;text-align:center;margin:4px!important}
.duet-orientation-hint{color:#92bec6!important;font-size:11px!important}
.duet-mode{font-size:12px;display:flex;gap:8px;align-items:center;justify-content:center;margin:5px}
.duet-mode select{background:#263438;color:#f7e5c3;border:1px solid #9b835d;border-radius:8px;padding:5px;font:inherit}
#modal.practice-live-input .duet-mode,#modal.practice-live-input .duet-instruction,#modal.practice-live-input .duet-orientation-hint{display:none!important}
#modal:has(.organ-duet) #practicePerformanceStartGate{margin:4px 0!important;padding:3px!important;background:none!important}
#modal:has(.organ-duet) #practicePerformanceStartGate p,#modal:has(.organ-duet) #practicePerformanceStartGate small{display:none!important}
#modal:has(.organ-duet) #practicePerformanceStartButton{background:linear-gradient(#e8cd8f,#b48a47);color:#211b12;border:1px solid #f6dfaa;min-height:40px!important;padding:9px 30px!important;box-shadow:0 3px 0 #634520}
#modal .organ-duet{--key-height:76px;position:relative;isolation:isolate;display:grid!important;grid-template-columns:minmax(76px,24%) minmax(0,1fr);grid-template-rows:minmax(0,1fr) var(--key-height);gap:0 12px;flex:0 0 auto!important;width:100%;height:clamp(330px,59dvh,620px);box-sizing:border-box;padding:16px 14px 12px;border:4px ridge #88704c;border-radius:18px;background:linear-gradient(#12202511,#0a131dda 75%),url('../assets/organ-duet-room.webp') center 35%/cover;box-shadow:inset 0 0 40px #000a,0 12px 30px #0006;overflow:hidden}
html[data-responsive-profile] #modal:has(.organ-duet) .organ-duet #rhythmStage{grid-column:2;grid-row:1;position:relative;flex:none!important;width:100%!important;height:100%!important;min-height:0!important;margin:0!important;border:0!important;border-radius:0;background:linear-gradient(180deg,#07182111,#06121ba8)!important;box-shadow:none!important;overflow:hidden}
#modal .organ-duet .rhythm-lanes{inset:0!important;gap:0!important}
#modal .organ-duet .rhythm-lane{background:linear-gradient(180deg,transparent,#efc65c0d)!important;border-right:1px solid #dbc38840!important}
#modal .organ-duet .lane-note-name,#modal .organ-duet .practice-level-corner,#modal .organ-duet .rhythm-hit-zone span,#modal .organ-duet .falling-note span,#modal .organ-duet .falling-note small{display:none!important}
#modal .organ-duet .rhythm-hit-zone{bottom:75px!important;height:2px!important;background:#f9d886!important;box-shadow:0 0 14px #ffdc82;border:0!important}
#modal .organ-duet .falling-note{width:66%!important;max-width:110px;height:36px!important;min-height:36px;border-radius:5px!important;background:linear-gradient(#fff7d8,#e3ae4a)!important;border:1px solid #fff1c9;box-shadow:0 0 12px #eabd6eaa!important}
#modal .organ-duet .falling-note-sustain{width:80%!important;background:linear-gradient(90deg,#af803940,#f8d488bd,#af803940)!important;border:1px solid #f9d68766}
#modal .organ-duet .rhythm-keys{grid-column:2;grid-row:2;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;margin:0!important;padding:0!important;z-index:3;height:100%!important}
#modal .organ-duet .rhythm-key{height:100%!important;min-height:0!important;max-height:none!important;border-radius:4px 4px 10px 10px!important;border:1px solid #c0a57b!important;background:linear-gradient(90deg,#cebc99,#fff5d9 22%,#f3e4c0 80%,#c2ad87)!important;color:#6b5537!important;box-shadow:inset 0 -8px 0 #a98d61,0 5px 0 #33251b!important;transition:filter .1s,box-shadow .1s}
#modal .organ-duet .rhythm-key b{font-size:15px!important;font-family:serif}
#modal .organ-duet .rhythm-key small{font-size:10px!important}
#modal .organ-duet .rhythm-key.hit,#modal .organ-duet .rhythm-key.holding{background:linear-gradient(#fff4ce,#edc777)!important;box-shadow:inset 0 -3px 0 #b18c43,0 0 26px #ffdb88!important;transform:translateY(3px)}
#modal .organ-duet #practicePedal{position:relative;grid-column:1;grid-row:1/3;display:block!important;padding:0!important;margin:0!important;min-width:0;border:0!important}
#modal .organ-duet [data-pedal-panel]{height:100%}
#modal .organ-duet [data-pedal-key]{position:absolute;inset:0;width:100%;height:100%!important;min-height:0!important;border:0!important;border-radius:0!important;background:linear-gradient(#0e3a4c15,#377c9738)!important;box-shadow:none!important;overflow:hidden}
#modal .organ-duet [data-pedal-key]::after{content:'';position:absolute;bottom:0;left:0;right:0;height:var(--key-height);box-sizing:border-box;border:2px solid #77bfd0;border-radius:7px 7px 12px 12px;background:repeating-linear-gradient(92deg,#433c3033 0 3px,#201c1922 4px 6px),linear-gradient(#536c69,#354449);box-shadow:inset 0 -7px 0 #192b31;z-index:0}
#modal .organ-duet [data-pedal-key].holding::after{background:linear-gradient(#83dbe4,#367d8f);box-shadow:inset 0 -3px #275765,0 0 30px #71e3fa}
#modal .organ-duet .pedal-track{inset:0 0 auto!important;height:calc(100% - var(--key-height));z-index:1}
#modal .organ-duet .pedal-heading{top:auto!important;bottom:27px;left:0;right:0;z-index:3;font-size:15px!important;color:#e0faff}
#modal .organ-duet [data-pedal-cue]{z-index:3;bottom:6px;font-size:10px!important}
#modal .organ-duet .pedal-note-band{left:17%;width:66%;border-radius:4px}
#modal .organ-duet .pedal-demo-band{display:none!important}
#modal .organ-duet .practice-performance-curtain{background:linear-gradient(#12201ef0,#152323dd);color:#ead4a2}
#modal .organ-duet .practice-judgement-flash small{display:none}
#modal .organ-duet .practice-judgement-flash{top:14px!important;font-size:14px!important}
.duet-pipes{position:absolute;inset:0 10% 40%;display:flex;gap:2%;align-items:flex-start;z-index:-1;opacity:.2;pointer-events:none}
.duet-pipes i{height:var(--height);flex:1;border-radius:0 0 4px 4px;background:linear-gradient(90deg,#384b52,#bfc7ba,#46534f);box-shadow:inset 0 -15px #18272d}
.organ-duet.melody-sounding .duet-pipes{animation:organ-breath .6s ease-out}
.organ-duet.bass-sounding{box-shadow:inset 0 -45px 65px -45px #79d5eb,0 12px 30px #0006!important}
@keyframes organ-breath{0%{opacity:.65;filter:drop-shadow(0 0 8px #f2d9a3)}100%{opacity:.2;filter:none}}
@media(orientation:landscape){.duet-orientation-hint{display:none}#modal .organ-duet{height:clamp(220px,65dvh,600px);--key-height:62px}#modal.practice-live-input .organ-duet{height:calc(100dvh - 94px)}}
@media(orientation:portrait){#modal .organ-duet{gap:0 7px;padding:12px 8px 10px;grid-template-columns:minmax(66px,24%) minmax(0,1fr)}#modal.practice-live-input .organ-duet{height:clamp(350px,72dvh,850px)}}
@media(prefers-reduced-motion:reduce){.organ-duet.melody-sounding .duet-pipes{animation:none;opacity:.35}#modal .organ-duet .rhythm-key{transition:none}}

#modal .organ-duet{min-height:250px}
#modal.practice-live-input:has(.organ-duet) #practicePerformanceStartGate{display:none!important}

/* v0.80.286 — Canon spatial expression vertical slice.
   Visual-only layer: never moves rhythm lanes, falling notes, judgement line, or input targets. */
#modal .organ-duet.practice-space-v2{
  --space-bg-brightness:1;
  --space-bg-blur:12px;
  --space-beam-opacity:.32;
  --space-depth-scale:1.015;
  --space-accent-rgb:238,190,86;
  --space-wash-rgb:178,121,56;
  --space-lane-alpha:.21;
  background:#11191b!important;
}
#modal .organ-duet.practice-space-v2[data-space-family="principal"]{
  --space-accent-rgb:238,190,86;
  --space-wash-rgb:177,119,51;
  --space-lane-alpha:.24;
}
#modal .organ-duet.practice-space-v2[data-space-family="flute"]{
  --space-accent-rgb:224,235,218;
  --space-wash-rgb:181,203,185;
  --space-lane-alpha:.19;
}
#modal .organ-duet.practice-space-v2[data-space-family="string"]{
  --space-accent-rgb:178,216,238;
  --space-wash-rgb:106,151,183;
  --space-lane-alpha:.20;
}
#modal .organ-duet.practice-space-v2[data-space-family="reed"]{
  --space-accent-rgb:235,151,76;
  --space-wash-rgb:166,77,42;
  --space-lane-alpha:.27;
}
#modal .organ-duet.practice-space-v2::before{
  content:"";
  position:absolute;
  inset:-4%;
  z-index:-3;
  pointer-events:none;
  background:
    linear-gradient(180deg,rgba(7,15,18,.08),rgba(6,14,18,.60) 76%),
    url('../assets/organ-duet-room.webp') center 35%/cover no-repeat;
  filter:brightness(var(--space-bg-brightness)) blur(var(--space-bg-blur));
  transform:scale(var(--space-depth-scale)) translate3d(0,0,0);
  transform-origin:50% 36%;
  transition:filter .22s ease,transform .22s ease;
  will-change:filter,transform;
}
#modal .organ-duet.practice-space-v2::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background:
    linear-gradient(162deg,transparent 0 35%,rgba(var(--space-accent-rgb),var(--space-beam-soft)) 47%,transparent 59%),
    linear-gradient(198deg,transparent 0 35%,rgba(var(--space-accent-rgb),var(--space-beam-soft)) 47%,transparent 59%),
    radial-gradient(circle at 50% 27%,rgba(var(--space-accent-rgb),var(--space-beam-opacity)) 0,rgba(var(--space-wash-rgb),var(--space-beam-mid)) 22%,transparent 52%),
    linear-gradient(180deg,rgba(var(--space-wash-rgb),var(--space-beam-wash)),transparent 45%);
  mix-blend-mode:screen;
  opacity:.88;
  transition:opacity .22s ease,background .34s ease;
}
#modal .organ-duet.practice-space-v2 .rhythm-lane{
  border-right-color:rgba(var(--space-accent-rgb),var(--space-lane-alpha))!important;
  background:linear-gradient(180deg,rgba(var(--space-accent-rgb),.015),rgba(var(--space-accent-rgb),.075))!important;
  transition:border-color .34s ease,background .34s ease;
}
#modal .organ-duet.practice-space-v2 .rhythm-hit-zone{
  background:rgba(var(--space-accent-rgb),.94)!important;
  box-shadow:0 0 16px rgba(var(--space-accent-rgb),.74),0 0 34px rgba(var(--space-accent-rgb),.24)!important;
  transition:background .34s ease,box-shadow .34s ease;
}
#modal .organ-duet.practice-space-v2 .falling-note{
  box-shadow:0 0 12px rgba(var(--space-accent-rgb),.64),0 5px 12px rgba(0,0,0,.22)!important;
  transition:box-shadow .34s ease,filter .34s ease;
}

/* Pedal energy moves only the room bitmap. Geometry and controls remain fixed. */
#modal .organ-duet.practice-space-v2.bass-impact::before{
  animation:practiceSpaceBassImpact .18s cubic-bezier(.18,.74,.28,1) 1;
}
#modal .organ-duet.practice-space-v2.bass-sounding:not(.bass-impact)::before{
  animation:practiceSpaceBassBreath .64s ease-in-out infinite;
}
#modal .organ-duet.practice-space-v2.bass-sounding{
  box-shadow:inset 0 -45px 65px -48px rgba(var(--space-accent-rgb),.28),0 12px 30px #0006!important;
}
#modal .organ-duet.practice-space-v2.bass-impact{
  box-shadow:inset 0 -48px 72px -54px rgba(var(--space-accent-rgb),.52),0 12px 30px #0006!important;
}
@keyframes practiceSpaceBassImpact{
  0%{transform:scale(var(--space-depth-scale)) translate3d(0,0,0)}
  34%{transform:scale(var(--space-depth-scale)) translate3d(0,2px,0)}
  68%{transform:scale(var(--space-depth-scale)) translate3d(0,-1px,0)}
  100%{transform:scale(var(--space-depth-scale)) translate3d(0,0,0)}
}
@keyframes practiceSpaceBassBreath{
  0%,100%{transform:scale(var(--space-depth-scale)) translate3d(0,0,0)}
  50%{transform:scale(var(--space-depth-scale)) translate3d(0,1px,0)}
}
@media(prefers-reduced-motion:reduce){
  #modal .organ-duet.practice-space-v2::before{transition:filter .18s linear!important;animation:none!important}
  #modal .organ-duet.practice-space-v2.bass-impact::after{opacity:.96}
  #modal .organ-duet.practice-space-v2.bass-sounding::before{animation:none!important}
}

/* v0.80.286 — Canon performance perspective v2.
   Visual projection only: lane hit areas, judgement timing, and rhythm-key input geometry are unchanged. */
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2{
  --canon-runway-top:31%;
  --canon-runway-bottom:75px;
  --canon-runway-top-width:20%;
  --canon-runway-bottom-width:72%;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .rhythm-lane{
  border-right-color:transparent!important;
  background:transparent!important;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .falling-note{
  translate:var(--canon-note-x,0px) 0;
  scale:var(--canon-note-scale,1);
  transform-origin:50% 50%;
  will-change:transform,translate,scale,opacity;
  box-shadow:
    0 0 var(--canon-note-glow-size,5px) rgba(var(--space-accent-rgb),var(--canon-note-glow-alpha,.34)),
    0 var(--canon-note-shadow-y,2px) var(--canon-note-shadow-blur,6px) rgba(0,0,0,.25)!important;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid{
  position:absolute;
  left:0;
  right:0;
  top:var(--canon-runway-top);
  bottom:var(--canon-runway-bottom);
  z-index:0;
  pointer-events:none;
  overflow:visible;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid::before{
  content:"";
  position:absolute;
  inset:0;
  clip-path:polygon(40% 0,60% 0,86% 100%,14% 100%);
  background:
    linear-gradient(90deg,rgba(255,255,255,.015),rgba(var(--space-accent-rgb),.07) 48%,rgba(255,255,255,.015)),
    repeating-linear-gradient(90deg,rgba(56,31,18,.82) 0 7%,rgba(83,49,25,.84) 7% 14%,rgba(48,27,17,.82) 14% 21%);
  box-shadow:inset 0 0 36px rgba(var(--space-accent-rgb),.08);
  opacity:.72;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  filter:drop-shadow(0 0 5px rgba(var(--space-accent-rgb),.14));
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid polygon{
  fill:rgba(20,13,9,.12);
  stroke:rgba(var(--space-accent-rgb),.42);
  stroke-width:2.2;
  vector-effect:non-scaling-stroke;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid line{
  stroke:rgba(var(--space-accent-rgb),.34);
  stroke-width:1.35;
  vector-effect:non-scaling-stroke;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid .canon-runway-top{
  stroke:rgba(var(--space-accent-rgb),.52);
  stroke-width:1.8;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-perspective-grid .canon-runway-bottom{
  stroke:rgba(var(--space-accent-rgb),.86);
  stroke-width:2.8;
  filter:drop-shadow(0 0 7px rgba(var(--space-accent-rgb),.48));
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-vanishing-point{
  position:absolute;
  left:50%;
  top:31%;
  z-index:1;
  width:13px;
  height:13px;
  transform:translate(-50%,-50%);
  border:1px solid rgba(var(--space-accent-rgb),.74);
  border-radius:50%;
  box-shadow:0 0 12px rgba(var(--space-accent-rgb),.45);
  pointer-events:none;
  opacity:.72;
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-vanishing-point::before,
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-vanishing-point::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  background:rgba(var(--space-accent-rgb),.72);
  transform:translate(-50%,-50%);
}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-vanishing-point::before{width:23px;height:1px}
#modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .canon-vanishing-point::after{width:1px;height:23px}
@media(prefers-reduced-motion:reduce){
  #modal .organ-duet.practice-canon-perspective-host #rhythmStage.practice-canon-perspective-v2 .falling-note{transition:none!important}
}


/* v0.80.338 — Progressive disclosure / one-screen-first information architecture */
.information-firstscreen .progressive-detail{margin-top:10px}
.information-firstscreen .progressive-detail>summary{min-height:46px;display:flex;align-items:center;justify-content:space-between;padding:11px 15px;font-weight:800;cursor:pointer}
.information-firstscreen .progressive-detail>summary:after{content:"＋";font-size:19px;line-height:1;color:#9b7b43}
.information-firstscreen .progressive-detail[open]>summary:after{content:"−"}
.progressive-detail-body{display:grid;gap:10px;padding-top:8px}
.firstscreen-primary-action{margin-top:8px!important}
.record-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.record-overview-grid>button{min-height:116px;border:1px solid rgba(110,88,60,.14);border-radius:20px;background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(248,242,226,.92));box-shadow:0 8px 22px rgba(78,61,43,.06);padding:14px 10px;display:grid;place-items:center;gap:3px;color:#554536}
.record-overview-grid>button>span{font-size:24px}.record-overview-grid>button>small{font-size:10px;font-weight:800;color:#87745e}.record-overview-grid>button>b{font-size:15px;line-height:1.3}
.record-overview-return{margin-top:10px}
.practice-result-v2-metrics-primary{grid-template-columns:repeat(2,minmax(0,1fr))!important}

html[data-responsive-profile="mobile-portrait"] .information-firstscreen{display:flex;flex-direction:column;gap:8px}
html[data-responsive-profile="mobile-portrait"] .information-firstscreen h2{margin-block:3px 5px!important}
html[data-responsive-profile="mobile-portrait"] .cedar-resource-guide .hill-resource-guide-visual{max-height:28dvh!important;overflow:hidden;border-radius:18px}
html[data-responsive-profile="mobile-portrait"] .cedar-resource-guide .hill-resource-guide-visual img{height:28dvh!important;object-fit:cover!important}
html[data-responsive-profile="mobile-portrait"] .cedar-resource-guide .hill-resource-status{margin:0!important;padding:8px 12px!important}
html[data-responsive-profile="mobile-portrait"] .cedar-resource-guide .hill-resource-lead{margin:2px 0 4px!important;font-size:13px!important;line-height:1.6!important}
html[data-responsive-profile="mobile-portrait"] .cedar-resource-guide .firstscreen-primary-action .primary{min-height:48px!important}

html[data-responsive-profile="mobile-portrait"] .organ-record-firstscreen>.organ-console-hero{height:min(24dvh,210px)!important;object-fit:contain!important;margin:0 auto!important}
html[data-responsive-profile="mobile-portrait"] .organ-record-firstscreen>.organ-record-title-card{padding:10px 12px!important;gap:10px!important;margin:0!important}
html[data-responsive-profile="mobile-portrait"] .organ-record-firstscreen>.organ-record-title-card p{display:none!important}
html[data-responsive-profile="mobile-portrait"] .organ-record-firstscreen>.organ-experience-card{padding:10px 12px!important;margin:0!important}
html[data-responsive-profile="mobile-portrait"] .organ-record-firstscreen>.organ-experience-card p{font-size:11px!important;line-height:1.5!important;margin-top:2px!important}
html[data-responsive-profile="mobile-portrait"] .organ-record-firstscreen .firstscreen-primary-action .primary{min-height:48px!important}

html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel{gap:8px!important}
html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel .story-score-speaker-visual{max-height:19dvh!important}
html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel .story-score-gift-quote{padding:9px 12px!important;margin:0!important}
html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel .story-score-gift-quote p{font-size:12px!important;line-height:1.55!important}
html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel .story-score-gift-title{margin:0!important}
html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel .story-score-gift-title h2{font-size:clamp(24px,7vw,32px)!important}
html[data-responsive-profile="mobile-portrait"] .story-score-gift-panel .firstscreen-primary-action .primary{min-height:50px!important}
html[data-responsive-profile="mobile-portrait"] .story-score-more .story-score-gift-art{max-width:340px;margin:10px auto}

html[data-responsive-profile="mobile-portrait"] .chapel-record-panel .chapel-record-heading p{margin-top:2px!important;font-size:11px!important}
html[data-responsive-profile="mobile-portrait"] .record-overview-grid{gap:8px}
html[data-responsive-profile="mobile-portrait"] .record-overview-grid>button{min-height:102px;border-radius:17px;padding:10px 8px}
html[data-responsive-profile="mobile-portrait"] .record-group-tabs{position:sticky;top:0;z-index:3;background:rgba(250,247,240,.96);padding:4px 0}

html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-art{aspect-ratio:16/6.8!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-summary{padding:11px 14px 10px!important;gap:5px!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-copy{font-size:10.5px!important;line-height:1.45!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-metrics-primary>span{padding:6px 4px!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-world{padding:6px 8px!important;margin-top:0!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-lower{padding:7px 12px max(10px,env(safe-area-inset-bottom))!important;gap:6px!important}
html[data-responsive-profile="mobile-portrait"] #modal.practice-result-v2-modal .practice-result-v2-actions>.primary{min-height:46px!important}


/* v0.80.338 — one-screen-first progressive disclosure, phase 2 */
.progressive-details{margin:10px 0;border:1px solid rgba(73,61,48,.16);border-radius:14px;background:rgba(255,255,255,.54);overflow:hidden;}
.progressive-details>summary{cursor:pointer;list-style:none;padding:12px 14px;font-weight:800;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.progressive-details>summary::-webkit-details-marker{display:none;}
.progressive-details>summary::after{content:'＋';font-size:1.05em;opacity:.65;}
.progressive-details[open]>summary::after{content:'−';}
.progressive-details-body{padding:0 12px 12px;}
.compact-now{margin:6px 0 10px!important;}
.connection-shelf-details .connection-shelf-record,.connection-shelf-details .making-culture-shelf-trace{margin-top:10px;}
.common-item-card .item-card-basic{margin-bottom:8px;}
.item-card-details .item-card-memory,.item-card-details .item-card-origin,.item-card-details .item-card-place-hint{margin:8px 0;}
.museum-shop-section.progressive-details{display:block;padding:0!important;}
.museum-shop-section.progressive-details>summary{font-size:1rem;}
.learning-details .learning-fact-list{margin-top:6px;}
.mechanism-step-list .mechanism-step-button:not(.active){display:none;}
.mechanism-step-list .mechanism-step-button.active{display:grid;}
.kurahashi-caption-details{width:100%;}
.kurahashi-caption-details .kurahashi-caption-card{box-shadow:none;margin:0;border:0;background:transparent;padding:8px 0 0;}
.kurahashi-overview-now{text-align:center;font-weight:700;margin:6px 0 10px;}
.exhibition-list-details ul{margin:4px 0;padding-left:20px;}
.settings-section.progressive-details{padding:0!important;}
.settings-section.progressive-details>summary{font-size:1.02rem;}
.settings-more{margin-top:8px;}
.danger-details>summary{color:#8b3b34;}
@media(max-width:640px){
  .mailbox-panel .mailbox-heading p{display:none;}
  .mailbox-panel .mailbox-timeline{gap:6px;}
  .mailbox-panel .mailbox-timeline-item{padding:8px 10px;}
  .joy-report-panel .joy-report-lead{font-size:.92rem;margin:4px 0 8px;}
  .connection-shelf-whisper{margin-bottom:8px;}
  .museum-shop-section .museum-shop-tags{grid-template-columns:1fr;}
  .common-item-card .item-card-hero img{max-height:28vh;object-fit:contain;}
  .learning-hero.organ-console-hero{max-height:30vh;object-fit:contain;}
  .mechanism-lesson-layout{gap:8px;}
  .mechanism-diagram-button .learning-diagram{max-height:31vh;object-fit:contain;}
  .kurahashi-viewer{gap:10px;}
  .kurahashi-viewer-header p{font-size:.92rem;}
  .kurahashi-image-frame{padding:8px;}
  .kurahashi-image-frame img{max-height:48vh;}
  .kurahashi-overview-grid{grid-template-columns:1fr;gap:8px;}
  .kurahashi-overview-card{padding:10px;gap:6px;}
  .settings-section:first-of-type{margin-bottom:8px;}
}

.environment-now-line{text-align:center;margin:6px 0 8px;font-weight:700;color:#65584b;}
.hibiki-letter-panel .experiential-letter{margin-bottom:8px;}
.gift-catalog-page-items.progressive-details>summary{justify-content:center;}
@media(max-width:640px){.hibiki-letter-paper{padding:14px!important}.hibiki-letter-body p{margin:.45em 0}.gift-catalog-page-frame img{max-height:52vh;object-fit:contain}.environment-hero{margin-bottom:6px}.environment-details{margin-top:6px}}

/* v0.80.338 — Adaptive HUD composition
   One semantic header, intentionally composed for phone, tablet and desktop. */
.hud.hud-single-row .hud-zone{min-width:0;align-items:center}
.hud.hud-single-row .hud-wide-label{display:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Zone wrappers are semantic only on compact layouts; explicitly retain canonical grid areas. */
.hud.hud-single-row #coinHud{grid-area:seed!important}
.hud.hud-single-row #elpisCoinHud{grid-area:coin!important}
.hud.hud-single-row #happinessHud{grid-area:cedar!important}
.hud.hud-single-row #titleHud{grid-area:title!important}
.hud.hud-single-row #organStatusHud{grid-area:humidity!important}
.hud.hud-single-row #settingsBtn{grid-area:settings!important}

/* Compact profiles flatten groups back into the proven single-row order. */
html[data-responsive-profile="mobile-portrait"] .hud.hud-single-row .hud-zone,
html[data-responsive-profile="mobile-landscape"] .hud.hud-single-row .hud-zone,
html[data-responsive-profile="tablet-portrait"] .hud.hud-single-row .hud-zone{display:contents!important}

/* Tablet landscape: touch-first, centered title, balanced sides. */
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row{
  --hud-control:48px;min-height:64px!important;height:64px!important;padding:7px 12px!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;grid-template-areas:"left center right"!important;gap:12px!important;align-items:center!important
}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-zone{display:flex!important;gap:7px!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-zone-left{grid-area:left!important;justify-self:start!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-zone-center{grid-area:center!important;justify-self:center!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-zone-right{grid-area:right!important;justify-self:end!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-pill,
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-icon-button{height:48px!important;min-height:48px!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row #coinHud,
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row #elpisCoinHud{width:72px!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row #happinessHud{width:48px!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row #titleHud{width:190px!important;max-width:190px!important}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row #organStatusHud,
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row #settingsBtn{width:48px!important;min-width:48px!important}

/* Desktop: left resources / true-centered primary record / right system controls. */
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row{
  --hud-control:50px;min-height:70px!important;height:70px!important;padding:8px clamp(14px,1.6vw,28px)!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;grid-template-areas:"left center right"!important;gap:18px!important;align-items:center!important;
  background:rgba(253,249,241,.95)!important;border-bottom:1px solid rgba(91,70,48,.08)!important;box-shadow:0 5px 18px rgba(54,39,25,.08)!important
}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-zone{display:flex!important;gap:9px!important;height:100%!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-zone-left{grid-area:left!important;justify-self:start!important;justify-content:flex-start!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-zone-center{grid-area:center!important;justify-self:center!important;justify-content:center!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-zone-right{grid-area:right!important;justify-self:end!important;justify-content:flex-end!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-pill,
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-icon-button{height:52px!important;min-height:52px!important;border-radius:17px!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #coinHud,
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #elpisCoinHud{width:auto!important;min-width:78px!important;padding-inline:10px!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #happinessHud{width:auto!important;min-width:52px!important;padding-inline:8px!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #titleHud{width:210px!important;max-width:210px!important;min-width:210px!important;justify-content:center!important;padding-inline:14px!important;box-shadow:0 3px 10px rgba(65,47,30,.06),inset 0 1px 0 rgba(255,255,255,.9)!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #titleHud .organ-record-hud-icon{display:block!important;width:32px!important;height:32px!important;min-width:32px!important;flex-basis:32px!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #titleHud .hud-copy{width:auto!important;align-items:flex-start!important;text-align:left!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #titleHud .hud-copy small{font-size:8px!important;letter-spacing:.06em!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #titleHud .hud-copy b{font-size:14px!important;text-align:left!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #organStatusHud,
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #settingsBtn{width:50px!important;min-width:50px!important;height:50px!important;min-height:50px!important}
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #settingsBtn{font-size:21px!important}

/* Wide desktop earns text labels; narrower desktop keeps icon-first clarity. */
@media(min-width:1380px){
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-wide-label{display:inline-block!important;font-size:11px!important;line-height:1!important;font-weight:760!important;color:#685a4d!important}
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #coinHud,
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #elpisCoinHud{min-width:132px!important;justify-content:flex-start!important}
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #happinessHud{min-width:126px!important;justify-content:flex-start!important;gap:8px!important}
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #happinessHud .cedar-hud-mark{width:34px!important;height:34px!important;flex-basis:34px!important}
}
@media(min-width:1000px) and (max-width:1379px){
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #coinHud,
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #elpisCoinHud{min-width:82px!important}
  html[data-responsive-profile="pc-landscape"] .hud.hud-single-row #happinessHud{min-width:52px!important}
}


/* v0.80.338 — immediate HUD parity before deferred styles arrive. */
html body:not(.hud-seed-not-yet) .hud.hud-single-row #coinHud,
html body:not(.hud-elpis-coin-not-yet) .hud.hud-single-row #elpisCoinHud,
html body:not(.hud-cedar-not-yet) .hud.hud-single-row #happinessHud,
html body:not(.hud-record-not-yet) .hud.hud-single-row #titleHud{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
}
html body.hud-seed-not-yet .hud.hud-single-row #coinHud,
html body.hud-elpis-coin-not-yet .hud.hud-single-row #elpisCoinHud,
html body.hud-cedar-not-yet .hud.hud-single-row #happinessHud,
html body.hud-record-not-yet .hud.hud-single-row #titleHud{
  display:none!important;
}
html[data-responsive-profile="tablet-landscape"] .hud.hud-single-row .hud-zone-center,
html[data-responsive-profile="pc-landscape"] .hud.hud-single-row .hud-zone-center{
  min-width:max-content!important;
}

/* v0.80.502: Clear, accessible restart flow; keep other save settings intact. */
.new-game-settings-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 0;}
.new-game-settings-row .install-copy{flex:1 1 180px;min-width:0;}
.new-game-settings-row .install-copy small{display:block;line-height:1.55;margin-top:4px;}
.new-game-settings-row button{min-height:44px;}
.new-game-confirm{max-width:530px;margin-inline:auto;line-height:1.65;}
.new-game-confirm h2{line-height:1.4;margin:2px 0 14px;}
.new-game-confirm p{margin:10px 0;}
.new-game-backup-note{border-top:1px solid rgba(74,57,39,.17);border-bottom:1px solid rgba(74,57,39,.17);padding:12px 0;}
.new-game-actions{display:grid;gap:10px;margin-top:18px;}
.new-game-actions button{min-height:48px;width:100%;white-space:normal;line-height:1.4;padding:12px 16px;}
.new-game-actions button:focus-visible,.new-game-settings-row button:focus-visible{outline:3px solid #4074bb;outline-offset:3px;}
