/* Colour tokens. Light values match the original design; html.dark (set by the theme switch) swaps them. */
:root {
    --app-border: #e5e7eb; --app-muted: #697282; --app-accent: #0d9488;
    --app-surface: var(--background, #fff); --app-page: #f7f8fa; --app-surface-muted: #f9fafb; --app-hover: #f4f5f7; --app-divider: #f0f1f3;
    --app-text: #1f2937; --app-text-soft: #515967; --app-link: #2563eb; --app-primary-soft: #eff6ff; --app-primary-line: #93c5fd;
    --app-danger: #be123c; --app-danger-soft: #fff1f2; --app-danger-line: #fecdd3;
    --app-success: #047857; --app-success-soft: #ecfdf5; --app-success-line: #a7f3d0;
    --app-warning-text: #604718; --app-warning-bar: #fff4d6; --app-warning-line: #f3d48a; --app-warning-soft: #fff8e7; --app-overlay: rgba(239, 246, 255, .94);
    --app-viewer-bg: rgba(10, 14, 20, .94); --app-viewer-text: #fff; --app-viewer-muted: rgba(255, 255, 255, .7);
    --app-on-accent: #fff; --app-float-shadow: rgba(15, 23, 42, .22);
    color-scheme: light;
}
html.dark {
    --app-border: #27272a; --app-muted: #9a9aa5; --app-accent: #14b8a6;
    --app-page: #0b0b0e; --app-surface-muted: #18181b; --app-hover: #1f1f23; --app-divider: #232327;
    --app-text: #e4e4e7; --app-text-soft: #a1a1aa; --app-link: #60a5fa; --app-primary-soft: rgba(59, 130, 246, .16); --app-primary-line: #1e40af;
    --app-danger: #fb7185; --app-danger-soft: rgba(225, 29, 72, .15); --app-danger-line: #881337;
    --app-success: #34d399; --app-success-soft: rgba(16, 185, 129, .14); --app-success-line: #065f46;
    --app-warning-text: #fbbf24; --app-warning-bar: #2a2110; --app-warning-line: #6b5216; --app-warning-soft: rgba(217, 154, 25, .15); --app-overlay: rgba(9, 9, 11, .9);
    --app-viewer-bg: rgba(0, 0, 0, .94); --app-viewer-text: #f4f4f5; --app-viewer-muted: rgba(244, 244, 245, .7);
    --app-on-accent: #fff; --app-float-shadow: rgba(0, 0, 0, .55);
    color-scheme: dark;
}
* { letter-spacing: 0; }
body { font-family: Inter, sans-serif; }
button, input, textarea { font-family: inherit; }
a, button, input, textarea { outline-offset: 4px; }
h1 { font-size: 24px; line-height: 1.3; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
.muted, .field-note { color: var(--app-muted); font-size: 13px; }
.auth-page { background: var(--app-page) url('/assets/media/images/2600x1200/bg-10.png') center / cover fixed; min-height: 100dvh; }
html.dark .auth-page { background-image: url('/assets/media/images/2600x1200/bg-10-dark.png'); }
.auth-shell { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 26px; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 600; }
.login-card { width: 100%; max-width: 410px; border-radius: 8px; }
.login-form { display: flex; flex-direction: column; gap: 24px; padding: 32px; }
.login-form h1 { margin-bottom: 8px; }
.login-submit { width: 100%; justify-content: center; }
.login-remember { display: flex; align-items: center; gap: 10px; margin-top: -8px; font-size: 13px; cursor: pointer; width: fit-content; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field input, .field textarea { width: 100%; min-width: 0; }
.field input[type="checkbox"], .field input[type="radio"] { width: calc(var(--spacing) * 4.5); flex: 0 0 auto; }
.notice { padding: 12px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 20px; overflow-wrap: anywhere; }
.login-form .notice { margin-bottom: 0; }
.notice-error { background: var(--app-danger-soft); color: var(--app-danger); border: 1px solid var(--app-danger-line); }
.notice-success { background: var(--app-success-soft); color: var(--app-success); border: 1px solid var(--app-success-line); }
.app-shell { width: 100%; min-height: 100dvh; }
.app-sidebar { width: 260px; height: 100dvh; top: 0; bottom: 0; --kt-drawer-enable: false; background: var(--app-surface); }
.sidebar-brand { position: relative; padding: 26px 24px; height: 92px; border-bottom: 1px solid var(--app-border); }
.sidebar-brand a { display: flex; gap: 12px; align-items: center; font-size: 22px; font-weight: 600; }
.sidebar-toggle { position: absolute; z-index: 30; right: -16px; top: 30px; width: 32px; height: 32px; border-radius: 50%; background: var(--app-surface); }
.sidebar-toggle i { transition: transform .3s ease; }
.brand-sub { display: block; font-size: 11px; color: var(--app-muted); font-weight: 400; margin-top: 2px; }
/* Only the menu scrolls; the brand and account rows stay pinned inside the full-height sidebar. */
.sidebar-content { padding: 28px 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-brand, .sidebar-account { flex-shrink: 0; }
.eyebrow { font-size: 10px; font-weight: 600; color: var(--app-muted); margin-bottom: 14px; }
.sidebar-content .eyebrow { padding-left: 12px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; border-radius: 6px; padding: 10px 12px; font-size: 13px; color: var(--app-text-soft); }
.nav-link i { font-size: 19px; }
.nav-link:hover { background: var(--app-hover); }
.nav-link.is-active { background: var(--app-primary-soft); color: var(--app-link); font-weight: 500; }
.nav-group-toggle { width: 100%; text-align: left; cursor: pointer; }
.nav-group-toggle > span { flex: 1; }
.nav-group-caret { font-size: 11px !important; color: var(--app-muted); transition: transform .15s; }
.nav-group.is-open .nav-group-caret { transform: rotate(180deg); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 21px; padding-left: 10px; border-left: 1px solid var(--app-border); }
.nav-sublink { min-height: 38px; padding-top: 8px; padding-bottom: 8px; }
.nav-sublink i { font-size: 16px; }
.nav-logout { width: 100%; border: 0; background: none; font-family: inherit; text-align: start; cursor: pointer; }
.nav-logout:hover { background: var(--app-danger-soft); color: var(--app-danger); }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 20px; border-top: 1px solid var(--app-border); }
.sidebar-account div { min-width: 0; }
.sidebar-account strong, .sidebar-account div span { display: block; font-size: 12px; overflow-wrap: anywhere; }
.sidebar-account div span { color: var(--app-muted); margin-top: 4px; }
.avatar-initial { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; background: var(--app-success-soft); color: var(--app-success); font-weight: 600; font-size: 14px; }
.avatar-initial.large { width: 52px; height: 52px; font-size: 22px; }
.demo1 { --sidebar-width: 260px; --sidebar-default-width: 260px; --sidebar-width-collapse: 76px; }
.demo1 .app-wrapper { padding-left: 260px; padding-top: 72px; min-width: 0; width: 100%; }
.demo1 .app-header { left: 260px; height: 72px; padding: 0 32px; border-bottom: 1px solid var(--app-border); justify-content: space-between; align-items: center; gap: 16px; }
.header-left, .header-actions { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header-label { font-size: 12px; color: var(--app-muted); }
.header-user { font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu { display: none; }
.app-content { padding: 32px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.page-heading .eyebrow { margin-bottom: 8px; }
.account-band { display: flex; gap: 16px; align-items: center; padding: 24px 0; border-top: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border); }
.account-band div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.account-band p { margin-top: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 28px 0; }
.stat-card { position: relative; padding: 22px; border-radius: 8px; border-top: 3px solid #3b82f6; }
.stat-card:nth-child(2) { border-top-color: var(--app-accent); }
.stat-card:nth-child(3) { border-top-color: #d99a19; }
.stat-card span { font-size: 13px; color: var(--app-muted); }
.stat-card strong { display: block; font-size: 30px; font-weight: 600; margin-top: 10px; }
.stat-card i { position: absolute; right: 20px; top: 24px; color: var(--app-muted); }
.section-line { padding: 28px 0; }
.details { margin-top: 20px; }
.details div { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--app-divider); font-size: 13px; }
.details dt { color: var(--app-muted); }
.details dd { overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.search-form { display: flex; align-items: center; gap: 8px; max-width: 400px; min-width: 0; }
.search-form .kt-input { width: 260px; max-width: 100%; min-width: 0; }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border); }
.app-table { width: 100%; font-size: 13px; }
.app-table th { background: var(--app-surface-muted); color: var(--app-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.app-table th, .app-table td { padding: 14px 16px; text-align: left; }
.app-table td { max-width: 360px; overflow-wrap: anywhere; }
.table-name { display: flex; align-items: center; gap: 10px; color: var(--app-text); font-weight: 500; min-width: 140px; }
.empty-state { height: 140px; text-align: center !important; color: var(--app-muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 12px; color: var(--app-muted); }
.pagination nav { display: flex; gap: 8px; }
.back-row { margin-bottom: 12px; }
.form-section { padding: 24px 0; border-top: 1px solid var(--app-border); }
.form-section h2 { margin-bottom: 22px; }
.editor-form { max-width: 760px; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
fieldset:disabled { opacity: .75; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.password-field { max-width: 368px; margin-bottom: 24px; }
.selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 760px; margin-bottom: 24px; }
.selection-row { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--app-border); border-radius: 6px; font-size: 13px; overflow-wrap: anywhere; }
.selection-row > span:first-of-type { flex: 1; min-width: 0; }
.permission-list { max-width: 760px; margin-bottom: 24px; }
.permission-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--app-border); }
.permission-row > div { flex: 1; min-width: 0; }
.permission-row strong { font-size: 13px; font-weight: 500; display: block; }
.permission-row code { display: block; font-size: 11px; color: var(--app-muted); margin-top: 5px; overflow-wrap: anywhere; }
.danger-button { color: var(--app-danger); }
.developer-notes { max-width: 980px; }
.notes-index { display: flex; align-items: center; gap: 20px; padding: 14px 0 22px; border-bottom: 1px solid var(--app-border); font-size: 13px; flex-wrap: wrap; }
.notes-index strong { margin-right: auto; font-weight: 600; }
.notes-index a { color: var(--app-link); }
.notes-section { padding: 32px 0; border-bottom: 1px solid var(--app-border); scroll-margin-top: 92px; }
.notes-heading { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 24px; }
.notes-heading > span { color: var(--app-accent); font-size: 12px; font-weight: 600; padding-top: 3px; }
.notes-heading h2 { margin-bottom: 6px; }
.notes-heading p, .notes-section > p { color: var(--app-muted); font-size: 13px; line-height: 1.65; }
.notes-map { margin-left: 52px; }
.notes-map > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 13px 0; border-top: 1px solid var(--app-divider); font-size: 13px; }
.notes-map dt { font-weight: 600; }
.notes-map dd { color: var(--app-muted); overflow-wrap: anywhere; }
.notes-section code { font-family: "JetBrains Mono", "Cascadia Code", monospace; font-size: .9em; }
.notes-steps { margin-left: 70px; display: grid; gap: 14px; font-size: 13px; line-height: 1.65; }
.notes-steps li { padding-left: 6px; }
.code-sample { margin: 18px 0 24px 52px; padding: 20px; overflow-x: auto; border: 1px solid var(--app-divider); border-left: 3px solid var(--app-link); border-radius: 6px; background: var(--app-surface-muted); color: var(--app-text); font-size: 12px; line-height: 1.7; tab-size: 4; }
.notes-callouts { margin-left: 52px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.notes-callouts > div { border-top: 2px solid var(--app-accent); padding-top: 14px; }
.notes-callouts strong { font-size: 13px; }
.notes-callouts p { margin-top: 7px; color: var(--app-muted); font-size: 12px; line-height: 1.6; }
.notes-warning { margin: 24px 0 14px 52px; padding: 14px 16px; background: var(--app-warning-soft); border-left: 3px solid #d99a19; color: var(--app-warning-text) !important; }
.notes-section > .field-note { margin-left: 52px; overflow-wrap: anywhere; }
.app-footer { display: flex; justify-content: space-between; margin: 0 32px; padding: 20px 0; border-top: 1px solid var(--app-border); color: var(--app-muted); font-size: 11px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; background: white; padding: 12px; }
.skip-link:focus { top: 8px; }
@media (min-width: 1024px) {
    .app-sidebar, .demo1 .app-wrapper, .demo1 .app-header { transition: width .3s ease, padding-left .3s ease, left .3s ease; }
    .sidebar-collapsed .demo1 { --sidebar-width: 76px; }
    .sidebar-collapsed .app-sidebar { width: 76px !important; }
    .sidebar-collapsed .demo1 .app-wrapper { padding-inline-start: 76px !important; }
    .sidebar-collapsed .demo1 .app-header { inset-inline-start: 76px !important; }
    .sidebar-collapsed .sidebar-brand { padding-left: 23px; padding-right: 23px; }
    .sidebar-collapsed .sidebar-content > .eyebrow,
    .sidebar-collapsed .nav-link span,
    .sidebar-collapsed .sidebar-account div { display: none; }
    .sidebar-collapsed .sidebar-content { padding-left: 16px; padding-right: 16px; }
    .sidebar-collapsed .nav-link { justify-content: center; padding-left: 12px; padding-right: 12px; }
    .sidebar-collapsed .nav-group-caret { display: none; }
    .sidebar-collapsed .nav-group-items { margin-left: 0; padding-left: 0; border-left: 0; border-top: 1px solid var(--app-border); padding-top: 2px; }
    .sidebar-collapsed .sidebar-account { justify-content: center; padding-left: 20px; padding-right: 20px; }
    .sidebar-collapsed .sidebar-toggle i { transform: rotate(180deg); }
}
.notification-toggle { position: relative; flex: 0 0 36px; width: 36px; height: 36px; }
.notification-count { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; background: #dc2626; color: white; font-size: 10px; line-height: 18px; text-align: center; }
.notification-count[hidden], .notification-footer [hidden] { display: none; }
.notification-drawer { --kt-drawer-enable: true; width: min(450px, calc(100vw - 24px)); top: 12px; bottom: 12px; right: 12px; max-height: calc(100dvh - 24px); border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); flex-direction: column; overflow: hidden; }
.notification-heading, .notification-toolbar, .notification-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; flex-shrink: 0; }
.notification-heading, .notification-toolbar { border-bottom: 1px solid var(--app-border); }
.notification-toolbar { padding-top: 0; padding-bottom: 0; min-height: 48px; }
.notification-toolbar > span { font-size: 11px; text-align: right; }
.notification-tabs { display: flex; gap: 16px; }
.notification-tabs button { padding: 14px 0; border-bottom: 2px solid transparent; font-size: 13px; white-space: nowrap; }
.notification-tabs button[aria-selected="true"] { border-bottom-color: var(--app-link); color: var(--app-link); }
.notification-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.notification-item { display: flex; gap: 12px; padding: 20px; border-bottom: 1px solid var(--app-border); }
.notification-item.is-unread { background: var(--app-primary-soft); }
.notification-icon { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--app-surface-muted); color: var(--app-link); }
.notification-content { min-width: 0; flex: 1; }
.notification-remove { flex: 0 0 32px; width: 32px; height: 32px; align-self: flex-start; color: var(--app-muted); }
.notification-remove:hover { color: var(--app-danger); background: var(--app-danger-soft); }
.notification-content h3 { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.notification-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; margin: 6px 0 10px; }
.notification-content time { font-size: 11px; }
.notification-empty { padding: 48px 20px; text-align: center; color: var(--app-muted); font-size: 13px; }
.notification-footer { border-top: 1px solid var(--app-border); min-height: 64px; flex-wrap: wrap; }
.notification-footer > span { flex: 1; overflow-wrap: anywhere; }
.notification-form > .field { margin-bottom: 20px; }
.notification-form select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.notification-history { min-width: 1080px; }
.notification-history td:first-child { min-width: 220px; }
.presence-indicator { display: inline-flex; align-items: center; gap: 8px; color: var(--app-success); white-space: nowrap; }
.presence-indicator::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #059669; }
.audit-filters { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.audit-filters .kt-input { width: 300px; max-width: 100%; }
.audit-filters .kt-select { min-width: 170px; }
.audit-history { min-width: 820px; }
.audit-history td:first-child { white-space: nowrap; }
.audit-history td:nth-child(2) strong, .audit-email { display: block; }
.audit-email { margin-top: 4px; color: var(--app-muted); font-size: 11px; }
.audit-impersonated { display: block; margin-top: 4px; color: var(--app-warning-text); font-size: 11px; font-weight: 500; }
.audit-history code { font-family: "JetBrains Mono", "Cascadia Code", monospace; font-size: 11px; overflow-wrap: anywhere; }
.maintenance-state-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.maintenance-state-line h2 { margin-bottom: 6px; }
.load-time-badge, .maintenance-active-badge { border-color: var(--app-danger); color: var(--app-danger); background: var(--app-danger-soft); }
.maintenance-form { display: grid; gap: 24px; }
.maintenance-form .kt-btn { justify-self: start; }
.maintenance-lock[hidden] { display: none; }
.maintenance-lock { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; }
.maintenance-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .78); }
.maintenance-modal { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 36px; border-top: 4px solid #e20074; border-radius: 8px; background: var(--app-surface); box-shadow: 0 24px 70px rgba(0, 0, 0, .28); text-align: center; }
.maintenance-modal:focus { outline: 2px solid #e20074; outline-offset: 2px; }
.maintenance-modal .eyebrow { margin: 18px 0 8px; color: var(--app-danger); }
.maintenance-modal h2 { font-size: 22px; line-height: 1.35; }
.maintenance-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--app-danger-soft); color: var(--app-danger); font-size: 25px; }
.maintenance-message { margin: 22px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; }
.maintenance-close-form { margin-top: 24px; }
.maintenance-locked { overflow: hidden; }
.idle-locked { overflow: hidden; }
.idle-lock[hidden] { display: none; }
.idle-lock { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; padding: 20px; }
.idle-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); }
.idle-modal { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 32px; border-top: 4px solid #d99a19; border-radius: 8px; background: var(--app-surface); box-shadow: 0 24px 64px rgba(15, 23, 42, .28); text-align: center; }
.idle-modal .eyebrow { margin: 18px 0 8px; color: var(--app-warning-text); }
.idle-modal h2 { font-size: 22px; line-height: 1.35; }
.idle-ring { position: relative; width: 88px; height: 88px; margin: 0 auto; }
.idle-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.idle-ring circle { fill: none; stroke-width: 5; }
.idle-ring-track { stroke: var(--app-warning-soft); }
.idle-ring-value { stroke: #d99a19; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.idle-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.idle-message { margin: 18px 0 24px; font-size: 15px; line-height: 1.6; }
.idle-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1023px) {
    .app-sidebar { --kt-drawer-enable: true; }
    .demo1 .app-wrapper { padding-left: 0; padding-top: 64px; }
    .demo1 .app-header { left: 0; height: 64px; padding: 0 20px; }
    .mobile-menu { display: inline-flex; }
    .sidebar-toggle { display: none; }
    .header-user { display: none; }
    .app-content { padding: 24px 20px; }
}
@media (max-width: 600px) {
    .header-label { max-width: 165px; overflow-wrap: anywhere; }
    .header-left, .header-actions { gap: 8px; }
    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 16px 20px; }
    .account-band { flex-wrap: wrap; }
    .form-grid, .selection-grid { grid-template-columns: 1fr; }
    .details div { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
    .toolbar { align-items: stretch; }
    .search-form { width: 100%; }
    .search-form .kt-input { flex: 1; width: auto; }
    .audit-filters { width: 100%; }
    .audit-filters .kt-input { flex: 1 1 220px; width: auto; }
    .audit-filters label:has(.kt-select) { flex: 1 1 150px; }
    .audit-filters .kt-select { width: 100%; min-width: 0; }
    .permission-row { gap: 10px; flex-wrap: wrap; }
    .permission-row > div { min-width: 175px; }
    .permission-row .kt-badge { font-size: 10px; }
    .notes-map, .notes-steps, .code-sample, .notes-callouts, .notes-warning, .notes-section > .field-note { margin-left: 0; }
    .notes-map > div { grid-template-columns: 1fr; gap: 5px; }
    .notes-callouts { grid-template-columns: 1fr; }
    .login-form { padding: 24px; }
    .maintenance-modal { padding: 28px 22px; }
    h1 { font-size: 22px; }
}
.files-app { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.files-app .sr-only, .files-public .sr-only, .files-member-list .sr-only, .files-spaces-table .sr-only, .audit-filters .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Keeps hidden labels inside horizontally scrolling tables instead of widening the page. */
.table-scroll { position: relative; }
.files-app .table-scroll, .files-public .table-scroll, .table-scroll:has(> .files-spaces-table), .files-member-list .permission-row { position: relative; }
.files-modal .hidden { display: none !important; }
.files-nav { position: sticky; top: 104px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.files-nav .eyebrow { margin: 0 0 8px 12px; }
.files-nav-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.files-nav-list .nav-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-nav-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 12px; }
.files-nav-manage { flex-shrink: 0; }
.files-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 24px; }
.files-filters { margin-bottom: 20px; }
.files-path { display: block; margin: 4px 0 0 40px; color: var(--app-muted); font-size: 11px; overflow-wrap: anywhere; }
a.files-path:hover { color: var(--app-link); }
.files-all-table { min-width: 1000px; }
.files-all-table td:nth-child(2) { min-width: 110px; overflow-wrap: break-word; }
.files-quota { display: grid; gap: 8px; padding: 16px 12px 0; border-top: 1px solid var(--app-border); }
.files-quota .eyebrow { margin: 0; }
.files-quota .muted { font-size: 12px; }
.files-main { min-width: 0; }
.files-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; font-size: 14px; }
.files-breadcrumb a { color: var(--app-link); overflow-wrap: anywhere; }
.files-breadcrumb [aria-current] { font-weight: 600; overflow-wrap: anywhere; }
.files-breadcrumb i { font-size: 10px; color: var(--app-muted); }
.files-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.files-actions .kt-btn { flex-shrink: 0; }
.files-search .kt-input { width: 220px; }
.files-search .kt-select { min-width: 140px; }
.files-note { margin: -12px 0 20px; }
.files-drop-area { position: relative; }
.files-dropzone-overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px; border: 2px dashed #3b82f6; border-radius: 8px; background: var(--app-overlay); color: var(--app-link); font-size: 13px; text-align: center; pointer-events: none; }
.files-dropzone-overlay i { font-size: 32px; }
.files-table { min-width: 760px; }
.files-table td { vertical-align: middle; }
.files-name { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.files-icon { display: inline-grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 6px; color: var(--app-muted); font-size: 20px; }
img.files-icon { object-fit: contain; }
.files-icon-folder { background: var(--app-warning-soft); color: #d99a19; }
.files-icon-lg { flex-basis: 44px; width: 44px; height: 44px; font-size: 28px; }
.files-name-text { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.files-name-text > a, .files-name-text > span:first-child { color: var(--app-text); font-weight: 500; overflow-wrap: anywhere; }
.files-name-text > a:hover { color: var(--app-link); }
.files-row-actions { width: 56px; text-align: right !important; }
.files-inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.files-inline-actions form { display: inline-flex; }
.files-trash-table, .files-links-table { min-width: 900px; }
.files-row-menu { position: fixed; z-index: 60; display: grid; min-width: 210px; padding: 6px; background: var(--app-surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .14); }
.files-row-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; color: var(--app-text); font-size: 13px; text-align: left; cursor: pointer; }
.files-row-menu-item:hover, .files-row-menu-item:focus-visible { background: var(--app-hover); outline: none; }
.files-row-menu-item i { font-size: 16px; }
.files-row-menu-item.is-danger { color: var(--app-danger); }
.files-modal .kt-modal-content { width: min(540px, calc(100vw - 24px)); max-width: 100%; top: 20px; }
.files-modal-wide .kt-modal-content { width: min(960px, calc(100vw - 24px)); }
.files-modal .kt-modal-body { max-height: calc(100dvh - 120px); }
.files-form { display: grid; gap: 16px; min-width: 0; }
.files-form .form-grid { gap: 16px; margin-bottom: 0; }
.files-form .kt-select, .files-form .kt-input, .files-form .kt-textarea { width: 100%; min-width: 0; }
.files-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.files-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; }
.files-section-title { font-size: 13px; font-weight: 600; }
.files-share-tabs { margin-top: -8px; gap: 20px; }
.files-picker { display: grid; gap: 10px; }
.files-picker-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; }
.files-picker-crumbs button { color: var(--app-link); }
.files-picker-crumbs i { font-size: 9px; color: var(--app-muted); }
.files-picker-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--app-border); border-radius: 6px; }
.files-picker-list li + li { border-top: 1px solid var(--app-divider); }
.files-picker-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; font-size: 13px; text-align: left; }
.files-picker-list button span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.files-picker-list button:hover { background: var(--app-hover); }
.files-picker-list .muted { display: block; padding: 12px; }
.files-list { display: grid; gap: 8px; }
.files-list-empty { padding: 6px 0; color: var(--app-muted); font-size: 13px; }
.files-share-row, .files-version-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: 6px; font-size: 13px; }
.files-share-row > div, .files-version-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.files-share-row small, .files-version-row small, .files-link-row small { display: block; margin-top: 3px; color: var(--app-muted); font-size: 11px; overflow-wrap: anywhere; }
.files-link-row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--app-border); border-radius: 6px; font-size: 13px; }
.files-link-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.files-link-url { display: flex; gap: 6px; }
.files-link-url .kt-input { flex: 1; min-width: 0; font-family: "JetBrains Mono", "Cascadia Code", monospace; font-size: 12px; }
.files-link-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.files-preview-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-preview-body { display: grid; place-items: center; min-height: 220px; overflow: hidden; border-radius: 6px; background: #111827; }
.files-preview-body img, .files-preview-body video { max-width: 100%; max-height: calc(100dvh - 200px); }
.files-preview-body audio { width: calc(100% - 32px); }
.files-uploads { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; flex-direction: column; width: min(420px, calc(100vw - 32px)); max-height: min(60dvh, 520px); overflow: hidden; border-radius: 8px; box-shadow: 0 18px 50px rgba(15, 23, 42, .18); }
.files-uploads-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--app-border); font-size: 13px; }
.files-uploads-head > div { display: flex; gap: 2px; }
.files-uploads-total { height: 3px; border-radius: 0; }
.files-uploads-list { overflow-y: auto; padding: 4px 0; }
.files-upload-row { display: grid; gap: 6px; padding: 8px 16px; font-size: 12px; }
.files-upload-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.files-upload-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.files-upload-status { font-size: 11px; white-space: nowrap; }
.files-upload-row.is-error .files-upload-status { color: var(--app-danger); white-space: normal; }
.files-upload-row.is-done .files-upload-status { color: var(--app-success); }
.files-upload-actions { display: flex; gap: 2px; }
.files-upload-progress { height: 4px; }
.files-spaces-table { min-width: 640px; }
.files-quota-form { display: flex; align-items: center; gap: 6px; }
.files-quota-form .kt-input { width: 110px; }
.files-member-list .kt-select { width: 170px; }
.files-subheading { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.files-field-gap { margin-bottom: 24px; }
.files-space-footer { justify-content: flex-start; }
.files-public-page { min-height: 100dvh; background: var(--app-page); }
.files-public-shell { display: grid; align-content: start; gap: 20px; width: 100%; max-width: 1000px; margin: 0 auto; padding: 32px 20px; }
.files-public-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; }
.files-public-brand .brand-sub { margin-top: 0; font-size: 13px; }
.files-public-card { border-radius: 8px; min-width: 0; }
.files-public-body { display: grid; gap: 20px; padding: 28px; min-width: 0; }
.files-public-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.files-public-heading > div { min-width: 0; }
.files-public-heading h1 { overflow-wrap: anywhere; }
.files-public-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; color: var(--app-muted); font-size: 12px; }
.files-public-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.files-public-drop { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border: 1px dashed var(--app-primary-line); border-radius: 8px; background: var(--app-primary-soft); font-size: 13px; }
.files-public-drop p { margin-top: 4px; }
.files-public-table { min-width: 560px; }
.files-public-login { justify-self: center; }
@media (max-width: 1023px) {
    .files-app { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .files-nav { position: static; display: flex; align-items: center; gap: 12px; padding-bottom: 6px; overflow-x: auto; border-bottom: 1px solid var(--app-border); }
    .files-nav-group { display: contents; }
    .files-nav .eyebrow { display: none; }
    .files-nav-list { display: flex; gap: 4px; }
    .files-nav .nav-link { min-height: 38px; white-space: nowrap; }
    .files-nav-list .nav-link span { overflow: visible; }
    .files-nav-actions { flex-wrap: nowrap; padding-left: 0; }
    .files-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .files-quota { flex: 0 0 180px; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--app-border); }
}
@media (max-width: 600px) {
    .files-actions { width: 100%; }
    .files-search { flex: 1 1 100%; max-width: none; }
    .files-search > .kt-input { flex: 1; width: auto; }
    .files-search .kt-select { min-width: 0; }
    .files-table, .files-trash-table, .files-links-table, .files-public-table, .files-all-table { min-width: 0; }
    .files-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .files-stats .stat-card { padding: 14px 16px; }
    .files-stats .stat-card strong { font-size: 22px; }
    .files-stats .stat-card i { top: 14px; right: 14px; }
    .files-filters label:has(.kt-select) { flex: 1 1 150px; }
    .files-filters .kt-select { width: 100%; min-width: 0; }
    .files-col-optional { display: none; }
    .files-name { min-width: 0; }
    .files-uploads { right: 16px; bottom: 16px; }
    .files-public-body { padding: 20px; }
    .files-public-drop { flex-wrap: wrap; }
    .files-link-actions .kt-btn { flex: 1 1 auto; }
}
/* Visually hidden but announced by screen readers; the compiled theme CSS does not ship this utility. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Keeps hidden labels inside horizontally scrolling tables instead of widening the page. */
.table-scroll { position: relative; }

/* Stores */
.store-tabs { display: flex; gap: 4px; margin: -8px 0 24px; border-bottom: 1px solid var(--app-border); overflow-x: auto; }
.store-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; color: var(--app-muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.store-tab:hover { color: var(--app-text); }
.store-tab.is-active { color: var(--app-text); font-weight: 500; border-bottom-color: var(--app-accent); }
.store-filters .kt-input { width: 260px; max-width: 100%; }
.store-lead { max-width: 820px; margin-bottom: 20px; line-height: 1.6; }
.store-table td { white-space: nowrap; overflow-wrap: normal; }
.store-table .is-number { text-align: right; font-variant-numeric: tabular-nums; }
.store-table th.is-number .sort-link { justify-content: flex-end; }
.sort-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.sort-link i { font-size: 10px; }
.store-row-actions { white-space: nowrap; text-align: right !important; }
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.store-band { margin-bottom: 8px; }
/* Full-width panel: the pairs flow in columns with the label above the value, instead of one tall two-column list. */
.store-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; }
.store-fields > div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; }
.store-fields dt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.store-fields dd { font-size: 14px; font-weight: 500; }
.store-longtext { white-space: pre-line; }
/* Four cards across on wide content; fewer when the sidebar or a narrow screen leaves less room. */
.store-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding-top: 24px; align-items: start; }
.store-folder { padding: 20px; border-radius: 8px; border-top: 3px solid var(--app-accent); }
.store-folder-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.store-folder-head h2 { font-size: 15px; font-weight: 600; }
.store-folder-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.store-recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.store-recent-head h2 { font-size: 15px; font-weight: 600; }
.store-timeline { display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.store-timeline li { padding-left: 14px; border-left: 2px solid var(--app-border); }
.store-timeline-meta { display: flex; justify-content: space-between; gap: 8px; }
.store-timeline-meta time { color: var(--app-muted); font-size: 12px; white-space: nowrap; }
.store-form .field-wide, .store-field-form .field-wide { grid-column: 1 / -1; }
.store-form .kt-textarea, .store-form .kt-select, .store-field-form .kt-textarea, .store-field-form .kt-select { width: 100%; min-width: 0; }
.store-form { max-width: 860px; }
.required-mark { color: var(--app-danger); }
.store-checks { flex-direction: row; flex-wrap: wrap; align-items: center; align-self: end; }
.store-checks .selection-row { flex: 0 0 auto; padding: 10px 14px; }
.store-checks input.kt-checkbox { width: calc(var(--spacing) * 4.5); flex: 0 0 auto; }
.store-checks .selection-row > span:first-of-type { flex: 0 0 auto; white-space: nowrap; }
.store-field-edit summary { list-style: none; cursor: pointer; }
.store-field-edit summary::-webkit-details-marker { display: none; }
.store-field-edit[open] { min-width: min(640px, 80vw); }
.store-field-form { padding: 16px 0 4px; }
.store-fields-table td { vertical-align: top; }
.store-diff { display: flex; flex-direction: column; gap: 6px; }
.store-diff li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.store-diff-field { color: var(--app-muted); min-width: 110px; }
.store-diff del { color: var(--app-danger); text-decoration: line-through; }
.store-diff ins { color: var(--app-success); text-decoration: none; font-weight: 500; }
.store-diff i { font-size: 10px; color: var(--app-muted); }
.store-history td { vertical-align: top; }
.store-chat { display: flex; flex-direction: column; max-width: 920px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); }
.store-chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--app-border); }
.store-chat-head h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.store-chat-notice { margin: 16px 24px 0; padding: 12px 16px; border-radius: 6px; background: var(--app-surface-muted); border: 1px solid var(--app-border); color: var(--app-muted); font-size: 13px; }
.store-chat-log { display: flex; flex-direction: column; gap: 14px; min-height: 320px; max-height: min(60dvh, 620px); overflow-y: auto; padding: 24px; }
.store-chat-empty { margin: auto; text-align: center; color: var(--app-muted); font-size: 13px; }
.store-chat-empty > i { font-size: 32px; color: var(--app-accent); }
.store-chat-empty p { margin: 10px 0 16px; }
.store-chat-examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; }
.store-chat-message { display: flex; flex-direction: column; gap: 4px; max-width: 80%; }
.store-chat-message.is-user { align-self: flex-end; align-items: flex-end; }
.store-chat-bubble { padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--app-surface-muted); color: var(--app-text); }
.store-chat-message.is-user .store-chat-bubble { background: var(--app-accent); color: #fff; border-bottom-right-radius: 4px; }
.store-chat-message.is-assistant .store-chat-bubble { border-bottom-left-radius: 4px; }
.store-chat-message.is-error .store-chat-bubble { background: var(--app-danger-soft); color: var(--app-danger); }
.store-chat-message.is-pending .store-chat-bubble { color: var(--app-muted); font-style: italic; }
.store-chat-meta { font-size: 11px; color: var(--app-muted); }
.store-chat-form { padding: 16px 24px 20px; border-top: 1px solid var(--app-border); }
.store-chat-form .kt-textarea { width: 100%; resize: vertical; }
.store-chat-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
/* Typing dots of a pending answer (data-typing roots, e.g. the floating window). */
.store-chat-typing { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: middle; }
.store-chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: store-chat-typing 1.2s ease-in-out infinite; }
.store-chat-typing i:nth-child(2) { animation-delay: .15s; }
.store-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes store-chat-typing { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .store-chat-typing i { animation: none; opacity: .7; } }
.store-chat-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.store-chat-message.is-assistant .store-chat-bubble a { color: var(--app-link); }

/* Floating store-assistant window (partials/assistant-widget.php). Above content and .files-uploads (40), below the
   maintenance (10000) and idle (10001) locks. */
.assistant-launcher { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--app-accent); color: var(--app-on-accent); font-size: 26px; box-shadow: 0 10px 28px var(--app-float-shadow); cursor: pointer; transition: transform .15s ease; }
/* Room below the footer so the launcher never covers the last line of a page scrolled to the end. */
body:has(.assistant-widget) .app-footer { padding-bottom: 92px; }
.assistant-launcher:hover { transform: translateY(-2px); }
.assistant-launcher:focus-visible { outline: 3px solid var(--app-primary-line); outline-offset: 3px; }
.assistant-launcher[aria-expanded="true"] { transform: scale(.92); }
/* While the upload panel of the file pages is visible the launcher moves next to it instead of covering it. */
body:has(.files-uploads:not([hidden])) .assistant-launcher { right: calc(24px + min(420px, 100vw - 32px) + 12px); }
@media (min-width: 640px) {
    /* The open window moves the same way, as far as the screen allows. */
    body:has(.files-uploads:not([hidden])) .assistant-panel { right: max(24px, min(calc(min(420px, 100vw - 32px) + 36px), calc(100vw - min(400px, 100vw - 48px) - 24px))); }
}
.assistant-panel[hidden] { display: none; }
.assistant-panel { position: fixed; right: 24px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 46; width: min(400px, calc(100vw - 48px)); height: min(600px, calc(100dvh - 116px - env(safe-area-inset-bottom, 0px))); max-width: none; overflow: hidden; box-shadow: 0 24px 60px var(--app-float-shadow); }
.assistant-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--app-border); }
.assistant-panel-title { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.assistant-panel-title h2 { font-size: 15px; font-weight: 600; }
.assistant-panel-title .kt-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-panel-tools { display: flex; flex-shrink: 0; gap: 2px; }
.assistant-panel-note { margin: 0; padding: 8px 18px; border-bottom: 1px solid var(--app-border); background: var(--app-surface-muted); color: var(--app-muted); font-size: 12px; line-height: 1.45; }
.assistant-panel .store-chat-log { flex: 1; min-height: 0; max-height: none; padding: 16px; }
.assistant-panel .store-chat-message { max-width: 88%; }
.assistant-panel .store-chat-examples { flex-direction: column; align-items: stretch; }
.assistant-panel .store-chat-examples .kt-btn { justify-content: flex-start; height: auto; min-height: 32px; padding-block: 6px; white-space: normal; text-align: left; }
.assistant-panel .store-chat-form { padding: 12px 16px 16px; }
.assistant-panel-compose { display: flex; align-items: flex-end; gap: 8px; }
.assistant-panel-compose .kt-textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; }
@media (max-width: 639px) {
    .assistant-launcher { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    body:has(.files-uploads:not([hidden])) .assistant-launcher { right: 16px; bottom: calc(16px + min(60dvh, 520px) + 12px + env(safe-area-inset-bottom, 0px)); }
    .assistant-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
    html.assistant-open { overflow: hidden; }
}
@media print { .assistant-widget { display: none !important; } }
@media (max-width: 600px) {
    .store-chat-head { flex-direction: column; padding: 16px; }
    .store-chat-log { padding: 16px; }
    .store-chat-form { padding: 12px 16px 16px; }
    .store-chat-message { max-width: 92%; }
    .store-filters .kt-input { width: 100%; }
    .store-field-edit[open] { min-width: 0; }
}

/* Menu editor */
.menu-editor { max-width: 980px; }
.menu-editor-bar { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 0; background: var(--app-surface); border-bottom: 1px solid var(--app-border); flex-wrap: wrap; }
.menu-status { margin-right: auto; font-size: 13px; color: var(--app-muted); }
.menu-tree, .menu-children { display: flex; flex-direction: column; gap: 6px; }
.menu-tree { padding: 16px 0; }
.menu-children { margin: 6px 0 4px 36px; padding: 6px 0 6px 14px; border-left: 2px dashed var(--app-border); min-height: 44px; }
.menu-children:empty::before { content: 'Drag pages here or add them with the right arrow in the row'; display: block; padding: 10px 12px; font-size: 12px; color: var(--app-muted); border: 1px dashed var(--app-border); border-radius: 6px; }
.menu-node { list-style: none; }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); }
.menu-node[data-type="group"] > .menu-row { background: var(--app-surface-muted); }
.menu-node.is-hidden > .menu-row { opacity: .6; }
.menu-node.is-dragging { opacity: .4; }
.menu-node.is-drop-target > .menu-row { border-color: var(--app-accent); box-shadow: 0 0 0 2px rgba(13, 148, 136, .2); }
.menu-handle { cursor: grab; color: var(--app-muted); padding: 4px; touch-action: none; }
.menu-handle:active { cursor: grabbing; }
.menu-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--app-surface-muted); flex-shrink: 0; }
.menu-icon i { font-size: 17px; }
.menu-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; font-size: 13px; }
.menu-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--app-muted); }
.menu-meta code { overflow-wrap: anywhere; }
.menu-row-actions { display: flex; gap: 2px; flex-shrink: 0; }
.menu-row-actions .kt-btn:disabled { opacity: .3; }
.menu-panels { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; padding: 2px 0 0 54px; }
.menu-panel summary { list-style: none; cursor: pointer; }
.menu-panel summary::-webkit-details-marker { display: none; }
.menu-panel[open] { flex-basis: 100%; padding: 8px 0 12px; }
.menu-form { padding: 12px 0 0; max-width: 760px; }
.menu-form .kt-select, .menu-form .kt-input { width: 100%; min-width: 0; }
.menu-form .field-wide { grid-column: 1 / -1; }
.menu-form-actions { display: flex; gap: 8px; }
.menu-delete { margin-top: 12px; }
.menu-access-note { display: block; margin-bottom: 12px; max-width: 760px; }
.menu-group-note { align-self: center; }
.menu-roles { margin-bottom: 12px; }
.menu-create { max-width: 980px; margin-top: 24px; }
.menu-create .kt-select { width: 100%; }
.menu-create .form-section > .muted { margin: -12px 0 20px; }
@media (max-width: 600px) {
    .menu-editor-bar { top: 64px; }
    .menu-row { flex-wrap: wrap; }
    .menu-title { flex-basis: calc(100% - 90px); }
    .menu-row-actions { width: 100%; justify-content: flex-end; }
    .menu-panels { padding-left: 0; }
    .menu-children { margin-left: 8px; padding-left: 10px; }
}

/* VR tours: store card and tour page (plan editor ported from vrCreator) */
.store-tours { display: grid; gap: .75rem; padding: 1rem; }
.store-tours-head { display: flex; align-items: center; gap: .75rem; }
.store-tours-head h2 { margin: 0; }
.store-tour-list { display: grid; margin: 0; padding: 0; list-style: none; }
.store-tour-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .5rem 0; border-bottom: 1px solid var(--app-divider); }
.store-tour-list li:last-child { border-bottom: 0; }
.store-tour-list a { color: var(--app-link); font-weight: 600; }
.store-tour-create { display: grid; gap: .375rem; }
.store-tour-create-row { display: flex; gap: .5rem; }
.store-tour-create-row .kt-input { flex: 1; min-width: 0; }
.tour-nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: 1rem 0; }
.tour-nav a { color: var(--app-link); font-weight: 500; }
.tour-upload { display: grid; gap: .5rem; margin-bottom: 1rem; }
.tour-upload-list { margin: 0; padding-left: 1.25rem; color: var(--app-text-soft); font-size: .8125rem; }
.tour-upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.tour-upload progress { width: 100%; }
.tour-scenes { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.tour-scene { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; border: 1px solid var(--app-border); border-radius: .5rem; background: var(--app-surface); }
.tour-scene-thumb { flex: none; width: 120px; height: 60px; object-fit: cover; border-radius: .375rem; background: var(--app-surface-muted); }
.tour-scene-body { display: grid; flex: 1; gap: .5rem; min-width: 0; }
.tour-scene-title { display: flex; gap: .5rem; }
.tour-scene-title .kt-input { flex: 1; min-width: 0; }
.tour-scene-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.tour-plan-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.tour-plan-upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.tour-plan-upload label { flex-basis: 100%; }
.tour-plan-upload .kt-input { min-width: 0; max-width: 100%; }
.plan-editor { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 1rem; }
.plan-stage-wrap { min-width: 0; }
.plan-stage { position: relative; display: inline-block; max-width: 100%; overflow: hidden; border: 1px solid var(--app-border); border-radius: .5rem; background: var(--app-surface); cursor: crosshair; user-select: none; touch-action: none; }
.plan-stage img { display: block; max-width: 100%; max-height: 70vh; height: auto; }
.plan-marker { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid var(--app-surface); border-radius: 50%; background: var(--app-text); color: var(--app-surface); box-shadow: 0 1px 4px var(--app-overlay); font-size: .6875rem; font-weight: 600; cursor: grab; }
.plan-marker.is-selected { z-index: 3; border-color: var(--app-text); background: var(--app-surface); color: var(--app-text); }
.plan-marker-num { position: relative; z-index: 1; line-height: 1; }
.plan-marker-arrow { position: absolute; top: 50%; left: 50%; width: 0; height: 0; transform-origin: 0 0; pointer-events: none; }
.plan-marker-arrow::before { content: ""; position: absolute; top: -34px; left: -2px; width: 4px; height: 26px; border-radius: 2px; background: var(--app-text); }
.plan-marker-arrow::after { content: ""; position: absolute; top: -40px; left: -6px; border-right: 6px solid transparent; border-bottom: 9px solid var(--app-text); border-left: 6px solid transparent; }
.plan-side { display: flex; flex-direction: column; gap: 1rem; }
.plan-scenes { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; border: 1px solid var(--app-border); border-radius: .5rem; background: var(--app-surface); }
.plan-scene { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: .5rem; padding: .5rem .625rem; border: 0; border-bottom: 1px solid var(--app-divider); background: transparent; color: var(--app-text); font-size: .8125rem; text-align: left; cursor: pointer; }
.plan-scene:last-child { border-bottom: 0; }
.plan-scene:hover { background: var(--app-hover); }
.plan-scene.is-selected { background: var(--app-primary-soft); }
.plan-scene-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--app-surface-muted); color: var(--app-text-soft); font-size: .6875rem; font-weight: 600; }
.plan-scene-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-scene-state { color: var(--app-muted); font-size: .75rem; }
.plan-heading input[type="range"] { width: 100%; accent-color: var(--app-accent); }
.plan-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.plan-status-error { color: var(--app-danger); }
.tour-link { display: grid; gap: .5rem; margin-bottom: 1rem; }
.tour-publish { display: grid; gap: .75rem; max-width: 32rem; }
.tour-publish-toggle { display: flex; align-items: center; gap: .5rem; }
.tour-stats-totals { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; }
.tour-stats-totals div { display: grid; }
.tour-stats-totals strong { font-size: 1.5rem; }
.tour-stats-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tour-stats-bars h3 { margin: 0 0 .5rem; font-size: .875rem; }
.tour-stats-bars ul { display: grid; gap: .375rem; margin: 0; padding: 0; list-style: none; }
.tour-stats-bars li { display: grid; grid-template-columns: minmax(0, 7rem) 1fr auto; align-items: center; gap: .5rem; font-size: .8125rem; }
.tour-stats-bars meter { width: 100%; }
.tour-visits { overflow-x: auto; }
.tour-delete { margin-top: 1rem; }
@media (max-width: 767.98px) { .plan-editor { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) {
    .tour-scene { flex-direction: column; }
    .tour-scene-thumb { width: 100%; height: auto; aspect-ratio: 2 / 1; }
}

/* Scheduled tasks, contacts and groups */
.page-tabs { display: flex; gap: 20px; margin-bottom: 16px; border-bottom: 1px solid var(--app-border); }
.page-tabs a { padding: 10px 0; border-bottom: 2px solid transparent; color: var(--app-text-soft); font-size: 13px; font-weight: 500; }
.page-tabs a[aria-current="page"] { border-bottom-color: var(--app-link); color: var(--app-link); }
.member-picker { display: grid; gap: 4px; max-height: 360px; margin-top: 10px; padding: 8px; overflow-y: auto; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface); }
.member-picker .selection-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-actions { display: flex; gap: 4px; align-items: center; }
.row-actions form { margin: 0; }
.scheduler-warning { margin: 0 0 16px; padding: 14px 16px; border-left: 3px solid var(--app-warning-text); background: var(--app-warning-soft); color: var(--app-warning-text); font-size: 13px; }
.task-flags, .weekday-picker, .column-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.task-flags .selection-row, .weekday-picker .selection-row, .column-picker .selection-row { padding: 10px 14px; }
.weekday-picker { margin: 12px 0 0; padding: 0; border: 0; }
.dataset-list { display: grid; gap: 16px; margin-bottom: 12px; }
.dataset-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface-muted); }
.dataset-card legend { padding: 0 6px; font-weight: 600; }
.filter-list { display: grid; gap: 8px; }
.filter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px; align-items: center; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.template-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-actions form { margin: 0; }
.preview-email { width: 100%; min-height: 520px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface); }
.preview-sms { padding: 14px 16px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface-muted); color: var(--app-text); white-space: pre-wrap; font-size: 13px; }
.run-summary { display: grid; gap: 8px; }
.run-summary div { display: flex; gap: 12px; }
.run-summary dt { min-width: 140px; color: var(--app-muted); font-size: 13px; }
@media (max-width: 640px) {
    .filter-row { grid-template-columns: 1fr; }
}

/* Store plans (dhtmlxGantt) */
.store-plan-description { margin: 0 0 12px; }
.store-plan-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.store-plan-zoom { display: inline-flex; gap: 4px; }
.store-plan-zoom [aria-pressed="true"] { border-color: var(--app-link); color: var(--app-link); background: var(--app-primary-soft); }
.store-plan-search { width: min(240px, 100%); }
.store-plan-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; color: var(--app-muted); font-size: 12px; }
.store-plan-legend .sw { display: inline-block; width: 18px; height: 8px; margin-right: 6px; border-radius: 4px; vertical-align: middle; }
.store-plan-legend .sw.actual { background: var(--app-link); }
.store-plan-legend .sw.planned { background: var(--app-muted); }
.store-plan-legend .sw.late { background: transparent; box-shadow: 0 0 0 2px var(--app-danger) inset; }
.store-plan-legend .sw.today { width: 3px; height: 12px; background: var(--app-danger); }
.store-plan-gantt { height: calc(100dvh - 300px); min-height: 460px; border: 1px solid var(--app-border); border-radius: 6px; overflow: hidden; }
.sp-overlay { position: absolute; z-index: 1; }
.sp-overlay.baseline { height: 7px; border-radius: 4px; background: var(--app-muted); opacity: .75; }
.sp-overlay.baseline.ms { width: 10px !important; transform: rotate(45deg) scaleX(.7); }
.sp-overlay.today-line { top: 0; width: 2px; background: var(--app-danger); pointer-events: none; z-index: 2; }
.sp-overlay.store-target, .sp-overlay.store-actual { height: 3px; border-radius: 2px; }
.sp-overlay.store-target { background: var(--app-accent); }
.sp-overlay.store-actual { background: var(--app-link); }
.sp-overlay.store-actual.is-open { background: repeating-linear-gradient(90deg, var(--app-link) 0 6px, transparent 6px 9px); }
.sp-overlay.target-late { height: 18px; padding: 0 6px; border: 1px solid var(--app-danger-line); border-radius: 9px; background: var(--app-danger-soft); color: var(--app-danger); font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap; pointer-events: none; }
.store-plan-legend .sw.target { height: 3px; background: var(--app-accent); }
.store-plan-legend .sw.target-actual { height: 3px; background: var(--app-link); }
.gantt_task_cell.sp-weekend, .gantt_scale_cell.sp-weekend { background: var(--app-surface-muted); }
.gantt_task_line.sp-st-done { background: var(--app-success); border-color: var(--app-success); }
.gantt_task_line.sp-st-on_hold { opacity: .75; }
.gantt_task_line.sp-st-cancelled { opacity: .45; }
.gantt_task_line.sp-late-bar { box-shadow: 0 0 0 2px var(--app-danger) inset; }
.gantt_row.sp-row .gantt_tree_content { font-weight: 600; }
.sp-store-link { color: inherit; }
.sp-dim { color: var(--app-muted); }
.sp-late { color: var(--app-danger); font-weight: 600; }
.sp-early { color: var(--app-success); font-weight: 600; }
.sp-status { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: var(--app-surface-muted); }
.sp-status-in_progress { background: var(--app-primary-soft); color: var(--app-link); }
.sp-status-done { background: var(--app-success-soft); color: var(--app-success); }
.sp-status-on_hold { background: var(--app-warning-soft); color: var(--app-warning-text); }
.sp-status-cancelled { background: var(--app-danger-soft); color: var(--app-danger); }
.sp-grid-btn { width: 22px; height: 22px; margin: 0 2px; border: 1px solid var(--app-border); border-radius: 4px; background: var(--app-surface); color: var(--app-text); line-height: 1; }
.store-plan-dialog { width: min(640px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); color: var(--app-text); }
.store-plan-dialog::backdrop { background: var(--app-overlay); }
.store-plan-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.store-plan-dialog h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
.store-plan-results { display: grid; gap: 6px; max-height: 240px; margin: 8px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.store-plan-results li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--app-border); border-radius: 6px; }
.store-plan-toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 1100; padding: 10px 16px; border-radius: 8px; background: var(--app-text); color: var(--app-surface); font-size: 13px; }
.store-plan-toast.is-error { background: var(--app-danger); color: var(--app-surface); }
@media (max-width: 640px) { .store-plan-gantt { height: 70dvh; } }

/* Companies */
.company-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.company-picker .kt-select { flex: 1 1 220px; }
.company-filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.company-dialog { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); color: var(--app-text); }
.company-dialog::backdrop { background: var(--app-overlay); }
.company-dialog h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.company-dialog-error { margin: 0 0 10px; color: var(--app-danger); font-size: 13px; }

/* Users: login switch */
[data-login-only][hidden] { display: none; }
.role-picker { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.role-picker legend { margin-bottom: 8px; }
.password-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.password-tools input { flex: 1 1 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.password-status:empty { display: none; }
.password-tools .kt-btn.is-copied, .password-tools .kt-btn.is-copied:hover { background: var(--app-success-soft); color: var(--app-success); border-color: var(--app-success-line); }

/* Store form date picker (flatpickr). Its stylesheet loads after app.css, so the overrides are prefixed with :root. */
.store-date-control { display: flex; gap: 6px; align-items: center; }
.store-date-control .kt-input { flex: 1 1 auto; min-width: 0; }
:root .flatpickr-calendar { background: var(--app-surface); color: var(--app-text); border: 1px solid var(--app-border); box-shadow: none; }
:root .flatpickr-calendar.arrowTop::before { border-bottom-color: var(--app-border); }
:root .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--app-surface); }
:root .flatpickr-calendar.arrowBottom::before { border-top-color: var(--app-border); }
:root .flatpickr-calendar.arrowBottom::after { border-top-color: var(--app-surface); }
:root .flatpickr-months .flatpickr-month, :root .flatpickr-current-month input.cur-year, :root .flatpickr-current-month .flatpickr-monthDropdown-months { background: transparent; color: var(--app-text); fill: var(--app-text); }
:root .flatpickr-current-month .flatpickr-monthDropdown-months option { background: var(--app-surface); color: var(--app-text); }
:root .flatpickr-months .flatpickr-prev-month, :root .flatpickr-months .flatpickr-next-month { color: var(--app-text); fill: var(--app-text); }
:root .flatpickr-months .flatpickr-prev-month:hover svg, :root .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--app-link); }
:root span.flatpickr-weekday { color: var(--app-muted); }
:root .flatpickr-calendar .flatpickr-day { color: var(--app-text); }
:root .flatpickr-calendar .flatpickr-day:hover, :root .flatpickr-calendar .flatpickr-day:focus { background: var(--app-hover); border-color: var(--app-hover); }
:root .flatpickr-calendar .flatpickr-day.today { border-color: var(--app-primary-line); }
:root .flatpickr-calendar .flatpickr-day.today:hover, :root .flatpickr-calendar .flatpickr-day.today:focus { color: var(--app-text); }
:root .flatpickr-current-month .numInputWrapper span.arrowUp:after { border-bottom-color: var(--app-muted); }
:root .flatpickr-current-month .numInputWrapper span.arrowDown:after { border-top-color: var(--app-muted); }
:root .flatpickr-calendar .flatpickr-day.selected, :root .flatpickr-calendar .flatpickr-day.selected:hover, :root .flatpickr-calendar .flatpickr-day.selected:focus { background: var(--app-link); border-color: var(--app-link); color: var(--app-surface); }
:root .flatpickr-calendar .flatpickr-day.prevMonthDay, :root .flatpickr-calendar .flatpickr-day.nextMonthDay { color: var(--app-muted); }
:root .flatpickr-calendar .flatpickr-day.flatpickr-disabled, :root .flatpickr-calendar .flatpickr-day.flatpickr-disabled:hover { background: transparent; border-color: transparent; color: var(--app-muted); opacity: .4; cursor: not-allowed; }

/* Store reports */
.report-form .field { margin-bottom: 20px; }
.report-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--app-border); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--app-surface-muted); }
.report-toolbar [aria-pressed="true"] { background: var(--app-primary-soft); color: var(--app-link); }
.report-toolbar-separator { width: 1px; margin: 4px 2px; background: var(--app-border); }
.report-editor { min-height: 220px; max-height: 60dvh; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: 0 0 6px 6px; background: var(--app-surface); color: var(--app-text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.report-editor:focus { outline: 2px solid var(--app-primary-line); outline-offset: 0; }
.report-editor[data-empty="true"]::before { content: attr(data-placeholder); color: var(--app-muted); pointer-events: none; }
.report-body, .report-editor { max-width: 860px; }
.report-body p, .report-editor p { margin: 0 0 .75em; }
.report-body ul, .report-editor ul { list-style: disc; padding-left: 1.5em; margin: 0 0 .75em; }
.report-body ol, .report-editor ol { list-style: decimal; padding-left: 1.5em; margin: 0 0 .75em; }
.report-body strong, .report-editor strong, .report-editor b { font-weight: 600; }
.report-body em, .report-editor em, .report-editor i { font-style: italic; }
.report-article { padding: 8px 0 24px; }
.report-meta { margin-bottom: 16px; overflow-wrap: anywhere; }
.report-body { font-size: 14px; line-height: 1.7; color: var(--app-text); overflow-wrap: anywhere; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-error { color: var(--app-danger); font-size: 13px; }
.report-old-title { display: block; color: var(--app-muted); font-size: 12px; overflow-wrap: anywhere; }
.report-next-note { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 16px; color: var(--app-muted); font-size: 13px; }
.report-next-note > i { margin-top: 2px; }
.report-upload-hint { display: block; margin: 0 0 12px; }

/* Store report feed (store page and public link page) */
.report-feed { display: grid; gap: 16px; margin-top: 24px; min-width: 0; }
.report-feed-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.report-feed-head h2 { margin: 0; }
.report-feed-list { display: grid; border-top: 1px solid var(--app-border); min-width: 0; }
.report-card { display: grid; gap: 12px; min-width: 0; padding: 20px 0; border-bottom: 1px solid var(--app-border); scroll-margin-top: 80px; }
.report-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.report-card-author { color: var(--app-text); font-weight: 600; overflow-wrap: anywhere; }
.report-card-tools { display: flex; align-items: center; gap: 8px; color: var(--app-muted); font-size: 12px; }
.report-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-pdf.is-loading { pointer-events: none; opacity: .75; }
.report-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.report-tile { display: grid; gap: 4px; align-content: start; min-width: 0; }
.report-tile-preview { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface-muted); color: var(--app-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.report-tile-preview > i { font-size: 28px; }
.report-tile-preview img, .report-tile-preview video { width: 100%; height: 100%; object-fit: cover; }
.report-tile-preview:hover, .report-tile-preview:focus-visible { border-color: var(--app-link); }
.report-tile-preview:focus-visible { outline: 2px solid var(--app-primary-line); outline-offset: 2px; }
.report-tile-video video { pointer-events: none; }
.report-tile-play { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--app-viewer-bg); color: var(--app-viewer-text); font-size: 18px; transform: translate(-50%, -50%); }
.report-tile-name { overflow: hidden; color: var(--app-text-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.report-composer-open { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 16px; border: 1px dashed var(--app-border); border-radius: 8px; background: var(--app-surface); color: var(--app-muted); font-size: 14px; text-align: left; cursor: text; }
.report-composer-open:hover, .report-composer-open:focus-visible { border-color: var(--app-link); color: var(--app-text); }
.report-composer-form { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); min-width: 0; }
.report-composer-form .field { margin-bottom: 0; }
.report-feed-more { display: flex; justify-content: center; }
.report-feed-status { text-align: center; }
@media (max-width: 480px) { .report-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Store report share link panel */
.store-report-link { display: grid; gap: .75rem; padding: 1rem; margin-top: 24px; }
.report-link-warning { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--app-warning-soft); color: var(--app-warning-text); font-size: 13px; max-width: 72ch; }
.report-link-warning > i { margin-top: 2px; }
.report-link-new, .report-link-form { display: grid; gap: 8px; }
.report-link-form .kt-input { max-width: 220px; }
.report-link-form .kt-btn { justify-self: start; }
.report-link-details { margin: 0; }
.report-public-head { display: grid; gap: 4px; }
.report-public-head h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--app-text); overflow-wrap: anywhere; }
.files-public-shell .report-feed { margin-top: 0; }

/* File viewer (file-viewer.js) */
.file-viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--app-viewer-bg); color: var(--app-viewer-text); }
.file-viewer::backdrop { background: var(--app-viewer-bg); }
.file-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 12px; }
.file-viewer-heading { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.file-viewer-title { margin: 0; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; color: var(--app-viewer-text); }
.file-viewer-counter, .file-viewer-zoom { flex: none; color: var(--app-viewer-muted); font-size: 12px; }
.file-viewer-tools { display: flex; flex: none; align-items: center; gap: 2px; }
.file-viewer-button, .file-viewer-button:hover { color: var(--app-viewer-text); }
.file-viewer-body { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; height: calc(100dvh - 56px); padding: 0 8px 12px; }
.file-viewer-stage { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; min-width: 0; overflow: auto; }
.file-viewer-image { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; transition: transform .16s ease; }
.file-viewer-video { max-width: 100%; max-height: 100%; background: var(--app-viewer-bg); }
.file-viewer-frame { width: min(100%, 960px); height: 100%; border: 0; border-radius: 4px; background: var(--app-surface); }
.file-viewer-status { position: absolute; inset: 50% auto auto 50%; margin: 0; color: var(--app-viewer-muted); font-size: 14px; transform: translate(-50%, -50%); text-align: center; }
.file-viewer-nav { justify-self: center; }
@media (max-width: 640px) {
    .file-viewer-body { grid-template-columns: 36px minmax(0, 1fr) 36px; padding: 0 0 8px; }
    .file-viewer-zoom { display: none; }
}

/* Store report attachments */
.report-attachments-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.report-attachments-head .muted { font-weight: 400; }
.report-dropzone { display: grid; justify-items: center; gap: 8px; padding: 24px 16px; border: 1px dashed var(--app-border); border-radius: 8px; background: var(--app-surface-muted); color: var(--app-text-soft); text-align: center; transition: border-color .15s, background-color .15s; }
.report-dropzone > i { font-size: 28px; color: var(--app-muted); }
.report-dropzone.is-dragover { border-color: var(--app-link); background: var(--app-primary-soft); }
.report-dropzone:focus-within { outline: 2px solid var(--app-primary-line); outline-offset: 2px; }
.report-dropzone .field-note { max-width: 560px; }
.report-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.report-upload-list { display: grid; gap: 8px; margin-top: 12px; }
.report-upload-list:empty { display: none; }
.report-upload-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface); font-size: 13px; }
.report-upload-name { min-width: 0; overflow-wrap: anywhere; font-weight: 500; color: var(--app-text); }
.report-upload-status { grid-column: 1; color: var(--app-muted); overflow-wrap: anywhere; }
.report-upload-item .kt-btn { grid-column: 2; grid-row: 1 / span 2; }
.report-upload-item.is-error .report-upload-status { color: var(--app-danger); }
.report-upload-item.is-done .report-upload-status { color: var(--app-success); }
.report-progress { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--app-divider); overflow: hidden; }
.report-progress > span { display: block; width: 0; height: 100%; background: var(--app-link); transition: width .2s; }
.report-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.report-file { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 8px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); }
.report-file-preview { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--app-surface-muted); color: var(--app-muted); font-size: 32px; overflow: hidden; }
.report-file-thumb { width: 100%; height: 100%; object-fit: cover; }
.report-file-name { min-width: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.report-file-meta { font-size: 12px; }
@media (max-width: 480px) { .report-files { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Brand logo (img/bltlogo.svg, dark navy): wide mark; shown light on the dark theme. */
.brand-logo { height: 28px; width: auto; flex-shrink: 0; }
.login-brand .brand-logo { height: 36px; }
html.dark .brand-logo { filter: brightness(0) invert(1); }
.sidebar-collapsed .sidebar-brand .brand-logo { width: 100%; height: auto; max-height: 28px; }

/* Double-submit guard (app.js): busy submit buttons and fetch actions. currentColor follows the button's theme colour. */
.app-busy-spinner { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: app-busy-spin .7s linear infinite; }
[aria-busy="true"] { cursor: progress; }
@keyframes app-busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .app-busy-spinner { animation-duration: 2s; } }

/* Read-only user view (partials/impersonation-banner.php): fixed bar above everything (also the maintenance and idle
   layers, so "Görünümden çık" stays reachable); impersonation.js sets --impersonation-bar to its real height. */
html[data-impersonating="1"] { --impersonation-bar: 48px; }
.impersonation-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 10002; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 48px; padding: 8px 32px; background: var(--app-warning-bar); border-bottom: 1px solid var(--app-warning-line); color: var(--app-warning-text); font-size: 13px; line-height: 1.45; }
.impersonation-banner > i { font-size: 18px; flex-shrink: 0; }
.impersonation-banner p { flex: 1 1 240px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.impersonation-banner form { margin: 0; }
.impersonation-banner .kt-btn { color: var(--app-warning-text); border-color: var(--app-warning-line); background: transparent; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-actions form { margin: 0; }
html[data-impersonating="1"] .notification-drawer { top: calc(12px + var(--impersonation-bar)); max-height: calc(100dvh - 24px - var(--impersonation-bar)); }
html[data-impersonating="1"] .files-nav { top: calc(104px + var(--impersonation-bar)); }
html[data-impersonating="1"] .menu-editor-bar { top: calc(72px + var(--impersonation-bar)); }
html[data-impersonating="1"] .app-sidebar { top: var(--impersonation-bar); height: calc(100dvh - var(--impersonation-bar)); }
html[data-impersonating="1"] .demo1 .app-header { top: var(--impersonation-bar); }
html[data-impersonating="1"] .demo1 .app-wrapper { padding-top: calc(72px + var(--impersonation-bar)); }
html[data-impersonating="1"] .auth-shell { padding-top: calc(32px + var(--impersonation-bar)); }
html[data-impersonating="1"] .assistant-panel { height: min(600px, calc(100dvh - 116px - var(--impersonation-bar) - env(safe-area-inset-bottom, 0px))); }
@media (max-width: 1023px) {
    .impersonation-banner { padding: 8px 20px; }
    html[data-impersonating="1"] .demo1 .app-wrapper { padding-top: calc(64px + var(--impersonation-bar)); }
}
@media (max-width: 600px) {
    html[data-impersonating="1"] { --impersonation-bar: 84px; }
    .impersonation-banner { font-size: 12px; }
}
@media (max-width: 639px) {
    html[data-impersonating="1"] .assistant-panel { top: var(--impersonation-bar); height: calc(100dvh - var(--impersonation-bar)); }
}
@media print {
    html[data-impersonating="1"] { --impersonation-bar: 0px !important; }
    .impersonation-banner { position: static; }
    .impersonation-banner form { display: none; }
}
.impersonation-info { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--app-primary-line); border-radius: 6px; background: var(--app-primary-soft); color: var(--app-text); font-size: 13px; overflow-wrap: anywhere; }
.impersonation-info i { flex: 0 0 auto; margin-top: 2px; color: var(--app-link); }
.impersonation-table { min-width: 560px; }
.impersonation-table td:last-child { white-space: nowrap; }
.load-time-badge { font-size: 10px; padding: 0 6px; line-height: 16px; height: auto; min-height: 0; }
.schedule-table th, .schedule-table td { text-align: center; white-space: nowrap; }
.schedule-table th:first-child, .schedule-table td:first-child { text-align: left; }
.schedule-total td { border-top: 2px solid var(--app-border); }
.schedule-late { color: var(--app-danger); font-weight: 600; }
.plan-form { display: flex; flex-direction: column; gap: 24px; }
.plan-form .field { gap: 8px; }
.plan-form .kt-btn[type="submit"] { align-self: flex-start; margin-top: 4px; }
