/* Measure & Quote only. Installation and ordinary Ask Ray retain their layout. */
/* The calculator grows beyond the viewport; keep the site footer after its content. */
.public-ray-page.is-measure-editor {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}
.is-measure-editor > .public-ray-hero { display:none!important; }
.is-measure-editor > .public-ray-chat-card { display:none!important; }
.is-measure-editor.rr-show-chat > .public-ray-chat-card { display:flex!important; margin-top:24px; max-height:650px; }
.ray-room-editor { --rr-red:#e71924; --rr-line:#dce1e5; background:#fff; border:1px solid var(--rr-line); border-radius:20px; box-shadow:0 8px 30px #18233008; padding:clamp(16px,3vw,36px); color:#26313b; width:100%; min-width:0; box-sizing:border-box; container-type:inline-size; }
.ray-room-editor[hidden] { display:none!important; }
.ray-room-editor * { box-sizing:border-box; }
.rr-header { display:flex; justify-content:space-between; gap:24px; align-items:start; }
.rr-header h2 { font-size:clamp(25px,3vw,36px); margin:6px 0 12px; letter-spacing:-.03em; }
.rr-header p { max-width:650px; }
.rr-header > div:last-child { display:flex; flex-wrap:wrap; gap:8px; }
.rr-eyebrow { text-transform:uppercase; letter-spacing:.09em; font-size:12px; color:#b61520; font-weight:700; }
.ray-room-editor p { line-height:1.6; }
.ray-room-editor button { border:1px solid #cdd4da; border-radius:9px; background:#fff; padding:10px 14px; color:#25313e; cursor:pointer; font:inherit; font-size:14px; min-height:42px; }
.ray-room-editor button:hover { background:#f4f6f7; }
.ray-room-editor button:disabled { opacity:.6; cursor:wait; }
.ray-room-editor button:focus-visible,.ray-room-editor input:focus-visible,.ray-room-editor select:focus-visible { outline:3px solid #235f96; outline-offset:2px; }
.ray-room-editor .rr-primary { background:var(--rr-red); color:#fff; border-color:var(--rr-red); font-weight:650; }
.ray-room-editor .rr-primary:hover { background:#c8111c; }
.ray-room-editor .rr-link { border:0; background:none; color:#a91e27; padding:6px; font-size:13px; min-height:36px; }
.rr-steps { display:flex; gap:8px; margin:24px 0; border-bottom:1px solid var(--rr-line); padding-bottom:16px; }
.rr-steps button { flex:1; text-align:left; }
.rr-steps button[aria-current=step] { border-color:var(--rr-red); color:#b51520; background:#fff1f1; font-weight:700; }
.rr-toolbar { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:24px; }
.rr-toolbar label { min-width:200px; margin-bottom:0 !important; }
.ray-room-editor label { display:grid; gap:6px; font-size:14px; font-weight:600; margin-bottom:14px; }
.ray-room-editor input:not([type=checkbox]),.ray-room-editor select { font:inherit; color:#25313e; background:#fff; border:1px solid #bdc7ce; border-radius:7px; min-height:44px; padding:9px 10px; width:100%; min-width:0; }
.ray-room-editor input[aria-invalid=true] { border-color:#c21d29; background:#fff5f5; }
.rr-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:28px; align-items:start; }
.rr-fields { min-width:0; }
.rr-dimensions,.rr-add { display:flex; gap:12px; align-items:end; }
.rr-dimensions > label,.rr-add > label { flex:1; min-width:0; }
.rr-add { margin-top:18px; }
.rr-add button { margin-bottom:14px; }
.rr-preview { position:sticky; top:88px; border:1px solid var(--rr-line); border-radius:14px; padding:16px; background:#fafbfc; min-width:0; }
.rr-preview-heading { display:flex; justify-content:space-between; gap:12px; font-size:14px; }
.rr-preview svg { width:100%; min-height:240px; max-height:480px; aspect-ratio:1.1; touch-action:none; user-select:none; }
.rr-preview svg g { cursor:grab; }
.rr-preview svg g:active { cursor:grabbing; }
.rr-preview p { font-size:13px; color:#55616d; }
.rr-legend { display:flex; flex-wrap:wrap; gap:12px; font-size:12px; margin-top:12px; }
.rr-legend span::before { content:''; display:inline-block; width:12px; height:12px; background:#fff; border:1px solid #777; margin-right:5px; }
.rr-legend .rr-green::before { background:#d5eedf; border-color:#9ac8ac; }
.rr-legend .rr-pink::before { background:#f9e4e4; border-color:#d3a6a6; }
.rr-table-wrap { overflow-x:auto; }
.ray-room-editor table { border-collapse:collapse; width:100%; font-size:14px; }
.ray-room-editor th { text-align:left; background:#f1f4f6; color:#52606b; font-size:12px; padding:12px 8px; }
.ray-room-editor td { border-bottom:1px solid var(--rr-line); padding:12px 6px; vertical-align:top; min-width:82px; }
.ray-room-editor td:last-child { min-width:160px; }
.ray-room-editor td input { min-width:76px; }
.ray-room-editor td strong { text-transform:capitalize; display:block; }
.ray-room-editor small { display:block; color:#687581; font-size:12px; line-height:1.5; font-weight:400; }
.rr-notice { background:#f1f6fa; border-radius:10px; padding:14px; font-size:13px; color:#435768; }
.rr-error { border:1px solid #e99ba1; background:#fff0f1; border-radius:9px; color:#9b1820; padding:14px; }
.rr-result { padding:16px; border:1px solid var(--rr-line); border-radius:10px; margin:14px 0; }
.rr-result h4 { margin:0 0 10px; font-size:17px; }
.ray-room-editor .rr-check,.rr-room-choice label { display:flex; gap:10px; align-items:flex-start; line-height:1.6; font-weight:500; }
.ray-room-editor input[type=checkbox] { width:19px; height:19px; accent-color:#d81722; flex-shrink:0; margin-top:3px; }
.ray-room-editor fieldset { border:1px solid var(--rr-line); border-radius:9px; padding:12px; margin:14px 0; }
.ray-room-editor legend { font-size:13px; font-weight:700; padding:0 5px; }
.rr-corners { max-height:300px; overflow:auto; margin-top:12px; }
.rr-corners fieldset { display:flex; gap:10px; }
.rr-footer { border-top:1px solid var(--rr-line); margin-top:28px; padding-top:20px; display:flex; justify-content:space-between; gap:16px; align-items:center; }
.rr-footer span { color:#66737d; font-size:12px; }
.rr-footer > div { display:flex; gap:10px; flex-shrink:0; }
.ray-room-editor details { border-top:1px solid var(--rr-line); padding:16px 0; margin-top:16px; }
.ray-room-editor summary { cursor:pointer; font-weight:600; }
.ray-room-editor iframe { width:100%; height:400px; border:1px solid var(--rr-line); margin-top:14px; }
@media(max-width:1050px) { .rr-layout { grid-template-columns:1fr; }.rr-preview { position:static; }.rr-preview svg { max-height:420px; }.rr-header { flex-direction:column; } }
@media(max-width:600px) { .rr-steps { gap:5px; }.rr-steps button { font-size:12px; padding:8px; }.rr-footer { align-items:stretch; flex-direction:column; }.rr-footer > div { justify-content:space-between; }.rr-dimensions { gap:8px; }.rr-toolbar label { min-width:140px; }.rr-header h2 { font-size:26px; } }
/* Keep fixture entry usable on narrow screens without horizontal scrolling. */
@media(max-width:600px) {
    .rr-table-wrap { overflow:visible; }
    .ray-room-editor table,.ray-room-editor tbody { display:block; }
    .ray-room-editor thead { display:none; }
    .ray-room-editor tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); border:1px solid var(--rr-line); border-radius:10px; padding:10px; margin-bottom:12px; gap:10px; }
    .ray-room-editor td { min-width:0; padding:0; border:0; }
    .ray-room-editor td:first-child,.ray-room-editor td:last-child { grid-column:1 / -1; min-width:0; }
    .ray-room-editor td:nth-child(2)::before { content:'Width (mm)'; }
    .ray-room-editor td:nth-child(3)::before { content:'Depth (mm)'; }
    .ray-room-editor td:nth-child(2)::before,.ray-room-editor td:nth-child(3)::before { display:block; font-size:13px; margin-bottom:6px; font-weight:600; }
    .ray-room-editor td:last-child label { margin-top:10px; }
}
.rr-preview svg text { font-family:Arial,sans-serif; }
.rr-result,.rr-preview,.rr-quotation { overflow-wrap:anywhere; }
.rr-quotation { border-top:1px solid var(--rr-line); margin-top:28px; padding-top:20px; }
.rr-quote-room { margin:18px 0; }
.rr-quote-line { display:flex; justify-content:space-between; gap:20px; border-bottom:1px solid var(--rr-line); padding:12px 0; }
.rr-quote-line > span:last-child { flex-shrink:0; text-align:right; }
.rr-quote-total { font-size:18px; }
.rr-quote-actions { display:flex; gap:12px; flex-wrap:wrap; }
.rr-footer > div { flex-wrap:wrap; }
@container (max-width:900px) {
    .rr-layout { grid-template-columns:minmax(0,1fr); }
    .rr-preview { position:static; }
    .rr-preview svg { max-height:420px; }
}
@media(max-width:600px) {
    .rr-toolbar { align-items:stretch; }
    .rr-toolbar label { flex:1 1 100%; min-width:0; }
    .rr-quote-line { flex-wrap:wrap; gap:6px; }
    .rr-quote-actions > button { width:100%; }
}

body.is-plan-tracing { overflow:hidden !important; }
.ray-plan-tracer { width:min(1320px,calc(100% - 24px)); max-width:none; max-height:calc(100dvh - 24px); margin:auto; padding:22px; border:1px solid #cbd4dc; border-radius:16px; color:#26313b; background:#fff; overflow:auto; box-sizing:border-box; }
.ray-plan-tracer::backdrop { background:#15202dcc; }
.ray-plan-tracer * { box-sizing:border-box; }
.ray-plan-tracer header,.ray-plan-tracer footer,.pt-toolbar,.pt-calibration { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ray-plan-tracer header,.ray-plan-tracer footer { justify-content:space-between; }
.ray-plan-tracer h2 { margin:0; font-size:24px; }
.ray-plan-tracer header p { margin:8px 0 0; }
.ray-plan-tracer button,.ray-plan-tracer input,.ray-plan-tracer select { font:inherit; padding:9px 12px; min-height:42px; border:1px solid #bdc7ce; border-radius:7px; background:#fff; color:#26313b; }
.ray-plan-tracer button { cursor:pointer; }
.ray-plan-tracer button:disabled { opacity:.5; cursor:default; }
.ray-plan-tracer button[aria-pressed=true] { border-color:#e31e24; background:#fff1f1; }
.ray-plan-tracer .rr-primary { background:#e31e24; border-color:#e31e24; color:#fff; }
.ray-plan-tracer :focus-visible { outline:3px solid #235f96; outline-offset:2px; }
.pt-toolbar,.pt-calibration { margin-top:16px; }
.ray-plan-tracer label { display:grid; gap:5px; font-size:13px; font-weight:600; }
.pt-calibration { align-items:end; padding:14px; background:#f1f6fa; border-radius:10px; }
.pt-instruction { font-size:14px; line-height:1.5; }
.pt-viewport { max-height:55dvh; min-height:260px; overflow:auto; border:1px solid #cbd4dc; background:#e5e9ee; padding:10px; overscroll-behavior:contain; }
.pt-stage { position:relative; flex:none; }
.pt-stage canvas,.pt-stage svg { position:absolute; inset:0; display:block; width:100%; height:100%; }
.pt-stage svg { cursor:crosshair; }
.pt-viewport[data-mode=pan],.pt-viewport[data-mode=pan] svg { cursor:grab; touch-action:none; }
.pt-stage [data-pt-corner] { cursor:move; touch-action:none; }
.ray-plan-tracer footer { margin-top:16px; }
.ray-plan-tracer footer > div { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pt-note,.pt-summary { font-size:13px; line-height:1.5; }
.pt-error { color:#9b1820; background:#fff0f1; padding:12px; border-radius:8px; }
@media(max-width:600px) {
    .ray-plan-tracer { padding:14px; width:calc(100% - 12px); max-height:calc(100dvh - 12px); }
    .ray-plan-tracer h2 { font-size:20px; }
    .pt-calibration label { flex:1 1 100%; }
    .pt-calibration button { flex:1 1 auto; }
    .ray-plan-tracer footer > button { width:100%; }
    .pt-viewport { max-height:48dvh; }
}

.rr-scan-actions { display:flex; flex-wrap:wrap; gap:12px; margin:20px 0; }
.pt-scale-steps { margin:12px 0; padding-left:24px; }
.pt-scale-steps li { margin-bottom:5px; }
.pt-scale-status { border-left:4px solid #0067a3; padding:12px; background:#eef6fb; }

/* Compact contextual tool-help drawer; keep normal Ask Ray and Installation layouts intact. */
.is-measure-editor.rr-show-chat > .public-ray-chat-card {position:fixed!important;right:22px;bottom:22px;top:auto!important;width:390px!important;max-width:calc(100vw - 24px);height:610px!important;max-height:calc(100dvh - 40px)!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr) auto auto!important;gap:0!important;z-index:1500;margin:0!important;border:1px solid #d6dce2;border-radius:16px;box-shadow:0 12px 50px #17273740;overflow:hidden!important;}
.is-measure-editor.rr-show-chat .public-ray-chat-card > * {grid-column:1!important;min-width:0;max-width:100%;}
.is-measure-editor.rr-show-chat .public-ray-chat-header {display:flex!important;flex-wrap:wrap;gap:8px;padding:12px;}
.is-measure-editor.rr-show-chat .public-ray-messages {display:block!important;overflow-y:auto!important;padding:12px;min-height:0;}
.is-measure-editor.rr-show-chat .public-ray-composer {padding:10px!important;}
.is-measure-editor.rr-show-chat .public-ray-composer__row {display:flex!important;gap:6px;}
.is-measure-editor.rr-show-chat .public-ray-composer textarea {min-width:0;flex:1;}
.is-measure-editor.rr-show-chat .public-ray-starters {display:none;}
.rr-room-tabs {display:flex;gap:8px;flex-wrap:wrap;}
.rr-room-tabs button[aria-current=true] {border-color:#df1823;background:#fff1f2;color:#b51420;font-weight:700;}
#rrPreview [data-resize-handle],#rrPreview [data-patch-resize] {cursor:nwse-resize;}
#rrPreview [data-shower-patch] {cursor:move;}
@media(max-width:500px){.is-measure-editor.rr-show-chat > .public-ray-chat-card {right:12px;bottom:12px;width:calc(100vw - 24px)!important;height:65dvh!important;}}

/* Group plan controls and keep gestures local to the plan. */
.pt-toolbar { align-items:end; justify-content:space-between; padding:12px; border:1px solid #d8e0e7; border-radius:10px; background:#fafbfd; }
.pt-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pt-controls label { display:flex; align-items:center; gap:8px; }
.pt-zoom-controls { flex-wrap:nowrap; }
.pt-zoom { min-width:48px; text-align:center; }
.pt-gesture-hint { font-size:12px; color:#58697a; }
.pt-viewport { touch-action:none; }
.pt-viewport.is-panning,.pt-viewport.is-panning svg { cursor:grabbing; user-select:none; }
.rr-kit-contents { padding:10px; background:#f1f6fa; border-radius:6px; }
@media(max-width:600px) { .pt-toolbar { justify-content:flex-start; gap:10px; } .pt-controls { flex:1 1 auto; } .pt-gesture-hint { flex-basis:100%; } }

.rr-email-dialog {overflow-wrap:anywhere;width:min(540px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #dce1e5;border-radius:16px;padding:24px;color:#26313b;background:#fff;box-sizing:border-box;font:inherit;}
.rr-email-dialog::backdrop {background:#15202db3;}
.rr-email-dialog header,.rr-email-dialog footer {display:flex;align-items:center;justify-content:space-between;gap:12px;}
.rr-email-dialog h2 {font-size:21px;margin:0;}.rr-email-dialog p{line-height:1.5;}
.rr-email-dialog label {display:grid;gap:6px;margin:14px 0;}.rr-email-dialog input,.rr-email-dialog textarea {box-sizing:border-box;width:100%;font:inherit;padding:10px;border:1px solid #bdc7ce;border-radius:7px;}
.rr-email-dialog button {font:inherit;padding:10px 14px;min-height:42px;border:1px solid #bdc7ce;border-radius:8px;background:#fff;cursor:pointer;}.rr-email-dialog .rr-email-send {background:#e71924;color:#fff;border-color:#e71924;}.rr-email-dialog button:disabled {opacity:.55;cursor:wait;}.rr-email-dialog :focus-visible {outline:3px solid #235f96;outline-offset:2px;}
