/* Same visual vocabulary as the demo; a vertical connected tree on phones. */
.estate-heading{margin:24px 0 18px}.estate-heading h2{font-size:22px;margin:0 0 6px}.estate-heading p{margin:0;line-height:1.6}
.estate-tree{display:flex;align-items:flex-start;padding:24px;border:1px solid var(--border);border-radius:20px;background:var(--panel);margin-bottom:24px;min-width:0;gap:0}
.estate-node{display:flex;flex-direction:column;flex:0 0 230px;min-width:0;border:1px solid var(--border);border-radius:15px;overflow:hidden;background:var(--bg);color:var(--text);text-decoration:none!important;align-self:flex-start}
.estate-photo{height:140px;width:100%;overflow:hidden;flex-shrink:0}.estate-photo img{width:100%;height:100%;object-fit:cover;display:block}.estate-photo .photo-placeholder svg{width:80px;height:58px}.estate-photo .photo-placeholder small{font-size:10px;text-align:center}
.estate-node-body{padding:16px;display:flex;flex-direction:column;gap:7px;min-width:0}.estate-name{font-size:17px;line-height:1.4;overflow-wrap:anywhere}.estate-address{font-size:12px;color:var(--muted);line-height:1.5;overflow-wrap:anywhere}.estate-badges{display:flex;flex-wrap:wrap;gap:6px}.estate-mode{background:#ffd23f20;color:var(--accent);border:1px solid #ffd23f55;border-radius:6px;padding:4px 7px;font-size:13px;font-weight:800}body.light .estate-mode{background:#fff0b1;color:#614600}.estate-status{font-size:12px;font-weight:700;color:var(--muted)}.estate-free{color:#48e597}body.light .estate-free{color:#087a39}.estate-price-label{margin-top:3px;color:var(--muted);font-size:11px}.estate-open{font-size:12px;font-weight:700;color:var(--text);margin-top:4px}.estate-available{border:2px solid #36cb80;box-shadow:0 0 16px #36cb801b}
.estate-branches,.estate-people{list-style:none!important;margin:0;padding:0 0 0 32px;min-width:0;flex:1}.estate-branch,.estate-person-branch{position:relative;display:flex;align-items:flex-start;min-width:0;padding:0 0 20px}.estate-branch:last-child,.estate-person-branch:last-child{padding-bottom:0}.estate-branch::before,.estate-person-branch::before{content:'';position:absolute;left:-17px;top:0;bottom:0;border-left:2px solid var(--accent);opacity:.65}.estate-branch:first-child::before,.estate-person-branch:first-child::before{top:30px}.estate-branch:last-child::before,.estate-person-branch:last-child::before{bottom:auto;height:30px}.estate-branch:only-child::before,.estate-person-branch:only-child::before{display:none}.estate-branch::after,.estate-person-branch::after{content:'';position:absolute;left:-32px;top:30px;width:32px;border-top:2px solid var(--accent);opacity:.65}.estate-branch:not(:first-child)::after,.estate-person-branch:not(:first-child)::after{left:-17px;width:17px}
.estate-room{flex-basis:200px}.estate-room .estate-photo{height:110px}.estate-person{display:flex;align-items:center;gap:11px;width:100%;text-align:left;padding:14px!important;min-height:84px;background:var(--bg);border:1px solid var(--border);border-radius:12px;color:var(--text);white-space:normal}.estate-person .tenant-avatar{width:42px;height:42px;flex:0 0 42px}.estate-person-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.estate-person-copy strong{font-size:14px;overflow-wrap:anywhere}.estate-person-copy small{font-size:11px;color:var(--muted)}.estate-empty{padding:16px;margin:0;border:1px dashed var(--border);border-radius:12px;font-size:13px;line-height:1.7;color:var(--muted)}.estate-tree>.estate-people{max-width:400px}
#real-menu-toggle,#real-menu-close,#real-menu-backdrop{display:none}.housing-sections{scroll-margin-top:120px}.real-app .license-unit-controls{border-radius:16px}.real-app main>.card{min-width:0}.real-app button,.real-app a{touch-action:manipulation}.estate-node:focus-visible,.estate-person:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
@media(max-width:1200px){.estate-tree{display:block}.estate-property{display:flex;flex-direction:row;width:100%;max-width:none}.estate-property .estate-photo{width:150px;height:auto;min-height:180px}.estate-branches,.estate-tree>.estate-people{padding:24px 0 0 26px;max-width:none}.estate-branch::before,.estate-person-branch::before{left:-14px}.estate-branch::after,.estate-person-branch::after{left:-14px;width:14px}.estate-branch:not(:first-child)::after,.estate-person-branch:not(:first-child)::after{left:-14px;width:14px}.estate-branch:first-child::before,.estate-person-branch:first-child::before{top:-24px}.estate-branch:only-child::before,.estate-person-branch:only-child::before{display:block;height:54px}.estate-people{padding-left:26px}.estate-person-branch:first-child::before{top:0}.estate-person-branch:only-child::before{height:30px}.estate-tree>.estate-people>.estate-person-branch:first-child::before{top:-24px;height:54px}}
@media(max-width:850px){
 .real-app aside{position:fixed!important;inset:0 auto 0 0;width:min(310px,86vw);height:100dvh;z-index:1100;overflow-y:auto;padding:24px 20px calc(24px + env(safe-area-inset-bottom));background:var(--panel);transform:translateX(-105%);transition:transform .2s ease;box-shadow:12px 0 40px #0003;border-right:1px solid var(--border)}
 .real-app.real-menu-open aside{transform:translateX(0)}.real-menu-open{overflow:hidden}.real-app aside .workspace{display:flex}.real-app aside .nav-label,.real-app aside .sidebar-footer{display:block}.real-app aside nav{display:flex;flex-direction:column;overflow:visible;margin-top:16px;gap:4px}.real-app aside nav a{font-size:15px;padding:13px 12px;min-height:48px}.real-app aside .sidebar-footer{margin-top:20px}.real-app aside .brand{margin-top:32px}
 .real-app #real-menu-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin:0;font-size:23px;padding:5px;background:var(--panel);border:1px solid var(--border);border-radius:10px;color:var(--text)}.real-app #real-menu-close{display:block;position:absolute;right:16px;top:12px;width:44px;height:44px;font-size:28px;margin:0;padding:0}.real-app #real-menu-backdrop:not([hidden]){display:block;position:fixed;inset:0;width:100%;height:100dvh;z-index:1090;background:#0008;border:0;border-radius:0;margin:0;padding:0;backdrop-filter:blur(3px);transform:none!important}
 .real-app main{margin:0!important;width:100%;min-width:0}.real-app .real-topbar{position:sticky;top:0;z-index:40;padding:10px 16px;background:var(--bg);border-bottom:1px solid var(--border);display:flex;gap:8px}.real-app .breadcrumb{margin:0;flex:1;font-size:12px;min-width:0;overflow-wrap:anywhere}.real-app .shell-actions{flex-basis:100%;justify-content:flex-end;gap:10px}.real-app .shell-actions button,.real-app .mode-switch a,.real-app .mode-switch span{min-height:44px;display:inline-flex;align-items:center;justify-content:center}.real-app .language-selector select{min-height:44px;font-size:14px}.real-app main>.card{padding:24px 16px 40px}.real-app #title{font-size:27px}.real-app input,.real-app select,.real-app textarea{font-size:16px!important}.real-app button{min-height:44px}.real-app .housing-sections button{font-size:13px}.real-app #real-properties>.photo-editor,.real-app #mortgage-panel,.real-app #expense-panel{max-width:100%;box-sizing:border-box}
}
@media(max-width:600px){
 .estate-tree{padding:14px;border-radius:16px;margin-bottom:18px}.estate-heading h2{font-size:19px}.estate-node-body{padding:12px;gap:6px}.estate-property .estate-photo{width:86px;min-height:180px}.estate-property .estate-node-body{flex:1}.estate-name{font-size:15px}.estate-mode{font-size:12px}.estate-node .money-income{font-size:14px}.estate-branch{display:block}.estate-room{width:100%;display:flex;flex-direction:row}.estate-room .estate-photo{width:76px;height:auto;min-height:148px}.estate-room .estate-node-body{flex:1}.estate-branches{padding-left:16px}.estate-branch::before,.estate-branch::after,.estate-branch:not(:first-child)::after{left:-9px}.estate-branch::after,.estate-branch:not(:first-child)::after{width:9px}.estate-branch>.estate-people{padding:16px 0 0 16px}.estate-person-branch::before,.estate-person-branch::after,.estate-person-branch:not(:first-child)::after{left:-9px}.estate-person-branch::after,.estate-person-branch:not(:first-child)::after{width:9px}.estate-branch>.estate-people>.estate-person-branch:first-child::before{top:-16px}.estate-branch>.estate-people>.estate-person-branch:only-child::before{height:46px}.estate-person{padding:11px!important;gap:8px}.estate-person-copy strong{font-size:13px}.estate-person .tenant-avatar{width:36px;height:36px;flex-basis:36px}.estate-photo .photo-placeholder small{display:none}.estate-photo .photo-placeholder svg{width:55px}.estate-empty{font-size:12px;padding:12px}.real-app .license-unit-controls{padding:14px;gap:12px}.real-app .license-unit-controls label{min-width:0;flex-basis:100%}.real-app .license-unit-controls button{width:100%}.real-app .document-filters{gap:12px}.real-app .document-filters label{min-width:0;flex-basis:100%}.real-app .expense-entry,.real-app .tenant-card{border-radius:14px}.real-app .photo-actions{gap:10px}
}
@media(prefers-reduced-motion:reduce){.real-app aside{transition:none}}
@media print{#real-menu-toggle,#real-menu-close,#real-menu-backdrop{display:none!important}}

.estate-branch::after,.estate-person-branch::after{top:27px;height:6px;border:0;background:var(--accent);clip-path:polygon(0 35%,75% 35%,75% 0,100% 50%,75% 100%,75% 65%,0 65%)}

/* Match the warm yellow demo palette in both themes. */
body.real-app:not(.light){--bg:#191918;--panel:#252523;--text:#f2f0e8;--muted:#b3b1a8;--border:#3b3a34}body.real-app.light{--bg:#f8f8f6;--panel:#fff;--text:#25241f;--muted:#737168;--border:#e9e7df}.real-app:not(.light) aside{background:#20201e}.real-app nav a[aria-current]{background:var(--accent);color:#15141a}.real-app .mode-switch span{background:var(--accent);color:#15141a}

.estate-overview .license-unit-controls>label,.estate-overview #license-add-room{display:none!important}.estate-overview .license-unit-controls{padding:0;margin:0 0 18px;border:0;background:transparent}.estate-add-room{border:1px dashed var(--accent);color:var(--text);font-weight:700;min-height:44px;padding:12px 16px}.estate-add-branch{padding-top:4px}.real-app main>.card>.tag{display:none}.estate-overview .license-unit-controls button{width:auto}
/* Date controls must shrink inside their cell, including Safari's native editor. */
.real-app input[type="date"],.real-app input[type="month"]{display:block;box-sizing:border-box;min-width:0;min-inline-size:0;max-width:100%;max-inline-size:100%}
.real-app input[type="date"]{width:100%;inline-size:100%;min-height:48px}
.real-app input[type="date"]::-webkit-date-and-time-value{min-width:0;text-align:left}
.real-app input[type="date"]::-webkit-datetime-edit{min-width:0;padding:0}
@media(max-width:600px){
 .real-app .mortgage-filters,.real-app .finance-filters{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
 .real-app .mortgage-filters>label,.real-app .finance-filters>label{width:100%;min-width:0;margin:0;grid-column:1;flex-basis:100%}
 .real-app .mortgage-filters input,.real-app .mortgage-filters select,.real-app .finance-filters input,.real-app .finance-filters select{width:100%;min-width:0;max-width:100%;box-sizing:border-box;margin-top:8px}
}
/* iOS date inputs reserve native editor width: leave an explicit right gutter. */
@media(max-width:600px){
 .real-app .mortgage-filters input[type="date"],.real-app .finance-filters input[type="date"],.real-app .document-filters input[type="date"]{width:calc(100% - 16px);inline-size:calc(100% - 16px);max-width:calc(100% - 16px);max-inline-size:calc(100% - 16px);min-width:0;min-inline-size:0;-webkit-appearance:none;appearance:none;padding-left:10px;padding-right:10px;overflow:hidden}
 .real-app input[type="date"]::-webkit-date-and-time-value{width:100%;min-width:0;overflow:hidden}
}
