:root {
    --advapafo-ink: #1d2327;
    --advapafo-ink-soft: #34404a;
    --advapafo-accent: #7e5bef;
    --advapafo-accent-dark: #6344d8;
    --advapafo-accent-deep: #4f33ba;
    --advapafo-bg: #f4f6f8;
    --advapafo-card: #ffffff;
    --advapafo-border: #dce2e8;
    --advapafo-border-strong: #c7d0da;
    --advapafo-muted: #667085;
    --advapafo-muted-bg: #f8fafc;
    --advapafo-success: #15803d;
    --advapafo-success-bg: #e8f7ee;
    --advapafo-radius: 14px;
    --advapafo-shadow: 0 18px 45px rgba(29, 35, 39, 0.08);
    --advapafo-shadow-soft: 0 8px 24px rgba(29, 35, 39, 0.06);
}

.advapafo-admin-wrap {
    margin: 20px 20px 0 0;
    color: var(--advapafo-ink);
}

#footer-upgrade .advapafo-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #646970;
    text-decoration: none;
    text-underline-offset: 2px;
}
#footer-left {
    color: #646970;
}
#footer-left .advapafo-footer-link {
    color: #646970;
    text-decoration: none;
}
#footer-left .advapafo-footer-link:hover,
#footer-left .advapafo-footer-link:focus {
    color: #3858e9;
    text-decoration: underline;
}

#footer-left .advapafo-rating-stars {
    color: #fbbf24;
}

#footer-upgrade .advapafo-footer-link__icon {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 14px;
}

#footer-upgrade .advapafo-footer-link:hover,
#footer-upgrade .advapafo-footer-link:focus {
    color: #3858e9;
    text-decoration: underline;
}

#footer-upgrade .advapafo-footer-link__icon--svg svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Hard-block: any notice injected inside the hero or shell by WP core or
   third-party plugins is invisible. Our notices live in .advapafo-notices-wrap
   which sits BEFORE .advapafo-premium-shell in the DOM. */
.advapafo-premium-shell .notice,
.advapafo-premium-shell .updated,
.advapafo-premium-shell .error,
.advapafo-premium-shell [class*="notice-"] {
    display: none !important;
}

.advapafo-premium-shell {
    max-width: 1280px;
}

.advapafo-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 150px;
    padding: 30px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(126, 91, 239, 0.42), transparent 36%),
        linear-gradient(135deg, var(--advapafo-ink), #111820 72%);
    border-radius: 18px;
    box-shadow: var(--advapafo-shadow);
    overflow: hidden;
}

.advapafo-product-mark {
    display: flex;
    align-items: center;
    gap: 16px;
}

.advapafo-product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 30px;
    line-height: 1;
    color: #fff;
}

.advapafo-hero h1,
.advapafo-section-header h2,
.advapafo-card h3,
.advapafo-side-card h2,
.advapafo-shortcode-card h3 {
    margin: 0;
    color: inherit;
    line-height: 1.2;
}

.advapafo-hero h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0;
}

.advapafo-eyebrow {
    margin: 0 0 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: currentColor;
    opacity: 0.72;
}

.advapafo-hero__copy {
    max-width: 560px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
}

.advapafo-hero__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.advapafo-status-pill,
.advapafo-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.advapafo-status-pill {
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.advapafo-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38d87b;
    box-shadow: 0 0 0 4px rgba(56, 216, 123, 0.14);
}

/* Settings notices — rendered above the hero */
.advapafo-notices-wrap {
    margin-bottom: 16px;
}

.advapafo-debug-banner {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #e8b949;
    border-left: 4px solid #e8b949;
    border-radius: 8px;
    background: #fff9e8;
    color: #1d2327;
    box-shadow: var(--advapafo-shadow-soft);
}

.advapafo-debug-banner strong {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.advapafo-debug-banner pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.45;
    color: #1d2327;
}

.advapafo-flash {
    margin: 0;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #4b5563;
    background: #fff;
    color: #1d2327;
    box-shadow: var(--advapafo-shadow-soft);
}

.advapafo-flash + .advapafo-flash {
    margin-top: 10px;
}

.advapafo-flash p {
    margin: 0;
    color: #1d2327;
    font-size: 13.5px;
}

.advapafo-flash--success {
    border-left-color: #0f9f4b;
    background: #eefbf3;
}

.advapafo-flash--error {
    border-left-color: #d63638;
    background: #fff0f1;
}

.advapafo-flash--warning {
    border-left-color: #dba617;
    background: #fff9e8;
}

.advapafo-flash--info {
    border-left-color: #2271b1;
    background: #eef6fc;
}

.advapafo-tabs {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding: 8px;
    background: var(--advapafo-card);
    border: 1px solid var(--advapafo-border);
    border-radius: 16px;
    box-shadow: var(--advapafo-shadow-soft);
    overflow-x: auto;
}

.advapafo-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 11px;
    color: var(--advapafo-muted);
    font-weight: 700;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.advapafo-tab:hover,
.advapafo-tab:focus {
    color: var(--advapafo-ink);
    background: var(--advapafo-muted-bg);
    outline: none;
    box-shadow: none;
}

.advapafo-tab.is-active {
    color: #fff;
    background: var(--advapafo-ink);
    box-shadow: 0 8px 18px rgba(29, 35, 39, 0.16);
}

.advapafo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

.advapafo-main-panel,
.advapafo-side-card,
.advapafo-card,
.advapafo-shortcode-card {
    background: var(--advapafo-card);
    border: 1px solid var(--advapafo-border);
    border-radius: var(--advapafo-radius);
    box-shadow: var(--advapafo-shadow-soft);
}

.advapafo-main-panel {
    overflow: hidden;
}

.advapafo-section-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 26px 28px;
    border-bottom: 1px solid var(--advapafo-border);
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.advapafo-section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.advapafo-section-header .advapafo-eyebrow {
    color: var(--advapafo-accent);
    opacity: 1;
}

.advapafo-shortcode-tab-note {
    margin: 10px 0 0;
    max-width: 780px;
    color: var(--advapafo-muted);
    font-size: 13px;
    line-height: 1.5;
}

.advapafo-settings-form .advapafo-card,
.advapafo-shortcode-grid {
    margin: 22px 28px;
}

.advapafo-card {
    padding: 22px;
}

.advapafo-card--setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.advapafo-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.advapafo-setting-copy h2,
.advapafo-setting-copy h3,
.advapafo-setting-copy h4,
.advapafo-setting-copy h5,
.advapafo-setting-copy h6 {
    margin: 0;
    line-height: 1.3;
}

.advapafo-setting-copy h3,
.advapafo-setting-copy h4,
.advapafo-card h3,
.advapafo-side-card h2,
.advapafo-shortcode-card h3 {
    font-size: 16px;
    font-weight: 700;
}

.advapafo-setting-copy p,
.advapafo-card__header p,
.advapafo-field p,
.advapafo-side-card p,
.advapafo-shortcode-card p,
.advapafo-form-footer p {
    margin: 7px 0 0;
    color: var(--advapafo-muted);
    font-size: 13px;
    line-height: 1.55;
}

.advapafo-switch {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.advapafo-switch > input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    appearance: none;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    pointer-events: none;
}

.advapafo-switch__track {
    position: relative;
    display: inline-flex;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: #cbd5df;
    transition: background 160ms ease;
}

.advapafo-switch__thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(29, 35, 39, 0.22);
    transition: transform 160ms ease;
}

.advapafo-switch input:checked + .advapafo-switch__track {
    background: var(--advapafo-accent);
}

.advapafo-switch input:checked + .advapafo-switch__track .advapafo-switch__thumb {
    transform: translateX(24px);
}

.advapafo-card--setting-disabled {
    opacity: 0.68;
}

.advapafo-card--setting-disabled .advapafo-switch {
    cursor: not-allowed;
}

.advapafo-card--setting-disabled .advapafo-switch > input[type="checkbox"] {
    display: none !important;
}

.advapafo-card--setting-disabled .advapafo-switch input:disabled + .advapafo-switch__track {
    background: #d8dee6;
}

.advapafo-card--setting-disabled .advapafo-switch input:disabled + .advapafo-switch__track .advapafo-switch__thumb {
    box-shadow: none;
}

.advapafo-role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.advapafo-role-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--advapafo-border);
    border-radius: 12px;
    background: var(--advapafo-muted-bg);
    font-weight: 650;
    cursor: pointer;
}

.advapafo-role-chip input {
    accent-color: var(--advapafo-accent);
}

.advapafo-grid-2,
.advapafo-grid-3 {
    display: grid;
    gap: 18px;
}

.advapafo-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.advapafo-integration-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.advapafo-integration-setting-card {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--advapafo-border);
    border-radius: 12px;
    background: var(--advapafo-muted-bg);
}

.advapafo-integration-setting-card.is-missing {
    opacity: 0.72;
}

.advapafo-integration-setting-card header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.advapafo-integration-setting-card h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--advapafo-ink);
}

.advapafo-integration-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--advapafo-border);
    color: var(--advapafo-muted);
    background: #fff;
}

.advapafo-integration-status.is-active {
    color: var(--advapafo-success);
    border-color: rgba(21, 128, 61, 0.22);
    background: var(--advapafo-success-bg);
}

.advapafo-integration-status.is-missing {
    color: #9ca3af;
    border-color: #d1d5db;
    background: #f3f4f6;
}

.advapafo-integration-toggle-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--advapafo-border);
}

.advapafo-integration-toggle-row label {
    margin: 0;
    color: var(--advapafo-ink-soft);
    font-size: 12px;
    font-weight: 650;
}

.advapafo-integration-toggle-row .advapafo-switch {
    position: relative;
    width: 54px;
    height: 30px;
}

.advapafo-integration-toggle-row .advapafo-switch > input[type="checkbox"] {
    position: absolute !important;
    inset: 0 !important;
    width: 54px !important;
    height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    pointer-events: none !important;
}

.advapafo-field label,
.advapafo-label-row label {
    display: block;
    margin-bottom: 8px;
    color: var(--advapafo-ink);
    font-size: 13px;
    font-weight: 750;
}

.advapafo-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.advapafo-label-row label {
    margin-bottom: 0;
}

.advapafo-field input[type="text"],
.advapafo-field input[type="number"],
.advapafo-field select {
    width: 100%;
    max-width: none;
    min-height: 42px;
    border-radius: 10px;
    border-color: var(--advapafo-border-strong);
    color: var(--advapafo-ink);
    background-color: #fff;
}

.advapafo-field input:focus,
.advapafo-field select:focus {
    border-color: var(--advapafo-accent);
    box-shadow: 0 0 0 3px rgba(126, 91, 239, 0.14);
    outline: none;
}

.advapafo-badge {
    padding: 7px 9px;
    color: var(--advapafo-muted);
    background: var(--advapafo-muted-bg);
    border: 1px solid var(--advapafo-border);
}

.advapafo-badge--accent {
    color: var(--advapafo-accent-dark);
    background: rgba(126, 91, 239, 0.1);
    border-color: rgba(126, 91, 239, 0.22);
}

.advapafo-badge--success {
    color: var(--advapafo-success);
    background: var(--advapafo-success-bg);
    border-color: rgba(21, 128, 61, 0.16);
}

.advapafo-badge--managed-code {
    color: #73510b;
    background: #fff7d6;
    border-color: #f4d469;
    margin-left: 8px;
}

.advapafo-field input[readonly],
.advapafo-field select:disabled {
    color: var(--advapafo-muted);
    background-color: var(--advapafo-muted-bg);
    cursor: not-allowed;
}

.advapafo-button,
.wp-core-ui .advapafo-save-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 42px !important;
    padding: 0 16px !important;
    border-radius: 10px !important;
    border: 0 !important;
    font-weight: 750 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.advapafo-button:hover,
.wp-core-ui .advapafo-save-button:hover {
    transform: translateY(-1px);
}

.wp-core-ui .advapafo-save-button {
    background: var(--advapafo-ink) !important;
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(29, 35, 39, 0.18) !important;
}

.advapafo-button--ghost {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.advapafo-button--accent {
    display: block;
    width: 100%;
    box-sizing: border-box;
    color: #fff !important;
    background: var(--advapafo-accent);
    box-shadow: 0 12px 24px rgba(126, 91, 239, 0.28);
    text-align: center;
}

.advapafo-button--accent:hover,
.advapafo-button--accent:focus {
    color: #fff !important;
    background: var(--advapafo-accent-deep);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(126, 91, 239, 0.38);
}

.advapafo-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    background: var(--advapafo-muted-bg);
    border-top: 1px solid var(--advapafo-border);
}

.advapafo-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.advapafo-side-card {
    padding: 22px;
}

.advapafo-side-card--accent {
    color: #fff;
    background:
        radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.28), transparent 30%),
        linear-gradient(145deg, var(--advapafo-accent), #4f33ba);
    border-color: rgba(126, 91, 239, 0.2);
}

.advapafo-side-card--accent p,
.advapafo-side-card--accent li,
.advapafo-side-card--accent h2 {
    color: #fff;
}

.advapafo-side-card--accent p,
.advapafo-side-card--accent li {
    opacity: 0.88;
}

.advapafo-side-card--accent .advapafo-badge--accent {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
}

.advapafo-side-card ul,
.advapafo-checklist {
    margin: 16px 0 18px;
    padding: 0;
    list-style: none;
}

.advapafo-side-card li,
.advapafo-checklist li,
.advapafo-compat-list span {
    display: flex;
    gap: 9px;
    align-items: center;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.4;
}

.advapafo-side-card ul li::before,
.advapafo-checklist li::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    color: var(--advapafo-success);
    background: var(--advapafo-success-bg);
    font-size: 11px;
    font-weight: 800;
}

.advapafo-side-card--accent ul li::before {
    color: var(--advapafo-accent-dark);
    background: rgba(255, 255, 255, 0.9);
}

.advapafo-compat-list {
    display: grid;
    gap: 8px;
    margin-top: 15px;
}

.advapafo-compat-list span {
    justify-content: space-between;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--advapafo-muted-bg);
}

.advapafo-compat-list strong {
    color: var(--advapafo-success);
}

.advapafo-shortcode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.advapafo-shortcode-helper-card {
    margin: 22px 28px;
    padding: 20px;
    border: 1px solid var(--advapafo-border);
    border-radius: var(--advapafo-radius);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: var(--advapafo-shadow-soft);
}

.advapafo-shortcode-helper-card__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--advapafo-ink);
}

.advapafo-shortcode-helper-card__header p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--advapafo-muted);
}

.advapafo-shortcode-helper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.advapafo-shortcode-helper-grid section {
    padding: 14px;
    border: 1px solid var(--advapafo-border);
    border-radius: 12px;
    background: #fff;
}

.advapafo-shortcode-helper-grid h4,
.advapafo-shortcode-examples h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--advapafo-ink);
}

.advapafo-shortcode-helper-grid ol,
.advapafo-shortcode-helper-list {
    margin: 10px 0 0;
    padding-left: 18px;
}

.advapafo-shortcode-helper-grid li,
.advapafo-shortcode-helper-list li {
    margin: 6px 0;
    color: var(--advapafo-ink-soft);
    font-size: 13px;
    line-height: 1.45;
}

.advapafo-shortcode-helper-list code {
    margin-right: 5px;
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid var(--advapafo-border);
    background: #fff;
    color: var(--advapafo-ink);
    font-size: 12px;
}

.advapafo-shortcode-examples {
    margin-top: 16px;
}

.advapafo-shortcode-examples__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.advapafo-shortcode-examples__grid > div {
    padding: 12px;
    border: 1px dashed var(--advapafo-border-strong);
    border-radius: 10px;
    background: #fff;
}

.advapafo-shortcode-examples__grid p {
    margin: 0 0 8px;
    color: var(--advapafo-ink);
    font-size: 12px;
    font-weight: 700;
}

.advapafo-shortcode-examples__grid code {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: #111820;
    color: #f8fafc;
    font-size: 12px;
    white-space: normal;
}

.advapafo-shortcode-card {
    padding: 22px;
}

.advapafo-shortcode-card code {
    display: block;
    margin-top: 16px;
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid var(--advapafo-border);
    background: #111820;
    color: #f8fafc;
    font-size: 13px;
    white-space: normal;
}

.advapafo-shortcode-card span {
    display: block;
    margin-top: 12px;
    color: var(--advapafo-muted);
    font-size: 12px;
    font-weight: 650;
}

/* Integration module wrappers used by injected and shortcode renders. */
.advapafo-integration-passkey {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid var(--advapafo-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.advapafo-integration-passkey--auto-inject {
    border-color: rgba(126, 91, 239, 0.28);
    box-shadow: 0 8px 16px rgba(126, 91, 239, 0.08);
}

.advapafo-integration-passkey .advapafo-shortcode-login-wrap {
    margin: 0;
}

@media (max-width: 1100px) {
    .advapafo-layout {
        grid-template-columns: 1fr;
    }

    .advapafo-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        display: grid;
    }
}

@media (max-width: 782px) {
    .advapafo-admin-wrap {
        margin-right: 12px;
    }

    .advapafo-hero,
    .advapafo-card--setting,
    .advapafo-card__header,
    .advapafo-form-footer,
    .advapafo-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .advapafo-hero {
        padding: 24px;
    }

    .advapafo-hero h1 {
        font-size: 28px;
    }

    .advapafo-role-grid,
    .advapafo-grid-2,
    .advapafo-grid-3,
    .advapafo-integration-settings-grid,
    .advapafo-shortcode-helper-grid,
    .advapafo-shortcode-examples__grid,
    .advapafo-shortcode-grid,
    .advapafo-sidebar {
        grid-template-columns: 1fr;
    }

    .advapafo-settings-form .advapafo-card,
    .advapafo-shortcode-grid,
    .advapafo-shortcode-helper-card {
        margin: 16px;
    }

    .advapafo-section-header,
    .advapafo-form-footer {
        padding: 20px;
    }
}

/* ── Profile section ──────────────────────────────────────── */

.advapafo-profile-section {
    margin: 28px 0;
    color: var(--advapafo-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.advapafo-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.advapafo-profile-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--advapafo-ink);
}

.advapafo-profile-header p {
    margin: 0;
    font-size: 13px;
    color: var(--advapafo-muted);
    line-height: 1.5;
}

.advapafo-profile-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--advapafo-border);
    background: var(--advapafo-muted-bg);
    font-size: 14px;
    font-weight: 700;
    color: var(--advapafo-ink);
    white-space: nowrap;
    flex-shrink: 0;
}

.advapafo-profile-count-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--advapafo-muted);
}

.advapafo-profile-card {
    background: #fff;
    border: 1px solid var(--advapafo-border);
    border-radius: var(--advapafo-radius);
    box-shadow: var(--advapafo-shadow-soft);
    overflow: hidden;
}

/* Register row */
.advapafo-profile-register-row {
    padding: 24px 28px;
    border-bottom: 1px solid var(--advapafo-border);
}

.advapafo-profile-register-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.advapafo-profile-register-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--advapafo-ink);
    white-space: nowrap;
}

.advapafo-profile-register-desc {
    font-size: 13px;
    color: var(--advapafo-muted);
    line-height: 1.5;
}

.advapafo-profile-register-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 520px;
}

.advapafo-profile-register-label {
    flex: 1;
    min-width: 0;
}

.advapafo-profile-register-label label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--advapafo-ink);
}

.advapafo-profile-label-input {
    width: 100%;
    height: 46px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--advapafo-border-strong) !important;
    border-radius: 10px !important;
    font-size: 14.5px;
    color: var(--advapafo-ink);
    background: #fff;
    box-shadow: none !important;
    box-sizing: border-box;
}

.advapafo-profile-label-input:focus {
    border-color: var(--advapafo-accent) !important;
    box-shadow: 0 0 0 3px rgba(126, 91, 239, 0.14) !important;
    outline: none;
}

.advapafo-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--advapafo-ink) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
    box-shadow: 0 8px 18px rgba(29, 35, 39, 0.18);
    width: 100%;
}

.advapafo-profile-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(29, 35, 39, 0.24);
    color: #fff !important;
}

.advapafo-profile-tip {
    margin: 0;
    font-size: 12px;
    color: var(--advapafo-muted);
    line-height: 1.5;
}

/* Hidden by default; JS sets display:'' when content is written */
#advapafo-passkey-profile-message {
    display: none;
    margin: 0;
    padding: 0;
}

.advapafo-profile-limit-notice {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(202, 138, 4, 0.28);
    background: rgba(254, 249, 195, 0.6);
    color: #854d0e;
    font-size: 13px;
    line-height: 1.5;
    min-width: 260px;
}

/* Credentials table */
.advapafo-profile-creds {
    padding: 0;
}

.advapafo-profile-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 28px 0;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(202, 138, 4, 0.28);
    background: rgba(254, 249, 195, 0.6);
    color: #854d0e;
    font-size: 12.5px;
    line-height: 1.4;
}

.advapafo-profile-warning svg {
    flex-shrink: 0;
    stroke: #a16207;
}

.advapafo-creds-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 13.5px;
}

.advapafo-creds-table thead tr {
    border-bottom: 1px solid var(--advapafo-border);
}

.advapafo-creds-table thead th {
    padding: 10px 28px;
    text-align: left;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--advapafo-muted);
    background: var(--advapafo-muted-bg);
}

.advapafo-creds-table tbody tr {
    border-bottom: 1px solid var(--advapafo-border);
    transition: background 120ms ease;
}

.advapafo-creds-table tbody tr:last-child {
    border-bottom: 0;
}

.advapafo-creds-table tbody tr:hover {
    background: #fafbff;
}

.advapafo-creds-table td {
    padding: 14px 28px;
    color: var(--advapafo-ink);
    vertical-align: middle;
}

.advapafo-creds-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
}

.advapafo-creds-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--advapafo-accent);
    flex-shrink: 0;
}

.advapafo-revoke-btn {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(185, 28, 28, 0.3) !important;
    border-radius: 8px !important;
    background: rgba(254, 226, 226, 0.6) !important;
    color: #b91c1c !important;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

.advapafo-revoke-btn:hover {
    background: rgba(254, 202, 202, 0.9) !important;
    border-color: rgba(185, 28, 28, 0.55) !important;
}

/* Login form passkey button: black style, same size as SSO button */
/* Front-end shortcode login button: mirror wp-login passkey styling */
.advapafo-shortcode-login-wrap {
    max-width: 320px;
    margin: 12px 0;
}

.advapafo-shortcode-login-wrap .advapafo-passkey-btn {
    width: 100% !important;
    min-height: 30px;
    margin: 0;
    padding: 0 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    border: 1px solid #111820 !important;
    border-radius: 4px !important;
    background: #111820 !important;
    color: #fff !important;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(17, 24, 32, 0.22);
    transition: background 150ms ease, border-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

.advapafo-shortcode-login-wrap .advapafo-passkey-btn:hover,
.advapafo-shortcode-login-wrap .advapafo-passkey-btn:focus {
    border-color: #0b0f14 !important;
    background: #0b0f14 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(17, 24, 32, 0.24);
}

.advapafo-shortcode-login-wrap .advapafo-passkey-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 159, 254, 0.45), 0 6px 14px rgba(17, 24, 32, 0.24);
}

.advapafo-shortcode-login-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-color: #c7d0da !important;
    background: #eef1f4 !important;
    color: #1f2937 !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.18);
}

.advapafo-shortcode-login-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey:hover,
.advapafo-shortcode-login-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey:focus {
    border-color: #9aa4b2 !important;
    background: #dde3ea !important;
    color: #111827 !important;
    box-shadow: 0 6px 14px rgba(71, 85, 105, 0.2);
}

.advapafo-shortcode-login-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey .advapafo-passkey-icon {
    color: #1f2937;
}

.advapafo-shortcode-login-wrap .advapafo-passkey-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    color: #fff;
}

.advapafo-shortcode-login-wrap .advapafo-passkey-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.advapafo-shortcode-login-wrap .advapafo-login-message {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #5f6873;
}

.advapafo-passkey-prompt {
    margin: 18px 0;
}

.advapafo-passkey-prompt__card {
    max-width: 640px;
    padding: 22px;
    border-radius: 14px;
    border: 1px solid #dbe2ea;
    background:
        radial-gradient(circle at top right, rgba(58, 173, 255, 0.14), transparent 42%),
        linear-gradient(165deg, #ffffff 0%, #f6f9fc 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.advapafo-passkey-prompt__eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f6b8e;
}

.advapafo-passkey-prompt h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    color: #111827;
}

.advapafo-passkey-prompt__copy {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: #3f4b5a;
}

.advapafo-passkey-prompt__benefits {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.advapafo-passkey-prompt__benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #243447;
    font-size: 13.5px;
    line-height: 1.4;
}

.advapafo-passkey-prompt__benefits li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1597d4;
    box-shadow: 0 0 0 4px rgba(21, 151, 212, 0.14);
    flex: 0 0 8px;
}

.advapafo-passkey-prompt__actions {
    margin-top: 16px;
}

.advapafo-passkey-prompt .advapafo-passkey-prompt-register {
    max-width: 520px;
}

.advapafo-passkey-prompt .advapafo-passkey-prompt-register .advapafo-profile-register-controls {
    gap: 10px;
}

.advapafo-passkey-prompt .advapafo-passkey-prompt-register .advapafo-profile-tip {
    margin-top: 6px;
}

@media (max-width: 782px) {
    .advapafo-passkey-prompt__card {
        padding: 16px;
    }

    .advapafo-passkey-prompt h3 {
        font-size: 20px;
    }
}

.advapafo-passkey-btn.advapafo-btn-disabled,
.advapafo-passkey-btn.advapafo-btn-disabled:hover,
.advapafo-passkey-btn.advapafo-btn-disabled:focus {
    border-color: #c8ced6 !important;
    background: #f1f3f5 !important;
    color: #8a929b !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
    opacity: 0.92;
}

.advapafo-passkey-btn.advapafo-btn-disabled .advapafo-passkey-icon {
    color: #9aa3ad;
}

.advapafo-is-hidden {
    display: none !important;
}

.advapafo-user-passkeys-muted {
    color: #8a8f96;
}

body.login #advapafo-login-passkey-block {
    clear: both;
    padding-top: 18px;
}

body.login #advapafo-login-passkey-block.advapafo-login-passkey-block--conditional-only {
    padding-top: 0;
}

body.login .advapafo-login-separator {
    width: 100%;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b949e;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.login .advapafo-login-separator::before,
body.login .advapafo-login-separator::after {
    content: "";
    flex: 1 1 auto;
    border-top: 1px solid #d8dde3;
}

body.login .advapafo-login-separator span {
    display: inline-block;
    padding: 0 10px;
    line-height: 1;
    background: #fff;
}

body.login .advapafo-login-passkey-wrap {
    margin-top: 0;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn {
    width: 100% !important;
    min-height: 30px;
    margin-bottom: 0;
    padding: 0 12px !important;
    position: relative;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    border: 1px solid #111820 !important;
    border-radius: 4px !important;
    background: #111820 !important;
    color: #fff !important;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(17, 24, 32, 0.22);
    transition: background 150ms ease, border-color 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn.advapafo-passkey-btn--hidden {
    display: none !important;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn:hover,
body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn:focus {
    border-color: #0b0f14 !important;
    background: #0b0f14 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(17, 24, 32, 0.24);
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 159, 254, 0.45), 0 6px 14px rgba(17, 24, 32, 0.24);
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-color: #c7d0da !important;
    background: #eef1f4 !important;
    color: #1f2937 !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.18);
}

/* Hidden state must always win, including when light-grey style is selected. */
body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey.advapafo-passkey-btn--hidden,
body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey:hover,
body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey:focus {
    border-color: #9aa4b2 !important;
    background: #dde3ea !important;
    color: #111827 !important;
    box-shadow: 0 6px 14px rgba(71, 85, 105, 0.2);
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-btn.advapafo-passkey-btn--light-grey .advapafo-passkey-icon {
    color: #1f2937;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    color: #fff;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-last-used-pill {
    position: absolute;
    top: -9px;
    right: -9px;
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid #d8dde3;
    background: #f5f7fa;
    color: #1f2937;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

body.login .advapafo-login-passkey-wrap .advapafo-passkey-last-used-pill[hidden] {
    display: none !important;
}

body.login #advapafo-passkey-login-message {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.wpkpro-provider-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.wpkpro-provider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 999px;
    color: #111827;
    background: rgba(17, 24, 39, 0.1);
    border: 1px solid rgba(17, 24, 39, 0.2);
}

.wpkpro-provider-icon svg {
    display: block;
    width: 14px;
    height: 14px;
}

.wpkpro-provider-icon-image-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wpkpro-provider-icon-image {
    display: block;
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.wpkpro-provider-chip--icloud .wpkpro-provider-icon,
.wpkpro-provider-chip--apple .wpkpro-provider-icon,
.wpkpro-provider-chip--apple-passwords .wpkpro-provider-icon {
    color: #111827 !important;
    background: rgba(17, 24, 39, 0.1) !important;
    border-color: rgba(17, 24, 39, 0.2) !important;
}

@media (prefers-color-scheme: dark) {
    .wpkpro-provider-chip--icloud .wpkpro-provider-icon,
    .wpkpro-provider-chip--apple .wpkpro-provider-icon,
    .wpkpro-provider-chip--apple-passwords .wpkpro-provider-icon {
        color: #ffffff !important;
        background: #111827 !important;
        border-color: #111827 !important;
    }
}

.wpkpro-provider-chip--unknown .wpkpro-provider-icon {
    color: #475569;
    background: rgba(71, 85, 105, 0.12);
    border-color: rgba(71, 85, 105, 0.24);
}

@media (max-width: 782px) {
    .advapafo-profile-register-row {
        flex-direction: column;
    }

    .advapafo-profile-register-controls,
    .advapafo-profile-limit-notice {
        min-width: 0;
        width: 100%;
    }

    .advapafo-creds-table thead th,
    .advapafo-creds-table td {
        padding-left: 16px;
        padding-right: 16px;
    }

    .advapafo-profile-warning {
        margin-left: 16px;
        margin-right: 16px;
    }
}
