/* room2.css — Room 2 · learning resources. A bright page over the 3D world: white cards, one colour per
   category, big buttons, readable Thai type. Works with mouse, touch and a VR headset browser. */
.r2 { position: fixed; inset: 0; z-index: 50; overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #EEE9FF 0, #F8F6FF 360px, #FBFAFF 100%); color: #1E2452; font-family: var(--f-body); -webkit-overflow-scrolling: touch; }
.r2.hidden { display: none; }
html.in-room2 #hud { display: none; }
.r2 button { cursor: pointer; }
.r2 :focus-visible { outline: 3px solid #7A5CF0; outline-offset: 2px; border-radius: 12px; }
.r2 h1, .r2 h2 { color: #1E2452; }
.r2 .flip { display: inline-flex; transform: scaleX(-1); }
.r2 .small { font-size: .85rem; }

/* header */
.r2-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); box-shadow: 0 6px 24px -14px rgba(30, 36, 82, .4); }
.r2-head .ttl { flex: 1; display: grid; text-align: center; }
.r2-head .ttl b { font-family: var(--f-head); font-weight: 600; font-size: 1.12rem; }
.r2-head .ttl span { font-size: .85rem; color: #5D5A86; }
.r2-nav { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid #D9D3F5; background: #fff; color: #1E2452; font-family: var(--f-head); font-size: 1rem; }
.r2-nav.next { background: #7A5CF0; border-color: #7A5CF0; color: #fff; }
.r2-wrap { max-width: 1120px; margin: 0 auto; padding: 18px 16px 120px; display: grid; gap: 22px; }

/* banner */
.r2-banner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.r2-scenebox { background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 14px 40px -24px rgba(30, 36, 82, .5); display: grid; gap: 8px; align-content: start; }
.r2-scene svg { display: block; width: 100%; height: auto; border-radius: 14px; }
.r2-scene .bld { font: 600 16px var(--f-head); fill: #5D5A86; }
.r2-scene .d, .r2-svg .d { font: 500 16px var(--f-body); fill: #1E2452; }
.r2-scene .smk circle { fill: #8A8FA8; opacity: 0; }
.r2-scene .fire, .r2-scene .detx, .r2-scene .farq, .r2-scene .upq, .r2-scene .exit, .r2-scene .sys { opacity: 0; transition: opacity .6s; }
.r2-scene .fl { font: 600 13px var(--f-head); fill: #5D5A86; }
.r2-scene .rm { font: 500 13px var(--f-body); fill: #4A4872; }
.r2-scene .plate { font: 600 13px var(--f-head); fill: #fff; }
.r2-scene .x { fill: #E0607A; }
.r2-scene .go { fill: none; stroke: #2FA876; stroke-width: 3; stroke-dasharray: 8 6; }
.r2-scene svg[class^="k"] .fire { opacity: 1; }
.r2-scene svg.k1 .detx, .r2-scene svg.k2 .detx, .r2-scene svg.k3 .detx, .r2-scene svg.k4 .detx { opacity: 1; fill: #E0607A; }
.r2-scene svg.k2 .farq, .r2-scene svg.k3 .farq, .r2-scene svg.k4 .farq, .r2-scene svg.k2 .upq, .r2-scene svg.k3 .upq, .r2-scene svg.k4 .upq { opacity: 1; }
.r2-scene svg.k2 .far { fill: #FFE6A8; }
.r2-scene svg.k3 .exit, .r2-scene svg.k4 .exit { opacity: 1; }
.r2-scene svg.k4 .sys { opacity: 1; }
@keyframes r2smoke { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: .75; } 100% { opacity: 0; transform: translateY(-40px); } }
.r2-cap { min-height: 2.6em; padding: 4px 8px; font: 500 1.05rem/1.4 var(--f-head); color: #1E2452; }
.r2-ctrl { display: flex; align-items: center; gap: 10px; }
.r2-play { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: #F26B4F; color: #fff; font-family: var(--f-head); font-size: .95rem; white-space: nowrap; }
.r2-bar { flex: 1; height: 8px; border-radius: 99px; background: #ECE8FA; overflow: hidden; }
.r2-bar i { display: block; height: 100%; width: 0; background: #F26B4F; border-radius: 99px; }
.r2-mission { background: #fff; border-radius: 22px; padding: 20px 22px; box-shadow: 0 14px 40px -24px rgba(30, 36, 82, .5); display: grid; gap: 10px; align-content: start; }
.r2-mission .kick { font: 500 .85rem var(--f-head); color: #7A5CF0; }
.r2-mission h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.3; }
.r2-mission > p { color: #4A4872; }
.r2-prob { background: #FFF6E8; border-radius: 14px; padding: 10px 14px; }
.r2-prob summary { cursor: pointer; font-family: var(--f-head); color: #9A5B00; }
.r2-prob p { margin-top: 6px; font-size: .95rem; }
.r2-progress { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.r2-progress li { display: flex; }
.r2-progress li > button { width: 100%; }
.r2-progress button { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 12px 6px 6px; border-radius: 16px; border: 2px solid #E3DEF7; background: #FBFAFF; color: #1E2452; text-align: left; }
.r2-progress button > span:last-child { display: grid; }
.r2-progress b { font-family: var(--f-head); font-weight: 600; }
.r2-progress small { font-size: .75rem; color: #6B688F; }
.r2-progress .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ECE8FA; font: 600 1rem var(--f-head); color: #7A5CF0; }
.r2-progress .here button { border-color: #7A5CF0; background: #F2EEFF; }
.r2-progress .done .dot { background: #2FA876; color: #fff; }
.r2-progress .sep { display: none; }

/* sections */
.r2-sec { background: #fff; border-radius: 24px; padding: 20px; box-shadow: 0 14px 40px -26px rgba(30, 36, 82, .45); display: grid; gap: 16px; scroll-margin-top: 90px; }
.r2-sechead { display: flex; gap: 12px; align-items: center; }
.r2-sechead .n { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: #7A5CF0; color: #fff; font: 600 1.3rem var(--f-head); }
.r2-sechead h2 { font-size: 1.35rem; }
.r2-sechead p { color: #5D5A86; font-size: .95rem; line-height: 1.5; }
.r2-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.r2-searchbox { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 50px; border-radius: 16px; border: 2px solid #E3DEF7; background: #FBFAFF; color: #7A5CF0; }
.r2-searchbox input { flex: 1; border: 0; background: transparent; padding: 10px 0; font-size: 1rem; color: #1E2452; width: auto; border-radius: 0; }
.r2-searchbox input:focus { box-shadow: none; outline: none; }
.r2-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.r2-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid #E3DEF7; background: #fff; color: #1E2452; font-size: .9rem; }
.r2-chip[aria-pressed="true"] { background: #1E2452; border-color: #1E2452; color: #fff; }
.r2-starcount { font-family: var(--f-head); color: #9A5B00; background: #FFF3CF; padding: 8px 14px; border-radius: 999px; }
.r2-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.r2-cat { position: relative; display: grid; gap: 6px; align-content: start; text-align: left; min-height: 210px; padding: 18px 16px 22px; border-radius: 22px; border: 0; background: color-mix(in srgb, var(--cc) 12%, #fff); color: #1E2452; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cc) 35%, transparent); transition: transform .15s; overflow: hidden; }
.r2-cat:hover { transform: translateY(-3px); }
.r2-cat .em { font-size: 2.6rem; line-height: 1; }
.r2-cat b { font-family: var(--f-head); font-weight: 600; font-size: 1.15rem; }
.r2-cat .desc { font-size: .9rem; color: #4A4872; line-height: 1.45; }
.r2-cat .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: #4A4872; margin-top: auto; }
.r2-cat .meta span { background: rgba(255, 255, 255, .8); padding: 2px 8px; border-radius: 99px; }
.r2-cat .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: rgba(255, 255, 255, .6); }
.r2-cat .bar i { display: block; height: 100%; background: var(--cc); }
.r2-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.r2-tile { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 14px; border-radius: 18px; border: 2px solid #ECE8FA; background: #fff; color: #1E2452; text-align: left; }
.r2-tile:hover { border-color: var(--cc); }
.r2-tile .cat { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; font-size: 1.5rem; background: color-mix(in srgb, var(--cc) 16%, #fff); }
.r2-tile .body { flex: 1; display: grid; gap: 2px; }
.r2-tile .mt { font-size: .78rem; color: #6B688F; }
.r2-tile b { font-family: var(--f-head); font-weight: 500; font-size: 1rem; line-height: 1.35; }
.r2-tile .marks { display: flex; gap: 4px; align-items: center; }
.r2-tile .marks .ok { color: #2FA876; }
.r2-tile.seen { background: #FBFAFF; }
.r2-reshead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.r2-link { border: 0; background: none; color: #7A5CF0; font-family: var(--f-head); text-decoration: underline; }
.r2-empty { color: #6B688F; text-align: center; padding: 18px; }
.r2-empty.big { display: grid; gap: 10px; justify-items: center; padding: 26px; border: 2px dashed #DCD5F5; border-radius: 20px; }
.r2-empty .em { font-size: 2.2rem; }

/* buttons */
.r2-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid #7A5CF0; background: #7A5CF0; color: #fff; font-family: var(--f-head); font-size: 1rem; text-decoration: none; }
.r2-btn.ghost { background: #fff; color: #4B2BB8; border-color: #D9D3F5; }
.r2-btn.small { min-height: 40px; font-size: .9rem; padding: 0 14px; }
.r2-btn.out { background: #1E9FBA; border-color: #1E9FBA; justify-self: start; }

/* modal + reader */
.r2-modal { position: fixed; inset: 0; z-index: 5; background: rgba(30, 36, 82, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.r2-sheet { position: relative; width: min(860px, 100%); max-height: calc(100% - 8px); overflow-y: auto; background: #fff; border-radius: 26px; padding: 22px 22px 18px; display: grid; gap: 14px; box-shadow: 0 30px 80px -30px rgba(10, 12, 40, .6); }
.r2-x { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 14px; border: 0; background: #F2EEFF; color: #1E2452; display: grid; place-items: center; z-index: 2; }
.r2-cathead { display: flex; gap: 14px; align-items: center; padding: 14px 60px 14px 14px; border-radius: 20px; background: color-mix(in srgb, var(--cc) 14%, #fff); }
.r2-cathead .em { font-size: 2.6rem; }
.r2-cathead h2 { font-size: 1.4rem; }
.r2-tip { font-size: .88rem; color: #6B688F; }
.r2-crumb { display: flex; flex-wrap: wrap; gap: 8px; padding-right: 54px; font-family: var(--f-head); font-size: .9rem; }
.r2-crumb > span:first-child { color: #fff; background: var(--cc); padding: 4px 12px; border-radius: 99px; }
.r2-crumb .mt { color: #4A4872; background: #F2EEFF; padding: 4px 12px; border-radius: 99px; }
.r2-utitle { font-size: 1.55rem; line-height: 1.3; }
.r2-lines { display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; background: #F8F6FF; border-left: 6px solid #7A5CF0; }
.r2-lines p { font-size: 1.12rem; line-height: 1.6; }
.r2-src { font-size: .85rem; color: #5D5A86; }
.r2-src summary { cursor: pointer; }
.r2-src a { color: #4B2BB8; }
.r2-quiz { display: grid; gap: 10px; padding: 16px; border-radius: 20px; background: #FFF8E6; border: 2px solid #F6D27A; }
.r2-quiz .kick { font: 600 .95rem var(--f-head); color: #9A5B00; }
.r2-quiz .q { font: 500 1.12rem/1.5 var(--f-head); }
.r2-choices { display: grid; gap: 8px; }
.r2-choice { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 16px; border: 2px solid #EADFB8; background: #fff; color: #1E2452; text-align: left; font-size: 1rem; }
.r2-choice .l { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #F6D27A; font-family: var(--f-head); }
.r2-choice.right { border-color: #2FA876; background: #E7F7EF; }
.r2-choice.right .l { background: #2FA876; color: #fff; }
.r2-choice.wrong { border-color: #E0607A; background: #FDEDEF; }
.r2-choice:disabled { cursor: default; opacity: 1; }
.r2-fb:empty { display: none; }
.r2-fb { padding: 10px 14px; border-radius: 14px; }
.r2-fb.ok { background: #E7F7EF; } .r2-fb.no { background: #FDEDEF; }
.r2-fb b { font-family: var(--f-head); }
.r2-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: #5D5A86; }
.r2-star { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 2px solid #E8B54A; background: #fff; color: #7A4E00; font: 600 1.05rem var(--f-head); }
.r2-star span { font-size: 1.3rem; }
.r2-star[aria-pressed="true"] { background: #FFE9A8; }
.r2-readnav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid #EEEAFB; padding-top: 12px; }
.r2-readnav .grow { flex: 1; }

/* media */
.r2-media { display: grid; gap: 10px; }
.r2-svg svg { display: block; width: 100%; height: auto; max-height: 340px; }
.r2-svg text { font-family: var(--f-body); }
.r2-svg .lab text, .r2-svg .w { font: 600 18px var(--f-head); fill: #fff; }
.r2-svg .s { font-size: 14px; }
.r2-svg .b { font: 600 15px var(--f-head); fill: #4A4872; }
.r2-svg .g { font: 600 15px var(--f-head); fill: #2FA876; }
.r2-svg .mo { font-size: 13px; fill: #4A4872; }
.r2-svg .src { font-size: 12px; fill: #8A84B8; }
.r2-svg .go { fill: none; stroke: #2FA876; stroke-width: 5; stroke-dasharray: 12 8; stroke-linecap: round; }
.r2-svg .ln { fill: none; stroke: #1E2452; stroke-width: 3; }
.r2-legend { margin: 8px 0 0; padding-left: 22px; columns: 2; font-size: .95rem; }
.r2-svg .tag2 { font: 600 15px var(--f-head); fill: #7A5CF0; }
.r2-svg .up { stroke: #7A5CF0; stroke-width: 4; stroke-dasharray: 6 6; }
.r2-b2 svg { max-height: 460px; }
.r2-blocked .fah { transition: opacity .4s; }
.r2-blocked .p2, .r2-blocked .p3 { opacity: 0; transition: opacity .5s; }
.r2-blocked svg.ph2 .p2, .r2-blocked svg.ph3 .p2, .r2-blocked svg.ph3 .p3 { opacity: 1; }
.r2-blocked svg.ph2 .p1, .r2-blocked svg.ph3 .p1 { stroke: #E0607A; opacity: .5; }
.r2-blocked .x { fill: #E0607A; }
.r2-ifthen .byes, .r2-ifthen .bno { opacity: .35; transition: opacity .4s; }
.r2-ifthen svg.yes .byes, .r2-ifthen svg.no .bno { opacity: 1; }
.r2-ifthen svg.yes .ln.yes, .r2-ifthen svg.no .ln.no { stroke: #F26B4F; stroke-width: 5; }
.r2-loop .bw, .r2-loop .bd, .r2-loop .be, .r2-loop .back { transition: all .3s; }
.r2-loop svg.w .bw, .r2-loop svg.d .bd, .r2-loop svg.e .be { stroke: #F26B4F; stroke-width: 6; }
.r2-loop svg.b .back { stroke: #E0607A; stroke-width: 6; }
.r2-strobe .flash { animation: r2flash 1s steps(2, start) infinite; }
@keyframes r2flash { to { opacity: .15; } }
.r2-linked .wire { stroke: #B9B3DA; stroke-width: 4; fill: none; }
.r2-linked .bell { opacity: .25; transition: opacity .3s; }
.r2-linked .smoke { opacity: 0; }
.r2-linked svg.s1 .smoke, .r2-linked svg.s2 .smoke, .r2-linked svg.s3 .smoke { opacity: 1; }
.r2-linked svg.s2 .r0 .bell, .r2-linked svg.s3 .bell { opacity: 1; }
.r2-linked svg.s2 .wire, .r2-linked svg.s3 .wire { stroke: #F26B4F; stroke-dasharray: 10 8; animation: r2wire .8s linear infinite; }
@keyframes r2wire { to { stroke-dashoffset: -18; } }
.r2-steps { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 8px; padding: 12px; border-radius: 20px; background: #F8F6FF; }
.r2-step { flex: 1 1 110px; max-width: 180px; display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; padding: 12px 8px; border-radius: 16px; background: #fff; border: 2px solid #ECE8FA; transition: all .35s; }
.r2-step .em { font-size: 2rem; }
.r2-step b { font-family: var(--f-head); font-weight: 500; font-size: .95rem; line-height: 1.35; }
.r2-step .sub { font-size: .8rem; color: #6B688F; }
.r2-steps.anim .r2-step { opacity: .45; }
.r2-steps.anim .r2-step.past { opacity: .85; }
.r2-steps.anim .r2-step.on { opacity: 1; border-color: #F26B4F; transform: translateY(-4px) scale(1.04); box-shadow: 0 12px 24px -14px rgba(242, 107, 79, .7); }
.r2-arrow { align-self: center; color: #B5AED8; font-size: 1.4rem; }
.r2-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.r2-cmp { padding: 14px; border-radius: 18px; background: #F8F6FF; }
.r2-cmp.l { background: #EEF6FF; } .r2-cmp.r { background: #FFF1EB; }
.r2-cmp .hd { display: flex; align-items: center; gap: 8px; font-family: var(--f-head); font-size: 1.1rem; }
.r2-cmp .em { font-size: 1.8rem; }
.r2-cmp ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.r2-compare .vs { align-self: center; font: 700 1rem var(--f-head); color: #8A84B8; }
.r2-icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.r2-ic { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 14px 10px; border-radius: 18px; background: #F8F6FF; font-size: .95rem; line-height: 1.4; }
.r2-ic .em { font-size: 2rem; }
.r2-syms { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.r2-sym { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: #F8F6FF; font-size: .95rem; }
.r2-sym .fc-shape { stroke: #1E2452; stroke-width: 6; }
.r2-sym .fc-start .fc-shape, .r2-sym .fc-sym.fc-start .fc-shape { fill: #7FE0B0; }
.r2-sym .arrowsym { font-size: 1.8rem; width: 60px; text-align: center; color: #1E2452; }
.r2-fig img { width: 100%; border-radius: 16px; }
.r2-vid { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.r2-vid video, .r2-vid iframe { width: 100%; height: 100%; border: 0; }

/* ② board */
.r2-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.r2-zone { display: grid; align-content: start; gap: 8px; min-height: 220px; padding: 12px; border-radius: 20px; background: color-mix(in srgb, var(--cc) 9%, #fff); border: 2px dashed color-mix(in srgb, var(--cc) 45%, transparent); transition: background .2s, transform .2s; }
.r2-zone.tray { background: #F6F5FA; }
.r2-zone.over { background: color-mix(in srgb, var(--cc) 22%, #fff); transform: scale(1.02); }
.r2-zone .zh { display: flex; align-items: center; gap: 8px; }
.r2-zone .zh .em { font-size: 1.5rem; }
.r2-zone .zh b { flex: 1; font-family: var(--f-head); font-weight: 600; font-size: 1rem; line-height: 1.35; }
.r2-zone .zh .n { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 99px; background: #fff; font-family: var(--f-head); }
.r2-zone .zl { display: grid; gap: 8px; }
.r2-zone .drop { color: #8A84B8; font-size: .88rem; text-align: center; padding: 18px 6px; }
.r2-card { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 0; background: #fff; color: #1E2452; text-align: left; font-size: .93rem; line-height: 1.35; box-shadow: 0 6px 14px -10px rgba(30, 36, 82, .6), inset 4px 0 0 var(--cc); touch-action: none; user-select: none; cursor: grab; }
.r2-card .em { font-size: 1.2rem; }
.r2-card.dragging { opacity: .35; }
.r2-card.ghost { position: fixed; z-index: 20; pointer-events: none; transform: rotate(-3deg); box-shadow: 0 18px 40px -14px rgba(30, 36, 82, .7), inset 4px 0 0 var(--cc); }
.r2-menu { position: fixed; z-index: 20; width: 262px; display: grid; gap: 4px; padding: 8px; border-radius: 18px; background: #fff; box-shadow: 0 20px 50px -20px rgba(10, 12, 40, .6); border: 1px solid #ECE8FA; }
.r2-menu .hd { font: 500 .8rem var(--f-head); color: #6B688F; padding: 4px 8px; }
.r2-menu button { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: #F8F6FF; color: #1E2452; text-align: left; font-size: .93rem; }
.r2-menu button.cur { background: #E7F7EF; }
.r2-menu button:hover { background: #ECE8FA; }

/* ③ connect */
.r2-connect { display: grid; gap: 14px; }
.r2-mine { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; }
.r2-pill { padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--cc) 14%, #fff); }
.r2-field { display: grid; gap: 6px; }
.r2-field label { font: 600 1.08rem var(--f-head); }
.r2 .r2-field textarea { width: 100%; min-height: 70px; padding: 12px 14px; border-radius: 16px; border: 2px solid #E3DEF7; background: #FBFAFF; color: #1E2452; font-size: 1.02rem; line-height: 1.6; resize: vertical; }
.r2 .r2-field textarea:focus { outline: none; border-color: #7A5CF0; box-shadow: 0 0 0 3px rgba(122, 92, 240, .2); }
.r2-ctarow { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.r2-note { color: #6B688F; font-size: .92rem; flex: 1 1 260px; }
.r2-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 26px; border-radius: 999px; border: 0; background: linear-gradient(135deg, #8C74F2, #5B3BD6); color: #fff; font: 600 1.08rem var(--f-head); box-shadow: 0 14px 30px -14px rgba(91, 59, 214, .9); }
.r2-cta:disabled { background: #CFCADF; box-shadow: none; cursor: not-allowed; }
.r2-saved { font-size: .85rem; color: #6B688F; }

/* footer */
.r2-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.r2-teacher { border: 0; background: none; color: #8A84B8; font-size: .85rem; text-decoration: underline; }

/* coach */
.r2-fab { position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 4; display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; min-height: 64px; border-radius: 999px; border: 0; background: #1E2452; color: #fff; text-align: left; box-shadow: 0 16px 34px -14px rgba(30, 36, 82, .8); }
.r2-fab .nova-face { width: 52px; height: 52px; }
.r2-fab span { display: grid; }
.r2-fab b { font-family: var(--f-head); font-size: 1.05rem; }
.r2-fab small { font-size: .74rem; color: #CFC6F7; }
.r2.chat-on .r2-fab { display: none; }
.r2-chat { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 6; width: min(400px, calc(100% - 32px)); height: min(620px, calc(100% - 110px)); display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 8px; padding: 14px; border-radius: 24px; background: #fff; box-shadow: 0 30px 70px -24px rgba(10, 12, 40, .55); border: 1px solid #ECE8FA; }
.r2-chat .hd { display: flex; align-items: center; gap: 10px; padding-right: 48px; }
.r2-chat .hd .nova-face { width: 48px; height: 48px; }
.r2-chat .hd div { display: grid; }
.r2-chat .hd b { font-family: var(--f-head); font-size: 1.1rem; }
.r2-chat .hd small { color: #6B688F; }
.r2-chat .r2-x { top: 14px; right: 14px; }
.r2-proto { font-size: .75rem; color: #1E7F94; background: #E3F6FA; padding: 4px 10px; border-radius: 10px; }
.r2-log { overflow-y: auto; display: grid; gap: 8px; align-content: start; padding: 4px; }
.r2-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.55; font-size: .98rem; white-space: pre-wrap; }
.r2-msg.nova { background: #F2EEFF; border-bottom-left-radius: 6px; justify-self: start; }
.r2-msg.me { background: #7A5CF0; color: #fff; border-bottom-right-radius: 6px; justify-self: end; }
.r2-offer { justify-self: start; }
.r2-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.r2-sugg .r2-chip { min-height: 36px; font-size: .84rem; }
.r2-input { display: flex; gap: 8px; align-items: flex-end; }
.r2 .r2-input textarea { flex: 1; min-height: 48px; max-height: 110px; padding: 12px 14px; border-radius: 16px; border: 2px solid #E3DEF7; background: #FBFAFF; color: #1E2452; resize: none; }
.r2-send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #7A5CF0; color: #fff; display: grid; place-items: center; }

@media (max-width: 900px) {
  .r2-banner { grid-template-columns: 1fr; }
  .r2-board { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .r2-head { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .r2-nav { padding: 0 12px; }
  .r2-head .ttl b { font-size: .98rem; }
  .r2-head .ttl span { display: none; }
  .r2-wrap { padding: 12px 10px 110px; gap: 16px; }
  .r2-sec { padding: 14px; border-radius: 20px; }
  .r2-board { grid-template-columns: 1fr; }
  .r2-zone { min-height: 0; }
  .r2-compare { grid-template-columns: 1fr; }
  .r2-compare .vs { justify-self: center; }
  .r2-progress { grid-template-columns: 1fr; }
  .r2-sheet { padding: 16px 14px; border-radius: 22px; }
  .r2-modal { padding: 8px; }
  .r2-legend { columns: 1; }
  .r2-fab small { display: none; }
  .r2-chat { right: 8px; left: 8px; width: auto; bottom: 8px; height: calc(100% - 90px); }
}
html.reduce-motion .r2 *, html.reduce-motion .r2 *::before { animation: none !important; transition: none !important; }
html.in-room2 #toasts { top: auto; bottom: calc(96px + var(--safe-b)); left: 50%; }
.r2-sugg { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.r2-sugg .r2-chip { flex: none; }
