/**
 * TamRank Schema Builder — Admin Page Styles
 *
 * All values use CSS custom properties from common/variables.css.
 * Only schema-specific additions are defined in the :root block below.
 */

/* ── Schema-specific tokens (not in variables.css) ── */
:root {
    --tr-color-primary-medium: rgba(16, 185, 129, 0.20);
    --tr-shadow-primary: 0 4px 16px rgba(16, 185, 129, 0.30);
}

/* ══════════════════════════════════════════════════════
   1. Page Layout & Header
   ══════════════════════════════════════════════════════ */
/* Layout via .tr-page-wrap in tamrank-admin-global.css */

.tr-schema-header {
    margin-bottom: var(--tr-space-6);
}

.tr-schema-title {
    font-size: var(--tr-text-xl);
    font-weight: var(--tr-font-bold);
    color: var(--tr-color-slate-900);
    margin: 0 0 var(--tr-space-1);
}

.tr-schema-subtitle {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
    margin: 0;
}

/* ══════════════════════════════════════════════════════
   2. Tab Navigation — uses shared .tr-pill-nav + .tr-pill + .tr-tab-panel from common/tabs.css
   ══════════════════════════════════════════════════════ */

.tr-schema-wrap .tr-pill-nav {
    margin-bottom: var(--tr-space-6);
}

/* ══════════════════════════════════════════════════════
   3. Cards (general)
   ══════════════════════════════════════════════════════ */
.tr-card {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    box-shadow: var(--tr-shadow-md);
    padding: var(--tr-space-5);
}

.tr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--tr-space-4);
}

.tr-card-title {
    font-size: var(--tr-text-base);
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-slate-800);
    margin: 0;
}

.tr-card-subtitle {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
    margin: var(--tr-space-1) 0 0;
}

/* ══════════════════════════════════════════════════════
   4. Stats Grid (Overzicht tab)
   ══════════════════════════════════════════════════════ */
.tr-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--tr-space-4);
    margin-bottom: var(--tr-space-4);
}

.tr-stat-card {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    box-shadow: var(--tr-shadow-md);
    padding: var(--tr-space-5);
}

.tr-stat-number {
    font-size: var(--tr-text-3xl);
    font-weight: var(--tr-font-extrabold);
    color: var(--tr-color-slate-800);
    line-height: 1;
    margin-bottom: 6px;
}

.tr-stat-number.is-primary {
    color: var(--tr-color-primary);
}

.tr-stat-label {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
    color: var(--tr-color-slate-500);
}

.tr-stat-meta {
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-400);
    margin-top: 2px;
}

/* ── Test URL Card ── */
.tr-test-url-card {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    box-shadow: var(--tr-shadow-md);
    padding: var(--tr-space-5);
}

.tr-test-url-label {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-slate-800);
    margin-bottom: var(--tr-space-2);
}

.tr-test-url-row {
    display: flex;
    gap: var(--tr-space-2);
}

/* Descendant selector (.tr-test-url-row .tr-test-url-input) zodat deze regels
   winnen van WordPress' eigen input[type=url]-styling (anders kleurt WP de rand
   medium-grijs i.p.v. de lichte plugin-rand). De var heeft een fallback zodat de
   border nooit op currentColor (donkere tekstkleur) terugvalt. */
.tr-test-url-row .tr-test-url-input {
    flex: 1;
    padding: var(--tr-space-2) var(--tr-space-3);
    border: 2px solid var(--tr-color-surface, #ECEAE7);
    border-radius: var(--tr-radius-md);
    background: var(--tr-color-white);
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-800);
    font-family: inherit;
}

.tr-test-url-row .tr-test-url-input:focus {
    outline: none;
    border-color: var(--tr-color-primary);
    box-shadow: var(--tr-shadow-focus);
}

.tr-test-url-row .tr-test-url-input::placeholder {
    color: var(--tr-color-slate-400);
}

/* ══════════════════════════════════════════════════════
   5. Tables
   ══════════════════════════════════════════════════════ */
.tr-table-wrap {
    overflow-x: auto;
}

.tr-table {
    width: 100%;
    border-collapse: collapse;
}

.tr-table th {
    font-size: var(--tr-text-xs);
    font-weight: var(--tr-font-semibold);
    text-transform: uppercase;
    color: var(--tr-color-slate-500);
    padding: 10px var(--tr-space-4);
    border-bottom: 1px solid var(--tr-color-surface);
    text-align: left;
}

.tr-table td {
    padding: 14px var(--tr-space-4);
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-800);
    border-bottom: 1px solid var(--tr-color-surface);
    vertical-align: middle;
}

.tr-table tr:nth-child(even) td {
    background: var(--tr-color-base);
}

.tr-table tr:last-child td {
    border-bottom: none;
}

/* Page name + type in table */
.tr-table-page-name {
    font-weight: var(--tr-font-medium);
    color: var(--tr-color-slate-800);
}

.tr-table-page-type {
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-400);
    margin-top: 2px;
}

/* Status cell */
.tr-status-active {
    color: var(--tr-color-primary);
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
}

.tr-status-active::before {
    content: '\2713\0020';
}

.tr-status-disabled {
    color: var(--tr-color-error);
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
}

/* Schema type pills */
.tr-schema-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tr-space-1);
    align-items: center;
}

.tr-schema-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--tr-space-2);
    background: var(--tr-color-primary-light);
    color: var(--tr-color-primary);
    font-size: 11px;
    font-weight: var(--tr-font-medium);
    border-radius: var(--tr-radius-sm);
}

.tr-schema-pill-auto {
    font-size: 11px;
    color: var(--tr-color-slate-400);
    margin-left: 2px;
}

/* Post type pills (neutral) */
.tr-post-pill {
    display: inline-flex;
    padding: 2px var(--tr-space-2);
    background: var(--tr-color-surface);
    color: var(--tr-color-slate-600);
    font-size: 11px;
    font-weight: var(--tr-font-medium);
    border-radius: var(--tr-radius-sm);
}

/* Action buttons */
.tr-action-link {
    color: var(--tr-color-primary);
    text-decoration: none;
    font-size: var(--tr-text-base);
}

.tr-action-link:hover {
    color: var(--tr-color-primary-hover);
}

.tr-action-icon-edit {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tr-color-slate-500);
    padding: var(--tr-space-1);
    font-size: var(--tr-text-base);
    transition: color var(--tr-transition-fast);
}

.tr-action-icon-edit:hover {
    color: var(--tr-color-slate-800);
}

.tr-action-icon-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tr-color-error);
    padding: var(--tr-space-1);
    font-size: var(--tr-text-base);
    transition: opacity var(--tr-transition-fast);
}

.tr-action-icon-delete:hover {
    opacity: 0.7;
}

/* Row fade-out on delete */
@keyframes tr-row-fade-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(16px); }
}

.tr-table tr.is-removing td {
    animation: tr-row-fade-out 0.25s ease forwards;
}

/* Empty state */
.tr-table-empty {
    text-align: center;
    padding: var(--tr-space-8);
    color: var(--tr-color-slate-400);
}

/* ══════════════════════════════════════════════════════
   6. Buttons — verplaatst naar common/buttons.css
   (BEM: .tr-btn--primary, .tr-btn--ghost, .tr-btn--secondary)
   ══════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════
   7. Info Banner
   ══════════════════════════════════════════════════════ */
.tr-info-banner {
    background: var(--tr-color-surface);
    border-radius: var(--tr-radius-md);
    padding: 14px var(--tr-space-4);
    margin-top: var(--tr-space-4);
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
}

/* ══════════════════════════════════════════════════════
   8. Two-step Wizard
   ══════════════════════════════════════════════════════ */

/* Back link */
.tr-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tr-color-slate-500);
    font-size: var(--tr-text-sm);
    text-decoration: none;
    margin-bottom: var(--tr-space-4);
}

.tr-back-link:hover {
    color: var(--tr-color-slate-800);
}

/* Step indicator */
.tr-steps {
    display: flex;
    align-items: center;
    gap: var(--tr-space-3);
    padding: var(--tr-space-5);
    border-bottom: 1px solid var(--tr-color-surface);
    margin-bottom: var(--tr-space-6);
}

.tr-step {
    display: flex;
    align-items: center;
    gap: var(--tr-space-2);
}

.tr-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
    flex-shrink: 0;
}

.tr-step-circle.is-active {
    background: var(--tr-color-primary);
    color: var(--tr-color-white);
}

.tr-step-circle.is-done {
    background: var(--tr-color-primary);
    color: var(--tr-color-white);
}

.tr-step-circle.is-inactive {
    background: var(--tr-color-surface);
    color: var(--tr-color-slate-400);
}

.tr-step-label {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-slate-800);
}

.tr-step-label.is-inactive {
    color: var(--tr-color-slate-400);
    font-weight: var(--tr-font-regular);
}

.tr-step-connector {
    flex: 1;
    height: 1px;
    background: var(--tr-color-surface);
}

.tr-step-connector.is-done {
    background: var(--tr-color-primary);
}

/* ══════════════════════════════════════════════════════
   9. Schema Type Selection Cards (wizard step 1)
   ══════════════════════════════════════════════════════ */
.tr-schema-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tr-space-3);
    margin-bottom: var(--tr-space-6);
}

.tr-schema-type-card {
    border: 2px solid var(--tr-color-surface);
    border-radius: var(--tr-radius-lg);
    padding: var(--tr-space-4);
    cursor: pointer;
    transition: all var(--tr-transition-fast);
    background: var(--tr-color-white);
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.tr-schema-type-card:hover {
    border-color: var(--tr-color-primary);
}

.tr-schema-type-card.is-selected {
    border-color: var(--tr-color-primary);
    background: var(--tr-color-primary-light);
}

.tr-schema-type-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.tr-schema-type-name {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-slate-800);
    margin-bottom: var(--tr-space-1);
}

.tr-schema-type-desc {
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
    line-height: 1.4;
}

.tr-schema-type-selected-badge {
    display: none;
    margin-top: 10px;
    font-size: 11px;
    font-weight: var(--tr-font-medium);
    color: var(--tr-color-primary);
}

.tr-schema-type-card.is-selected .tr-schema-type-selected-badge {
    display: block;
}

/* More types dropdown row */
.tr-more-types-row {
    margin-bottom: var(--tr-space-6);
}

.tr-more-types-select {
    width: 100%;
    padding: var(--tr-space-2) var(--tr-space-3);
    border: 2px solid var(--tr-color-surface);
    border-radius: var(--tr-radius-md);
    background: var(--tr-color-white);
    color: var(--tr-color-slate-800);
    font-size: var(--tr-text-sm);
    font-family: inherit;
    cursor: pointer;
}

.tr-more-types-select:focus {
    outline: none;
    border-color: var(--tr-color-primary);
    box-shadow: var(--tr-shadow-focus);
}

/* Checkbox group (post types) */
.tr-checkbox-group {
    display: flex;
    gap: var(--tr-space-5);
    flex-wrap: wrap;
}

.tr-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--tr-space-2);
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-800);
    cursor: pointer;
}

.tr-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--tr-color-primary);
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   10. Field Mapping Rows (wizard step 2)
   ══════════════════════════════════════════════════════ */
.tr-field-section-label {
    font-size: 11px;
    font-weight: var(--tr-font-semibold);
    text-transform: uppercase;
    color: var(--tr-color-slate-400);
    letter-spacing: 0.05em;
    padding: var(--tr-space-3) 0 var(--tr-space-2);
    border-bottom: 1px solid var(--tr-color-surface);
    margin-bottom: var(--tr-space-1);
}

.tr-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--tr-space-4);
    padding: var(--tr-space-3) 0;
    border-bottom: 1px solid var(--tr-color-surface);
}

.tr-field-row:last-child {
    border-bottom: none;
}

.tr-field-row:nth-child(even) {
    background: var(--tr-color-base);
    margin: 0 calc(-1 * var(--tr-space-5));
    padding: var(--tr-space-3) var(--tr-space-5);
}

.tr-field-name {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
    color: var(--tr-color-slate-800);
}

.tr-field-required {
    color: var(--tr-color-error);
}

.tr-field-type {
    font-size: 11px;
    color: var(--tr-color-slate-400);
    margin-top: 2px;
}

.tr-field-select {
    width: 100%;
    padding: var(--tr-space-2) var(--tr-space-3);
    border: 2px solid var(--tr-color-surface);
    border-radius: var(--tr-radius-md);
    background: var(--tr-color-white);
    color: var(--tr-color-slate-800);
    font-size: var(--tr-text-sm);
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.tr-field-select:focus {
    outline: none;
    border-color: var(--tr-color-primary);
    box-shadow: var(--tr-shadow-focus);
}

/* ══════════════════════════════════════════════════════
   11. Entity Type Cards (Globale Instellingen)
   ══════════════════════════════════════════════════════ */
.tr-entity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tr-space-4);
    margin-bottom: var(--tr-space-5);
}

.tr-entity-card {
    border: 2px solid var(--tr-color-surface);
    border-radius: var(--tr-radius-lg);
    padding: var(--tr-space-5);
    cursor: pointer;
    transition: all var(--tr-transition-fast);
    background: var(--tr-color-white);
    text-align: left;
    width: 100%;
    font-family: inherit;
    position: relative;
}

.tr-entity-card:hover {
    border-color: var(--tr-color-primary);
}

.tr-entity-card.is-selected {
    border-color: var(--tr-color-primary);
    background: var(--tr-color-primary-light);
}

.tr-entity-card.is-advanced.is-selected {
    border-color: var(--tr-color-warning);
    background: var(--tr-color-warning-bg);
}

.tr-entity-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.tr-entity-name {
    font-size: var(--tr-text-base);
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-slate-800);
    margin-bottom: 6px;
}

.tr-entity-desc {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
    line-height: 1.45;
}

.tr-entity-selected-badge {
    display: none;
    margin-top: var(--tr-space-3);
    font-size: var(--tr-text-xs);
    font-weight: var(--tr-font-medium);
    color: var(--tr-color-primary);
}

.tr-entity-card.is-selected .tr-entity-selected-badge {
    display: block;
}

.tr-entity-card.is-advanced.is-selected .tr-entity-selected-badge {
    color: var(--tr-color-warning);
}

/* Advanced badge top-right */
.tr-advanced-badge {
    position: absolute;
    top: var(--tr-space-3);
    right: var(--tr-space-3);
    padding: 2px var(--tr-space-2);
    background: var(--tr-color-warning-bg);
    color: var(--tr-color-warning);
    font-size: 11px;
    font-weight: var(--tr-font-medium);
    border-radius: var(--tr-radius-sm);
}

/* Orange bottom accent on advanced card */
.tr-entity-card.is-advanced::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tr-color-warning-bg);
    border-radius: 0 0 var(--tr-radius-lg) var(--tr-radius-lg);
}

/* ══════════════════════════════════════════════════════
   12. Form Fields
   ══════════════════════════════════════════════════════ */
.tr-form-grid {
    display: grid;
    gap: var(--tr-space-4);
}

.tr-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tr-form-label {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
    color: var(--tr-color-slate-800);
}

.tr-form-label .tr-required {
    color: var(--tr-color-error);
    margin-left: 2px;
}

/* One-line explanation under a field. Same size and tone as .tr-field-hint on
   the settings page, repeated here because the schema card does not load
   admin.css. */
.tr-form-help {
    font-size: var(--tr-text-xs);
    line-height: 1.5;
    color: var(--tr-color-slate-500);
    margin: 2px 0 0 0;
}

.tr-form-input,
.tr-form-input[type="text"],
.tr-form-input[type="url"],
.tr-form-input[type="email"],
.tr-form-input[type="tel"],
select.tr-form-input {
    width: 100% !important;
    padding: 13px var(--tr-space-4) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: var(--tr-radius-lg) !important;
    font-size: 14px !important;
    color: var(--tr-color-slate-800) !important;
    background: var(--tr-color-white) !important;
    font-family: inherit !important;
    transition: border-color var(--tr-transition-fast);
    box-sizing: border-box;
}

.tr-form-input:focus {
    outline: none !important;
    border-color: var(--tr-color-primary) !important;
    box-shadow: var(--tr-shadow-focus) !important;
}

.tr-form-input::placeholder {
    color: var(--tr-color-slate-400);
}

/* Two-column form grid */
.tr-form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tr-space-4);
}

/* ══════════════════════════════════════════════════════
   13. Warning Banner
   ══════════════════════════════════════════════════════ */
.tr-warning-banner {
    display: none;
    background: var(--tr-color-warning-bg);
    border-radius: var(--tr-radius-md);
    padding: 14px var(--tr-space-4);
    margin-bottom: var(--tr-space-4);
}

.tr-warning-banner.is-visible {
    display: flex;
    gap: 10px;
}

.tr-warning-icon {
    color: var(--tr-color-warning);
    font-size: var(--tr-text-base);
    flex-shrink: 0;
    margin-top: 1px;
}

.tr-warning-title {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-warning);
    margin-bottom: var(--tr-space-1);
}

.tr-warning-text {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-600);
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   14. JSON-LD Code Editor
   ══════════════════════════════════════════════════════ */
.tr-code-editor {
    width: 100%;
    min-height: 200px;
    padding: var(--tr-space-4);
    background: var(--tr-color-slate-900);
    color: var(--tr-color-slate-200);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: var(--tr-text-sm);
    line-height: 1.6;
    border: none;
    border-radius: var(--tr-radius-md);
    resize: vertical;
    box-sizing: border-box;
}

.tr-code-editor:focus {
    outline: 2px solid var(--tr-color-warning);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════
   15. Form Footer
   ══════════════════════════════════════════════════════ */
.tr-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: var(--tr-space-5);
    border-top: 1px solid var(--tr-color-surface);
    margin-top: var(--tr-space-5);
}

.tr-form-footer-split {
    justify-content: space-between;
}

/* ══════════════════════════════════════════════════════
   16. Responsive
   ══════════════════════════════════════════════════════ */
@media (max-width: 782px) {
    .tr-stats-grid {
        grid-template-columns: 1fr;
    }

    .tr-schema-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tr-entity-grid {
        grid-template-columns: 1fr;
    }

    .tr-field-row {
        grid-template-columns: 1fr;
        gap: var(--tr-space-2);
    }

    .tr-form-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════
   17. LocalBusiness workbench (variant C)

   Everything below is scoped to #tr-global-bench, and the two-column
   layout plus the section cards only engage with .is-lb. Organization
   and Custom mode keep the flat form they have always had: the section
   wrappers fall back to display:contents so their fields flow into the
   surrounding .tr-form-grid exactly as before.
   ══════════════════════════════════════════════════════ */

/* --- mode switches --- */

/* Deze regel staat bewust vóór .tr-lb-only. Hij heeft dezelfde specificiteit
   (1,1,0), dus wie het laatst staat wint: stond hij eronder, dan kregen de
   secties 3–5 in Organization-modus `display: contents` in plaats van `none` —
   het wrapperblok verdwijnt dan wel, maar de kop en de body eronder blijven
   gewoon staan. In LocalBusiness-modus verandert er niets: daar wint
   `#tr-global-bench.is-lb .tr-lb-section` (1,2,0) hoe dan ook. */
#tr-global-bench .tr-lb-section { display: contents; }

#tr-global-bench .tr-lb-only { display: none; }
#tr-global-bench.is-lb .tr-lb-only { display: block; }
#tr-global-bench.is-lb .tr-lb-hide { display: none; }

/* .tr-lb-only zit ook op inline-elementen — het verplicht-sterretje achter een
   labelwoord. Voor die groep is `display: block` fout: het sterretje valt dan op
   een eigen regel onder het label. Bewust een eigen modifier in plaats van
   `display: revert` op .tr-lb-only zelf: revert geeft élk element zijn
   user-agent-display terug, en de blok-elementen hierboven (secties, leads,
   grids) hebben juist die expliciete `block` nodig. Eén klasse erbij houdt de
   twee soorten uit elkaar zonder dat de schakelaar zelf van betekenis verandert. */
#tr-global-bench.is-lb .tr-lb-only.tr-lb-only-inline { display: inline; }

/* --- two columns --- */
#tr-global-bench.is-lb {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: var(--tr-space-5);
    align-items: start;
}

#tr-global-bench.is-lb > .tr-lb-formcol {
    min-width: 0;
}

/* The outer .tr-card stops being a card in LB mode; the sections become
   the cards instead. */
#tr-global-bench.is-lb > .tr-lb-formcol > .tr-card {
    background: none;
    box-shadow: none;
    padding: 0;
    border: 0;
}

#tr-global-bench.is-lb .tr-lb-section {
    display: block;
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    box-shadow: var(--tr-shadow-md);
    padding: var(--tr-space-5) var(--tr-space-6);
    margin-bottom: var(--tr-space-4);
}

/* --- section headers --- */
#tr-global-bench.is-lb .tr-lb-shead {
    display: flex;
    align-items: center;
    gap: var(--tr-space-3);
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-align: left;
    color: inherit;
}

#tr-global-bench.is-lb .tr-lb-shead--btn { cursor: pointer; }

#tr-global-bench.is-lb .tr-lb-kicker {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tr-color-slate-400);
    font-weight: var(--tr-font-semibold);
    margin-bottom: 2px;
}

#tr-global-bench.is-lb .tr-lb-stitle {
    font-size: var(--tr-text-base);
    font-weight: var(--tr-font-semibold);
    margin: 0;
    color: var(--tr-color-slate-900);
}

#tr-global-bench.is-lb .tr-lb-sum {
    margin-left: auto;
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
    white-space: nowrap;
}

#tr-global-bench.is-lb .tr-lb-sum-empty {
    color: var(--tr-color-slate-400);
    font-style: italic;
}

#tr-global-bench.is-lb .tr-lb-sum b {
    font-weight: var(--tr-font-semibold);
    color: var(--tr-color-slate-700);
}

#tr-global-bench.is-lb .tr-lb-caret {
    color: var(--tr-color-slate-400);
    font-size: 11px;
    transition: transform var(--tr-transition-fast);
}

#tr-global-bench.is-lb .tr-lb-acc.is-open .tr-lb-caret { transform: rotate(90deg); }

/* --- accordion bodies --- */
#tr-global-bench.is-lb .tr-lb-acc { padding: var(--tr-space-4) var(--tr-space-6); }
#tr-global-bench.is-lb .tr-lb-acc .tr-lb-sbody { display: none; padding-top: var(--tr-space-5); }
#tr-global-bench.is-lb .tr-lb-acc.is-open .tr-lb-sbody { display: block; }

/* Advanced sits behind a dashed outline until it is opened. */
#tr-global-bench.is-lb .tr-lb-adv {
    background: transparent;
    box-shadow: none;
    border: 1px dashed var(--tr-color-slate-300);
}
#tr-global-bench.is-lb .tr-lb-adv.is-open {
    background: var(--tr-color-white);
    border-color: transparent;
    box-shadow: var(--tr-shadow-md);
}

/* --- narrative lead per section --- */
#tr-global-bench.is-lb .tr-lb-lead {
    font-size: var(--tr-text-sm);
    color: var(--tr-color-slate-500);
    margin: 6px 0 var(--tr-space-4);
    max-width: 66ch;
    line-height: 1.6;
}

#tr-global-bench .tr-lb-help {
    display: block;
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
    line-height: 1.5;
    margin-top: 4px;
}
#tr-global-bench .tr-lb-help--warn { color: var(--tr-color-warning); }

/* --- equal field heights: inputs and selects on one line (46px) --- */
#tr-global-bench.is-lb .tr-form-input,
#tr-global-bench.is-lb input.tr-form-input,
#tr-global-bench.is-lb select.tr-form-input {
    height: 46px !important;
    padding: 0 var(--tr-space-4) !important;
    line-height: normal !important;
}

#tr-global-bench.is-lb select.tr-form-input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 38px !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
}

#tr-global-bench.is-lb .tr-form-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--tr-space-4);
}

/* --- address switch --- */
#tr-global-bench.is-lb .tr-lb-switch {
    display: flex;
    gap: var(--tr-space-3);
    align-items: flex-start;
    padding: var(--tr-space-4);
    background: var(--tr-color-surface);
    border-radius: var(--tr-radius-lg);
    margin-bottom: var(--tr-space-4);
}

#tr-global-bench.is-lb .tr-lb-track {
    flex: 0 0 auto;
    width: 40px;
    height: 22px;
    border-radius: var(--tr-radius-full);
    background: var(--tr-color-slate-300);
    position: relative;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin-top: 1px;
    transition: background var(--tr-transition-base);
}

#tr-global-bench.is-lb .tr-lb-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tr-color-white);
    box-shadow: var(--tr-shadow-sm);
    transition: transform var(--tr-transition-base);
}

#tr-global-bench.is-lb .tr-lb-track.is-on { background: var(--tr-color-primary); }
#tr-global-bench.is-lb .tr-lb-track.is-on::after { transform: translateX(18px); }

#tr-global-bench.is-lb .tr-lb-switch-txt strong {
    display: block;
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
}

#tr-global-bench.is-lb .tr-lb-switch-txt span {
    display: block;
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
    margin-top: 2px;
    line-height: 1.55;
}

#tr-global-bench.is-lb .tr-lb-dim { opacity: 0.42; pointer-events: none; }

/* --- notes --- */
#tr-global-bench .tr-lb-note {
    border-radius: var(--tr-radius-md);
    padding: var(--tr-space-3) var(--tr-space-4);
    font-size: var(--tr-text-xs);
    line-height: 1.6;
    gap: var(--tr-space-3);
    margin-bottom: var(--tr-space-4);
}
#tr-global-bench.is-lb .tr-lb-note { display: flex; }
#tr-global-bench .tr-lb-note b { display: block; font-size: var(--tr-text-sm); margin-bottom: 2px; }

/* Het icoon draagt het onderscheid samen met de achtergrondtint; op de
   body-maat van de banner (11px) viel het weg tegen de tekst. */
#tr-global-bench .tr-lb-note > span[aria-hidden="true"] {
    flex: 0 0 auto;
    font-size: var(--tr-text-lg);
    line-height: 1.2;
}

/* De @id-URL in de info-banner is één lang token in een smalle kolom (banner
   300-360px). Gemeten: zonder deze regel valt een hostnaam zonder koppelteken
   of punt 111-171px BUITEN de banner, want `overflow-wrap: normal` laat een
   token dat nergens mag breken liever overlopen. `anywhere` grijpt alleen in
   als de browser geen enkele legale breekplek heeft, dus hostnamen met een
   koppelteken breken nog steeds op dat koppelteken — dat is hun eigen
   woordgrens, niet iets wat CSS verplaatst. `hyphens: none` legt vast dat er
   nooit een streepje bijkomt dat op deel van de URL lijkt. */
#tr-global-bench .tr-lb-note code {
    overflow-wrap: anywhere;
    hyphens: none;
}

/* Geen linkerlijn: de achtergrondtint is het onderscheid tussen de drie
   varianten. Bewust op alle drie tegelijk — één component gaat niet half om. */
#tr-global-bench .tr-lb-note--warn {
    background: var(--tr-color-warning-bg);
    color: var(--tr-color-slate-700);
}
#tr-global-bench .tr-lb-note--info {
    background: var(--tr-color-slate-100);
    color: var(--tr-color-slate-600);
}
#tr-global-bench .tr-lb-note--ok {
    background: var(--tr-color-primary-light);
    color: var(--tr-color-slate-700);
}

/* --- opening hours --- */
#tr-global-bench.is-lb .tr-lb-quick {
    display: flex;
    gap: var(--tr-space-2);
    margin-bottom: var(--tr-space-3);
    flex-wrap: wrap;
}

#tr-global-bench.is-lb .tr-lb-hrow {
    display: grid;
    grid-template-columns: 110px 1fr auto 1fr auto;
    gap: var(--tr-space-3);
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--tr-color-slate-100);
}
#tr-global-bench.is-lb .tr-lb-hrow:last-child { border-bottom: 0; }

#tr-global-bench.is-lb .tr-lb-hday {
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-medium);
}

#tr-global-bench.is-lb .tr-lb-hsep {
    color: var(--tr-color-slate-400);
    font-size: var(--tr-text-sm);
    text-align: center;
}

#tr-global-bench.is-lb .tr-lb-hclosed {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
    white-space: nowrap;
}

#tr-global-bench.is-lb .tr-lb-hrow.is-closed .tr-lb-htime {
    opacity: 0.35;
    pointer-events: none;
}

/* --- online profiles --- */
#tr-global-bench.is-lb .tr-lb-profile-row {
    display: flex;
    gap: var(--tr-space-2);
    align-items: center;
    margin-bottom: var(--tr-space-2);
}

#tr-global-bench.is-lb .tr-lb-icon-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid var(--tr-color-surface);
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-md);
    cursor: pointer;
    color: var(--tr-color-slate-500);
    font-size: 16px;
    line-height: 1;
}
#tr-global-bench.is-lb .tr-lb-icon-btn:hover {
    border-color: var(--tr-color-error);
    color: var(--tr-color-error);
}

#tr-global-bench.is-lb .tr-lb-media-row {
    display: flex;
    gap: var(--tr-space-2);
    align-items: center;
}

/* --- form footer: save stays at the bottom, like every other TamRank form --- */
#tr-global-bench .tr-lb-unsaved {
    font-size: var(--tr-text-xs);
    color: var(--tr-color-warning);
    font-weight: var(--tr-font-semibold);
    align-self: center;
}

/* --- the sticky panel: own scroll, so clicking is unambiguous --- */
#tr-global-bench .tr-lb-panel { display: none; }
#tr-global-bench.is-lb .tr-lb-panel {
    display: grid;
    position: sticky;
    top: 46px;
    gap: var(--tr-space-4);
    align-content: start;
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    padding: 4px;
    margin: -4px;
}

#tr-global-bench .tr-lb-pcard {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    box-shadow: var(--tr-shadow-md);
    overflow: hidden;
}

#tr-global-bench .tr-lb-pcard-h {
    display: flex;
    align-items: center;
    gap: var(--tr-space-2);
    padding: var(--tr-space-4) var(--tr-space-5);
    border-bottom: 1px solid var(--tr-color-surface);
}

#tr-global-bench .tr-lb-pcard-h h3 {
    margin: 0;
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
}

#tr-global-bench .tr-lb-pcard-b { padding: var(--tr-space-4) var(--tr-space-5); }

#tr-global-bench .tr-lb-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tr-color-primary);
    font-weight: var(--tr-font-semibold);
}
#tr-global-bench .tr-lb-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tr-color-primary);
}

/* --- coverage meter --- */
#tr-global-bench .tr-lb-meter {
    flex: 1;
    height: 6px;
    background: var(--tr-color-surface);
    border-radius: var(--tr-radius-full);
    overflow: hidden;
    min-width: 60px;
    margin: 0 var(--tr-space-2);
}
#tr-global-bench .tr-lb-meter i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--tr-color-primary);
    border-radius: var(--tr-radius-full);
    transition: width var(--tr-transition-base);
}

#tr-global-bench .tr-lb-cov-n {
    font-size: var(--tr-text-xs);
    font-weight: var(--tr-font-bold);
    color: var(--tr-color-slate-700);
    white-space: nowrap;
}

#tr-global-bench .tr-lb-chk { display: grid; gap: 7px; }
#tr-global-bench .tr-lb-chk-row {
    display: flex;
    align-items: flex-start;
    gap: var(--tr-space-2);
    font-size: var(--tr-text-sm);
}
#tr-global-bench .tr-lb-chk-ic {
    flex: 0 0 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    font-weight: var(--tr-font-bold);
}
#tr-global-bench .tr-lb-chk-row.is-ok .tr-lb-chk-ic { background: var(--tr-color-primary); color: var(--tr-color-white); }
#tr-global-bench .tr-lb-chk-row.is-miss .tr-lb-chk-ic { background: var(--tr-color-surface); color: var(--tr-color-slate-400); }
#tr-global-bench .tr-lb-chk-row.is-bad .tr-lb-chk-ic { background: var(--tr-color-error); color: var(--tr-color-white); }
#tr-global-bench .tr-lb-chk-row.is-miss { color: var(--tr-color-slate-400); }
#tr-global-bench .tr-lb-chk-row.is-bad { color: var(--tr-color-error); }

#tr-global-bench .tr-lb-chk-t {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tr-color-slate-400);
    font-weight: var(--tr-font-semibold);
    margin: var(--tr-space-4) 0 var(--tr-space-2);
}
#tr-global-bench .tr-lb-chk-t:first-child { margin-top: 0; }

/* --- the JSON panel: folded to node level, changes light up briefly --- */
#tr-global-bench .tr-lb-json {
    margin: 0;
    background: var(--tr-color-slate-900);
    color: var(--tr-color-slate-200);
    padding: var(--tr-space-4);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    line-height: 1.65;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 2;
}
#tr-global-bench .tr-lb-k { color: #7dd3fc; }
#tr-global-bench .tr-lb-s { color: #a7f3d0; }
#tr-global-bench .tr-lb-n { color: #fcd34d; }
#tr-global-bench .tr-lb-jline { display: block; margin: 0 -16px; padding: 0 16px; }
#tr-global-bench .tr-lb-jline.is-exp { cursor: pointer; }
#tr-global-bench .tr-lb-jline.is-exp:hover { background: rgba(255, 255, 255, 0.05); }
#tr-global-bench .tr-lb-dots { color: var(--tr-color-slate-500); font-style: italic; }
#tr-global-bench .tr-lb-jline.is-chg { animation: tr-lb-chg 1.4s ease-out; }
@keyframes tr-lb-chg {
    0%   { background: rgba(16, 185, 129, 0.35); }
    100% { background: transparent; }
}
#tr-global-bench .tr-lb-jline.is-ghost {
    color: var(--tr-color-error);
    animation: tr-lb-ghost 1.5s ease-out forwards;
}
@keyframes tr-lb-ghost {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
}

#tr-global-bench .tr-lb-json-foot {
    font-size: var(--tr-text-xs);
    line-height: 1.5;
    padding: var(--tr-space-2) var(--tr-space-5) var(--tr-space-3);
    background: var(--tr-color-slate-900);
    color: var(--tr-color-slate-400);
}

/* --- output location --- */
#tr-global-bench .tr-lb-radios { display: grid; gap: var(--tr-space-2); }
#tr-global-bench .tr-lb-radio {
    display: flex;
    gap: var(--tr-space-3);
    align-items: flex-start;
    padding: 10px var(--tr-space-3);
    border: 1px solid var(--tr-color-surface);
    border-radius: var(--tr-radius-md);
    cursor: pointer;
}
#tr-global-bench .tr-lb-radio.is-on {
    border-color: var(--tr-color-primary);
    background: var(--tr-color-primary-light);
}
#tr-global-bench .tr-lb-radio input { margin-top: 3px; accent-color: var(--tr-color-primary); }
#tr-global-bench .tr-lb-radio b {
    display: block;
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
}
/* Alleen de omschrijvingsregel onder de titel, en die staat als DIRECTE
   kleinkindspan in de label. De RECOMMENDED-pil is óók een span-in-een-span,
   maar zit een niveau dieper (in de <b>); met een afstammingsselector won deze
   regel op specificiteit van .tr-lb-tag-def en werd de pil een grijs blok over
   de volle kolombreedte. Het directe-kindpad laat haar er buiten vallen. */
#tr-global-bench .tr-lb-radio > span > span {
    display: block;
    font-size: 11px;
    color: var(--tr-color-slate-500);
    margin-top: 1px;
    line-height: 1.5;
}
#tr-global-bench .tr-lb-tag-def {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tr-color-primary);
    background: var(--tr-color-primary-light);
    border-radius: var(--tr-radius-full);
    padding: 1px 6px;
    margin-left: 5px;
}

#tr-global-bench .tr-lb-btn-block { width: 100%; }

/* --- responsive: the panel narrows, then drops below the form --- */
@media (max-width: 1240px) {
    #tr-global-bench.is-lb { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 940px) {
    #tr-global-bench.is-lb { grid-template-columns: minmax(0, 1fr); }
    #tr-global-bench.is-lb .tr-lb-panel {
        position: static;
        max-height: none;
        overflow: visible;
        padding: 0;
        margin: 0;
    }
    #tr-global-bench.is-lb .tr-form-grid-3col { grid-template-columns: 1fr; }
    #tr-global-bench.is-lb .tr-lb-hrow { grid-template-columns: 90px 1fr auto 1fr; }
    #tr-global-bench.is-lb .tr-lb-hclosed { grid-column: 1 / -1; }
}

/* =========================================================================
   MERCHANT LISTING CARD (MERCH-01)

   The LocalBusiness switch, note and section styling above is all scoped to
   #tr-global-bench.is-lb, because those elements only exist in LocalBusiness
   mode. The merchant card is different: shipping, returns and product
   condition apply to a webshop whichever entity type it picked, so the card
   carries its own scope and repeats the handful of rules it needs.
   ========================================================================= */

/* In LocalBusiness mode the outer .tr-card is stripped of its card look so the
   sections inside it can be the cards. The merchant card is a card in its own
   right in both modes, so it takes the styling back. */
#tr-global-bench #tr-merch-card,
#tr-global-bench.is-lb > .tr-lb-formcol > #tr-merch-card {
    background: var(--tr-color-white);
    border-radius: var(--tr-radius-lg);
    box-shadow: var(--tr-shadow-md);
    padding: var(--tr-space-5);
    border: 0;
    margin-top: var(--tr-space-5);
}

#tr-merch-card .tr-merch-section {
    padding-bottom: var(--tr-space-5);
    margin-bottom: var(--tr-space-5);
    border-bottom: 1px solid var(--tr-color-slate-200);
}

#tr-merch-card .tr-merch-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

#tr-merch-card .tr-lb-switch {
    display: flex;
    gap: var(--tr-space-3);
    align-items: flex-start;
    padding: var(--tr-space-4);
    background: var(--tr-color-surface);
    border-radius: var(--tr-radius-lg);
    margin-bottom: var(--tr-space-4);
}

#tr-merch-card .tr-lb-track {
    flex: 0 0 auto;
    width: 40px;
    height: 22px;
    border-radius: var(--tr-radius-full);
    background: var(--tr-color-slate-300);
    position: relative;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin-top: 1px;
    transition: background var(--tr-transition-base);
}

#tr-merch-card .tr-lb-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tr-color-white);
    box-shadow: var(--tr-shadow-sm);
    transition: transform var(--tr-transition-base);
}

#tr-merch-card .tr-lb-track.is-on { background: var(--tr-color-primary); }
#tr-merch-card .tr-lb-track.is-on::after { transform: translateX(18px); }

#tr-merch-card .tr-lb-switch-txt strong {
    display: block;
    font-size: var(--tr-text-sm);
    font-weight: var(--tr-font-semibold);
}

#tr-merch-card .tr-lb-switch-txt span {
    display: block;
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
    margin-top: 2px;
    line-height: 1.55;
}

#tr-merch-card .tr-lb-note {
    display: flex;
    background: var(--tr-color-surface);
    color: var(--tr-color-slate-600);
}

#tr-merch-card .tr-lb-help {
    display: block;
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
    margin-top: var(--tr-space-2);
    line-height: 1.55;
}

/* The two-number ranges (processing time, delivery time) stay on one line
   until the column gets too narrow for two inputs plus the word between. */
#tr-merch-card .tr-merch-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--tr-space-2);
    align-items: center;
}

#tr-merch-card .tr-merch-dash {
    font-size: var(--tr-text-xs);
    color: var(--tr-color-slate-500);
}

@media (max-width: 640px) {
    #tr-merch-card .tr-merch-range { grid-template-columns: minmax(0, 1fr); }
    #tr-merch-card .tr-merch-dash { display: none; }
}
