/* ============================================================================
   Community cards — "AI 2026 / Minimal-Mono" restyle.
   Loaded LAST (after dark-mode.css) so these win by order. CSS-only: targets
   existing classes, changes no markup/logic. Remove the <link> to revert.
   Aesthetic: flat dark, hairline borders, airy spacing, tiny uppercase mono
   labels, monospace accents — calm and data-dense ("terminal-elegant").
============================================================================ */
:root {
    --ai26-mono: 'JetBrains Mono', 'SF Mono', 'Roboto Mono', ui-monospace, Menlo, Consolas, monospace;
    --ai26-line: rgba(255, 255, 255, 0.09);
    --ai26-line-strong: rgba(255, 255, 255, 0.18);
    --ai26-dim: rgba(255, 255, 255, 0.42);
    --ai26-dim2: rgba(255, 255, 255, 0.62);
    --ai26-ink: rgba(255, 255, 255, 0.92);
    --ai26-chip: rgba(255, 255, 255, 0.04);
}

/* ── Card shell: flat, hairline, no gradient bar, calm hover ── */
[data-theme="dark"] .shared-item {
    background: rgba(255, 255, 255, 0.012);
    border: 1px solid var(--ai26-line);
    border-radius: 12px;
    padding: 1.5rem 1.65rem;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}
[data-theme="dark"] .shared-item::before { display: none; }   /* kill gradient top bar */
[data-theme="dark"] .shared-item:hover {
    border-color: var(--ai26-line-strong);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: none;
    transform: none;                                            /* no lift — quiet */
}

/* ── Header: mono title, dim author ── */
[data-theme="dark"] .item-title {
    font-family: var(--ai26-mono);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ai26-ink);
}
[data-theme="dark"] .item-author,
[data-theme="dark"] .item-author-name {
    font-family: var(--ai26-mono);
    font-size: 0.72rem;
    color: var(--ai26-dim);
    font-weight: 400;
}

/* ── Badges: uniform hairline outline pills (neutralize colored + inline bg) ── */
[data-theme="dark"] .shared-item .badge {
    background: transparent !important;
    border: 1px solid var(--ai26-line-strong);
    color: var(--ai26-dim2) !important;
    font-family: var(--ai26-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.16rem 0.5rem;
    border-radius: 5px;
}

/* ── Info rows: airy, with quiet uppercase mono labels (no colored pills) ── */
[data-theme="dark"] .shared-item .expr-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.35rem;
}
[data-theme="dark"] .shared-item .expr-info-row {
    align-items: baseline;
    gap: 0.85rem;
    font-size: 0.85rem;
}
[data-theme="dark"] .shared-item .expr-info-label {
    background: transparent !important;
    color: var(--ai26-dim) !important;
    font-family: var(--ai26-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0;
    border-radius: 0;
    min-width: 78px;
    text-align: left;
    margin-top: 0;
}
[data-theme="dark"] .shared-item .expr-info-text {
    color: var(--ai26-dim2);
    line-height: 1.55;
}
[data-theme="dark"] .shared-item .expr-info-text code {
    font-family: var(--ai26-mono);
    background: var(--ai26-chip);
    border: 1px solid var(--ai26-line);
    border-radius: 5px;
    padding: 0.06rem 0.34rem;
    color: var(--ai26-ink);
}

/* ── Code / expression preview chip ── */
[data-theme="dark"] .shared-item .sf-expr-preview {
    font-family: var(--ai26-mono);
    background: var(--ai26-chip);
    border: 1px solid var(--ai26-line);
    border-radius: 7px;
    color: var(--ai26-dim2);
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
    margin: 0.2rem 0 0.6rem;
}

/* ── Snapshot/metrics bar: hairline rule, mono numbers ── */
[data-theme="dark"] .shared-item .sf-snapshot-bar {
    border-top: 1px solid var(--ai26-line);
    margin-top: 1rem;
    padding-top: 0.85rem;
    gap: 1.1rem;
}
[data-theme="dark"] .shared-item .sf-snap-label {
    font-family: var(--ai26-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ai26-dim);
}
[data-theme="dark"] .shared-item .sf-snap-val {
    font-family: var(--ai26-mono);
    color: var(--ai26-ink);
    font-weight: 600;
}
[data-theme="dark"] .shared-item .sf-snap-val-pos { color: #4ade80; }
[data-theme="dark"] .shared-item .sf-snap-val-neg { color: #f87171; }

/* ── Buttons inside cards: ghost outline mono ── */
[data-theme="dark"] .shared-item .btn-small {
    font-family: var(--ai26-mono);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    background: transparent;
    border: 1px solid var(--ai26-line-strong);
    color: var(--ai26-dim2);
    border-radius: 6px;
    transition: border-color 0.15s ease, color 0.15s ease;
}
[data-theme="dark"] .shared-item .btn-small:hover {
    border-color: rgba(255, 255, 255, 0.34);
    color: var(--ai26-ink);
}

/* ── Tags: hairline mono chips ── */
[data-theme="dark"] .shared-item .item-tags .tag {
    font-family: var(--ai26-mono);
    font-size: 0.66rem;
    background: transparent;
    border: 1px solid var(--ai26-line);
    color: var(--ai26-dim);
    border-radius: 5px;
}
[data-theme="dark"] .shared-item .item-tags .tag:hover {
    border-color: var(--ai26-line-strong);
    color: var(--ai26-dim2);
}

/* ── Inline details panel (the in-place expand) blends in ── */
[data-theme="dark"] .shared-item > .details-inline {
    background: rgba(255, 255, 255, 0.015);
    border-top: 1px solid var(--ai26-line);
}

/* ============================================================================
   DRAMATIC LAYER — accent, depth, glow on top of the mono base.
   Accent = cyan(#38bdf8) → indigo(#818cf8). Keeps mono cleanliness, adds wow.
============================================================================ */

/* ── Hero title: gradient text + glow ── */
[data-theme="dark"] .header h1 {
    font-size: clamp(2.1rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #e0f2fe 0%, #7dd3fc 42%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 42px rgba(56, 189, 248, 0.18);
}
[data-theme="dark"] .header h1 .saas-readonly-badge {
    -webkit-text-fill-color: initial;
    font-family: var(--ai26-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
    box-shadow: 0 0 18px -4px rgba(56, 189, 248, 0.5);
}

/* ── Type bar: base chips quiet, LEAD chips glow with an accent dot ── */
[data-theme="dark"] .type-tab {
    font-family: var(--ai26-mono);
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--ai26-line);
    color: var(--ai26-dim2);
    border-radius: 9px;
    padding: 0.42rem 0.72rem;
    transition: all 0.15s ease;
}
[data-theme="dark"] .type-tab:hover {
    border-color: var(--ai26-line-strong);
    color: var(--ai26-ink);
}
[data-theme="dark"] .type-tab .type-tab-count {
    color: var(--ai26-dim);
    margin-left: 0.32rem;
    font-weight: 600;
}
[data-theme="dark"] .type-tab-lead {
    border-color: rgba(56, 189, 248, 0.4);
    color: #e0f2fe;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.10), rgba(129, 140, 248, 0.05));
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.05), 0 8px 22px -12px rgba(56, 189, 248, 0.6);
    font-weight: 600;
}
[data-theme="dark"] .type-tab-lead::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 7px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    box-shadow: 0 0 9px rgba(56, 189, 248, 0.85);
    vertical-align: middle;
}
[data-theme="dark"] .type-tab-lead .type-tab-count { color: #7dd3fc; }
[data-theme="dark"] .type-tab-lead:hover { border-color: rgba(56, 189, 248, 0.72); }
[data-theme="dark"] .type-tab.active {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px -8px rgba(56, 189, 248, 0.75);
}
[data-theme="dark"] .type-tab.active::before { background: #fff; box-shadow: 0 0 9px rgba(255, 255, 255, 0.8); }
[data-theme="dark"] .type-tab.active .type-tab-count { color: rgba(255, 255, 255, 0.85); }
[data-theme="dark"] .type-tab.zero { opacity: 0.4; }

/* ── Cards: accent left stripe + glow on hover + brighter title ── */
[data-theme="dark"] .shared-item { padding-left: 1.95rem; }
[data-theme="dark"] .shared-item::before {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 3px;
    height: auto;
    background: linear-gradient(180deg, #38bdf8, #818cf8);
    opacity: 0.42;
    border-radius: 12px 0 0 12px;
    transition: opacity 0.18s ease, width 0.18s ease;
}
[data-theme="dark"] .shared-item:hover::before { opacity: 1; width: 4px; }
[data-theme="dark"] .shared-item:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.03);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.10), 0 16px 44px -18px rgba(56, 189, 248, 0.38);
    transform: none;
}
[data-theme="dark"] .item-title { color: #f1f5f9; font-size: 0.95rem; }
[data-theme="dark"] .shared-item .badge {
    border-color: rgba(56, 189, 248, 0.35);
    color: #7dd3fc !important;
}

/* ── Make the one-line expression preview a visual "flow chip" (narrow text,
   more visual) — accent left edge + gradient, without replacing the tree. ── */
[data-theme="dark"] .shared-item .sf-expr-preview {
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-left: 3px solid #38bdf8;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.09), rgba(129, 140, 248, 0.03));
    color: #cbd5e1;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}
/* Keep the collapsed Desc tight (2 lines max) so cards stay scannable. The
   expanded rows are added separately, so this only clips the summary line. */
[data-theme="dark"] .shared-item .expr-info-row .lbl-desc + .expr-info-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
