/* OrderBadger admin styles */

/* -------------------------------------------------------------------------
 * Pro feature labels
 * ----------------------------------------------------------------------- */
.ob-pro-label {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #dbeafe;
    color: #1e40af;
    vertical-align: middle;
    white-space: nowrap;
}

/* Keep Pro-labelled form rows on one line */
.ob-badge-card th,
#ob-builder-advanced-fields th {
    white-space: nowrap;
    vertical-align: middle;
}

/* -------------------------------------------------------------------------
 * Connection status
 * ----------------------------------------------------------------------- */
.orderbadger-status--connected   { color: #46b450; font-weight: 600; }
.orderbadger-status--disconnected { color: #a00;    font-weight: 600; }

/* -------------------------------------------------------------------------
 * Layout & cards
 * ----------------------------------------------------------------------- */
.orderbadger-admin .card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.orderbadger-tab-content {
    margin-top: 16px;
}

/* Flex header used on several tabs */
.ob-flex-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ob-flex-header h2,
.ob-flex-header h3 { margin: 0; }

/* -------------------------------------------------------------------------
 * Badge pill previews
 * ----------------------------------------------------------------------- */
.orderbadger-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}
.orderbadger-badge__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
 * Tab dots
 * ----------------------------------------------------------------------- */
.ob-tab-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: middle;
}
.ob-tab-dot--green { background: #7bc67e; }
.ob-tab-dot--grey  { background: #767676; }
.ob-tab-dot--red   { background: #dc3232; }

/* -------------------------------------------------------------------------
 * Page header / How-to link
 * ----------------------------------------------------------------------- */
.orderbadger-admin > h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.orderbadger-admin > h1 img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}
.ob-howto-link {
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    background: #f0f0f1;
    color: #50575e;
    padding: 2px 8px;
    border-radius: 3px;
    vertical-align: middle;
}

/* -------------------------------------------------------------------------
 * Feedback bubble (fixed bottom-right)
 * ----------------------------------------------------------------------- */
#ob-feedback-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}
#ob-feedback-trigger {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #0073aa;
    color: #fff;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#ob-feedback-trigger:hover { background: #005177; }
#ob-feedback-trigger .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 1;
}
#ob-feedback-popover {
    position: absolute;
    bottom: 54px;
    right: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    padding: 16px;
}
.ob-feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
#ob-feedback-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #666;
    padding: 0;
}
.ob-feedback-desc {
    font-size: 12px;
    color: #666;
    margin: 0 0 8px;
}
#ob-feedback-text {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font-size: 13px;
}
.ob-feedback-context-toggle {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Mode toggle (plain-english / logic)
 * ----------------------------------------------------------------------- */
.ob-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}
.ob-mode-option {
    padding: 6px 16px;
    border: 1px solid #c3c4c7;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #50575e;
    background: #f6f7f7;
    transition: background-color 0.15s, color 0.15s;
}
.ob-mode-option:first-child {
    border-radius: 4px 0 0 4px;
}
.ob-mode-option:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}
.ob-mode-option--active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* -------------------------------------------------------------------------
 * Condition builder
 * ----------------------------------------------------------------------- */
.ob-condition-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ob-condition-row select,
.ob-condition-row input[type="number"],
.ob-condition-row input[type="text"] {
    min-width: 140px;
}
.ob-condition-remove {
    color: #a00;
    font-size: 18px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0 4px;
    line-height: 1;
}
.ob-condition-remove:hover {
    color: #dc3232;
}

/* -------------------------------------------------------------------------
 * Rule authoring
 * ----------------------------------------------------------------------- */
#ob-rule-draft-result pre {
    font-size: 12px;
    background: transparent;
    border: none;
    padding: 0;
}

/* Rule status dots */
.ob-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}
.ob-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.ob-status--active::before   { background-color: #46b450; }
.ob-status--compiled::before { background-color: #999; }

.ob-rule-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ob-delete-rule {
    color: #a00;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-size: 16px;
}
.ob-delete-rule:hover { color: #dc3232; }

/* -------------------------------------------------------------------------
 * Confidence indicator
 * ----------------------------------------------------------------------- */
.ob-confidence-wrap { margin: 16px 0 8px; }
.ob-confidence-bar-outer {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.ob-confidence-bar-inner {
    height: 100%;
    border-radius: 4px;
    transition: width .3s ease, background-color .3s ease;
}
.ob-confidence-bar-inner.ob-conf-green { background-color: #46b450; }
.ob-confidence-bar-inner.ob-conf-amber { background-color: #f0b849; }
.ob-confidence-bar-inner.ob-conf-red   { background-color: #dc3232; }
.ob-confidence-text { margin-top: 6px; font-size: 13px; }
.ob-confidence-text .ob-conf-pct { font-weight: 600; }
.ob-threshold-note {
    margin: 8px 0 0;
    padding: 8px 12px;
    background: #fef8ee;
    border-left: 4px solid #f0b849;
    font-size: 12px;
    color: #826200;
}

/* -------------------------------------------------------------------------
 * Badges tab - create badge card
 * ----------------------------------------------------------------------- */
.ob-create-badge-card {
    background: #f6f7f7;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    max-width: 600px;
}
.ob-create-badge-card h3 { margin: 0 0 12px; }
.ob-create-badge-card .form-table { margin: 0; }
.ob-create-badge-card th { width: 80px; }

button.ob-btn-delete-badge,
.ob-btn-delete-badge.button { color: #a00; }
button.ob-btn-delete-badge:hover,
.ob-btn-delete-badge.button:hover { color: #dc3232; }

/* -------------------------------------------------------------------------
 * Badge expandable cards
 * ----------------------------------------------------------------------- */
#ob-badge-cards {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 700px;
}
.ob-badge-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.ob-badge-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
}
.ob-badge-card__meta {
    flex: 1;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.ob-badge-card__tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #f0f0f1;
    color: #50575e;
    font-weight: 500;
}
.ob-badge-card__tag--inactive {
    background: #fce7ea;
    color: #a00;
}
.ob-badge-card__expand {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #999;
    padding: 4px;
    transition: transform 0.15s;
}
.ob-badge-card__expand--open {
    transform: rotate(90deg);
}
.ob-badge-card__body {
    padding: 0 14px 14px;
    border-top: 1px solid #f0f0f0;
}
.ob-badge-card__body .form-table {
    margin: 0;
}
.ob-badge-card__body .form-table th {
    width: 100px;
    font-size: 13px;
    padding: 6px 8px 6px 0;
}
.ob-badge-card__body .form-table td {
    padding: 6px 0;
}
.ob-badge-card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}
.ob-card-advanced-toggle {
    margin-top: 8px;
}
.ob-advanced-link {
    font-size: 12px;
    text-decoration: none;
    color: #50575e;
}

/* -------------------------------------------------------------------------
 * Badge picker (shared by automate + rules templates)
 * ----------------------------------------------------------------------- */
.ob-badge-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ob-badge-picker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
}

/* -------------------------------------------------------------------------
 * Rule authoring panel
 * ----------------------------------------------------------------------- */
.ob-rule-panel {
    max-width: 800px;
    padding: 20px;
}
.ob-rule-draft-result {
    margin: 12px 0;
    padding: 12px;
    background: #f8f8f8;
    border-left: 4px solid #0073aa;
}
.ob-rule-hints {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 13px;
    color: #555;
}

/* -------------------------------------------------------------------------
 * Subscription tab
 * ----------------------------------------------------------------------- */
.ob-subscription-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 16px 20px;
    margin: 20px 0;
}
.ob-subscription-card h2 { margin: 0 0 8px; }
.ob-subscription-card--pro    { border-left: 4px solid #46b450; }
.ob-subscription-card--free   { border-left: 4px solid #dba617; }
.ob-subscription-card p       { margin: 0 0 4px; color: #555; }
.ob-subscription-card .ob-subscribe-btn {
    background: #F97316;
    border-color: #EA580C;
    font-size: 14px;
    padding: 6px 20px;
}
.ob-subscription-card .ob-manage-link {
    color: #0073aa;
    font-size: 13px;
}
.ob-subscription-card .ob-subtle { color: #999; font-size: 12px; margin-top: 8px; }
.ob-pro-features {
    list-style: none;
    margin: 12px 0 4px;
    padding: 0;
}
.ob-pro-features li {
    padding: 4px 0;
    font-size: 13px;
    color: #3c434a;
}
.ob-subscription-card--pro .ob-pro-features li {
    color: #2e7d32;
}
.ob-refresh-link {
    color: #999;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Feedback tab
 * ----------------------------------------------------------------------- */
.ob-feedback-tab-form {
    max-width: 640px;
    margin-top: 16px;
}
.ob-feedback-tab-form fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px;
}
.ob-feedback-tab-form legend {
    font-weight: 600;
    margin-bottom: 10px;
}
.ob-feedback-type-selector {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.ob-feedback-type-selector label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Utility helpers
 * ----------------------------------------------------------------------- */
.ob-spinner-inline {
    float: none;
    vertical-align: middle;
}
.ob-mt-0  { margin-top: 0; }
.ob-mt-4  { margin-top: 4px; }
.ob-mt-12 { margin-top: 12px; }
.ob-mt-16 { margin-top: 16px; }
.ob-ml-8  { margin-left: 8px; }

/* Badge / rule notice areas */
.orderbadger-badge-notice { margin-top: 12px; }

/* Inline notices inside form fields - remove default WP margins */
.ob-badge-picker + .description { margin-top: 8px; }
.orderbadger-rule-panel .notice.inline { margin: 0; }

/* -------------------------------------------------------------------------
 * Badge Inbox (v1.1)
 * ----------------------------------------------------------------------- */
.ob-inbox-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 16px 0;
}
.ob-inbox-filters select {
    min-width: 130px;
}
.ob-inbox-filters label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}
.ob-inbox-summary {
    color: #666;
    font-size: 13px;
    margin: 0 0 8px;
}
.ob-inbox-table {
    font-size: 13px;
}
.ob-inbox-table tr.ob-inbox-row--overdue,
.widefat.striped tr.ob-inbox-row--overdue,
.ob-inbox-table tr.ob-inbox-row--overdue > td,
.widefat.striped tr.ob-inbox-row--overdue > td {
    background-color: #fce9e9;
}
.ob-inbox-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #666;
}
.ob-inbox-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.ob-inbox-actions .button {
    font-size: 11px !important;
    padding: 1px 8px !important;
    min-height: 22px !important;
}
/* Badge response border + icon in Inbox */
.ob-badge-border--pass {
    border: 2px solid #27ae60;
}
.ob-badge-border--fail {
    border: 2px solid #c0392b;
}
.ob-badge-response-icon {
    font-size: 12px;
    width: 12px;
    height: 12px;
    line-height: 1;
    margin-left: 2px;
}
.ob-badge-response-icon.dashicons-yes,
.ob-badge-response-icon.dashicons-yes-alt { color: #27ae60; }
.ob-badge-response-icon.dashicons-no-alt  { color: #c0392b; }

.ob-state-icon--pass {
    color: #27ae60;
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.ob-state-icon--fail {
    color: #c0392b;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ob-state-text--pass    { color: #27ae60; }
.ob-state-text--fail    { color: #c0392b; }
.ob-state-text--applied { color: #666; }

.ob-inbox-customer {
    font-size: 12px;
    color: #666;
}
.ob-severity-info     { color: #2980b9; }
.ob-severity-warning  { color: #e67e22; font-weight: 600; }
.ob-severity-critical { color: #c0392b; font-weight: 600; }

.ob-inbox-pagination {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    align-items: center;
}
.ob-inbox-page-current {
    font-weight: 700;
    padding: 2px 8px;
    background: #2271b1;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
}
.ob-inbox-page-link {
    padding: 2px 8px;
    text-decoration: none;
    font-size: 13px;
}
.ob-inbox-snooze-group {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.ob-inbox-snooze-presets {
    display: inline-flex;
    gap: 3px;
}
.ob-inbox-audit-cell {
    padding: 12px 14px !important;
    background: #f9f9f9;
}
.ob-inbox-audit-content {
    max-height: 300px;
    overflow-y: auto;
}

/* -------------------------------------------------------------------------
 * Build tab — section spacing
 * ----------------------------------------------------------------------- */
.ob-build-section {
    margin-bottom: 28px;
}
/* Shimmer skeleton loader */
@keyframes ob-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.ob-shimmer {
    padding: 16px 0;
}
.ob-shimmer__row {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 800px 14px;
    animation: ob-shimmer 1.4s ease-in-out infinite;
}
.ob-shimmer__row--wide  { width: 100%; }
.ob-shimmer__row--med   { width: 70%; }
.ob-shimmer__row--short { width: 40%; }
.ob-shimmer__row--block {
    height: 44px;
    border-radius: 4px;
}

/* Data tree (non-interactive, for test results) */
.ob-tree-wrap {
    margin-top: 6px;
    max-height: 220px;
    overflow-y: auto;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
}
dl.ob-tree {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 10px;
}
dl.ob-tree dl.ob-tree {
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid #e5e7eb;
}
.ob-tree-key {
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
    padding: 1px 0;
}
.ob-tree-val {
    margin: 0;
    padding: 1px 0;
    color: #1f2937;
    word-break: break-word;
}
.ob-tree-str   { color: #059669; }
.ob-tree-num   { color: #2563eb; }
.ob-tree-bool  { color: #d97706; font-weight: 600; }
.ob-tree-null  { color: #9ca3af; font-style: italic; }
.ob-tree-empty { color: #9ca3af; }
ul.ob-tree-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 10px;
    border-left: 1px solid #e5e7eb;
}
ul.ob-tree-list > li {
    padding: 1px 0;
}
ul.ob-tree-list > li::before {
    content: "\2022";
    color: #9ca3af;
    margin-right: 6px;
}

.ob-builder-busy {
    opacity: 0.55;
    pointer-events: none;
}
.ob-build-section-header {
    margin-top: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e4e7;
}
details.ob-build-collapsible {
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 0 16px;
    background: #fff;
}
details.ob-build-collapsible > summary {
    cursor: pointer;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    outline: none;
}
details.ob-build-collapsible > summary::-webkit-details-marker { display: none; }
details.ob-build-collapsible > summary::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s;
}
details.ob-build-collapsible[open] > summary::before {
    transform: rotate(90deg);
}
details.ob-build-collapsible > summary ~ * {
    padding-bottom: 16px;
}

/* -------------------------------------------------------------------------
 * Inbox — welcome state
 * ----------------------------------------------------------------------- */
.ob-inbox-welcome {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.ob-inbox-welcome h2 {
    margin-top: 0;
}
.ob-inbox-welcome .ob-dismiss-welcome {
    background: none;
    border: none;
    color: #a0a5aa;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-top: 8px;
}
.ob-inbox-empty {
    color: #646970;
    font-style: italic;
    padding: 16px 0;
}

/* -------------------------------------------------------------------------
 * Consent modal
 * ----------------------------------------------------------------------- */
.ob-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ob-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.45);
}
.ob-modal-content {
    position: relative;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
    max-width: 480px;
    width: 90%;
    padding: 24px 28px;
    z-index: 1;
}
.ob-modal-content h3 {
    margin-top: 0;
}
.ob-modal-content ul {
    margin: 12px 0 16px 18px;
    list-style: disc;
}
.ob-consent-checkbox {
    display: block;
    margin: 16px 0 12px;
    font-weight: 600;
}
.ob-consent-checkbox input {
    margin-right: 6px;
}
.ob-modal-actions {
    margin-top: 16px;
}
.ob-modal-actions .button {
    margin-right: 8px;
}

/* -------------------------------------------------------------------------
 * Upgrade modal
 * ----------------------------------------------------------------------- */
#ob-upgrade-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}
.ob-upgrade-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: ob-modal-in 0.2s ease-out;
}
@keyframes ob-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ob-upgrade-dialog .ob-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    z-index: 1;
}
.ob-upgrade-dialog .ob-modal-close:hover {
    color: #333;
}
.ob-upgrade-dialog__header {
    text-align: center;
    padding: 32px 28px 20px;
    background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
    border-radius: 12px 12px 0 0;
}
.ob-upgrade-dialog__icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}
.ob-upgrade-dialog__header h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}
.ob-upgrade-dialog__subtitle {
    margin: 0;
    color: #78716c;
    font-size: 14px;
}
.ob-upgrade-dialog__body {
    padding: 24px 28px 8px;
}
.ob-upgrade-features {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ob-upgrade-features li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.ob-upgrade-features li:last-child {
    border-bottom: none;
}
.ob-upgrade-features__icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
    line-height: 1.4;
}
.ob-upgrade-features li strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.ob-upgrade-features li p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
}
.ob-upgrade-dialog__footer {
    text-align: center;
    padding: 20px 28px 28px;
}
.ob-upgrade-cta {
    display: inline-block;
    background: #F97316 !important;
    border-color: #EA580C !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600;
    padding: 10px 36px !important;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.ob-upgrade-cta:hover {
    background: #EA580C !important;
    color: #fff !important;
    transform: translateY(-1px);
}
.ob-upgrade-dialog__note {
    margin: 10px 0 0;
    font-size: 12px;
    color: #9ca3af;
}

/* -------------------------------------------------------------------------
 * Starter Rules — Pill Filter + Tile Grid
 * ----------------------------------------------------------------------- */

/* Search */
.ob-starter-search-wrap {
    margin: 8px 0 12px;
    position: relative;
    display: inline-block;
}
.ob-starter-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.ob-starter-search-clear:hover {
    color: #d63638;
}

/* Filter pills */
.ob-starter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.ob-starter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 20px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.ob-starter-pill:hover {
    border-color: #2271b1;
    color: #2271b1;
}
.ob-starter-pill--active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}
.ob-starter-pill--active:hover {
    color: #fff;
}
.ob-starter-pill__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    font-size: 11px;
    font-weight: 600;
}
.ob-starter-pill--active .ob-starter-pill__count {
    background: rgba(255,255,255,0.25);
}

/* Tile grid — cards hidden until JS applies the active pill filter */
.ob-starter-grid--loading > .ob-starter-card {
    display: none;
}
.ob-starter-card--hidden {
    display: none !important;
}

.ob-starter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

/* Compact card */
.ob-starter-card {
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 12px 14px;
    background: #fafafa;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
}
.ob-starter-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.ob-starter-card__title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}
.ob-starter-card__condition {
    background: #f0f0f0;
    border-radius: 3px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #333;
}
.ob-starter-card__condition input {
    font-size: 11px;
    padding: 1px 3px;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
}
.ob-starter-card__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}
.ob-starter-card__actions .button {
    font-size: 12px;
    padding: 2px 10px;
    min-height: 28px;
}

/* Help link (?) */
.ob-starter-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #c3c4c7;
    color: #888;
    font-size: 11px;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
}
.ob-starter-help:hover {
    background: #f0f0f1;
    color: #2271b1;
    border-color: #2271b1;
    text-decoration: none;
}

/* Faded state — non-active cards while a panel is open */
.ob-starter-card--faded {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Disabled pills + search while a panel is open */
.ob-starter-pills--disabled {
    opacity: 0.5;
    pointer-events: none;
}
#ob-starter-search:disabled {
    opacity: 0.5;
}

/* Expanded results panel — placed after the grid, full width */
.ob-starter-results-panel {
    border: 1px solid #2271b1;
    border-radius: 4px;
    padding: 16px;
    background: #fff;
    margin-top: 16px;
    position: relative;
}
.ob-starter-results-pointer {
    position: absolute;
    top: -8px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-left: 1px solid #2271b1;
    border-top: 1px solid #2271b1;
    transform: rotate(45deg);
    margin-left: -7px;
}
.ob-starter-card--expanded {
    border-color: #2271b1;
    background: #fff;
}

/* Search extras — KB articles + guides shown only during search */
.ob-starter-search-extras {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* KB article + Guide cards */
.ob-starter-kb-card {
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 14px 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ob-starter-guide-card {
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 14px 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.ob-starter-guide-card__title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e1e1e;
}
.ob-starter-guide-card__link {
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
}
.ob-starter-guide-card__link:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Badge Library — inline rules & Automated tag
 * ----------------------------------------------------------------------- */
.ob-badge-card__tag--automated {
    background: #e0f0ff;
    color: #0066cc;
}
.ob-badge-card__tag--automated-off {
    background: #f0f0f0;
    color: #888;
}

/* Header activate/deactivate toggle */
.ob-badge-header-toggle {
    font-size: 11px;
    padding: 2px 10px;
    border: 1px solid #007cba;
    border-radius: 3px;
    background: #007cba;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}
.ob-badge-header-toggle--on {
    background: #fff;
    color: #666;
    border-color: #ccd0d4;
}
.ob-badge-header-delete {
    font-size: 11px;
    padding: 2px 10px;
    border: 1px solid #a00;
    border-radius: 3px;
    background: #a00;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}
.ob-badge-header-delete:hover {
    background: #800;
    border-color: #800;
}
.ob-header-spinner {
    float: none !important;
    display: none !important;
    vertical-align: middle;
    margin: 0 4px !important;
}
.ob-header-spinner.is-active {
    display: inline-block !important;
    visibility: visible !important;
}
.ob-badge-rule {
    border-top: 1px solid #e2e4e7;
    padding-top: 12px;
}
.ob-badge-rule h4 {
    margin: 0 0 6px;
    font-size: 13px;
}
.ob-badge-rule__slug {
    font-weight: 400;
    color: #888;
    font-size: 12px;
    margin-left: 6px;
}
.ob-badge-rule__desc {
    margin: 0 0 4px;
    font-size: 13px;
    color: #333;
}
.ob-badge-rule__meta {
    margin: 0;
    font-size: 12px;
    color: #888;
}
.ob-badge-rule__meta code {
    font-size: 11px;
}
.ob-badge-rule__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ob-badge-rule__actions .ob-delete-rule {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    color: #a00;
}
.ob-badge-rule__test-summary {
    margin: 4px 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}
.ob-badge-preview-results {
    margin-top: 12px;
}
