/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background-color: #f4f7f6; color: #333; line-height: 1.6; }
a { text-decoration: none; color: #005a9e; }
/* Views */
.view-container { width: 100%; min-height: 100vh; }
.sub-view { animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Utilities */
.fw-bold { font-weight: bold; }
.req { color: #c62828; }
.btn { border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: bold; }
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-primary { background: #005a9e; color: #fff; }
.btn-secondary { background: #e0e0e0; color: #333; margin-right: 10px; }
.btn-danger { background: #c62828; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.error-msg { color: #c62828; margin-top: 10px; font-size: 14px; min-height: 20px; }
.badge { background: #e0e0e0; padding: 2px 6px; border-radius: 4px; font-size: 12px; margin: 0 10px; }
/* Alert Messages */
.alert { padding: 10px; margin-bottom: 15px; border-radius: 4px; font-size: 14px; text-align: left; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
/* U4A v2.2 - keep list data status visually prominent while refreshing/loading. */
.accgen-data-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    font-weight: 600;
}
.accgen-data-status--loading {
    gap: 0;
    background: #e8f4fd;
    color: #004085;
    border: 1px solid #8fc2e8;
    box-shadow: 0 1px 3px rgba(0, 90, 158, 0.12);
}
.accgen-data-status--loading::before {
    content: "";
    display: inline-block;
    box-sizing: border-box;
    flex: 0 0 20px;
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    align-self: center;
    position: relative;
    top: 4px;
    margin-right: 12px;
    border: 3px solid #9fc8e5;
    border-top-color: #005a9e;
    border-right-color: #005a9e;
    border-radius: 50%;
    animation: accgenScopedLoadingSpin 0.8s linear infinite;
}
.accgen-data-status--warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffe08a;
}
.accgen-data-status--neutral {
    background: #f5f7f9;
    color: #4a5568;
    border: 1px solid #dce2e8;
}
/* U4A - scoped loading. The legacy overlay remains as a compact fallback only. */
#loading-overlay {
    position: fixed;
    top: 12px;
    right: 12px;
    left: auto;
    width: auto;
    height: auto;
    max-width: calc(100vw - 24px);
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #d7e3ec;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
#loading-overlay.loading-overlay--silent {
    display: none !important;
}
.spinner { font-weight: bold; color: #005a9e; }
.accgen-scoped-loading {
    display: none;
    align-items: center;
    gap: 9px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 9px 12px;
    border: 1px solid #d7e3ec;
    border-radius: 8px;
    background: #f7fbff;
    color: #31566f;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}
.accgen-scoped-loading::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid #c5d8e6;
    border-top-color: #005a9e;
    border-radius: 50%;
    animation: accgenScopedLoadingSpin 0.8s linear infinite;
}
.accgen-loading-scope {
    position: relative;
}
.accgen-scoped-loading--floating {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 40;
    width: auto;
    max-width: min(360px, calc(100% - 16px));
    margin: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    pointer-events: none;
}
.login-card .accgen-scoped-loading {
    justify-content: center;
    width: 100%;
    margin: 14px 0 2px;
}
/* U4A v2.3 - keep login checking state vertically balanced.
   Empty Google/error regions must not reserve space below the scoped loader. */
.login-card[aria-busy="true"] #google-btn-container:empty,
.login-card[aria-busy="true"] #login-error:empty {
    display: none;
    margin: 0;
    min-height: 0;
}
@keyframes accgenScopedLoadingSpin {
    to { transform: rotate(360deg); }
}
@media (max-width: 560px) {
    .accgen-scoped-loading:not(.accgen-scoped-loading--floating) {
        width: 100%;
    }
    .accgen-scoped-loading--floating {
        top: 6px;
        right: 6px;
        max-width: calc(100% - 12px);
    }
}
/* Login View */
#view-login {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-card h2 {
    color: #005a9e;
    margin-bottom: 10px;
}
.google-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
/* Settings & Forms */
#view-settings {
    padding: 0;
}
.settings-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
    text-align: center;
}
.settings-card h2 {
    color: #005a9e;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
#form-user-settings,
#form-person {
    text-align: left;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    background: #fafafa;
}
legend {
    padding: 0 10px;
    font-weight: bold;
    color: #005a9e;
    background: #f4f7f6;
    border-radius: 4px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
@media (min-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: bold;
    color: #555;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #005a9e;
    outline: none;
}
.form-actions {
    text-align: right;
    margin-top: 20px;
}
/* Advanced Details (Collapsible) */
.advanced-details {
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 20px;
}
.advanced-details summary {
    font-weight: bold;
    color: #005a9e;
    cursor: pointer;
    outline: none;
}
/* Main App View */
.app-header {
    background: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.app-header .logo {
    font-size: 20px;
    font-weight: bold;
    color: #005a9e;
}
.user-menu {
    display: flex;
    align-items: center;
}
.app-nav {
    background: #005a9e;
    overflow-x: auto;
    white-space: nowrap;
}
.app-nav ul {
    list-style: none;
    display: flex;
}
.app-nav a {
    display: block;
    color: #fff;
    padding: 12px 20px;
    opacity: 0.8;
}
.app-nav a.active,
.app-nav a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}
.app-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
/* Page Layouts & Toolbars */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.page-header h2 {
    color: #005a9e;
    margin: 0;
}
.toolbar {
    margin-bottom: 15px;
}
.list-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.list-toolbar__search {
    flex: 1;
    max-width: 400px;
}
.list-toolbar__sort-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}
.list-toolbar__sort {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    outline: none;
}
.list-toolbar__sort:focus {
    border-color: #005a9e;
}
.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.responsive-table {
    width: 100%;
    border-collapse: collapse;
}
.responsive-table th,
.responsive-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.responsive-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}
.responsive-table tbody tr:hover {
    background-color: #f1f5f9;
}
/* Row Actions Layout (Responsive - Desktop/Tablet) */
@media (min-width: 768px) {
    .row-actions,
    .batch-row-actions {
        display: inline-flex;
        gap: 8px;
    }
    .row-actions .btn-action,
    .batch-row-actions .btn-action {
        margin: 0;
    }
}
/* Mobile Layout Overrides */
@media (max-width: 767px) {
    .list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .list-toolbar__search {
        max-width: 100%;
    }
    .list-toolbar__sort-wrapper {
        justify-content: space-between;
    }
    .list-toolbar__sort {
        flex: 1;
        margin-left: 10px;
    }
    /* Neutralize outer double-card wrapper for lists */
    .list-table-wrapper {
        background: transparent;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        overflow-x: visible;
    }
    /* Neutralize outer double-card wrapper for Batch Review */
    #view-batch-review .table-responsive {
        background: transparent;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        overflow-x: visible;
    }
    .responsive-table thead {
        display: none;
    }
    .responsive-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    /* Generic table mobile td (used by Batch review) */
    .responsive-table td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border-bottom: 1px dashed #eee;
        font-size: 14px;
    }
    .responsive-table td:last-child {
        border-bottom: none;
    }
    .responsive-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #555;
    }
    /* Person/Business Field Row Fix (No Float Collapse) */
    .list-table-wrapper .responsive-table td {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        text-align: right;
        min-width: 0;
        padding: 8px 0;
        border-bottom: 1px dashed #eee;
    }
    .list-table-wrapper .responsive-table td::before {
        float: none;
        flex: 0 0 auto;
        text-align: left;
    }
    /* Person/Business Action Row */
    .row-actions {
        display: flex;
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
        margin-top: 5px;
    }
    .row-actions .btn-action {
        width: auto;
        flex: 1;
        min-width: 0;
        margin-top: 0;
        margin-left: 0;
    }
    /* Batch Action Alignment */
    .batch-row-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
        min-width: 0;
        margin-top: 5px;
    }
    .batch-row-actions .btn-action {
        width: auto;
        min-width: 0;
        margin-left: 0;
        margin-top: 0;
    }
    /* Keep old standalone btn-action fallback for safe isolation */
    .responsive-table td .btn-action:not(.row-actions .btn-action):not(.batch-row-actions .btn-action) {
        margin-top: 5px;
        width: 100%;
    }
}
/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}
#person-page-info {
    font-weight: bold;
    color: #555;
    font-size: 14px;
}
/* ========================================================= */
/* SETTINGS ONBOARDING MODAL */
/* ========================================================= */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}
.settings-modal-overlay .settings-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
/* ========================================================= */
/* SETTINGS NORMAL SUB-VIEW */
/* ========================================================= */
.settings-subview {
    width: 100%;
}
.settings-subview .settings-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}
/* ========================================================= */
/* SETTINGS MOBILE ONBOARDING */
/* ========================================================= */
@media (max-width: 600px) {
    .settings-modal-overlay {
        padding: 10px;
        align-items: flex-start;
    }
    .settings-modal-overlay .settings-card {
        margin-top: 10px;
        max-height: calc(100vh - 20px);
    }
}
/* ========================================================= */
/* QR SCANNER MODAL (Mobile-first) */
/* ========================================================= */
.qr-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-scanner-content {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.qr-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
}
.qr-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.qr-viewfinder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
/* ========================================================= */
/* ADDRESS STATUS BADGE (3D UX) */
/* ========================================================= */
.address-status-badge {
    display: inline-block;
    padding: 6px 12px;
    margin-top: 5px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
}
.address-status-badge--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.address-status-badge--warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
.address-status-badge--danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.address-status-badge--neutral {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}
/* ========================================================= */
/* TEMPLATE MAPPING EDITOR - RESPONSIVE FOUNDATION */
/* Scoped to Admin template mapping only. */
/* ========================================================= */
.template-mapping-toolbar {
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.template-mapping-toolbar h3 {
    margin-right: auto !important;
}
.template-mapping-toolbar .btn {
    margin-right: 0;
    white-space: nowrap;
}
.template-mapping-table-wrapper {
    width: 100%;
    overflow-x: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
#tpl-mapping-table {
    width: 100%;
    table-layout: fixed;
    font-size: 13px;
}
#tpl-mapping-table th,
#tpl-mapping-table td {
    min-width: 0;
    padding: 9px 8px;
    vertical-align: top;
}
#tpl-mapping-table .template-mapping-header,
#tpl-mapping-table .template-mapping-cell {
    overflow-wrap: anywhere;
}
#tpl-mapping-table .template-mapping-header--bulk,
#tpl-mapping-table .template-mapping-cell--bulk {
    width: 42px;
    text-align: center;
}
#tpl-mapping-table .template-mapping-header--placeholder,
#tpl-mapping-table .template-mapping-cell--placeholder {
    width: 14%;
}
#tpl-mapping-table .template-mapping-header--count,
#tpl-mapping-table .template-mapping-cell--count {
    width: 56px;
    text-align: center;
}
#tpl-mapping-table .template-mapping-header--analysis,
#tpl-mapping-table .template-mapping-cell--analysis {
    width: 76px;
}
#tpl-mapping-table .template-mapping-header--status,
#tpl-mapping-table .template-mapping-cell--status {
    width: 94px;
}
#tpl-mapping-table .template-mapping-header--source,
#tpl-mapping-table .template-mapping-cell--source {
    width: 36%;
}
#tpl-mapping-table .template-mapping-header--confidence,
#tpl-mapping-table .template-mapping-cell--confidence {
    width: 82px;
}
#tpl-mapping-table .template-mapping-header--required,
#tpl-mapping-table .template-mapping-cell--required {
    width: 72px;
}
#tpl-mapping-table .template-mapping-header--action,
#tpl-mapping-table .template-mapping-cell--action {
    width: 82px;
}
#tpl-mapping-table .template-mapping-cell--analysis,
#tpl-mapping-table .template-mapping-cell--status,
#tpl-mapping-table .template-mapping-cell--confidence,
#tpl-mapping-table .template-mapping-cell--required,
#tpl-mapping-table .template-mapping-cell--action {
    white-space: nowrap;
}
#tpl-mapping-table .template-mapping-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0;
    white-space: nowrap;
    line-height: 1.25;
}
#tpl-mapping-table .template-mapping-select {
    display: block;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    height: 36px;
    padding: 7px 8px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
}
#tpl-mapping-table .template-mapping-row-action {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-left: 8px;
    padding-right: 8px;
}
#tpl-mapping-table .template-mapping-bulk-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}
#tpl-mapping-table .template-mapping-bulk-checkbox:disabled {
    cursor: not-allowed;
}
/* Tablet and narrow desktop: turn the dense 9-column grid into cards. */
@media (max-width: 1050px) {
    .template-mapping-table-wrapper {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    #tpl-mapping-table {
        display: block;
        width: 100%;
        table-layout: auto;
    }
    #tpl-mapping-table thead {
        display: none;
    }
    #tpl-mapping-table tbody {
        display: grid;
        gap: 12px;
    }
    #tpl-mapping-table tbody .template-mapping-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 12px;
        margin: 0 !important;
        padding: 12px 14px !important;
        border: 1px solid #dde3e8;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }
    #tpl-mapping-table .template-mapping-cell {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: 118px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        width: auto !important;
        min-width: 0;
        padding: 7px 0 !important;
        border-bottom: 1px dashed #e6e8eb;
        text-align: left !important;
        white-space: normal;
    }
    #tpl-mapping-table .template-mapping-cell::before {
        content: attr(data-label);
        float: none !important;
        display: block;
        min-width: 0;
        color: #667085;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.35;
        text-align: left;
    }
    #tpl-mapping-table .template-mapping-cell--placeholder {
        grid-column: 1;
        grid-row: 1;
        display: block !important;
        padding: 0 0 10px !important;
        border-bottom: 1px solid #edf0f2;
        font-size: 15px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }
    #tpl-mapping-table .template-mapping-cell--placeholder::before {
        display: none;
    }
    #tpl-mapping-table .template-mapping-cell--bulk {
        grid-column: 2;
        grid-row: 1;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        width: auto !important;
        padding: 0 0 10px !important;
        border-bottom: 1px solid #edf0f2;
        white-space: nowrap;
    }
    #tpl-mapping-table .template-mapping-cell--bulk::before {
        content: attr(data-label);
        display: inline;
        color: #667085;
        font-size: 12px;
        font-weight: 700;
    }
    #tpl-mapping-table .template-mapping-cell--count {
        text-align: left !important;
    }
    #tpl-mapping-table .template-mapping-cell--source {
        display: block !important;
    }
    #tpl-mapping-table .template-mapping-cell--source::before {
        margin-bottom: 6px;
    }
    #tpl-mapping-table .template-mapping-select {
        width: 100%;
        min-width: 0 !important;
        height: 40px;
        font-size: 14px;
    }
    #tpl-mapping-table .template-mapping-cell--action {
        border-bottom: 0;
        align-items: center;
    }
    #tpl-mapping-table .template-mapping-row-action {
        min-height: 40px;
    }
    #tpl-mapping-table .template-mapping-bulk-checkbox {
        width: 20px;
        height: 20px;
    }
}
/* Phone / PWA touch foundation. */
@media (max-width: 560px) {
    .template-mapping-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
    .template-mapping-toolbar h3 {
        grid-column: 1 / -1;
        margin-right: 0 !important;
    }
    .template-mapping-toolbar .btn {
        width: 100%;
        min-height: 42px;
        padding: 9px 8px;
        font-size: 13px;
    }
    #tpl-mapping-table tbody .template-mapping-row {
        padding: 11px 12px !important;
        border-radius: 9px;
    }
    #tpl-mapping-table .template-mapping-cell {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px;
        padding: 7px 0 !important;
    }
    #tpl-mapping-table .template-mapping-select {
        min-height: 44px;
        height: 44px;
        padding: 8px 9px;
        font-size: 16px;
    }
    #tpl-mapping-table .template-mapping-row-action {
        min-height: 44px;
        font-size: 14px;
    }
    #tpl-mapping-table .template-mapping-bulk-checkbox {
        width: 22px;
        height: 22px;
    }
}
/* ========================================================= */
/* TEMPLATE MAPPING EDITOR - SEMANTIC ORGANIZATION M1        */
/* PERSON / BUSINESS / COMPANY                               */
/* ========================================================= */
#tpl-mapping-table .template-mapping-group-row {
    background: #eef4f8;
}
#tpl-mapping-table .template-mapping-group-cell {
    padding: 10px 12px;
    border-top: 2px solid #d3e1ea;
    border-bottom: 1px solid #dbe5ec;
    color: #23445c;
}
#tpl-mapping-table .template-mapping-group-title {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
#tpl-mapping-table .template-mapping-group-summary {
    display: block;
    margin-top: 2px;
    color: #667785;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
}
#tpl-mapping-table .template-mapping-select optgroup {
    font-weight: 700;
}
#tpl-mapping-table .template-mapping-select option {
    font-weight: 400;
}
@media (max-width: 1050px) {
    #tpl-mapping-table tbody .template-mapping-group-row {
        display: block !important;
        width: 100%;
        margin: 4px 0 0 !important;
        padding: 0 !important;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    #tpl-mapping-table .template-mapping-group-cell {
        display: block !important;
        width: 100% !important;
        padding: 10px 12px !important;
        border: 1px solid #d7e2ea;
        border-left: 4px solid #6f94ad;
        border-radius: 8px;
        background: #eef4f8;
        text-align: left !important;
    }
}
@media (max-width: 560px) {
    #tpl-mapping-table .template-mapping-group-cell {
        padding: 9px 10px !important;
    }
    #tpl-mapping-table .template-mapping-group-title {
        font-size: 12px;
    }
    #tpl-mapping-table .template-mapping-group-summary {
        font-size: 11px;
    }
}
/* TEMPLATE USER GENERATE + HISTORY RESPONSIVE POLISH */
#templates-user-state .templates-generate-card,
#templates-user-state .templates-history-card { padding: 16px !important; }
#templates-user-state #user-generate-tabs { margin-bottom: 14px !important; padding-bottom: 10px !important; }
#templates-user-state .templates-single-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
#templates-user-state .templates-single-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
#templates-user-state #btn-user-generate { min-width: 160px; margin: 0; }
/* Batch create: prioritize long profile/company names and keep sequence compact. */
#templates-batch-table { table-layout: fixed; }
#templates-batch-table th:nth-child(1) { width: 64px !important; }
#templates-batch-table th:nth-child(2) { width: 64px !important; }
#templates-batch-table th:nth-child(4) { width: 140px; }
#templates-batch-table th:nth-child(5) { width: 125px; }
#templates-batch-table td:nth-child(3) { overflow-wrap: anywhere; word-break: break-word; }
#templates-batch-table .template-batch-sequence { width: 100% !important; min-width: 0 !important; min-height: 32px; padding: 5px 8px; font-size: 14px; }
#templates-user-state .templates-history-card { margin-top: 16px !important; }
#templates-user-state .templates-history-card > .page-header { margin-bottom: 12px !important; padding-bottom: 8px; }
#templates-user-state .templates-history-filters { grid-template-columns: 1.15fr .85fr .8fr .8fr .8fr; gap: 10px 12px; }
#templates-user-state .templates-history-filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; margin-bottom: 12px !important; }
#templates-user-state .templates-history-filter-actions .btn { margin: 0; }
#templates-user-state .templates-history-bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 9px 10px; border: 1px solid #e4e8ec; border-radius: 8px; background: #f8f9fa; }
#templates-user-state .templates-history-bulk-selection { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#templates-user-state .templates-history-bulk-toolbar .btn { margin: 0; }
#templates-user-state #templates-history-selected-count { color: #555; font-size: 13px; font-weight: 700; white-space: nowrap; }
#templates-user-state .templates-history-table-wrap { overflow-x: hidden; }
#templates-history-table { table-layout: fixed; font-size: 13px; }
#templates-history-table th,
#templates-history-table td { min-width: 0; padding: 10px 10px; vertical-align: middle; }
#templates-history-table th:nth-child(1) { width: 4%; text-align: center; }
#templates-history-table th:nth-child(2) { width: 8%; }
#templates-history-table th:nth-child(3) { width: 21%; }
#templates-history-table th:nth-child(4) { width: 10%; }
#templates-history-table th:nth-child(5) { width: 22%; }
#templates-history-table th:nth-child(6) { width: 9%; }
#templates-history-table th:nth-child(7) { width: 7%; }
#templates-history-table th:nth-child(8) { width: 19%; }
#templates-history-table td:nth-child(2),
#templates-history-table td:nth-child(4),
#templates-history-table td:nth-child(6),
#templates-history-table td:nth-child(7) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#templates-history-table .templates-history-template-cell,
#templates-history-table .templates-history-subject-cell { overflow: hidden; }
#templates-history-table .templates-history-ellipsis { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#templates-history-table .templates-history-select-cell { text-align: center; }
#templates-history-table .templates-history-select-checkbox { width: 18px; height: 18px; margin: 0; cursor: pointer; }
#templates-history-table .templates-history-action-cell { white-space: nowrap; }
#templates-history-table .templates-history-actions { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
#templates-history-table .templates-history-actions .btn { margin: 0 !important; white-space: nowrap; }
#templates-user-state .templates-history-pagination { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px !important; }
#templates-user-state .templates-history-pagination .btn { margin: 0; }
@media (max-width: 1050px) {
    #templates-user-state .templates-history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #templates-user-state .templates-history-table-wrap { overflow: visible; background: transparent; box-shadow: none; border-radius: 0; }
    #templates-history-table { display: block; width: 100%; table-layout: auto; }
    #templates-history-table thead { display: none; }
    #templates-history-table tbody { display: grid; gap: 10px; }
    #templates-history-table tbody tr { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0 !important; padding: 12px 14px !important; border: 1px solid #dde3e8; border-radius: 10px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
    #templates-history-table td { display: grid !important; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; width: auto !important; padding: 7px 0 !important; border-bottom: 1px dashed #e6e8eb; text-align: left !important; white-space: normal !important; }
    #templates-history-table td::before { content: attr(data-label); float: none !important; color: #667085; font-size: 12px; font-weight: 700; text-align: left; }
    #templates-history-table td:nth-child(3),
    #templates-history-table td:nth-child(8) { grid-column: 1 / -1; }
    #templates-history-table td:nth-child(8) { border-bottom: 0; }
    #templates-history-table .templates-history-select-cell { align-items: center; }
    #templates-history-table .templates-history-select-checkbox { width: 20px; height: 20px; }
    #templates-history-table .templates-history-action-cell { display: block !important; padding-top: 10px !important; }
    #templates-history-table .templates-history-action-cell::before { display: block; margin-bottom: 7px; }
    #templates-history-table .templates-history-actions { gap: 8px; }
    #templates-history-table .templates-history-actions .btn { width: auto !important; min-height: 38px; }
}
@media (max-width: 767px) {
    #templates-batch-table { table-layout: auto; }
}
@media (max-width: 700px) {
    #templates-user-state .templates-generate-card,
    #templates-user-state .templates-history-card { padding: 12px !important; border-radius: 8px !important; }
    #templates-user-state .templates-single-grid,
    #templates-user-state .templates-history-filters { grid-template-columns: 1fr; gap: 10px; }
    #templates-user-state .templates-single-actions { margin-top: 12px; }
    #templates-user-state #btn-user-generate { width: 100%; min-width: 0; min-height: 44px; }
    #templates-user-state .templates-history-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    #templates-user-state .templates-history-filter-actions .btn { width: 100%; min-height: 42px; }
    #templates-user-state .templates-history-bulk-toolbar { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 8px; }
    #templates-user-state .templates-history-bulk-selection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    #templates-user-state #templates-history-selected-count { grid-column: 1 / -1; text-align: center; }
    #templates-user-state .templates-history-bulk-selection .btn,
    #templates-user-state #btn-templates-history-delete-selected { width: 100%; min-height: 40px; }
    #templates-history-table tbody tr { grid-template-columns: 1fr; padding: 11px 12px !important; }
    #templates-history-table td,
    #templates-history-table td:nth-child(3),
    #templates-history-table td:nth-child(8) { grid-column: 1; grid-template-columns: 96px minmax(0, 1fr); }
    #templates-history-table .templates-history-action-cell { border-bottom: 0; }
    #templates-history-table .templates-history-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    #templates-history-table .templates-history-actions .btn { width: 100% !important; min-width: 0; min-height: 42px; padding-left: 6px; padding-right: 6px; }
    #templates-user-state .templates-history-pagination { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
    #templates-user-state #templates-history-page-info { text-align: center; font-size: 13px; }
    #templates-user-state .templates-history-pagination .btn { min-height: 40px; padding-left: 10px; padding-right: 10px; }
}
/* U4B - ADMIN + SETTINGS MOBILE SPACE / CARD POLISH          */
/* Desktop remains unchanged.                                 */
/* ========================================================= */
@media (max-width: 700px) {
    /* Settings edit view: keep only fieldsets as visual cards. */
    #view-settings.settings-subview .settings-card {
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    #view-settings.settings-subview .settings-card > h2 {
        margin: 0 0 12px;
        padding: 4px 0 10px;
    }
    #view-settings.settings-subview #form-user-settings {
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    #view-settings.settings-subview #form-user-settings fieldset {
        margin: 0 0 12px;
        padding: 12px;
        border-radius: 8px;
        background: #fff;
    }
    #view-settings.settings-subview #form-user-settings legend {
        padding: 0 8px;
    }
    #view-settings.settings-subview #form-user-settings .form-grid {
        gap: 12px;
    }
    #view-settings.settings-subview #form-user-settings .form-group,
    #view-settings.settings-subview #form-user-settings input,
    #view-settings.settings-subview #form-user-settings select,
    #view-settings.settings-subview #form-user-settings textarea {
        min-width: 0;
    }
    #view-settings.settings-subview #form-user-settings .form-hint {
        line-height: 1.45;
    }
    #view-settings.settings-subview #form-user-settings .form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 4px;
    }
    #view-settings.settings-subview #form-user-settings .form-actions .btn {
        width: 100%;
        min-height: 44px;
        margin: 0;
    }
    /* Admin tabs stay on one compact horizontal row. */
    #admin-section-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 14px !important;
        padding-bottom: 8px !important;
        scrollbar-width: thin;
    }
    #admin-section-tabs .btn {
        flex: 0 0 auto;
        min-height: 40px;
        margin: 0;
        padding: 8px 12px;
        white-space: nowrap;
    }
    /* Cleanup sections use available mobile width instead of horizontal tables. */
    #admin-cleanup-panel .admin-cleanup-shell {
        gap: 12px;
    }
    #admin-cleanup-panel .admin-cleanup-summary-card,
    #admin-cleanup-panel .admin-cleanup-section,
    #admin-cleanup-panel .admin-cleanup-policy {
        padding: 10px;
        border-radius: 9px;
    }
    #admin-cleanup-panel .admin-cleanup-section-header {
        gap: 6px;
        margin-bottom: 10px;
    }
    #admin-cleanup-panel .admin-cleanup-section-header h3 {
        font-size: 16px;
        line-height: 1.35;
    }
    #admin-cleanup-panel .admin-cleanup-retention-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
    #admin-cleanup-panel .admin-cleanup-retention-option {
        width: 100%;
        min-width: 0;
    }
    #admin-cleanup-panel .admin-cleanup-retention-custom {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        align-items: stretch;
    }
    #admin-cleanup-panel #admin-cleanup-retention-custom-days,
    #admin-cleanup-panel #admin-old-record-custom-days,
    #admin-cleanup-panel #admin-old-record-entity-type {
        width: 100%;
        min-width: 0;
    }
    #admin-cleanup-panel #btn-admin-cleanup-eligibility-apply,
    #admin-cleanup-panel #btn-admin-old-record-load {
        width: 100%;
        min-height: 42px;
        margin: 0;
    }
    #admin-cleanup-panel .admin-cleanup-table-wrap {
        overflow: visible;
    }
    #admin-cleanup-panel .admin-cleanup-table,
    #admin-cleanup-panel .admin-cleanup-table tbody {
        display: block;
        width: 100%;
    }
    #admin-cleanup-panel .admin-cleanup-table thead {
        display: none;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody {
        display: grid;
        gap: 10px;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody tr {
        display: block;
        width: 100%;
        margin: 0;
        padding: 10px 12px;
        border: 1px solid var(--admin-cleanup-border);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
        overflow: hidden;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        width: 100%;
        min-width: 0 !important;
        padding: 7px 0;
        border: 0;
        border-bottom: 1px solid #edf0f2;
        text-align: left !important;
        overflow-wrap: anywhere;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody td:last-child {
        border-bottom: 0;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody td::before {
        content: attr(data-label);
        min-width: 0;
        color: var(--admin-cleanup-muted);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.35;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody td.admin-cleanup-empty {
        display: block;
        padding: 14px 8px;
        border-bottom: 0;
        text-align: center !important;
    }
    #admin-cleanup-panel .admin-cleanup-table tbody td.admin-cleanup-empty::before {
        display: none;
    }
    #admin-cleanup-panel .admin-cleanup-select-cell {
        width: 100%;
        min-width: 0;
        text-align: left !important;
    }
    #admin-cleanup-panel .admin-cleanup-select-cell .admin-cleanup-purge-select {
        justify-self: start;
        width: 22px;
        height: 22px;
    }
    #admin-cleanup-panel .admin-cleanup-candidate-name,
    #admin-cleanup-panel .admin-cleanup-dependency-list,
    #admin-cleanup-panel .admin-cleanup-record-list,
    #admin-cleanup-panel .admin-cleanup-purge-action {
        min-width: 0;
    }
    #admin-cleanup-panel .admin-cleanup-status {
        white-space: normal;
    }
    /* Old-record desktop status uses the TD as the badge; flatten only on mobile. */
    #admin-cleanup-panel #admin-old-record-candidates td.admin-cleanup-status {
        min-height: 0;
        border-radius: 0;
        background: transparent;
    }
    #admin-cleanup-panel .admin-cleanup-purge-action .btn {
        width: 100%;
        min-height: 42px;
        margin: 0;
    }
    /* Keep destructive batch action reachable while its section is on screen. */
    #admin-cleanup-panel .admin-cleanup-batch-toolbar {
        position: sticky;
        bottom: 8px;
        z-index: 15;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
        border: 1px solid var(--admin-cleanup-border);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 6px 20px rgba(16, 24, 40, 0.12);
    }
    #admin-cleanup-panel .admin-cleanup-batch-selection {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        align-items: stretch;
    }
    #admin-cleanup-panel .admin-cleanup-batch-selection .btn {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        margin: 0;
    }
    #admin-cleanup-panel #admin-cleanup-batch-selected-count,
    #admin-cleanup-panel #admin-old-record-selected-count {
        grid-column: 1 / -1;
        text-align: center;
    }
    #admin-cleanup-panel #btn-admin-cleanup-batch-purge,
    #admin-cleanup-panel #btn-admin-old-record-delete {
        width: 100%;
        min-height: 44px;
        margin: 0;
    }
}
/* Wave G1B/G1C v3 - mobile app shell, compact navigation, restored density and list action alignment. */
.app-nav__icon,.app-nav__label--mobile{display:none;}
@media (max-width:767px){
html,body{max-width:100%;overflow-x:hidden;}
.view-container{min-height:100dvh;}
.app-header{position:sticky;top:0;z-index:850;min-height:56px;padding-top:calc(8px + env(safe-area-inset-top));padding-right:calc(10px + env(safe-area-inset-right));padding-bottom:8px;padding-left:calc(10px + env(safe-area-inset-left));gap:8px;background:rgba(255,255,255,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid rgba(15,63,94,.08);box-shadow:0 4px 14px rgba(15,23,42,.06);}
.app-header .logo{position:relative;display:inline-flex;align-items:center;flex:0 0 auto;margin:0;font-size:20px;font-weight:900;line-height:1;letter-spacing:.075em;color:#005a9e;background:linear-gradient(115deg,#004f8a 0%,#0079bd 56%,#00a0d2 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 1px 1px rgba(0,90,158,.16));}
.app-header .logo::after{content:"";position:absolute;left:1px;bottom:-6px;width:30px;height:3px;border-radius:999px;background:linear-gradient(90deg,#005a9e,#23a6d5);box-shadow:0 2px 8px rgba(0,90,158,.22);}
.user-menu{min-width:0;gap:4px;}
#ui-fullname,#ui-role{display:none;}
#btn-logout{display:none!important;}
.account-plan-entry{width:40px;height:40px;min-width:40px;padding:3px!important;justify-content:center;border:1px solid #dbe5ec!important;background:#fff!important;box-shadow:0 2px 8px rgba(15,23,42,.06);}
.account-plan-avatar,.account-plan-avatar-fallback{width:32px!important;height:32px!important;flex-basis:32px!important;}
.mobile-more-trigger{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;padding:0;border:1px solid #d5dde4;border-radius:12px;background:#fff;color:#005a9e;font-size:18px;font-weight:800;line-height:1;letter-spacing:1px;cursor:pointer;box-shadow:0 2px 8px rgba(15,23,42,.06);}
.pwa-install-header{display:none!important;}
.app-nav{position:fixed;right:0;bottom:0;left:0;z-index:900;overflow:hidden;white-space:normal;padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left);background:#005a9e;box-shadow:0 -5px 18px rgba(15,23,42,.16);}
.app-nav ul{display:flex;width:100%;overflow:hidden;}
#nav-admin-item,#nav-settings-item{display:none!important;}
.app-nav li{flex:1 1 20%;min-width:0;}
.app-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:60px;padding:5px 2px;text-align:center;white-space:normal;color:#fff;opacity:.7;font-size:10.5px;font-weight:700;line-height:1.05;}
.app-nav a.active{opacity:1;background:rgba(255,255,255,.10);box-shadow:inset 0 3px 0 rgba(255,255,255,.98);}
.app-nav a:focus-visible{outline:2px solid #fff;outline-offset:-3px;}
.app-nav__icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;line-height:1;}
.app-nav__icon svg{display:block;width:20px;height:20px;stroke:currentColor;}
.app-nav__label--desktop{display:none;}
.app-nav__label--mobile{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.app-content{padding-top:10px;padding-right:calc(10px + env(safe-area-inset-right));padding-bottom:calc(76px + env(safe-area-inset-bottom));padding-left:calc(10px + env(safe-area-inset-left));}
.page-header{margin-bottom:10px;padding-bottom:8px;gap:8px;}
.page-header h2{font-size:22px;line-height:1.15;}
.list-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:8px;margin-bottom:10px;}
.list-toolbar__search{grid-column:1/-1;max-width:none;min-width:0;min-height:42px;padding:8px 12px;}
.list-toolbar__sort-wrapper{grid-column:1/-1;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;justify-content:initial;gap:8px;min-width:0;}
.list-toolbar__sort{width:100%;min-width:0;min-height:42px;margin-left:0!important;padding:7px 10px;}
#btn-person-apc-selected,#btn-person-delete-selected,#btn-business-apc-selected,#btn-business-delete-selected,#btn-company-apc-selected,#btn-company-delete-selected{grid-column:auto;width:100%;min-width:0;min-height:42px;margin:0!important;padding:7px 8px;font-size:12.5px;line-height:1.15;white-space:normal;}
.alert{margin-bottom:10px;}
.responsive-table tbody tr{margin-bottom:10px;padding:9px 10px;}
.list-table-wrapper .responsive-table td{gap:8px;padding:7px 0;}
.row-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:100%;margin-top:3px;}
.row-actions .btn-action{width:100%!important;min-width:0;min-height:44px;margin:0!important;padding:6px 4px;font-size:12px;line-height:1.1;white-space:normal;}
.pagination{margin-top:14px;gap:10px;}
.pagination .btn{min-height:40px;margin:0;}
.btn,.btn-sm{touch-action:manipulation;}
.mobile-more-backdrop{position:fixed;inset:0;z-index:1090;background:rgba(15,23,42,.42);}
.mobile-more-backdrop:not([hidden]){display:block;}
.mobile-more-sheet{position:fixed;right:calc(10px + env(safe-area-inset-right));bottom:calc(74px + env(safe-area-inset-bottom));left:calc(10px + env(safe-area-inset-left));z-index:1100;padding:10px;border:1px solid #d9e1e7;border-radius:16px;background:#fff;box-shadow:0 18px 48px rgba(15,23,42,.24);}
.mobile-more-sheet:not([hidden]){display:block;}
.mobile-more-sheet__head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 2px 8px;color:#17324a;}
.mobile-more-sheet__close{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:10px;background:#eef2f5;color:#334155;font-size:24px;line-height:1;cursor:pointer;}
.mobile-more-sheet__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.mobile-more-sheet__item{min-width:0;min-height:46px;padding:9px 10px;border:1px solid #d8e0e6;border-radius:11px;background:#f8fafb;color:#17324a;font:inherit;font-size:13px;font-weight:700;text-align:center;cursor:pointer;}
.mobile-more-sheet__item--danger{border-color:#efc2c2;background:#fff1f1;color:#b42318;}
.mobile-more-sheet__item[hidden]{display:none!important;}
body.mobile-more-open{overflow:hidden;}
#view-login .pwa-install-login{width:100%;min-height:40px;margin:12px 0 0;padding:8px 12px;border:1px solid #cbd7e1;background:#f8fbfd;color:#005a9e;box-shadow:none;font-size:13px;}
#view-login .pwa-install-login:hover,#view-login .pwa-install-login:focus-visible{background:#eef6fb;border-color:#8fb9d8;outline:none;}
#view-login .pwa-install-login[hidden]{display:none!important;}
.login-card h2{font-weight:900;letter-spacing:.055em;background:linear-gradient(115deg,#004f8a,#0079bd 58%,#00a0d2);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;}
.pwa-install-help{position:fixed;inset:0;z-index:1200;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.5);}
.pwa-install-help:not([hidden]){display:flex;}
.pwa-install-help__card{width:min(100%,380px);padding:18px;border-radius:14px;background:#fff;box-shadow:0 18px 48px rgba(15,23,42,.25);text-align:left;}
.pwa-install-help__card h3{margin:0 0 8px;color:#005a9e;}
.pwa-install-help__card p{margin:0 0 14px;color:#475467;line-height:1.5;}
.pwa-install-help__card .btn{width:100%;margin:0;}
}
/* Wave G1 v9 - compact home terms + consistent mobile select UI */
.home-u5f-terms--compact{padding:0!important;overflow:hidden;}
.home-u5f-terms--compact>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;cursor:pointer;}
.home-u5f-terms--compact>summary::-webkit-details-marker{display:none;}
.home-u5f-terms--compact>summary span:first-child{display:grid;gap:2px;min-width:0;}
.home-u5f-terms--compact>summary strong{font-size:15px;color:#1f2937;}
.home-u5f-terms--compact>summary small{font-size:12px;line-height:1.35;color:#667085;font-weight:400;}
.home-u5f-terms-toggle{flex:0 0 auto;padding:5px 9px;border:1px solid #cbd5e1;border-radius:999px;color:#005a9e;font-size:12px;font-weight:700;}
.home-u5f-terms--compact[open] .home-u5f-terms-toggle{font-size:0;}
.home-u5f-terms--compact[open] .home-u5f-terms-toggle::after{content:"Thu gọn";font-size:12px;}
.home-u5f-terms-body{padding:0 16px 14px;border-top:1px solid #eef2f6;}
.home-u5f-terms-body p,.home-u5f-terms-body ul{margin-top:10px;margin-bottom:0;}
.mobile-select-trigger,.mobile-select-backdrop,.mobile-select-sheet{display:none;}
@media(max-width:767px){
select.mobile-select-native{position:absolute!important;width:1px!important;height:1px!important;min-width:1px!important;min-height:1px!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%)!important;}
.mobile-select-trigger{display:flex;width:100%;min-width:0;min-height:42px;align-items:center;justify-content:space-between;gap:8px;padding:9px 34px 9px 10px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#1f2937;font:inherit;font-size:16px;line-height:1.25;text-align:left;position:relative;}
.mobile-select-trigger::after{content:"⌄";position:absolute;right:11px;top:50%;transform:translateY(-55%);color:#667085;font-size:18px;line-height:1;}
.mobile-select-trigger:disabled{background:#f3f4f6;color:#98a2b3;opacity:1;}
.mobile-select-trigger__text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.mobile-select-backdrop{position:fixed;inset:0;z-index:14000;background:rgba(15,23,42,.42);}
.mobile-select-backdrop.is-open{display:block;}
.mobile-select-sheet{position:fixed;left:0;right:0;bottom:0;z-index:14001;max-height:min(72vh,620px);padding:10px 12px calc(12px + env(safe-area-inset-bottom));border-radius:18px 18px 0 0;background:#fff;box-shadow:0 -16px 42px rgba(15,23,42,.2);}
.mobile-select-sheet.is-open{display:flex;flex-direction:column;}
.mobile-select-sheet__handle{width:42px;height:4px;margin:0 auto 8px;border-radius:999px;background:#d0d5dd;}
.mobile-select-sheet__head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px 2px 10px;}
.mobile-select-sheet__title{margin:0;font-size:17px;line-height:1.3;color:#1f2937;}
.mobile-select-sheet__close{width:40px;height:40px;min-height:40px;padding:0;border:0;border-radius:50%;background:#f2f4f7;color:#344054;font-size:22px;font-weight:400;}
.mobile-select-sheet__search{width:100%;min-height:42px;margin:0 0 8px;padding:9px 11px;border:1px solid #cbd5e1;border-radius:8px;font-size:16px;}
.mobile-select-sheet__list{display:grid;gap:2px;overflow:auto;overscroll-behavior:contain;padding:2px 0;}
.mobile-select-sheet__group{padding:9px 10px 4px;color:#667085;font-size:12px;font-weight:700;text-transform:none;}
.mobile-select-sheet__option{display:flex;width:100%;min-height:44px;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border:0;border-radius:8px;background:#fff;color:#1f2937;font-size:15px;line-height:1.3;text-align:left;}
.mobile-select-sheet__option:active,.mobile-select-sheet__option.is-selected{background:#edf6fc;color:#005a9e;font-weight:700;}
.mobile-select-sheet__option.is-selected::after{content:"✓";flex:0 0 auto;font-size:16px;}
.mobile-select-sheet__empty{padding:18px 10px;text-align:center;color:#667085;font-size:14px;}
body.mobile-select-open{overflow:hidden;}
.home-u5f-terms--compact>summary{padding:12px 13px;}
.home-u5f-terms-body{padding:0 13px 12px;}
}
/* Wave G1 v11 - shared mobile select affordance and accessible close controls. */
@media(max-width:767px){
.mobile-select-trigger{padding-right:51px;cursor:pointer;touch-action:manipulation;transition:border-color .15s ease,background-color .15s ease;}
.mobile-select-trigger::before{content:"";position:absolute;right:7px;top:50%;width:30px;height:30px;border:1px solid #c7dff0;border-radius:9px;background:#eef7fe;transform:translateY(-50%);pointer-events:none;box-sizing:border-box;}
.mobile-select-trigger::after{content:"";position:absolute;right:18px;top:calc(50% - 2px);width:10px;height:10px;border:solid #005a9e;border-width:0 2.5px 2.5px 0;border-radius:1px;transform:translateY(-50%) rotate(45deg);pointer-events:none;}
.mobile-select-trigger:hover:not(:disabled){border-color:#9bbfdb;background:#fbfdff;}
.mobile-select-trigger:focus-visible{outline:3px solid #8bc5ed;outline-offset:2px;}
.mobile-select-trigger:disabled::before{border-color:#e0e6ed;background:#eef0f3;}
.mobile-select-trigger:disabled::after{border-color:#98a2b3;}
.mobile-select-sheet__close,.mobile-more-sheet__close{position:relative;display:inline-flex;flex:0 0 44px;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #b4d2e8;border-radius:12px;background:#eaf5fd;color:#005a9e;font-size:0;box-shadow:0 1px 3px rgba(0,90,158,.10);cursor:pointer;touch-action:manipulation;}
.mobile-select-sheet__close::before,.mobile-select-sheet__close::after,.mobile-more-sheet__close::before,.mobile-more-sheet__close::after{content:"";position:absolute;top:50%;left:50%;width:19px;height:2.5px;border-radius:99px;background:currentColor;pointer-events:none;}
.mobile-select-sheet__close::before,.mobile-more-sheet__close::before{transform:translate(-50%,-50%) rotate(45deg);}
.mobile-select-sheet__close::after,.mobile-more-sheet__close::after{transform:translate(-50%,-50%) rotate(-45deg);}
.mobile-select-sheet__close:hover,.mobile-more-sheet__close:hover{border-color:#88b7d8;background:#dceefb;}
.mobile-select-sheet__close:active,.mobile-more-sheet__close:active{background:#cde6f8;}
.mobile-select-sheet__close:focus-visible,.mobile-more-sheet__close:focus-visible{outline:3px solid #8bc5ed;outline-offset:2px;}
}
/* Wave G1 v12: visually balanced, unboxed chevron for shared mobile selects. */
@media(max-width:767px){
.mobile-select-trigger{padding-right:35px;}
.mobile-select-trigger::before{content:none;display:none;}
.mobile-select-trigger::after{content:"";right:10px;top:50%;width:16px;height:16px;transform:translateY(-50%);border:0;border-radius:0;background:transparent url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M3.5%206%208%2010.5%2012.5%206%22%20fill%3D%22none%22%20stroke%3D%22%23005a9e%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") center/16px 16px no-repeat;}
.mobile-select-trigger:disabled::after{opacity:.45;}
}
/* Wave G1 v15: consistent mobile form controls, user actions, and iOS safe-area behavior. */
.mobile-choice-field{display:block;min-width:0;width:100%;}
.mobile-choice-open{display:none;}
.mobile-ios-date-wrap{display:block;min-width:0;}
.mobile-ios-date-display{display:none;}
@media(max-width:767px){
.form-grid,.form-grid>*,.form-group,.settings-card,.admin-u5e-form-grid,.admin-u5e-form-grid>*,fieldset{min-width:0;max-width:100%;}
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.form-group textarea,.search-input,#admin-user-plan-search,#form-user-settings input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.admin-u5e-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]){box-sizing:border-box;min-width:0;max-width:100%;font-size:16px;}
.form-group input[type="text"],.form-group input[type="email"],.form-group input[type="search"],.search-input,#admin-user-plan-search{overflow:hidden;text-overflow:ellipsis;}
.mobile-select-trigger,.mobile-select-trigger__text{max-width:100%;min-width:0;}
.mobile-choice-field{display:grid;grid-template-columns:minmax(0,1fr) 42px;align-items:stretch;gap:6px;min-width:0;}
.mobile-choice-field>input{width:100%;min-width:0;max-width:100%;margin:0;}
.mobile-choice-open{position:relative;display:block;width:42px;min-width:42px;min-height:42px;padding:0;border:1px solid #cbd5e1;border-radius:6px;background:#fff;cursor:pointer;touch-action:manipulation;}
.mobile-choice-open::after{content:"";position:absolute;left:50%;top:50%;width:16px;height:16px;transform:translate(-50%,-50%);background:transparent url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M3.5%206%208%2010.5%2012.5%206%22%20fill%3D%22none%22%20stroke%3D%22%23005a9e%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E") center/16px 16px no-repeat;pointer-events:none;}
.mobile-choice-open:focus-visible{outline:3px solid #8bc5ed;outline-offset:2px;}
.mobile-choice-open:disabled{opacity:.45;cursor:default;background:#f4f5f7;}
#admin-plan-quota-panel #admin-user-plan-tbody .admin-u5e-row-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;width:100%;min-width:0;}
#admin-plan-quota-panel #admin-user-plan-tbody .admin-u5e-row-actions .btn{display:flex;align-items:center;justify-content:center;min-width:0;width:100%;min-height:44px;margin:0!important;padding:7px 2px;font-size:13px;line-height:1.2;white-space:nowrap!important;word-break:normal!important;}
#admin-plan-quota-panel #admin-user-plan-tbody td[data-label="Thao tác"]{min-width:0;max-width:100%;}
}
@media(max-width:767px) and (hover:none){input[type="search"],input[type="email"],input[type="number"],input[type="tel"],input[type="password"],input[type="text"],textarea{font-size:16px;}}
@media(max-width:767px){
.accgen-mobile-date-device .mobile-ios-date-wrap{position:relative;display:block;min-width:0;max-width:100%;}
.accgen-mobile-date-device .mobile-ios-date-wrap[hidden]{display:none!important;}
.accgen-mobile-date-device .mobile-ios-date-native{position:absolute!important;width:1px!important;height:1px!important;min-width:1px!important;min-height:1px!important;padding:0!important;border:0!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%)!important;}
.accgen-mobile-date-device .mobile-ios-date-display{display:block;width:100%;min-width:0;min-height:44px;padding:9px 38px 9px 12px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#1f2937;font-size:16px;line-height:1.25;}
.accgen-mobile-date-device .mobile-ios-date-display:disabled{background:#f3f4f6;color:#667085;}
.accgen-ios-device .app-nav{bottom:0;transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;}
html.accgen-ios-device body.accgen-ios-keyboard-focus .app-nav{visibility:hidden;pointer-events:none;}
}
/* Wave G1 v18: a compact iOS tab bar and a real calendar while keeping ISO form values. */
.mobile-ios-calendar-trigger{display:none;}
@media(max-width:767px){
html.accgen-ios-device .app-nav{bottom:0!important;transform:none!important;padding-bottom:clamp(0px,calc(env(safe-area-inset-bottom) - 10px),24px);}
html.accgen-ios-device .app-nav a{min-height:54px;gap:2px;padding:4px 2px;}
html.accgen-ios-device .app-content{padding-bottom:calc(70px + clamp(0px,calc(env(safe-area-inset-bottom) - 10px),24px));}
html.accgen-ios-device .mobile-more-sheet{bottom:calc(64px + clamp(0px,calc(env(safe-area-inset-bottom) - 10px),24px));}
html.accgen-mobile-date-device .mobile-ios-date-display{padding-right:50px;cursor:pointer;text-overflow:ellipsis;}
html.accgen-mobile-date-device .mobile-ios-date-display:focus-visible{outline:2px solid #8bc5ed;outline-offset:1px;}
html.accgen-mobile-date-device .mobile-ios-calendar-trigger{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;border:0;border-left:1px solid #e0e7ef;border-radius:0 6px 6px 0;background:transparent;color:#005a9e;cursor:pointer;touch-action:manipulation;}
html.accgen-mobile-date-device .mobile-ios-calendar-trigger svg{width:20px;height:20px;}
html.accgen-mobile-date-device .mobile-ios-calendar-trigger:disabled{opacity:.4;cursor:default;}
html.accgen-mobile-date-device .mobile-ios-calendar-trigger:focus-visible{outline:2px solid #8bc5ed;outline-offset:-2px;}
}
.mobile-ios-calendar-backdrop,.mobile-ios-calendar-sheet{display:none;}
.mobile-ios-calendar-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:15000;background:rgba(15,23,42,.48);}
.mobile-ios-calendar-sheet:not([hidden]){display:flex;flex-direction:column;position:fixed;bottom:0;left:0;right:0;z-index:15001;max-height:min(88dvh,670px);padding:10px 12px calc(12px + env(safe-area-inset-bottom));border-radius:18px 18px 0 0;background:#fff;color:#1f2937;box-shadow:0 -14px 36px rgba(15,23,42,.22);overflow-y:auto;overscroll-behavior:contain;}
.mobile-ios-calendar-handle{width:36px;height:4px;flex:0 0 auto;align-self:center;margin:0 0 10px;border-radius:99px;background:#cbd5e1;}
.mobile-ios-calendar-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.mobile-ios-calendar-title{margin:0;font-size:17px;line-height:1.3;font-weight:700;color:#17324a;}
.mobile-ios-calendar-close{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:1px solid #b4d2e8;border-radius:12px;background:#eaf5fd;color:#005a9e;font-size:27px;font-weight:700;cursor:pointer;}
.mobile-ios-calendar-navigation{display:flex;align-items:center;gap:6px;min-width:0;padding:8px;border-radius:10px;background:#f3f7fb;}
.mobile-ios-calendar-prev,.mobile-ios-calendar-next{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;border-radius:9px;background:#fff;color:#005a9e;font-size:30px;cursor:pointer;}
.mobile-ios-calendar-month{flex:1;min-width:0;text-align:center;font-size:15px;font-weight:700;white-space:nowrap;}
.mobile-ios-calendar-year-label{display:flex;align-items:center;gap:4px;flex:0 0 auto;color:#667085;font-size:12px;}
.mobile-ios-calendar-year{width:68px;min-width:0;height:44px;padding:6px 5px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#1f2937;font-size:16px;text-align:center;}
.mobile-ios-calendar-weekdays,.mobile-ios-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;min-width:0;}
.mobile-ios-calendar-weekdays{margin-top:12px;margin-bottom:4px;}
.mobile-ios-calendar-weekdays span{padding:5px 0;text-align:center;color:#667085;font-size:12px;font-weight:700;}
.mobile-ios-calendar-day{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;height:42px;padding:0;border:0;border-radius:9px;background:#fff;color:#344054;font-size:15px;cursor:pointer;touch-action:manipulation;}
.mobile-ios-calendar-day.is-today{outline:1px solid #9ac7e7;outline-offset:-1px;}
.mobile-ios-calendar-day.is-selected{background:#005a9e;color:#fff;font-weight:700;}
.mobile-ios-calendar-day:disabled{background:transparent;color:#b2bdc9;cursor:default;}
.mobile-ios-calendar-day:focus-visible{outline:2px solid #005a9e;outline-offset:-2px;}
.mobile-ios-calendar-manual:not([hidden]){display:grid;gap:6px;margin-top:10px;padding:10px;border:1px solid #dde8f0;border-radius:9px;background:#f8fbfd;}
.mobile-ios-calendar-manual label{display:grid;gap:6px;font-size:13px;font-weight:700;}
.mobile-ios-calendar-manual-input{width:100%;height:44px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:7px;font-size:16px;}
.mobile-ios-calendar-error{min-height:0;color:#b42318;font-size:12px;}
.mobile-ios-calendar-apply{min-height:44px;border:0;border-radius:8px;background:#005a9e;color:#fff;font-size:14px;font-weight:700;}
.mobile-ios-calendar-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:14px;}
.mobile-ios-calendar-actions button{min-width:0;min-height:44px;padding:7px 4px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafb;color:#005a9e;font-size:13px;font-weight:700;white-space:nowrap;}
.mobile-ios-calendar-actions .mobile-ios-calendar-today{background:#005a9e;border-color:#005a9e;color:#fff;}
.mobile-ios-calendar-actions button:disabled{opacity:.4;cursor:default;}
body.mobile-ios-calendar-open{overflow:hidden;}
@media(max-width:350px){.mobile-ios-calendar-sheet:not([hidden]){padding-left:8px;padding-right:8px;}.mobile-ios-calendar-navigation{gap:4px;padding:5px;}.mobile-ios-calendar-year{width:60px;}.mobile-ios-calendar-day{height:40px;}.mobile-ios-calendar-actions button{font-size:12px;}}
/* Wave G1 v19: shared mobile calendar and compact iOS bottom bar. */
@media(max-width:767px){
html.accgen-ios-device .app-nav{padding-bottom:clamp(0px,env(safe-area-inset-bottom),6px)!important;}
html.accgen-ios-device .app-nav a{min-height:54px;gap:3px;padding:5px 2px;}
html.accgen-ios-device .app-content{padding-bottom:72px;}
html.accgen-ios-device .mobile-more-sheet{bottom:70px;}
}

/* ACCGEN FIELD DESIGN SYSTEM v9 - visual-only parity with Person Noi cap/Gioi tinh selectors. */
:root{--accgen-field-height:44px;--accgen-field-border:#cbd5e1;--accgen-field-radius:6px;--accgen-field-bg:#fff;--accgen-field-text:#1f2937;--accgen-field-focus:#005a9e;}
:is(#view-main-layout,#view-login,.mobile-select-sheet,.accgen-picker-panel,.accgen-role-ui-panel) :is(input,select,textarea):not([type="checkbox"],[type="radio"],[type="hidden"],[type="file"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"],[type="image"],.mobile-select-native,.accgen-picker-native,.mobile-ios-date-native,.mobile-ios-date-display,.accgen-role-original-select,[data-mobile-native="true"]){box-sizing:border-box;min-width:0;max-width:100%;min-height:var(--accgen-field-height)!important;padding:9px 12px!important;border:1px solid var(--accgen-field-border)!important;border-radius:var(--accgen-field-radius)!important;background:var(--accgen-field-bg)!important;color:var(--accgen-field-text)!important;font-family:inherit;font-size:16px!important;line-height:1.25!important;box-shadow:none!important;}
:is(#view-main-layout,#view-login,.mobile-select-sheet,.accgen-picker-panel,.accgen-role-ui-panel) textarea:not([type="hidden"]){min-height:74px!important;line-height:1.45!important;resize:vertical;}
:is(#view-main-layout,#view-login,.mobile-select-sheet,.accgen-picker-panel,.accgen-role-ui-panel) :is(input,select,textarea):not([type="checkbox"],[type="radio"],[type="hidden"],[type="file"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"],[type="image"],.mobile-select-native,.accgen-picker-native,.mobile-ios-date-native,.mobile-ios-date-display,.accgen-role-original-select,[data-mobile-native="true"]):focus{border-color:var(--accgen-field-focus)!important;box-shadow:0 0 0 3px rgba(0,90,158,.14)!important;outline:none!important;}
:is(#view-main-layout,#view-login,.mobile-select-sheet,.accgen-picker-panel,.accgen-role-ui-panel) :is(input,select,textarea):not([type="checkbox"],[type="radio"],[type="hidden"],[type="file"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"],[type="image"],.mobile-select-native,.accgen-picker-native,.mobile-ios-date-native,.mobile-ios-date-display,.accgen-role-original-select,[data-mobile-native="true"]):read-only:not(select){background:#f7f9fb!important;color:#475467!important;}
:is(#view-main-layout,#view-login,.mobile-select-sheet,.accgen-picker-panel,.accgen-role-ui-panel) :is(input,select,textarea):not([type="checkbox"],[type="radio"],[type="hidden"],[type="file"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"],[type="image"],.mobile-select-native,.accgen-picker-native,.mobile-ios-date-native,.mobile-ios-date-display,.accgen-role-original-select,[data-mobile-native="true"]):disabled{background:#f3f4f6!important;color:#667085!important;cursor:not-allowed;}
:is(#view-main-layout,#view-login,.mobile-select-sheet,.accgen-picker-panel,.accgen-role-ui-panel) :is(input,textarea)::placeholder{color:#98a2b3;opacity:1;}
/* Keep rich picker content, mobile chevrons and iOS/Android date interaction intact. */
.mobile-select-trigger,.accgen-picker-trigger{box-sizing:border-box;min-height:var(--accgen-field-height)!important;border:1px solid var(--accgen-field-border)!important;border-radius:var(--accgen-field-radius)!important;background:var(--accgen-field-bg)!important;color:var(--accgen-field-text)!important;font-size:16px!important;}
.mobile-select-trigger:focus-visible,.accgen-picker-trigger:focus-visible{border-color:var(--accgen-field-focus)!important;box-shadow:0 0 0 3px rgba(0,90,158,.14);}
.mobile-select-trigger:hover:not(:disabled){background:#fbfdff!important;border-color:#9bbfdb!important;}
.accgen-picker-trigger:hover:not(:disabled){background:#fbfdff!important;border-color:#88b7db!important;}
@media(max-width:767px){.mobile-choice-open{min-height:var(--accgen-field-height);border-color:var(--accgen-field-border);border-radius:var(--accgen-field-radius);}.accgen-mobile-date-device .mobile-ios-date-display{min-height:var(--accgen-field-height)!important;border:1px solid var(--accgen-field-border)!important;border-radius:var(--accgen-field-radius)!important;background:#fff!important;color:var(--accgen-field-text)!important;font-size:16px!important;}.accgen-mobile-date-device .mobile-ios-date-display:disabled{background:#f3f4f6!important;color:#667085!important;}}

/* ACCGEN v11: compact linked-Person cards, scoped to Business/Company forms. */
.business-owner-fieldset,.company-role-fieldset{background:#fff;border:1px solid #dce6ef;border-radius:12px;padding:14px 14px 16px;margin-bottom:18px;}
.business-owner-fieldset>legend,.company-role-fieldset>legend{max-width:calc(100% - 16px);padding:0 7px;margin-left:0;background:#fff;color:#005a9e;border-radius:0;font-size:15px;font-weight:700;line-height:1.4;white-space:normal;}
.business-owner-picker .entity-linked-summary,.company-role-fieldset .entity-linked-summary{width:100%;min-width:0;color:inherit;font-weight:400;font-size:14px;}
.entity-linked-card{width:100%;min-width:0;padding:12px 13px;border:1px solid #cddfed;border-radius:10px;background:#f8fbfe;color:#1f2937;box-shadow:0 1px 2px rgba(0,90,158,.03);}
.entity-linked-card--empty{padding:12px;border:1px dashed #d5e1eb;background:#fafcff;box-shadow:none;}
.entity-linked-card__empty{color:#667085;font-size:13px;}
.entity-linked-card__header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0;}
.entity-linked-card__identity{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 auto;}
.entity-linked-card__title{display:block;color:#14446a;font-size:15px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;}
.entity-linked-card__subtitle{display:block;color:#52677b;font-size:13px;line-height:1.45;overflow-wrap:anywhere;}
.entity-linked-card__status{display:inline-flex;flex:0 0 24px;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid #c8e2d4;border-radius:50%;background:#edf8f1;color:#207347;font-size:14px;font-weight:700;line-height:1;}
.entity-linked-card__status--pending{color:#667085;background:#f2f4f7;border-color:#dce2e8;}
.entity-linked-card__brief{margin-top:8px;color:#526172;font-size:13px;line-height:1.4;overflow-wrap:anywhere;}
.entity-linked-card__disclosure{margin-top:9px;border-top:1px solid #dfebf4;}
.entity-linked-card__toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;padding:8px 0 0;color:#005a9e;font-size:13px;font-weight:600;line-height:1.35;cursor:pointer;list-style:none;touch-action:manipulation;}
.entity-linked-card__toggle::-webkit-details-marker{display:none;}
.entity-linked-card__toggle:focus-visible{outline:2px solid #005a9e;outline-offset:2px;border-radius:4px;}
.entity-linked-card__toggle-close-label{display:none;}
.entity-linked-card__disclosure[open] .entity-linked-card__toggle-open-label{display:none;}
.entity-linked-card__disclosure[open] .entity-linked-card__toggle-close-label{display:inline;}
.entity-linked-card__chevron{width:8px;height:8px;flex:0 0 8px;margin-right:4px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s ease;}
.entity-linked-card__disclosure[open] .entity-linked-card__chevron{transform:rotate(225deg);}
.entity-linked-card__details{display:grid;grid-template-columns:1fr;gap:0;padding-top:9px;}
.entity-linked-card__detail-row{display:grid;grid-template-columns:minmax(78px,30%) minmax(0,1fr);gap:10px;padding:8px 0;border-top:1px solid #e2eaf1;min-width:0;}
.entity-linked-card__detail-row dt{color:#667085;font-size:12px;font-weight:600;line-height:1.45;}
.entity-linked-card__detail-row dd{margin:0;color:#1f2937;font-size:13px;line-height:1.45;overflow-wrap:anywhere;}
.business-owner-picker #btn-owner-clear,.company-role-actions .btn{display:inline-flex;justify-content:center;align-items:center;min-height:42px;margin:0!important;padding:7px 12px;border:1px solid #d1dce5;border-radius:7px;background:#fff;color:#005a9e;font-size:13px;font-weight:600;line-height:1.3;white-space:normal;}
.business-owner-picker #btn-owner-clear,.company-role-actions [id$="-clear"]{color:#a23b3b;border-color:#e9d7d7;background:#fff;}
.business-owner-picker #btn-owner-clear:focus-visible,.company-role-actions .btn:focus-visible{outline:2px solid #005a9e;outline-offset:2px;}
.company-role-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;}
@media(max-width:767px){.business-owner-fieldset,.company-role-fieldset{padding:12px;margin-bottom:16px;border-radius:10px;}.business-owner-fieldset>legend,.company-role-fieldset>legend{font-size:14px;}.entity-linked-card{padding:11px 12px;}.company-role-actions .btn{flex:1 1 auto;}}

/* ACCGEN v11.1: separate Business unlink action from linked Person card. */
.business-owner-picker #btn-owner-clear{margin-top:12px!important;}

/* ACCGEN v12: inline Person search results for HKD and all Company roles. */
.accgen-inline-person-results{
    position:relative;
    inset:auto;
    box-sizing:border-box;
    width:100%;
    min-width:0;
    max-width:100%;
    max-height:min(292px,38vh);
    overflow-y:auto;
    overscroll-behavior:contain;
    margin-top:8px;
    border:1px solid #ccdeec;
    border-radius:9px;
    background:#fff;
    box-shadow:0 2px 8px rgba(28,72,107,.08);
    -webkit-overflow-scrolling:touch;
}
.accgen-inline-person-results__item{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:3px;
    width:100%;
    min-width:0;
    padding:11px 12px;
    margin:0;
    border:0;
    border-bottom:1px solid #e7edf4;
    border-radius:0;
    background:#fff;
    color:#1f2937;
    text-align:left;
    font:inherit;
    cursor:pointer;
}
.accgen-inline-person-results__item:last-child{border-bottom:0;}
.accgen-inline-person-results__item:hover,.accgen-inline-person-results__item:focus-visible{background:#edf6fd;}
.accgen-inline-person-results__item:focus-visible{outline:2px solid #005a9e;outline-offset:-2px;}
.accgen-inline-person-results__name{display:block;width:100%;color:#164368;font-size:14px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;}
.accgen-inline-person-results__meta{display:block;width:100%;color:#667085;font-size:12px;line-height:1.45;overflow-wrap:anywhere;}
.accgen-inline-person-results__status{padding:12px;color:#667085;font-size:13px;line-height:1.4;}
.accgen-inline-person-results__status--error{color:#a23b3b;}
@media(max-width:767px){
    .accgen-inline-person-results{max-height:min(255px,34vh);border-radius:8px;}
    .accgen-inline-person-results__item{min-height:55px;padding:10px 11px;}
}

/* ACCGEN v12.1: rhythm between HKD owner search, results and selected Person. */
.business-owner-picker #owner-search-results.accgen-inline-person-results{margin-top:10px;}
.business-owner-picker #owner-display-label.entity-linked-summary{margin-top:14px;}

/* ACCGEN home installation instructions v13: reuse the closed-by-default terms card. */
.home-install-guide__body{color:#344054;font-size:14px;line-height:1.58;}
.home-install-guide__body>p:first-child{margin:12px 0 0;}
.home-install-guide__platform{margin-top:12px;padding:12px 13px;border:1px solid #e1e9f1;border-radius:10px;background:#f8fafc;min-width:0;}
.home-install-guide__platform h4{margin:0 0 8px;color:#005a9e;font-size:15px;line-height:1.4;}
.home-install-guide__platform ol{margin:0;padding-left:21px;list-style:decimal;}
.home-install-guide__platform li{padding-left:2px;overflow-wrap:anywhere;}
.home-install-guide__platform li+li{margin-top:8px;}
.home-install-guide__platform li::marker{color:#005a9e;font-weight:700;}
.home-install-guide__note{margin:10px 0 0!important;padding:9px 10px;border:1px solid #e5eaf0;border-radius:8px;background:#fff;color:#475467;font-size:13px;line-height:1.52;}
.home-install-guide__troubleshoot{background:#f9fafb;}
.home-install-guide__references{margin:12px 0 0!important;color:#667085;font-size:12px;line-height:1.5;}
.home-install-guide__references a{font-weight:600;text-decoration:underline;text-underline-offset:2px;}
.home-u5f-contact{padding:13px 15px;border:1px solid #dfe5ec;border-radius:12px;background:#fff;min-width:0;}
.home-u5f-contact h4{margin:0 0 7px;color:#005a9e;font-size:15px;line-height:1.45;}
.home-u5f-contact dl{margin:0;}
.home-u5f-contact dl>div{display:grid;grid-template-columns:minmax(104px,130px) minmax(0,1fr);gap:10px;padding:8px 0;border-top:1px solid #edf1f5;align-items:baseline;}
.home-u5f-contact dt{color:#667085;font-size:13px;line-height:1.5;}
.home-u5f-contact dd{margin:0;color:#1f2937;font-size:14px;font-weight:600;line-height:1.5;overflow-wrap:anywhere;}
.home-u5f-contact a{font-weight:700;}
@media(max-width:767px){
.home-install-guide__body{font-size:13px;}
.home-install-guide__platform{margin-top:10px;padding:11px 10px;}
.home-install-guide__platform h4{font-size:14px;}
.home-install-guide__note{font-size:12px;}
.home-u5f-contact{padding:11px 13px;border-radius:10px;}
.home-u5f-contact dl>div{grid-template-columns:minmax(90px,116px) minmax(0,1fr);gap:8px;}
}


/* ACCGEN v14: compact install tabs, contact and plan loading rhythm. */
#home-plan-loading{margin-top:12px;min-height:49px;display:flex;align-items:center;justify-content:center;line-height:1.4;}
#home-plan-loading[style*="none"]{display:none!important;}
#home-plan-content{margin-top:11px;}
#home-plan-content[style*="none"]{display:none!important;}
.home-install-guide__switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:13px;padding:4px;border:1px solid #dce7f0;border-radius:11px;background:#f3f7fb;}
.home-install-guide__switch [role="tab"]{display:flex;justify-content:center;align-items:center;min-width:0;min-height:42px;padding:8px;border:1px solid transparent;border-radius:8px;background:transparent;color:#52677b;font:inherit;font-size:14px;font-weight:700;line-height:1.25;cursor:pointer;touch-action:manipulation;}
.home-install-guide__switch [role="tab"][aria-selected="true"]{border-color:#c0daf0;background:#fff;color:#005a9e;box-shadow:0 1px 3px rgba(0,90,158,.09);}
.home-install-guide__switch [role="tab"]:focus-visible{outline:2px solid #005a9e;outline-offset:2px;}
.home-install-guide__platform[hidden]{display:none!important;}
.home-install-guide__troubleshoot{margin-top:10px;padding:0;border:1px solid #dbe6ef;border-radius:8px;background:#fff;overflow:hidden;}
.home-install-guide__troubleshoot>summary{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:44px;padding:10px;list-style:none;cursor:pointer;color:#005a9e;font-size:13px;line-height:1.4;touch-action:manipulation;}
.home-install-guide__troubleshoot>summary::-webkit-details-marker{display:none;}
.home-install-guide__troubleshoot>summary span{flex:0 0 auto;font-size:12px;font-weight:600;white-space:nowrap;color:#52677b;}
.home-install-guide__troubleshoot[open]>summary{border-bottom:1px solid #e7edf2;}
.home-install-guide__troubleshoot>summary:focus-visible{outline:2px solid #005a9e;outline-offset:-2px;}
.home-install-guide__troubleshoot-body{padding:10px;}
.home-install-guide__troubleshoot-body ol{margin:0;}
.home-u5f-contact--compact{display:flex;flex-direction:column;gap:6px;padding:12px 14px;}
.home-contact-compact__person{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 12px;min-width:0;line-height:1.4;}
.home-u5f-contact--compact h4{margin:0;font-size:14px;line-height:1.4;flex:0 0 auto;}
.home-contact-compact__person strong{font-size:14px;color:#1f2937;overflow-wrap:anywhere;}
.home-contact-compact__channels{display:flex;align-items:center;flex-wrap:wrap;gap:4px 14px;font-size:13px;line-height:1.45;color:#667085;}
.home-contact-compact__channels strong{color:#344054;font-weight:600;}
.home-contact-compact__channels a{font-weight:700;white-space:nowrap;}
@media(max-width:767px){
.home-u5f-contact--compact{padding:10px 12px;gap:5px;}
.home-install-guide__switch [role="tab"]{font-size:13px;}
.home-install-guide__troubleshoot>summary{align-items:flex-start;flex-direction:column;gap:3px;}
}

/* ACCGEN v14.1: contact details reuse the home accordion, with four compact illustrated fields. */
.home-contact-details__body{padding-top:4px;}
.home-contact-details__list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:18px;margin:0;font-style:normal;}
.home-contact-details__item{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:11px;min-width:0;padding:12px 0;border-bottom:1px solid #edf1f5;}
.home-contact-details__item:nth-last-child(-n+2){border-bottom:0;}
.home-contact-details__icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:1px solid #e0edf7;border-radius:10px;background:#edf6fc;color:#005a9e;}
.home-contact-details__icon svg{width:20px;height:20px;display:block;flex:0 0 auto;}
.home-contact-details__info{display:flex;flex-direction:column;gap:2px;min-width:0;}
.home-contact-details__label{color:#667085;font-size:12px;font-weight:500;line-height:1.4;}
.home-contact-details__value{color:#25364a;font-size:14px;font-weight:700;line-height:1.45;overflow-wrap:anywhere;}
.home-contact-details a.home-contact-details__value{color:#005a9e;text-decoration:none;}
.home-contact-details a.home-contact-details__value:hover{text-decoration:underline;text-underline-offset:3px;}
.home-contact-details a.home-contact-details__value:focus-visible{outline:2px solid #005a9e;outline-offset:3px;border-radius:3px;}
@media(max-width:767px){
.home-contact-details__list{grid-template-columns:minmax(0,1fr);}
.home-contact-details__item:nth-last-child(2){border-bottom:1px solid #edf1f5;}
.home-contact-details__item:last-child{border-bottom:0;}
.home-contact-details__item{padding:11px 0;gap:10px;}
}

/* ACCGEN v15A - compact mobile record cards; legacy tables, business logic and APIs remain unchanged. */
.accgen-profile-card-list{display:none;}
.accgen-profile-bulk[hidden]{display:none!important;}
.accgen-profile-bulk{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:11px 12px;margin:0 0 12px;border:1px solid #cfe0ef;border-radius:10px;background:#f5faff;}
.accgen-profile-bulk__count{font-size:13px;color:#15466b;font-weight:700;flex:1 1 auto;}
.accgen-profile-bulk__actions{display:flex;gap:8px;flex-wrap:wrap;width:100%;}
.accgen-profile-bulk__actions .btn{min-height:42px;margin:0!important;flex:1 1 100px;padding:9px 12px;font-size:13px;}
.accgen-profile-bulk__reset{border:0;background:transparent;color:#005a9e;font-weight:700;font-size:13px;cursor:pointer;padding:5px 0;}
.accgen-sort-toggle{display:none;}
#view-persons-list .accgen-data-status--ready,#view-businesses-list .accgen-data-status--ready,#view-companies-list .accgen-data-status--ready{background:transparent;border:0;box-shadow:none;color:#65768a;padding:2px 0 0;margin:0 0 12px;min-height:0;font-size:12px;font-weight:500;line-height:1.45;}
@media(max-width:767px){
  #view-persons-list.accgen-cards-ready .list-table-wrapper,#view-businesses-list.accgen-cards-ready .list-table-wrapper,#view-companies-list.accgen-cards-ready .list-table-wrapper{display:none!important;}
  #view-persons-list.accgen-cards-ready .accgen-profile-card-list,#view-businesses-list.accgen-cards-ready .accgen-profile-card-list,#view-companies-list.accgen-cards-ready .accgen-profile-card-list{display:flex;}
  #view-persons-list .list-toolbar,#view-businesses-list .list-toolbar,#view-companies-list .list-toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px;margin-bottom:8px;}
  #view-persons-list .list-toolbar__search,#view-businesses-list .list-toolbar__search,#view-companies-list .list-toolbar__search{grid-column:1;grid-row:1;min-width:0;width:100%;min-height:44px;margin:0;}
  #view-persons-list .accgen-sort-toggle,#view-businesses-list .accgen-sort-toggle,#view-companies-list .accgen-sort-toggle{display:flex;align-items:center;justify-content:center;grid-column:2;grid-row:1;width:44px;height:44px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#005a9e;font-size:22px;cursor:pointer;line-height:1;touch-action:manipulation;}
  #view-persons-list .list-toolbar:not(.accgen-sort-open) .list-toolbar__sort-wrapper,#view-businesses-list .list-toolbar:not(.accgen-sort-open) .list-toolbar__sort-wrapper,#view-companies-list .list-toolbar:not(.accgen-sort-open) .list-toolbar__sort-wrapper{display:none!important;}
  #view-persons-list .list-toolbar__sort-wrapper,#view-businesses-list .list-toolbar__sort-wrapper,#view-companies-list .list-toolbar__sort-wrapper{grid-column:1/-1;grid-row:2;margin-top:2px;}
  #view-persons-list .list-toolbar>.btn,#view-businesses-list .list-toolbar>.btn,#view-companies-list .list-toolbar>.btn{display:none!important;}
  .accgen-profile-card-list{flex-direction:column;gap:11px;min-width:0;margin:0;}
  .accgen-profile-card{position:relative;min-width:0;padding:13px;border-radius:12px;border:1px solid #d5e1ea;background:#fff;box-shadow:0 1px 4px rgba(11,42,73,.045);}
  .accgen-profile-card__header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0;}
  .accgen-profile-card__heading{min-width:0;flex:1 1 auto;}
  .accgen-profile-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;color:#123b58;font-size:15px;line-height:1.45;font-weight:700;word-break:break-word;}
  .accgen-profile-card__identity{margin-top:4px;color:#566d82;font-size:12px;line-height:1.45;overflow-wrap:anywhere;}
  .accgen-profile-card__select{display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;cursor:pointer;flex:0 0 40px;margin:-7px -7px 0 0;}
  .accgen-profile-card__select input{width:19px;height:19px;accent-color:#005a9e;cursor:pointer;}
  .accgen-profile-card__meta{display:flex;flex-wrap:wrap;gap:5px 12px;margin-top:10px;color:#566d82;font-size:12px;line-height:1.5;}
  .accgen-profile-card__meta-item{display:inline-flex;align-items:baseline;min-width:0;gap:5px;overflow-wrap:anywhere;}
  .accgen-profile-card__meta-label{color:#708093;flex:0 0 auto;}
  .accgen-profile-card__meta-value{color:#34495e;font-weight:500;overflow-wrap:anywhere;}
  .accgen-profile-card__details{margin-top:9px;padding-top:9px;border-top:1px dashed #e0e8ed;color:#365167;font-size:12px;}
  .accgen-profile-card__details summary{cursor:pointer;color:#005a9e;font-weight:600;list-style:none;}
  .accgen-profile-card__details summary::-webkit-details-marker{display:none;}
  .accgen-profile-card__details summary::after{content:'⌄';padding-left:6px;}
  .accgen-profile-card__details[open] summary::after{content:'⌃';}
  .accgen-profile-card__detail-line{margin-top:7px;overflow-wrap:anywhere;}
  .accgen-profile-card__actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;gap:7px;align-items:start;margin-top:11px;padding-top:11px;border-top:1px solid #e8eff4;}
  .accgen-profile-card__actions>.btn{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;margin:0!important;padding:8px 6px;border-radius:8px;font-size:13px;line-height:1.2;white-space:nowrap;}
  .accgen-profile-card__actions>.btn.btn-primary{background:#005a9e;color:#fff;}
  .accgen-profile-card__actions>.btn.btn-secondary{background:#f5f8fb;color:#005a9e;border:1px solid #d4e1eb;}
  .accgen-profile-card__more-trigger{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:1px solid #d4e1eb;border-radius:8px;background:#fff;color:#005a9e;font-size:24px;line-height:1;cursor:pointer;user-select:none;}
  .accgen-profile-card__more-trigger[aria-expanded="true"]{background:#eaf4fb;border-color:#96c4e1;}
  .accgen-profile-card__more-actions[hidden]{display:none!important;}
  .accgen-profile-card__more-actions{display:flex;gap:8px;margin-top:8px;}
  .accgen-profile-card__more-actions>.btn{flex:1 1 0;min-width:0;min-height:42px;margin:0!important;font-size:13px;padding:8px 5px;border:1px solid #d8e3ec;border-radius:8px;background:#f6f8fa;color:#1f2937;}
  .accgen-profile-card__more-actions>.btn.accgen-profile-card__delete{background:#fff7f7;color:#a52323;border-color:#eccbcb;}
  .accgen-profile-card__empty{padding:20px 14px;text-align:center;border-radius:12px;border:1px dashed #cedbe5;background:#fff;color:#667085;font-size:14px;}
  .accgen-profile-bulk{margin:4px 0 12px;}
  .accgen-profile-bulk__actions{width:100%;}
}
@media(max-width:320px){
  .accgen-profile-card{padding:11px;}
  .accgen-profile-card__actions{gap:6px;}
  .accgen-profile-card__actions>.btn{font-size:12px;}
}

/* ACCGEN v15A.1: denser card details and accessible four-action layout. */
@media(max-width:767px){
.accgen-profile-card__meta{gap:5px 11px;margin-top:9px;}
.accgen-profile-card__title--expandable{cursor:pointer;}
.accgen-profile-card__title--expandable:focus-visible{outline:2px solid #005a9e;outline-offset:2px;border-radius:3px;}
.accgen-profile-card--name-expanded .accgen-profile-card__title{display:block;-webkit-line-clamp:unset;line-clamp:unset;overflow:visible;}
.accgen-profile-card__meta-item{line-height:1.5;}
.accgen-profile-card__actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:11px;padding-top:11px;}
.accgen-profile-card__actions>.btn{display:flex;justify-content:center;align-items:center;width:100%;min-width:0;min-height:44px;margin:0!important;padding:8px 3px;border-radius:8px;font-size:clamp(11px,3.25vw,13px);font-weight:700;line-height:1.2;white-space:nowrap;}
.accgen-profile-card__actions>.btn.accgen-profile-card__apc{background:#f2f5f8;border:1px solid #d5e1ea;color:#344c62;}
.accgen-profile-card__actions>.btn.accgen-profile-card__delete{background:#fff7f7;border:1px solid #ecc9c9;color:#ad2c2c;}
.accgen-profile-pagination--single{display:none!important;}
}
.accgen-profile-pagination{display:flex;align-items:center;justify-content:center;gap:4px;width:max-content;max-width:100%;margin:15px auto 8px;padding:4px;border:1px solid #d9e5ee;border-radius:12px;background:#fff;box-shadow:0 1px 3px rgba(22,63,91,.04);}
.accgen-profile-pagination .btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:40px;min-width:76px;margin:0!important;padding:7px 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:#005a9e;font-size:13px;font-weight:700;}
.accgen-profile-pagination .btn:first-child::before{content:'‹';font-size:23px;line-height:.7;}
.accgen-profile-pagination .btn:last-child::after{content:'›';font-size:23px;line-height:.7;}
.accgen-profile-pagination .btn:not(:disabled):hover{background:#edf6fc;border-color:#d1e5f3;}
.accgen-profile-pagination .btn:disabled{opacity:.38;cursor:default;}
.accgen-profile-pagination [id$="page-info"]{display:block;min-width:82px;padding:9px 6px;text-align:center;font-size:12px;font-weight:700;color:#31536d;line-height:1.5;white-space:nowrap;}
/* Shared capture/import control style, scoped to person/business/company forms only. */
.accgen-capture-actions{display:flex;align-items:stretch;flex-wrap:wrap;gap:9px;max-width:100%;margin:0 0 16px;padding:0;}
.accgen-capture-actions .accgen-capture-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:1 1 145px;min-width:0;min-height:46px;margin:0!important;padding:10px 12px;border:1px solid #c6dce9;border-radius:9px;background:#f8fbfd;color:#005a9e;font-size:13px;font-weight:700;line-height:1.3;text-align:center;white-space:normal;box-shadow:0 1px 2px rgba(9,63,105,.035);touch-action:manipulation;}
.accgen-capture-actions .accgen-capture-btn:focus-visible,.accgen-form-utility-btn:focus-visible,.accgen-form-footer .btn:focus-visible{outline:2px solid #005a9e;outline-offset:2px;}
.accgen-capture-actions .accgen-capture-btn:hover:not(:disabled){background:#edf6fc;border-color:#93c3df;}
.accgen-capture-actions .accgen-capture-btn:active:not(:disabled){background:#dceffa;}
.accgen-capture-btn__icon{display:flex;align-items:center;justify-content:center;flex:0 0 18px;color:#005a9e;}
.accgen-capture-btn__icon svg{display:block;width:18px;height:18px;}
.accgen-capture-btn__label{min-width:0;overflow-wrap:normal;}
.accgen-capture-actions--company .form-hint{flex:1 0 100%;font-size:12px;color:#667085;line-height:1.45;}
.accgen-capture-actions--owner{margin-bottom:12px;}
.accgen-form-utility-btn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;margin:0!important;padding:8px 12px;border:1px solid #d4e1eb;border-radius:8px;background:#f8fafc;color:#005a9e;font-size:13px;font-weight:700;}
.accgen-form-utility-btn:hover{background:#edf6fc;border-color:#9ecbe5;}
.accgen-form-footer{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.accgen-form-footer .btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:0!important;padding:10px 14px;border-radius:8px;font-size:13px;}
.accgen-form-footer .btn-secondary{border:1px solid #d7e3eb;background:#f1f5f8;color:#3d5267;}
@media(max-width:767px){
.accgen-capture-actions .accgen-capture-btn{flex:1 1 0;padding:9px 6px;gap:6px;}
.accgen-capture-actions .accgen-capture-btn__icon{flex-basis:17px;}
.accgen-capture-actions .accgen-capture-btn__icon svg{width:17px;height:17px;}
.accgen-capture-actions--company .form-hint{margin:0;}
}
@media(max-width:320px){
.accgen-profile-card__actions>.btn{padding:7px 2px;font-size:11px;}
.accgen-profile-pagination .btn{min-width:67px;padding:7px 5px;}
.accgen-capture-actions .accgen-capture-btn{font-size:12px;gap:4px;padding:7px 3px;}
.accgen-capture-actions .accgen-capture-btn__icon{flex-basis:15px;}
.accgen-capture-actions .accgen-capture-btn__icon svg{width:15px;height:15px;}
}

/* ACCGEN v15A.2: compact read-only details and consistent inline capture actions. */
.accgen-capture-actions .accgen-capture-btn{
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    flex-wrap:nowrap!important;
    gap:7px;
    text-align:center;
}
.accgen-capture-actions .accgen-capture-btn__icon{
    display:inline-flex!important;
    flex:0 0 18px!important;
    width:18px;
    align-self:center!important;
}
.accgen-capture-actions .accgen-capture-btn__label{
    display:inline-block!important;
    flex:0 1 auto;
    width:auto!important;
    text-align:left;
    min-width:0;
    line-height:1.3;
}
#btn-business-owner-create-new.accgen-form-utility-btn{
    margin:8px 0 0!important;
    width:max-content;
    max-width:100%;
    min-height:40px;
    border-radius:8px;
    border:1px solid #d4e1eb;
    padding:8px 12px;
    font-size:13px;
    font-weight:700;
    background:#f8fafc;
    color:#005a9e;
}
#btn-business-owner-create-new.accgen-form-utility-btn:hover{background:#edf6fc;border-color:#9ecbe5;}
@media(max-width:767px){
    .accgen-profile-detail{margin-top:8px;min-width:0;border-top:1px solid #e4edf3;}
    .accgen-profile-detail__toggle{
        display:flex;
        align-items:center;
        justify-content:space-between;
        min-height:36px;
        padding:8px 2px;
        color:#005a9e;
        font-size:12px;
        font-weight:700;
        cursor:pointer;
        list-style:none;
    }
    .accgen-profile-detail__toggle::-webkit-details-marker{display:none;}
    .accgen-profile-detail__chevron{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;height:28px;margin-left:auto;border:1px solid #dbe8f1;border-radius:8px;background:#f4f9fc;color:#005a9e;}
    .accgen-profile-detail__chevron svg{display:block;width:16px;height:16px;transition:transform .16s ease;}
    .accgen-profile-detail[open] .accgen-profile-detail__chevron svg{transform:rotate(180deg);}
    .accgen-profile-detail__collapse-label{display:none;}
    .accgen-profile-detail[open] .accgen-profile-detail__expand-label{display:none;}
    .accgen-profile-detail[open] .accgen-profile-detail__collapse-label{display:inline;}
    .accgen-profile-detail__toggle:focus-visible{outline:2px solid #005a9e;outline-offset:2px;border-radius:4px;}
    .accgen-profile-detail__body{padding:2px 0 6px;display:grid;gap:13px;min-width:0;}
    .accgen-profile-detail__section{min-width:0;}
    .accgen-profile-detail__section-title{
        font-size:12px;
        line-height:1.4;
        color:#005a9e;
        font-weight:700;
        margin:0 0 7px;
    }
    .accgen-profile-detail__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
    .accgen-profile-detail__cell{
        display:flex;
        flex-direction:column;
        gap:3px;
        min-width:0;
        padding:9px 10px;
        border:1px solid #e2eaf0;
        border-radius:8px;
        background:#f8fafc;
    }
    .accgen-profile-detail__cell--wide{grid-column:1/-1;}
    .accgen-profile-detail__label{font-size:11px;line-height:1.4;color:#667085;overflow-wrap:anywhere;}
    .accgen-profile-detail__value{font-size:12px;font-weight:600;line-height:1.48;color:#22384c;overflow-wrap:anywhere;white-space:pre-wrap;}
    .accgen-profile-detail__value--empty{font-weight:400;font-style:italic;color:#748292;}
    .accgen-profile-detail__notice{margin:5px 0 8px;padding:9px 10px;background:#f3f8fc;border-radius:7px;color:#536c80;font-size:12px;line-height:1.45;}
    .accgen-profile-detail__notice--error{background:#fff5f5;color:#b42318;}
    .accgen-profile-card__actions{margin-top:5px;padding-top:9px;}
}
@media(max-width:320px){
    .accgen-capture-actions .accgen-capture-btn{gap:4px!important;padding:7px 3px!important;}
    .accgen-capture-actions .accgen-capture-btn__icon{flex-basis:15px!important;width:15px;}
}

/* ACCGEN v15A.3: match QR/OCR icon spacing and vertical alignment on small screens. */
.accgen-capture-actions .accgen-capture-btn{
    display:inline-flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:center!important;
    column-gap:10px!important;
    min-height:46px;
    padding:9px 11px!important;
    white-space:nowrap!important;
    line-height:1.2!important;
}
.accgen-capture-actions .accgen-capture-btn__icon{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 18px!important;
    width:18px!important;
    height:18px!important;
    margin:0!important;
    line-height:1!important;
}
.accgen-capture-actions .accgen-capture-btn__icon svg{
    display:block!important;
    flex:none!important;
    width:18px!important;
    height:18px!important;
    vertical-align:middle;
}
.accgen-capture-actions .accgen-capture-btn__label{
    display:block!important;
    flex:0 1 auto!important;
    min-width:0;
    margin:0!important;
    line-height:1.25!important;
    text-align:left;
    white-space:nowrap!important;
}
@media(max-width:359px){
    .accgen-capture-actions .accgen-capture-btn{column-gap:7px!important;padding:8px 5px!important;font-size:11px!important;}
    .accgen-capture-actions .accgen-capture-btn__icon{flex-basis:16px!important;width:16px!important;height:16px!important;}
    .accgen-capture-actions .accgen-capture-btn__icon svg{width:16px!important;height:16px!important;}
}

/* ACCGEN v15A.4 FIXED: Person card - two columns, inline labels and values. */
@media(max-width:767px){
  #view-persons-list .accgen-profile-card__meta--person{
    display:grid;
    grid-template-columns:minmax(0,1.36fr) minmax(0,1fr);
    column-gap:10px;
    row-gap:5px;
    margin-top:8px;
    font-size:12px;
    line-height:1.5;
  }
  #view-persons-list .accgen-profile-card__meta--person .accgen-profile-card__meta-item{
    display:inline-flex;
    align-items:baseline;
    min-width:0;
    gap:4px;
    white-space:nowrap;
    overflow:visible;
  }
  #view-persons-list .accgen-profile-card__meta--person .accgen-profile-card__meta-item--empty{
    visibility:hidden;
  }
}
@media(max-width:340px){
  #view-persons-list .accgen-profile-card__meta--person{column-gap:5px;font-size:11px;}
  #view-persons-list .accgen-profile-card__meta--person .accgen-profile-card__meta-item{gap:3px;}
}

/* ACCGEN v18.5: Business/Company basic metadata follows Person's fixed two-column mobile layout. */
@media(max-width:767px){
  #view-businesses-list .accgen-profile-card__meta,#view-companies-list .accgen-profile-card__meta{display:grid;grid-template-columns:minmax(0,1.36fr) minmax(0,1fr);column-gap:10px;row-gap:5px;margin-top:8px;font-size:12px;line-height:1.5;}
  #view-businesses-list .accgen-profile-card__meta-item,#view-companies-list .accgen-profile-card__meta-item{display:flex;align-items:baseline;min-width:0;gap:4px;overflow:hidden;white-space:nowrap;}
  #view-businesses-list .accgen-profile-card__meta-label,#view-companies-list .accgen-profile-card__meta-label{flex:0 0 auto;white-space:nowrap;}
  #view-businesses-list .accgen-profile-card__meta-value,#view-companies-list .accgen-profile-card__meta-value{display:block;flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  #view-businesses-list .accgen-profile-card__meta-item--empty,#view-companies-list .accgen-profile-card__meta-item--empty{visibility:hidden;}
}
@media(max-width:340px){
  #view-businesses-list .accgen-profile-card__meta,#view-companies-list .accgen-profile-card__meta{column-gap:5px;font-size:11px;}
  #view-businesses-list .accgen-profile-card__meta-item,#view-companies-list .accgen-profile-card__meta-item{gap:3px;}
}

/* ACCGEN v15B - compact template creation and mobile history, desktop unchanged. */
.templates-history-mobile-controls,.templates-history-mobile-summary,.templates-history-mobile-cards,.templates-history-search-empty{display:none;}
.templates-history-filter-modal{display:block;position:static;}
.templates-history-filter-panel{display:block;}
.templates-history-filter-backdrop,.templates-history-filter-heading{display:none;}
@media(max-width:767px){
  #templates-user-state .templates-generate-card,#templates-user-state .templates-history-card{padding:12px!important;border-radius:12px!important;box-shadow:0 1px 4px rgba(15,58,94,.055)!important;}
  #templates-user-state .templates-history-card{margin-top:12px!important;}
  #templates-user-state .templates-generate-card .user-generate-panel-heading{display:none!important;}
  #templates-user-state #user-generate-tabs{margin-bottom:14px!important;padding-bottom:10px!important;gap:8px!important;}
  #templates-user-state #user-generate-tabs .btn{flex:1;min-height:40px;padding:8px 7px;font-size:13px;line-height:1.2;margin:0;white-space:normal;}
  #templates-user-state .templates-single-grid{gap:10px!important;}
  #templates-user-state .templates-history-mobile-controls{display:grid;grid-template-columns:minmax(0,1fr)auto auto;align-items:center;gap:7px;margin-bottom:6px;}
  #templates-user-state .templates-history-search-box{display:flex;align-items:center;gap:7px;min-width:0;height:44px;padding:0 10px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;}
  #templates-user-state .templates-history-search-box:focus-within{border-color:#005a9e;box-shadow:0 0 0 2px rgba(0,90,158,.1);}
  .templates-history-search-box svg{width:17px;height:17px;flex-shrink:0;color:#667085;}
  #templates-user-state #templates-history-search-in-page{width:100%;min-width:0;border:0!important;outline:0!important;background:transparent;font-size:14px!important;padding:8px 0!important;color:#1f2937;box-shadow:none!important;}
  #templates-user-state .templates-history-toolbar-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:44px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fbfe;color:#005a9e;font-size:13px;font-weight:700;padding:8px 10px;cursor:pointer;}
  #templates-user-state .templates-history-toolbar-btn svg{width:16px;height:16px;flex-shrink:0;}
  #templates-user-state .templates-history-toolbar-btn[aria-pressed=true]{background:#e8f4fd;border-color:#8fc2e8;}
  .templates-history-filter-indicator{position:absolute;right:-4px;top:-5px;min-width:17px;height:17px;padding:1px 4px;border-radius:10px;background:#005a9e;color:#fff;font-size:10px;line-height:15px;}
  #templates-user-state .templates-history-mobile-summary{display:block;margin:0 0 11px;color:#667085;font-size:11px;line-height:1.35;}
  #templates-user-state .templates-history-filter-modal{display:none;position:fixed;inset:0;z-index:10030;isolation:isolate;}
  #templates-user-state .templates-history-filter-modal.is-open{display:block;}
  .templates-history-filter-backdrop{display:block;position:absolute;inset:0;background:rgba(17,34,51,.42);}
  #templates-user-state .templates-history-filter-panel{position:absolute;left:0;right:0;bottom:0;display:block;width:100%;max-height:min(85dvh,770px);overflow:auto;overscroll-behavior:contain;padding:14px 15px calc(14px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0;background:#fff;box-shadow:0 -9px 35px rgba(0,0,0,.15);}
  #templates-user-state .templates-history-filter-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px;padding-bottom:12px;border-bottom:1px solid #e7ecf1;color:#0f3a5e;font-size:15px;}
  .templates-history-filter-close{display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;border:1px solid #d7e5ef;border-radius:10px;background:#f5faff;color:#005a9e;font-size:26px;line-height:1;cursor:pointer;}
  #templates-user-state .templates-history-filter-panel .templates-history-filters{display:grid;grid-template-columns:1fr!important;gap:10px!important;}
  #templates-user-state .templates-history-filter-panel .templates-history-filter-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0 0!important;}
  #templates-user-state .templates-history-filter-panel .templates-history-filter-actions .btn{min-height:44px!important;margin:0!important;}
  #templates-user-state .templates-history-table-wrap{display:none!important;}
  #templates-user-state .templates-history-mobile-cards{display:grid;gap:10px;}
  #templates-user-state .templates-history-mobile-card{min-width:0;padding:13px;border:1px solid #d5e3ef;border-radius:12px;background:#fff;box-shadow:0 2px 5px rgba(22,55,85,.045);}
  .templates-history-mobile-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:9px;min-width:0;}
  .templates-history-mobile-card-title-block{flex:1;min-width:0;}
  .templates-history-mobile-card-title{font-size:15px;font-weight:700;color:#16426a;line-height:1.4;overflow-wrap:anywhere;}
  .templates-history-mobile-card-type{display:block;margin-top:3px;color:#667085;font-size:12px;line-height:1.45;}
  #templates-user-state .templates-history-card-check{display:none;flex-shrink:0;width:20px;height:20px;margin:2px 0 0;accent-color:#005a9e;cursor:pointer;}
  #templates-user-state .templates-history-is-selecting .templates-history-card-check{display:block;}
  .templates-history-mobile-card-customer{margin-top:9px;color:#1f2937;font-size:14px;font-weight:600;line-height:1.45;overflow-wrap:anywhere;}
  .templates-history-mobile-card-meta{display:flex;align-items:center;gap:6px 13px;flex-wrap:wrap;margin-top:9px;color:#667085;font-size:12px;line-height:1.45;}
  .templates-history-mobile-card-status{margin-left:auto;display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;border-radius:999px;border:1px solid #ccebd8;background:#eff9f1;color:#267445;font-size:11px;font-weight:700;}
  .templates-history-mobile-card-status.is-archived{background:#f4f6f8;border-color:#e0e5ea;color:#536171;}
  .templates-history-mobile-card-status.is-error{background:#fff2f2;border-color:#f2cece;color:#ab3838;}
  .templates-history-mobile-card-actions{display:grid;grid-template-columns:minmax(0,1fr)44px;gap:8px;align-items:center;padding-top:12px;margin-top:11px;border-top:1px solid #e8eff5;}
  .templates-history-mobile-download,.templates-history-mobile-no-download{display:flex;align-items:center;justify-content:center;grid-column:1;grid-row:1;min-height:44px;border-radius:8px;font-size:13px;font-weight:700;}
  .templates-history-mobile-download{background:#005a9e;color:#fff;border:1px solid #005a9e;cursor:pointer;}
  .templates-history-mobile-no-download{background:#f2f4f6;color:#667085;}
  .templates-history-mobile-action-menu{display:contents;}
  .templates-history-mobile-more{display:flex;align-items:center;justify-content:center;grid-column:2;grid-row:1;height:44px;width:44px;border:1px solid #cbd5e1;border-radius:8px;color:#005a9e;background:#f8fbfe;font-size:22px;line-height:1;cursor:pointer;list-style:none;}
  .templates-history-mobile-more::-webkit-details-marker{display:none;}
  .templates-history-mobile-menu-items{display:none;grid-column:1/-1;grid-row:2;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .templates-history-mobile-action-menu[open] .templates-history-mobile-menu-items{display:grid;}
  .templates-history-mobile-menu-action{min-height:42px;border:1px solid #d1e2ef;background:#f8fbfe;border-radius:8px;color:#005a9e;font-size:13px;font-weight:700;cursor:pointer;}
  .templates-history-mobile-menu-action.is-delete{border-color:#eecbcb;background:#fff7f7;color:#b42323;}
  .templates-history-mobile-card[hidden]{display:none!important;}
  #templates-user-state .templates-history-search-empty:not([hidden]){display:block;text-align:center;padding:24px 12px;border:1px dashed #d6e1eb;border-radius:10px;color:#667085;font-size:13px;}
  #templates-user-state .templates-history-bulk-toolbar{display:none!important;}
  #templates-user-state .templates-history-is-selecting .templates-history-bulk-toolbar{display:grid!important;grid-template-columns:1fr;gap:8px;margin-bottom:12px;padding:10px;border:1px solid #cfe3f2;border-radius:10px;background:#f3f9fd;}
  #templates-user-state .templates-history-is-selecting .templates-history-bulk-selection{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
  #templates-user-state .templates-history-is-selecting #templates-history-selected-count{grid-column:1/-1;text-align:left;font-size:13px;}
  #templates-user-state .templates-history-is-selecting .templates-history-bulk-toolbar .btn{min-height:40px;font-size:12px;}
  #templates-user-state .templates-history-pagination{display:flex!important;align-items:center;justify-content:center!important;gap:12px;margin-top:12px!important;}
  #templates-user-state .templates-history-pagination .btn{min-height:40px;padding:8px 12px;border:1px solid #d7e3ed;border-radius:8px;background:#f8fbfe;font-size:12px;}
  #templates-user-state .templates-history-pagination.templates-history-one-page{display:none!important;}
  #templates-user-state #templates-history-page-info{font-size:12px;font-weight:700;color:#16426a;white-space:nowrap;}
}
@media(max-width:345px){
  #templates-user-state .templates-history-mobile-controls{gap:5px;}
  #templates-user-state .templates-history-toolbar-btn{padding:6px 7px;}
  #templates-user-state .templates-history-mobile-card{padding:11px;}
  .templates-history-mobile-card-meta{gap:6px 9px;}
}

/* Optional sequence field is compact on mobile and unchanged on desktop. */
#templates-user-state .templates-sequence-disclosure{min-width:0;}
#templates-user-state .templates-sequence-disclosure>summary{display:none;}
@media(max-width:767px){
  #templates-user-state .templates-sequence-disclosure{padding:0;border:1px solid #dbe6ef;border-radius:9px;background:#f8fbfe;}
  #templates-user-state .templates-sequence-disclosure>summary{display:flex;align-items:center;gap:5px;min-height:42px;padding:10px 12px;color:#005a9e;font-size:13px;font-weight:700;cursor:pointer;list-style:none;}
  #templates-user-state .templates-sequence-disclosure>summary::-webkit-details-marker{display:none;}
  #templates-user-state .templates-sequence-disclosure>summary span{color:#667085;font-size:12px;font-weight:400;}
  #templates-user-state .templates-sequence-disclosure>summary::after{content:"";margin-left:auto;flex:0 0 8px;width:8px;height:8px;border-right:1.8px solid #005a9e;border-bottom:1.8px solid #005a9e;transform:translateY(-2px) rotate(45deg);transition:transform .15s ease;}
  #templates-user-state .templates-sequence-disclosure[open]>summary{border-bottom:1px solid #e2eaf1;}
  #templates-user-state .templates-sequence-disclosure[open]>summary::after{transform:translateY(2px) rotate(225deg);}
  #templates-user-state .templates-sequence-disclosure>.form-group{padding:10px 12px 12px;}
}

/* ACCGEN v15B.1: batch sequence and history cards – presentation-only mobile refinements. */
#templates-batch-table thead th:nth-child(4),#templates-batch-table tbody td:nth-child(4){display:none!important;}
@media(max-width:767px){
  #templates-user-state .templates-sequence-required{display:block;min-width:0;}
  #templates-user-state .templates-sequence-required input{width:100%;}
  #user-generate-panel-batch #templates-batch-table td:nth-child(4){display:none!important;}
  #user-generate-panel-batch #templates-batch-table td:nth-child(4)::before{display:none!important;}
  #user-generate-panel-batch #templates-batch-table td:nth-child(5){grid-column:1/-1;grid-row:3;display:flex!important;justify-content:space-between;align-items:center;gap:12px;margin-top:7px;padding-top:11px!important;border-top:1px solid #e6edf3!important;}
  #user-generate-panel-batch #templates-batch-table td:nth-child(5)::before{content:"STT hồ sơ"!important;display:block;flex:0 0 auto;white-space:nowrap;color:#526b82;font-weight:600;font-size:13px;}
  #user-generate-panel-batch #templates-batch-table td:nth-child(5) .template-batch-sequence{flex:0 1 132px;max-width:132px;min-width:92px!important;width:132px!important;height:44px;}
  #templates-user-state .templates-history-mobile-controls{grid-template-columns:minmax(0,1fr)auto;gap:8px;}
  #templates-user-state input#templates-history-search-in-page{display:block;box-sizing:border-box;appearance:none;-webkit-appearance:none;min-width:0;width:100%!important;height:44px!important;min-height:44px!important;margin:0;padding:0 10px 0 38px!important;border:1px solid #cbd5e1!important;border-radius:8px!important;background:#fff url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23667085%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%227%22%2F%3E%3Cpath%20d%3D%22m20%2020-4-4%22%2F%3E%3C%2Fsvg%3E") 12px center/17px 17px no-repeat!important;box-shadow:none!important;outline:none!important;color:#1f2937;font-size:16px!important;line-height:normal;}
  #templates-user-state input#templates-history-search-in-page:focus{border-color:#005a9e!important;box-shadow:0 0 0 2px rgba(0,90,158,.12)!important;}
  #templates-user-state .templates-history-card-check{display:block;flex-shrink:0;accent-color:#005a9e;width:20px;height:20px;margin:2px 0 0;}
  .templates-history-mobile-card-title{font-size:15px;line-height:1.4;}
  .templates-history-mobile-card-info{margin-top:10px;display:grid;gap:6px;}
  .templates-history-mobile-card-info-line{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:start;column-gap:8px;min-width:0;}
  .templates-history-mobile-card-info-label{font-size:12px;line-height:1.4;color:#708093;}
  .templates-history-mobile-card-info-value{font-size:12px;line-height:1.4;color:#405368;min-width:0;overflow-wrap:anywhere;}
  .templates-history-mobile-card-meta{margin-top:5px;font-size:12px;}
  .templates-history-mobile-card-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px;padding-top:11px;}
  .templates-history-mobile-download,.templates-history-mobile-visibility,.templates-history-mobile-delete{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;padding:8px 3px;border-radius:8px;font-size:12px;font-weight:700;line-height:1.15;white-space:nowrap;cursor:pointer;}
  .templates-history-mobile-download{grid-column:auto;grid-row:auto;border:1px solid #005a9e;background:#005a9e;color:#fff;}
  .templates-history-mobile-visibility{border:1px solid #cbd5e1;background:#f8fbfe;color:#16426a;}
  .templates-history-mobile-delete{border:1px solid #efc8c8;background:#fff7f7;color:#c52a2a;}
  .templates-history-mobile-card-actions button:disabled{cursor:not-allowed;opacity:.45;}
}
@media(max-width:320px){
  #templates-user-state .templates-history-mobile-card-info-line{grid-template-columns:58px minmax(0,1fr);column-gap:6px;}
  #templates-user-state .templates-history-mobile-card-actions{gap:5px;}
  #templates-user-state .templates-history-mobile-card-actions button{font-size:11px;}
}


/* ACCGEN v15B.2: mobile workspace tabs. Retain both original panels/inputs in DOM. */
.templates-workspace-mobile-title,.templates-workspace-tabs{display:none;}
.templates-workspace-panel{min-width:0;}
@media(max-width:767px){
  #templates-user-state .templates-workspace-page-header{margin-bottom:10px;padding-bottom:8px;}
  #templates-user-state .templates-workspace-desktop-title{display:none;}
  #templates-user-state .templates-workspace-mobile-title{display:inline;}
  #templates-user-state .templates-workspace-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;width:100%;margin:0 0 12px;padding:5px;background:#eaf1f6;border:1px solid #d7e5ef;border-radius:11px;}
  #templates-user-state .templates-workspace-tabs button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;margin:0;padding:8px 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:#586c7e;font-size:14px;line-height:1.25;font-weight:700;cursor:pointer;touch-action:manipulation;}
  #templates-user-state .templates-workspace-tabs button[aria-selected="true"]{background:#fff;border-color:#bfd7e8;color:#005a9e;box-shadow:0 1px 4px rgba(0,70,120,.10);}
  #templates-user-state .templates-workspace-tabs button:focus-visible{outline:2px solid #005a9e;outline-offset:1px;}
  #templates-user-state[data-workspace-tab="create"] #templates-workspace-history-panel{display:none!important;}
  #templates-user-state[data-workspace-tab="history"] #templates-workspace-create-panel{display:none!important;}
  #templates-user-state #templates-workspace-history-panel .templates-history-card{margin-top:0!important;}
  #templates-user-state .templates-workspace-history-link{display:inline-flex;align-items:center;justify-content:center;min-height:36px;margin:8px 0 0 8px;padding:7px 11px;border:1px solid #99c9ea;border-radius:7px;background:#f2f9ff;color:#005a9e;font-size:12px;font-weight:700;cursor:pointer;}
}


/* ACCGEN v16: Home hierarchy + Person form single-layer layout; visual-only, scoped. */
#view-main .home-u5f-shell{width:100%;max-width:960px;margin-inline:auto;gap:13px;}
#view-main .home-v16-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;position:relative;isolation:isolate;overflow:hidden;padding:18px 20px;border:1px solid #c8e2f3;border-radius:16px;background:linear-gradient(117deg,#f0f8ff 0%,#e8f4fd 56%,#ddecfa 100%);box-shadow:0 5px 16px rgba(0,90,158,.07);}
#view-main .home-v16-hero::before{content:"";position:absolute;z-index:-1;width:180px;height:180px;right:-74px;top:-98px;border-radius:50%;border:24px solid rgba(80,158,220,.1);pointer-events:none;}
#view-main .home-v16-hero__text{min-width:0;flex:1 1 auto;}
#view-main .home-v16-hero__eyebrow{display:block;margin-bottom:6px;color:#396a90;font-size:11px;font-weight:800;letter-spacing:.08em;line-height:1.2;}
#view-main .home-v16-hero h3{margin:0;color:#143b59;font-size:clamp(18px,2.4vw,25px);line-height:1.26;font-weight:750;letter-spacing:-.02em;overflow-wrap:break-word;}
#view-main .home-v16-hero h3 span{color:#005a9e;white-space:nowrap;}
#view-main .home-v16-hero p{margin-top:8px;color:#526b80;font-size:13px;line-height:1.5;max-width:440px;}
#view-main .home-v16-hero__mark{display:grid;place-items:center;flex:0 0 82px;width:82px;height:82px;border:1px solid rgba(112,174,221,.25);border-radius:22px;background:rgba(255,255,255,.7);box-shadow:0 4px 12px rgba(0,90,158,.07);color:#005a9e;}
#view-main .home-v16-hero__mark svg{display:block;width:63px;height:63px;}
#view-main .home-u5f-plan-card{position:relative;isolation:isolate;overflow:hidden;padding:17px 18px;border:1px solid #afd4ec;border-radius:15px;background:linear-gradient(135deg,#ffffff 0%,#f4faff 65%,#eaf5ff 100%);box-shadow:0 5px 15px rgba(0,90,158,.07);}
#view-main .home-u5f-plan-card::before{content:"";position:absolute;z-index:-1;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,#005a9e,#39a6df);}
#view-main .home-v16-plan-title{display:flex;align-items:center;gap:9px;min-width:0;}
#view-main .home-v16-plan-icon{display:grid;place-items:center;flex:0 0 35px;width:35px;height:35px;color:#005a9e;border-radius:11px;background:#e3f1fc;}
#view-main .home-v16-plan-icon svg{width:19px;height:19px;display:block;}
#view-main .home-u5f-plan-card .home-u5f-kicker{color:#005a9e;font-size:11px;font-weight:800;letter-spacing:.055em;}
#view-main .home-u5f-plan-card .home-u5f-plan-name{font-size:23px;font-weight:750;color:#102c45;}
#view-main .home-u5f-plan-detail{padding-inline:12px;border-color:#b9d7ef;border-radius:10px;color:#005a9e;background:#fff;box-shadow:0 1px 2px rgba(0,90,158,.06);}
#view-main .home-u5f-plan-detail:hover{background:#eaf5fe;}
#view-main .home-u5f-stats-heading{color:#42708e;font-weight:750;}
#view-main .home-u5f-stats-grid{gap:9px;margin-top:8px;}
#view-main .home-u5f-stat{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:8px;min-height:60px;padding:10px 11px;border:1px solid #e0edf7;border-radius:11px;background:rgba(255,255,255,.88);}
#view-main .home-u5f-stat span:not(.home-v16-stat-icon){font-size:12px;font-weight:650;color:#526477;}
#view-main .home-u5f-stat strong{font-size:21px;font-weight:800;color:#005a9e;}
#view-main .home-v16-stat-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;color:#005a9e;background:#e7f4fd;}
#view-main .home-v16-stat-icon--template{color:#0f816b;background:#e4f5ef;}
#view-main .home-v16-stat-icon svg{display:block;width:17px;height:17px;}
#view-main .home-u5f-terms--compact{padding:0;border:1px solid #dde8f2;border-radius:13px;background:#fff;box-shadow:0 2px 9px rgba(22,68,109,.04);overflow:hidden;}
#view-main .home-u5f-terms--compact>summary{display:flex;align-items:center;justify-content:space-between;min-height:76px;gap:11px;padding:13px 15px;}
#view-main .home-u5f-terms--compact>summary::-webkit-details-marker{display:none;}
#view-main .home-u5f-terms--compact>summary .home-v16-accordion-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 auto;}
#view-main .home-v16-accordion-copy{display:grid;gap:2px;min-width:0;}
#view-main .home-v16-accordion-copy strong{font-size:14px;font-weight:750;line-height:1.36;color:#1e3d57;}
#view-main .home-v16-accordion-copy small{font-size:12px;line-height:1.35;color:#66798a;}
#view-main .home-v16-accordion-icon{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border-radius:12px;color:#006ca8;background:#e8f4fd;}
#view-main .home-v16-accordion-icon svg{display:block;width:21px;height:21px;}
#view-main .home-v16-accordion-icon--install{color:#7253b5;background:#f2edff;}
#view-main .home-v16-accordion-icon--contact{color:#168977;background:#e6f7f2;}
#view-main .home-u5f-terms--compact>summary .home-u5f-terms-toggle{margin-left:auto;flex:0 0 auto;background:#f4faff;border-color:#c8e1f2;border-radius:999px;min-width:46px;text-align:center;padding:6px 9px;font-size:12px;}
#view-main .home-u5f-terms--compact[open]{border-color:#c4ddec;}
#view-main .home-u5f-terms--compact[open]>summary{background:#f5faff;}
#view-main .home-u5f-terms--compact>summary:focus-visible{outline:2px solid #005a9e;outline-offset:-3px;}
@media(max-width:767px){
  /* Person was the only form with a second white padded shadow layer. */
  #view-persons-form #form-person{margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;width:100%;max-width:none;}
  #view-main .home-u5f-shell{gap:11px;}
  #view-main .home-v16-hero{padding:15px 14px;border-radius:13px;gap:8px;}
  #view-main .home-v16-hero h3{font-size:19px;line-height:1.27;}
  #view-main .home-v16-hero p{font-size:12px;line-height:1.43;margin-top:6px;}
  #view-main .home-v16-hero__eyebrow{font-size:10px;margin-bottom:5px;}
  #view-main .home-v16-hero__mark{flex-basis:60px;width:60px;height:60px;border-radius:17px;}
  #view-main .home-v16-hero__mark svg{width:47px;height:47px;}
  #view-main .home-u5f-plan-card{padding:13px 13px 14px;border-radius:12px;}
  #view-main .home-u5f-plan-card .home-u5f-plan-name{font-size:22px;}
  #view-main .home-v16-plan-icon{flex-basis:32px;width:32px;height:32px;}
  #view-main .home-u5f-stat{min-height:55px;grid-template-columns:26px minmax(0,1fr) auto;padding:8px;gap:5px;}
  #view-main .home-v16-stat-icon{width:26px;height:26px;border-radius:8px;}
  #view-main .home-v16-stat-icon svg{width:15px;height:15px;}
  #view-main .home-u5f-stat strong{font-size:19px;}
  #view-main .home-u5f-terms--compact>summary{min-height:71px;padding:11px 11px;gap:8px;}
  #view-main .home-u5f-terms--compact>summary .home-v16-accordion-main{gap:9px;}
  #view-main .home-v16-accordion-icon{flex-basis:36px;width:36px;height:36px;border-radius:10px;}
  #view-main .home-v16-accordion-icon svg{width:19px;height:19px;}
  #view-main .home-v16-accordion-copy strong{font-size:13px;}
  #view-main .home-v16-accordion-copy small{font-size:11px;}
}
@media(max-width:340px){
  #view-main .home-v16-hero__mark{flex-basis:48px;width:48px;height:48px;}
  #view-main .home-v16-hero__mark svg{width:39px;height:39px;}
  #view-main .home-v16-hero h3{font-size:17px;}
  #view-main .home-u5f-stat{grid-template-columns:22px minmax(0,1fr) auto;gap:4px;padding:7px 6px;}
  #view-main .home-v16-stat-icon{width:22px;height:22px;}
  #view-main .home-v16-accordion-icon{flex-basis:31px;width:31px;height:31px;}
  #view-main .home-u5f-terms--compact>summary .home-u5f-terms-toggle{min-width:42px;padding:6px 7px;}
}

/* ACCGEN v16.1: layered document artwork in the welcome hero only. */
#view-main .home-v16-hero__mark{background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(235,247,255,.79));border-color:rgba(119,180,224,.5);box-shadow:0 5px 14px rgba(0,90,158,.10),inset 0 1px 0 rgba(255,255,255,.85);}
#view-main .home-v16-hero__mark .home-v16-hero__stack{width:73px;height:73px;max-width:100%;max-height:100%;display:block;filter:drop-shadow(0 2px 2px rgba(32,103,157,.10));}
@media(max-width:767px){#view-main .home-v16-hero__mark .home-v16-hero__stack{width:56px;height:56px;}}
@media(max-width:340px){#view-main .home-v16-hero__mark .home-v16-hero__stack{width:43px;height:43px;}}

/* ACCGEN v17 – Settings notes and instant local loading feedback. */
#view-settings .settings-load-status{display:flex;align-items:center;justify-content:center;gap:10px;min-height:72px;margin:4px 0 14px;padding:15px;border:1px solid #d2e3f1;border-radius:10px;background:#f4f9fd;color:#185782;font-size:13px;font-weight:600;text-align:left;}
.settings-load-status__spinner{width:20px;height:20px;flex:none;border:2px solid #c7dff0;border-top-color:#005a9e;border-radius:50%;animation:accgen-settings-spin .85s linear infinite;}
@keyframes accgen-settings-spin{to{transform:rotate(360deg);}}
#form-user-settings .settings-guide{margin:0 0 14px;border:1px solid #d5e4ee;border-radius:11px;background:#fff;overflow:hidden;}
#form-user-settings .settings-guide>summary{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:48px;padding:10px 13px;list-style:none;cursor:pointer;color:#104e7c;text-align:left;font-size:14px;font-weight:700;}
#form-user-settings .settings-guide>summary::-webkit-details-marker{display:none;}
#form-user-settings .settings-guide>summary:focus-visible{outline:2px solid #4a9aca;outline-offset:-3px;border-radius:9px;}
#form-user-settings .settings-guide__heading{display:flex;align-items:center;gap:9px;min-width:0;}
#form-user-settings .settings-guide__icon{display:grid;place-items:center;width:26px;height:26px;flex:none;border-radius:8px;background:#e7f3fc;color:#005a9e;font-style:normal;font-family:Georgia,serif;font-weight:700;font-size:17px;}
#form-user-settings .settings-guide__toggle{display:inline-flex;justify-content:center;align-items:center;flex:none;min-width:69px;min-height:31px;padding:5px 10px;border:1px solid #cadeec;border-radius:999px;background:#f5faff;color:#005a9e;font-size:12px;font-weight:600;}
#form-user-settings .settings-guide__hide{display:none;}
#form-user-settings .settings-guide[open] .settings-guide__show{display:none;}
#form-user-settings .settings-guide[open] .settings-guide__hide{display:inline;}
#form-user-settings .settings-guide__body{padding:0 14px 14px;border-top:1px solid #e7eef5;text-align:left;color:#344054;font-size:13px;line-height:1.55;}
#form-user-settings .settings-guide__intro{margin:11px 0 9px;color:#57687a;}
#form-user-settings .settings-guide__items{margin:0;display:grid;gap:0;}
#form-user-settings .settings-guide__items>div{padding:10px 0;border-top:1px dashed #e2eaf1;min-width:0;}
#form-user-settings .settings-guide__items>div:first-child{border:0;}
#form-user-settings .settings-guide__items dt{margin:0 0 4px;color:#005a9e;font-weight:700;}
#form-user-settings .settings-guide__items dd{margin:0;overflow-wrap:anywhere;}
#form-user-settings .settings-guide__items em{font-style:normal;font-weight:600;color:#25364a;}
@media(max-width:700px){#view-settings.settings-subview .settings-load-status{margin:0 0 12px;}#form-user-settings .settings-guide{margin:0 0 13px;}}

/* ACCGEN v17.1: keep both settings edit actions on one mobile row. */
@media(max-width:700px){
  #view-settings.settings-subview #form-user-settings .form-actions{display:flex;flex-direction:row;align-items:stretch;gap:8px;}
  #view-settings.settings-subview #form-user-settings .form-actions #btn-settings-back{flex:0 0 35%;width:35%;}
  #view-settings.settings-subview #form-user-settings .form-actions #btn-settings-submit{flex:1 1 0;width:auto;}
  #view-settings.settings-subview #form-user-settings .form-actions .btn{min-width:0;white-space:normal;line-height:1.25;}
}

/* v18 - OCR recovery dialog: safe scrolling and controls at narrow/short viewports. */
body.accgen-ocr-recovery-open{overflow:hidden;}
#ocr-recovery-choice-modal.accgen-ocr-recovery{position:fixed;inset:0;z-index:12000;align-items:center;justify-content:center;box-sizing:border-box;padding:12px max(12px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:rgba(12,29,45,.56);overflow-y:auto;overscroll-behavior:contain;}
.accgen-ocr-recovery__panel{box-sizing:border-box;width:min(480px,100%);max-width:100%;max-height:calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:auto;padding:20px;border:1px solid #d7e4ee;border-radius:17px;background:#fff;box-shadow:0 18px 46px rgba(12,29,45,.26);}
.accgen-ocr-recovery__heading{display:flex;align-items:flex-start;gap:11px;margin-bottom:10px;}
.accgen-ocr-recovery__icon{flex:0 0 42px;display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:12px;color:#005a9e;background:#e9f5fe;}
.accgen-ocr-recovery__icon svg{width:25px;height:25px;}
.accgen-ocr-recovery__heading h3{margin:0;color:#123b59;font-size:17px;font-weight:750;line-height:1.35;overflow-wrap:anywhere;}
.accgen-ocr-recovery__description{margin:0 0 14px;color:#52667b;font-size:14px;line-height:1.5;}
.accgen-ocr-recovery__choices{display:grid;gap:9px;}
.accgen-ocr-recovery__choice{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;min-width:0;width:100%;min-height:70px;margin:0!important;padding:12px 14px;border:1px solid #cfdeeb;border-radius:11px;background:#f8fbfe;color:#163a57;text-align:left;white-space:normal;cursor:pointer;}
.accgen-ocr-recovery__choice--primary{border-color:#8ec1e6;background:#e9f5fe;color:#005a9e;}
.accgen-ocr-recovery__choice-label{font-size:14px;font-weight:700;line-height:1.35;overflow-wrap:anywhere;}
.accgen-ocr-recovery__choice-description{font-size:12px;font-weight:400;line-height:1.45;color:#556e82;overflow-wrap:anywhere;}
.accgen-ocr-recovery__footer{display:flex;justify-content:flex-end;padding-top:13px;}
.accgen-ocr-recovery__footer .btn{min-width:96px;min-height:44px;margin:0!important;border:1px solid #cbd5e1;border-radius:9px;background:#f3f6f9;color:#273d51;}
.accgen-ocr-recovery__choice:focus-visible,.accgen-ocr-recovery__footer .btn:focus-visible{outline:3px solid #8bc5ed;outline-offset:2px;}
@media(max-width:380px){.accgen-ocr-recovery__panel{padding:15px 14px;border-radius:14px;}.accgen-ocr-recovery__heading h3{font-size:16px;}.accgen-ocr-recovery__icon{width:36px;height:36px;flex-basis:36px;}}
@media(max-height:540px){#ocr-recovery-choice-modal.accgen-ocr-recovery{align-items:flex-start;}.accgen-ocr-recovery__panel{margin:0 auto;}}

/* v18.4 - field clear action visible only during focus; date fields use their calendar popup. */
.accgen-clear-field{position:relative;display:block;flex:1 1 auto;min-width:0;width:100%;max-width:100%;}
.accgen-clear-field>input:not([type="hidden"]),.accgen-clear-field>textarea{box-sizing:border-box;min-width:0;width:100%;max-width:100%;}
.accgen-clear-field:focus-within>input:not([type="hidden"]),.accgen-clear-field:focus-within>textarea{padding-right:48px!important;}
.accgen-clear-field>.accgen-clear-button{position:absolute;z-index:2;top:50%;right:4px;display:flex;align-items:center;justify-content:center;width:36px;height:36px;min-height:36px;padding:0;border:0;border-radius:9px;background:transparent;color:#496981;transform:translateY(-50%);cursor:pointer;touch-action:manipulation;}
.accgen-clear-field>.accgen-clear-button::before{content:"";position:absolute;inset:4px;border-radius:7px;background:#edf4fa;pointer-events:none;}
.accgen-clear-field>textarea+.accgen-clear-button{top:7px;right:8px;transform:none;}
.accgen-clear-field>.accgen-clear-button[hidden]{display:none!important;}
.accgen-clear-field>.accgen-clear-button svg{position:relative;z-index:1;width:12px;height:12px;stroke-width:2.3;pointer-events:none;}
.accgen-clear-field>.accgen-clear-button:hover{color:#005a9e;}
.accgen-clear-field>.accgen-clear-button:hover::before{background:#dcebf7;}
.accgen-clear-field>.accgen-clear-button:focus-visible{outline:2px solid #005a9e;outline-offset:1px;}
.accgen-clear-field--number:focus-within>input[type="number"]{padding-right:66px!important;}
.accgen-clear-field--number>.accgen-clear-button{right:29px;}
.accgen-clear-field input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none;}

#ocr-recovery-choice-modal.accgen-ocr-recovery:focus{outline:none;}
