.erm-portal,
.erm-login,
.erm-otp-gate,
.erm-registration-form-shell {
    --erm-font-family: inherit;
    --erm-font-size: 16px;
    --erm-line-height: 1.5;
    --erm-border: #d1d5db;
    --erm-muted: #6b7280;
    --erm-bg: #f9fafb;
    --erm-text: #111827;
    --erm-link: #1d4ed8;
    --erm-danger: #b91c1c;
    --erm-container-width: 1200px;
    --erm-portal-margin-y: 24px;
    --erm-heading-font-family: inherit;
    --erm-heading-size: 28px;
    --erm-heading-weight: 700;
    --erm-heading-line-height: 1.2;
    --erm-heading-color: #111827;
    --erm-subheading-size: 20px;
    --erm-subheading-weight: 700;
    --erm-card-bg: #ffffff;
    --erm-card-radius: 10px;
    --erm-card-padding: 22px;
    --erm-component-gap: 20px;
    --erm-card-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    --erm-stat-value-size: 28px;
    --erm-button-font-size: 16px;
    --erm-button-weight: 600;
    --erm-button-radius: 7px;
    --erm-button-padding-y: 10px;
    --erm-button-padding-x: 16px;
    --erm-button-primary-bg: #111827;
    --erm-button-primary-text: #ffffff;
    --erm-button-secondary-bg: #4b5563;
    --erm-button-text-transform: none;
    --erm-input-font-size: 16px;
    --erm-input-height: 44px;
    --erm-input-radius: 7px;
    --erm-input-border: #d1d5db;
    --erm-input-bg: #ffffff;
    --erm-input-text: #111827;
    --erm-input-focus: #2563eb;
    --erm-label-weight: 600;
    color: var(--erm-text);
    font-family: var(--erm-font-family);
    font-size: var(--erm-font-size);
    line-height: var(--erm-line-height);
}

.erm-portal {
    max-width: var(--erm-container-width);
    margin: var(--erm-portal-margin-y) auto;
}

.erm-login {
    max-width: min(460px, var(--erm-container-width));
    margin: var(--erm-portal-margin-y) auto;
}

.erm-portal a:not(.erm-button),
.erm-login a:not(.erm-button),
.erm-otp-gate a:not(.erm-button),
.erm-registration-form-shell a:not(.erm-button) {
    color: var(--erm-link);
}

.erm-header {
    display: flex;
    justify-content: space-between;
    gap: var(--erm-component-gap);
    align-items: flex-start;
    margin-bottom: var(--erm-component-gap);
}

.erm-header h2,
.erm-card h3,
.erm-otp-card h2 {
    margin-top: 0;
    color: var(--erm-heading-color);
    font-family: var(--erm-heading-font-family);
}

.erm-header h2,
.erm-otp-card h2 {
    font-size: var(--erm-heading-size);
    font-weight: var(--erm-heading-weight);
    line-height: var(--erm-heading-line-height);
}

.erm-card h3 {
    font-size: var(--erm-subheading-size);
    font-weight: var(--erm-subheading-weight);
}

.erm-card,
.erm-stat {
    background: var(--erm-card-bg);
    border: 1px solid var(--erm-border);
    border-radius: var(--erm-card-radius);
    box-shadow: var(--erm-card-shadow);
}

.erm-card {
    padding: var(--erm-card-padding);
    margin-bottom: var(--erm-component-gap);
}

.erm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--erm-component-gap);
}

.erm-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: max(8px, calc(var(--erm-component-gap) * .8));
    margin: 0 0 var(--erm-component-gap);
}

.erm-stat {
    padding: max(10px, calc(var(--erm-card-padding) * .82));
}

.erm-stat strong,
.erm-stat span {
    display: block;
}

.erm-stat strong {
    font-size: var(--erm-stat-value-size);
    line-height: 1.1;
}

.erm-stat span {
    color: var(--erm-muted);
    margin-top: 6px;
}

.erm-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--erm-border);
    border-radius: var(--erm-card-radius);
    background: var(--erm-card-bg);
}

.erm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.erm-table th,
.erm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.erm-table th {
    background: var(--erm-bg);
    font-size: calc(var(--erm-font-size) * .8125);
}

.erm-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    font-size: calc(var(--erm-font-size) * .75);
}

.erm-button {
    display: inline-block;
    border: 0;
    border-radius: var(--erm-button-radius);
    padding:
        var(--erm-button-padding-y)
        var(--erm-button-padding-x);
    background: var(--erm-button-primary-bg);
    color: var(--erm-button-primary-text) !important;
    cursor: pointer;
    font-family: var(--erm-font-family);
    font-size: var(--erm-button-font-size);
    font-weight: var(--erm-button-weight);
    line-height: 1.2;
    text-decoration: none !important;
    text-transform: var(--erm-button-text-transform);
}

.erm-button:hover {
    opacity: .9;
}

.erm-button-secondary {
    background: var(--erm-button-secondary-bg);
}

.erm-button-danger {
    background: var(--erm-danger);
}

.erm-button-small {
    padding:
        max(5px, calc(var(--erm-button-padding-y) * .7))
        max(8px, calc(var(--erm-button-padding-x) * .7));
    font-size: max(12px, calc(var(--erm-button-font-size) * .82));
}

.erm-actions,
.erm-inline,
.erm-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.erm-actions {
    margin: 16px 0;
}

.erm-filters {
    margin-bottom: 18px;
}

.erm-portal input[type="text"],
.erm-portal input[type="search"],
.erm-portal input[type="email"],
.erm-portal input[type="password"],
.erm-portal select,
.erm-portal textarea,
.erm-login input[type="text"],
.erm-login input[type="password"] {
    width: 100%;
    max-width: 100%;
    min-height: var(--erm-input-height);
    padding: 10px 12px;
    border: 1px solid var(--erm-input-border);
    border-radius: var(--erm-input-radius);
    background: var(--erm-input-bg);
    color: var(--erm-input-text);
    font-family: var(--erm-font-family);
    font-size: var(--erm-input-font-size);
}

.erm-portal input:focus,
.erm-portal select:focus,
.erm-portal textarea:focus,
.erm-login input:focus,
.erm-otp-gate input:focus,
.erm-otp-gate select:focus,
.erm-otp-gate textarea:focus {
    border-color: var(--erm-input-focus);
    box-shadow: 0 0 0 1px var(--erm-input-focus);
    outline: none;
}

.erm-inline input {
    flex: 1 1 300px;
}

.erm-login input[type="submit"] {
    border: 0;
    border-radius: var(--erm-button-radius);
    padding:
        var(--erm-button-padding-y)
        var(--erm-button-padding-x);
    background: var(--erm-button-primary-bg);
    color: var(--erm-button-primary-text);
    cursor: pointer;
    font-family: var(--erm-font-family);
    font-size: var(--erm-button-font-size);
    font-weight: var(--erm-button-weight);
    text-transform: var(--erm-button-text-transform);
}


.erm-card label {
    display: block;
    font-weight: var(--erm-label-weight);
    margin: 12px 0 6px;
}

.erm-details {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr);
    gap: 8px 16px;
    margin: 0;
}

.erm-details dt {
    color: var(--erm-muted);
}

.erm-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.erm-notice {
    padding: 12px 14px;
    border-radius: 7px;
    margin: 12px 0;
    border: 1px solid transparent;
}

.erm-notice-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.erm-notice-error {
    background: #fef2f2;
    border-color: #fecaca;
}

.erm-notice-info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.erm-rpc-reader {
    width: 100%;
    max-width: 620px;
    min-height: 260px;
    margin: 12px 0;
    overflow: hidden;
    border-radius: 10px;
    background: #111827;
}

.erm-rpc-reader video,
.erm-rpc-reader canvas {
    max-width: 100%;
}


.erm-rpc-result-valid {
    border-left: 5px solid #059669;
}

.erm-rpc-result-warning {
    border-left: 5px solid #d97706;
}

.erm-rpc-result-error {
    border-left: 5px solid #dc2626;
}

/* Racepack Collection: a focused scan workspace that keeps the live camera
 * and participant decision side by side on desktop, then stacks on mobile. */
.erm-rpc-portal {
    max-width: 1160px;
    padding: 24px;
    border: 1px solid #dbe3ef;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 36%),
        #f5f7fb;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .12);
}

.erm-rpc-portal > .erm-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dbe3ef;
}

.erm-rpc-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr);
    gap: 20px;
    align-items: stretch;
}

.erm-rpc-scan-panel,
.erm-rpc-side-panel {
    min-width: 0;
}

.erm-rpc-scan-panel {
    padding: 20px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #dbe3ef;
}

.erm-rpc-panel-heading {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.erm-rpc-kicker {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.erm-rpc-panel-heading h3 {
    margin: 4px 0 0;
    color: #172033;
    font-size: 18px;
    line-height: 1.3;
}

.erm-rpc-camera-state {
    flex: 0 1 190px;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
}

.erm-rpc-camera-state::before {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.erm-rpc-camera-state:empty {
    display: none;
}

.erm-rpc-reader {
    display: flex;
    width: 100%;
    max-width: none;
    min-height: 390px;
    margin: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 42%, rgba(37, 99, 235, .28), transparent 42%),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, .025) 32px),
        #111827;
}

.erm-rpc-reader:empty::before {
    width: min(46vw, 200px);
    height: min(46vw, 200px);
    border: 3px solid #fff;
    border-radius: 24px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .10);
    content: '';
}

.erm-rpc-reader video,
.erm-rpc-reader canvas {
    width: 100% !important;
    max-width: 100%;
    border-radius: 16px;
}

.erm-rpc-scan-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.erm-rpc-scan-actions .erm-button {
    min-height: 44px;
}

.erm-rpc-upload {
    display: inline-flex;
    min-height: 44px;
    padding: 10px 14px;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: var(--erm-button-radius);
    color: #334155;
    cursor: pointer;
    font-size: var(--erm-button-font-size);
    font-weight: var(--erm-button-weight);
}

.erm-rpc-upload:hover {
    background: #f1f5f9;
}

#erm-rpc-image {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.erm-rpc-side-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.erm-rpc-context,
.erm-rpc-result .erm-card {
    margin: 0;
    border-radius: 18px;
    border-color: #dbe3ef;
}

.erm-rpc-context {
    padding: 17px 18px 15px;
    background: #eaf1ff;
}

.erm-rpc-context > p:not(.erm-help):not(.erm-rpc-event-list) {
    margin: 7px 0 11px;
}

.erm-rpc-context label {
    margin: 0 0 6px;
}

.erm-rpc-context input {
    min-height: 46px;
}

.erm-rpc-context .erm-help {
    margin: 7px 0 0;
}

.erm-rpc-event-list {
    margin: 13px 0 0;
    padding-top: 11px;
    border-top: 1px solid rgba(37, 99, 235, .18);
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.erm-rpc-result {
    flex: 1 1 auto;
}

.erm-rpc-result .erm-card {
    height: 100%;
    min-height: 280px;
    padding: 20px;
}

.erm-rpc-result .erm-card h3 {
    margin: 5px 0 16px;
}

.erm-rpc-result .erm-details {
    grid-template-columns: minmax(115px, .9fr) minmax(0, 1.3fr);
    gap: 10px 14px;
}

.erm-rpc-result .erm-details dt {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.erm-rpc-result .erm-details dd {
    color: #172033;
    font-weight: 600;
}

.erm-rpc-result .erm-button {
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    background: #198765;
}

.erm-rpc-result .erm-button-secondary {
    background: #475569;
}

.erm-rpc-result-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.erm-rpc-result-empty p {
    max-width: 31ch;
    color: #64748b;
}

.erm-help {
    color: var(--erm-muted);
    font-size: 13px;
}

@media (max-width: 800px) {
    .erm-grid,
    .erm-stats {
        grid-template-columns: 1fr;
    }

    .erm-header {
        display: block;
    }

    .erm-details {
        grid-template-columns: 1fr;
    }

    .erm-rpc-portal {
        margin: 12px 0;
        padding: 14px;
        border-radius: 16px;
    }

    .erm-rpc-portal > .erm-header {
        display: flex;
        gap: 12px;
        align-items: flex-end;
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .erm-rpc-portal > .erm-header > div:last-child {
        margin-left: auto;
        text-align: right;
        white-space: nowrap;
    }

    .erm-rpc-workspace {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .erm-rpc-scan-panel {
        padding: 14px;
        border-radius: 15px;
    }

    .erm-rpc-panel-heading {
        display: block;
        margin-bottom: 12px;
    }

    .erm-rpc-camera-state {
        display: block;
        margin-top: 8px;
        text-align: left;
    }

    .erm-rpc-reader {
        min-height: 260px;
        border-radius: 14px;
    }

    .erm-rpc-reader:empty::before {
        width: 142px;
        height: 142px;
        border-radius: 18px;
    }

    .erm-rpc-scan-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .erm-rpc-scan-actions .erm-button,
    .erm-rpc-upload {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .erm-rpc-side-panel {
        gap: 14px;
    }

    .erm-rpc-result .erm-card {
        min-height: 0;
        padding: 17px;
    }

    .erm-rpc-result .erm-details {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .erm-rpc-result .erm-details dd {
        margin-bottom: 9px;
    }
}


.erm-public-participants {
    max-width: 100%;
    margin-top: 14px;
    color: var(--erm-public-text-color);
    font-family: var(--erm-public-font-family);
}

.erm-public-participants .erm-header {
    margin-bottom: 12px;
    color: var(--erm-text);
    font-family: var(--erm-font-family);
}

.erm-public-participants .erm-header h2 {
    margin-bottom: 2px;
}

.erm-public-participants .erm-header p {
    margin: 0;
}

.erm-public-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    color: var(--erm-text);
    font-family: var(--erm-font-family);
}

.erm-public-stats .erm-stat {
    padding: max(8px, calc(var(--erm-card-padding) * .5));
    border-radius: min(var(--erm-card-radius), 12px);
}

.erm-public-stats .erm-stat strong {
    font-size: max(18px, calc(var(--erm-stat-value-size) * .72));
}

.erm-public-stats .erm-stat span {
    margin-top: 2px;
    font-size: 12px;
}

.erm-public-search {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 12px;
    color: var(--erm-text);
    font-family: var(--erm-font-family);
}

.erm-public-search input[type="search"] {
    flex: 1 1 320px;
    width: auto;
    min-width: 220px;
}

.erm-public-search .erm-button {
    flex: 0 0 auto;
}

.erm-public-search.erm-live-search-enabled .erm-public-search-submit {
    display: none;
}

.erm-public-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--erm-public-border-color);
    border-radius: var(--erm-public-radius);
    background: var(--erm-public-row-bg);
    -webkit-overflow-scrolling: touch;
}

.erm-public-width-full .erm-public-table-wrap {
    display: block;
    width: 100%;
}

.erm-public-width-full .erm-public-table {
    width: 100%;
}

.erm-public-width-auto .erm-public-table-wrap {
    display: inline-block;
    width: auto;
    vertical-align: top;
}

.erm-public-width-auto .erm-public-table {
    width: max-content;
    max-width: none;
}

.erm-public-table {
    min-width: 0;
    max-width: none;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    color: var(--erm-public-text-color);
    font-family: var(--erm-public-font-family);
    font-size: var(--erm-public-font-size);
    font-weight: var(--erm-public-font-weight);
    line-height: 1.35;
}

.erm-public-table th,
.erm-public-table td {
    width: auto;
    padding: var(--erm-public-padding-y) var(--erm-public-padding-x);
    border: 0;
    text-align: var(--erm-public-text-align);
    vertical-align: middle;
    background: var(--erm-public-row-bg);
}

.erm-public-table th {
    position: relative;
    z-index: 1;
    color: var(--erm-public-header-color);
    background: var(--erm-public-header-bg);
    font-size: var(--erm-public-header-font-size);
    font-weight: var(--erm-public-header-font-weight);
    letter-spacing: .01em;
    text-align: var(--erm-public-header-align);
    text-transform: none;
}

.erm-public-sticky-header .erm-public-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.erm-public-border-horizontal .erm-public-table tbody td {
    border-bottom: 1px solid var(--erm-public-border-color);
}

.erm-public-border-horizontal .erm-public-table tbody tr:last-child td {
    border-bottom: 0;
}

.erm-public-border-all .erm-public-table th,
.erm-public-border-all .erm-public-table td {
    border-right: 1px solid var(--erm-public-border-color);
    border-bottom: 1px solid var(--erm-public-border-color);
}

.erm-public-border-all .erm-public-table th:last-child,
.erm-public-border-all .erm-public-table td:last-child {
    border-right: 0;
}

.erm-public-border-all .erm-public-table tbody tr:last-child td {
    border-bottom: 0;
}

.erm-public-border-none .erm-public-table th,
.erm-public-border-none .erm-public-table td {
    border: 0;
}

.erm-public-zebra .erm-public-table tbody tr:nth-child(even) td {
    background: var(--erm-public-alt-row-bg);
}

.erm-public-hover .erm-public-table tbody tr:hover td {
    background: var(--erm-public-hover-bg);
}

.erm-public-table .erm-align-left {
    text-align: left;
}

.erm-public-table .erm-align-center {
    text-align: center;
}

.erm-public-table .erm-align-right {
    text-align: right;
}

.erm-public-table .erm-align-justify {
    text-align: justify;
}

.erm-public-table .erm-column-nowrap {
    white-space: nowrap;
}

.erm-public-table .erm-column-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
}

.erm-status-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.erm-status-success {
    color: #047857;
    background: #d1fae5;
}

.erm-status-waiting {
    color: #a16207;
    background: #fef3c7;
}

.erm-status-danger {
    color: #b91c1c;
    background: #fee2e2;
}

.erm-table-result-summary {
    margin: 10px 0 0;
    color: var(--erm-muted, #6b7280);
    font-family: var(--erm-public-font-family, inherit);
    font-size: 13px;
    line-height: 1.4;
}

.erm-table-result-summary + .erm-pagination {
    margin-top: 6px;
}

.erm-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.erm-pagination-compact {
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
}

.erm-pagination-button,
.erm-pagination-current {
    display: inline-flex;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--erm-public-border-color);
    border-radius: 5px;
    background: var(--erm-public-row-bg);
    color: var(--erm-public-text-color) !important;
    font-family: var(--erm-public-font-family);
    font-size: 13px;
    line-height: 1;
    text-decoration: none !important;
}

.erm-pagination-button:hover {
    background: var(--erm-public-hover-bg);
}

.erm-pagination-current {
    min-width: 58px;
    color: var(--erm-muted) !important;
}

.erm-public-participants .erm-help {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 11px;
}

.erm-status-icon .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .erm-public-participants {
        margin: 12px 0;
    }

    .erm-public-participants .erm-header h2 {
        font-size: 1.3rem;
    }

    .erm-public-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .erm-public-stats .erm-stat {
        padding: 8px;
    }

    .erm-public-stats .erm-stat strong {
        font-size: 18px;
    }

    .erm-public-table {
        font-size: var(--erm-public-mobile-font-size);
    }

    .erm-public-table th,
    .erm-public-table td {
        padding: var(--erm-public-mobile-padding-y) var(--erm-public-mobile-padding-x);
    }

    .erm-public-table .erm-column-mobile-hidden {
        display: none;
    }

    .erm-public-mobile-scroll .erm-public-table-wrap {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    .erm-public-mobile-scroll .erm-public-table {
        width: max-content;
        min-width: 100%;
    }

    .erm-public-table-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .erm-public-table {
        display: table;
        width: max-content;
        min-width: 100%;
        table-layout: auto;
    }

    .erm-public-table thead {
        display: table-header-group;
    }

    .erm-public-table tbody {
        display: table-row-group;
    }

    .erm-public-table tr {
        display: table-row;
    }

    .erm-public-table th,
    .erm-public-table td {
        display: table-cell;
        width: auto;
        min-width: max-content;
        white-space: nowrap;
    }

    .erm-public-table .erm-column-wrap {
        white-space: normal;
        min-width: 140px;
    }

    .erm-pagination-compact {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .erm-public-stats {
        grid-template-columns: 1fr;
    }
}


/* Email OTP registration gate */
.erm-otp-gate {
    width: 100%;
    max-width: min(100%, var(--erm-otp-max-width, 760px));
    margin: var(--erm-portal-margin-y) auto;
}

.erm-registration-form-shell {
    width: 100%;
    max-width: var(--erm-container-width);
    margin: var(--erm-portal-margin-y) auto;
}

.erm-otp-card {
    padding: var(--erm-otp-card-padding, var(--erm-card-padding));
    border:
        var(--erm-otp-card-border-width, 1px)
        solid
        var(--erm-otp-card-border, var(--erm-border));
    border-radius: var(--erm-otp-card-radius, var(--erm-card-radius));
    background: var(--erm-otp-card-bg, var(--erm-card-bg));
    box-shadow: var(--erm-otp-card-shadow, var(--erm-card-shadow));
}

.erm-otp-card h2 {
    margin: 0 0 8px;
    color: var(--erm-otp-title-color, var(--erm-heading-color));
    font-size: var(--erm-otp-title-size, var(--erm-heading-size));
    font-weight: var(--erm-otp-title-weight, var(--erm-heading-weight));
}

.erm-otp-card > p {
    margin: 0 0 18px;
    color: var(--erm-otp-description-color, var(--erm-muted));
    font-size: var(--erm-otp-description-size, var(--erm-font-size));
}

.erm-otp-request-form,
.erm-otp-verify-form {
    display: grid;
    gap: 14px;
}

.erm-otp-request-form label,
.erm-otp-verify-form label {
    display: grid;
    gap: 6px;
    color: var(--erm-otp-label-color, var(--erm-text));
    font-weight: var(--erm-otp-label-weight, var(--erm-label-weight));
}

.erm-otp-request-form input,
.erm-otp-verify-form input {
    width: 100%;
    min-height: var(--erm-otp-input-height, var(--erm-input-height));
    padding: 9px 12px;
    border: 1px solid var(--erm-otp-input-border, var(--erm-input-border));
    border-radius: var(--erm-otp-input-radius, var(--erm-input-radius));
    background: var(--erm-otp-input-bg, var(--erm-input-bg));
    color: var(--erm-otp-input-text, var(--erm-input-text));
    font-family: var(--erm-font-family);
    font-size: var(--erm-input-font-size);
}

.erm-otp-request-form input:focus,
.erm-otp-verify-form input:focus {
    border-color: var(--erm-otp-input-focus, var(--erm-input-focus));
    box-shadow:
        0 0 0 1px
        var(--erm-otp-input-focus, var(--erm-input-focus));
    outline: none;
}

.erm-otp-verify-form input[name="code"] {
    max-width: 240px;
    font-size: var(--erm-otp-code-size, 22px);
    font-weight: 700;
    letter-spacing: var(--erm-otp-code-letter-spacing, 8px);
    text-align: center;
}

.erm-otp-button {
    width: fit-content;
    min-height: var(--erm-otp-input-height, var(--erm-input-height));
    padding:
        var(--erm-button-padding-y)
        var(--erm-button-padding-x);
    border: 0;
    border-radius: var(--erm-otp-button-radius, var(--erm-button-radius));
    background: var(--erm-otp-button-bg, var(--erm-button-primary-bg));
    color: var(--erm-otp-button-text, var(--erm-button-primary-text));
    font-family: var(--erm-font-family);
    font-size: var(--erm-button-font-size);
    font-weight: var(--erm-button-weight);
    text-transform: var(--erm-button-text-transform);
    cursor: pointer;
}

.erm-otp-button:hover:not(:disabled) {
    background:
        var(--erm-otp-button-hover-bg, var(--erm-button-primary-bg));
}

.erm-otp-button:disabled,
.erm-otp-link-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.erm-otp-link-button {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--erm-otp-link-color, var(--erm-link));
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.erm-otp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
}

.erm-otp-message {
    display: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: var(--erm-otp-message-radius, 7px);
}

.erm-otp-message:not(:empty) {
    display: block;
}

.erm-otp-message.is-success {
    color: var(--erm-otp-success-text, #065f46);
    background: var(--erm-otp-success-bg, #d1fae5);
}

.erm-otp-message.is-error {
    color: var(--erm-otp-error-text, #991b1b);
    background: var(--erm-otp-error-bg, #fee2e2);
}

.erm-otp-honeypot {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.erm-otp-verified-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--erm-otp-verified-border, #a7f3d0);
    border-radius: var(--erm-otp-verified-radius, var(--erm-card-radius));
    background: var(--erm-otp-verified-bg, #ecfdf5);
    color: var(--erm-otp-verified-text, #065f46);
}

.erm-otp-verified-bar div {
    display: grid;
    gap: 2px;
}

.erm-otp-registration-form input[readonly] {
    cursor: not-allowed;
    background: #f3f4f6;
}

@media (max-width: 600px) {
    .erm-otp-card {
        padding: min(
            var(--erm-otp-card-padding, var(--erm-card-padding)),
            18px
        );
    }

    .erm-otp-button {
        width: 100%;
    }

    .erm-otp-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .erm-otp-verified-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Direct Midtrans payment after Fluent Forms submission */
.erm-direct-payment-message,
.erm-direct-payment-error,
.erm-direct-payment-runtime {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--erm-input-border, #cbd5e1);
    border-radius: var(--erm-card-radius, 8px);
    background: var(--erm-bg, #f8fafc);
    color: var(--erm-text, #0f172a);
    font-family: var(--erm-font-family, inherit);
    font-size: var(--erm-font-size, inherit);
}

.erm-direct-payment-runtime.is-success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.erm-direct-payment-runtime.is-error,
.erm-direct-payment-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.erm-direct-payment-message a,
.erm-direct-payment-runtime a {
    font-weight: 700;
}


/* Analon appearance bridge for Fluent Forms rendered inside the registration gate. */
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form {
    color: var(--erm-text);
    font-family: var(--erm-font-family);
    font-size: var(--erm-font-size);
    line-height: var(--erm-line-height);
}

:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form label {
    color: var(--erm-text);
    font-weight: var(--erm-label-weight);
}

:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form select,
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form textarea {
    min-height: var(--erm-input-height);
    border-color: var(--erm-input-border);
    border-radius: var(--erm-input-radius);
    background: var(--erm-input-bg);
    color: var(--erm-input-text);
    font-family: var(--erm-font-family);
    font-size: var(--erm-input-font-size);
}

:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form input:focus,
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form select:focus,
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form textarea:focus {
    border-color: var(--erm-input-focus);
    box-shadow: 0 0 0 1px var(--erm-input-focus);
    outline: none;
}

:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form button[type="submit"],
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form input[type="submit"] {
    border-radius: var(--erm-button-radius);
    padding:
        var(--erm-button-padding-y)
        var(--erm-button-padding-x);
    background: var(--erm-button-primary-bg);
    color: var(--erm-button-primary-text);
    font-family: var(--erm-font-family);
    font-size: var(--erm-button-font-size);
    font-weight: var(--erm-button-weight);
    text-transform: var(--erm-button-text-transform);
}

:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form .ff-el-help-message,
:is(.erm-otp-gate, .erm-registration-form-shell) .frm-fluent-form .text-muted {
    color: var(--erm-muted);
}


@media (max-width: 720px) {
    .erm-public-search {
        align-items: stretch;
    }

    .erm-public-search input[type="search"] {
        min-width: 0;
    }
}

/*
 * Table views must not render visual container frames.
 * Keep table headers, row separators, zebra/hover states, and responsive overflow intact.
 */
.erm-portal.erm-clear-table-surface,
.erm-table-design-scope {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.erm-table-design-scope {
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.erm-clear-table-surface .erm-table-wrap,
.erm-table-design-scope .erm-table-wrap {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.erm-clear-table-surface .erm-table,
.erm-table-design-scope .erm-table {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
