/* V5 shared geometry. Existing controllers still own visibility and scroll restoration. */
:root {
  --premium-version:5;
  --primary:#007c83; --primary-strong:#005f66; --primary-soft:#e7f6f3;
  --text:#173440; --premium-ink:#173440; --muted:#536b77;
  --premium-muted-on-white:#607681;
  --bg:#f4f9fa; --surface:#fff; --surface-soft:#f4f9fa; --line:#dfeaed;
  --green:#107c5d; --green-soft:#e7f6f3; --blue:#246e9e; --blue-soft:#eaf4fc;
  --red:#b93636; --red-soft:#fff0f0; --amber:#865b12; --amber-soft:#fff7e6;
  --premium-control:44px; --page-gutter:16px; --premium-space:18px;
  --shadow-soft:0 3px 12px #17344006; --radius:8px;
}
html,body,.app-frame { background:var(--bg); }
[hidden] { display:none !important; }
body,input,select,textarea,button { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing:0; }
.content { background:linear-gradient(#eaf6fc 0,#fff 250px,#f4f9fa 100%); padding-top:calc(12px + env(safe-area-inset-top,0px)); padding-bottom:calc(82px + env(safe-area-inset-bottom,0px)); }
.content { --premium-screen-media:var(--media-dashboard); }
.content:has(.asset-card-header),.content:has([data-scene=assets]) { --premium-screen-media:var(--media-assets); }
.content:has([data-scene=elevators]) { --premium-screen-media:var(--media-elevators); }
.content:has([data-scene=visitors]) { --premium-screen-media:var(--media-visitors); }
.content:has(.premium-hero),.content:has(.asset-card-header) { background:linear-gradient(#edf8fd 80px,#edf8fd00 150px) 0 0/100% 244px no-repeat,linear-gradient(90deg,#effafff5 0,#edf9fed9 38%,#edf9fe15 85%) 0 0/100% 244px no-repeat,var(--premium-screen-media) right 60px/auto 184px no-repeat,linear-gradient(#edf8fd 230px,#fff 360px,var(--bg)); }
.title-row,.title-row:has(.ops-menu-button) { margin-top:calc(-12px - env(safe-area-inset-top,0px)); margin-bottom:12px; padding:calc(12px + env(safe-area-inset-top,0px)) var(--page-gutter) 12px; min-height:76px; gap:6px; background:#edf8fc; border:0; }
.content:has(.premium-hero)>.title-row,.content:has(.asset-card-header)>.title-row { background:transparent; margin-bottom:0; }
.content .title-row.is-scrolled { background:#eef8fcf5; box-shadow:0 2px 12px #1734400a; }
.title-row { backdrop-filter:none; }
.title-row::before { background:inherit; height:calc(12px + env(safe-area-inset-top,0px)); }
.title-row h1,.title-row .screen-title,.title-row:has(.ops-menu-button) .screen-title { font-size:18px; font-weight:750; line-height:1.2; }
.title-row p { font-size:11px; margin-top:4px; }
.title-row .mistral-header-logo,.title-row:has(.ops-menu-button) .mistral-header-logo { width:36px; max-width:36px; }
.title-row .brand-wordmark.is-compact .brand-wordmark-my { font-size:17px; }
.title-row .brand-wordmark.is-compact .brand-wordmark-mistral { width:90px; max-width:90px; flex:0 1 90px; }
.header-actions { gap:2px; }
.icon-button,.ops-menu-button { border:0; background:#ffffffb8; box-shadow:0 4px 12px #183c4c08; }
.icon-button svg,.ops-menu-button svg { width:20px; height:20px; }
.section-stack,.content:has(.premium-hero)>.section-stack { gap:18px; }
.premium-hero { min-height:164px; padding:16px var(--page-gutter) 22px; background:transparent; overflow:visible; }
.premium-hero::before { display:none; }
.premium-hero[data-scene] { background:none; }
.premium-hero-copy { width:64%; }
.premium-eyebrow { font-size:10px; margin-bottom:8px; color:var(--muted); }
.premium-hero h2 { font-size:28px; line-height:1.13; max-width:240px; }
.premium-hero h2::after { width:30px; height:3px; margin-top:12px; }
.premium-hero-subtitle { font-size:14px; line-height:1.45; margin-top:10px; max-width:190px; }
.premium-date { right:16px; bottom:20px; padding:8px 11px; font-size:12px; gap:8px; box-shadow:none; background:#ffffffd9; }
.premium-date svg { width:20px; height:20px; }
.premium-date small { font-size:10px; }
.premium-hero>.ops-toolbar.premium-hero-tools:has(>[data-op=export-list]:only-child) { top:auto; bottom:20px; right:16px; transform:translateY(-57px); }
.premium-section-bar { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:4px; min-width:0; }
.content .premium-section-heading { font-size:18px; line-height:1.25; gap:10px; margin:0; }
.premium-section-heading>i { width:34px; height:36px; border-radius:8px; background:#e7f3f3; }
.premium-section-heading svg { width:22px; height:22px; }
.premium-all { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; gap:2px; min-height:44px; padding:0 3px; font-size:12px; text-decoration:none; color:var(--text); }
.premium-all svg { width:15px; height:15px; }
.admin-stat-grid { gap:10px; }
.premium-visitor-stats { position:relative; padding-top:6px; }
.premium-visitor-stats::before { content:''; position:absolute; top:-18px; bottom:0; left:calc(-1 * var(--page-gutter)); right:calc(-1 * var(--page-gutter)); border-radius:24px 24px 0 0; background:linear-gradient(#ffffffed,#fff); z-index:0; pointer-events:none; }
.premium-visitor-stats>* { position:relative; }
.admin-stat-grid .premium-metric { display:grid; grid-template-columns:34px minmax(0,1fr); grid-template-rows:auto auto auto 24px; min-height:138px; padding:10px 12px; gap:3px 8px; align-content:start; align-items:center; border:1px solid #deeeea; background:linear-gradient(130deg,#fcfefd,#effaf7); box-shadow:var(--shadow-soft); border-radius:var(--radius); overflow:hidden; color:#11866f; }
.premium-metric .list-icon { grid-column:1; grid-row:1; width:34px; height:34px; border-radius:50%; background:#dff4ed; color:inherit; }
.premium-metric .list-icon svg { width:20px; height:20px; }
.premium-metric strong { grid-column:2; grid-row:1; min-height:0; font-size:12px; line-height:1.3; color:var(--text); font-weight:650; }
.admin-stat-grid .premium-metric .stat-number { grid-column:1/-1; grid-row:2; font-size:29px; font-weight:750; line-height:1.05; color:var(--text); }
.premium-comparison { grid-column:1/-1; grid-row:3; font-size:11px; line-height:1.3; color:var(--muted); font-weight:500; }
.premium-trend { grid-column:1/-1; grid-row:4; width:100%; height:24px; overflow:visible; }
.premium-trend-empty { grid-column:1/-1; grid-row:4; font-size:11px; line-height:1.3; color:var(--muted); }
.premium-metric[data-metric=guestsInside],.premium-metric[data-metric=exits] { background:linear-gradient(130deg,#fcfeff,#eaf4fc); color:#2687bd; }
.premium-metric[data-metric=guestsInside] .list-icon,.premium-metric[data-metric=exits] .list-icon { background:#dceffc; color:inherit; }
.premium-metric[data-metric=uniqueEntrants] { background:linear-gradient(130deg,#fff,#f4eeff); color:#7952b5; }
.premium-metric[data-metric=uniqueEntrants] .list-icon { background:#ede4fc; color:inherit; }
.admin-stat-grid.premium-traffic-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.admin-stat-grid.premium-traffic-stats .premium-metric { grid-template-columns:24px minmax(0,1fr); padding:10px; gap:3px 4px; min-height:138px; }
.premium-traffic-stats .premium-metric .list-icon { width:28px; height:30px; }
.premium-traffic-stats .premium-metric .list-icon svg { width:18px; height:18px; }
.premium-traffic-stats .premium-metric strong { font-size:11px; min-height:43px; line-height:1.2; }
.premium-traffic-stats .premium-metric .stat-number { font-size:27px; }
.premium-traffic-stats .premium-comparison { font-size:10px; }
.premium-traffic-stats .premium-trend-empty { font-size:10px; }
.asset-overview>h2,.card-title { font-size:18px; }
.asset-stat-grid .access-stat { min-height:58px; padding:8px; gap:3px; }
.asset-stat-grid .stat-number { font-size:23px; line-height:1.1; }
.company-visual h2 { font-size:19px; }
.action-grid { gap:8px; }
.action-card { min-height:84px; padding:12px 6px; gap:8px; font-size:12px; }
.action-card svg { width:30px; height:30px; }
/* Compact compound fields keep a full 44px interactive area and 16px input text. */
.field-stack,.premium-form-group { gap:12px; }
.field.premium-field { padding:5px 12px 0 46px; gap:0; border-color:var(--line); background:#ffffffdb; box-shadow:none; }
.field.premium-field:not(:has(>.premium-field-icon)) { padding-left:12px; }
.premium-field-icon { left:12px; top:17px; width:24px; height:24px; color:#46717c; }
.premium-field-icon svg { width:20px; height:20px; }
.content .field.premium-field>label,.content .field.premium-field>span { font-size:11px; line-height:1.3; }
.content .field.premium-field input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.content .field.premium-field select { min-height:40px; font-size:16px; line-height:1.3; padding:4px 0 8px; }
.content .field.premium-field select { padding-right:22px; }
.content .field.premium-field textarea { font-size:16px; min-height:76px; padding-top:5px; }
.premium-field p { font-size:11px; line-height:1.45; margin:0 0 8px; }
.premium-select-arrow { bottom:12px; }
.field.premium-field:focus-within { box-shadow:0 0 0 3px #007c8312; border-color:#007c83; }
.premium-form-section { font-size:18px; margin-top:8px; gap:10px; padding:0; }
.premium-form-section>svg { width:32px; height:32px; padding:6px; }
.premium-form-intro { padding:12px; gap:12px; margin:0; box-shadow:0 3px 12px #17344006; }
.premium-form-intro>i { width:34px; height:36px; }
.premium-form-intro>i svg { width:21px; height:21px; }
.premium-form-intro strong { font-size:14px; }
.premium-form-intro p { font-size:12px; line-height:1.5; margin-top:5px; }
.primary-button,.secondary-button,.danger-button { min-height:44px; padding:10px 14px; font-size:14px; gap:7px; line-height:1.35; border-radius:8px; }
.primary-button { background:linear-gradient(115deg,#006b73,#007c83); box-shadow:0 3px 10px #007c8314; }
.secondary-button { background:linear-gradient(120deg,#fff,#eaf4fc); border-color:var(--line); }
.primary-button svg,.secondary-button svg,.danger-button svg { width:20px; height:20px; flex-shrink:0; }
.button-row { gap:8px; }
.check-row { padding:8px 0; gap:10px; }
.check-row small { font-size:12px; }
.field-stack>.soft-panel { padding:12px; }
.premium-form-actions { display:grid; grid-template-columns:1fr 2fr; gap:8px; }
.premium-form-actions button { min-height:46px; }
.asset-card-header { min-height:162px; grid-template-columns:minmax(0,1fr); gap:8px; padding:18px var(--page-gutter); background:transparent; }
.premium-asset-symbol { display:none; }
.premium-asset-identity { padding-right:44px; }
.asset-card-header h2 { font-size:26px; }
.asset-card-header p { font-size:15px; }
.premium-asset-status { grid-column:1; padding:4px 10px; font-size:11px; }
.asset-card-management { top:auto; bottom:20px; right:16px; }
.asset-card-management>summary { min-width:44px; min-height:44px; }
.premium-asset-facts,.asset-extra-fields { background:#fff; grid-template-columns:minmax(0,1.12fr) minmax(0,1fr); gap:0 10px; }
.premium-asset-facts { padding-top:8px; position:relative; }
.premium-asset-facts::before { content:''; position:absolute; top:-14px; left:calc(-1 * var(--page-gutter)); right:calc(-1 * var(--page-gutter)); height:24px; border-radius:24px 24px 0 0; background:#fff; }
.premium-asset-facts dt,.premium-asset-facts dd,.asset-extra-fields dt,.asset-extra-fields dd { min-height:44px; padding:8px 0; font-size:13px; line-height:1.4; }
.premium-asset-facts dt,.asset-extra-fields dt { gap:8px; }
.premium-asset-facts dt i,.asset-extra-fields dt i { width:28px; height:28px; }
.premium-asset-facts dt svg,.asset-extra-fields dt svg { width:18px; height:18px; }
.asset-primary-actions { margin:16px 0 12px; gap:8px; }
.asset-primary-actions button { min-height:44px; padding:9px 7px; font-size:13px; gap:6px; }
.asset-primary-actions svg { width:19px; height:19px; }
.premium-asset-extra { margin-top:12px; border-top:1px solid var(--line); padding-top:8px; }
.premium-asset-extra>summary { min-height:44px; display:flex; align-items:center; gap:10px; font-size:15px; font-weight:650; cursor:pointer; }
.premium-asset-extra>summary svg { width:20px; color:var(--primary); }
.premium-asset-extra dl { font-size:12px; overflow-wrap:anywhere; }
.asset-row,.people-result,.ops-person,.visit-list-row,.profile-row { padding:12px; box-shadow:var(--shadow-soft); }
.asset-row strong,.people-result strong { font-size:14px; }
.ops-filters,.visit-filters,[data-work-filter-panel] { padding:12px; gap:10px; }
.status-chip,.chip { padding:4px 9px; font-size:11px; }
dialog { max-width:min(94vw,620px); max-height:calc(100dvh - 32px); padding:18px; border-radius:8px; }
dialog .field input,dialog .field select,dialog .field textarea { font-size:16px; min-height:44px; }
.empty-state,.elevator-empty { padding:28px 16px; box-shadow:none; }
.message,.asset-notice,.toast,.ops-result { font-size:13px; line-height:1.5; }
.bottom-tabs { height:calc(64px + env(safe-area-inset-bottom,0px)); padding-top:5px; border-radius:20px 20px 0 0; box-shadow:0 -3px 18px #1734400c; }
.tab-button { min-height:44px; gap:3px; font-size:10px; }
.tab-button svg { width:22px; height:22px; }
.tab-button.is-active>svg { width:38px; height:30px; padding:4px 8px; }
.qr-tab-button>svg,.qr-tab-button.is-active>svg { width:42px; height:42px; padding:10px; margin-top:-11px; border-radius:50%; }
.ops-drawer nav button { min-height:44px; padding:10px; }
.ops-drawer nav svg { width:20px; height:20px; }
.ops-drawer-head { padding:14px 0; }
.test-account-panel { gap:6px; }
.content>.test-account-panel:last-child { margin-top:20px; }
.test-account-panel>div>strong { font-size:12px; }
.test-account-panel .link-button { min-height:44px; }
.test-account-panel>.premium-push-prompt { display:grid; grid-template-columns:minmax(0,1fr) auto 44px; align-items:center; gap:6px; padding:8px 10px; background:#eaf4fc; border-radius:8px; }
.premium-push-prompt span { flex:1; font-size:12px; }
.premium-push-prompt .primary-button { width:auto; min-width:0; min-height:44px; padding:7px; font-size:12px; box-shadow:none; }
.premium-push-prompt .icon-button { box-shadow:none; }
.premium-push-prompt[hidden],.premium-elevator-summary[hidden] { display:none; }
.club-media-panel { border:1px dashed #b7ccd2; border-radius:8px; padding:12px; background:#f4f9fa; }
.club-media-heading { display:flex; gap:10px; align-items:center; margin:0 0 8px; font-size:16px; }
.club-media-heading svg { width:22px; height:22px; color:var(--primary); }
.club-media-panel p { font-size:13px; margin:8px 0; color:var(--muted); }
.club-media-panel input { width:100%; min-height:44px; font-size:14px; }
.club-media-panel .club-detail-image { width:100%; max-height:160px; object-fit:contain; }
.elevator-card { grid-template-columns:64px minmax(0,1fr); padding:10px; gap:10px; }
.elevator-card header { padding:8px 4px; gap:5px; }
.elevator-card header h2 { font-size:18px; }
.elevator-card header .subtle { font-size:10px; }
.elevator-body { grid-template-columns:24px minmax(0,1fr); gap:10px; }
.elevator-shaft { height:96px; }
.elevator-card dl { gap:6px; }
.elevator-card dt { font-size:10px; }
.elevator-card dd { font-size:14px; }
.elevator-card footer { font-size:10px; }
.elevator-toolbar { margin:10px 0; }
.premium-elevator-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:16px 0; padding:12px 0; border-bottom:1px solid var(--line); }
.premium-elevator-summary dt { font-size:10px; color:var(--muted); }
.premium-elevator-summary dd { margin:6px 0 0; font-size:24px; font-weight:700; }
.premium-elevator-summary[data-stale=true] { color:var(--muted); }
.premium-elevator-empty-icon { width:44px; height:44px; }
.login-hero { min-height:220px; }
.login-panel { padding:18px 0; }
@media(max-width:359px) {
  .title-row,.title-row:has(.ops-menu-button) { gap:2px; }
  .title-row h1,.title-row .screen-title,.title-row:has(.ops-menu-button) .screen-title { font-size:16px; }
  .title-row .mistral-header-logo,.title-row:has(.ops-menu-button) .mistral-header-logo { width:28px; max-width:28px; }
  .title-row .brand-wordmark.is-compact .brand-wordmark-my { font-size:16px; }
  .title-row .brand-wordmark.is-compact .brand-wordmark-mistral { width:70px; max-width:70px; flex-basis:70px; }
  .content .premium-section-heading { font-size:16px; gap:6px; }
  .premium-section-heading>i { width:28px; }
  .premium-visitor-stats .premium-metric { grid-template-columns:28px minmax(0,1fr); padding:10px; gap:5px; }
  .admin-stat-grid.premium-traffic-stats .premium-metric { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto auto 24px; min-height:158px; padding:9px; }
  .premium-traffic-stats .premium-metric .list-icon { grid-row:1; }
  .premium-traffic-stats .premium-metric strong { grid-column:1; grid-row:2; min-height:43px; }
  .premium-traffic-stats .premium-metric .stat-number { grid-row:3; }
  .premium-traffic-stats .premium-comparison { grid-row:4; }
  .premium-traffic-stats .premium-trend,.premium-traffic-stats .premium-trend-empty { grid-row:5; }
  .asset-primary-actions button { font-size:12px; gap:4px; }
}
@media(min-width:700px) {
  :root { --page-gutter:28px; }
  .content:has(.premium-hero),.content:has(.asset-card-header) { background-size:100% 300px,100% 300px,auto 240px,auto; }
  .premium-hero { min-height:220px; padding:28px; }
  .premium-hero h2 { font-size:32px; max-width:360px; }
  .title-row h1,.title-row .screen-title,.title-row:has(.ops-menu-button) .screen-title { font-size:22px; }
  .admin-stat-grid .premium-metric { min-height:138px; padding:14px; }
  .premium-metric strong { font-size:14px; }
  .premium-traffic-stats .premium-metric { display:grid; }
  .premium-traffic-stats .premium-metric strong { font-size:13px; }
  .asset-card-header { min-height:220px; padding:28px; }
  .bottom-tabs { padding-inline:15%; }
}
@media(prefers-reduced-motion:reduce) { .premium-trend,.premium-hero,.premium-metric { animation:none; transition:none; } }
@media print { .content,.content:has(.premium-hero),.content:has(.asset-card-header) { background:white; } }
/* Editing actions remain below the fields, including with the mobile keyboard. */
[data-form="edit-independent-section"] > .button-row,
[data-form="admin-independent-section"] > .button-row {
  position:static; padding-bottom:env(safe-area-inset-bottom,0px);
}
[data-form="edit-independent-section"] > .button-row > .primary-button,
[data-form="admin-independent-section"] > .button-row > .primary-button {
  min-height:46px; border-radius:12px; background:#007c83; color:#fff;
  position:static; flex:1; white-space:normal;
}
:root .visit-mode {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border:0;padding:0;margin:0 0 12px;min-width:0;}
:root .visit-mode label {display:flex;align-items:center;gap:8px;min-height:48px;padding:10px;border:1px solid #DFEAED;border-radius:10px;font-size:14px;color:#173440;}
:root .visit-mode label:has(input:checked) {background:#E7F6F3;border-color:#007C83;}
:root .visit-mode input {width:18px;height:18px;min-height:0;flex:none;accent-color:#007C83;}
:root [data-visit-detail] .visit-detail-summary {padding:0;background:none;border:0;box-shadow:none;}
:root .visit-detail-summary header {display:flex;align-items:center;justify-content:space-between;gap:12px;}
:root .visit-detail-summary h2 {font-size:21px;margin:0;overflow-wrap:anywhere;}
:root .visit-detail-summary h3,:root .visit-approval-title,:root .visit-history h3 {font-size:17px;margin:18px 0 8px;color:#173440;}
:root .visit-detail-summary .notice-fields,:root .visit-receipt .notice-fields {display:grid;grid-template-columns:minmax(90px,38%) minmax(0,1fr);gap:0;margin:0;}
:root .visit-detail-summary .notice-fields dt,:root .visit-detail-summary .notice-fields dd,:root .visit-receipt .notice-fields dt,:root .visit-receipt .notice-fields dd {margin:0;padding:9px 0;min-height:0;border-bottom:1px solid #DFEAED;font-size:14px;line-height:1.4;overflow-wrap:anywhere;}
:root .visit-detail-summary .notice-fields dt,:root .visit-receipt .notice-fields dt {padding-right:12px;color:#607681;}
:root .visit-detail-summary .notice-fields dd,:root .visit-receipt .notice-fields dd {color:#173440;}
:root [data-invitation-open] {margin-top:12px;}
:root .visit-receipt .message-preview {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.55;user-select:text;}
:root .visit-receipt .button-row {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
:root .visit-receipt .button-row button {min-height:44px;padding:8px;}
[data-office-results] .people-results {
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
