/* Layout adapters for the existing PHP views. Behaviour stays in those views. */
html { height: 100%; }
html { overflow-x: clip; scroll-padding-top: 84px; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
body:not(.db-body):not(.hub-ui-media):not(.hub-ui-screen-view) { overflow-x: clip !important; }
body::before, body::after { display: none; }
.hub-ui-header { width: 100%; min-height: 68px; height: 68px; flex-shrink: 0; box-shadow: none; }
body .hub-ui-header { position: sticky; top: 0; z-index: 100; }
.hub-ui-header .ui-brand { display: flex; margin: 0; padding: 0; background: none; border: 0; font-size: 16px; }
.hub-ui-header .ui-brand img { width: 29px; height: 29px; }
.hub-ui-header .account-button { min-height: 34px; border: 0; box-shadow: none; color: var(--text); background: transparent; }
.hub-ui-header button:hover { transform: none; box-shadow: none; }
body .icon-button { min-height: 34px; min-width: 34px; width: 34px; height: 34px; padding: 0; font-weight: 400; box-shadow: none; }
body .hub-ui-header .theme-switch .icon-button { min-height: 29px; min-width: 31px; width: 31px; height: 29px; }
body .toolbar>select { width: auto; min-width: 120px; }
body .toolbar .search input[type=search], body .toolbar .fh-search-field input[type=search] { border: 0; width: 100%; min-height: 0; padding: 0; background: transparent; }
body .fh-search-field input::placeholder { color: var(--muted); }
.hub-ui-header .mobile-menu { position: absolute; top: 68px; right: 16px; width: 220px; padding: 12px; border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); background: var(--surface); }
.hub-ui-header .mobile-menu a { display: block; padding: 10px; font-size: 13px; }
body .wrap, body .wrap-narrow, body .hub-admin-shell, body .fh-modern-admin-page .page,
body.fh-modern-admin-page .page, body .fh-privacy-shell { width: 100%; max-width: none; margin: 0; padding: 32px; }
body.hub-ui-portal-entry .wrap.wrap-narrow { width: min(1280px,100%); max-width: 1280px; margin-inline: auto; }
body .topbar, body .hub-admin-header { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; margin: 0 0 28px; min-height: 0; }
body .topbar .brand { display: block; white-space: normal; }
body .topbar h1, body .hub-admin-header h1, body .media-title h1, body .vs3-header h1 { font-size: 28px; font-weight: 550; line-height: 1.25; text-transform: none; }
body .topbar p, body .hub-admin-header p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.hub-admin-kicker, .fh-admin-logo, .fh-section-kicker, .fh-eyebrow, .fh-section-count { display: none; }
body .section-title { font-size: 16px; font-weight: 550; text-transform: none; color: var(--text); margin-bottom: 14px; }
body .grid { gap: 12px; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); }
body .card { min-height: 100px; border: 1.5px solid var(--border); border-radius: 5px; background: var(--surface); box-shadow: none; padding: 18px; }
body .card .accent, body .card::before { display: none; }
body .card:hover { transform: none; box-shadow: none; border-color: var(--accent); }
body .card h3 { font-size: 14px; font-weight: 550; margin: 0 0 9px; }
body .card p { font-size: 12px; line-height: 1.6; color: var(--muted); }
body .badge { padding: 0; margin-top: 10px; border: 0; background: transparent; font-size: 11px; color: var(--muted); }
body .btn, body .hub-btn, body .mini-btn { border-radius: 4px; min-height: 38px; background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong); box-shadow: none; font-size: 13px; font-weight: 500; }
body .btn:hover, body .hub-btn:hover, body .mini-btn:hover { box-shadow: none; transform: none; background: var(--hover); }
body .btn.primary, body .hub-btn-primary, body button.primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: none; }
[data-theme=dark] body .btn.primary, [data-theme=dark] body .hub-btn-primary, [data-theme=dark] body button.primary { color: #172c23; }
body .note, body .hub-security-note { padding: 14px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; color: var(--muted); }
body .hub-stat-grid { display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 24px; }
body .hub-stat { padding: 0; border: 0; background: none; box-shadow: none; display: flex; flex-direction: row-reverse; gap: 6px; align-items: baseline; min-height: 0; }
body .hub-stat span { font-size: 12px; text-transform: none; color: var(--muted); }
body .hub-stat strong { font-size: 14px; color: var(--text); font-weight: 600; }
body .hub-panel, body .box { border: 0; border-radius: 0; box-shadow: none; padding: 20px 0; background: none; }
body .hub-tablet-card { padding: 20px 0; border: 0; border-top: 1px solid var(--border); background: none; border-radius: 0; box-shadow: none; }
body .hub-tablet-block { background: none; border: 0; border-radius: 0; padding: 14px 0; }
body .hub-tablet-list { gap: 0; }
body .hub-tablet-head { border-bottom: 0; }
body .hub-create-panel { border-block: 1px solid var(--border); padding: 0; margin: 16px 0 24px; }
body .hub-create-panel>summary { padding: 13px 0; font-weight: 500; }
body .hub-create-panel>summary small { display: none; }
body .hub-create-panel[open] .hub-form-grid { padding: 20px 0; }
body .hub-permission-fieldset { background: none; border-radius: 0; border: 0; border-top: 1px solid var(--border); padding: 14px 0; }
body .hub-check, body .perm { border: 0; background: none; padding: 8px 0; border-radius: 0; font-size: 13px; }
body .hub-form-grid label>span,body .hub-permission-fieldset label>span { text-transform: none; font-size: 12px; font-weight: 500; }
body .fiha-tablet-module-check { text-transform: none; background: var(--surface); }
body .fiha-tablet-module-check span { text-transform: none; }
body .fiha-tablet-module-check strong { font-size: 13px; font-weight: 550; color: var(--text); }
body .fiha-tablet-module-check small { font-weight: 400; color: var(--muted); opacity: 1; }
body .fiha-tablet-module-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
body .hub-badge { font-weight: 500; border-radius: 4px; }
body .hub-setup-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
body .hub-setup-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 4px; box-shadow: none; min-height: 94px; padding: 18px; }
body .hub-setup-card:hover { transform: none; box-shadow: none; background: var(--hover); border-color: var(--accent); }
body .hub-setup-card h2 { font-size: 15px; font-weight: 550; }
body .hub-setup-icon { color: var(--accent); background: none; border: 0; border-radius: 0; }
body table { border-collapse: collapse; width: 100%; color: var(--text); background: var(--surface); }
body th { color: var(--muted); background: var(--subtle); font-size: 11px; text-transform: none; font-weight: 500; }
body th, body td { border-color: var(--border); padding: 12px 16px; }
body .table-wrap { border: 0; border-block: 1px solid var(--border); border-radius: 0; }
body h2 { font-size: 17px; font-weight: 550; }
body h3 { font-size: 15px; font-weight: 550; }
body input:not([type=checkbox]):not([type=range]), body select, body textarea { background: var(--surface); color: var(--text); border-color: var(--border-strong); border-radius: 4px; box-shadow: none; }
body input[type=checkbox], body input[type=range] { accent-color: var(--accent); }
body .button, body .search, body .fh-search-field, body .device { border-width: 1.5px; }
body button, body .button, body .btn, body .hub-btn { transition: background-color .12s, border-color .12s, color .12s; }
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), body select, body textarea { border-width: 1.5px; }
body .search input:not([type=checkbox]), body .fh-search-field input[type=search] { border: 0; }
body button:not(:disabled):hover, body a.button:hover, body a.btn:hover { outline: 2px solid var(--accent); outline-offset: -2px; transform: none; }
body button:focus-visible, body a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
body .permission-grid .check { border: 1px solid var(--border); border-radius: 4px; padding: 8px; }
body .permission-grid .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ui-dialog { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); padding: 0; width: min(720px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); border-radius: 6px; box-shadow: var(--shadow); }
.ui-dialog::backdrop { background: #0008; }
.ui-dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.ui-dialog .dialog-head h2 { font-size: 18px; }
.ui-dialog .dialog-body { padding: 20px 22px; max-height: calc(100dvh - 250px); overflow: auto; }
.ui-dialog .dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.ui-dialog label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); min-width: 0; }
.ui-dialog .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.ui-dialog .permission-fieldset { grid-column: 1/-1; border: 0; border-top: 1px solid var(--border); padding: 16px 0 0; margin: 0; }
.ui-dialog .permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 18px; }
.ui-dialog .check { display: flex; flex-direction: row; align-items: flex-start; gap: 9px; color: var(--text); line-height: 1.55; padding: 6px 0; }
.ui-dialog .check input { flex-shrink: 0; margin: 3px 0 0; width: 16px; height: 16px; }
.ui-delete-user { padding: 0 22px 18px; }
body .data-table { min-width: 0; font-size: 13px; }
body .data-table td { height: 65px; }
.department-mobile-key { display: none; }
.hub-message { padding: 12px 15px; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.hub-message-ok { color: var(--success); border-color: var(--success); }
.hub-message-error { color: var(--danger); border-color: var(--danger); }
/* Dashboard keeps its real favorites, permission checks and live feeds. */
body.fh-hub-dashboard .fh-dashboard-shell { display: block; }
body .fh-main { margin: 0; width: 100%; max-width: none; min-height: 0; padding: 32px; }
body .fh-main-header, body .fh-dashboard-section, body .fh-dashboard-footer, body .fh-tablet-banner { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
body .fh-main-header { margin-bottom: 28px; }
body .fh-main-header h1 { font-size: 28px; font-weight: 550; }
body .fh-header-subline { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
body .fh-dashboard-section { margin: 28px 0; }
body .fh-section-head { margin-bottom: 14px; }
body .fh-section-head h2 { font-size: 17px; font-weight: 550; }
body .fh-app-grid, body .fh-favorites-grid { grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
body .fh-app-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 5px; box-shadow: none; min-height: 138px; }
body .fh-app-card::before, body .fh-app-card::after { display: none; }
body .fh-app-card:hover { transform: none; box-shadow: none; background: var(--hover); border-color: var(--accent); }
body .fh-app-card.is-compact { min-height: 138px; }
body .fh-app-card-link { padding: 18px; min-height: 138px; height: 100%; display: grid; grid-template-columns: 20px minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 12px 10px; }
body .fh-app-card-topline { justify-content: flex-start; margin: 0; grid-column: 1; grid-row: 1; align-self: start; }
body .fh-app-card-copy { grid-column: 2; grid-row: 1; margin: 0; padding-right: 20px; }
body .fh-app-icon { color: var(--accent); background: none; border: 0; border-radius: 0; width: 20px; height: 20px; }
body .fh-app-card-copy h3 { font-size: 14px; font-weight: 550; margin: 0; overflow-wrap: anywhere; }
body .fh-app-icon svg { width: 20px; height: 20px; }
body .fh-app-card-copy p { font-size: 12px; line-height: 1.6; margin: 7px 0 0; color: var(--muted); min-height: 0; display: block; overflow: visible; }
body .fh-app-card-footer { grid-column: 1/-1; align-self: end; margin-top: auto; padding-top: 0; font-size: 11px; color: var(--muted); }
body .fh-favorite-button { width: 30px; height: 30px; border: 0; background: none; box-shadow: none; top: 10px; right: 10px; color: var(--muted); border-radius: 4px; }
body .fh-favorite-button.is-active { color: var(--warning); background: none; }
body .fh-favorite-button.is-active svg { fill: var(--warning-soft); }
body .fh-favorite-drag { position: absolute; right: 42px; bottom: 9px; z-index: 2; cursor: grab; touch-action: none; color: var(--muted); background: transparent; border: 0; }
body .fh-favorite-drag:active { cursor: grabbing; }
body .fh-favorite-drag svg { width: 17px; height: 17px; }
body .fh-favorite-ghost { opacity: .35; border-color: var(--accent); }
body .fh-favorite-chosen { border-color: var(--accent); }
body .fh-favorites-grid[aria-busy=true] .fh-favorite-drag { cursor: wait; }
.hub-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body .fh-dashboard-footer { padding: 18px 0 0; margin-top: 40px; color: var(--muted); font-size: 11px; letter-spacing: 0; }
body .fh-search-field { padding: 0 12px; border-radius: 4px; min-height: 39px; width: 340px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: none; }
body .fh-search-field input { background: transparent; border: 0; box-shadow: none; padding: 9px 0; }
body .fh-visitor-kpi-grid { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; padding: 18px 0; border-block: 1px solid var(--border); }
body .fh-visitor-kpi-card { width: auto; min-width: 200px; flex: 1; padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; }
body .fh-visitor-kpi-card::before { display: none; }
body .fh-visitor-kpi-card:hover { transform: none; background: none; }
body .fh-visitor-kpi-card strong { font-size: 26px; font-weight: 500; grid-row: 1/3; }
body .fh-visitor-kpi-card span { font-size: 12px; text-transform: none; }
body .fh-visitor-kpi-card small, body .fh-visitor-kpi-live { display: none; }
body .fh-visitor-detail-dialog { border-radius: 6px; background: var(--surface); color: var(--text); }
/* Safe centering grows with long forms instead of clipping short viewports. */
body.fh-modern-auth { display: block; padding: 0; min-height: 100dvh; background: var(--bg) !important; }
body.fh-modern-auth .auth-stage { display: flex; align-items: center; justify-content: center; min-height: calc(100dvh - 68px); padding: 32px 24px; }
body.fh-modern-auth .login-shell { width: min(460px,100%); max-width: none; display: block; margin: 0; border: 0; background: none; border-radius: 0; box-shadow: none; overflow: visible; min-height: 0; animation: none; backdrop-filter: none; }
body.fh-modern-auth .login-panel { padding: 0; background: none; border: 0; }
body.fh-modern-auth .login-box { padding: 0; width: 100%; max-width: none; }
body.fh-modern-auth .auth-identity { display: flex; align-items: center; flex-direction: column; gap: 10px; margin: 0 0 16px; text-align: center; }
body.fh-modern-auth .auth-identity img { display: block; width: 96px; height: 96px; object-fit: contain; }
body.fh-modern-auth .auth-identity strong { font-size: 22px; font-weight: 500; }
body.fh-modern-auth .login-box h1 { font-size: 28px; font-weight: 550; color: var(--text); text-transform: none; }
body.fh-modern-auth .login-box h1,body.fh-modern-auth .login-box .subtitle { text-align: center; }
body.fh-modern-auth .login-box .subtitle { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
body.fh-modern-auth .login-kicker { display: none; }
body.fh-modern-auth .login-form { display: block; margin-top: 22px; }
body.fh-modern-auth .login-field { margin: 0 0 14px; }
body.fh-modern-auth .login-field label { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
body.fh-modern-auth .login-field input { min-height: 46px; margin-top: 7px; padding: 10px 12px; width: 100%; font-size: 15px; }
body.fh-modern-auth .login-actions { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; }
body.fh-modern-auth .login-actions button { background: var(--accent); color: white; border: 1px solid var(--accent); border-radius: 4px; min-height: 46px; box-shadow: none; font-weight: 500; font-size: 14px; }
[data-theme=dark] body.fh-modern-auth .login-actions button { color: #172c23; }
body.fh-modern-auth .login-actions .btn,body.fh-modern-auth .login-actions a { border: 0; background: none; color: var(--accent); padding: 5px 0; min-height: 30px; box-shadow: none; font-size: 13px; }
body.fh-modern-auth .login-secondary-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
body.fh-modern-auth .login-secondary-actions a { text-align: left; width: auto; }
body.fh-modern-auth .login-secondary-actions a:last-child { text-align: right; }
body.fh-modern-auth .footer { color: var(--muted); font-size: 11px; }
body.fh-modern-auth .fh-privacy-check { padding: 12px 0; border: 0; background: none; font-size: 12px; }
.brand-panel, .fh-mobile-login-logo { display: none; }
body .fh-privacy-page-shell { width: 100%; max-width: none; margin: 0; padding: 32px; }
body .fh-privacy-page-head { padding: 0 0 24px; background: none; border: 0; border-radius: 0; display: flex; align-items: flex-start; flex-wrap: wrap; }
body .fh-privacy-page-head>img { display: none; }
body .fh-privacy-page-head>div { min-width: 0; flex: 1; }
body .fh-privacy-page-head h1 { font-size: 28px; font-weight: 550; overflow-wrap: anywhere; }
body .fh-privacy-page-content { padding: 0; background: none; border: 0; border-radius: 0; overflow-wrap: anywhere; }
body .fh-privacy-backdrop { background: #0007; }
body .fh-privacy-actions button { background: var(--accent); color: white; font-weight: 500; }
[data-theme=dark] body .fh-privacy-actions button { color: #172c23; }
/* Database stays viewport-bound, including on narrow phones. */
body.db-body { grid-template-rows: 68px auto minmax(0,1fr); font-family: "Segoe UI",Arial,sans-serif; color-scheme: inherit; }
body.db-body .hub-ui-header { position: relative; }
body.db-body .db-sourcebar { background: var(--bg); }
body.db-body .db-content { padding: 22px 24px 14px; }
body.db-body .db-title-row h1 { font-size: 21px; font-weight: 550; }
body.db-body #db-grid td { background: var(--surface); color: var(--text); }
body.db-body #db-grid th { background: var(--subtle); color: var(--muted); }
body.db-body #db-grid .db-key { background: var(--accent-soft); color: var(--accent); }
body.db-body #db-grid th.db-key { background: var(--accent-soft); }
body.db-body #db-grid tbody tr:hover td { background: var(--hover); }
/* Media transport and libraries retain their application-specific controls. */
body .media-shell { display: block; min-height: 0; }
body.hub-ui-media { display: grid; grid-template-rows: 68px minmax(0,1fr); height: 100dvh; overflow: hidden !important; }
body.hub-ui-media .media-shell { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); height: auto !important; overflow: hidden !important; }
body.hub-ui-media .media-sidebar { height: auto !important; min-height: 0 !important; position: static !important; }
body.hub-ui-media .media-main { height: auto !important; min-height: 0; padding-bottom: 112px; }
body.hub-ui-media .r83-bottom-player { left: 0 !important; }
body.hub-ui-media .r83-dashboard-hero { display: none; }
body.hub-ui-media .dot, body.hub-ui-media .sidebar-state-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
body.hub-ui-media .dot.online, body.hub-ui-media .sidebar-state-dot.online { background: var(--success); }
body.hub-ui-media .dot.offline, body.hub-ui-media .sidebar-state-dot.offline { background: var(--danger); }
body.hub-ui-media .dot.warn { background: var(--warning); }
body.hub-ui-media .r83-control.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); font-size: 20px; opacity: 1; }
[data-theme=dark] body.hub-ui-media .r83-control.primary { color: #172c23; }
body.hub-ui-media .r83-control.primary:hover:not(:disabled) { background: var(--accent); color: #fff; outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme=dark] body.hub-ui-media .r83-control.primary:hover:not(:disabled) { color: #172c23; }
body.hub-ui-media .r83-control:disabled { opacity: .45; cursor: not-allowed; }
body.hub-ui-media .r83-dashboard-hero h2 { font-size: 22px; }
body.hub-ui-screen-view { display: grid; grid-template-rows: 68px auto minmax(0,1fr); height: 100dvh; overflow: hidden; }
body.hub-ui-screen-view iframe { height: 100%; min-height: 0; }
body.hub-ui-screen-view .screen-topbar { min-height: 54px; height: auto; gap: 12px; flex-wrap: wrap; padding: 8px 16px; }
body.hub-ui-screen-view .screen-title { font-size: 16px; overflow-wrap: anywhere; }
body.hub-ui-screen-view .screen-actions a { font-size: 12px; padding: 6px 10px; }
body .media-sidebar { position: static; height: auto; width: auto; padding: 0 32px; border: 0; border-bottom: 1px solid var(--border); background: none; }
body .media-sidebar .brand-block, body .media-sidebar .sidebar-brand, body .media-sidebar .sidebar-info, body .media-sidebar .sidebar-hub, body .media-sidebar .sidebar-footer { display: none; }
body .media-nav { display: flex; overflow: auto; gap: 26px; }
body .media-nav .nav-item { display: flex; padding: 13px 0; border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
body .media-nav .nav-item.active { border-bottom-color: var(--accent); background: none; }
body .media-main { padding: 28px 32px; background: none; }
body .media-title h1 { font-size: 28px; font-weight: 550; }
body .now-title { font-size: 26px; line-height: 1.25; font-weight: 550; }
body .cover-monogram { font-size: 24px; }
body .media-top { min-height: 0; margin-bottom: 24px; }
body .panel-head h2, body .panel-head h3 { font-size: 16px; font-weight: 550; }
body .vs3-shell { width: 100%; max-width: none; padding: 32px; margin: 0; }
body .vs3-main, body .vs3-wrap { max-width: none; }
body .vs3-kicker { display: none; }
body .vs3-kpis { gap: 0; border-block: 1px solid var(--border); padding: 18px 0; }
body .vs3-kpis article { border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0 18px; }
body .vs3-kpis article:first-child { padding-left: 0; }
body .vs3-kpis strong { font-size: 26px; font-weight: 500; }
body.tablet-auth-body,body.hub-ui-entry,body.center-shell { display: block; padding: 0; background: var(--bg); }
body .tablet-login-shell,body .tablet-auth-shell { width: min(440px,calc(100% - 32px)); display: block; margin: 40px auto; border: 0; box-shadow: none; background: none; overflow: visible; }
body .tablet-brand-mark,body .tablet-login-head .fh-kiosk-logo-frame,body .tablet-brand-panel .fh-kiosk-logo-frame { display: none; }
body .tablet-brand-panel { padding: 0; background: none; }
body .tablet-brand-panel h1,body .tablet-login-head h1 { font-size: 28px; font-weight: 550; }
body .tablet-auth-card,body .tablet-pin-card { padding: 20px 0; border: 0; background: none; box-shadow: none; }
body .tablet-keypad button { font-weight: 500; border-radius: 4px; background: var(--surface); }
body .tablet-pin-dots span { border-radius: 50%; transition: none; }
body .tablet-pin-dots span.filled { background-color: var(--accent); border-color: var(--accent); box-shadow: none; }
body .fiha-module-shell { width: 100%; max-width: none; margin: 0; padding: 32px; }
body .fiha-module-head img { display: none; }
body .fiha-module-head h1 { font-size: 28px; font-weight: 550; }
body .fiha-module-card { border: 1.5px solid var(--border); border-radius: 5px; min-height: 145px; padding: 18px; background: var(--surface); }
body .fiha-module-card:hover { transform: none; }
body .focus-card,body.hub-ui-entry .box { width: min(520px,calc(100% - 32px)); padding: 0; margin: 48px auto; background: none; border: 0; box-shadow: none; }
body .focus-card h1 { font-size: 28px; }
@media(min-width:701px) and (max-height:760px) {
  body.fh-modern-auth .auth-stage { padding: 16px 24px; }
}
@media(max-width:900px) {
  body .hub-ui-header { gap: 24px; }
  body .hub-ui-header .header-actions { gap: 12px; }
  .ui-users-table .user-access { display: none; }
}
@media(max-width:700px) {
  body .hub-ui-header { height: 60px; min-height: 60px; padding: 0 16px; gap: 12px; }
  .hub-ui-header .ui-brand { font-size: 14px; gap: 7px; }
  .hub-ui-header .ui-brand img { width: 24px; height: 24px; }
  .hub-ui-header .primary-nav, .hub-ui-header .account-wrap { display: none; }
  .hub-ui-header .header-actions { gap: 8px; }
  .hub-ui-header .mobile-menu-button { display: inline-flex; }
  .hub-ui-header .mobile-menu { top: 60px; }
  body .wrap, body .wrap-narrow, body .hub-admin-shell, body.fh-modern-admin-page .page, body .fh-main, body .fh-privacy-shell, body .vs3-shell { padding: 24px 16px; }
  body .fh-privacy-page-shell { padding: 24px 16px; }
  body .fh-privacy-page-head h1 { font-size: 24px; }
  body .topbar h1, body .hub-admin-header h1, body .fh-main-header h1, body .media-title h1 { font-size: 24px; }
  body.fh-modern-auth .login-box h1,body .tablet-brand-panel h1,body .tablet-login-head h1 { font-size: 24px; }
  body .hub-setup-grid { grid-template-columns: minmax(0,1fr); }
  body .grid, body .fh-app-grid, body .fh-favorites-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .fh-app-card-link { padding: 14px; min-height: 155px; }
  body .fh-app-card-copy h3 { padding-right: 12px; font-size: 13px; }
  body .fh-app-card-copy p { font-size: 11px; }
  body .fh-search-field { width: 100%; }
  .ui-users-table .user-department, .ui-users-table .user-role, .ui-users-table .user-login { display: none; }
  body .ui-users-table td, body .ui-users-table th { padding: 10px 9px; }
  .ui-departments-table { table-layout: fixed; }
  .ui-departments-table .department-key { display: none; }
  .ui-departments-table .department-mobile-key { display: block; margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
  .ui-departments-table th.number { width: 62px; }
  .ui-departments-table th.action-col { width: 48px; }
  body .ui-departments-table td,body .ui-departments-table th { padding: 10px 8px; }
  .ui-users-table .status { font-size: 11px; }
  .ui-dialog .form-grid, .ui-dialog .permission-grid { grid-template-columns: minmax(0,1fr); }
  .ui-dialog .dialog-body { padding: 18px; }
  body .media-main { padding: 24px 16px; }
  body .media-sidebar { padding: 0 16px; }
  body.db-body { grid-template-rows: 60px auto minmax(0,1fr); }
  body.hub-ui-media { grid-template-rows: 60px minmax(0,1fr); }
  body.hub-ui-screen-view { grid-template-rows: 60px auto minmax(0,1fr); }
  body.fh-modern-auth .auth-stage { min-height: calc(100dvh - 60px); padding: 28px 20px; }
  body.fh-modern-auth .auth-identity { gap: 12px; margin-bottom: 20px; }
  body.fh-modern-auth .auth-identity img { width: 80px; height: 80px; }
  body .fiha-module-shell { padding: 24px 16px; }
  body .fh-main-header { flex-wrap: wrap; gap: 8px; }
}
@media(max-width:600px) {
  body .fh-app-grid,body .fh-favorites-grid { grid-template-columns: minmax(0,1fr); }
  body .fh-app-card-link { min-height: 110px; }
  body .fh-app-card,body .fh-app-card.is-compact { min-height: 110px; }
  body .fh-app-card-copy h3 { overflow-wrap: anywhere; }
}
@media(max-width:380px) {
  .hub-ui-header .ui-brand b { display: none; }
  body .fh-app-grid, body .fh-favorites-grid { grid-template-columns: minmax(0,1fr); }
}

/* Keep the dashboard visible behind visitor details in both themes. */
@media(max-width:1000px) {
  .hub-ui-header .primary-nav { display:none; }
  .hub-ui-header .mobile-menu-button { display:inline-flex; }
  .hub-ui-header .mobile-menu { display:flex; flex-direction:column; left:auto; max-width:calc(100vw - 32px); }
}
body .fh-visitor-detail-dialog::backdrop { background:rgba(27,38,44,.24); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
:root[data-theme=dark] body .fh-visitor-detail-dialog::backdrop { background:rgba(0,0,0,.38); }
