/* Scoped working layout; the canvas and library share a fixed available height. */
#editor-leave-dialog { position:fixed; inset:0; margin:auto; width:min(480px,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; padding:30px; border:1px solid rgba(0,229,255,.3); border-radius:16px; background:linear-gradient(180deg,#141c2e,#0d1220); color:#e2e8f0; font-family:'Montserrat',system-ui,sans-serif; text-align:center; box-shadow:0 24px 60px rgba(0,0,0,.55); }
#editor-leave-dialog::backdrop { background:rgba(8,14,26,.78); backdrop-filter:blur(8px); }
#editor-leave-title { color:#fff; font-size:1.15rem; margin:0 0 14px; }
#editor-leave-message { color:#cbd5e1; font-size:.9rem; line-height:1.65; margin:0 0 24px; }
.rm-leave-icon { display:grid; place-items:center; width:52px; height:52px; margin:0 auto 18px; border:1px solid rgba(0,229,255,.5); border-radius:50%; background:rgba(0,229,255,.1); color:#00e5ff; font-size:1.6rem; font-weight:700; }
.rm-leave-actions { display:flex; flex-wrap:wrap; gap:10px; }
.rm-leave-actions button { flex:1 1 170px; }
#editor-leave-download { display:block; margin:18px auto 0; font:inherit; font-size:.75rem; color:#a9d8e1; }
#editor-leave-download[hidden] { display:none; }
#editor-leave-dialog :focus-visible { outline:2px solid #00e5ff; outline-offset:4px; }
/* The cursor outside a top-layer dialog cannot render above its backdrop. */
body.rm-configurator-page.rm-cursor-active #editor-leave-dialog { cursor:default; }
body.rm-configurator-page.rm-cursor-active #editor-leave-dialog button { cursor:pointer; }
body.rm-configurator-page .rm-step-pill { font-family: inherit; background: transparent; line-height: normal; }
body.rm-configurator-page .rm-step-pill.is-active { background: rgba(0,229,255,.06); }
body.rm-configurator-page .rm-step-pill:disabled { opacity: 1; }
body.rm-configurator-page .rm-step-pill:not(:disabled):hover { border-color: var(--rm-accent); color: #fff; background: rgba(0,229,255,.06); }
body.rm-configurator-page .rm-step-pill:focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 3px; }
body.rm-configurator-page.rm-cursor-active .canvas-area,
body.rm-configurator-page.rm-cursor-active #canvas-container,
body.rm-configurator-page.rm-cursor-active #canvas-container * { cursor: none !important; }
body.rm-configurator-page .sidebar { width: auto; min-width: 0; }
body.rm-configurator-page .rm-library-sidebar { display: flex; overflow: hidden; }
.rm-library-controls { flex: none; padding-bottom: 6px; }
.rm-library-controls label { font-size: .875rem; letter-spacing: 0; }
.rm-library-controls input { font: inherit; font-size: .875rem; padding: 8px; margin-bottom: 0; }
.rm-library-toggle { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rm-library-toggle button { background: transparent; border: 0; color: var(--rm-accent); font: inherit; font-size: .75rem; padding: 5px 0; }
.rm-library-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; }
.rm-library-category { border-top: 1px solid var(--rm-line); }
.rm-library-category summary { padding: 12px 2px; color: #eef5fc; font-size: .875rem; font-weight: 650; cursor: pointer; }
.rm-library-category[open] summary { color: var(--rm-accent); }
.rm-library-category .rm-lib-grid { padding: 0 0 12px; }
.rm-library-category .rm-lib-item span { font-size: .8rem; }
.rm-library-category .rm-lib-item small { font-size: .75rem; }
.rm-library-category .rm-lib-item[hidden], .rm-library-category[hidden] { display: none !important; }
#library-no-results { font-size: .875rem; padding: 12px 0; }
body.rm-configurator-page .rm-editor-guide { grid-template-columns: .75fr .85fr .85fr 4.5fr; align-items: stretch; }
body.rm-configurator-page .rm-guide-title { display: none; }
.rm-editor-guide li { padding: 10px; min-width: 0; font-size: .75rem; }
.rm-editor-guide li strong { font-size: .8rem; }
.rm-guide-shortcuts .rm-shortcut-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px 10px; margin: 5px 0; line-height: 1.35; }
.rm-editor-guide kbd { font-size: .7rem; }
.rm-guide-shortcuts small { display: block; font-size: .7rem; line-height: 1.4; color: #aab4c2; }
.rm-guide-title { padding: 12px 10px; }
.rm-flow-step { padding: 12px 0 22px; }
.rm-flow-step h1 { color: #fff; font-size: clamp(1.3rem,2.4vw,2rem); line-height: 1.25; margin: 0 0 14px; }
.rm-flow-step > p { margin: 0 0 18px; color: #aeb9c6; max-width: 100ch; line-height: 1.6; }
.rm-source-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.rm-source-card { min-width:0; }
.rm-source-resume { display:flex; flex-direction:column; gap:12px; width:100%; }
.rm-source-card > .btn { margin-top:auto; width:100%; }
.rm-source-card .btn { letter-spacing:.3px; padding:12px; }
@media(max-width:1000px){.rm-source-options{grid-template-columns:1fr;}}
.rm-source-card { padding: clamp(18px,3vw,36px); text-align: left; border: 1px solid var(--rm-line); border-radius: 14px; background: #10151d; color: #aeb9c6; font: inherit; display: flex; flex-direction: column; gap: 14px; }
.rm-source-card strong { color: #fff; font-size: 1.2rem; }
.rm-source-card span { line-height: 1.6; }
.rm-source-card small { font-size: .875rem; }
.rm-source-card b, .rm-source-icon { color: var(--rm-accent); }
.rm-source-card:hover { border-color: var(--rm-accent); background: #131e28; }
.rm-source-icon { font-size: 2rem; }
@media (min-width:1001px) and (max-height:800px) {
    #step-source { padding-top:4px; padding-bottom:8px; }
    #step-source > h1 { margin-bottom:10px; }
    #step-source > p { margin-bottom:14px; }
    .rm-source-options { gap:14px; margin-bottom:14px; }
    .rm-source-card { padding:22px; gap:10px; }
    .rm-source-card strong { font-size:1.1rem; }
    .rm-source-card span { line-height:1.45; }
    .rm-source-card .rm-source-icon { font-size:1.5rem; }
}
.rm-model-form { border: 1px solid var(--rm-line); border-radius: 14px; background: #10151d; padding: 24px; max-width: 1100px; }
.rm-model-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin: 22px 0; }
.rm-model-form label { font-size: .875rem; }
.rm-model-form input, .rm-model-form select { font: inherit; }
#model-file-help, .rm-review-help { font-size: .875rem; color: #aeb9c6; line-height: 1.5; margin: 10px 0; }
.rm-beta-note { padding: 15px 18px; border-left: 3px solid var(--rm-accent); background: #101e29; color: #c4d5e2 !important; line-height: 1.6; font-size: .9375rem; }
.rm-beta-badge { display: inline-block; vertical-align: middle; font-size: .8rem; padding: 5px 9px; border-radius: 5px; color: var(--rm-accent); background: #142b35; }
.rm-flow-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
#model-upload-status { margin-top: 14px; line-height: 1.5; }
#model-upload-status.is-error { color: #ffa8a8; }
.rm-model-results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin: 24px 0; }
.rm-model-results > div { padding: 24px; border: 1px solid var(--rm-line); border-radius: 12px; background: #10151d; display: flex; flex-direction: column; gap: 12px; }
.rm-model-results strong { font-size: clamp(1.1rem,2vw,1.8rem); color: var(--rm-accent); }
.rm-model-results small { font-size: .875rem; line-height: 1.5; color: #aeb9c6; }
.rm-flow-step :focus-visible, .rm-library-sidebar :focus-visible { outline: 2px solid var(--rm-accent); outline-offset: 3px; }
@media (min-width: 921px) {
    body.rm-configurator-page .rm-library-sidebar { padding: 12px; }
    body.rm-configurator-page .rm-library-sidebar h3 { margin: 0 0 6px; padding-bottom: 6px; }
    body.rm-configurator-page .rm-library-controls input { padding: 8px 10px; }
    body.rm-configurator-page .rm-library-controls label { margin-bottom: 4px; }
    body.rm-configurator-page .rm-props-sidebar { padding: 12px; font-size: .8rem; line-height: 1.45; }
    body.rm-configurator-page .rm-props-sidebar #props-empty { font-size: .8rem; line-height: 1.5; margin: 8px 0; }
    body.rm-configurator-page { height: 100dvh; min-height: 680px; }
    body.rm-configurator-page .step-container { overflow: hidden; }
    body.rm-configurator-page .step-container > :not(.rm-stepper):not(#step-3):not(.hidden) { flex: 1; min-height: 0; overflow-y: auto; }
    body.rm-configurator-page .rm-editor-layout { min-height: 0; flex: 1 1 0; }
    body.rm-configurator-page .canvas-area { min-width: 0; }
    body.rm-configurator-page .rm-library-sidebar { height: 100%; }
}
.rm-draft-resume { display:flex; flex-wrap:wrap; align-items:center; gap:12px; background:#10252b; border:1px solid var(--rm-accent); border-radius:10px; padding:16px; margin:0 0 20px; }
.rm-draft-resume span { flex:1; color:#b9c8d4; }
.rm-draft-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; font-size:.68rem; color:#aab4c2; }
.rm-draft-tools button { border:1px solid var(--rm-line); background:#10151d; border-radius:5px; padding:5px 7px; font:inherit; color:#bce8f0; }
#draft-status[data-saved="false"] { color:#ffb6a8; }
#editor-feedback { flex:none; font-size:.7rem; line-height:1.35; color:#a9d8e1; margin:6px 0 0; min-height:1em; }
body.rm-configurator-page .rm-canvas-toolbar .rm-grid-control { width:70px; flex:0 0 70px; padding:5px; }
#freehand-controls { position:absolute; z-index:15; left:45px; right:8px; top:8px; display:flex; gap:6px; flex-wrap:wrap; align-items:center; background:#102029; border:1px solid #00e5ff; border-radius:7px; padding:8px; font-size:.72rem; }
.canvas-area.is-freehand .rm-canvas-toolbar, .canvas-area.is-freehand .rm-cad-commandbar { visibility:hidden; }
#freehand-controls button { font:inherit; padding:5px; background:#172d39; color:white; border:1px solid #56717e; border-radius:4px; }
.rm-measure-lock { display:flex; align-items:center; gap:10px; color:#d9edf2; font-size:.85rem; }
body.rm-configurator-page .rm-measure-lock input { width:18px; height:18px; margin:0; }
.rm-measure-help { color:#aab4c2; font-size:.75rem; line-height:1.5; margin:10px 0; }
@media(max-width:920px){.rm-draft-tools{justify-content:flex-start;}body.rm-configurator-page .rm-editor-topbar{flex-wrap:wrap;}.rm-draft-tools{order:3;flex-basis:100%;}}
@media (max-width: 1450px) {
    .rm-editor-guide .rm-guide-title { display: none; }
    body.rm-configurator-page .rm-step-pill { letter-spacing: .5px; font-size: .72rem; }
}
@media (max-width: 1100px) {
    body.rm-configurator-page .rm-editor-guide { grid-template-columns: .7fr .8fr .8fr 3fr; }
    .rm-guide-shortcuts .rm-shortcut-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
    body.rm-configurator-page .rm-editor-layout { grid-template-columns: minmax(0,1fr); }
    body.rm-configurator-page .rm-library-sidebar { height: 380px; max-height: 380px; overflow: hidden; }
    body.rm-configurator-page .canvas-area { height: 58svh; min-height: 360px; }
    body.rm-configurator-page .rm-editor-guide { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .rm-guide-shortcuts { grid-column: 1 / -1; border-top: 1px solid var(--rm-line); }
    .rm-model-results { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .rm-source-options, .rm-model-fields { grid-template-columns: 1fr; }
    body.rm-configurator-page .rm-step-pill { flex: 1 1 40%; }
    .rm-model-form { padding: 16px; }
    .rm-guide-shortcuts .rm-shortcut-grid { grid-template-columns: 1fr; }
    .rm-editor-guide li { font-size: .75rem; }
    .rm-source-card { padding: 18px; }
}
