/* ============================================================
   TNC FlipBook 3D - Admin UI Styles
   Scoped under .tnc-flipbook-admin to prevent WP style leaks
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
.tnc-flipbook-admin {
    --tncfb-primary: var(--wp-admin-theme-color, #2271b1);
    --tncfb-primary-hover: var(--wp-admin-theme-color--rgb, #135e96);
    --tncfb-primary-light: #f0f6fc;
    --tncfb-border: #dcdcde;
    --tncfb-border-light: #e8e8eb;
    --tncfb-bg: #f6f7f7;
    --tncfb-bg-alt: #fafafa;
    --tncfb-radius: 8px;
    --tncfb-radius-sm: 4px;
    --tncfb-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
    --tncfb-shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --tncfb-switch-on: #2271b1;
    --tncfb-switch-off: #c3c4c7;
    --tncfb-text: #1d2327;
    --tncfb-text-muted: #646970;
    --tncfb-text-light: #787c82;
    --tncfb-danger: #d63638;
    --tncfb-spacing-xs: 4px;
    --tncfb-spacing-sm: 8px;
    --tncfb-spacing-md: 16px;
    --tncfb-spacing-lg: 24px;
    --tncfb-spacing-xl: 32px;
    --tncfb-transition: .15s ease;
}

/* ── Banner component ──────────────────────────────────────── */
.tncfb-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #c2d9f0;
    background: #f0f6fc;
    color: #1d2327;
    font-size: 13px;
    line-height: 1.5;
}
.tncfb-banner svg { flex-shrink: 0; color: #2271b1; }
.tncfb-banner.is-info { background: #f0f6fc; border-color: #c2d9f0; }
.tncfb-banner.is-info svg { color: #2271b1; }
.tncfb-banner.is-warn { background: #fef0c7; border-color: #fec84b; color: #b54708; }
.tncfb-banner.is-warn svg { color: #b54708; }
.tncfb-banner.is-success { background: #e7f6ec; border-color: #b7e1c5; color: #1e8a4a; }
.tncfb-banner.is-success svg { color: #1e8a4a; }
.tncfb-banner.is-danger { background: #fcf0f0; border-color: #d63638; color: #d63638; }
.tncfb-banner.is-danger svg { color: #d63638; }

/* ── Tab navigation ────────────────────────────────────────── */
.tncfb-wizard-wrap {
    margin: -12px -12px 0;
}

.tncfb-tab-nav {
    display: flex;
    border-bottom: 2px solid var(--tncfb-border);
    background: #fff;
    padding: 0 var(--tncfb-spacing-md);
    gap: 0;
    overflow-x: auto;
}

.tncfb-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 14px 20px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #50575e;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--tncfb-transition), border-color var(--tncfb-transition), background var(--tncfb-transition);
}
.tncfb-tab-btn:hover {
    color: var(--tncfb-primary);
    background: rgba(34, 113, 177, 0.04);
}
.tncfb-tab-btn.is-active {
    color: var(--tncfb-primary);
    border-bottom-color: var(--tncfb-primary);
    font-weight: 600;
    background: rgba(34, 113, 177, 0.06);
}

/* ── Tab panels ────────────────────────────────────────────── */
.tncfb-tab-panel {
    display: none;
    padding: var(--tncfb-spacing-lg);
}
.tncfb-tab-panel.is-active { display: block; }

/* ── Section headings ──────────────────────────────────────── */
.tncfb-section-title {
    margin: 0 0 var(--tncfb-spacing-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--tncfb-text);
    line-height: 1.4;
}
.tncfb-section-desc {
    margin: 0 0 var(--tncfb-spacing-lg);
    color: var(--tncfb-text-muted);
    font-size: 13px;
    line-height: 1.5;
}
.tncfb-section-divider {
    border-top: 1px solid var(--tncfb-border-light);
    margin: var(--tncfb-spacing-xl) 0 var(--tncfb-spacing-lg);
    padding-top: var(--tncfb-spacing-lg);
}
.tncfb-section-divider h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--tncfb-text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ── Card selectors (source type, layouts, styles) ─────────── */
.tncfb-source-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: var(--tncfb-spacing-lg);
}

.tncfb-source-card {
    position: relative;
    border: 1.5px solid var(--tncfb-border-light);
    border-radius: 8px;
    padding: 28px 24px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #fff;
}
.tncfb-source-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.tncfb-source-card:hover {
    border-color: var(--tncfb-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}
.tncfb-source-card.is-active {
    border-color: var(--tncfb-border-light);
    border-bottom: 3px solid var(--tncfb-primary);
    background: var(--tncfb-primary-light);
    box-shadow: 0 4px 16px rgba(34,113,177,0.08);
}
.tncfb-source-card.is-active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 6px solid var(--tncfb-primary);
}
.tncfb-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--tncfb-primary-light);
    color: var(--tncfb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.tncfb-source-card.is-active .tncfb-card-icon {
    background: #fff;
}
.tncfb-card-icon svg { stroke: var(--tncfb-primary); }
.tncfb-card-title { font-size: 14px; font-weight: 600; display: block; color: var(--tncfb-text); }
.tncfb-card-desc { font-size: 13px; color: var(--tncfb-text-muted); display: block; line-height: 1.5; max-width: 240px; }

.tncfb-card-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: var(--tncfb-spacing-sm);
}
.tncfb-card-sm {
    border: 1.5px solid var(--tncfb-border);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--tncfb-text-muted);
    transition: all var(--tncfb-transition);
    position: relative;
    background: #fff;
}
.tncfb-card-sm input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; appearance: none; -webkit-appearance: none; }
.tncfb-card-sm:hover {
    border-color: var(--tncfb-primary);
    color: var(--tncfb-text);
    box-shadow: var(--tncfb-shadow-sm);
}
.tncfb-card-sm.is-active {
    border-color: var(--tncfb-primary);
    background: var(--tncfb-primary-light);
    color: var(--tncfb-primary);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--tncfb-primary);
}

/* Toolbar layout illustrated picker (2x2 grid) */
.tncfb-layout-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 360px;
    margin-bottom: var(--tncfb-spacing-sm);
}
.tncfb-layout-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border: 1.5px solid var(--tncfb-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all var(--tncfb-transition);
}
.tncfb-layout-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; appearance: none; -webkit-appearance: none; }
.tncfb-layout-card:hover {
    border-color: var(--tncfb-primary);
    box-shadow: var(--tncfb-shadow-sm);
}
.tncfb-layout-card.is-active,
.tncfb-layout-card:has(input[type="radio"]:checked) {
    border-color: var(--tncfb-primary);
    background: var(--tncfb-primary-light);
    box-shadow: 0 0 0 1px var(--tncfb-primary);
}
.tncfb-layout-card-svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: #f6f7f7;
    border: 1px solid #e8e8eb;
}
.tncfb-layout-card-svg .tncfb-lc-page-line { fill: #d0d4d9; }
.tncfb-layout-card-svg .tncfb-lc-bar { fill: #9ca3af; transition: fill var(--tncfb-transition); }
.tncfb-layout-card.is-active .tncfb-layout-card-svg,
.tncfb-layout-card:has(input[type="radio"]:checked) .tncfb-layout-card-svg { background: #fff; border-color: #c2d9f0; }
.tncfb-layout-card.is-active .tncfb-layout-card-svg .tncfb-lc-bar,
.tncfb-layout-card:has(input[type="radio"]:checked) .tncfb-layout-card-svg .tncfb-lc-bar { fill: var(--tncfb-primary); }
.tncfb-layout-card-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tncfb-text-muted);
    text-align: center;
}
.tncfb-layout-card.is-active .tncfb-layout-card-label,
.tncfb-layout-card:has(input[type="radio"]:checked) .tncfb-layout-card-label {
    color: var(--tncfb-primary);
    font-weight: 600;
}
/* 3D-only badge */
.tncfb-badge-3d {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 1.4;
}

/* ── Toggle switch ─────────────────────────────────────────── */
.tncfb-switcher-wrap {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.tnc-flipbook-admin .tncfb-switcher-wrap input[type="checkbox"],
.tnc-flipbook-admin .tncfb-override-toggle input[type="checkbox"],
.tnc-flipbook-admin .tncfb-accordion-header-toggle input[type="checkbox"],
.tnc-flipbook-admin .tncfb-section-enable-toggle input[type="checkbox"],
.tnc-flipbook-admin .tncfb-section-override-toggle input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0;
    -webkit-appearance: none; appearance: none;
    margin: 0; padding: 0; border: none;
}

.tncfb-switcher-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: var(--tncfb-switch-off);
    border-radius: 22px;
    transition: background .2s;
    flex-shrink: 0;
}
.tncfb-switcher-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.tncfb-switcher-wrap input:checked + .tncfb-switcher-slider,
.tncfb-override-toggle input:checked + .tncfb-switcher-slider,
.tncfb-accordion-header-toggle input:checked + .tncfb-switcher-slider,
.tncfb-section-enable-toggle input:checked + .tncfb-switcher-slider,
.tncfb-section-override-toggle input:checked + .tncfb-switcher-slider { background: var(--tncfb-switch-on); }
.tncfb-switcher-wrap input:checked + .tncfb-switcher-slider::after,
.tncfb-override-toggle input:checked + .tncfb-switcher-slider::after { transform: translateX(18px); }
.tncfb-accordion-header-toggle input:checked + .tncfb-switcher-slider::after,
.tncfb-section-enable-toggle input:checked + .tncfb-switcher-slider::after { transform: translateX(14px); }
.tncfb-section-override-toggle input:checked + .tncfb-switcher-slider::after { transform: translateX(12px); }

.tncfb-switcher-small { width: 32px; height: 18px; }
.tncfb-switcher-small::after { width: 12px; height: 12px; }
.tncfb-switcher-wrap input:checked + .tncfb-switcher-small::after,
.tncfb-override-toggle input:checked + .tncfb-switcher-small::after { transform: translateX(14px); }

.tncfb-switcher-xs { width: 28px; height: 16px; }
.tncfb-switcher-xs::after { width: 10px; height: 10px; top: 3px; left: 3px; }
.tncfb-switcher-wrap input:checked + .tncfb-switcher-xs::after,
.tncfb-override-toggle input:checked + .tncfb-switcher-xs::after { transform: translateX(12px); }

.tncfb-switcher-label { font-size: 13px; color: var(--tncfb-text); }

.tncfb-field-switcher { margin-bottom: var(--tncfb-spacing-md); text-align: left; }

/* ── Global override wrap ──────────────────────────────────── */
.tncfb-override-wrap {
    border: 1px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    margin-bottom: var(--tncfb-spacing-md);
    background: #fff;
    box-shadow: var(--tncfb-shadow-sm);
}
.tncfb-override-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--tncfb-spacing-md);
    background: var(--tncfb-bg);
    border-bottom: 1px solid var(--tncfb-border-light);
}
.tncfb-override-label { font-weight: 600; font-size: 13px; color: var(--tncfb-text); }
.tncfb-override-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--tncfb-spacing-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--tncfb-text-muted);
}
.tncfb-override-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.tncfb-override-body { padding: var(--tncfb-spacing-md); }
.tncfb-override-body.is-disabled {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}
/* Block input on the controls themselves, but the body keeps pointer-events
   so clicks land on it and we can surface an explanatory tooltip. */
.tncfb-override-body.is-disabled > * { pointer-events: none; }

/* Static "per-FlipBook" pill in a card header (for settings with no global
   default, so they show this instead of the global/custom override toggle). */
.tncfb-perfb-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--tncfb-text-muted);
    background: #fff;
    border: 1px solid var(--tncfb-border-light);
    padding: 2px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
/* Conditional sub-options nested inside a card body, set off with a divider. */
.tncfb-startup-suboption {
    margin-top: var(--tncfb-spacing-md);
    padding-top: var(--tncfb-spacing-md);
    border-top: 1px dashed var(--tncfb-border-light);
}

/* ── Watermark type conditional fields ─────────────────────── */
.tncfb-watermark-image-fields { display: none; }
.tncfb-wm-image-row { display: none; }

/* ── Toolbar guide ─────────────────────────────────────────── */
.tncfb-toolbar-guide {
    background: var(--tncfb-primary-light);
    border: 1px solid var(--tncfb-border-light);
    border-left: 3px solid var(--tncfb-primary);
    border-radius: var(--tncfb-radius-sm);
    padding: 12px 16px;
    margin-bottom: var(--tncfb-spacing-lg);
}
.tncfb-toolbar-guide-text {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--tncfb-text);
}
.tncfb-toolbar-guide-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.tncfb-toolbar-guide-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tncfb-text-muted);
    line-height: 1.4;
}
.tncfb-toolbar-guide-legend-item strong {
    color: var(--tncfb-text);
}
/* Mini toggle shape replicas for the legend */
.tncfb-guide-toggle {
    display: inline-block;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--tncfb-switch-off);
    position: relative;
}
.tncfb-guide-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #fff;
}
.tncfb-guide-toggle-sm {
    width: 28px;
    height: 16px;
}
.tncfb-guide-toggle-sm::after {
    width: 12px;
    height: 12px;
}
.tncfb-guide-toggle-lg {
    width: 40px;
    height: 22px;
}
.tncfb-guide-toggle-lg::after {
    width: 18px;
    height: 18px;
}

/* ── Toolbar items grid ────────────────────────────────────── */
.tncfb-toolbar-group { margin-bottom: 32px; padding-top: 16px; }
.tncfb-toolbar-group:first-child { padding-top: 0; }
.tncfb-group-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 var(--tncfb-spacing-md);
    border-bottom: 1px solid var(--tncfb-border-light);
    padding-bottom: var(--tncfb-spacing-sm);
}
.tncfb-group-heading-row .tncfb-group-heading {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}
.tncfb-group-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--tncfb-text-muted);
    margin: 0 0 var(--tncfb-spacing-md);
    border-bottom: 1px solid var(--tncfb-border-light);
    padding-bottom: var(--tncfb-spacing-sm);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.tncfb-toolbar-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.tncfb-toolbar-item {
    border: 1px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    padding: 12px 14px;
    background: #fff;
    transition: box-shadow var(--tncfb-transition);
}
.tncfb-toolbar-item:hover {
    box-shadow: var(--tncfb-shadow-sm);
}
.tncfb-toolbar-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--tncfb-spacing-sm);
}
.tncfb-toolbar-item-label { font-size: 13px; font-weight: 600; color: var(--tncfb-text); }

/* ── Range slider ──────────────────────────────────────────── */
.tncfb-field-slider label.tncfb-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.tncfb-slider-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--tncfb-primary);
    background: var(--tncfb-primary-light);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 36px;
    text-align: center;
}
input[type="range"].tncfb-field-slider,
.tncfb-field-slider input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--tncfb-border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.tncfb-field-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tncfb-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
    transition: transform var(--tncfb-transition);
}
.tncfb-field-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.tncfb-field-slider input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tncfb-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
}
.tncfb-field-slider input[type="range"]:focus {
    outline: none;
}

/* ── Color picker ──────────────────────────────────────────── */
.tncfb-color-wrap { display: flex; align-items: center; gap: 8px; }
.tncfb-color-wrap input[type="color"] {
    width: 36px;
    height: 36px;
    border: 2px solid #fff;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
    box-shadow: 0 0 0 1px var(--tncfb-border), 0 1px 3px rgba(0,0,0,.1);
    transition: box-shadow var(--tncfb-transition), transform var(--tncfb-transition);
    -webkit-appearance: none;
}
.tncfb-color-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.tncfb-color-wrap input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
.tncfb-color-wrap input[type="color"]:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--tncfb-primary), 0 1px 3px rgba(0,0,0,.15);
}
.tncfb-color-text {
    width: 90px !important;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    letter-spacing: .3px;
}

/* ── Color scheme swatches ─────────────────────────────────── */
.tncfb-scheme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--tncfb-spacing-md);
}
.tncfb-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: var(--tncfb-radius);
    border: 2px solid transparent;
    transition: border-color var(--tncfb-transition), background var(--tncfb-transition);
    min-width: 48px;
}
.tncfb-swatch:hover {
    background: var(--tncfb-bg);
    border-color: var(--tncfb-border);
}
.tncfb-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tncfb-swatch-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.12);
    background: linear-gradient(135deg, #aaa, #ccc);
    transition: transform var(--tncfb-transition), box-shadow var(--tncfb-transition);
}
.tncfb-swatch:hover .tncfb-swatch-dot {
    transform: scale(1.1);
}
.tncfb-swatch-name {
    font-size: 9px;
    font-weight: 500;
    color: var(--tncfb-text-muted);
    text-transform: capitalize;
    letter-spacing: .2px;
}
.tncfb-swatch.is-active {
    border-color: var(--tncfb-primary);
    background: var(--tncfb-primary-light);
}
.tncfb-swatch.is-active .tncfb-swatch-dot {
    box-shadow: 0 0 0 2px var(--tncfb-primary), 0 1px 3px rgba(0,0,0,.12);
}
.tncfb-swatch.is-active .tncfb-swatch-name {
    color: var(--tncfb-primary);
    font-weight: 600;
}
/* Custom scheme swatch - rainbow gradient */
.tncfb-swatch-dot-custom {
    background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e) !important;
}
/* Settings page swatches inside form table */
.tncfb-settings-section .tncfb-scheme-swatches { margin-top: 4px; }

/* ── Chrome cards (surface palette picker) ─────────────────── */
.tncfb-chrome-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 4px;
}
.tncfb-chrome-card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 10px 12px;
    border: 2px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    background: #fff;
    cursor: pointer;
    transition: border-color var(--tncfb-transition), box-shadow var(--tncfb-transition), transform var(--tncfb-transition);
}
.tncfb-chrome-card:hover {
    border-color: var(--tncfb-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.tncfb-chrome-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.tncfb-chrome-card-preview {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    overflow: hidden;
    background-clip: padding-box;
}
.tncfb-chrome-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}
.tncfb-chrome-card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--tncfb-text);
}
.tncfb-chrome-card-desc {
    font-size: 12px;
    color: var(--tncfb-text-muted);
    line-height: 1.4;
}
.tncfb-chrome-card.is-active {
    border-color: var(--tncfb-primary);
    box-shadow: 0 0 0 2px var(--tncfb-primary-light);
}
.tncfb-chrome-card.is-active .tncfb-chrome-card-label {
    color: var(--tncfb-primary);
}
.tncfb-chrome-card input[type="radio"]:disabled ~ * { opacity: 0.7; }
.tncfb-chrome-card:has(input[type="radio"]:disabled) { cursor: not-allowed; opacity: 0.7; }

/* ── Media field ───────────────────────────────────────────── */
.tncfb-media-preview {
    display: flex;
    align-items: center;
    gap: var(--tncfb-spacing-md);
    margin-bottom: var(--tncfb-spacing-sm);
    padding: 10px 12px;
    border: 1px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    background: var(--tncfb-bg);
}
.tncfb-media-preview.tncfb-hidden { display: none; }
.tncfb-media-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--tncfb-radius-sm); }
.tncfb-media-filename { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tncfb-text); }
.tncfb-media-remove { color: var(--tncfb-danger) !important; font-size: 13px; }

/* ── Repeater ──────────────────────────────────────────────── */
.tncfb-repeater { margin-bottom: var(--tncfb-spacing-md); }
.tncfb-repeater-header { margin-bottom: var(--tncfb-spacing-md); }
.tncfb-repeater-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--tncfb-spacing-md); }
.tncfb-repeater-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    background: #fff;
    transition: box-shadow var(--tncfb-transition);
}
.tncfb-repeater-row:hover { box-shadow: var(--tncfb-shadow-sm); }
.tncfb-row-handle { color: #9ca3af; cursor: grab; flex-shrink: 0; }
.tncfb-row-handle:active { cursor: grabbing; }
.tncfb-row-fields { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.tncfb-row-remove {
    align-self: center;
    flex-shrink: 0;
}
.tncfb-repeater-empty { color: var(--tncfb-text-muted); font-style: italic; font-size: 13px; }
.tncfb-sortable-placeholder {
    border: 2px dashed var(--tncfb-primary);
    border-radius: var(--tncfb-radius);
    background: var(--tncfb-primary-light);
    min-height: 50px;
}
.tncfb-repeater-add { margin-top: var(--tncfb-spacing-xs); }
.tncfb-repeater-add .dashicons { vertical-align: text-top; }

/* ── Row grid ──────────────────────────────────────────────── */
.tncfb-row-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}
.tncfb-row-grid label { font-size: 13px; display: flex; flex-direction: column; gap: 4px; font-weight: 500; color: var(--tncfb-text-muted); }
.tncfb-row-grid label input,
.tncfb-row-grid label select { margin-top: 2px; }
/* Row grid: checkbox labels sit inline, not stacked */
.tncfb-row-grid label:has(> input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    align-self: flex-end;
    padding-bottom: 6px;
}
.tncfb-row-grid label > input[type="checkbox"] { margin-top: 0; }
/* Regular-text inputs inside row grids: fit the label, don't overflow */
.tncfb-row-grid input.regular-text { width: 100%; max-width: 280px; }
.tncfb-full-width { width: 100% !important; flex-basis: 100%; }

/* ── Gallery thumbnails ────────────────────────────────────── */
.tncfb-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tncfb-spacing-sm);
    margin-bottom: var(--tncfb-spacing-md);
    min-height: 70px;
    padding: 12px;
    border: 2px dashed var(--tncfb-border);
    border-radius: var(--tncfb-radius);
    background: var(--tncfb-bg-alt);
}
.tncfb-gallery-thumb {
    position: relative;
    width: 70px;
    height: 99px; /* A4 aspect ratio 1:1.414 */
    border-radius: var(--tncfb-radius-sm);
    overflow: hidden;
    border: 1px solid var(--tncfb-border);
    cursor: move;
    background: #f8f9fa;
}
.tncfb-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tncfb-gallery-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity var(--tncfb-transition);
}
.tncfb-gallery-thumb:hover .tncfb-gallery-remove { opacity: 1; }

/* ── Accordion ─────────────────────────────────────────────── */
.tncfb-accordion-group { display: flex; flex-direction: column; gap: 10px; }
.tncfb-accordion-item {
    border: 1px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    background: #fff;
    margin-bottom: 10px;
}
.tncfb-accordion-group > .tncfb-accordion-item { margin-bottom: 0; }
.tncfb-accordion-header {
    padding: 14px var(--tncfb-spacing-md);
    background: var(--tncfb-bg);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--tncfb-radius);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--tncfb-spacing-sm);
    color: var(--tncfb-text);
    transition: background var(--tncfb-transition);
}
/* Accordion header toggle - sits on the right side */
.tncfb-accordion-header-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--tncfb-text-muted);
}
.tncfb-accordion-header-toggle .tncfb-toggle-label {
    min-width: 20px;
}
/* Tri-state segmented control (Global / On / Off) */
.tncfb-tristate {
    display: inline-flex;
    border: 1px solid var(--tncfb-border);
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.tncfb-tristate input { position: absolute; opacity: 0; width: 0; height: 0; }
.tncfb-tristate label {
    padding: 5px 10px;
    cursor: pointer;
    color: var(--tncfb-text-muted);
    transition: all var(--tncfb-transition);
    border-right: 1px solid var(--tncfb-border);
    background: #fff;
    display: flex;
    align-items: center;
}
.tncfb-tristate label:last-child { border-right: none; }
.tncfb-tristate label:hover { background: var(--tncfb-bg); }
.tncfb-tristate input:checked + span { /* handled by JS class */ }
.tncfb-tristate label.is-active {
    background: var(--tncfb-primary);
    color: #fff;
    border-color: var(--tncfb-primary);
}
.tncfb-tristate label.is-on {
    background: #059669;
    color: #fff;
    border-color: #059669;
}
.tncfb-tristate label.is-off {
    background: var(--tncfb-text-muted);
    color: #fff;
    border-color: var(--tncfb-text-muted);
}
.tncfb-accordion-header-toggle .tncfb-switcher-slider {
    width: 32px;
    height: 18px;
}
.tncfb-accordion-header-toggle .tncfb-switcher-slider::after {
    width: 12px;
    height: 12px;
}
.tnc-flipbook-admin .tncfb-accordion-header-toggle input:checked + .tncfb-switcher-slider::after {
    transform: translateX(14px);
}
/* Dim accordion body when section is disabled */
.tncfb-accordion-item.is-disabled .tncfb-accordion-body {
    opacity: 0.4;
    cursor: not-allowed;
}
.tncfb-accordion-item.is-disabled .tncfb-accordion-body > * { pointer-events: none; }
.tncfb-accordion-item.is-disabled .tncfb-accordion-header {
    color: var(--tncfb-text-muted);
}
.tncfb-accordion-header:hover { background: #eef1f3; }
.tncfb-accordion-header::-webkit-details-marker { display: none; }
.tncfb-accordion-header::before {
    content: '\f347';
    font-family: dashicons;
    font-size: 16px;
    color: var(--tncfb-text-muted);
    transition: transform var(--tncfb-transition);
    flex-shrink: 0;
}
details.tncfb-accordion-item[open] .tncfb-accordion-header::before { transform: rotate(180deg); }
details.tncfb-accordion-item[open] .tncfb-accordion-header {
    border-radius: var(--tncfb-radius) var(--tncfb-radius) 0 0;
}
.tncfb-accordion-body { padding: var(--tncfb-spacing-md) var(--tncfb-spacing-lg); }

/* ── Sidebar boxes ─────────────────────────────────────────── */
/* ── Embed & Preview metabox (full-width layout) ──────────── */
.tncfb-embed-box { padding: 0; }
#tncfb3d_sidebar > .inside { padding: 0 !important; margin: 0 !important; }

.tncfb-embed-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
}
.tncfb-embed-empty p { margin: 0; }

.tncfb-embed-inner { }
.tncfb-embed-card-body { padding: 16px 20px; }

/* Shortcode card */
.tncfb-embed-card-shortcode { min-width: 0; }
.tncfb-embed-sc-top { margin-bottom: 12px; }
.tncfb-embed-select {
    width: 180px;
    font-size: 13px;
    padding: 5px 8px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
}
.tncfb-embed-sc-output {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f1;
}
.tncfb-embed-code {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-family: Menlo, Consolas, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #f6f7f7;
    padding: 7px 10px;
    border-radius: 4px;
    border: 1px solid #e8e8eb;
    color: #1d2327;
    line-height: 1.3;
}
.tncfb-embed-copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid #c2d9f0;
    border-radius: 6px;
    background: #fff;
    color: #2271b1;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.tncfb-embed-copy-btn:hover {
    background: #2271b1;
    color: #fff;
}

/* Shortcode options grid */
.tncfb-sc-options-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 18px;
    margin-bottom: 4px;
}
.tncfb-sc-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.tncfb-sc-field > span:first-child {
    min-width: 62px;
    color: #6b7280;
    flex-shrink: 0;
    font-size: 13px;
}
.tncfb-sc-field select,
.tncfb-sc-field input[type="text"] {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 3px 6px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}
.tncfb-sc-field-check { gap: 4px; }
.tncfb-sc-field-check > span { min-width: auto !important; font-size: 13px; }
.tncfb-sc-group { display: contents; }



/* ── Notices ───────────────────────────────────────────────── */
.tncfb-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--tncfb-spacing-md);
    padding: 12px var(--tncfb-spacing-md);
    border-radius: var(--tncfb-radius);
    font-size: 13px;
    line-height: 1.5;
}
.tncfb-notice-info { background: var(--tncfb-primary-light); border: 1px solid #c2d9f0; }
.tncfb-notice .dashicons { flex-shrink: 0; color: var(--tncfb-primary); }
.tncfb-notice p { margin: 0; }

/* ── Fields ────────────────────────────────────────────────── */
.tncfb-field { margin-bottom: var(--tncfb-spacing-md); }
.tncfb-field:last-child { margin-bottom: 0; }
.tncfb-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--tncfb-text); }
.tncfb-field-desc { font-size: 13px; color: var(--tncfb-text-muted); margin: 6px 0 var(--tncfb-spacing-md); line-height: 1.5; }
.tncfb-field-desc:last-child { margin-bottom: 0; }
.tncfb-field-disabled { opacity: .7; cursor: not-allowed; }
.tncfb-field-disabled > * { pointer-events: none; }

/* Disabled-field hint tooltip — appears at click point with arrow on top.
   Translate-x is set inline by JS so the arrow aligns to the click. */
.tncfb-override-hint {
    position: absolute;
    z-index: 99999;
    background: #1d4551;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    max-width: 300px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}
.tncfb-override-hint.is-visible { opacity: 1; transform: translateY(0); }
.tncfb-override-hint::after {
    content: '';
    position: absolute;
    top: -5px;
    /* JS sets --arrow-left in px from the tooltip's left edge */
    left: var(--arrow-left, 50%);
    margin-left: -5px;
    width: 10px;
    height: 10px;
    background: #1d4551;
    transform: rotate(45deg);
}

/* ── Source section ────────────────────────────────────────── */
.tncfb-source-inner {
    border: 1px solid var(--tncfb-border-light);
    border-radius: var(--tncfb-radius);
    padding: var(--tncfb-spacing-lg);
    background: var(--tncfb-bg-alt);
}
.tncfb-source-inner h4 {
    margin: 0 0 var(--tncfb-spacing-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--tncfb-text);
}

/* PDF file card (when PDF is attached) */
.tncfb-pdf-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e8e8eb;
    border-radius: 10px;
}
.tncfb-pdf-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fcf0f0;
    border-radius: 8px;
}
.tncfb-pdf-card-info {
    flex: 1;
    min-width: 0;
}
.tncfb-pdf-card-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tncfb-pdf-card-meta {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    margin-top: 2px;
}
.tncfb-pdf-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.tncfb-pdf-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #c2d9f0;
    border-radius: 6px;
    background: #fff;
    color: #50575e;
    cursor: pointer;
    transition: all 0.12s;
}
.tncfb-pdf-card-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
    background: #f0f6fc;
}
.tncfb-pdf-card-btn-danger:hover {
    border-color: #d63638;
    color: #d63638;
    background: #fcf0f0;
}

/* PDF upload prompt */
.tncfb-pdf-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    border: 1px solid #e8e8eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.tncfb-pdf-dropzone-compact { padding: 14px 16px; }
.tncfb-pdf-dropzone-compact .tncfb-pdf-dropzone-text { margin-top: 0; }
.tncfb-pdf-dropzone-compact { flex-direction: row; gap: 8px; }
.tncfb-pdf-dropzone-compact .tncfb-pdf-dropzone-hint { margin-top: 0; }
.tncfb-pdf-dropzone:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}
.tncfb-pdf-dropzone-text {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #2271b1;
}
.tncfb-pdf-dropzone-hint {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 3px;
}

/* ── Multi-PDF rows ────────────────────────────────────────── */
.tncfb-multi-pdf-list { display: flex; flex-direction: column; gap: 6px; }
.tncfb-multi-pdf-row.tncfb-pdf-card {
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e8e8eb;
    border-radius: 8px;
    background: #fff;
}
.tncfb-multi-pdf-row .tncfb-row-handle { cursor: grab; flex-shrink: 0; display: flex; align-items: center; }
.tncfb-multi-pdf-row .tncfb-row-handle:active { cursor: grabbing; }
.tncfb-multi-pdf-row .tncfb-pdf-card-icon { width: 36px; height: 36px; }
.tncfb-multi-pdf-row .tncfb-pdf-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.tncfb-multi-pdf-row .tncfb-pdf-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    white-space: nowrap;
    flex-shrink: 0;
}
.tncfb-multi-pdf-name {
    width: 200px;
    max-width: 100%;
    flex-shrink: 1;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid #e8e8eb;
    border-radius: 4px;
    background: #fafafa;
    color: #50575e;
    transition: all 0.15s;
}
.tncfb-multi-pdf-name:focus {
    border-color: #2271b1;
    background: #fff;
    color: #1d2327;
    outline: none;
}
/* Override base repeater row for multi-pdf */
.tncfb-multi-pdf-row.tncfb-repeater-row {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
}

/* ── Hotspot conditional ───────────────────────────────────── */
.tncfb-hotspot-action-fields { display: none; }
.tncfb-hotspot-action-fields.tncfb-visible { display: contents; }
.tncfb-hotspot-row .tncfb-hotspot-fields {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
/* Action select: auto-width, not full-width */
.tncfb-hotspot-row > label.tncfb-full-width select {
    width: auto;
    min-width: 180px;
}

/* ── Settings page ─────────────────────────────────────────── */
.tncfb-settings-wrap { max-width: 960px; }
.tncfb-settings-wrap > h1 {
    display: flex;
    align-items: center;
    font-size: 22px;
    margin-bottom: var(--tncfb-spacing-sm);
}
.tncfb-settings-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--tncfb-border);
    margin-bottom: var(--tncfb-spacing-lg);
}
.tncfb-settings-nav-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tncfb-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--tncfb-transition), border-color var(--tncfb-transition);
}
.tncfb-settings-nav-btn:hover { color: var(--tncfb-primary); }
.tncfb-settings-nav-btn.is-active {
    color: var(--tncfb-primary);
    border-bottom-color: var(--tncfb-primary);
    font-weight: 600;
}
.tncfb-settings-section { display: none; }
.tncfb-settings-section.is-active { display: block; }
.tncfb-settings-section table.form-table { border-spacing: 0; }
.tncfb-settings-section table.form-table th {
    width: 260px;
    padding: 16px 10px 16px 0;
    font-weight: 500;
    color: var(--tncfb-text);
    vertical-align: top;
}
.tncfb-settings-section table.form-table td {
    padding: 14px 10px;
}
.tncfb-settings-section table.form-table tr {
    border-bottom: 1px solid var(--tncfb-border-light);
}
.tncfb-settings-section table.form-table tr:last-child {
    border-bottom: none;
}

/* ── Settings page modern form fields ──────────────────────── */

/* Inputs & number fields */
.tncfb-settings-section input[type="text"],
.tncfb-settings-section input[type="number"],
.tncfb-settings-section input[type="password"],
.tncfb-settings-section input[type="url"],
.tncfb-settings-section input[type="email"],
.tnc-flipbook-admin input[type="text"],
.tnc-flipbook-admin input[type="number"],
.tnc-flipbook-admin input[type="password"],
.tnc-flipbook-admin input[type="url"],
.tnc-flipbook-admin input[type="email"],
.tnc-flipbook-admin textarea {
    border: 1px solid var(--tncfb-border);
    border-radius: var(--tncfb-radius-sm);
    padding: 6px 8px;
    font-size: 13px;
    color: var(--tncfb-text);
    background: #fff;
    transition: border-color var(--tncfb-transition), box-shadow var(--tncfb-transition);
    line-height: 1.4;
}
/* Larger padding for settings page inputs */
.tncfb-settings-section input[type="text"],
.tncfb-settings-section input[type="number"],
.tncfb-settings-section input[type="password"],
.tncfb-settings-section input[type="url"],
.tncfb-settings-section input[type="email"] {
    padding: 8px 12px;
}
.tncfb-settings-section input[type="text"]:focus,
.tncfb-settings-section input[type="number"]:focus,
.tncfb-settings-section input[type="password"]:focus,
.tncfb-settings-section input[type="url"]:focus,
.tncfb-settings-section input[type="email"]:focus,
.tnc-flipbook-admin input[type="text"]:focus,
.tnc-flipbook-admin input[type="number"]:focus,
.tnc-flipbook-admin input[type="password"]:focus,
.tnc-flipbook-admin input[type="url"]:focus,
.tnc-flipbook-admin input[type="email"]:focus,
.tnc-flipbook-admin textarea:focus {
    border-color: var(--tncfb-primary);
    box-shadow: 0 0 0 1px var(--tncfb-primary);
    outline: none;
}
.tncfb-settings-section select,
.tnc-flipbook-admin select {
    border: 1px solid var(--tncfb-border);
    border-radius: var(--tncfb-radius-sm);
    padding: 8px 32px 8px 12px;
    font-size: 13px;
    color: var(--tncfb-text);
    background: #fff url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23646970%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22%2F%3E%3C%2Fsvg%3E') no-repeat right 8px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--tncfb-transition), box-shadow var(--tncfb-transition);
    line-height: 1.4;
    min-height: 36px;
}
.tncfb-settings-section select:focus,
.tnc-flipbook-admin select:focus {
    border-color: var(--tncfb-primary);
    box-shadow: 0 0 0 1px var(--tncfb-primary);
    outline: none;
}
.tncfb-settings-section select:disabled,
.tnc-flipbook-admin select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f6f7f7;
}
.tncfb-settings-section input.small-text,
.tnc-flipbook-admin input.small-text {
    width: 100px;
    padding: 6px 12px;
}
.tncfb-settings-section .description,
.tncfb-settings-section .form-table td { font-size: 13px; }
.tncfb-settings-section .form-table th { font-size: 13px; }

/* Select dropdowns */
.tncfb-settings-section select,
.tnc-flipbook-admin select {
    border: 1px solid var(--tncfb-border);
    border-radius: var(--tncfb-radius-sm);
    padding: 6px 28px 6px 8px;
    font-size: 13px;
    color: var(--tncfb-text);
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23787c82" d="M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z"/></svg>') no-repeat right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color var(--tncfb-transition), box-shadow var(--tncfb-transition);
    line-height: 1.4;
}
.tncfb-settings-section select {
    padding: 8px 32px 8px 12px;
    min-width: 200px;
    background-position: right 10px center;
}
.tncfb-settings-section select:focus,
.tnc-flipbook-admin select:focus {
    border-color: var(--tncfb-primary);
    box-shadow: 0 0 0 1px var(--tncfb-primary);
    outline: none;
}
.tncfb-override-body select {
    min-width: 0;
    width: 100%;
}

/* Custom checkbox toggle */
.tncfb-settings-section input[type="checkbox"],
.tnc-flipbook-admin input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--tncfb-border);
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    margin: 0 6px 0 0;
    transition: background var(--tncfb-transition), border-color var(--tncfb-transition);
    flex-shrink: 0;
}
.tncfb-settings-section input[type="checkbox"]:checked,
.tnc-flipbook-admin input[type="checkbox"]:checked {
    background: var(--tncfb-primary);
    border-color: var(--tncfb-primary);
}
.tncfb-settings-section input[type="checkbox"]:checked::after,
.tnc-flipbook-admin input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 3.5px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}
.tncfb-settings-section input[type="checkbox"]:focus,
.tnc-flipbook-admin input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
    outline: none;
}
/* Hide radio buttons — selection shown via card/tab wrapper */
.tncfb-settings-section input[type="radio"],
.tnc-flipbook-admin input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}
.tncfb-settings-section label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: var(--tncfb-text);
}

/* Description text */
.tncfb-settings-section .description,
.tnc-flipbook-admin .tncfb-field-desc {
    font-size: 13px;
    color: var(--tncfb-text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* ── Buttons refinement ────────────────────────────────────── */
.tnc-flipbook-admin .button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--tncfb-radius-sm);
    font-size: 13px;
    line-height: 1.5;
    transition: all var(--tncfb-transition);
}
.tnc-flipbook-admin .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.tnc-flipbook-admin .button-primary {
    border-radius: var(--tncfb-radius-sm);
}

/* ── Multi-PDF add button spacing fix ──────────────────────── */
#tncfb-add-pdf-btn,
#tncfb-add-images-btn {
    margin-top: var(--tncfb-spacing-xs);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 782px) {
    .tncfb-tab-btn {
        padding: 10px 14px 8px;
        font-size: 13px;
    }
    .tncfb-tab-panel {
        padding: var(--tncfb-spacing-md);
    }
    .tncfb-source-cards {
        grid-template-columns: 1fr;
    }
    .tncfb-toolbar-items {
        grid-template-columns: 1fr;
    }
    .tncfb-accordion-body {
        padding: var(--tncfb-spacing-md);
    }
    .tncfb-settings-section table.form-table th {
        width: auto;
        display: block;
        padding-bottom: 4px;
    }
    .tncfb-settings-section table.form-table td {
        display: block;
        padding-top: 0;
    }
}

/* ── Secret field with inline eye toggle ───────────────────────── */
.tncfb-secret-wrap {
    position: relative;
    display: inline-block;
}
.tncfb-secret-wrap input.regular-text {
    padding-right: 36px;
}
.tncfb-eye-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #787c82;
    line-height: 1;
    display: flex;
    align-items: center;
}
.tncfb-eye-toggle:hover {
    color: #2271b1;
}
.tncfb-eye-toggle svg {
    width: 14px;
    height: 14px;
}
.tncfb-eye-toggle .is-hidden {
    display: none;
}

/* ── Pill buttons (modern inline actions) ─────────────────────────────── */
.tncfb-btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid #c3c4c7;
    border-radius: var(--tncfb-radius);
    background: #fff;
    color: #2c3338;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tncfb-btn-pill:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #1d2327;
}
.tncfb-btn-pill:active {
    background: #dcdcde;
}
.tncfb-btn-pill--danger {
    padding: 4px 8px;
    color: #8b8e94;
    border-color: #dcdcde;
}
.tncfb-btn-pill--danger:hover {
    color: #d63638;
    border-color: #d63638;
    background: #fcf0f0;
}
.tncfb-btn-pill--danger:active {
    background: #f5d5d5;
}

/* ── CodeMirror (Custom CSS editor) ───────────────────────────────── */
.tnc-flipbook-admin .CodeMirror {
    border: 1px solid #dcdcde;
    border-radius: var(--tncfb-radius, 8px);
    font-size: 13px;
    line-height: 1.6;
}
.tnc-flipbook-admin .CodeMirror .CodeMirror-gutter-wrapper {
    left: -40px !important;
}
.tnc-flipbook-admin .CodeMirror .CodeMirror-sizer {
    margin-left: 40px !important;
}
.tnc-flipbook-admin .CodeMirror .CodeMirror-gutters {
    width: 40px !important;
    border-right: 1px solid #eee;
}
.tnc-flipbook-admin .CodeMirror .CodeMirror-linenumber {
    width: 28px !important;
    padding: 0 4px;
    text-align: right;
}
.tnc-flipbook-admin .tncfb-accordion-body .CodeMirror,
.tnc-flipbook-admin .form-table .CodeMirror {
    margin-top: 4px;
}

/* ── Tooltips ──────────────────────────────────────────────── */
.tncfb-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    cursor: help;
    vertical-align: middle;
    color: var(--tncfb-text-light);
    transition: color var(--tncfb-transition);
    outline: none;
}
.tncfb-tip:hover,
.tncfb-tip:focus {
    color: var(--tncfb-primary);
}
.tncfb-tip-icon {
    flex-shrink: 0;
}
.tncfb-tip-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: -8px;
    width: 280px;
    padding: 12px 14px;
    background: #1d2327;
    color: #f0f0f1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.1);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
    z-index: 100000;
    pointer-events: auto;
}
.tncfb-tip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 16px;
    border: 6px solid transparent;
    border-top-color: #1d2327;
}
.tncfb-tip:hover .tncfb-tip-popup,
.tncfb-tip:focus .tncfb-tip-popup,
.tncfb-tip:focus-within .tncfb-tip-popup {
    display: block;
}
.tncfb-tip-text {
    display: block;
    margin-bottom: 8px;
}
.tncfb-tip-link {
    display: inline-block;
    color: #72aee6;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}
.tncfb-tip-link:hover {
    color: #a0d2ff;
    text-decoration: underline;
}
/* Flip popup above/below depending on viewport position */
.tncfb-tip-popup--below {
    bottom: auto;
    top: calc(100% + 8px);
}
.tncfb-tip-popup--below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1d2327;
}
/* Inside accordion headers - adjust positioning */
.tncfb-accordion-header .tncfb-tip {
    margin-left: 8px;
}
/* Lift accordion item above siblings when tooltip is active */
.tncfb-accordion-item:has(.tncfb-tip:hover),
.tncfb-accordion-item:has(.tncfb-tip:focus),
.tncfb-accordion-item:has(.tncfb-tip:focus-within) {
    z-index: 10;
    position: relative;
}
/* Also handle table rows inside settings sections */
.form-table tr:has(.tncfb-tip:hover),
.form-table tr:has(.tncfb-tip:focus) {
    position: relative;
    z-index: 10;
}
/* Prevent tooltip from overflowing left/right */
@media (max-width: 782px) {
    .tncfb-tip-popup {
        width: 220px;
        left: auto;
        right: -8px;
        transform: none;
    }
    .tncfb-tip-popup::after {
        left: auto;
        right: 12px;
        transform: none;
    }
}

/* ── Searchable Select ──────────────────────────────────────────── */
.tncfb-searchable-wrap {
    position: relative;
    display: inline-block;
    min-width: 280px;
    max-width: 100%;
}
.tncfb-searchable-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    height: 36px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #2c3338;
    transition: border-color 0.15s;
}
.tncfb-searchable-display:hover {
    border-color: #2271b1;
}
.tncfb-searchable-open .tncfb-searchable-display {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}
.tncfb-searchable-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tncfb-searchable-arrow {
    flex-shrink: 0;
    color: #8c8f94;
    transition: transform 0.2s;
}
.tncfb-searchable-open .tncfb-searchable-arrow {
    transform: rotate(180deg);
}
.tncfb-searchable-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 320px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100000;
    overflow: hidden;
}
.tncfb-searchable-open .tncfb-searchable-dropdown {
    display: block;
}
.tncfb-searchable-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #dcdcde;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    background: #f9f9f9;
}
.tncfb-searchable-input:focus {
    background: #fff;
    box-shadow: none;
}
.tncfb-searchable-list {
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.tncfb-searchable-group {
    padding: 6px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f6f7f7;
    border-top: 1px solid #f0f0f1;
    position: sticky;
    top: 0;
}
.tncfb-searchable-item {
    padding: 7px 12px;
    font-size: 13px;
    color: #2c3338;
    cursor: pointer;
    transition: background 0.1s;
}
.tncfb-searchable-item:hover,
.tncfb-searchable-item.tncfb-searchable-hover {
    background: #f0f6fc;
    color: #2271b1;
}
.tncfb-searchable-item.tncfb-searchable-selected {
    background: #2271b1;
    color: #fff;
    font-weight: 500;
}
.tncfb-searchable-item.tncfb-searchable-selected:hover,
.tncfb-searchable-item.tncfb-searchable-selected.tncfb-searchable-hover {
    background: #135e96;
    color: #fff;
}
.tncfb-searchable-disabled .tncfb-searchable-display {
    opacity: 0.5;
    pointer-events: none;
    background: #f0f0f1;
}
.tncfb-searchable-empty,
.tncfb-searchable-more {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: #8c8f94;
    font-style: italic;
}

/* ──────────────────────────────────────────────────────────────────────────
   Flipbook list table — scoped to the FlipBook CPT list screen only
   so it never bleeds onto other post types or generic admin tables.
   ────────────────────────────────────────────────────────────────────────── */
body.post-type-flipbook.edit-php #wpbody-content > .wrap { max-width: 1280px; }

body.post-type-flipbook.edit-php .wp-list-table.posts {
    background: #fff;
    border: 1px solid #e8e8eb;
    border-radius: 8px;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: none;
    overflow: hidden;
}

/* Header */
body.post-type-flipbook.edit-php .wp-list-table.posts thead th,
body.post-type-flipbook.edit-php .wp-list-table.posts tfoot th {
    background: transparent;
    border-bottom: 1px solid #e8e8eb;
    border-top: none;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 14px;
}
body.post-type-flipbook.edit-php .wp-list-table.posts thead th a,
body.post-type-flipbook.edit-php .wp-list-table.posts tfoot th a {
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
body.post-type-flipbook.edit-php .wp-list-table.posts thead th a .sorting-indicators,
body.post-type-flipbook.edit-php .wp-list-table.posts tfoot th a .sorting-indicators {
    display: inline-flex;
    flex-direction: column;
    margin-left: 2px;
}
body.post-type-flipbook.edit-php .wp-list-table.posts thead th.sorted a,
body.post-type-flipbook.edit-php .wp-list-table.posts tfoot th.sorted a {
    color: #2271b1;
}
body.post-type-flipbook.edit-php .wp-list-table.posts tfoot th {
    border-top: 1px solid #e8e8eb;
    border-bottom: none;
}

/* Rows */
body.post-type-flipbook.edit-php .wp-list-table.posts tbody td {
    padding: 14px;
    font-size: 13px;
    color: #1d2327;
    border-bottom: 1px solid #f5f5f5;
    background: transparent;
    vertical-align: middle;
}
body.post-type-flipbook.edit-php .wp-list-table.posts tbody tr:last-child td {
    border-bottom: none;
}
body.post-type-flipbook.edit-php .wp-list-table.posts.striped > tbody > :nth-child(odd) {
    background: transparent;
}
body.post-type-flipbook.edit-php .wp-list-table.posts tbody tr:hover {
    background: #fafbfc;
}

/* Title column */
body.post-type-flipbook.edit-php .wp-list-table.posts .row-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    text-decoration: none;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .row-title:hover {
    color: #2271b1;
}

/* Row actions — softer color, smaller */
body.post-type-flipbook.edit-php .wp-list-table.posts .row-actions {
    font-size: 13px;
    color: #9ca3af;
    padding-top: 4px;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .row-actions a {
    color: #6b7280;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .row-actions a:hover {
    color: #2271b1;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .row-actions .trash a:hover {
    color: #d63638;
}

/* Checkbox column */
body.post-type-flipbook.edit-php .wp-list-table.posts .check-column {
    padding-left: 16px;
}

/* Author / date columns muted */
body.post-type-flipbook.edit-php .wp-list-table.posts .column-author,
body.post-type-flipbook.edit-php .wp-list-table.posts .column-date {
    color: #6b7280;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .column-author a {
    color: #6b7280;
}

/* Status indicators (post-state, sticky, etc.) */
body.post-type-flipbook.edit-php .wp-list-table.posts .post-state {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    color: #b54708;
    background: #fef0c7;
    border: 1px solid #fec84b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .post-state::before {
    content: none;
}

/* Search box, view links, top tablenav — tighter spacing */
body.post-type-flipbook.edit-php .tablenav {
    padding: 12px 0;
}
body.post-type-flipbook.edit-php .subsubsub {
    font-size: 13px;
    margin: 8px 0 14px;
}

/* Pagination */
body.post-type-flipbook.edit-php .tablenav-pages .page-numbers,
body.post-type-flipbook.edit-php .tablenav-pages a.button,
body.post-type-flipbook.edit-php .tablenav-pages span.button {
    border-radius: 6px;
}

/* Thumbnail column — compact, fixed width, no oversized rows */
body.post-type-flipbook.edit-php .wp-list-table.posts th.column-thumbnail,
body.post-type-flipbook.edit-php .wp-list-table.posts td.column-thumbnail {
    width: 56px;
    padding: 8px 0 8px 14px;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .tncfb-list-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 44px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #fff;
    object-fit: cover;
    overflow: hidden;
    vertical-align: middle;
}
body.post-type-flipbook.edit-php .wp-list-table.posts .tncfb-list-thumb--empty {
    background: #f6f7f9;
    color: #9ca3af;
}

/* Title column — give it more breathing room so titles don't break awkwardly */
body.post-type-flipbook.edit-php .wp-list-table.posts th.column-title,
body.post-type-flipbook.edit-php .wp-list-table.posts td.column-title {
    width: 22%;
    min-width: 220px;
}
body.post-type-flipbook.edit-php .wp-list-table.posts td.column-title .row-title {
    word-break: normal;
    overflow-wrap: anywhere;
}


/* Moved from inline <style> for WordPress.org (enqueue) */
.column-shortcode { width: 300px; }
            .column-source_type { width: 120px; }
            .column-page_count { width: 60px; }
            .tncfb-copy-code { font-size: 11px; user-select: all; }
            .tncfb-copy-btn { margin-left: 6px; vertical-align: middle; }


/* Moved from inline <style> for WordPress.org (enqueue) */
.tncfb-welcome { max-width: 960px; }

/* Header */
.tncfb-welcome-header {
    display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
    padding-bottom: 20px; border-bottom: 1px solid #e8e8eb;
}
.tncfb-welcome-logo {
    width: 44px; height: 44px; background: linear-gradient(135deg, #2271b1, #135e96);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(34,113,177,0.2);
}
.tncfb-welcome-title { font-size: 21px; font-weight: 700; color: #1d2327; margin: 0; }
.tncfb-welcome-subtitle { font-size: 13px; color: #9ca3af; margin: 2px 0 0; }
.tncfb-welcome-version {
    font-size: 10px; font-weight: 600; color: #2271b1; background: #f0f6fc;
    padding: 2px 7px; border-radius: 4px; border: 1px solid #c2d9f0;
    vertical-align: middle; margin-left: 6px;
}

/* Hero */
.tncfb-welcome-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    background: #fff; border: 1px solid #e8e8eb; border-radius: 8px;
    padding: 28px 32px; margin-bottom: 24px;
}
.tncfb-welcome-hero-content { flex: 1; min-width: 0; }
.tncfb-welcome-hero-content h2 {
    font-size: 16px; font-weight: 600; color: #1d2327; margin: 0 0 6px;
}
.tncfb-welcome-hero-content p {
    font-size: 13px; color: #9ca3af; margin: 0 0 16px; line-height: 1.5;
}
.tncfb-welcome-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tncfb-welcome-btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; font-size: 13px; font-weight: 600;
    background: #2271b1; color: #fff;
    border-radius: 6px; text-decoration: none; transition: background 0.15s;
}
.tncfb-welcome-btn-primary:hover { color: #fff; background: #135e96; }
.tncfb-welcome-btn-secondary {
    display: inline-flex; align-items: center;
    padding: 9px 14px; font-size: 13px; font-weight: 500;
    color: #50575e; text-decoration: none; transition: color 0.1s;
}
.tncfb-welcome-btn-secondary:hover { color: #2271b1; }
.tncfb-welcome-hero-stats {
    display: flex; gap: 0; flex-shrink: 0;
    border: 1px solid #e8e8eb; border-radius: 8px; overflow: hidden;
}
.tncfb-welcome-stat {
    text-align: center; padding: 14px 20px;
    border-right: 1px solid #f0f0f1;
}
.tncfb-welcome-stat:last-child { border-right: none; }
.tncfb-welcome-stat-num { display: block; font-size: 20px; font-weight: 700; color: #1d2327; line-height: 1.2; }
.tncfb-welcome-stat-label { display: block; font-size: 12px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 3px; }
@media (max-width: 700px) {
    .tncfb-welcome-hero { flex-direction: column; }
    .tncfb-welcome-hero-stats { align-self: stretch; }
    .tncfb-welcome-stat { flex: 1; }
}

/* Grid */
.tncfb-welcome-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }
@media (max-width: 860px) { .tncfb-welcome-grid { grid-template-columns: 1fr; } }

/* Cards */
.tncfb-welcome-card {
    background: #fff; border: 1px solid #e8e8eb; border-radius: 8px; overflow: hidden;
}
.tncfb-welcome-card-header {
    display: flex; align-items: center; gap: 8px; padding: 14px 20px;
    font-size: 12px; font-weight: 600; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.4px;
    border-bottom: 1px solid #f0f0f1;
}
.tncfb-welcome-card-header svg { opacity: 0.5; flex-shrink: 0; }
.tncfb-welcome-card-body { padding: 18px 20px; }

/* Blog posts */
.tncfb-welcome-posts { list-style: none; margin: 0; padding: 0; }
.tncfb-welcome-posts li { padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.tncfb-welcome-posts li:last-child { border-bottom: none; padding-bottom: 0; }
.tncfb-welcome-posts a {
    font-size: 13px; font-weight: 500; color: #1d2327; text-decoration: none;
    display: block; line-height: 1.5;
}
.tncfb-welcome-posts a:hover { color: #2271b1; }
.tncfb-welcome-posts .tncfb-post-date { font-size: 13px; color: #9ca3af; margin-top: 3px; display: block; }

/* Quick links */
.tncfb-welcome-links { display: flex; flex-direction: column; gap: 6px; }
.tncfb-welcome-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border-radius: 6px; text-decoration: none; color: #1d2327; transition: background 0.1s;
}
.tncfb-welcome-link:hover { background: #f0f6fc; color: #1d2327; }
.tncfb-welcome-link svg { color: #2271b1; flex-shrink: 0; opacity: 0.7; }
.tncfb-welcome-link:hover svg { opacity: 1; }
.tncfb-welcome-link strong { display: block; font-size: 13px; font-weight: 500; line-height: 1.4; }
.tncfb-welcome-link small { display: block; font-size: 11px; color: #9ca3af; line-height: 1.3; margin-top: 1px; }

/* Newsletter */
.tncfb-welcome-newsletter { grid-column: 1 / -1; margin-top: 4px; }
.tncfb-welcome-newsletter .tncfb-welcome-card-body {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.tncfb-newsletter-form {
    display: flex; gap: 0; align-items: stretch;
    border: 1px solid #dcdcde; border-radius: 6px; overflow: hidden; background: #fff;
}
.tncfb-newsletter-form input[type="email"] {
    width: 260px; padding: 9px 12px; font-size: 13px;
    border: none; outline: none; background: transparent;
}
.tncfb-newsletter-form input[type="email"]::-webkit-credentials-auto-fill-button,
.tncfb-newsletter-form input[type="email"]::-webkit-contacts-auto-fill-button { display: none !important; }
.tncfb-newsletter-form [data-lastpass-icon-root] { display: none !important; }
.tncfb-newsletter-form button {
    padding: 9px 18px; font-size: 13px; font-weight: 600;
    background: #2271b1; color: #fff;
    border: none; cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.tncfb-newsletter-form button:hover { background: #135e96; }
.tncfb-newsletter-desc { font-size: 13px; color: #9ca3af; margin: 0; flex: 1; min-width: 200px; }

/* FAQ */
.tncfb-welcome-faq { grid-column: 1 / -1; margin-top: 4px; }
.tncfb-faq-list { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 700px) { .tncfb-faq-list { grid-template-columns: 1fr; } }
.tncfb-faq-item { border-bottom: 1px solid #f0f0f1; }
.tncfb-faq-item summary {
    padding: 14px 0; font-size: 13px; font-weight: 500; color: #1d2327;
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
}
.tncfb-faq-item summary::-webkit-details-marker { display: none; }
.tncfb-faq-item summary::before {
    content: ''; width: 16px; height: 16px; flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center;
    transition: transform 0.2s;
}
.tncfb-faq-item[open] summary::before { transform: rotate(180deg); }
.tncfb-faq-item[open] summary { color: #2271b1; }
.tncfb-faq-item p {
    margin: 0 0 14px 24px; font-size: 13px; color: #6b7280; line-height: 1.6;
}


/* Moved from inline <style> for WordPress.org (enqueue) */
.tncfb-ideas-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:24px}
            .tncfb-ideas-title{display:flex;align-items:center;gap:10px;font-size:22px;font-weight:700;color:#1d2327;margin:0}
            .tncfb-ideas-btn{display:inline-flex;align-items:center;gap:7px;padding:10px 22px;border-radius:6px;font-size:13px;font-weight:600;text-decoration:none;transition:all .15s}
            .tncfb-ideas-btn-primary{background:linear-gradient(135deg,#2271b1,#135e96);color:#fff;box-shadow:0 2px 6px rgba(34,113,177,.25)}
            .tncfb-ideas-btn-primary:hover{color:#fff;box-shadow:0 4px 12px rgba(34,113,177,.35);transform:translateY(-1px)}
            .tncfb-ideas-btn-outline{background:#fff;color:#2271b1;border:1.5px solid #c2d9f0;padding:8px 16px;font-size:12px}
            .tncfb-ideas-btn-outline:hover{color:#2271b1;background:#f0f6fc;border-color:#2271b1}
            .tncfb-ideas-stats{display:flex;gap:14px;margin-bottom:24px;flex-wrap:wrap}
            .tncfb-ideas-stat{background:#fff;border:1px solid #e8e8eb;border-radius:8px;padding:16px 22px;min-width:90px;text-align:center}
            .tncfb-ideas-stat-num{font-size:24px;font-weight:700;color:#1d2327;display:block;line-height:1.2}
            .tncfb-ideas-stat-label{font-size:10px;color:#6b7280;text-transform:uppercase;letter-spacing:.4px;margin-top:4px;display:block}
            .tncfb-ideas-list{background:#fff;border:1px solid #e8e8eb;border-radius:8px;overflow:hidden;margin-bottom:20px}
            .tncfb-ideas-section-hd{padding:12px 20px;background:#f6f7f7;border-bottom:1px solid #e8e8eb;display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#1d2327}
            .tncfb-ideas-section-hd:not(:first-child){border-top:1px solid #e8e8eb}
            .tncfb-idea-row{display:flex;align-items:center;gap:16px;padding:16px 20px;border-bottom:1px solid #f0f0f1;transition:background .1s}
            .tncfb-idea-row:last-child{border-bottom:none}
            .tncfb-idea-row:hover{background:#f9fbfd}
            .tncfb-idea-votes{display:flex;flex-direction:column;align-items:center;min-width:46px;padding:8px 10px;border:1.5px solid #e8e8eb;border-radius:8px;background:#fafafa;flex-shrink:0}
            .tncfb-idea-votes b{font-size:16px;line-height:1;color:#1d2327}
            .tncfb-idea-votes small{font-size:8px;color:#9ca3af;text-transform:uppercase;letter-spacing:.3px;margin-top:2px}
            .tncfb-idea-body{flex:1;min-width:0}
            .tncfb-idea-body a{font-size:14px;font-weight:600;color:#1d2327;text-decoration:none}
            .tncfb-idea-body a:hover{color:#2271b1}
            .tncfb-idea-desc{font-size:12px;color:#6b7280;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:500px}
            .tncfb-idea-badge{font-size:9px;font-weight:600;padding:3px 8px;border-radius:9px;color:#fff;white-space:nowrap}
            .tncfb-idea-comments{font-size:11px;color:#9ca3af;display:flex;align-items:center;gap:3px}
            .tncfb-ideas-empty{padding:48px;text-align:center;color:#9ca3af}
