/* --- style.css (ALL STYLES CENTRALIZED) --- */

/* =========================
   Design tokens (dashboard-aligned — change once, site-wide)
   ========================= */
:root {
  --site-bg: #f4f4f4;
  --site-text: #111827;
  --site-muted: #6b7280;
  --site-border: #ddd;
  --site-border-soft: #e5e7eb;
  --site-card-bg: #fff;
  --site-radius: 12px;
  --site-radius-sm: 10px;
  --site-purple: #5514B4;
  --site-purple-soft: rgba(85, 20, 180, 0.12);
  --site-font: Arial, Helvetica, sans-serif;
  --site-weight-bold: 800;
  --site-weight-black: 900;
  /* Buttons: pill + purple (matches Energy dashboard toggles) */
  --site-btn-pill: 999px;
  --site-btn-border: 2px solid var(--site-purple);
}

/* =========================
   Reset & base
   ========================= */
body {
  font-family: var(--site-font);
  margin: 0;
  padding: 0;
  background: var(--site-bg);
  color: var(--site-text);
  line-height: 1.45;
}

main { padding: 20px; }

/* =========================
   Base layout / chrome (from base.html)
   ========================= */
header{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:12px 16px;
  background:#f1f1f1;
  border-bottom:2px solid #ccc;
}
header h1{
  margin:0;
  font-size:clamp(1.2rem,3.5vw,1.7rem);
}

.page-wrap{
  max-width:1200px;
  margin:0 auto;
  padding:16px 14px;
}

/* Flash messages */
.flash-wrap{
  margin:10px 0 14px 0;
  display:grid;
  gap:10px;
}
.flash{
  border-radius:12px;
  padding:12px 14px;
  font-weight:700;
  border:1px solid rgba(0,0,0,0.12);
}
.flash.ok,
.flash.success{ background:#e9fbf0; color:#0f5132; }
.flash.err,
.flash.error{ background:#fdecec; color:#842029; }

/* Nav dropdown section label */
.nav-section-label{
  display:block;
  padding:6px 14px;
  font-size:0.75rem;
  color:#888;
  text-transform:uppercase;
  font-weight:700;
  letter-spacing:0.04em;
}

/* =========================
   NAV (scoped to nav to avoid clashes)
   ========================= */
nav{
  background:var(--site-purple);
  padding:10px 12px;
}

nav .nav-row{
  display:flex;
  align-items:center;
  gap:16px;
  max-width:1200px;
  margin:0 auto;
  flex-wrap:wrap;
}

nav .nav-spacer{ flex:1; }

/* Nav buttons/links (scoped!) */
nav .btn-link,
nav .dropbtn{
  background:transparent;
  border:2px solid rgba(255,255,255,0.65);
  color:#fff;
  font-size:0.95rem;
  font-weight:700;
  padding:8px 16px;
  border-radius:var(--site-btn-pill);
  text-decoration:none;
  cursor:pointer;
  white-space:nowrap;
}

nav .btn-link:hover,
nav .dropbtn:hover{
  background:rgba(255,255,255,0.14);
}

nav .btn-link.active{
  background:rgba(255,255,255,0.22);
}

/* Dropdowns (scoped!) */
nav .dropdown{ position:relative; }

nav .dropdown-content{
  display:none;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:220px;
  background:#fff;
  border-radius:12px;
  box-shadow:0 8px 20px rgba(0,0,0,0.18);
  padding:8px;
  z-index:999;
}

nav .dropdown-content a{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  text-decoration:none;
  color:#222;
  font-weight:700;
  font-size:0.9rem;
}

nav .dropdown-content a:hover{ background:#f2effa; }

nav .dropdown.open .dropdown-content{ display:block; }

nav .dropdown-divider{
  height:1px;
  background:#e5e5e5;
  margin:6px 0;
}

/* Optional: small-screen nav wrap looks nicer */
@media (max-width: 768px){
  nav .nav-row{ gap:10px; }
  nav .btn-link,
  nav .dropbtn{ padding:8px 12px; }
}

/* =========================
   (Legacy) Header Top: Logos and Title
   =========================
   Safe to keep if used on any pages.
*/
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #fff;
  border-bottom: 1px solid #ccc;
}

.header-left,
.header-center,
.header-right { display: flex; align-items: center; }

.header-center {
  flex-grow: 1;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
}

/* Scoped logo */
.header-top .logo { height: 50px; }

.header-left img,
.header-right img { display: block; }

/* Responsive tweaks (header-top only) */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
  .header-left, .header-right { justify-content: center; }
}

/* =========================
   BLOG (Public listing)
   ========================= */
.blog-hero {
  padding: 28px 16px;
  background: linear-gradient(180deg, rgba(85,20,180,0.10), rgba(0,0,0,0));
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.blog-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.blog-hero-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 8px;
}

.blog-hero-title {
  font-size: 34px;
  margin: 0 0 8px 0;
}

.blog-hero-subtitle {
  margin: 0;
  max-width: 70ch;
  opacity: 0.8;
  line-height: 1.45;
}

.blog-wrap {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 28px 16px;
  box-sizing: border-box;
  min-width: 0;
}

.blog-wrap .admin-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.blog-empty {
  padding: 18px;
  border: 1px dashed rgba(0,0,0,0.25);
  border-radius: 14px;
  background: rgba(0,0,0,0.02);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 980px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

/* Tile image area */
.blog-card-media {
  height: 160px;
  position: relative;
  overflow: hidden;
  background: rgba(85,20,180,0.06);
}

/* FIT (no crop): show the whole image inside the tile */
.blog-card-media img.blog-card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center;
  display: block;
  background: rgba(255,255,255,0.65);
}

/* Placeholder */
.blog-card-img--placeholder {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card-placeholder { display: flex; gap: 8px; }

.blog-card-placeholder-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(85,20,180,0.55);
}

.blog-card-body { padding: 14px 14px 16px 14px; }

.blog-card-meta {
  font-size: 12px;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.blog-dot { opacity: 0.5; }

.blog-card-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  line-height: 1.25;
}

.blog-card-excerpt {
  margin: 0 0 12px 0;
  opacity: 0.85;
  line-height: 1.45;
}

.blog-card-cta {
  font-size: 13px;
  color: #5514B4;
  font-weight: 600;
}

/* =========================
   BLOG (Post page)
   ========================= */
.post {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 16px 36px 16px;
}

.post-breadcrumb-wrap{
  max-width: 900px;
  margin: 0 auto 6px auto;
}

.post-breadcrumb {
  font-size: 12px;
  opacity: 0.75;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.post-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.post-backlink{
  text-decoration:none;
}
.post-backlink:hover{
  text-decoration:underline;
}

.post-date{
  opacity:0.85;
}

.post-title {
  font-size: 36px;
  line-height: 1.15;
  margin: 0 0 10px 0;
}

.post-excerpt {
  margin: 0 0 16px 0;
  opacity: 0.85;
  max-width: 75ch;
  line-height: 1.5;
  font-size: 16px;
}

.post-hero {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.10);
  margin: 14px 0 18px 0;
  background: rgba(85,20,180,0.06);
}

/* FIT (no crop): show the whole hero image */
.post-hero img {
  width: 100% !important;
  height: 360px !important;
  object-fit: contain !important;
  object-position: center;
  display: block;
  background: rgba(255,255,255,0.65);
}

/* Content body */
.post-content {
  line-height: 1.65;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.post-content h2 { margin-top: 22px; }
.post-content p  { margin: 12px 0; }

/* Post content images: scale down to container (fit width) */
.post-content img {
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
  display: block;
  margin: 16px auto;
  border-radius: 12px;
}

/* Word/Docs paste safety */
.post-content * {
  box-sizing: border-box;
  max-width: 100%;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
}

.post-content th,
.post-content td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  text-align: left;
  vertical-align: top;
}

.post-content thead th { background: rgba(0,0,0,0.03); }

.post-content pre,
.post-content code {
  white-space: pre-wrap;
  word-break: break-word;
}

.post-footer { margin-top: 24px; }

.post-back {
  text-decoration: none;
  color: #5514B4;
  font-weight: 600;
}

/* =========================
   BLOG (Admin)
   ========================= */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) { .admin-grid { grid-template-columns: 1fr; } }

/* Grid items must shrink or wide toolbars (e.g. Quill) blow past the card */
.admin-grid > .admin-card {
  min-width: 0;
  max-width: 100%;
}

.admin-card {
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  overflow: visible;
  box-sizing: border-box;
}

/* Nested section inside an admin card (user management, smart home, etc.) */
.admin-subcard{
  background:rgba(0,0,0,0.02);
  border:1px solid rgba(0,0,0,0.08);
  border-radius:12px;
  padding:14px 16px;
  margin-top:12px;
}
.admin-subcard:first-of-type{ margin-top:0; }

/* Blog create column: clip any stray overflow; normal flow for button below Quill */
.blog-admin-create-card {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.blog-admin-create-card .admin-form {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.blog-admin-field-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.blog-admin-content-field {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: block;
  margin-top: 0;
}

.blog-admin-submit-wrap {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 2;
}

.blog-wrap .admin-actions {
  margin-top: 16px;
  padding-top: 12px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.admin-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.admin-help {
  margin-top: -6px;
  opacity: 0.8;
  line-height: 1.45;
}

.admin-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
}

.admin-form > .admin-btn {
  margin-top: 8px;
  margin-bottom: 4px;
  justify-self: start;
}

.admin-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  min-width: 0;
  max-width: 100%;
}

.admin-input,
.admin-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.admin-textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  line-height: 1.35;
}

.admin-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
}

/* Primary = solid purple + white | Secondary = white + purple ring (dashboard toggle style) */
.admin-btn {
  border: var(--site-btn-border);
  border-radius: var(--site-btn-pill);
  padding: 10px 18px;
  background: var(--site-purple);
  color: #fff;
  font-weight: var(--site-weight-black);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.admin-btn:hover { filter: brightness(1.06); }

.admin-btn-secondary {
  background: #fff;
  color: var(--site-purple);
  border: var(--site-btn-border);
  border-radius: var(--site-btn-pill);
  padding: 10px 18px;
  font-weight: var(--site-weight-black);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.admin-btn-secondary:hover {
  background: var(--site-purple-soft);
}

/* IMPORTANT: make button styles apply cleanly to links too */
a.admin-btn,
a.admin-btn-secondary{
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.admin-btn:visited{ color:#fff; }
a.admin-btn-secondary:visited{ color:#5514B4; }

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  background: rgba(0,0,0,0.02);
}

.admin-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.admin-row-meta {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-link {
  text-decoration: none;
  color: #5514B4;
  font-weight: 700;
  font-size: 13px;
  align-self: center;
}

.admin-link-danger {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #b00020;
  font-weight: 800;
  font-size: 13px;
}

/* Optional: compact button size variant */
.admin-btn.btn-sm,
.admin-btn-secondary.btn-sm{
  padding: 8px 14px;
  border-radius: var(--site-btn-pill);
  font-size: 0.82rem;
}

/* =========================
   SMART HOME (Floor page UI)
   ========================= */

/* Header */
.sh-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
  padding-bottom:12px;
  border-bottom:1px solid #f3f4f6;
  margin-bottom:14px;
}

.sh-header-left{ min-width:260px; flex:1 1 auto; }

.sh-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.sh-title{
  margin:0;
  font-size:1.35rem;
  font-weight:900;
  color:#111827;
}

.sh-subline{
  margin-top:6px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  font-size:0.95rem;
  color:#6b7280;
}

.sh-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 10px;
  border-radius:999px;
  font-size:0.86rem;
  font-weight:900;
  border:1px solid #e5e7eb;
}

.sh-badge-on{
  background:#ecfdf5;
  border-color:#a7f3d0;
  color:#065f46;
}

.sh-badge-off{
  background:#f9fafb;
  color:#6b7280;
}

.sh-header-right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.sh-live{
  font-size:0.9rem;
  color:#6b7280;
}

.sh-live strong{ font-weight:900; }

.sh-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-size:0.85rem;
  color:#111827;
  font-weight:800;
}

.sh-pill strong{ font-weight:900; }

.sh-pill-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  display:inline-block;
}

/* Nav layout only (buttons themselves use admin-btn/admin-btn-secondary) */
.sh-nav-row{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.sh-floor-nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

/* Main grid */
.sh-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: 1fr 340px;
  gap:14px;
}

@media (max-width: 980px){
  .sh-grid{ grid-template-columns: 1fr; }
}

/* MAP container */
.sh-map{ min-width:0; }

.sh-floorplan{
  position: relative;
  border:1px solid #eee;
  border-radius:12px;
  overflow:hidden;
  background:#fafafa;
}

.sh-floorplan img{
  display:block;
  width:100%;
  height:auto;
}

/* overlay */
.sh-markers{
  position:absolute;
  inset:0;
  pointer-events:none;
}

/* Marker v2 */
.sh-marker{
  position:absolute;
  transform: translate(-50%, -50%);
  pointer-events:auto;
  cursor:pointer;
  user-select:none;
}

.sh-marker--v2{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

.sh-marker-dot{
  width:26px;
  height:26px;
  border-radius:999px;
  background:#fff;
  border:2px solid #9ca3af; /* ring becomes online/offline via JS */
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  position:relative;
  display:grid;
  place-items:center;
  transition: opacity .18s ease, box-shadow .18s ease, transform .18s ease, filter .18s ease, outline .18s ease;
  opacity:0.95;
}

.sh-marker:hover .sh-marker-dot{
  filter:brightness(1.05);
  transform: translateY(-1px);
}

.sh-dot{
  position:absolute;
  inset:3px;
  border-radius:999px;
  background:transparent; /* filled via JS for on/motion */
  box-shadow:none;
  transition: background .18s ease, box-shadow .18s ease, filter .18s ease;
}

.sh-marker-letter{
  position:relative;
  z-index:1;
  font-weight:900;
  font-size:12px;
  color:#111827;
  line-height:1;
}

.sh-marker-label{
  max-width:160px;
  text-align:center;
  font-size:12px;
  font-weight:900;
  color:#111;
  background: rgba(255,255,255,0.92);
  border:1px solid rgba(0,0,0,0.10);
  padding:4px 8px;
  border-radius:999px;
  box-shadow:0 6px 14px rgba(0,0,0,0.08);
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Popover */
.sh-popover{
  position:absolute;
  display:none;
  min-width:240px;
  max-width:340px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,0.16);
  padding:10px;
  z-index:50;
}

.sh-pop-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.sh-pop-head-left{ min-width:0; }

.sh-pop-title{
  font-weight:900;
  color:#111827;
  line-height:1.1;
  word-break:break-word;
}

.sh-pop-sub{
  color:#6b7280;
  font-size:0.88rem;
  margin-top:3px;
  word-break:break-word;
}

.sh-pop-close{
  border:var(--site-btn-border);
  background:#fff;
  border-radius:var(--site-btn-pill);
  padding:6px 12px;
  cursor:pointer;
  font-weight:var(--site-weight-black);
  color:var(--site-purple);
}
.sh-pop-close:hover{ background:var(--site-purple-soft); }

.sh-pop-body{
  margin-top:10px;
  display:grid;
  gap:8px;
}

.sh-pop-pill-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.sh-pop-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-size:0.85rem;
  color:#111827;
}

.sh-pop-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  display:inline-block;
  background:#9ca3af;
}

.sh-pop-toggle-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.sh-pop-hint{
  color:#6b7280;
  font-size:0.9rem;
}

.sh-pop-meta{
  border-top:1px solid #f3f4f6;
  padding-top:8px;
  color:#374151;
  font-size:0.92rem;
  display:grid;
  gap:4px;
}

.sh-pop-debug{
  border-top:1px solid #f3f4f6;
  padding-top:8px;
}

.sh-pop-debug summary{
  cursor:pointer;
  color:#6b7280;
  font-weight:800;
}

.sh-pop-raw{
  margin:8px 0 0 0;
  max-height:180px;
  overflow:auto;
  font-size:12px;
  background:#f9fafb;
  border:1px solid #eef2f7;
  border-radius:10px;
  padding:8px;
  white-space:pre-wrap;
}

/* Legend */
.sh-legend{
  margin-top:8px;
  color:#6b7280;
  font-size:0.9rem;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.sh-legend-items{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.sh-legend-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.sh-legend-swatch{
  width:10px;
  height:10px;
  display:inline-block;
}

.sh-legend-swatch.ring{
  border-radius:50%;
  background:#fff;
  border:2px solid #9ca3af;
}

.sh-legend-swatch.dot{
  border-radius:999px;
}

/* Sidebar */
.sh-sidebar{
  border:1px solid #eee;
  border-radius:12px;
  background:#fff;
  padding:12px;
  height:fit-content;
}

.sh-sidebar-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}

.sh-sidebar-title{ font-weight:900; }

.sh-filter{
  margin-top:10px;
}

.sh-filter input{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:8px 10px;
  outline:none;
}

.sh-list{
  margin-top:10px;
  display:grid;
  gap:8px;
}

.sh-list-muted{
  color:#6b7280;
  font-size:0.92rem;
}

.sh-toast{
  display:none;
  margin-top:12px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  border-radius:12px;
  padding:10px;
  color:#374151;
  font-size:0.92rem;
}

.sh-tip{
  margin-top:12px;
  border-top:1px solid #f3f4f6;
  padding-top:10px;
  color:#6b7280;
  font-size:0.9rem;
}

/* List room groups + rows (used by JS rendering) */
.sh-room{
  border:1px solid #eef2f7;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}

.sh-room summary{
  list-style:none;
  cursor:pointer;
  padding:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.sh-room-title{
  font-weight:900;
  color:#111827;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sh-room-count{
  font-size:0.8rem;
  font-weight:900;
  color:#6b7280;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  border-radius:999px;
  padding:2px 8px;
}

.sh-room-body{
  padding:10px;
  display:grid;
  gap:8px;
  border-top:1px solid #f3f4f6;
}

.sh-row{
  border:1px solid #eef2f7;
  border-radius:12px;
  padding:10px;
  display:flex;
  gap:10px;
  align-items:center;
  cursor:pointer;
}

.sh-row-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
  flex:0 0 auto;
}

.sh-row-name{
  min-width:0;
  flex:1 1 auto;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sh-row-pill{
  font-size:0.75rem;
  font-weight:900;
  border:1px solid #e5e7eb;
  background:#fff;
  padding:2px 8px;
  border-radius:999px;
  color:#374151;
  flex:0 0 auto;
}

.sh-placeholder{
  padding: 28px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* =========================
   SITE — Energy dashboard + settings (shared layout)
   Same look as Energy Generation page: cards, purple buttons, grids
   ========================= */
.site-wrap{
  max-width:1100px;
  margin:0 auto;
}

.site-top-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
  margin:6px auto 16px;
}
@media (max-width:980px){ .site-top-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .site-top-grid{ grid-template-columns:1fr; } }

/* Energy card (dashboard tiles) — distinct from .admin-card */
.site-card{
  background:var(--site-card-bg);
  border:1px solid var(--site-border);
  border-radius:var(--site-radius);
  padding:12px 14px;
}
.site-card h3{
  margin:0 0 10px 0;
  font-size:0.95rem;
  font-weight:var(--site-weight-black);
}

.site-kv{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:4px 0;
  font-weight:var(--site-weight-bold);
}
.site-kv .k{ opacity:0.75; font-weight:var(--site-weight-black); }
.site-kv .v{ font-weight:var(--site-weight-black); }

.site-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius:999px;
  font-weight:var(--site-weight-black);
  letter-spacing:0.06em;
  border:2px solid var(--site-border);
  background:#f7f7f7;
  color:#333;
  min-width:140px;
}
.site-badge.solar{ background:#fef3c7; border-color:#f59e0b; color:#7c2d12; }
.site-badge.wind{ background:#dbeafe; border-color:#2563eb; color:#1e3a8a; }

.site-source-center{
  height:calc(100% - 28px);
  min-height:110px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.site-demo-pill{
  display:none;
  width:100%;
  text-align:center;
  background:#dc2626;
  color:#fff;
  font-weight:var(--site-weight-black);
  border-radius:var(--site-radius-sm);
  padding:8px 10px;
  letter-spacing:0.06em;
}

.site-grid-2x3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.site-grid-2x2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.site-grid-row4{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.site-grid-row4-compact{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.site-grid-row5{ display:grid; grid-template-columns:repeat(5,1fr); gap:8px; width:100%; }

/* Primary toggle buttons (dashboard time ranges, etc.) */
.site-btn{
  border:var(--site-btn-border);
  background:#fff;
  color:var(--site-purple);
  border-radius:var(--site-btn-pill);
  padding:8px 14px;
  font-weight:var(--site-weight-black);
  cursor:pointer;
  font-size:0.85rem;
  width:100%;
  font-family:inherit;
}
.site-btn:hover{ filter:brightness(0.97); }
.site-btn.active{ background:var(--site-purple); color:#fff; }
.site-btn:disabled{ opacity:0.55; cursor:not-allowed; }

.site-btn-sm{
  border:var(--site-btn-border);
  background:#fff;
  color:var(--site-purple);
  border-radius:var(--site-btn-pill);
  padding:6px 12px;
  font-weight:var(--site-weight-black);
  cursor:pointer;
  font-size:0.78rem;
  width:100%;
  font-family:inherit;
}
.site-btn-sm.active{ background:var(--site-purple); color:#fff; }

.site-btn-primary{
  border:var(--site-btn-border);
  background:var(--site-purple);
  color:#fff;
  border-radius:var(--site-btn-pill);
  padding:10px 20px;
  font-weight:var(--site-weight-black);
  cursor:pointer;
  font-family:inherit;
}
.site-btn-primary:hover{ filter:brightness(1.06); }

.site-statusline{
  margin-top:8px;
  font-size:0.82rem;
  font-weight:var(--site-weight-black);
  min-height:18px;
}
.site-mini-title{
  margin:10px 0 6px;
  font-weight:var(--site-weight-black);
  font-size:0.82rem;
  opacity:0.85;
  display:flex;
  gap:8px;
  align-items:center;
}

.site-charts{
  display:grid;
  grid-template-columns:1fr;
  gap:22px;
  margin-bottom:24px;
  min-width:0;
}
.site-chart-box{
  background:var(--site-card-bg);
  border:1px solid var(--site-border);
  border-radius:var(--site-radius);
  padding:12px;
  min-width:0;
  max-width:1100px;
  width:100%;
  margin:0 auto;
  box-sizing:border-box;
}
.site-chart-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:8px;
  font-weight:var(--site-weight-black);
}
.site-chart-sub{ font-size:0.85rem; opacity:0.75; font-weight:var(--site-weight-black); }

.lw-mount{
  display:block;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  height:400px !important;
  min-height:400px !important;
  max-height:400px !important;
  border-radius:var(--site-radius-sm);
  overflow:hidden;
  background:#fff;
  border:1px solid var(--site-border-soft);
  box-sizing:border-box;
  contain:strict;
}
.site-chart-box.lw-card{ padding:10px 12px 12px; }
.lw-legend{
  display:flex; flex-wrap:wrap; gap:16px; align-items:center;
  margin-bottom:10px; font-weight:var(--site-weight-bold); font-size:0.82rem;
}
.lw-legend span{ display:inline-flex; align-items:center; gap:8px; color:#444; }
.lw-legend i{
  width:22px; height:4px; border-radius:2px; display:inline-block;
}
.lw-legend .leg-solar i{ background:linear-gradient(90deg,#ea580c,#fb923c); }
.lw-legend .leg-wind i{ background:linear-gradient(90deg,#0284c7,#38bdf8); }
#crosshairReadout{
  font-size:0.8rem; font-weight:var(--site-weight-bold); color:#374151;
  min-height:1.4em; margin-bottom:6px;
  padding:6px 10px; background:#f8fafc; border-radius:8px; border:1px solid var(--site-border-soft);
}

/* Energy settings page */
.site-settings-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:10px;
}
@media (max-width:980px){ .site-settings-grid{ grid-template-columns:1fr; } }
.site-settings-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px dashed #eee;
  flex-wrap:wrap;
}
.site-settings-row:last-child{ border-bottom:0; }
.site-settings-k{ font-weight:var(--site-weight-black); opacity:0.85; }
.site-hint{ font-size:0.82rem; font-weight:var(--site-weight-black); opacity:0.7; margin-top:6px; }
.site-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  border:2px solid var(--site-border);
  background:#f7f7f7;
  font-weight:var(--site-weight-black);
  font-size:0.8rem;
  gap:8px;
}
.site-pill.ok{ border-color:#16a34a; background:#dcfce7; color:#14532d; }
.site-pill.warn{ border-color:#f59e0b; background:#fef3c7; color:#7c2d12; }
.site-pill.bad{ border-color:#dc2626; background:#fee2e2; color:#7f1d1d; }
.site-mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:0.78rem;
  white-space:pre-wrap;
  word-break:break-word;
  margin-top:10px;
  background:#fafafa;
  border:1px solid #eee;
  border-radius:var(--site-radius-sm);
  padding:10px;
}
.site-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }

/* Home + login */
.site-hero{
  max-width:900px;
  margin:0 auto;
  text-align:center;
  padding:8px 12px 24px;
}
.site-hero h2{ margin-top:20px; font-weight:var(--site-weight-black); }
.site-hero p{ margin-top:16px; color:#374151; }

/* Home page — same shell as admin cards */
.site-home-card{
  max-width:920px;
  margin-left:auto;
  margin-right:auto;
}
.site-home-title{
  margin-top:0;
  margin-bottom:12px;
}
.site-home-lead,
.site-home-p,
.site-home-footer{
  margin:0 0 14px 0;
  line-height:1.55;
  color:var(--site-text);
  max-width:75ch;
}
.site-home-footer{
  margin-top:20px;
  margin-bottom:0;
  padding-top:14px;
  border-top:1px solid rgba(0,0,0,0.08);
  font-weight:var(--site-weight-bold);
  color:var(--site-muted);
  max-width:none;
}

.site-login{
  max-width:420px;
  margin:30px auto;
  padding:20px;
  background:var(--site-card-bg);
  border:1px solid var(--site-border);
  border-radius:var(--site-radius);
  box-shadow:0 4px 14px rgba(0,0,0,0.06);
}
.site-login h2{ text-align:center; margin:0 0 16px; font-weight:var(--site-weight-black); }
.site-login .field{ margin-bottom:14px; }
.site-login label{ display:block; font-weight:var(--site-weight-bold); font-size:0.9rem; margin-bottom:6px; }
.site-login input[type="text"],
.site-login input[type="password"]{
  width:100%;
  box-sizing:border-box;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,0.18);
  border-radius:var(--site-radius-sm);
  font-size:14px;
}

/* Generic .btn on admin pages → match dashboard purple */
/* Generic .btn (admin pages): outline pill; add .active for solid */
.btn{
  border:var(--site-btn-border);
  background:#fff;
  color:var(--site-purple);
  border-radius:var(--site-btn-pill);
  padding:8px 16px;
  font-weight:var(--site-weight-black);
  cursor:pointer;
  font-size:0.9rem;
  font-family:inherit;
  text-decoration:none;
  display:inline-block;
  text-align:center;
  box-sizing:border-box;
}
.btn:hover{ background:var(--site-purple-soft); }
.btn.active{ background:var(--site-purple); color:#fff; }
a.btn:visited{ color:var(--site-purple); }
.btn.active:visited, a.btn.active:visited{ color:#fff; }

/* Aliases — dashboard & energy_settings templates use these class names */
.wrap, .site-wrap{ max-width:1100px; margin:0 auto; }
.top-grid, .site-top-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:6px auto 16px;
}
@media (max-width:980px){ .top-grid, .site-top-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .top-grid, .site-top-grid{ grid-template-columns:1fr; } }

/*
 * Energy dashboard: one centred column — same width as chart, full bleed of that column.
 * Cards use 3 equal columns so they align left/center/right across the graph width.
 */
.wrap.energy-dashboard-page{
  width:100%;
  max-width:1100px;
  margin-left:auto;
  margin-right:auto;
  display:block;
  box-sizing:border-box;
}
.energy-dashboard-stack{
  width:100%;
  max-width:none;
  margin:0;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:stretch;
}
/* Three equal columns — spans full chart width (not bunched left). */
.energy-top-grid.energy-top-grid-equal,
.energy-top-grid-equal{
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  gap:14px;
  margin:6px 0 16px;
  width:100%;
  align-items:stretch;
  justify-content:stretch;
  box-sizing:border-box;
}
.energy-top-grid-equal > .card{
  min-width:0;
  width:100%;
  box-sizing:border-box;
}
@media (max-width:980px){
  .energy-top-grid-equal{ grid-template-columns:1fr 1fr !important; }
  .energy-top-grid-equal .card-source{ grid-column:1 / -1; }
}
@media (max-width:560px){
  .energy-top-grid-equal{ grid-template-columns:1fr !important; }
  .energy-top-grid-equal .card-source{ grid-column:auto; }
}
.energy-charts{
  width:100%;
  max-width:none;
}
.energy-charts .chart-box:not(.blog-card){
  max-width:none !important;
  width:100% !important;
  margin:0 !important;
  box-sizing:border-box;
}
.card:not(.blog-card):not(.admin-card){
  background:var(--site-card-bg); border:1px solid var(--site-border);
  border-radius:var(--site-radius); padding:12px 14px;
}
.card:not(.blog-card):not(.admin-card) h3{
  margin:0 0 10px 0; font-size:0.95rem; font-weight:var(--site-weight-black);
}
.kv, .site-kv{
  display:flex; justify-content:space-between; gap:12px; padding:4px 0; font-weight:var(--site-weight-bold);
}
.kv .k, .site-kv .k{ opacity:0.75; font-weight:var(--site-weight-black); }
.kv .v, .site-kv .v{ font-weight:var(--site-weight-black); }
.wrap .badge, .site-badge{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 16px; border-radius:999px; font-weight:var(--site-weight-black);
  letter-spacing:0.06em; border:2px solid var(--site-border); background:#f7f7f7; color:#333; min-width:140px;
}
.wrap .badge.solar, .site-badge.solar{ background:#fef3c7; border-color:#f59e0b; color:#7c2d12; }
.wrap .badge.wind, .site-badge.wind{ background:#dbeafe; border-color:#2563eb; color:#1e3a8a; }
.source-center, .site-source-center{
  min-height:88px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:10px;
}
.card-source .source-center{ min-height:72px; }
.card-source .source-center-with-demo{ align-items:stretch; width:100%; }
/* Energy dashboard: red bar under badge, same card. Inline styles + JS duplicate this so bar always shows. */
.energy-demo-bar{
  width:100%; box-sizing:border-box; margin-top:10px; padding:10px 14px;
  background:#b91c1c !important; color:#fff !important;
  text-align:center !important; font-weight:800 !important; font-size:0.8rem;
  letter-spacing:0.12em !important; border-radius:4px; line-height:1.25; display:block;
}
.wrap .card.card-source .energy-demo-bar.u-hidden{ display:none !important; }
.demo-pill, .site-demo-pill{
  width:100%; text-align:center; background:#dc2626; color:#fff;
  font-weight:var(--site-weight-black); border-radius:var(--site-radius-sm); padding:8px 10px;
}
.chart-toolbar{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px;
  margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid var(--site-border-soft);
}
.chart-toolbar-hint{ margin:0; flex:1 1 200px; }
.chart-reset-btn{ margin-top:0; max-width:280px; flex:0 0 auto; }
.chart-load-hint{ margin:0; flex:1 1 100%; min-height:1.2em; }
.grid-2x3, .site-grid-2x3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.grid-2x2, .site-grid-2x2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.grid-row4-compact, .site-grid-row4-compact{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.grid-row4, .site-grid-row4{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:10px; }
.grid-row5, .site-grid-row5{ display:grid; grid-template-columns:repeat(5,1fr); gap:8px; width:100%; }
.wrap .btn, .site-btn{
  border:var(--site-btn-border); background:#fff; color:var(--site-purple);
  border-radius:var(--site-btn-pill); padding:8px 12px; font-weight:var(--site-weight-black);
  cursor:pointer; font-size:0.85rem; width:100%; font-family:inherit;
}
.wrap .btn.active, .site-btn.active{ background:var(--site-purple); color:#fff; border-color:var(--site-purple); }
.wrap .btn:disabled, .site-btn:disabled{ opacity:0.55; cursor:not-allowed; }
.btn-small, .site-btn-sm{
  border:var(--site-btn-border); background:#fff; color:var(--site-purple);
  border-radius:var(--site-btn-pill); padding:6px 10px; font-weight:var(--site-weight-black);
  cursor:pointer; font-size:0.78rem; width:100%; font-family:inherit;
}
.btn-small.active, .site-btn-sm.active{ background:var(--site-purple); color:#fff; border-color:var(--site-purple); }
.statusline, .site-statusline{ margin-top:8px; font-size:0.82rem; font-weight:var(--site-weight-black); min-height:18px; }
.mini-title, .site-mini-title{
  margin:10px 0 6px; font-weight:var(--site-weight-black); font-size:0.82rem; opacity:0.85;
  display:flex; gap:8px; align-items:center;
}
.charts, .site-charts{ display:grid; grid-template-columns:1fr; gap:22px; margin-bottom:24px; min-width:0; }
.chart-box:not(.blog-card), .site-chart-box{
  background:var(--site-card-bg); border:1px solid var(--site-border); border-radius:var(--site-radius);
  padding:12px; min-width:0; max-width:1100px; width:100%; margin:0 auto; box-sizing:border-box;
}
.chart-title, .site-chart-title{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin-bottom:8px; font-weight:var(--site-weight-black);
}
.chart-sub, .site-chart-sub{ font-size:0.85rem; opacity:0.75; font-weight:var(--site-weight-black); }

/* Energy settings */
.energy-settings .grid, .site-settings-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:10px; }
@media (max-width:980px){ .energy-settings .grid, .site-settings-grid{ grid-template-columns:1fr; } }
.energy-settings .row, .site-settings-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0;
  border-bottom:1px dashed #eee; flex-wrap:wrap;
}
.energy-settings .row:last-child, .site-settings-row:last-child{ border-bottom:0; }
.energy-settings .k{ font-weight:var(--site-weight-black); opacity:0.85; }
.energy-settings .hint, .site-hint{ font-size:0.82rem; font-weight:var(--site-weight-black); opacity:0.7; margin-top:6px; }
.energy-settings .pill, .site-pill{
  display:inline-flex; align-items:center; justify-content:center; padding:6px 10px;
  border-radius:999px; border:2px solid var(--site-border); background:#f7f7f7;
  font-weight:var(--site-weight-black); font-size:0.8rem; gap:8px;
}
.energy-settings .pill.ok, .site-pill.ok{ border-color:#16a34a; background:#dcfce7; color:#14532d; }
.energy-settings .pill.warn, .site-pill.warn{ border-color:#f59e0b; background:#fef3c7; color:#7c2d12; }
.energy-settings .pill.bad, .site-pill.bad{ border-color:#dc2626; background:#fee2e2; color:#7f1d1d; }
.energy-settings .mono, .site-mono{ /* same as .site-mono above */ font-family:ui-monospace,monospace; font-size:0.78rem;
  white-space:pre-wrap; word-break:break-word; margin-top:10px; background:#fafafa; border:1px solid #eee;
  border-radius:var(--site-radius-sm); padding:10px; }
.energy-settings .actions, .site-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; align-items:center; }
.energy-settings .btn-apply, .site-btn-primary{
  border:var(--site-btn-border); background:var(--site-purple); color:#fff;
  border-radius:var(--site-btn-pill); padding:10px 20px; font-weight:var(--site-weight-black); cursor:pointer; font-family:inherit;
}
.energy-settings .btn-apply:hover, .site-btn-primary:hover{ filter:brightness(1.06); }
.energy-settings .btn{
  border-radius:var(--site-btn-pill);
  border:var(--site-btn-border);
  background:#fff;
  color:var(--site-purple);
}
.energy-settings .btn.active{
  background:var(--site-purple);
  color:#fff;
}
.energy-settings input[type="number"]{
  border:2px solid var(--site-border); border-radius:var(--site-radius-sm);
  padding:8px 10px; font-weight:var(--site-weight-black); width:200px; max-width:60vw; background:#fff;
}
.energy-settings .status{ min-height:20px; font-weight:var(--site-weight-black); font-size:0.85rem; }
.energy-settings .section-title{
  margin:8px 0 6px; font-weight:var(--site-weight-black); font-size:0.82rem; opacity:0.85;
}

/* =========================
   Floor editor (drag markers)
   ========================= */
.sh-editor-wrap{ max-width:1200px; margin:0 auto; }
.sh-editor-grid{
  display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:12px; align-items:start;
}
.sh-right{ width:380px; max-width:380px; }
.sh-left{ min-width:0; }
@media (max-width:1100px){
  .sh-editor-grid{ grid-template-columns:1fr; }
  .sh-right{ width:auto; max-width:none; }
}
.sh-editor-top{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:10px;
}
.sh-top-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.sh-subtle{ color:#666; font-size:13px; }
.sh-status{ color:#444; min-width:140px; text-align:right; }
.sh-addbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 10px 0; }
.sh-canvas-wrap{ border:1px solid var(--site-border); border-radius:14px; overflow:hidden; background:#fff; }
.sh-canvas{ position:relative; height:70vh; min-height:520px; overflow:auto; background:#fff; }
.sh-viewport{ position:relative; transform-origin:top left; min-width:980px; min-height:620px; }
.sh-floorimg{ display:none; width:100%; height:auto; user-select:none; pointer-events:none; }
.sh-markers-layer{ position:absolute; inset:0; }
.sh-viewport.sh-grid{
  background:linear-gradient(0deg,rgba(0,0,0,0.03),rgba(0,0,0,0.03)),
    repeating-linear-gradient(0deg,#fff,#fff 24px,#fafafa 24px,#fafafa 25px),
    repeating-linear-gradient(90deg,#fff,#fff 24px,#fafafa 24px,#fafafa 25px);
}
.sh-click-overlay{
  position:absolute; inset:0; display:none; cursor:crosshair;
  background:rgba(85,20,180,0.02);
}
.sh-click-overlay.on{ display:block; }
.sh-hud{
  position:absolute; right:12px; bottom:12px; border:1px solid var(--site-border);
  background:rgba(255,255,255,0.95); border-radius:12px; padding:8px 10px; font-size:13px;
  color:#333; min-width:220px; text-align:right; box-shadow:0 6px 18px rgba(0,0,0,0.08); pointer-events:none;
}
.sh-last{ margin-top:12px; border:1px solid var(--site-border); border-radius:14px; padding:12px 14px; background:#fff; }
.sh-panel{ border:1px solid var(--site-border); border-radius:14px; background:#fff; overflow:hidden; width:100%; }
.sh-acc-head{
  width:100%; display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
  padding:12px 14px; border:0; border-bottom:1px solid #eee; cursor:pointer; text-align:left; background:transparent;
}
.sh-acc-head:hover{ background:#fafafa; }
.sh-acc-left{ min-width:0; }
.sh-acc-right{ display:flex; align-items:center; gap:10px; white-space:nowrap; flex:0 0 auto; }
.sh-editor-wrap .sh-badge{
  border:1px solid var(--site-border); border-radius:999px; padding:6px 10px; font-size:12px;
  background:#fff; color:#333; white-space:nowrap; width:160px; max-width:160px;
  overflow:hidden; text-overflow:ellipsis; text-align:center;
}
.sh-acc-caret{ font-size:14px; line-height:1; opacity:0.7; transition:transform 120ms ease; }
.sh-acc-head[aria-expanded="false"] .sh-acc-caret{ transform:rotate(-90deg); }
.sh-panel-body,.sh-acc-body{ padding:12px 14px; }
.sh-label{ display:flex; flex-direction:column; gap:6px; font-size:13px; color:#444; margin-bottom:10px; }
.sh-form-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width:1100px){ .sh-form-row{ grid-template-columns:1fr; } }
.sh-input{
  padding:9px 10px; border:1px solid var(--site-border); border-radius:12px; background:#fff; font-size:14px;
}
.sh-input[readonly]{ background:#fafafa; color:#666; }
.sh-textarea{
  padding:9px 10px; border:1px solid var(--site-border); border-radius:12px; background:#fff; font-size:13px;
  font-family:ui-monospace,Menlo,monospace;
}
.sh-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.sh-list{ max-height:42vh; overflow:auto; }
.sh-room-head{
  padding:10px 12px; border-top:1px solid #eee; background:#fafafa; font-weight:var(--site-weight-black);
  color:#374151; display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.sh-room-count{ border:1px solid #e5e7eb; border-radius:999px; padding:4px 8px; font-size:12px; color:#6b7280; background:#fff; }
.sh-list-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px;
  border-top:1px solid #eee; cursor:pointer;
}
.sh-list-item:hover{ background:#fafafa; }
.sh-list-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.sh-mini{
  width:30px; height:30px; border-radius:10px; border:2px solid var(--site-purple); background:#fff;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.sh-mini span{ font-size:14px; font-weight:var(--site-weight-black); }
.sh-list-text{ min-width:0; }
.sh-list-name{ font-weight:var(--site-weight-black); color:#333; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sh-list-sub{ color:#666; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sh-editor-wrap .sh-marker{
  position:absolute; transform:translate(-50%,-50%); user-select:none; touch-action:none; cursor:grab;
}
.sh-editor-wrap .sh-marker:active{ cursor:grabbing; }
.sh-editor-wrap .sh-marker .dot{
  width:20px; height:20px; border-radius:999px; border:2px solid var(--site-purple); background:#fff;
  box-shadow:0 4px 10px rgba(0,0,0,0.12); display:flex; align-items:center; justify-content:center;
  color:var(--site-purple); font-size:12px; font-weight:var(--site-weight-black);
}
.sh-editor-wrap .sh-marker .label{
  position:absolute; top:24px; left:50%; transform:translateX(-50%); background:rgba(255,255,255,0.95);
  border:1px solid var(--site-border); border-radius:10px; padding:3px 6px; font-size:12px; white-space:nowrap;
  box-shadow:0 4px 10px rgba(0,0,0,0.08); max-width:180px; overflow:hidden; text-overflow:ellipsis;
}
.sh-editor-wrap .sh-marker.selected .dot{ outline:3px solid rgba(85,20,180,0.25); }
.sh-saving{ opacity:0.7; filter:grayscale(0.15); }
.sh-zoombar{ display:flex; align-items:center; gap:6px; border:1px solid var(--site-border); border-radius:12px; padding:6px; }
.sh-zoomlabel{ min-width:64px; text-align:center; font-weight:var(--site-weight-bold); color:#444; padding:0 6px; font-size:13px; }
.sh-tool{
  display:flex; align-items:center; gap:8px; border:1px solid #eee; border-radius:12px; padding:8px 10px; color:#444; font-size:13px;
}
.sh-tool select{ border:1px solid var(--site-border); border-radius:10px; padding:6px 8px; }
.sh-editor-wrap .sh-mono{ font-family:ui-monospace,monospace; color:#333; }
.sh-warn{
  border:1px solid #f0c36d; background:#fff7e6; color:#6a4b00; border-radius:12px; padding:10px 12px; margin-top:10px;
}
.sh-bindings-box{ border:1px solid #eee; background:#fafafa; border-radius:12px; padding:10px; }
.sh-bindings-list{ margin-top:8px; display:grid; gap:8px; }
.sh-binding-row{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:10px;
  background:#fff; border:1px solid #eee; border-radius:12px;
}
.sh-binding-main{ min-width:0; }
.sh-binding-title{ font-weight:var(--site-weight-black); color:#333; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sh-binding-sub{ font-size:12px; color:#666; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sh-devices-inv{ display:flex; flex-direction:column; gap:8px; max-height:280px; overflow:auto; }
.sh-device-row{
  display:grid; grid-template-columns:1fr 90px; gap:8px; align-items:center;
  padding:8px; border:1px solid #eee; border-radius:8px; font-size:13px;
}
.sh-device-row .sh-device-name{ font-weight:700; grid-column:1/-1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sh-device-row .sh-device-slug{ color:#666; font-size:11px; grid-column:1/-1; margin-top:-4px; }
.sh-device-row .sh-device-actions{ grid-column:1/-1; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sh-lock-btn.is-locked{ background:#111827 !important; border-color:#111827 !important; color:#fff !important; }

/* Smart home floor — sidebar chips + marker v3 + mobile popover */
.sh-side-controls{ margin:10px 0; }
.sh-chip-row{ display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; }
.sh-chip{
  border:1px solid #e5e7eb; background:#fff; color:#374151; border-radius:999px;
  padding:6px 10px; font-size:12px; cursor:pointer;
}
.sh-chip.is-active{ border-color:#c7d2fe; background:#eef2ff; }
.sh-sort-row{ display:flex; gap:8px; align-items:center; margin-top:8px; }
.sh-sort-label{ font-size:12px; color:#6b7280; }
.sh-sort{
  width:100%; border:1px solid #e5e7eb; border-radius:10px; padding:8px 10px; background:#fff; color:#111827; font-size:13px;
}
.sh-mini-stats{ margin-top:8px; font-size:12px; color:#6b7280; display:flex; gap:8px; align-items:center; }
.sh-marker--v3{
  position:absolute; transform:translate(-50%,-50%); width:30px; height:30px; border:0; padding:0; margin:0;
  background:transparent; cursor:pointer; border-radius:999px; -webkit-tap-highlight-color:transparent; touch-action:manipulation;
}
.sh-marker--v3:focus{ outline:none; }
.sh-marker--v3 .sh-marker-ring{
  /* Match icon footprint so border hugs icon edge */
  position:absolute; inset:3px; border-radius:999px; border:3px solid #9ca3af;
  background:transparent; box-shadow:none;
}
.sh-marker--v3 .sh-marker-icon{
  position:absolute; inset:3px; width:calc(100% - 6px); height:calc(100% - 6px); object-fit:contain; z-index:2; pointer-events:none;
}
.sh-marker--v3 .sh-marker-glyph{
  position:absolute; inset:3px; z-index:2; pointer-events:none;
}
@media (max-width:980px){
  .sh-grid{ display:flex; flex-direction:column; gap:12px; }
  .sh-map{ width:100%; }
  .sh-sidebar{ width:100%; }
  .sh-marker--v3{ width:34px; height:34px; }
  .sh-popover{
    position:fixed !important; left:10px !important; right:10px !important; bottom:10px !important; top:auto !important;
    width:auto !important; max-width:none !important; z-index:9999; border-radius:16px;
    box-shadow:0 12px 40px rgba(0,0,0,0.25);
  }
  .sh-pop-raw{ max-height:200px; overflow:auto; }
}

/* Distance dashboard */
.distance-topbar{
  display:grid; grid-template-columns:240px 1fr 280px; gap:12px; max-width:1100px; margin:0 auto 12px; align-items:stretch;
}
@media (max-width:980px){ .distance-topbar{ grid-template-columns:1fr; } }
.distance-left,.distance-middle,.distance-right{
  background:#fff; border:1px solid var(--site-border); border-radius:var(--site-radius-sm); padding:10px 12px;
}
.distance-left{ display:flex; flex-direction:column; justify-content:center; }
.distance-now-label{ font-weight:var(--site-weight-bold); font-size:0.95rem; opacity:0.85; }
.distance-now{ font-weight:var(--site-weight-black); font-size:2rem; line-height:1.1; margin-top:4px; }
.distance-unit{ font-size:1.05rem; font-weight:var(--site-weight-bold); margin-left:6px; opacity:0.85; }
.distance-middle{ display:flex; align-items:center; }
.info-grid{ width:100%; display:grid; grid-template-columns:repeat(2,minmax(180px,1fr)); gap:8px 14px; }
.info-k{ font-weight:var(--site-weight-bold); font-size:0.82rem; opacity:0.75; margin-bottom:2px; }
.info-v{ font-weight:var(--site-weight-bold); font-size:1.02rem; word-break:break-word; }
.distance-right{ display:flex; flex-direction:column; justify-content:flex-start; }
.range-label{ font-weight:var(--site-weight-bold); font-size:0.82rem; opacity:0.75; margin-bottom:6px; }
.range-buttons{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.range-btn{
  width:100%; border:var(--site-btn-border); background:#fff; color:var(--site-purple);
  font-weight:var(--site-weight-black); font-size:0.78rem; padding:6px 8px; border-radius:var(--site-btn-pill);
  cursor:pointer; line-height:1.2; font-family:inherit;
}
.range-btn.active{ background:var(--site-purple); color:#fff; }
.distance-chart-box{ max-width:1100px; margin:0 auto 18px; background:#fff; border:1px solid var(--site-border); border-radius:var(--site-radius); padding:12px 14px; }

/* Architecture pages (distance + solar) */
.arch-wrap{ max-width:980px; margin:0 auto; padding:26px 14px 36px; }
.arch-title{
  text-align:center; font-weight:var(--site-weight-bold); margin:6px auto 18px; line-height:1.25;
  font-size:clamp(16px,2.2vw,20px); max-width:820px; white-space:normal; overflow-wrap:anywhere; word-break:break-word;
  padding:0 8px;
}
.arch-image{ display:flex; justify-content:center; margin:6px 0 18px; }
.arch-image img{
  width:82%; max-width:820px; height:auto; border-radius:var(--site-radius-sm);
  box-shadow:0 2px 10px rgba(0,0,0,0.1); background:#fff;
}
.arch-wrap > .card{
  background:#fff; border-radius:14px; box-shadow:0 2px 10px rgba(0,0,0,0.1); padding:18px 20px; margin:18px 0;
  border:1px solid rgba(0,0,0,0.06);
}
.arch-wrap > .card h3{ margin:0 0 12px; font-size:18px; font-weight:var(--site-weight-bold); }
.arch-wrap > .card p{ margin:0; line-height:1.55; }
.arch-wrap .mono{
  font-family:ui-monospace,monospace; font-size:0.95em;
}
.arch-wrap > .card ol{ margin:10px 0 0 22px; padding:0; line-height:1.7; }
.arch-wrap .kv{ margin-top:8px; line-height:1.6; }
.arch-wrap .kv .row{ display:block; margin:4px 0; }
.arch-wrap .kv strong{ display:inline-block; min-width:110px; }
.arch-wrap .fields{ margin:10px 0 0 18px; line-height:1.7; }
.arch-spaced-p{ margin-top:12px; }

/* Blog post page — white card shell (index uses individual blog-cards again) */
.arch-wrap > .card.blog-post-card{
  margin-top:0;
  margin-bottom:0;
}
.post-breadcrumb--in-card{
  max-width:none;
  margin:0 0 16px 0;
  padding-bottom:14px;
  border-bottom:1px solid rgba(0,0,0,0.08);
}
.post--in-card{
  max-width:none;
  margin:0;
  padding:0;
}
.post--in-card .post-title{
  font-size:clamp(1.5rem,4vw,2.25rem);
}

/* Blog admin — Quill + posts table (scoped) */
.blog-wrap .admin-label{ min-width:0; max-width:100%; }
.blog-wrap .editor-wrap{
  margin-top:0;
  min-width:0;
  max-width:100%;
  width:100%;
  box-sizing:border-box;
  display:block;
  position:relative;
  z-index:0;
}
/* Quill snow uses height:100% on .ql-container/.ql-editor — breaks grid flow and can cover the submit button */
.blog-wrap .ql-container.ql-snow,
.blog-wrap #editor.ql-container{
  height:auto !important;
  min-height:260px;
  max-width:100% !important;
  width:100% !important;
  box-sizing:border-box;
}
.blog-wrap .ql-editor{
  height:auto !important;
  min-height:240px;
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto;
  overflow-y:auto;
  max-height:min(560px, 65vh);
}
.blog-wrap #toolbar{
  border:1px solid var(--site-border); border-bottom:0; border-radius:12px 12px 0 0; background:#fff;
  padding:8px 6px;
  max-width:100%;
  width:100%;
  box-sizing:border-box;
  flex-wrap:wrap;
  row-gap:6px;
}
.blog-wrap #toolbar .ql-formats{ margin-right:4px; }
.blog-wrap #editor{
  border:1px solid var(--site-border); border-radius:0 0 12px 12px; background:#fff;
  min-height:260px;
  max-width:100%;
  width:100%;
  box-sizing:border-box;
}
.blog-wrap .ql-toolbar.ql-snow{
  flex-wrap:wrap;
  padding:8px;
  max-width:100%;
  width:100%;
  box-sizing:border-box;
}
.blog-wrap .ql-editor{ font-size:1rem; line-height:1.65; }
.blog-wrap .ql-editor.ql-blank::before{ color:#888; font-style:normal; }
.blog-wrap .ql-editor .ql-size-small{ font-size:0.9rem; }
.blog-wrap .ql-editor .ql-size-large{ font-size:1.25rem; }
.blog-wrap .ql-editor .ql-size-huge{ font-size:1.6rem; }
.blog-wrap .ql-editor .ql-align-center{ text-align:center; }
.blog-wrap .ql-editor .ql-align-right{ text-align:right; }
.blog-wrap .ql-editor img{ max-width:100%; height:auto; display:block; margin:10px 0; border-radius:10px; }
.blog-wrap .posts-table{ width:100%; border-collapse:collapse; margin-top:8px; }
.blog-wrap .posts-table th,.blog-wrap .posts-table td{
  text-align:left; border-bottom:1px solid #eee; padding:10px 8px; vertical-align:top;
}
.blog-wrap .posts-table th{ font-size:0.9rem; color:#444; }
.blog-wrap .posts-meta{ color:#666; font-size:0.85rem; }
.blog-wrap .slug{ font-family:ui-monospace,monospace; font-size:0.85rem; color:#555; }
.blog-wrap .posts-actions{ display:flex; gap:12px; flex-wrap:wrap; }
.blog-wrap .posts-actions .btn-link{
  background:none; border:none; padding:0; margin:0; color:var(--site-purple); font-size:0.9rem; font-weight:700;
  text-decoration:none; cursor:pointer;
}
.blog-wrap .posts-actions .btn-link:hover{ text-decoration:underline; }
.blog-wrap .posts-actions .btn-danger{ color:#b00020; }
.blog-wrap .badge,.blog-wrap .post-status-badge{
  display:inline-block; padding:2px 8px; border-radius:999px; border:1px solid var(--site-border);
  font-size:0.8rem; margin-left:6px; color:#333; background:#fafafa;
}
.blog-wrap .badge.pub,.blog-wrap .post-status-badge.pub{ border-color:#b9dfc5; background:#f2fbf5; }
.blog-wrap .badge.draft,.blog-wrap .post-status-badge.draft{ border-color:#e3d3a9; background:#fffaf0; }

/* Tapo plug form */
.tapo-wrap{ max-width:920px; margin:0 auto; padding:0 12px; }
.tapo-card{ background:#fff; border:1px solid var(--site-border); border-radius:var(--site-radius); padding:14px; }
.tapo-actions-top{ display:flex; align-items:center; gap:10px; margin:10px 0 14px; flex-wrap:wrap; }
.tapo-btn{
  border:var(--site-btn-border); padding:8px 16px; border-radius:var(--site-btn-pill);
  text-decoration:none; display:inline-block; background:#fff; color:var(--site-purple); font-weight:var(--site-weight-black);
}
.tapo-btn:hover{ background:var(--site-purple-soft); }
.tapo-form{ display:flex; flex-direction:column; gap:12px; }
.tapo-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; align-items:start; }
@media (max-width:820px){ .tapo-grid-2{ grid-template-columns:1fr; } }
.tapo-field label{ display:inline-block; font-weight:700; margin-bottom:6px; }
.tapo-field input,.tapo-field textarea{
  width:100%; box-sizing:border-box; padding:9px 10px; border:1px solid var(--site-border);
  border-radius:var(--site-radius-sm); outline:none;
}
.tapo-help{ color:#666; font-size:0.92rem; margin-top:6px; }
.tapo-inline{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.tapo-chip{
  display:inline-flex; align-items:center; gap:8px; border:1px solid var(--site-border);
  border-radius:10px; padding:8px 10px; background:#fafafa;
}
.tapo-muted{ color:#666; font-size:0.92rem; }
.tapo-submit-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:6px; }
.tapo-primary{
  padding:10px 20px; font-weight:var(--site-weight-black); border-radius:var(--site-btn-pill);
  border:var(--site-btn-border); background:var(--site-purple); color:#fff; cursor:pointer; font-family:inherit;
}
.tapo-secondary{
  padding:10px 20px; border-radius:var(--site-btn-pill); border:var(--site-btn-border);
  background:#fff; text-decoration:none; display:inline-block; color:var(--site-purple); font-weight:var(--site-weight-black); font-family:inherit;
}
.tapo-secondary:hover{ background:var(--site-purple-soft); }
.tapo-hide{ display:none !important; }
.tapo-input-narrow{ width:130px; padding:8px 10px; border-radius:var(--site-radius-sm); border:1px solid var(--site-border); }
.tapo-input-octet{ width:90px; padding:8px 10px; border-radius:var(--site-radius-sm); border:1px solid var(--site-border); }
.tapo-inline-gap{ margin-bottom:8px; }
.tapo-h2{ margin:0 0 6px 0; font-weight:var(--site-weight-black); }

/* Unclassed form submits → solid purple pill (prefer .admin-btn / .site-btn-primary in markup) */
.page-wrap input[type="submit"]{
  border:var(--site-btn-border);
  background:var(--site-purple);
  color:#fff;
  border-radius:var(--site-btn-pill);
  padding:10px 20px;
  font-weight:var(--site-weight-black);
  cursor:pointer;
  font-family:inherit;
}
.page-wrap input[type="submit"]:hover{ filter:brightness(1.06); }

/* ========== Site utilities — use classes instead of inline style="" ========== */
.u-hidden{ display:none !important; }
.u-m-0{ margin:0; }
.u-mt-6{ margin-top:6px; }
.u-mt-8{ margin-top:8px; }
.u-mt-10{ margin-top:10px; }
.u-mt-12{ margin-top:12px; }
.u-mt-14{ margin-top:14px; }
.u-mt-24{ margin-top:24px; }
.u-mt-28{ margin-top:28px; }
.u-mb-6{ margin-bottom:6px; }
.u-mb-8{ margin-bottom:8px; }
.u-mb-12{ margin-bottom:12px; }
.u-mb-14{ margin-bottom:14px; }
.u-mb-20{ margin-bottom:20px; }
.u-ml-8{ margin-left:8px; }
.u-ml-10{ margin-left:10px; }
.u-my-flash{ margin:15px 0; }
.u-bind-hint{ margin:-2px 0 10px 0; }
.u-fw-700{ font-weight:700; }
.u-fw-800{ font-weight:800; }
.u-fw-900{ font-weight:900; }
.flex-between{ display:flex; justify-content:space-between; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.flex-between-start{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.flex-between-baseline{ display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.flex-row-wrap{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.flex-row-wrap-8{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.flex-end-wrap{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.flex-start-8{ display:flex; gap:8px; align-items:center; margin-top:8px; }
.flex-col-gap20{ display:flex; flex-direction:column; gap:20px; }
.flex-col-label{ display:flex; flex-direction:column; gap:6px; }
.flex-col-label-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; }
.flex-get-8{ display:flex; gap:8px; align-items:center; }
.admin-wrap{ max-width:1100px; margin:0 auto; }
.admin-wrap-900{ max-width:900px; margin:0 auto; }
.admin-card-solid{
  background:var(--site-card-bg);
  border:1px solid var(--site-border);
  border-radius:var(--site-radius);
  padding:14px;
}
.admin-card-info{
  background:#e0f2fe;
  border:1px solid #7dd3fc;
  border-radius:var(--site-radius);
  padding:14px;
  margin-bottom:14px;
}
.admin-card-pad12{ padding:12px; }
.admin-card-pad20{ padding:20px; border-radius:16px; }
.admin-h2{ margin:0 0 6px 0; font-weight:var(--site-weight-black); }
.admin-h1-page{ margin:0 0 8px 0; font-size:1.5rem; font-weight:var(--site-weight-black); }
.admin-h3{ margin:0 0 8px 0; font-weight:var(--site-weight-black); }
.admin-lead-mb{ margin:0 0 12px 0; color:#555; }
.admin-muted-block{ margin-top:14px; color:#666; font-size:13px; }
.text-muted-09{ color:var(--site-muted); font-size:0.9rem; }
.text-muted-sm{ color:#888; font-size:0.85rem; }
.text-cyan{ color:#0369a1; font-size:0.9rem; margin-left:8px; }
.text-slate{ color:#9ca3af; font-size:0.85rem; }
.hr-soft{ border:none; border-top:1px solid #eee; margin:14px 0; }
.subpanel{ border:1px solid #eee; border-radius:12px; padding:12px; margin-bottom:14px; }
.subpanel-only{ border:1px solid #eee; border-radius:12px; padding:12px; }
.subpanel-fa{
  border:1px solid #e5e7eb; border-radius:14px; padding:18px; background:#fafafa;
}
.tip-box{
  background:#f0f9ff; border:1px solid #bae6fd; border-radius:12px;
  padding:12px 14px; margin-bottom:20px; font-size:0.95rem; color:#0c4a6e;
}
.grid-form-220{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; align-items:end; }
.grid-form-260{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.grid-form-280{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px; }
.grid-form-320{ display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:12px; align-items:start; }
.grid-2col{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:14px; }
.grid-1gap{ display:grid; gap:10px; }
.grid-1gap-12{ display:grid; gap:12px; }
.grid-field{ display:grid; grid-template-columns:1fr; gap:6px; }
.grid-span2{ grid-column:span 2; }
.input-admin, .select-admin-full{
  width:100%; box-sizing:border-box;
  padding:8px 10px; border:1px solid #ccc; border-radius:10px; font-family:inherit;
}
.select-admin{ padding:8px 10px; border:1px solid #ccc; border-radius:10px; font-family:inherit; }
.input-admin-wide{ min-width:240px; padding:8px 10px; border:1px solid #ccc; border-radius:10px; box-sizing:border-box; }
.label-admin{ font-size:0.9rem; color:#666; margin-bottom:6px; }
.profile-card-link{
  display:block; text-decoration:none; color:inherit;
  border:1px solid #eee; border-radius:12px; padding:12px;
}
.profile-card-title{ font-weight:700; margin-bottom:6px; }
.icon-thumb-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(64px,1fr));
  gap:10px;
}
.icon-thumb-cell{
  border:1px solid #f0f0f0; border-radius:10px; padding:8px;
  display:flex; flex-direction:column; gap:6px; align-items:center;
}
.icon-thumb-img{ width:36px; height:36px; object-fit:contain; }
.icon-thumb-caption{ font-size:0.75rem; color:#666; text-align:center; word-break:break-word; line-height:1.1; }
.icon-preview-44{
  width:44px; height:44px; object-fit:contain; border-radius:8px;
  background:#fff; border:1px solid #eee;
}
.workflow-ol{ margin:0; padding-left:18px; color:#444; line-height:1.5; }
.energy-val{ font-weight:900; }
.pill-tight{ padding:4px 8px; font-size:0.75rem; }
.mono-inline{ display:inline; padding:2px 6px; }
.grid-7cols{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.row-no-border{ border-bottom:0; padding-bottom:0; }
.row-no-border-pt{ border-bottom:0; padding-top:8px; }
.btn-outline-light{ background:#fff !important; color:var(--site-purple) !important; }
.dashboard-lead{ margin:0; font-size:0.82rem; font-weight:700; line-height:1.45; opacity:0.9; }
.statusline-mt{ margin-top:8px; }
.mini-title-mt{ margin-top:12px; }
.grid-row4-mt8{ margin-top:8px; }
.chart-sub-tight{ margin:8px 0 0; font-size:0.72rem; }
.btn-follow-live{ margin-top:8px; max-width:240px; }
.th-w55{ width:55%; }
.th-w15{ width:15%; }
.th-w30{ width:30%; }
.blog-h2-posts{ margin:0 0 8px 0; font-weight:var(--site-weight-black); }
.flash-wrap-mb{ margin-bottom:14px; }
.login-btn-full{ width:100%; margin-top:8px; }
.form-mt14-gap12{ margin-top:14px; display:grid; gap:12px; }
.icons-save-btn{ padding:10px 18px; border-radius:10px; font-weight:600; }
.hint-tight{ margin:0 0 10px; font-size:0.8rem; opacity:0.9; }
.sh-editor-lead{ margin:6px 0 0 0; color:#555; }
.sh-dot-green{ background:#16a34a; }
.sh-dot-red{ background:#ef4444; }
.sh-ring-green{ border-color:#16a34a; }
.sh-ring-red{ border-color:#ef4444; }
.sh-dot-amber{ background:#f59e0b; }
.sh-dot-gray{ background:#9ca3af; }
.sh-list-mt{ margin-top:10px; }
.sh-list-error{ color:#b91c1c; font-weight:900; }
.sh-row-spacer{ width:1px; height:1px; display:inline-block; }
.content-narrow-70{ width:70%; max-width:920px; margin:0 auto; }
.admin-table{ width:100%; border-collapse:collapse; }
.admin-table th{
  text-align:left; border-bottom:1px solid #ccc; padding:8px; font-weight:var(--site-weight-black);
}
.admin-table td{ padding:8px; border-bottom:1px solid #eee; vertical-align:middle; }
.flash-item{ padding:10px; border:1px solid var(--site-border); margin-bottom:8px; border-radius:var(--site-radius-sm); }
.form-inline-end{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.form-inline-center{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.input-pad-8{ padding:8px; border:1px solid var(--site-border); border-radius:var(--site-radius-sm); box-sizing:border-box; }
.input-pad-6{ padding:6px; border:1px solid var(--site-border); border-radius:var(--site-radius-sm); box-sizing:border-box; }
.btn-admin-create{
  padding:10px 14px; font-weight:var(--site-weight-black); border-radius:var(--site-btn-pill);
  border:var(--site-btn-border); background:var(--site-purple); color:#fff; cursor:pointer; font-family:inherit;
}
.btn-admin-sm{
  padding:6px 10px; border-radius:var(--site-btn-pill); border:var(--site-btn-border);
  background:#fff; color:var(--site-purple); font-weight:700; cursor:pointer; font-family:inherit;
}
details.advanced-details{ margin-top:28px; color:#6b7280; font-size:0.88rem; }
details.advanced-details summary{ cursor:pointer; font-weight:600; color:#374151; }
.details-p{ margin:10px 0 8px 0; }
.details-p0{ margin:0; }
.tapo-chip-start{ justify-content:flex-start; }
.file-input-sm{ font-size:0.9rem; }
.inline-a{ display:inline; }
.label-blog-hidden{ display:none; }
.label-blog-check-hidden{ margin-top:22px; display:none; }
.wrap-1200{ max-width:1200px; margin:0 auto; }
.card-page{ background:var(--site-card-bg); border:1px solid var(--site-border); border-radius:var(--site-radius); padding:14px; }
.floorplan-stage{ position:relative; border:1px solid #eee; border-radius:10px; overflow:hidden; background:#fafafa; }
.floorplan-stage img{ width:100%; display:block; }
.floorplan-empty{ padding:40px; text-align:center; color:#666; }
.markers-admin-wrap{ max-width:1200px; margin:0 auto; }
.markers-map-box{ margin-top:12px; border:1px solid #ddd; border-radius:14px; overflow:hidden; background:#fff; }
.markers-map{ height:70vh; min-height:520px; }
.markers-panel{ margin-top:12px; padding:12px 14px; border:1px solid #ddd; border-radius:14px; background:#fff; }
.btn-legacy{ padding:10px 12px; border:1px solid #ddd; border-radius:10px; background:#fff; cursor:pointer; font-family:inherit; }
.alerts-wrap{ max-width:900px; margin:0 auto; }
.alerts-card{ background:#fff; padding:16px; border-radius:var(--site-radius); border:1px solid var(--site-border); }
.account-form{ max-width:520px; margin-top:16px; }
.form-row-spaced{ margin:12px 0; }
.input-full-pad{ width:100%; padding:10px; box-sizing:border-box; border:1px solid var(--site-border); border-radius:var(--site-radius-sm); }
.hint-12{ font-size:12px; opacity:0.75; margin-top:6px; }
.tapo-plug-add{ text-decoration:none; display:inline-block; }
.house-title-clip{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0 0 6px 0; }
.houses-grid-2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.camera-stream{ width:100%; max-width:1000px; border-radius:12px; border:1px solid #eee; background:#fafafa; }
.camera-stream.u-hidden{ display:none !important; }
.smart-home-pill{ margin-left:8px; font-weight:900; color:#065f46; }
.blog-card-plain{ text-decoration:none; color:inherit; }
.floor-nav{ margin-top:10px; }
.cursor-default{ cursor:default; }
.btn-danger-solid{ background:#b41414 !important; color:#fff !important; border-color:#b41414 !important; }
.mono-last-drop{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; color:#333; }
.status-muted{ font-size:0.95rem; color:#444; }
.text-soft{ opacity:0.85; }
.excerpt-mt{ margin:10px 0 0 0; }
.floor-file-text{
  width:220px; padding:10px 12px; border:1px solid #ddd; border-radius:10px;
  background:#fff; color:#333; cursor:pointer; box-sizing:border-box;
}
.houses-form-grid{
  display:grid;
  grid-template-columns:minmax(220px,1.5fr) minmax(120px,0.6fr) auto;
  column-gap:14px; row-gap:12px; align-items:end;
}
.input-max-420{ max-width:420px; width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid var(--site-border); border-radius:10px; }
.input-max-110{ max-width:110px; box-sizing:border-box; padding:8px 10px; border:1px solid var(--site-border); border-radius:10px; }
.house-floor-preview{ margin:12px 0 10px 0; border:1px solid #eee; border-radius:12px; overflow:hidden; background:#fafafa; }
.house-floor-preview img{ display:block; width:100%; height:auto; user-select:none; }
.house-floor-empty{
  margin:12px 0 10px 0; border:1px dashed #ccc; border-radius:12px; padding:18px;
  text-align:center; color:#666; background:#fafafa;
}
.nowrap{ white-space:nowrap; }
.minw0{ min-width:0; }
.houses-list-grid{ margin-top:16px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.house-card-title{ margin:0 0 10px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:1.1rem; font-weight:var(--site-weight-black); }
.grid-span-full-muted{ grid-column:1 / -1; color:#666; }
.form-m-0{ margin:0; }
.u-mt-16{ margin-top:16px; }
.camera-status{ margin-top:10px; color:#888; font-size:0.92rem; }
.admin-blurb{ line-height:1.5; max-width:640px; }
.admin-blurb-sm{ max-width:520px; }
.admin-h2-lg{ font-size:1.15rem; margin:0 0 6px 0; font-weight:var(--site-weight-black); }
