/* Design tokens. Bootstrap handles form controls; these drive the app chrome. */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --border: #e3e6eb;
    --text: #15181d;
    --muted: #646b76;
    --accent: #2f6fed;
    --accent-soft: #e8efff;
    --success: #12805c;
    --success-soft: #e3f5ee;
    --danger: #c9372c;
    --danger-soft: #fdecea;
    --info: #2f6fed;
    --info-soft: #e8efff;
    --warning-soft: #fff6e0;
    --facebook: #1877f2;
    --instagram: #d6249f;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --sidebar-width: 240px;

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-primary: var(--accent);
    --bs-link-color: var(--accent);
    --bs-link-hover-color: var(--accent);
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-bs-theme="dark"] {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --border: #2a2f3a;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --accent: #6b9bff;
    --accent-soft: #1d2a47;
    --success: #4cc79a;
    --success-soft: #133328;
    --danger: #ff7b70;
    --danger-soft: #3a1b19;
    --info: #6b9bff;
    --info-soft: #1d2a47;
    --warning-soft: #3a3016;
    --shadow: none;

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--bs-font-sans-serif);
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.6rem; font-weight: 650; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
h1:focus { outline: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { color: inherit; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }

.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: color-mix(in srgb, var(--accent) 88%, black); --bs-btn-hover-border-color: transparent; --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: .4rem; border-radius: 8px; font-weight: 500; }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem var(--accent-soft); border-color: var(--accent); }
.form-control, .form-select { background-color: var(--surface); border-color: var(--border); color: var(--text); border-radius: 8px; }
.form-label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .4rem; }
.alert { border-radius: 10px; }
.icon { flex-shrink: 0; vertical-align: -.15em; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 .5rem 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: white; }
.sidebar-close { display: none; }
.team-switcher select {
    width: 100%; padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font-weight: 600; margin-bottom: .75rem;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border-radius: 8px; color: var(--muted);
    text-decoration: none; font-weight: 500; background: none; border: 0; width: 100%; text-align: left; min-width: 0;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: .75rem; display: flex; flex-direction: column; gap: 2px; }
.main { flex: 1; min-width: 0; }
.mobile-bar { display: none; }
.content { padding: 2rem clamp(1rem, 3vw, 2.5rem); max-width: 1200px; }

@media (max-width: 860px) {
    .sidebar { position: fixed; z-index: 30; left: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
    .sidebar.open { transform: none; }
    .sidebar-close { display: inline-flex; }
    .mobile-bar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
    .content { padding: 1.25rem 1rem; }
}

.icon-button { display: inline-grid; place-items: center; background: none; border: 0; color: var(--muted); padding: .3rem; border-radius: 6px; }
.icon-button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-button:disabled { opacity: .35; }

/* Page structure */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header p { margin: .25rem 0 0; }
.section { margin-bottom: 2.25rem; }
.section > h2, .section-header { margin-bottom: .85rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.narrow { max-width: 480px; margin: 3rem auto; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card-grid .card + .card { margin-top: 0; }
.card-link { text-decoration: none; color: inherit; transition: border-color .15s; }
.card-link:hover { border-color: var(--accent); }
.card-title { font-weight: 600; font-size: 1.05rem; }
.input-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.input-row > .form-control { flex: 1; min-width: 180px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.help { font-size: .85rem; color: var(--muted); background: var(--surface-2); padding: .65rem .8rem; border-radius: 8px; margin-bottom: 1rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state h2 { color: var(--text); margin: .75rem 0 .35rem; }
.empty-state.small { padding: 1.5rem; }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: none; padding: .35rem .8rem; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: .6rem 0; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: .75rem; background: var(--surface-2); padding: 0 .45rem; border-radius: 99px; color: var(--muted); }
.tab-count.danger { background: var(--danger-soft); color: var(--danger); }

.badge { font-weight: 600; font-size: .72rem; padding: .25em .6em; border-radius: 99px; }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* Lists (connections, members) */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list:empty { display: none; }
.list-row { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; }
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row.nested { padding-left: 3.25rem; background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.list-main { flex: 1; min-width: 0; }
.list-actions { display: flex; gap: .35rem; align-items: center; }
.list-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.list-icon.initials { border-radius: 50%; font-weight: 600; }
.sync-status { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sync-status.ok { color: var(--success); }
.sync-status.error { color: var(--danger); white-space: normal; }

.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 600; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-badge { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: white; border: 2px solid var(--surface); }
.avatar-facebook .avatar-badge { background: var(--facebook); }
.avatar-instagram .avatar-badge { background: var(--instagram); }

/* Dashboard */
.source-section { margin-bottom: 2rem; }
.source-heading { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .85rem; }
.metric-grid .card + .card { margin-top: 0; }
.metric-card { padding: 1rem 1rem .75rem; }
.metric-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.metric-value { font-size: 1.65rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.delta { font-size: .8rem; font-weight: 600; margin-bottom: .5rem; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.line-chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.line-chart-wrap { position: relative; height: 56px; }
.line-chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.line-chart-area { fill: var(--accent); opacity: .1; }
.line-chart-axis { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-top: .25rem; }
.chart-empty { height: 56px; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }

/* Compose */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 1080px) { .compose { grid-template-columns: 1fr; } .compose-preview { order: -1; } }
.compose-text { resize: vertical; min-height: 150px; font-size: 1rem; }
.compose-meta { display: flex; gap: 1rem; font-size: .8rem; margin-top: .35rem; }
.compose-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.media-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: .25rem; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .15s; }
.media-tile:hover .media-tile-actions, .media-tile:focus-within .media-tile-actions { opacity: 1; }
.media-tile-actions .icon-button { color: white; }
.media-drop { aspect-ratio: 1; border: 1.5px dashed var(--border); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; color: var(--muted); font-size: .8rem; text-align: center; cursor: pointer; position: relative; padding: .5rem; }
.media-drop:hover { border-color: var(--accent); color: var(--accent); }
.media-drop.busy { cursor: progress; }
.media-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.account-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.account-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .75rem .3rem .3rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 500; }
.account-chip.selected { border-color: var(--accent); background: var(--accent-soft); }
.compose-preview { position: sticky; top: 1.5rem; }
.preview-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: .5rem; }
.preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.preview-header { display: flex; gap: .65rem; align-items: center; padding: .85rem; }
.preview-text { padding: 0 .85rem .85rem; white-space: pre-wrap; word-break: break-word; font-size: .95rem; }
.preview-media { position: relative; background: #000; }
.preview-media img, .preview-media video { width: 100%; display: block; max-height: 420px; object-fit: contain; }
.preview-count { position: absolute; top: .5rem; right: .5rem; background: rgba(0, 0, 0, .6); color: white; font-size: .75rem; padding: .1rem .45rem; border-radius: 99px; }
.preview-link { margin: 0 .85rem .85rem; padding: .6rem .75rem; background: var(--surface-2); border-radius: 8px; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Posts */
.post-list { display: flex; flex-direction: column; gap: .75rem; }
.post-list .card + .card { margin-top: 0; }
.post-row { display: flex; gap: 1rem; align-items: flex-start; }
.post-thumb { position: relative; width: 72px; height: 72px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.post-thumb img, .post-thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-thumb-count { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .6); color: white; font-size: .7rem; padding: 0 .35rem; border-radius: 99px; }
.post-body { flex: 1; min-width: 0; }
.post-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.post-text { margin: .45rem 0 .55rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.target-list { display: flex; gap: .4rem; flex-wrap: wrap; }
.target { display: inline-flex; gap: .3rem; align-items: center; font-size: .78rem; font-weight: 500; padding: .15rem .55rem; border-radius: 99px; }
.target a { color: inherit; }
.target-error { font-size: .8rem; color: var(--danger); margin-top: .4rem; }
.post-actions { display: flex; gap: .25rem; align-items: center; flex-shrink: 0; }
@media (max-width: 640px) { .post-row { flex-wrap: wrap; } .post-actions { width: 100%; justify-content: flex-end; } }

.invite-link { margin-top: 1rem; padding: .85rem; border-radius: 10px; background: var(--success-soft); }

/* Loading */
.skeleton-stack { display: flex; flex-direction: column; gap: .75rem; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Template bits kept for the Identity pages */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); }
.darker-border-checkbox.form-check-input { border-color: #929292; }
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { color: var(--bs-secondary-color); text-align: end; }
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { text-align: start; }

#blazor-error-ui { background: var(--danger-soft); color: var(--danger); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--danger); padding: 1rem; color: white; border-radius: 8px; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* Search performance leaderboards */
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-top: 1rem; }
.search-grid .card + .card { margin-top: 0; }
.search-table table { width: 100%; margin-top: .5rem; border-collapse: collapse; table-layout: fixed; font-size: .88rem; }
.search-table th { color: var(--muted); font-weight: 500; text-align: right; font-size: .75rem; padding: .2rem 0; }
.search-table th:first-child, .search-table td:first-child { text-align: left; }
.search-table th:not(:first-child), .search-table td:not(:first-child) { width: 4.5rem; }
.search-table td { padding: .3rem 0; border-top: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.tracked-queries { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; }
.tracked-chip { display: inline-flex; align-items: center; gap: .15rem; background: var(--surface-2); border-radius: 99px; padding: .1rem .2rem .1rem .65rem; font-size: .82rem; }
.tracked-add { display: inline-flex; gap: .35rem; }
.tracked-add input { width: 14rem; }
.property-select { width: auto; max-width: 11rem; }
.property-heading { font-size: 1.25rem; margin: 2rem 0 .25rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.property-heading:first-of-type { margin-top: 0; }
.property-label { margin: .75rem 0 .25rem; }
.property-label:first-of-type { margin-top: .25rem; }

/* Chart hover: a column per point shows a guide, a dot and a tooltip */
.chart-col { position: absolute; top: 0; bottom: 0; outline: none; }
.chart-guide { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--border); display: none; }
.chart-dot { position: absolute; left: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-sizing: border-box; display: none; }
.chart-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 30; display: none; flex-direction: column; gap: 1px; white-space: nowrap; pointer-events: none;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .55rem; font-size: .8rem; box-shadow: var(--shadow); }
.chart-tip-date { color: var(--muted); font-size: .72rem; }
.chart-col.first .chart-tip { left: 0; transform: none; }
.chart-col.last .chart-tip { left: auto; right: 0; transform: none; }
.chart-col:hover .chart-guide, .chart-col:hover .chart-dot, .chart-col:hover .chart-tip,
.chart-col:focus .chart-guide, .chart-col:focus .chart-dot, .chart-col:focus .chart-tip { display: block; }
.chart-col:hover .chart-tip, .chart-col:focus .chart-tip { display: flex; }
.search-growth { display: block; font-size: .7rem; line-height: 1.1; }
.search-growth.up { color: var(--bs-success, #1a7f4b); }
.search-growth.down { color: var(--bs-danger, #c0392b); }
.search-growth.flat { color: var(--muted); }

/* Messages */
.inbox { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 1rem; align-items: start; }
.inbox-list { display: flex; flex-direction: column; gap: .5rem; max-height: calc(100vh - 14rem); overflow-y: auto; }
.conversation { display: flex; gap: .75rem; align-items: center; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem; color: inherit; }
.conversation:hover { border-color: var(--accent); }
.conversation.active { border-color: var(--accent); background: var(--accent-soft); }
.conversation-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.conversation-top { display: flex; justify-content: space-between; gap: .5rem; }
.conversation-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation.unread .conversation-name, .conversation.unread .conversation-preview { font-weight: 700; color: var(--text); }
.conversation-time, .conversation-account { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.conversation-preview { font-size: .875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.inbox-thread { display: flex; flex-direction: column; min-height: 24rem; max-height: calc(100vh - 14rem); padding: 0; }
.thread-header { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.thread-back { display: none; }
/* column-reverse keeps the scroll anchored at the newest message without any script. */
.thread-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column-reverse; padding: 1rem; }
.bubble-row { display: flex; flex-direction: column; margin-bottom: .6rem; max-width: 80%; }
.bubble-row.mine { align-items: flex-end; margin-left: auto; }
.bubble-row.theirs { align-items: flex-start; }
.bubble { padding: .5rem .8rem; border-radius: 16px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: .25rem; }
.mine .bubble { background: var(--accent); color: white; }
.mine .bubble a { color: inherit; }
.bubble.failed { background: var(--danger-soft); color: var(--danger); }
.bubble-attachment { display: inline-flex; align-items: center; gap: .3rem; font-size: .875rem; }
.bubble-meta { font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.thread-note { display: flex; gap: .4rem; align-items: center; margin: 0; padding: .8rem 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.thread-compose { display: flex; flex-direction: column; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--border); }
.thread-compose-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
@media (max-width: 800px) {
    .inbox { grid-template-columns: 1fr; }
    .inbox.has-thread .inbox-list { display: none; }
    .inbox:not(.has-thread) .inbox-thread { display: none; }
    .inbox-list, .inbox-thread { max-height: none; }
    .thread-back { display: inline-grid; }
}

/* Insights */
.insights { margin-bottom: 1.5rem; }
.insights h2 { margin-top: 0; }
.insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.insight { display: grid; gap: .15rem; padding-left: .75rem; border-left: 3px solid var(--muted); }
.insight.positive { border-left-color: var(--success); }
.insight.warning { border-left-color: var(--danger); }
