/* Room planner (/room-planner/). Scoped under .rp; colors reuse the shared vars. */
/* styles.css has a global `section { width/height: 200px; border; margin }`: undo it here. */
.rp section { width: auto; height: auto; margin: 0; border: 0; }
.rp { --rp-border: #d6e4ef; --rp-muted: #6b7785; --rp-ink: #2c3640; --rp-wall: #3b4650; --rp-sel: var(--color-primary);
      max-width: 1500px; margin: 0 auto; padding: 16px 16px 32px; color: var(--rp-ink); }

.rp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rp-title { font-size: 1.5rem; margin: 0; font-weight: 700; }
.rp-name { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 8px; font-size: 1rem; min-width: 180px; color: var(--rp-ink); }
.rp-name:hover, .rp-name:focus { border-color: var(--rp-border); background: var(--color-white); outline: none; }
.rp-status { font-size: .85rem; color: var(--rp-muted); }
.rp-status[data-kind="ok"] { color: var(--color-success); }
.rp-status[data-kind="error"] { color: var(--color-error); }

.rp-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--color-white); border: 1px solid var(--rp-border);
              border-radius: 10px; padding: 6px; margin-bottom: 10px; }
.rp-group { display: flex; gap: 4px; align-items: center; padding-right: 8px; border-right: 1px solid var(--rp-border); }
.rp-group:last-child, .rp-group-end { border-right: 0; }
.rp-group-end { margin-left: auto; }
.rp-tool, .rp-btn, .rp-cta { box-shadow: none; }
.rp-tool, .rp-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px;
                    background: transparent; color: var(--rp-ink); font-size: .9rem; cursor: pointer; white-space: nowrap; }
.rp-tool:hover, .rp-btn:hover:not(:disabled) { background: var(--color-light-gray); }
.rp-tool.active { background: #e6f1f8; border-color: #b9d6ea; color: var(--color-primary); font-weight: 600; }
.rp-btn:disabled { opacity: .35; cursor: default; }
.rp-btn-primary { background: var(--color-primary); color: var(--color-white); }
.rp-btn-primary:hover:not(:disabled) { background: #005f94; }
.rp-btn-danger { color: var(--color-error); }
.rp-tool i, .rp-btn i { font-size: 1rem; }
.rp-select { height: 34px; border: 1px solid var(--rp-border); border-radius: 7px; padding: 0 8px; background: var(--color-white); font-size: .9rem; max-width: 220px; }

.rp-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; }
.rp-canvas-wrap { position: relative; background: #fbfcfd; border: 1px solid var(--rp-border); border-radius: 10px; overflow: hidden;
                  height: calc(100vh - 230px); min-height: 460px; }
.rp-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.rp-svg[data-tool="room"] { cursor: crosshair; }
.rp-svg[data-tool="door"], .rp-svg[data-tool="window"] { cursor: copy; }
.rp-svg .rp-room { cursor: move; }
.rp-svg[data-tool="room"] .rp-room, .rp-svg[data-tool="door"] .rp-room, .rp-svg[data-tool="window"] .rp-room { cursor: inherit; }

.rp-grid-minor { stroke: #e9eef2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rp-grid-major { stroke: #d5dee6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rp-room { stroke: none; }
.rp-room.is-sel { filter: brightness(.97); }
.rp-wall { fill: none; stroke: var(--rp-wall); pointer-events: none; }
.rp-ops .rp-op { cursor: ew-resize; }
.rp-op-gap { fill: #fbfcfd; }
.rp-door-swing { fill: none; stroke: var(--rp-muted); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; }
.rp-door-leaf { stroke: var(--rp-wall); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rp-window-line { stroke: #2f8fc9; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rp-hit { fill: transparent; }
.rp-op.is-sel .rp-door-leaf, .rp-op.is-sel .rp-window-line { stroke: var(--rp-sel); stroke-width: 3; }
.rp-op.is-sel .rp-op-gap { fill: #dcecf7; }
.rp-op.is-ghost { opacity: .6; pointer-events: none; }
.rp-labels text { text-anchor: middle; pointer-events: none; font-family: inherit; }
.rp-label { font-weight: 700; fill: var(--rp-ink); }
.rp-area { fill: var(--rp-muted); }
.rp-dim { fill: #8a97a3; }
.rp-ghost { fill: rgba(0, 114, 177, .08); stroke: var(--rp-sel); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; pointer-events: none; }
.rp-ghost-dim { text-anchor: middle; fill: var(--rp-sel); font-weight: 600; pointer-events: none; }
.rp-sel-outline { fill: none; stroke: var(--rp-sel); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-handle { fill: var(--color-white); stroke: var(--rp-sel); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rp-h-nw, .rp-h-se { cursor: nwse-resize; } .rp-h-ne, .rp-h-sw { cursor: nesw-resize; }
.rp-h-n, .rp-h-s { cursor: ns-resize; } .rp-h-e, .rp-h-w { cursor: ew-resize; }

.rp-hint { position: absolute; left: 10px; bottom: 10px; right: 70px; font-size: .8rem; color: var(--rp-muted); pointer-events: none; }
.rp-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.rp-zoom button { width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--rp-border); background: var(--color-white); color: var(--rp-ink); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.rp-zoom button:hover { background: var(--color-light-gray); }

.rp-side { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 230px); min-height: 460px; overflow-y: auto; }
.rp .rp-card { flex-shrink: 0; background: var(--color-white); border: 1px solid var(--rp-border); border-radius: 10px; padding: 12px; }
.rp-card h2 { font-size: .95rem; font-weight: 700; margin: 0 0 8px; }
.rp-kv, .rp-table { width: 100%; font-size: .85rem; border-collapse: collapse; }
.rp-kv td { padding: 3px 0; white-space: nowrap; }
.rp-kv td:last-child { text-align: right; white-space: nowrap; }
.rp-table th { font-weight: 600; color: var(--rp-muted); border-bottom: 1px solid var(--rp-border); padding: 3px 4px; text-align: right; }
.rp-table td { padding: 4px; border-bottom: 1px solid #eef3f7; text-align: right; white-space: nowrap; }
.rp-table th:first-child, .rp-table td:first-child { text-align: left; padding-left: 0; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.rp-table tbody tr[data-room] { cursor: pointer; }
.rp-table tbody tr[data-room]:hover { background: #f5f9fc; }
.rp-table tbody tr.is-sel { background: #e6f1f8; }
.rp-empty td { color: var(--rp-muted); text-align: left !important; white-space: normal !important; }
.rp-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.12); vertical-align: -1px; }
.rp-num { width: 70px; padding: 3px 6px; border: 1px solid var(--rp-border); border-radius: 6px; text-align: right; }
.rp-field { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--rp-muted); margin-bottom: 8px; flex: 1; }
.rp-field input, .rp-field select { padding: 5px 8px; border: 1px solid var(--rp-border); border-radius: 6px; font-size: .9rem; color: var(--rp-ink); width: 100%; }
.rp-row { display: flex; gap: 8px; }
.rp-actions { justify-content: flex-end; gap: 4px; }
.rp-actions .rp-btn { border-color: var(--rp-border); }
.rp-cta { width: 100%; margin-top: 10px; height: 38px; border: 0; border-radius: 8px; background: var(--color-success); color: var(--color-white); font-weight: 600; cursor: pointer; }
.rp-cta:hover { filter: brightness(.95); }

.rp-info { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid #a9b6c2;
           color: var(--rp-muted); font-size: 10px; font-style: italic; font-family: Georgia, serif; cursor: help; position: relative; vertical-align: 1px; }
.rp-info:hover::after, .rp-info:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: 20px; transform: translateX(-50%); width: 230px;
           background: var(--rp-ink); color: var(--color-white); font: normal .78rem/1.35 system-ui, sans-serif; padding: 7px 9px; border-radius: 6px; z-index: 20; white-space: normal; }

.rp .rp-seo { margin-top: 18px; font-size: .9rem; color: var(--color-dark-gray); max-width: 820px; }
.rp-seo h2 { font-size: 1.05rem; font-weight: 700; }
.rp-seo ol { padding-left: 18px; margin: 0; }

@media (max-width: 900px) {
    .rp-body { grid-template-columns: 1fr; }
    .rp-canvas-wrap { height: 62vh; min-height: 360px; }
    .rp-side { max-height: none; min-height: 0; overflow: visible; }
    .rp-tool span, .rp-btn span { display: none; }
    .rp-group-end { margin-left: 0; }
    .rp-hint { display: none; }
}
