/* Rabin-Interiors & Woods: Room Ply Finder. Themed through the --riw-* variables in core.css.
   The script draws the cut-away home in the SVG; the switches, room buttons, legend and panel are plain HTML. */

.riw-ply { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 20px; align-items: start; }

/* Stage */
.riw-ply-stage { border-radius: var(--riw-radius); overflow: hidden; background: linear-gradient(#d7e4ea, #f1eee7 70%); border: 1px solid var(--riw-line); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.riw--dark .riw-ply-stage { background: linear-gradient(#22303a, #1c1814 75%); }
.riw-ply-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.riw-ply-seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.72); border: 1px solid rgba(0,0,0,.08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.riw-ply-seg button { padding: .45rem .9rem; border: 0; border-radius: 999px; background: none; color: #4a4038; font-size: .76rem; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background .25s, color .25s; }
.riw-ply-seg button:hover { color: #1c1712; }
.riw-ply-seg button.is-on { background: #1c1712; color: #f6f1e9; }
.riw--dark .riw-ply-seg { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
.riw--dark .riw-ply-seg button { color: #cfc6b9; }
.riw--dark .riw-ply-seg button.is-on { background: #f3d79b; color: #1c1712; }

.riw-ply-svg { display: block; width: 100%; height: auto; }
.riw-ply-room { cursor: pointer; }
.riw-ply-tint { opacity: 0; transition: opacity .35s, fill .35s; pointer-events: none; }
.riw-ply.is-map .riw-ply-tint { opacity: .6; }
.riw-ply-label { font: 600 11px/1 var(--riw-font, inherit); letter-spacing: .12em; fill: #5a5048; pointer-events: none; }
.riw-ply-grade { font: 700 32px/1 var(--riw-font-display, inherit); letter-spacing: -.02em; fill: #1c1712; pointer-events: none; }
.riw-ply-hl { fill: none; stroke: var(--riw-accent); stroke-width: 4; opacity: 0; transition: opacity .25s; pointer-events: none; }
.riw-ply-room:hover .riw-ply-hl { opacity: .45; }
.riw-ply-room.is-on .riw-ply-hl { opacity: 1; }
.riw-ply-drop { animation: riw-ply-drop 2.4s linear infinite; }
@keyframes riw-ply-drop { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(22px); opacity: 0; } }

.riw-ply-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.riw-ply-rooms button { padding: .45rem .85rem; border-radius: 999px; border: 1px solid rgba(0,0,0,.12); background: rgba(255,255,255,.7); color: #2a241f; font-size: .78rem; font-weight: 600; line-height: 1.2; cursor: pointer; transition: all .25s; }
.riw-ply-rooms button:hover { border-color: var(--riw-accent); }
.riw-ply-rooms button.is-on { background: var(--riw-ink); border-color: var(--riw-ink); color: #f6f1e9; }
.riw--dark .riw-ply-rooms button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--riw-text); }
.riw--dark .riw-ply-rooms button.is-on { background: #f3d79b; border-color: #f3d79b; color: #1c1712; }

.riw .riw-ply-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.riw-ply-legend li { display: flex; align-items: baseline; gap: .4rem; font-size: .76rem; line-height: 1.35; color: #2a241f; }
.riw--dark .riw-ply-legend li { color: var(--riw-text); }
.riw-ply-legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; align-self: center; }
.riw-ply-legend small { color: #6f6458; font-size: .72rem; }
.riw--dark .riw-ply-legend small { color: var(--riw-muted); }

/* Panel */
.riw-ply-side { background: var(--riw-card); border: 1px solid var(--riw-line); border-radius: var(--riw-radius); padding: 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; }
.riw-ply-sum { display: flex; flex-direction: column; gap: 1rem; }
.riw .riw-ply-name { font-size: clamp(2rem, 3.4vw, 2.7rem); }
.riw-ply-wet { display: flex; align-items: center; gap: .7rem; font-size: .78rem; color: var(--riw-muted); }
.riw-ply-wet b { color: var(--riw-text); font-weight: 600; min-width: 4.5em; text-align: right; }
.riw-ply-meter { flex: 1; height: 6px; border-radius: 9px; background: var(--riw-tint); box-shadow: inset 0 0 0 1px var(--riw-line); overflow: hidden; }
.riw-ply-meter i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #e3c99b, #3fa7c9, #2f6fb5); transition: width .5s var(--riw-ease); }

.riw .riw-ply-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.riw-ply-it { display: grid; grid-template-columns: 10px 1fr auto; gap: .8rem; align-items: center; padding: .75rem .9rem; border-radius: 14px; border: 1px solid var(--riw-line); background: var(--riw-bg); }
.riw-ply-it.is-in { animation: riw-ply-in .45s var(--riw-ease) both; }
@keyframes riw-ply-in { from { opacity: 0; transform: translateX(14px); } }
.riw-ply-it > i { width: 10px; height: 36px; border-radius: 4px; }
.riw-ply-it__t b { display: block; font-size: .9rem; font-weight: 600; line-height: 1.3; }
.riw-ply-it__t small { display: block; font-size: .76rem; color: var(--riw-muted); line-height: 1.4; }
.riw-ply-it__t em { font-style: normal; color: #b07a12; font-weight: 600; }
.riw--dark .riw-ply-it__t em { color: #f2c14e; }
.riw-ply-it__g { font-size: .82rem; font-weight: 700; text-align: right; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.riw-ply-it__g small { display: block; font-weight: 500; color: var(--riw-muted); font-size: .74rem; }
.riw-ply-it.is-up { border-color: rgba(214,160,40,.55); box-shadow: inset 0 0 0 1px rgba(214,160,40,.25); }

.riw-ply-side .riw-btn { justify-content: center; margin-top: .3rem; }
.riw .riw-ply-note { font-size: .72rem; color: var(--riw-dim); text-align: center; line-height: 1.5; margin-top: -.4rem; }

@media (max-width: 1100px) {
	.riw-ply { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
	.riw-ply-stage { padding: 12px; }
	.riw-ply-seg button { padding: .4rem .7rem; font-size: .72rem; }
	.riw-ply-side { padding: 1.2rem; }
	.riw-ply-it { padding: .65rem .75rem; gap: .65rem; }
	.riw-ply-legend small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.riw-ply * { transition: none !important; animation: none !important; }
}
