/* Final kitchen only. Legacy T1–T4 and historical case layouts stay intact. */
body:has(#attempt-section.is-t5:not(.hidden)) { background: #fff !important; }
html:has(#attempt-section.is-t5:not(.hidden)) { background: #fff; }
body.olympiad-page.exam-mode-active:has(#attempt-section.is-t5:not(.hidden)) .shell { width: min(1260px, calc(100% - 32px)); }
#attempt-section.is-t5 { width: 100%; max-width: 1260px; margin: auto; color: #202b2a; font-family: Arial, sans-serif; }
#attempt-section.is-t5 [hidden], .t5-kitchen [hidden] { display: none !important; }
#attempt-section.is-t5 > .card { background: #fff; box-shadow: none; backdrop-filter: none; border: 0; }
#attempt-section.is-t5 .dashboard-head { justify-content: center; padding: 10px 0; }
#attempt-section.is-t5 .dashboard-head > div:first-child,
#attempt-section.is-t5 .exam-cockpit,
#attempt-section.is-t5 .participant-mode-strip,
#attempt-section.is-t5 #progress-global,
#attempt-section.is-t5 .progress-bars,
#attempt-section.is-t5 #question-transition-banner,
#attempt-section.is-t5 #tour-code,
#attempt-section.is-t5 #tour-limit,
#attempt-section.is-t5 .question-meta,
#attempt-section.is-t5 #question-case,
#attempt-section.is-t5 #question-prompt,
#attempt-section.is-t5 #question-note,
#attempt-section.is-t5 #tour-description { display: none; }
#attempt-section.is-t5 .timer-stack { display: flex; gap: 12px; }
#attempt-section.is-t5 .timer-box { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: #f7f9f8; border: 1px solid #d7dfde; border-radius: 8px; box-shadow: none; }
#attempt-section.is-t5 .timer-box span { font-size: 13px; color: #394a46; }
#attempt-section.is-t5 .timer-box strong { font-size: 24px; color: #15826f; }
#attempt-section.is-t5 > .card:last-child { padding: 8px 0 20px; }
#attempt-section.is-t5 .progress-meta { justify-content: center; margin: 0; }
#attempt-section.is-t5 #progress-tour { background: none; color: #65716d; padding: 0; font-size: 14px; }
#attempt-section.is-t5 .tour-head { margin: 10px 0 24px; display: block; text-align: center; }
#attempt-section.is-t5 #tour-title { margin: 0; font: 700 34px/1.2 Georgia, serif; }
#attempt-section.is-t5 .question-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
#attempt-section.is-t5 .button:hover { transform: none; }
#attempt-section.is-t5 #submit-answer,
.t5-kitchen .button.primary { background: #15826f; border: 1px solid #15826f; border-radius: 8px; color: #fff; min-height: 48px; padding: 12px 20px; font: 600 15px/1.4 Arial, sans-serif; box-shadow: none; }
#attempt-section.is-t5 #submit-answer:disabled { background: #e6ede9; border-color: #d4dfd8; color: #68756e; opacity: 1; }
.t5-kitchen { min-width: 0; }
.t5-kitchen *, .t5-kitchen *::before, .t5-kitchen *::after { box-sizing: border-box; }
.t5-kitchen h3, .t5-kitchen h4 { margin: 0; color: #202b2a; font-family: Georgia, serif; }
.t5-kitchen button { cursor: pointer; font-family: Arial, sans-serif; }
.t5-kitchen button:disabled { cursor: default; }
.t5-kitchen button:focus-visible, #attempt-section.is-t5 button:focus-visible { outline: 3px solid #15826f; outline-offset: 3px; }
.t5-hint, .t5-scene-notice { color: #64716b; font-size: 13px; line-height: 1.5; }
.t5-secondary { min-height: 44px; padding: 10px 16px; border: 1px solid #cdd9d3; border-radius: 8px; background: #fff; color: #254b3f; font-size: 14px; line-height: 1.4; transition: background-color 150ms; }
.t5-secondary:hover:not(:disabled) { background: #f2f7f4; }
.t5-clear { min-height: 44px; padding: 10px 6px; border: 0; background: none; color: #25735f; font-size: 13px; text-decoration: underline; }
.t5-clear:disabled { opacity: .6; }
.t5-assembly-heading { margin-bottom: 14px; text-align: center; }
.t5-assembly-heading h3 { font-size: 26px; }
.t5-assembly-heading p { margin: 7px 0 0; }
.t5-instruction { font-size: 15px; line-height: 1.5; }
.t5-workspace { display: grid; grid-template-columns: minmax(0, 7fr) minmax(275px, 3fr); gap: 20px; align-items: stretch; }
.t5-visual { min-width: 0; }
.t5-scene { position: relative; height: 330px; border: 1px solid #dce4df; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, #fff 30%, #f7f9f7 100%); }
.t5-scene.is-over { box-shadow: inset 0 0 0 3px #15826f; }
.t5-flat-scene, .t5-webgl { position: absolute; inset: 0; }
.t5-webgl canvas { display: block; width: 100%; height: 100%; }
.t5-flat-scene { display: grid; place-items: center; }
.t5-vessel { position: absolute; width: min(78%, 320px); aspect-ratio: 1; border-radius: 50%; border: 12px solid #f1f0eb; background: radial-gradient(ellipse, #fff 61%, #e2e4df 65%, #fefefc 70%); box-shadow: 0 8px 16px #283d251a, inset 0 0 0 1px #dadfd9; transform: scaleY(.78); }
.t5-vessel-bowl { border-width: 18px; box-shadow: 0 9px 17px #283d2524, inset 0 0 15px #9ea49635; }
.t5-vessel-boat, .t5-vessel-wrap, .t5-vessel-roll { border-radius: 42%; }
.t5-vessel-roll { border-radius: 8px; border-width: 4px; background: #faf9f5; }
.t5-layers { position: relative; width: min(78%, 320px); aspect-ratio: 1; transition: transform 180ms ease; }
.t5-layer { position: absolute; pointer-events: none; }
.t5-layer img { display: block; width: 100%; height: 100%; object-fit: contain; }
.t5-layer-cropped { overflow: hidden; }
.t5-layer-cropped img { position: absolute; height: 100%; max-width: none; object-fit: fill; }
.t5-rotations { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.t5-rotate { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.t5-icon { width: 18px; height: 18px; display: inline-flex; }
.t5-icon svg, .t5-remove svg, .t5-check svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.t5-scene-notice { min-height: 20px; margin: 7px 0 0; text-align: center; font-size: 12px; }
.t5-mobile-counter { display: none; }
.t5-media-retry { display: block; margin: 12px auto 0; }
.t5-summary { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid #dce4df; border-radius: 12px; background: #fcfdfc; }
.t5-summary > h3 { font: 700 20px/1.3 Arial, sans-serif; }
.t5-selected-list { list-style: none; padding: 0; margin: 12px 0 0; min-height: 188px; }
.t5-selected-row { display: flex; align-items: center; min-width: 0; gap: 8px; border-bottom: 1px solid #e7ece8; font-size: 14px; line-height: 1.35; }
.t5-selected-row > span:nth-child(2) { flex: 1; overflow-wrap: anywhere; }
.t5-selected-photo { width: 42px; height: 46px; flex: 0 0 42px; display: grid; place-items: center; }
.t5-selected-photo img { width: 100%; height: 100%; object-fit: contain; }
.t5-remove { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 13px; border: 0; border-radius: 6px; color: #52645a; background: transparent; }
.t5-status { margin: 10px 0 0; color: #65716d; font-size: 13px; line-height: 1.4; min-height: 37px; }
.t5-summary .t5-clear { margin-top: auto; align-self: flex-start; }
#attempt-section.is-t5 .t5-summary #submit-answer { width: 100%; margin-top: 8px; }
.t5-components { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.t5-component { position: relative; display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; min-height: 142px; padding: 10px 8px 8px; border: 1px solid #d8e2db; border-radius: 10px; color: #202b2a; background: #fff; transition: border-color 150ms, background-color 150ms; }
.t5-component:hover:not(:disabled) { background: #f7faf8; }
.t5-component.is-selected { border: 2px solid #15826f; padding: 9px 7px 7px; background: #f3f9f5; }
.t5-component-photo { display: flex; align-items: center; justify-content: center; height: 100px; flex: 0 0 100px; min-width: 0; overflow: hidden; }
.t5-component-photo img { display: block; width: auto; max-width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.t5-component-name { display: block; text-align: center; margin-top: 8px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.t5-check { display: none; position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: #15826f; color: white; }
.t5-component.is-selected .t5-check { display: block; }
.t5-photo-missing { padding: 8px; font: 12px/1.4 Arial, sans-serif; color: #65716d; }
.t5-help { display: block; margin: 8px auto 0; }
.t5-drag-ghost { position: fixed; top: -1000px; left: -1000px; width: 150px; height: 160px; background: white; }
.t5-station-title { text-align: center; font-size: 26px; }
.t5-choice-instruction { margin: 9px 0 20px; text-align: center; color: #64716b; }
.t5-dish-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.t5-dish-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid #d8e2db; border-radius: 12px; background: #fff; }
.t5-dish-photo { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.t5-dish-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.t5-dish-card h4 { margin-top: 18px; font-size: 23px; line-height: 1.3; }
.t5-dish-card .t5-hint { margin: 8px 0; }
.t5-choice-fact { margin: 5px 0 16px; font-size: 14px; }
.t5-choice-button { margin-top: auto; align-self: flex-start; }
.t5-intro { max-width: 840px; margin: auto; padding: 28px 36px; border: 1px solid #d8e2db; border-radius: 12px; }
.t5-intro .t5-intro-facts { text-align: center; font: 600 18px/1.5 Arial, sans-serif; color: #15826f; }
.t5-intro-stations { counter-reset: stations; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; gap: 14px; padding: 0; margin: 24px 0; }
.t5-intro-stations li { counter-increment: stations; text-align: center; font-size: 15px; line-height: 1.4; }
.t5-intro-stations li::before { content: counter(stations); display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 9px; border-radius: 50%; color: #15826f; background: #edf5ee; font-weight: 700; }
.t5-rules { padding-left: 22px; font-size: 15px; line-height: 1.65; }
.t5-rules li + li { margin-top: 10px; }
.t5-time-note { margin: 18px 0 0; padding: 12px 15px; background: #f4f7f4; border-radius: 8px; color: #52645a; font-size: 13px; line-height: 1.5; }
.t5-start { display: block; margin: 24px auto 0; }
.t5-dialog { width: min(92vw, 520px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; margin: auto; padding: 28px; border: 1px solid #d7dfde; border-radius: 12px; background: #fff; color: #202b2a; box-shadow: 0 12px 60px #142c2940; }
.t5-dialog::backdrop { background: #16352680; }
.t5-dialog h3 { margin: 0 0 16px; font: bold 27px/1.25 Georgia, serif; }
.t5-dialog p { line-height: 1.5; }
.t5-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.t5-dialog-error { color: #894d36; font-size: 14px; }
#attempt-section.is-t5 .action-deck { margin-top: 12px; }
#attempt-section.is-t5 .action-deck > .actions { justify-content: center; margin-top: 6px; }
#attempt-section.is-t5 #finish-attempt { min-height: 44px; background: none; border: 0; color: #42665b; text-decoration: underline; box-shadow: none; font-size: 13px; }
#attempt-section.is-t5 .sync-strip { gap: 8px; margin-top: 6px; font-size: 12px; }
#attempt-section.is-t5 #attempt-sync-meta { font-size: 12px; }
.t5-selection-enter { animation: t5-enter 180ms ease both; }
@keyframes t5-enter { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .t5-workspace { display: contents; }
  .t5-kitchen:not(.t5-intro) { display: flex; flex-direction: column; }
  .t5-assembly-heading { order: 0; margin-bottom: 12px; }
  .t5-visual { order: 1; }
  .t5-components { order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .t5-summary { order: 3; margin-top: 14px; padding: 14px; }
  .t5-kitchen > .t5-hint, .t5-help { order: 4; }
  .t5-media-retry { order: 4; }
  .t5-mobile-counter { display: block; margin: 12px 0 0; font-size: 16px; font-weight: 700; }
  .t5-scene { height: 230px; }
  .t5-vessel, .t5-layers { width: min(78%, 235px); }
  .t5-component { min-height: 126px; padding: 8px 6px; }
  .t5-component.is-selected { padding: 7px 5px; }
  .t5-component-photo { height: 82px; flex-basis: 82px; }
  .t5-component-name { margin-top: 6px; font-size: 13px; }
  .t5-selected-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 0; }
  .t5-selected-row { flex: 1 1 140px; border-bottom: 0; padding: 2px 6px; background: #f2f6f2; border-radius: 6px; font-size: 12px; }
  .t5-selected-photo { display: none; }
  .t5-summary > h3 { display: none; }
  .t5-status { min-height: 0; margin-top: 12px; }
  .t5-rotations { gap: 6px; }
  .t5-rotate { padding: 10px 11px; font-size: 12px; gap: 4px; }
  .t5-scene-notice { font-size: 11px; }
  .t5-dish-choices { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .t5-dish-card { padding: 14px; }
  .t5-dish-photo { max-height: 170px; }
  .t5-dish-card h4 { font-size: 22px; margin-top: 10px; }
  .t5-choice-button { width: 100%; }
  .t5-intro { padding: 20px 16px; }
  .t5-intro-stations { gap: 8px; }
  .t5-intro-stations li { font-size: 12px; }
  .t5-intro .t5-intro-facts { font-size: 15px; }
  .t5-rules { font-size: 14px; padding-left: 18px; }
  .t5-dialog { padding: 20px; }
  .t5-dialog-actions { flex-direction: column; }
  #attempt-section.is-t5 #tour-title { font-size: 25px; }
  #attempt-section.is-t5 .tour-head { margin: 8px 0 16px; }
  #attempt-section.is-t5 .timer-stack { width: 100%; gap: 6px; }
  #attempt-section.is-t5 .timer-box { flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; }
  #attempt-section.is-t5 .timer-box span { font-size: 11px; }
  #attempt-section.is-t5 .timer-box strong { font-size: 21px; }
  #attempt-section.is-t5 #progress-tour { font-size: 12px; }
  #attempt-section.is-t5 .sync-strip { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  #attempt-section.is-t5 .question-enter, .t5-kitchen *, .t5-kitchen *::before, .t5-kitchen *::after { animation: none !important; transition: none !important; }
}
