:root {
  color-scheme: light;
  --ink: #172a43;
  --ink-soft: #53657c;
  --muted: #78899d;
  --line: rgba(255, 255, 255, .72);
  --glass: rgba(255, 255, 255, .64);
  --glass-strong: rgba(255, 255, 255, .83);
  --surface: rgba(244, 249, 255, .74);
  --shadow: 0 24px 72px rgba(67, 108, 157, .14), 0 3px 12px rgba(44, 82, 125, .06);
  --shadow-hover: 0 28px 78px rgba(50, 94, 146, .21), 0 7px 20px rgba(44, 82, 125, .1);
  --accent: #1976ed;
  --accent-soft: rgba(25, 118, 237, .12);
  --focus: #146bd8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4ff;
  --ink-soft: #b7c6da;
  --muted: #91a2b8;
  --line: rgba(255, 255, 255, .14);
  --glass: rgba(23, 40, 64, .68);
  --glass-strong: rgba(25, 43, 67, .9);
  --surface: rgba(20, 36, 59, .72);
  --shadow: 0 24px 76px rgba(0, 0, 0, .28), 0 3px 14px rgba(0, 0, 0, .16);
  --shadow-hover: 0 30px 88px rgba(0, 0, 0, .38), 0 7px 20px rgba(0, 0, 0, .2);
  --accent: #72afff;
  --accent-soft: rgba(114, 175, 255, .17);
  --focus: #9cc7ff;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #d9eafa; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  --portal-backdrop:
    radial-gradient(ellipse 46% 34% at 10% 8%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.54) 34%, transparent 76%),
    radial-gradient(ellipse 37% 24% at 82% 19%, rgba(255,255,255,.76) 0%, rgba(255,255,255,.28) 42%, transparent 76%),
    radial-gradient(ellipse 46% 32% at 62% 96%, rgba(171,211,255,.64) 0%, transparent 74%),
    linear-gradient(135deg, #e7f4ff 0%, #d5e8fb 43%, #dbeeff 100%);
  background: var(--portal-backdrop);
  background-attachment: fixed;
}
:root[data-theme="dark"] body {
  --portal-backdrop:
    radial-gradient(ellipse 45% 35% at 11% 7%, rgba(67,106,153,.36) 0%, transparent 76%),
    radial-gradient(ellipse 40% 26% at 83% 19%, rgba(71,115,162,.28) 0%, transparent 76%),
    radial-gradient(ellipse 42% 32% at 58% 100%, rgba(36,83,135,.3) 0%, transparent 74%),
    linear-gradient(135deg, #101c2d 0%, #182b43 52%, #1b3551 100%);
}
/* Only the homes registry gives the gradient its own viewport-sized layer. */
:root[data-theme="dark"] body { background-attachment:scroll; }
html.homes-registry { overflow-y:scroll; }
.homes-registry body { background:none; isolation:isolate; }
.homes-registry body::before {
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:var(--portal-backdrop); transform:translateZ(0);
}
.homes-registry #house-results { overflow-anchor:none; }
.homes-registry .house-row, .homes-registry .house-empty {
  -webkit-backdrop-filter:none; backdrop-filter:none;
}
.homes-registry .house-exits {
  position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:1;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.page-shell { width: min(1240px, calc(100% - 56px)); margin: 0 auto; padding: 30px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 46px; }
.brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 16px; background: linear-gradient(145deg, #79c3ff, #3d8df0 68%, #2169dc); box-shadow: 0 9px 22px rgba(43, 119, 222, .28), inset 0 1px 1px rgba(255,255,255,.8); }
.brand-mark img { width: 30px; height: 30px; }
.brand-copy { display: grid; gap: 1px; }
.brand-name { font-size: 18px; font-weight: 730; letter-spacing: -.035em; line-height: 1.1; }
.brand-caption { color: var(--ink-soft); font-size: 11px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .profile-summary { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--ink); background: var(--glass); box-shadow: 0 4px 12px rgba(43, 82, 125, .07), inset 0 1px rgba(255,255,255,.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.icon-button { width: 44px; height: 44px; border-radius: 15px; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.icon-button:hover { transform: translateY(-2px); background: var(--glass-strong); }
.icon-button svg { width: 19px; height: 19px; }
.profile-menu { position: relative; }
.profile-summary { min-height: 48px; gap: 10px; padding: 5px 13px 5px 6px; border-radius: 17px; cursor: pointer; list-style: none; }
.profile-summary::-webkit-details-marker { display: none; }
.profile-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: white; font-size: 15px; font-weight: 700; background: linear-gradient(145deg,#75b8ff,#397ce6); }
.profile-name { max-width: 145px; overflow: hidden; font-size: 13px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 14px; height: 14px; color: var(--muted); }
.profile-popover { position: absolute; z-index: 5; top: calc(100% + 10px); right: 0; width: 212px; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass-strong); box-shadow: var(--shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.profile-popover form { margin: 0; }
.popover-user { padding: 9px 10px 11px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.popover-user strong { display: block; color: var(--ink); font-size: 14px; }
.menu-action { display: flex; width: 100%; align-items: center; gap: 9px; padding: 10px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.menu-action:hover { background: var(--accent-soft); }
.menu-action svg { width: 17px; height: 17px; color: var(--ink-soft); }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(31px, 4vw, 48px); font-weight: 730; letter-spacing: -.055em; line-height: 1.06; }
.hero-subtitle { margin: 11px 0 0; color: var(--ink-soft); font-size: 16px; }
.hero-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin: 12px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hero-stats span { white-space: nowrap; }
.hero-stats strong { color: var(--ink-soft); font-size: 14px; font-weight: 680; }
.hero-stats-separator { color: var(--muted); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.app-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 15px; }
.app-tile { position: relative; display: flex; min-height: 184px; flex-direction: column; align-items: flex-start; padding: 20px 19px 18px; border: 1px solid var(--line); border-radius: 23px; background: var(--glass); box-shadow: 0 14px 36px rgba(59, 97, 140, .09), inset 0 1px rgba(255,255,255,.5); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: transform .22s cubic-bezier(.2,.75,.25,1), box-shadow .22s ease, background .22s ease; }
a.app-tile:hover { transform: translateY(-5px); background: var(--glass-strong); box-shadow: var(--shadow-hover); }
a.app-tile:active { transform: translateY(-1px) scale(.99); }
.app-tile--disabled { opacity: .66; }
.app-icon { display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 17px; border: 1px solid rgba(255,255,255,.68); border-radius: 19px; box-shadow: 0 8px 19px rgba(37, 79, 125, .15), inset 0 1px 1px rgba(255,255,255,.85); }
.app-icon img { width: 31px; height: 31px; filter: drop-shadow(0 1px 1px rgba(20,44,68,.12)); }
.app-icon--blue { background: linear-gradient(145deg,#c2e7ff,#5ba9fa); }
.app-icon--yellow { background: linear-gradient(145deg,#fff0b2,#ffce58); }
.app-icon--teal { background: linear-gradient(145deg,#b6f2e8,#39c8ba); }
.app-icon--orange { background: linear-gradient(145deg,#ffd6b5,#ff9a59); }
.app-icon--violet { background: linear-gradient(145deg,#e1d2ff,#9a79f4); }
.app-icon--green { background: linear-gradient(145deg,#c9f6cf,#5aca7d); }
.app-icon--sky { background: linear-gradient(145deg,#c8eeff,#69c4ef); }
.app-icon--red { background: linear-gradient(145deg,#ffd0ca,#f47467); }
.app-icon--slate { background: linear-gradient(145deg,#e4ebf3,#9eafc4); }
:root[data-theme="dark"] .app-icon { border-color: rgba(255,255,255,.22); box-shadow: 0 8px 19px rgba(0,0,0,.2), inset 0 1px 1px rgba(255,255,255,.3); }
.app-title { font-size: 15px; font-weight: 690; letter-spacing: -.02em; line-height: 1.25; }
.app-description { margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.app-state { margin-top: auto; padding-top: 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-state--disabled { color: #9c6d2b; }
:root[data-theme="dark"] .app-state--disabled { color: #f4c477; }
.tile-arrow { position: absolute; top: 20px; right: 18px; width: 16px; height: 16px; color: var(--muted); opacity: .8; }
.footer-note { margin: 31px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.glass-panel { border: 1px solid var(--line); border-radius: 25px; background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.page-heading { margin: 0 0 24px; }
.page-heading h1 { margin: 0; font-size: clamp(27px,4vw,40px); font-weight: 730; letter-spacing: -.05em; }
.page-heading p { margin: 8px 0 0; color: var(--ink-soft); }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 17px; color: var(--accent); font-size: 13px; font-weight: 660; }
.back-link svg { width: 16px; height: 16px; }
.placeholder-card { display: grid; min-height: 310px; place-items: center; padding: 40px; text-align: center; }
.placeholder-inner { max-width: 440px; }
.placeholder-icon { display: grid; width: 78px; height: 78px; place-items: center; margin: 0 auto 20px; border-radius: 25px; background: var(--accent-soft); }
.placeholder-icon img { width: 42px; height: 42px; }
.placeholder-inner h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.placeholder-inner p { margin: 10px 0 0; color: var(--ink-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--glass-strong); font-size: 12px; font-weight: 640; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e4a33f; box-shadow: 0 0 0 3px rgba(228,163,63,.12); }
.settings-list { display: grid; gap: 14px; }
.settings-card { padding: 20px; }
.settings-card-head { display: flex; align-items: center; gap: 13px; padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.settings-card-head .app-icon { width: 46px; height: 46px; flex: 0 0 46px; margin: 0; border-radius: 15px; }
.settings-card-head .app-icon img { width: 26px; height: 26px; }
.settings-card-head h2 { margin: 0; font-size: 16px; }
.settings-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.settings-form-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field-label { color: var(--ink-soft); font-size: 11px; font-weight: 680; }
.form-control { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid rgba(117,143,171,.3); border-radius: 11px; color: var(--ink); background: var(--glass-strong); }
.form-control:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.checkbox-row { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 10px; border: 1px solid rgba(117,143,171,.24); border-radius: 11px; color: var(--ink-soft); background: var(--glass-strong); font-size: 12px; font-weight: 610; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-errors { color: #bd4141; font-size: 12px; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.button-primary { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid rgba(255,255,255,.52); border-radius: 13px; color: #fff; background: linear-gradient(135deg,#438ff0,#236fe0); box-shadow: 0 8px 18px rgba(38,112,218,.23); font-weight: 680; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(38,112,218,.31); }
.module-state-note { color: var(--muted); font-size: 11px; }
.message-stack { display: grid; gap: 8px; margin-bottom: 17px; }
.message { padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--glass-strong); font-size: 13px; }
.message--success { border-color: rgba(39,162,94,.28); color: #167244; }
.message--error { border-color: rgba(210,76,76,.28); color: #a93838; }
:root[data-theme="dark"] .message--success { color: #8fe0af; }
:root[data-theme="dark"] .message--error { color: #ffaaaa; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.auth-card { width: min(440px,100%); padding: 35px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; text-align: center; }
.auth-brand .brand-mark { width: 66px; height: 66px; flex-basis: 66px; margin-bottom: 16px; border-radius: 22px; }
.auth-brand .brand-mark img { width: 39px; height: 39px; }
.auth-brand .brand-name { font-size: 25px; }
.auth-brand .brand-caption { margin-top: 4px; }
.auth-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.025em; text-align: center; }
.auth-subtitle { margin: 7px 0 23px; color: var(--ink-soft); font-size: 13px; text-align: center; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { color: var(--ink-soft); font-size: 12px; font-weight: 680; }
.auth-form input[type="text"], .auth-form input[type="password"] { width: 100%; height: 47px; margin-top: 6px; padding: 0 13px; border: 1px solid rgba(117,143,171,.32); border-radius: 13px; color: var(--ink); background: var(--glass-strong); }
.auth-error { padding: 10px 12px; border-radius: 11px; color: #a93838; background: rgba(255,115,115,.1); font-size: 12px; }
.auth-footer { margin-top: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.public-tools { position: fixed; top: 22px; right: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1050px) { .app-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 760px) {
  .page-shell { width: min(100% - 32px, 680px); padding-top: 18px; }
  .topbar { margin-bottom: 35px; }
  .hero { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .hero-stats { gap: 4px 8px; font-size: 12px; }
  .app-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
  .app-tile { min-height: 164px; padding: 15px 13px; border-radius: 19px; }
  .app-icon { width: 51px; height: 51px; margin-bottom: 13px; border-radius: 17px; }
  .app-icon img { width: 27px; height: 27px; }
  .app-title { font-size: 13px; }
  .app-description { font-size: 11px; }
  .tile-arrow { top: 15px; right: 12px; }
  .settings-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-card { padding: 28px 23px; }
}
@media (max-width: 430px) {
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
  .brand-mark img { width: 26px; height: 26px; }
  .brand-name { font-size: 16px; }
  .brand-caption { font-size: 9px; }
  .profile-name { display: none; }
  .profile-summary { padding-right: 7px; }
  .hero-stats-separator { display: none; }
  .app-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .app-tile { min-height: 155px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .settings-card { padding: 15px; }
  .settings-form-grid { grid-template-columns: 1fr; }
  .settings-actions { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* House registry and reusable house-card components */
.house-page-heading,.section-title,.house-detail-head,.house-head-status,.scope-switch,.house-search,.house-row,.house-pagination,.form-actions,.note-actions,.history-head { display:flex; align-items:center; }
.house-page-heading,.section-title,.house-detail-head,.house-row,.history-head { justify-content:space-between; gap:18px; }
.house-page-heading { margin: 0 0 20px; }
.house-page-heading h1,.house-detail-title h1 { margin:0; font-size:clamp(29px,4vw,40px); letter-spacing:-.05em; }
.house-page-heading p:not(.eyebrow),.house-detail-title>p:last-child { margin:6px 0 0; color:var(--ink-soft); }
.house-count-chip { display:flex; align-items:baseline; gap:8px; padding:10px 15px; border:1px solid var(--line); border-radius:15px; color:var(--muted); background:var(--glass); font-size:12px; }
.house-count-number { color:var(--ink); font-size:22px; font-weight:740; font-variant-numeric:tabular-nums; }
.house-toolbar { padding:17px; margin-bottom:17px; }
.scope-switch { gap:5px; width:max-content; max-width:100%; padding:4px; border-radius:13px; background:rgba(95,120,150,.08); }
.scope-option { padding:8px 12px; border-radius:10px; color:var(--ink-soft); font-size:12px; font-weight:650; white-space:nowrap; }
.scope-option span { margin-left:5px; opacity:.72; }
.scope-option.is-active { color:var(--ink); background:var(--glass-strong); box-shadow:0 2px 8px rgba(30,60,90,.09); }
.house-search { position:relative; gap:8px; margin-top:14px; }
.house-search input { flex:1; min-width:0; min-height:46px; padding:9px 14px 9px 43px; border:1px solid rgba(117,143,171,.3); border-radius:14px; color:var(--ink); background:var(--glass-strong); }
.search-icon { position:absolute; left:14px; width:19px; height:19px; color:var(--muted); }
.search-submit,.search-clear { min-height:42px; padding:8px 13px; border:1px solid var(--line); border-radius:12px; color:var(--ink-soft); background:var(--glass-strong); cursor:pointer; font-size:12px; font-weight:650; }
.search-hint,.muted { color:var(--muted); font-size:12px; }
.search-hint { margin:9px 3px 0; }
.search-hint.is-error { color:#a93838; }
:root[data-theme="dark"] .search-hint.is-error { color:#ffaaaa; }
#house-results { position:relative; }
.house-list { display:grid; gap:9px; }
.house-row { min-width:0; padding:14px 17px; border:1px solid var(--line); border-radius:17px; background:var(--glass); box-shadow:0 6px 20px rgba(46,83,122,.055); backdrop-filter:blur(16px); transition:transform .16s ease,background .16s ease,box-shadow .16s ease; }
.house-row.is-search-exit { position:absolute; margin:0; pointer-events:none; z-index:2; will-change:opacity,transform; }
.house-row:hover { transform:translateY(-2px); background:var(--glass-strong); box-shadow:var(--shadow); }
.house-row-icon,.house-detail-icon { display:grid; flex:0 0 auto; place-items:center; border-radius:14px; background:linear-gradient(145deg,#c8eaff,#76b8fa); }
.house-row-icon { width:43px; height:43px; }
.house-row-icon img { width:25px; height:25px; }
.house-row-main { display:grid; flex:1; min-width:0; gap:4px; margin:0 14px; }
.house-row-title { overflow:hidden; font-weight:720; text-overflow:ellipsis; white-space:nowrap; }
.contract-badge,.object-type-chip { display:inline-flex; align-items:center; width:max-content; max-width:100%; padding:4px 9px; border:1px solid transparent; border-radius:999px; font-size:10px; font-weight:700; }
.status-pill--direct { color:#147447; border-color:rgba(35,159,94,.22); background:rgba(35,159,94,.1); }
.status-pill--indirect { color:#91621b; border-color:rgba(216,157,49,.24); background:rgba(236,177,70,.12); }
.status-pill--unknown { color:var(--muted); border-color:var(--line); background:rgba(130,145,160,.08); }
:root[data-theme="dark"] .status-pill--direct { color:#89e1b0; }
:root[data-theme="dark"] .status-pill--indirect { color:#f3cc82; }
.house-row-facts { display:flex; flex-wrap:wrap; gap:3px 12px; color:var(--muted); font-size:11px; }
.house-row-arrow { width:17px; height:17px; flex:0 0 auto; color:var(--muted); }
.house-empty { display:grid; justify-items:center; gap:8px; padding:35px 20px; text-align:center; }
.house-empty h2,.house-empty h3 { margin:0; }
.house-empty p { margin:0; color:var(--muted); }
.house-pagination { justify-content:center; gap:18px; margin:18px 0; color:var(--muted); font-size:12px; }
.house-pagination a { padding:7px 11px; border:1px solid var(--line); border-radius:10px; color:var(--accent); background:var(--glass); }
@media (prefers-reduced-motion: reduce) {
  .house-row { transition:none; }
}
.house-detail-head { padding:22px; margin-bottom:17px; }
.house-detail-icon { width:60px; height:60px; border-radius:19px; }
.house-detail-icon img { width:34px; height:34px; }
.house-detail-title { flex:1; min-width:0; }
.house-detail-title .eyebrow { margin-bottom:5px; }
.house-detail-title h1 { overflow-wrap:anywhere; }
.house-head-status { flex-direction:column; align-items:flex-end; gap:8px; }
.object-type-chip { color:var(--ink-soft); border-color:var(--line); background:var(--glass-strong); }
.archive-notice { padding:11px 15px; margin-bottom:14px; border:1px solid rgba(218,160,52,.28); border-radius:13px; color:var(--ink-soft); background:rgba(235,182,72,.1); font-size:12px; }
.house-tabs { display:flex; gap:4px; overflow-x:auto; padding:5px; margin-bottom:14px; border:1px solid var(--line); border-radius:16px; background:var(--glass); scrollbar-width:thin; }
.house-tab { flex:0 0 auto; padding:9px 12px; border-radius:11px; color:var(--ink-soft); font-size:12px; font-weight:650; white-space:nowrap; }
.house-tab.is-active { color:var(--ink); background:var(--glass-strong); box-shadow:0 3px 10px rgba(33,67,103,.1); }
.house-tab.is-placeholder { color:var(--muted); }
.tab-soon { margin-left:3px; }
.house-tab-content { display:grid; gap:14px; }
.section-title { margin:2px 1px 12px; }
.section-title h2 { margin:0; font-size:23px; letter-spacing:-.035em; }
.section-title h3 { margin:0; }
.summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.summary-card { display:grid; gap:7px; padding:16px; }
.summary-card span,.area-total span,.tariff-total>span:first-child { color:var(--muted); font-size:11px; }
.summary-card strong { font-size:clamp(17px,2vw,24px); letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
.info-panel { padding:19px; }
.info-panel h3 { margin:0 0 15px; font-size:15px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px 26px; margin:0; }
.detail-grid--three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.detail-grid div { min-width:0; }
.detail-grid dt { color:var(--muted); font-size:11px; }
.detail-grid dd { margin:4px 0 0; overflow-wrap:anywhere; font-size:13px; font-weight:640; }
.quick-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.quick-link { display:flex; align-items:center; gap:12px; padding:14px; }
.quick-link>span:nth-child(2) { display:grid; flex:1; gap:2px; }
.quick-link small { color:var(--muted); }
.quick-link-icon { display:grid; width:38px; height:38px; place-items:center; border-radius:13px; color:var(--accent); background:var(--accent-soft); font-size:21px; }
.area-total { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.area-total strong,.tariff-total strong { font-size:24px; font-variant-numeric:tabular-nums; }
.area-bar { display:flex; height:14px; overflow:hidden; margin:17px 0; border-radius:999px; background:rgba(120,140,160,.1); }
.area-segment--residential { background:#4a98ee; }
.area-segment--nonresidential { background:#f0b547; }
.area-segment--common { background:#47bca9; }
.area-dot { width:9px; height:9px; flex:0 0 auto; border-radius:50%; }
.area-legend { display:grid; gap:10px; }
.area-line { display:flex; align-items:center; gap:9px; font-size:12px; }
.area-line span:nth-child(2) { flex:1; }
.area-line strong { font-variant-numeric:tabular-nums; }
.tariff-total { display:grid; gap:3px; padding:20px; }
.tariff-total strong { font-size:32px; }
.tariff-total strong small { font-size:15px; font-weight:600; }
.tariff-lines { display:grid; }
.tariff-line { display:flex; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--line); font-size:13px; }
.tariff-line:last-child { border-bottom:0; }
.tariff-line strong { text-align:right; font-variant-numeric:tabular-nums; }
.meter-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; }
.meter-card { display:grid; gap:7px; padding:12px; border:1px solid var(--line); border-radius:13px; background:var(--surface); }
.meter-card span { color:var(--muted); font-size:10px; }
.meter-card strong { font-size:12px; }
.document-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.document-group { padding:17px; }
.document-group h3 { margin:0 0 10px; font-size:14px; }
.document-group ul { display:grid; gap:8px; padding:0; margin:0; list-style:none; }
.document-group li { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.document-group li>span { display:grid; gap:2px; min-width:0; }
.document-group li strong { overflow:hidden; text-overflow:ellipsis; }
.document-group li small { color:var(--muted); font-size:10px; }
.house-edit-form { padding:19px; }
.house-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.house-form-grid--wide { grid-template-columns:repeat(3,minmax(0,1fr)); }
.house-form-grid .field--wide { grid-column:1/-1; }
.house-form-grid .field small { color:var(--muted); font-size:10px; }
.form-actions { justify-content:flex-start; gap:9px; margin-top:17px; }
.button-secondary { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:8px 12px; border:1px solid var(--line); border-radius:11px; color:var(--ink-soft); background:var(--glass-strong); font-size:12px; font-weight:650; cursor:pointer; }
.button-secondary:hover { color:var(--ink); background:var(--accent-soft); }
.button-danger { color:#a84141; }
.house-admin-actions { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px; margin-top:18px; }
.house-admin-actions p { margin:3px 0 0; color:var(--muted); font-size:11px; }
.house-admin-actions form,.note-actions form { display:flex; align-items:center; gap:7px; }
.house-admin-actions .form-control { width:min(270px,32vw); min-height:38px; }
.note-composer { padding:15px; }
.note-composer>summary { cursor:pointer; color:var(--accent); font-weight:680; }
.note-composer form { padding-top:14px; }
.note-list { display:grid; gap:11px; }
.note-card { padding:17px; }
.note-card--pinned { border-color:rgba(38,128,221,.4); }
.note-card--archived { opacity:.78; }
.note-card-heading { display:grid; gap:5px; }
.note-card-heading h3 { margin:4px 0 0; font-size:16px; }
.note-meta,.history-actor { color:var(--muted); font-size:10px; }
.pin-label { display:inline-block; margin-right:6px; color:var(--accent); font-size:10px; font-weight:700; }
.note-body { padding:12px 0; overflow-wrap:anywhere; font-size:13px; }
.note-actions { flex-wrap:wrap; gap:7px; }
.history-list { display:grid; gap:10px; }
.history-card { display:flex; align-items:flex-start; gap:13px; padding:15px; }
.history-marker { width:10px; height:10px; flex:0 0 auto; margin-top:6px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.history-main { flex:1; min-width:0; }
.history-head { flex-wrap:wrap; }
.history-head time { color:var(--muted); font-size:11px; }
.history-actor { margin:4px 0 8px; }
.history-card details summary { color:var(--accent); font-size:11px; cursor:pointer; }
.history-changes { display:grid; gap:6px; margin:10px 0 0; }
.history-changes div { display:grid; grid-template-columns:minmax(110px,.5fr) 1fr; gap:12px; font-size:11px; }
.history-changes dt { color:var(--muted); }
.history-changes dd { margin:0; overflow-wrap:anywhere; }
.house-placeholder { min-height:330px; }

@media (max-width:760px) {
  .house-page-heading { align-items:flex-start; }
  .house-count-chip { padding:8px 10px; }
  .house-detail-head { align-items:flex-start; flex-wrap:wrap; padding:16px; }
  .house-detail-icon { width:48px; height:48px; border-radius:15px; }
  .house-detail-icon img { width:27px; height:27px; }
  .house-detail-title { flex-basis:calc(100% - 70px); }
  .house-detail-title h1 { font-size:25px; }
  .house-head-status { flex-direction:row; align-items:center; flex-wrap:wrap; margin-left:60px; }
  .summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .detail-grid--three,.meter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .document-groups { grid-template-columns:1fr; }
  .house-form-grid--wide { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .house-admin-actions { align-items:flex-start; flex-direction:column; }
  .house-admin-actions form { width:100%; flex-wrap:wrap; }
  .house-admin-actions .form-control { width:auto; flex:1; }
}
@media (max-width:480px) {
  .house-page-heading { gap:8px; }
  .house-page-heading h1 { font-size:30px; }
  .house-count-chip { flex-direction:column; align-items:flex-start; gap:0; font-size:9px; }
  .house-toolbar { padding:12px; }
  .house-search { flex-wrap:wrap; }
  .house-search input { flex-basis:100%; }
  .search-icon { top:13px; }
  .search-submit,.search-clear { flex:1; text-align:center; }
  .house-row { gap:3px; padding:11px; }
  .house-row-icon { width:36px; height:36px; }
  .house-row-icon img { width:21px; height:21px; }
  .house-row-main { margin:0 8px; }
  .contract-badge { font-size:9px; }
  .house-tabs { gap:2px; }
  .house-tab { padding:8px 9px; font-size:11px; }
  .detail-grid,.detail-grid--three,.house-form-grid,.house-form-grid--wide { grid-template-columns:1fr; }
  .quick-links { grid-template-columns:1fr; }
  .info-panel { padding:15px; }
  .area-total { align-items:flex-start; flex-direction:column; gap:2px; }
  .meter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .history-changes div { grid-template-columns:1fr; gap:2px; }
  .note-actions { align-items:flex-start; }
}

.source-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 20px; margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.source-grid>div { min-width:0; }
.source-grid>div>span { color:var(--muted); font-size:10px; text-transform:capitalize; }
.source-details { margin-top:2px; color:var(--ink-soft); font-size:10px; }
.source-details summary { color:var(--accent); cursor:pointer; }
.source-details p { margin:5px 0 0; overflow-wrap:anywhere; }
@media (max-width:480px) { .source-grid { grid-template-columns:1fr; } }

/* The detail page keeps its gradient in viewport coordinates, like the registry. */
html.house-detail-page { overflow-y:scroll; }
.house-detail-page body { background:none; isolation:isolate; }
.house-detail-page body::before {
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:var(--portal-backdrop); transform:translateZ(0);
}
.portal-view { position:relative; overflow-anchor:none; }
.portal-view [data-portal-panel] .glass-panel, .portal-view-exit .glass-panel {
  -webkit-backdrop-filter:none; backdrop-filter:none;
}
.portal-view > .portal-view-exit {
  position:absolute; inset:0 0 auto; z-index:1; pointer-events:none;
}
.portal-view-error:not([hidden]) {
  position:fixed; bottom:20px; right:20px; z-index:6; max-width:calc(100% - 40px);
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:12px; border:1px solid var(--line); border-radius:14px;
  color:var(--ink); background:var(--glass-strong); box-shadow:var(--shadow);
}
[data-portal-tabs] .house-tab {
  transition:background-color 300ms ease-out, color 300ms ease-out, box-shadow 300ms ease-out;
}
@media (prefers-reduced-motion:reduce) {
  [data-portal-tabs] .house-tab { transition:none; }
}
