/* Floorplan workspace: keep the supplied image intact and crop its letterbox in CSS. */
.smart-home-nav .fp-nav-link { padding-left: 2rem; font-size: .9rem; }
.fp-section-tabs { display: flex; gap: .45rem; margin: -.4rem 0 2rem; padding: .35rem; width: fit-content; max-width: 100%; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface2); }
.fp-section-tabs button { display: flex; align-items: center; justify-content: center; gap: .5rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); padding: .8rem 1.1rem; cursor: pointer; }
.fp-section-tabs button.active { color: var(--text); background: var(--sh-panel); box-shadow: 0 2px 8px #0001; }
.fp-section-tabs svg { width: 19px; height: 19px; }
.fp-intro { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.fp-intro h2 { margin: .4rem 0; font-size: clamp(1.5rem, 2.8vw, 2.15rem); font-weight: 600; letter-spacing: -.045em; }
.fp-intro p, .fp-muted { color: var(--muted); font-size: .85rem; line-height: 1.65; }
.fp-intro p { margin: .4rem 0 0; }
.fp-intro > button { flex-shrink: 0; }
.fp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.fp-stats > div { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.15rem; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--sh-panel); }
.fp-stats strong { font-size: 1.7rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.fp-stats span { color: var(--muted); font-size: .76rem; }
.fp-alert { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem; border: 1px solid #f4b44e66; border-radius: 12px; padding: 1rem; background: var(--sh-amber-soft); font-size: .85rem; margin-bottom: 1rem; }
.fp-alert button { border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; }
.fp-loading { padding: 3rem; text-align: center; color: var(--muted); }
.fp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 1.2rem; }
.fp-map-card, .fp-room-panel { min-width: 0; border: 1px solid var(--border-soft); border-radius: 20px; background: var(--sh-panel); overflow: hidden; }
.fp-map-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: .85rem; border-bottom: 1px solid var(--border-soft); }
.fp-layers, .fp-zoom { display: flex; gap: .2rem; }
.fp-layers button, .fp-zoom button, .fp-hvac-modes button, .fp-device-actions button, .fp-editor-secondary button { border: 1px solid transparent; border-radius: 8px; background: var(--surface2); color: var(--muted); padding: .55rem .65rem; font-size: .75rem; cursor: pointer; min-height: 36px; }
.fp-layers button.active, .fp-hvac-modes button.active { border-color: color-mix(in srgb, var(--sh-blue) 40%, transparent); background: var(--sh-blue-soft); color: var(--sh-blue); }
.fp-workspace button:disabled { opacity: .45; cursor: default; }
.fp-workspace button:focus-visible, .fp-workspace select:focus-visible { outline: 2px solid var(--sh-blue); outline-offset: 3px; }
.fp-zoom { margin-left: auto; }
.fp-zoom button { color: var(--text); min-width: 36px; }
.fp-viewport { max-height: 850px; height: min(78vh, 850px); min-height: 400px; overflow: auto; padding: 1.5rem 0; background: #f8f8f6; overscroll-behavior: contain; }
.fp-map { position: relative; aspect-ratio: 1320 / 2125; margin: 0 auto; overflow: hidden; isolation: isolate; background: white; }
.fp-map.is-editing { cursor: crosshair; }
.fp-image { display: block; position: absolute; width: 100%; height: auto; max-width: none; top: -17.46%; left: 0; pointer-events: none; user-select: none; }
.fp-pin { position: absolute; z-index: 1; display: grid; justify-items: center; gap: 2px; transform: translate(-50%, -50%); min-width: 48px; min-height: 44px; max-width: 110px; padding: 5px 8px; border: 1px solid #d2d9d5; border-radius: 12px; background: #fffffff0; color: #243b34; box-shadow: 0 3px 12px #203b3020; cursor: pointer; font-variant-numeric: tabular-nums; transition: box-shadow .15s, background .15s; }
.fp-pin.is-unassigned { border-style: dashed; }
.fp-pin.is-heating { background: #fff0dc; border-color: #e2a14e; color: #9c5610; }
.fp-pin.is-selected { z-index: 2; background: #244d40; color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 2px #244d40, 0 5px 18px #16362940; }
.fp-pin-value { font-size: .9rem; font-weight: 700; line-height: 1.1; }
.fp-pin-name { font-size: .59rem; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-map-footer { display: flex; flex-wrap: wrap; gap: .8rem; padding: .9rem 1rem; color: var(--muted); font-size: .67rem; }
.fp-map-footer span { display: flex; align-items: center; gap: .35rem; }
.fp-map-footer i { width: 7px; height: 7px; border-radius: 50%; background: #4d8d77; }
.fp-map-footer i.heat { background: #e2a14e; }
.fp-edit-hint { margin: 0; padding: .75rem 1rem; background: var(--sh-blue-soft); color: var(--sh-blue); font-size: .77rem; line-height: 1.5; }
.fp-image-error { position: absolute; inset: 20% 10% auto; background: white; color: #333; padding: 1rem; font-size: .85rem; }
.fp-room-panel { padding: 1.35rem; }
.fp-panel-heading h3 { margin: .4rem 0 1.2rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -.035em; overflow-wrap: anywhere; }
.fp-room-picker, .fp-editor label { display: block; font-size: .78rem; color: var(--muted); }
.fp-room-picker select, .fp-editor select, .fp-editor input[type="text"] { display: block; width: 100%; box-sizing: border-box; margin: .4rem 0 1rem; padding: .7rem .75rem; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface2); color: var(--text); font: inherit; }
.fp-temperature-hero { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 1.2rem 0; padding: 1.7rem .7rem; border: 1px solid #669a7c33; border-radius: 16px; background: linear-gradient(145deg, #57977415, #57977405); }
.fp-temperature-hero > span { color: var(--muted); font-size: .74rem; text-align: center; }
.fp-temperature-hero strong { font-size: 3.1rem; font-weight: 400; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.fp-empty { padding: 1rem; background: var(--surface2); border: 1px dashed var(--border-soft); border-radius: 12px; margin-bottom: 1.2rem; }
.fp-empty h4 { margin: 0 0 .5rem; font-size: .9rem; font-weight: 500; }
.fp-empty p { font-size: .78rem; color: var(--muted); line-height: 1.65; margin: 0 0 .8rem; }
.fp-devices-heading { display: flex; justify-content: space-between; align-items: center; margin-top: 1.3rem; }
.fp-devices-heading h4 { margin: 0; font-size: .85rem; font-weight: 500; }
.fp-devices-heading > span { color: var(--muted); font-size: .8rem; }
.fp-device { border-bottom: 1px solid var(--border-soft); padding: 1rem 0; }
.fp-device:last-child { border-bottom: 0; padding-bottom: 0; }
.fp-device.is-unavailable { opacity: .6; }
.fp-device-title { display: flex; align-items: center; gap: .65rem; }
.fp-device-title > span { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--surface2); color: var(--sh-blue); flex-shrink: 0; }
.fp-device-title svg { width: 19px; height: 19px; }
.fp-device-title strong { display: block; font-size: .8rem; font-weight: 500; overflow-wrap: anywhere; }
.fp-device-title small { display: block; color: var(--muted); font-size: .72rem; margin-top: .25rem; }
.fp-track { color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.fp-device-actions, .fp-hvac-modes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.fp-device-slider { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1rem; font-size: .73rem; color: var(--muted); }
.fp-device-slider input { width: 100%; }
.fp-workspace input[type="range"] { accent-color: #649a82; cursor: pointer; }
.fp-editor { padding: 0; border: 0; margin: 1rem 0 0; min-width: 0; }
.fp-editor label { margin-top: 1rem; }
.fp-editor label output { float: right; }
.fp-editor input[type="range"] { width: 100%; margin-top: .7rem; }
.fp-editor .fp-muted { font-size: .73rem; }
.fp-editor-secondary { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.3rem 0; }
.fp-save-actions { display: grid; gap: .5rem; }
.fp-thermostat { padding: 1rem 0; border-bottom: 1px solid var(--border-soft); }
.fp-thermostat h4 { margin: 0; font-weight: 500; }
.fp-target-label { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; }
.fp-stepper { display: flex; gap: .7rem; align-items: center; margin: 1rem 0; }
.fp-stepper button { width: 36px; height: 36px; flex-shrink: 0; background: var(--surface2); border: 1px solid var(--border-soft); border-radius: 10px; color: var(--text); cursor: pointer; }
.fp-stepper input { width: 100%; min-width: 0; }
.fp-room-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .7rem; margin-top: 1.25rem; }
.fp-room-strip button { display: grid; gap: .4rem; min-width: 0; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--sh-panel); padding: 1rem; text-align: left; color: var(--text); cursor: pointer; }
.fp-room-strip button.active { border-color: #649a82; background: #649a8215; }
.fp-room-strip span { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-room-strip strong { font-size: 1.25rem; font-weight: 500; }
.fp-room-strip small { color: var(--muted); font-size: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1050px) {
  .fp-layout { grid-template-columns: minmax(0, 1fr) 285px; }
  .fp-room-panel { padding: 1rem; }
  .fp-layers button { padding: .55rem .4rem; font-size: .68rem; }
}
@media (max-width: 800px) {
  .fp-layout { grid-template-columns: 1fr; }
  .fp-room-panel { padding: 1.25rem; }
  .fp-viewport { height: min(78vh, 780px); }
  .fp-intro { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .fp-stats { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .fp-stats > div { padding: .85rem 1rem; }
  .fp-section-tabs { width: 100%; box-sizing: border-box; }
  .fp-section-tabs button { flex: 1; padding: .7rem .5rem; font-size: .8rem; }
  .fp-section-tabs svg { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fp-pin { transition: none; } }
