/* ==========================================================================
   Command Center (2026-08-23, premium pass 2026-08-23b) — visual module
   command center styles. All selectors are scoped under .tbf-cc so nothing
   here can leak into the rest of the app (same discipline as .wa-premium on
   the WhatsApp inbox).

   Premium pass: Plus Jakarta Sans + JetBrains Mono (loaded by
   command-center.php, scoped here), per-module accent via a --acc custom
   property set inline on each card (tinted surfaces derived with color-mix,
   which header.php already relies on), hover-invert icon tiles, card footer
   action rows, dark Quick Actions bar, live-status pill and ⌘K search chip.
   Still a controlled system — one accent per module, no rainbow cards.
   ========================================================================== */

.tbf-cc {
    --cc-border: #e2e8f0;
    --cc-ink: #0f172a;
    --cc-muted: #64748b;
    --cc-faint: #94a3b8;
    --cc-surface: #ffffff;
    --cc-radius: 18px;
    max-width: 1240px;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.tbf-cc .tbf-cc-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- header / hero ---------- */
.tbf-cc-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.tbf-cc-hero h1 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cc-ink);
    margin: 0;
}
.tbf-cc-hero .tbf-cc-sub {
    color: var(--cc-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 2px;
}
.tbf-cc-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tbf-cc-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cc-ink);
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    white-space: nowrap;
}
.tbf-cc-live-pill .tbf-cc-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    animation: tbfCcPulse 1.6s ease-in-out infinite;
}
@keyframes tbfCcPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    50%      { opacity: 0.65; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0); }
}
.tbf-cc-hero .tbf-cc-work-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--cc-surface);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 8px 15px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #1e293b;
    text-decoration: none;
    transition: background 0.14s ease, border-color 0.14s ease;
}
.tbf-cc-hero .tbf-cc-work-btn:hover {
    background: #f8fafc;
    border-color: var(--cc-faint);
    color: var(--cc-ink);
}
.tbf-cc-hero .tbf-cc-work-btn i { color: var(--tbf-primary, #0284c7); }

/* ---------- search ---------- */
.tbf-cc-search {
    position: relative;
    margin-bottom: 18px;
}
.tbf-cc-search .tbf-cc-search-box {
    display: flex;
    align-items: center;
    gap: 11px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 16px;
    padding: 13px 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tbf-cc-search .tbf-cc-search-box:focus-within {
    border-color: var(--tbf-primary, #0284c7);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tbf-primary, #0284c7) 16%, transparent);
}
.tbf-cc-search input {
    border: none;
    outline: none;
    flex: 1 1 auto;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--cc-ink);
    background: transparent;
    min-width: 0;
}
.tbf-cc-search input::placeholder { color: var(--cc-faint); }
.tbf-cc-search .tbf-cc-search-icon { color: var(--cc-faint); }
.tbf-cc-search .tbf-cc-kbd {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid var(--cc-border);
    border-radius: 7px;
    padding: 3px 8px;
    flex: 0 0 auto;
    pointer-events: none;
}
@media (max-width: 767.98px) {
    .tbf-cc-search .tbf-cc-kbd { display: none; }
}
.tbf-cc-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    z-index: 1050;
    max-height: 420px;
    overflow-y: auto;
    display: none;
}
.tbf-cc-search-results.open { display: block; }
.tbf-cc-search-group {
    padding: 11px 15px 4px 15px;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--cc-faint);
}
a.tbf-cc-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 15px;
    text-decoration: none;
    color: var(--cc-ink);
    font-size: 0.86rem;
    font-weight: 600;
}
a.tbf-cc-search-item:hover, a.tbf-cc-search-item.active {
    background: #f1f5f9;
}
a.tbf-cc-search-item .tbf-cc-search-path {
    color: var(--cc-faint);
    font-size: 0.72rem;
    font-weight: 500;
}
a.tbf-cc-search-item i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex: 0 0 auto;
}

/* ---------- KPI strip ---------- */
.tbf-cc-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
a.tbf-cc-kpi {
    --acc: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 16px;
    padding: 14px 16px;
    text-decoration: none;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
a.tbf-cc-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -8px rgba(15, 23, 42, 0.09);
    border-color: color-mix(in srgb, var(--acc) 45%, #fff);
}
.tbf-cc-kpi .tbf-cc-kpi-label {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cc-faint);
}
.tbf-cc-kpi .tbf-cc-kpi-value {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cc-ink);
    line-height: 1.25;
    margin-top: 2px;
    transition: color 0.14s ease;
}
a.tbf-cc-kpi:hover .tbf-cc-kpi-value { color: var(--acc); }
.tbf-cc-kpi .tbf-cc-kpi-sub {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--acc);
    margin-top: 1px;
}
.tbf-cc-kpi .tbf-cc-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto;
    color: var(--acc);
    background: color-mix(in srgb, var(--acc) 9%, #fff);
    border: 1px solid color-mix(in srgb, var(--acc) 20%, #fff);
    transition: background 0.14s ease, color 0.14s ease;
}
a.tbf-cc-kpi:hover .tbf-cc-kpi-icon {
    background: var(--acc);
    color: #fff;
}

/* ---------- Quick Actions bar ---------- */
.tbf-cc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--cc-ink);
    border-radius: 16px;
    padding: 12px 15px;
    margin-bottom: 20px;
}
.tbf-cc-actions .tbf-cc-actions-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.tbf-cc-actions .tbf-cc-actions-label .tbf-cc-bolt {
    width: 27px;
    height: 27px;
    border-radius: 9px;
    background: var(--tbf-primary, #0284c7);
    color: var(--tbf-on-primary, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.tbf-cc-actions .tbf-cc-actions-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
a.tbf-cc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 11px;
    padding: 7px 13px;
    font-size: 0.73rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: background 0.14s ease;
    white-space: nowrap;
}
a.tbf-cc-action-btn:hover { background: #334155; color: #fff; }
a.tbf-cc-action-btn.primary {
    background: var(--tbf-primary, #0284c7);
    border-color: transparent;
    color: var(--tbf-on-primary, #fff);
}
a.tbf-cc-action-btn.primary:hover {
    background: var(--tbf-primary-dark, #026aa0);
    color: var(--tbf-on-primary, #fff);
}

/* ---------- section titles ---------- */
.tbf-cc-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cc-muted);
    margin: 4px 2px 10px 2px;
}

/* ---------- quick access + recent chips ---------- */
.tbf-cc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
a.tbf-cc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cc-ink);
    text-decoration: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
    max-width: 100%;
}
a.tbf-cc-chip:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
    color: var(--cc-ink);
}
a.tbf-cc-chip i { font-size: 0.76rem; }
a.tbf-cc-chip .tbf-cc-chip-x {
    color: #cbd5e1;
    margin-left: 2px;
    padding: 2px;
}
a.tbf-cc-chip .tbf-cc-chip-x:hover { color: #ef4444; }
.tbf-cc-empty-hint {
    color: var(--cc-faint);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 2px 0 2px;
    margin-bottom: 20px;
}

/* ---------- breadcrumb (drill-down levels) ---------- */
.tbf-cc-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 14px;
}
.tbf-cc-crumbs a {
    color: var(--cc-muted);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 8px;
}
.tbf-cc-crumbs a:hover { background: #eef2f7; color: var(--cc-ink); }
.tbf-cc-crumbs .sep { color: #cbd5e1; font-size: 0.65rem; }
.tbf-cc-crumbs .current {
    color: var(--cc-ink);
    font-weight: 800;
    padding: 3px 8px;
}

/* ---------- card grids ---------- */
.tbf-cc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.tbf-cc-card {
    --acc: #64748b;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    padding: 18px;
    cursor: pointer;
    text-decoration: none;
    color: var(--cc-ink);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease;
}
.tbf-cc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.1);
    border-color: color-mix(in srgb, var(--acc) 55%, #fff);
    color: var(--cc-ink);
}
.tbf-cc-card .tbf-cc-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.tbf-cc-card .tbf-cc-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--acc);
    background: color-mix(in srgb, var(--acc) 9%, #fff);
    border: 1px solid color-mix(in srgb, var(--acc) 20%, #fff);
    transition: background 0.18s ease, color 0.18s ease;
}
.tbf-cc-card:hover .tbf-cc-card-icon {
    background: var(--acc);
    color: #fff;
}
.tbf-cc-card .tbf-cc-card-arrow {
    color: #cbd5e1;
    font-size: 0.75rem;
    margin-top: 4px;
    transition: transform 0.18s ease, color 0.18s ease;
}
.tbf-cc-card:hover .tbf-cc-card-arrow {
    transform: translateX(3px);
    color: var(--acc);
}
.tbf-cc-card .tbf-cc-card-title {
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: -0.015em;
    margin-top: 14px;
    transition: color 0.14s ease;
}
.tbf-cc-card:hover .tbf-cc-card-title { color: var(--acc); }
.tbf-cc-card .tbf-cc-card-desc {
    font-size: 0.77rem;
    font-weight: 500;
    color: var(--cc-muted);
    line-height: 1.55;
    margin-top: 4px;
    min-height: 2.4em;
}
.tbf-cc-card .tbf-cc-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 11px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cc-faint);
}
.tbf-cc-card .tbf-cc-card-open {
    font-weight: 800;
    color: color-mix(in srgb, var(--acc) 82%, #000);
    white-space: nowrap;
}

/* ---------- page rows (level 3) ---------- */
.tbf-cc-pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
a.tbf-cc-page {
    --acc: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--cc-ink);
    font-size: 0.86rem;
    font-weight: 700;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
a.tbf-cc-page:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -8px rgba(15, 23, 42, 0.09);
    border-color: color-mix(in srgb, var(--acc) 50%, #fff);
    color: var(--cc-ink);
}
a.tbf-cc-page i.tbf-cc-page-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex: 0 0 auto;
    color: var(--acc);
    background: color-mix(in srgb, var(--acc) 9%, #fff);
    border: 1px solid color-mix(in srgb, var(--acc) 18%, #fff);
    transition: background 0.14s ease, color 0.14s ease;
}
a.tbf-cc-page:hover i.tbf-cc-page-icon {
    background: var(--acc);
    color: #fff;
}
a.tbf-cc-page .tbf-cc-page-arrow {
    margin-left: auto;
    color: #cbd5e1;
    font-size: 0.68rem;
    transition: transform 0.14s ease, color 0.14s ease;
}
a.tbf-cc-page:hover .tbf-cc-page-arrow {
    transform: translateX(2px);
    color: var(--acc);
}
.tbf-cc-page .tbf-cc-star {
    border: none;
    background: transparent;
    color: #cbd5e1;
    padding: 2px 6px;
    font-size: 0.85rem;
    flex: 0 0 auto;
    cursor: pointer;
    transition: color 0.12s ease;
}
.tbf-cc-page .tbf-cc-star:hover { color: #f59e0b; }
.tbf-cc-page .tbf-cc-star.pinned { color: #f59e0b; }

/* Hub row (module overview link at the top of a drill-down level) */
a.tbf-cc-hub-link {
    border-style: dashed;
    background: #f8fafc;
}

/* ---------- drill-down launcher (premium pass 2) ---------- */
.tbf-cc-launcher-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--cc-border);
}
.tbf-cc-launcher-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cc-ink);
    margin-top: 2px;
}
.tbf-cc-launcher-count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cc-faint);
}

/* Segment tabs — one pill strip, anchors so hash routing does the work */
.tbf-cc-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    background: #eef2f7;
    border: 1px solid var(--cc-border);
    border-radius: 14px;
    padding: 5px;
    align-self: flex-start;
}
a.tbf-cc-tab {
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--cc-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.14s ease, background 0.14s ease;
}
a.tbf-cc-tab:hover { color: var(--cc-ink); }
a.tbf-cc-tab.active {
    background: var(--cc-ink);
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
a.tbf-cc-tab .tbf-cc-tab-count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.64rem;
    opacity: 0.65;
    margin-left: 3px;
}

/* Spotlight tiles — page launch cards inside a module */
.tbf-cc-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
a.tbf-cc-tile {
    --acc: #64748b;
    display: flex;
    flex-direction: column;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 16px;
    padding: 15px;
    text-decoration: none;
    color: var(--cc-ink);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}
a.tbf-cc-tile:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: color-mix(in srgb, var(--acc) 60%, #fff);
    box-shadow: 0 20px 30px -10px color-mix(in srgb, var(--acc) 22%, transparent);
    color: var(--cc-ink);
}
.tbf-cc-tile .tbf-cc-tile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.tbf-cc-tile .tbf-cc-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex: 0 0 auto;
    color: var(--acc);
    background: color-mix(in srgb, var(--acc) 9%, #fff);
    border: 1px solid color-mix(in srgb, var(--acc) 20%, #fff);
    transition: background 0.18s ease, color 0.18s ease;
}
a.tbf-cc-tile:hover .tbf-cc-tile-icon {
    background: var(--acc);
    color: #fff;
}
.tbf-cc-tile .tbf-cc-tile-side {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tbf-cc-tile .tbf-cc-tile-badge {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cc-muted);
    background: #f1f5f9;
    border: 1px solid var(--cc-border);
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}
.tbf-cc-tile .tbf-cc-star {
    border: none;
    background: transparent;
    color: #cbd5e1;
    padding: 2px 5px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.12s ease;
}
.tbf-cc-tile .tbf-cc-star:hover { color: #f59e0b; }
.tbf-cc-tile .tbf-cc-star.pinned { color: #f59e0b; }
.tbf-cc-tile .tbf-cc-tile-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.87rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-top: 12px;
    transition: color 0.14s ease;
}
a.tbf-cc-tile:hover .tbf-cc-tile-title { color: var(--acc); }
.tbf-cc-tile .tbf-cc-tile-arrow {
    color: #cbd5e1;
    font-size: 0.68rem;
    transition: transform 0.18s ease, color 0.18s ease;
}
a.tbf-cc-tile:hover .tbf-cc-tile-arrow {
    transform: translateX(3px);
    color: var(--acc);
}

/* Staggered entrance — every card/tile carries --i (its index) inline */
.tbf-cc-anim {
    animation: tbfCcTileIn 0.38s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes tbfCcTileIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .tbf-cc-anim { animation: none; }
    .tbf-cc-card, a.tbf-cc-tile, a.tbf-cc-kpi, a.tbf-cc-page { transition: none; }
}

/* ---------- view switching ---------- */
.tbf-cc-view { display: none; }
.tbf-cc-view.active { display: block; animation: tbfCcFade 0.18s ease; }
@keyframes tbfCcFade {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- mobile ---------- */
@media (max-width: 575.98px) {
    .tbf-cc-hero h1 { font-size: 1.2rem; }
    .tbf-cc-live-pill { display: none; }
    .tbf-cc-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tbf-cc-card { padding: 14px; }
    .tbf-cc-card .tbf-cc-card-desc { display: none; }
    .tbf-cc-card .tbf-cc-card-foot .tbf-cc-card-open { display: none; }
    .tbf-cc-pages { grid-template-columns: 1fr; }
    .tbf-cc-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
    .tbf-cc-kpi .tbf-cc-kpi-value { font-size: 1.15rem; }
    .tbf-cc-actions { padding: 10px 12px; }
}

/* ---------- grouped "All Tools" view: one titled block per sub-module ---------- */
.tbf-cc-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 0 12px;
    margin-bottom: 16px;
    max-width: 460px;
}
.tbf-cc-filter > i { color: var(--cc-faint); font-size: 0.8rem; }
.tbf-cc-filter-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.85rem;
    color: var(--cc-ink);
}
.tbf-cc-filter-empty { display: none; font-size: 0.75rem; color: var(--cc-muted); white-space: nowrap; }

.tbf-cc-groups { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.tbf-cc-group {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 16px;
    padding: 6px 14px 14px;
}
.tbf-cc-group.tbf-cc-empty { display: none; }
.tbf-cc-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0 10px;
}
.tbf-cc-group-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    border: none;
    background: transparent;
    padding: 4px 2px;
    cursor: pointer;
    color: var(--cc-ink);
    text-align: left;
}
.tbf-cc-group-chev { font-size: 0.7rem; color: var(--cc-faint); transition: transform 0.16s ease; }
.tbf-cc-group.collapsed .tbf-cc-group-chev { transform: rotate(-90deg); }
.tbf-cc-group-title { font-size: 0.98rem; font-weight: 800; letter-spacing: -0.02em; }
.tbf-cc-group-count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--cc-muted);
    background: #f1f5f9;
    border: 1px solid var(--cc-border);
    border-radius: 999px;
    padding: 2px 8px;
}
a.tbf-cc-group-open {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--cc-muted);
    text-decoration: none;
    white-space: nowrap;
}
a.tbf-cc-group-open:hover { color: var(--cc-ink); }
a.tbf-cc-group-open i { font-size: 0.62rem; margin-left: 3px; }
.tbf-cc-group.collapsed .tbf-cc-group-body { display: none; }

.tbf-cc-minis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
a.tbf-cc-mini {
    --acc: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: var(--cc-ink);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
a.tbf-cc-mini:hover {
    border-color: color-mix(in srgb, var(--acc) 55%, #fff);
    box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--acc) 30%, transparent);
    transform: translateY(-1px);
    color: var(--cc-ink);
}
.tbf-cc-mini .tbf-cc-mini-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 0.82rem;
    color: var(--acc);
    background: color-mix(in srgb, var(--acc) 9%, #fff);
    border: 1px solid color-mix(in srgb, var(--acc) 20%, #fff);
}
.tbf-cc-mini .tbf-cc-mini-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
}
.tbf-cc-mini .tbf-cc-star {
    border: none;
    background: transparent;
    color: #cbd5e1;
    padding: 2px 4px;
    font-size: 0.78rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, color 0.12s ease;
}
a.tbf-cc-mini:hover .tbf-cc-star, .tbf-cc-mini .tbf-cc-star.pinned, .tbf-cc-mini .tbf-cc-star:focus { opacity: 1; }
.tbf-cc-mini .tbf-cc-star:hover, .tbf-cc-mini .tbf-cc-star.pinned { color: #f59e0b; }
@media (hover: none) { .tbf-cc-mini .tbf-cc-star { opacity: 1; } }

/* long groups show the first few; "Show more" reveals the rest */
.tbf-cc-group:not(.expanded) .tbf-cc-more-item { display: none; }
.tbf-cc-showmore {
    margin-top: 10px;
    border: 1px dashed var(--cc-border);
    background: #f8fafc;
    color: var(--cc-muted);
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.tbf-cc-showmore:hover { color: var(--cc-ink); border-color: var(--cc-faint); }

/* filtering: show every match (even in collapsed / "more" areas), hide the rest */
.tbf-cc-groups.filtering .tbf-cc-group.collapsed .tbf-cc-group-body { display: block; }
.tbf-cc-groups.filtering .tbf-cc-more-item { display: flex; }
.tbf-cc-groups.filtering .tbf-cc-showmore { display: none; }
.tbf-cc-groups .tbf-cc-miss { display: none !important; }

@media (max-width: 575.98px) {
    .tbf-cc-minis { grid-template-columns: 1fr; }
    .tbf-cc-group { padding: 4px 10px 12px; }
    a.tbf-cc-group-open { display: none; }
}
