body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #1f2937;
    overscroll-behavior-y: none; /* suppress browser's native rubber-band so our pull-to-refresh controls it */
}

main {
    transform-origin: top center;
    will-change: transform;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 3px 2rem;
    background: linear-gradient(135deg, #435335 0%, #2e3a24 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 90;
}

.brand-logo {
    font-size: 1.75rem;
    font-weight: 700;
}

.brand-logo-btn {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 1;
    transition: opacity 0.15s;
}

.brand-logo-btn:hover { opacity: 0.8; }

.brand-logo-img {
    display: block;
    height: calc(100% - 6px); /* fills header minus 3px top+bottom padding */
    max-height: 56px;
    width: auto;
}

.brand-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #a3b899;
    letter-spacing: 0.02em;
}

.brand-tagline {
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

main.has-sidebar {
    grid-template-columns: 300px 1fr;
}

.sidebar {
    position: sticky;
    top: 80px;
    min-height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}

.feed-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.sources-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 2rem;
}

.articles-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 2rem;
}

.articles-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.article-thumbnail {
    width: 200px;
    height: 140px;
    border-radius: 0.75rem;
    object-fit: cover;
    background: #f3f4f6;
}

.article-thumbnail-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    flex-shrink: 0;
}

.weave-thread-link {
    font-size: 0.72rem;
    color: #435335;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: block;
}

.weave-thread-link:hover {
    text-decoration: underline;
}

.weave-card--highlight {
    animation: weave-flash 1.8s ease-out;
}

@keyframes weave-flash {
    0%   { box-shadow: 0 0 0 3px #435335; }
    100% { box-shadow: none; }
}

.article-thumbnail--no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.source-favicon {
    width: 52px;
    height: 52px;
    border-radius: 0.5rem;
    object-fit: contain;
}

.article-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.article-source {
    font-weight: 600;
    color: #111827;
}

.article-date {
    color: #9ca3af;
}

.profile-topic-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #FBF9F6;
    color: #2e3a24;
    font-size: 0.82rem;
    font-weight: 600;
}

.gist-wrapper {
    cursor: pointer;
}

.gist-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
}

.gist-text.gist-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.gist-less {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    color: #435335;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
    margin-top: 0.15rem;
    font-family: inherit;
}

.gist-less:hover {
    text-decoration: underline;
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.article-engagement {
    margin-top: 0.75rem;
}

/* V1 feed card — match badge */
.card-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-left: auto;
}

.card-match-badge--exact {
    background: #e8f0e4;
    color: #2e3a24;
}

.card-match-badge--partial {
    background: #fef3c7;
    color: #92400e;
}

/* V1 feed card — In Your Lens block */
.lens-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.lens-block-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin: 0 0 0.3rem 0;
}

.lens-match-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lens-match-item {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.lens-match-item--exact {
    background: #e8f0e4;
    color: #2e3a24;
}

.lens-match-item--partial {
    background: #fef3c7;
    color: #92400e;
}

/* V1 feed card — The Margins placeholder */
.margins-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.margins-block-summary {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.margins-block-summary::-webkit-details-marker { display: none; }

.margins-block[open] .margins-block-summary {
    border-bottom: 1px solid #e5e7eb;
}

.margins-placeholder {
    font-size: 0.78rem;
    color: #9ca3af;
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-style: italic;
}

.margins-loading {
    font-size: 0.78rem;
    color: #9ca3af;
    padding: 0.5rem 0.75rem;
    margin: 0;
}

.margins-takes {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.margins-take {
    padding: 0.65rem 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.margins-take-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.margins-take-role {
    font-size: 0.68rem;
    color: #9ca3af;
    font-style: italic;
}

.margins-take-body {
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

/* V1 feed card — reaction bar */
.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.react-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1;
}

.react-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.react-btn--active {
    background: #e8f0e4;
    border-color: #435335;
    color: #2e3a24;
}

.react-emoji {
    font-size: 0.82rem;
}

.react-label {
    font-size: 0.78rem;
}

.react-count {
    font-size: 0.72rem;
    font-weight: 600;
    background: #fff;
    border-radius: 999px;
    padding: 0 0.3rem;
    margin-left: 0.1rem;
}

/* article-meta separator */
.article-meta-sep {
    color: #d1d5db;
    margin: 0 0.1rem;
}

.engage-label {
    font-size: 0.85rem;
}

.engagement-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reaction-emojis-left {
    font-size: 1rem;
    letter-spacing: 0.05em;
    min-width: 1rem;
}

.reaction-chip {
    cursor: default;
    display: inline-block;
}

.simple-tooltip {
    position: absolute;
    z-index: 1000;
    background: #2e3a24;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.reactor-tooltip {
    position: absolute;
    z-index: 999;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 0.5rem 0.75rem;
    min-width: 120px;
    max-width: 200px;
    pointer-events: auto;
}

.reactor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
    color: #374151;
}

.reactor-list li {
    padding: 0.1rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reactor-more {
    color: #9ca3af;
    font-style: italic;
}

.engagement-buttons {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.react-container {
    position: relative;
}

.engage-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.88rem;
    color: #9ca3af;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.engage-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.engage-btn--active {
    color: #435335;
}

.engage-count {
    font-size: 0.85rem;
}

.reaction-popup {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: auto;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
    gap: 0.15rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 20;
    white-space: nowrap;
    transition: opacity 0.1s, visibility 0.1s;
    transition-delay: 0.4s;
}

.reaction-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 6px;
    pointer-events: auto;
}

.react-container:hover .reaction-popup {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.reaction-emoji-btn {
    background: none;
    border: none;
    border-radius: 999px;
    padding: 0.2rem 0.3rem;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.1s;
}

.reaction-emoji-btn:hover {
    transform: scale(1.3);
}

.reaction-emoji-btn.active {
    background: #FBF9F6;
}

.article-topic-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #FBF9F6;
    color: #2e3a24;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.access-badge {
    font-size: 1rem;
    cursor: default;
    line-height: 1;
    position: relative;
}

.access-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.access-badge:hover::after {
    opacity: 1;
}

.article-headline {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.article-headline a {
    color: inherit;
    text-decoration: none;
}

.article-headline a:hover {
    text-decoration: underline;
}

.article-gist {
    border-left: 3px solid #435335;
    padding-left: 0.75rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* You're caught up empty state */
.caught-up-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.caught-up-icon {
    font-size: 2.5rem;
    margin: 0 0 0.75rem;
}

.caught-up-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.5rem;
}

.caught-up-body {
    font-size: 0.9rem;
    color: #9ca3af;
    max-width: 320px;
    margin: 0 auto;
}

/* First Lens builder */
.lens-builder {
    padding: 2.5rem 1.5rem;
    max-width: 520px;
    margin: 0 auto;
}

.lens-builder-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin: 0 0 0.5rem;
}

.lens-builder-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.5rem;
}

.lens-builder-body {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.lens-builder-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.lens-builder-topic {
    background: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.lens-builder-topic:hover {
    background: #e5e7eb;
}

.lens-builder-topic--selected {
    background: #e8f0e4;
    border-color: #435335;
    color: #2e3a24;
}

.lens-builder-done {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
}

.error {
    padding: 1.5rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 0.75rem;
    color: #991b1b;
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #435335;
    font-size: 0.8rem;
}

.panel-header h1 {
    margin: 0.4rem 0 0;
    font-size: 2rem;
    line-height: 1.1;
}

.panel-copy {
    margin: 0.75rem 0 0;
    max-width: 720px;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.7;
    min-height: 3.4rem; /* 2 lines × 1.7 line-height — prevents layout shift on subtitle rotation */
    transition: opacity 0.3s ease;
}

.panel-copy.fading {
    opacity: 0;
}

.source-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.source-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.source-meta {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.source-badge {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #435335;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
}

.source-meta h3 {
    margin: 0;
    font-size: 1.1rem;
}

.source-meta p {
    margin: 0.35rem 0 0;
    color: #4b5563;
    line-height: 1.6;
}

.source-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #FBF9F6;
    color: #2e3a24;
    font-size: 0.82rem;
    font-weight: 600;
}

@media (max-width: 720px) {
    .article-card {
        grid-template-columns: 1fr;
    }

    .article-thumbnail {
        width: 100%;
        height: 180px;
    }
}


button {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.primary-button,
.source-details button {
    background-color: #435335;
    color: #ffffff;
}

.primary-button:hover,
.source-details button:hover {
    background-color: #5E8052;
    color: #ffffff;
}

.secondary-button {
    background-color: #f3f4f6;
    color: #111827;
}

.secondary-button:hover {
    background-color: #e5e7eb;
}

.danger-button {
    background-color: #fee2e2;
    color: #b91c1c;
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.danger-button:hover {
    background-color: #fecaca;
}

footer {
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Topics panel */
.topics-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
}

.topics-panel h2 {
    margin: 0.4rem 0 0;
    font-size: 1.5rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.topic-card {
    position: relative;
    padding: 0.45rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #f9fafb;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    width: 100%;
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
}

.topic-card:hover {
    border-color: #435335;
    background: #fff;
}

.topic-card[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 0.3rem 0.55rem;
    border-radius: 0.4rem;
    font-size: 0.72rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
    line-height: 1.4;
}

.topic-card.selected {
    background: #FBF9F6;
    border-color: #435335;
    color: #2e3a24;
}

/* Notifications */
.notif-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── DM Panel ─────────────────────────────────────────────── */

.dm-container {
    position: relative;
}

.dm-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 520px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(15,23,42,0.12);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dm-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
}

.dm-panel-header span {
    flex: 1;
}

.dm-back-btn, .dm-new-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #6b7280;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
}

.dm-back-btn:hover, .dm-new-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.dm-inbox {
    overflow-y: auto;
    flex: 1;
}

.dm-conv-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f9fafb;
    transition: background 0.1s;
}

.dm-conv-item:hover { background: #f9fafb; }

.dm-conv-item--unread { background: #f0fdf9; }
.dm-conv-item--unread:hover { background: #dcfce7; }

.dm-conv-info { flex: 1; min-width: 0; }

.dm-conv-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dm-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #435335;
    flex-shrink: 0;
}

.dm-conv-preview {
    font-size: 0.78rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.dm-conversation {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dm-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.dm-msg--mine { align-self: flex-end; align-items: flex-end; }
.dm-msg--theirs { align-self: flex-start; align-items: flex-start; }

.dm-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

.dm-msg--mine .dm-bubble {
    background: #435335;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.dm-msg--theirs .dm-bubble {
    background: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.dm-msg-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

.dm-article-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    max-width: 220px;
    margin-bottom: 0.25rem;
}

.dm-article-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.dm-article-headline {
    display: block;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.3;
}

.dm-article-headline:hover { color: #435335; }

.dm-input-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem;
    border-top: 1px solid #f3f4f6;
}

.dm-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    line-height: 1.4;
}

.dm-input:focus { outline: none; border-color: #435335; }

.dm-send-btn { flex-shrink: 0; padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.dm-new-conv {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.dm-search-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    font-family: inherit;
    box-sizing: border-box;
}

.dm-search-input:focus { outline: none; border-color: #435335; }

.dm-search-result {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #111827;
}

.dm-search-result:hover { background: #f9fafb; }

.dm-empty {
    color: #9ca3af;
    font-size: 0.85rem;
    text-align: center;
    padding: 1.5rem 1rem;
}

/* ── Broadcast Modal ──────────────────────────────────────── */

.modal--sm { max-width: 360px; }
.modal--wide { max-width: 600px; }

.broadcast-hint {
    color: #6b7280;
    font-size: 0.88rem;
    margin: 0 0 1rem;
}

.broadcast-status {
    font-size: 0.85rem;
    min-height: 1.2rem;
    margin: 0.5rem 0;
}

.broadcast-send-btn { width: 100%; margin-top: 0.25rem; }

.notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: background 0.15s;
}

.notif-badge--empty {
    background: transparent;
    font-size: 0.85rem;
    min-width: unset;
    height: unset;
    padding: 0;
    top: -4px;
    right: -10px;
}

.notif-badge:hover { background: #dc2626; }
.notif-badge--empty:hover { background: transparent; opacity: 0.7; }

.notif-panel-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0.75rem;
}

.notif-mark-all {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.78rem;
    color: #435335;
    font-weight: 600;
    cursor: pointer;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f9fafb;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #f9fafb;
}

.notif-item--unread {
    background: #f2f5f1;
}

.notif-item--unread:hover {
    background: #dcfce7;
}

.notif-dot {
    position: absolute;
    top: 50%;
    left: 0.3rem;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #435335;
}

.notif-avatar {
    flex-shrink: 0;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-message {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
    color: #111827;
    line-height: 1.4;
}

.notif-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.notif-empty {
    padding: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.88rem;
    margin: 0;
}

/* Header search */
.header-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
}

.search-clear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    border-radius: 0;
    padding: 0.1rem 0.35rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}

.search-clear:hover {
    color: #fff;
}

/* Header auth */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-area,
.user-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.username-display {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
}

.user-menu-container {
    position: relative;
}

.username-display-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.username-display {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.username-display:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    z-index: 50;
    min-width: 150px;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    text-align: left;
    color: #374151;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.15s;
    border-radius: 0;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item--danger {
    color: #ef4444;
}

.dropdown-item--danger:hover {
    background-color: #fef2f2;
}

.username-chevron {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 0.1rem;
}

.header-unread-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

.dropdown-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #435335;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 5px;
    margin-left: auto;
    line-height: 1;
}

.dropdown-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 0.25rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
  .modal-overlay {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal {
    margin-bottom: 0;
  }
}

.modal h2 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    color: #111827;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
    color: #435335;
    border-bottom-color: #435335;
}

.tab-btn:hover:not(.active) {
    color: #374151;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.forgot-link {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    color: #6b7280;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.forgot-link:hover {
    color: #435335;
    text-decoration: underline;
}

.form-success {
    margin: 0;
    padding: 0.6rem 0.9rem;
    background: #FBF9F6;
    border: 1px solid #8fa888;
    border-radius: 0.5rem;
    color: #2e3a24;
    font-size: 0.9rem;
}

.label-hint {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.82rem;
}

.form-group input {
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus {
    border-color: #435335;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.form-error {
    margin: 0;
    padding: 0.6rem 0.9rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 0.5rem;
    color: #991b1b;
    font-size: 0.9rem;
}

.form-submit {
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0.25rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: #435335;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.form-actions button {
    flex: 1;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
}

.form-select {
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #111827;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

.form-select:focus {
    border-color: #435335;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* New leaves banner */
.new-pages-banner {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    background: #435335;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 200;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.new-pages-banner:hover { opacity: 0.9; }

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #435335;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
    z-index: 100;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background: rgba(16, 185, 129, 0.28);
}

/* Refresh spinner */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 201;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    scale: 0.4;
    transition: opacity 0.15s ease, scale 0.15s ease;
}

.pull-indicator--visible {
    opacity: 1;
    scale: 1;
}

.pull-indicator--ready {
    background: #435335;
}

.pull-indicator--ready .pull-arrow {
    color: #fff;
}

.pull-arrow {
    font-size: 1.1rem;
    color: #435335;
    transition: transform 0.2s ease, color 0.15s ease;
}

.pull-indicator--ready .pull-arrow {
    transform: rotate(180deg);
}

.refresh-spinner {
    position: fixed;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: #435335;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    z-index: 200;
    margin-left: -12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 2rem));
    background: #111827;
    color: #fff;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 200;
    white-space: nowrap;
}

.toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast--green {
    background: #2e3a24;
}

/* Mention autocomplete */
.mention-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 200;
    overflow: hidden;
}

.mention-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #111827;
    transition: background 0.1s;
}

.mention-option:hover,
.mention-option--active {
    background: #f3f4f6;
}

/* Takes */
.takes-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.take-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid #f9fafb;
}

.take-item:last-child {
    border-bottom: none;
}

.take-item--ai {
    background: #f2f5f1;
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.25rem;
}

.take-gc-icon {
    font-size: 1.1rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.take-ai-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #435335;
    letter-spacing: 0.04em;
}

.persona-chip {
    cursor: pointer;
    background: #e8f0e4;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    transition: background 0.12s;
}

.persona-chip:hover {
    background: #d4e4cc;
}

.persona-popover {
    position: absolute;
    z-index: 200;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 0.85rem 1rem;
    max-width: 280px;
    pointer-events: auto;
}

.persona-popover-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.2rem;
}

.persona-popover-role {
    font-size: 0.72rem;
    font-weight: 600;
    color: #435335;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
}

.persona-popover-card {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

.take-gc-thumbsdown {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.75rem;
    color: #d1d5db;
    cursor: pointer;
    margin-top: 0.35rem;
    display: block;
    font-family: inherit;
}

.take-gc-thumbsdown:hover:not(:disabled) { color: #9ca3af; }
.take-gc-thumbsdown:disabled { color: #d1d5db; cursor: default; }

.take-item--deleted .take-body {
    color: #9ca3af;
    font-style: italic;
}

.take-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.take-username {
    font-weight: 700;
    font-size: 0.83rem;
    color: #111827;
}

.take-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.take-delete {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.75rem;
    color: #d1d5db;
    cursor: pointer;
    margin-left: auto;
}

.take-delete:hover {
    color: #ef4444;
}

.take-body {
    margin: 0;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.take-empty {
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
    padding: 0.75rem 0;
    margin: 0;
}

.take-form {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.take-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.take-input:focus {
    border-color: #435335;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.take-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.take-char-count,
.retake-char-count {
    font-size: 0.75rem;
    color: #9ca3af;
    transition: color 0.15s;
}

.char-count--amber { color: #f59e0b; font-weight: 600; }
.char-count--red   { color: #ef4444; font-weight: 700; }

.take-submit {
    border-radius: 0.5rem;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
}

.take-login-prompt {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.5rem 0 0;
}

.take-privacy-notice {
    font-size: 0.78rem;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
    padding: 0.4rem 0.65rem;
    margin: 0 0 0.5rem;
}

.take-actions {
    margin-top: 0.35rem;
}

.take-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.take-reactions-left {
    font-size: 1rem;
    letter-spacing: 0.05em;
    min-width: 1rem;
}

.take-react-container {
    position: relative;
    display: inline-block;
}

.take-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.88rem;
    color: #9ca3af;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    line-height: 1;
}

.take-react-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.take-react-btn--active { color: #435335; }

.take-react-count {
    font-size: 0.85rem;
}

.take-reaction-popup {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: auto;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.25rem 0.4rem;
    gap: 0.1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 20;
    white-space: nowrap;
    transition: opacity 0.1s, visibility 0.1s;
    transition-delay: 0.4s;
}

.take-reaction-popup::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 4px;
    pointer-events: auto;
}

.take-react-container:hover .take-reaction-popup {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.mention-option--gc {
    border-bottom: 1px solid #f3f4f6;
    background: #f2f5f1;
}

.mention-option--gc.mention-option--active,
.mention-option--gc:hover {
    background: #c8d4c2;
}

.mention-gc-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.mention-link {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    color: #435335;
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    display: inline;
}

.mention-link:hover {
    text-decoration: underline;
}

.feed-user-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.75rem;
}

.feed-username-link {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: inherit;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    font-family: inherit;
}

.feed-username-link:hover {
    color: #435335;
    text-decoration: underline;
}

.retake-bar {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.retake-toggle {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #435335;
    cursor: pointer;
}

.retake-toggle:hover {
    text-decoration: underline;
}

.reply-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #435335;
    cursor: pointer;
}

.reply-toggle:hover {
    text-decoration: underline;
}

/* Reply form — collapsed by default, expands on ↩ Reply click */
.reply-form {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.reply-form.open {
    display: flex;
}

.retake-section {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 3px solid #e5e7eb;
}

.take-item--retake {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f9fafb;
}

.take-item--retake:last-child {
    border-bottom: none;
}

.take-item--sub-retake {
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid #e5e7eb;
}

@keyframes takeHighlight {
    0%   { background-color: var(--color-accent-light, #fef9c3); }
    80%  { background-color: var(--color-accent-light, #fef9c3); }
    100% { background-color: transparent; }
}
.take-item--highlight {
    animation: takeHighlight 2s ease-out forwards;
    border-radius: 4px;
}

.retake-form {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.retake-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.retake-input:focus {
    border-color: #435335;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.retake-char-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

.retake-submit {
    border-radius: 0.5rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
}

/* Keywords & Exclusions */
.lens-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.lens-hint {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    color: #6b7280;
}

.tag-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tag-text-input {
    flex: 1;
    min-width: 140px;
    padding: 0.55rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.tag-text-input:focus {
    border-color: #435335;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.tag-type-select {
    flex-shrink: 0;
    padding: 0.55rem 2rem 0.55rem 0.75rem;
    font-size: 0.9rem;
}

.tag-add-btn {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.4rem 0.3rem 0.75rem;
    border-radius: 999px;
    background: #FBF9F6;
    color: #2e3a24;
    font-size: 0.85rem;
    font-weight: 600;
}

.tag-chip--exclusion {
    background: #fef2f2;
    color: #991b1b;
}

.tag-chip-type {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
}

.tag-chip-remove {
    background: none;
    border: none;
    border-radius: 999px;
    padding: 0 0.25rem;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.tag-chip-remove:hover {
    opacity: 1;
}

/* Source picker */
.source-picker-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.source-ctrl-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    white-space: nowrap;
}

.source-picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.35rem;
}

.source-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #374151;
    transition: background 0.1s;
}

.source-picker-item:hover { background: #f3f4f6; }
.source-picker-item--selected { background: #f2f5f1; }

.source-picker-check { flex-shrink: 0; accent-color: #435335; }
.source-picker-name { flex: 1; }
.source-picker-count { color: #9ca3af; font-size: 0.78rem; }
.source-tier3-badge { margin-right: 0.2rem; }
.source-notice { color: #435335; margin-bottom: 0.5rem; }

/* Feed tabs */
.feed-tabs {
    display: none !important;
}

.feed-tab {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0.5rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.feed-tab.active {
    color: #435335;
    border-bottom-color: #435335;
}

.feed-tab:hover:not(.active) { color: #374151; }

.weave-badge {
    background: #435335;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.weave-mode-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.weave-mode-btn {
    padding: 0.3rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.weave-mode-btn.active {
    background: #435335;
    border-color: #435335;
    color: #fff;
    font-weight: 600;
}

.weave-build-wrap {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

/* Weave feed */
.weave-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.weave-card {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15,23,42,0.05);
}

.weave-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.weave-card-image {
    float: right;
    width: 45%;
    max-width: 360px;
    min-width: 160px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 1rem 1.25rem;
    display: block;
}

@media (max-width: 540px) {
    .weave-card-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 1rem 0;
    }
}

.weave-card-clearfix {
    clear: both;
}

.weave-meta {
    font-size: 0.78rem;
    color: #9ca3af;
}

.weave-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.weave-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.weave-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.weave-status--green { background: #FBF9F6; color: #2e3a24; }
.weave-status--grey  { background: #f3f4f6; color: #6b7280; }

.weave-timeline {
    margin-bottom: 1rem;
    padding-left: 0.25rem;
}

.weave-timeline-entry {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.weave-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.weave-timeline-dot--filled {
    border-color: #435335;
    background: #435335;
}

.weave-timeline-content {
    flex: 1;
    min-width: 0;
}

.weave-timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.15rem;
}

.weave-timeline-headline {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.weave-timeline-headline:hover { text-decoration: underline; color: #435335; }

.weave-timeline-entry--latest .weave-timeline-headline { color: #435335; }

.weave-timeline-summary {
    margin: 0;
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.5;
}

.weave-body {
    margin-bottom: 0.5rem;
}

.weave-days {
    margin-bottom: 0.5rem;
}

.weave-day-entry {
    margin-bottom: 1.1rem;
}

.weave-day-entry--hidden {
    display: none;
}

.weave-day-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.weave-day-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    flex-shrink: 0;
}

.weave-day-dot--active {
    border-color: #435335;
    background: #435335;
}

.weave-day-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.weave-day-synthesis {
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.65;
    padding-left: 1.25rem;
}

.weave-day-synthesis p {
    margin: 0 0 0.5rem;
}

.weave-bullet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.weave-bullet-list li {
    padding-left: 1rem;
    position: relative;
    line-height: 1.55;
}

.weave-bullet-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: #435335;
    font-weight: 700;
}

.weave-citation {
    text-decoration: none;
    font-size: 0.75rem;
    vertical-align: middle;
    margin-left: 0.1rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.weave-citation:hover {
    opacity: 1;
}

.weave-show-more {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    color: #6b7280;
    cursor: pointer;
    text-align: center;
    margin-bottom: 1rem;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.weave-show-more:hover {
    background: #f9fafb;
    color: #374151;
}

.weave-open {
    background: #f9fafb;
    border-left: 3px solid #435335;
    padding: 0.6rem 0.85rem;
    border-radius: 0 0.4rem 0.4rem 0;
    font-size: 0.88rem;
    color: #374151;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.weave-open-label {
    font-weight: 700;
    color: #435335;
    margin-right: 0.3rem;
}

.thread-reactions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.thread-reaction-pill {
    font-size: 0.72rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.thread-reaction-count {
    color: #435335;
}

.thread-reaction-total {
    font-size: 0.68rem;
    color: #9ca3af;
}

.weave-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.weave-source-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: #f3f4f6;
    border-radius: 999px;
    color: #6b7280;
    font-weight: 500;
}

/* Search scope toggle */
.search-scope-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.scope-btn {
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.scope-btn.active {
    background: #435335;
    border-color: #435335;
    color: #fff;
}

.scope-btn:hover:not(.active) {
    border-color: #435335;
    color: #435335;
}

/* Rustlers panel */
.rustlings-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
}

.rustlings-panel h2 {
    margin: 0.4rem 0 0;
    font-size: 1.5rem;
}

.rustlings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.rustling-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.9rem 1.1rem;
    background: #f9fafb;
    transition: box-shadow 0.15s, background 0.15s;
}

.rustling-card:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.rustling-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #435335;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: grid;
    place-items: center;
}

/* Shared avatar component */
.avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
}

.avatar--initial {
    background: #435335;
    color: #fff;
    font-weight: 700;
}

.avatar--lg {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.avatar--clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}

.avatar--clickable:hover {
    opacity: 0.85;
}

.avatar-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.avatar-upload-hint {
    font-size: 0.78rem;
    color: #9ca3af;
}

.rustling-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rustling-card-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rustling-name {
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
    cursor: pointer;
    text-align: left;
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.rustling-name:hover {
    color: #435335;
    text-decoration: underline;
}

.rustling-meta {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: #9ca3af;
}

.follow-btn {
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

/* User profile modal */
.modal--wide {
    max-width: 500px;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.user-profile-avatar {
    width: 60px;
    height: 60px;
}

.user-profile-name {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
}

.user-profile-bio {
    margin: 0.25rem 0 0.4rem;
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.5;
}

.user-profile-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.user-meta-item {
    font-size: 0.82rem;
    color: #6b7280;
}

.form-textarea {
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s;
}

.form-textarea:focus {
    border-color: #435335;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.user-profile-interests {
    margin-bottom: 1.25rem;
}

.user-profile-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.user-profile-actions button {
    flex: 1;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Lens Overlap block */
.lens-overlap-block {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.overlap-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.overlap-row--muted {
    opacity: 0.6;
}

.overlap-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    width: 110px;
    flex-shrink: 0;
}

.overlap-bar-wrap {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.overlap-bar {
    height: 100%;
    background: #435335;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.overlap-bar--source {
    background: #6b7280;
}

.overlap-bar--stance {
    background: #92400e;
}

.overlap-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
    width: 2.5rem;
    text-align: right;
}

.overlap-na {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

.overlap-shared {
    font-size: 0.72rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    padding-left: 116px;
}

.overlap-signal {
    font-size: 0.75rem;
    font-weight: 600;
    color: #435335;
    background: #e8f0e4;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.overlap-signal--neutral {
    color: var(--text-muted, #888);
    background: var(--bg-secondary, #f5f5f5);
}

/* Back-to-feed breadcrumb */
.back-to-feed-btn {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    color: #435335;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.back-to-feed-btn:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-search {
        max-width: 100%;
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    main {
        padding: 1rem;
    }

    main.has-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .rustlings-grid {
        grid-template-columns: 1fr;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
