/* ============================================
   DISCOVERY SECTION
   Shared styles for /discovery pages
   ============================================ */

/* --- Discovery Index --- */
.discovery-hero {
    padding: 10rem 0 4rem;
    text-align: center;
}

.discovery-hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.discovery-hero-sub {
    font-size: 1.1rem;
    color: var(--silver);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.8;
}

/* --- Content Grid --- */
.discovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 0 8rem;
}

.discovery-card {
    border: 1px solid var(--smoke);
    padding: 2rem;
    transition: all 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
}

.discovery-card:hover {
    border-color: var(--accent-dim);
    background: rgba(201, 168, 76, 0.03);
    transform: translateY(-2px);
}

.discovery-card-category {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.discovery-card-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--white);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.discovery-card-excerpt {
    font-size: 0.9rem;
    color: var(--ash);
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.discovery-card-link {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s var(--ease-out);
}

.discovery-card:hover .discovery-card-link {
    gap: 0.75rem;
}

.discovery-card-link svg {
    width: 14px;
    height: 14px;
}

/* --- Empty State --- */
.discovery-empty {
    text-align: center;
    padding: 6rem 0;
    color: var(--ash);
}

.discovery-empty p {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.discovery-empty-sub {
    font-size: 0.9rem;
    color: var(--smoke);
}

/* --- Individual Discovery Page --- */
.discovery-page-header {
    padding: 8rem 0 3rem;
    border-bottom: 1px solid var(--smoke);
}

.discovery-page-back {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ash);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    transition: color 0.3s;
}

.discovery-page-back:hover {
    color: var(--accent);
}

.discovery-page-back svg {
    width: 14px;
    height: 14px;
}

.discovery-page-category {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.discovery-page-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    color: var(--white);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.discovery-page-meta {
    font-size: 0.8rem;
    color: var(--ash);
    letter-spacing: 0.05em;
}

/* --- Article Content --- */
.discovery-content {
    padding: 4rem 0 6rem;
}

.discovery-content h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--white);
    margin: 3rem 0 1rem;
    line-height: 1.3;
}

.discovery-content h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--white);
    margin: 2.5rem 0 0.75rem;
    line-height: 1.4;
}

.discovery-content p {
    font-size: 1.05rem;
    color: var(--silver);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.discovery-content blockquote {
    border-left: 2px solid var(--accent-dim);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--bone);
    line-height: 1.7;
}

.discovery-content ul,
.discovery-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.discovery-content li {
    font-size: 1.05rem;
    color: var(--silver);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.discovery-content em {
    color: var(--bone);
}

.discovery-content strong {
    color: var(--white);
    font-weight: 500;
}

.discovery-content hr {
    border: none;
    border-top: 1px solid var(--smoke);
    margin: 3rem 0;
}

/* --- Discovery CTA at bottom of article --- */
.discovery-cta {
    text-align: center;
    padding: 4rem 0;
    border-top: 1px solid var(--smoke);
}

.discovery-cta p {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--silver);
    margin-bottom: 1.5rem;
}

.discovery-cta-link {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: 0.75rem 2rem;
    display: inline-block;
    transition: all 0.3s var(--ease-out);
}

.discovery-cta-link:hover {
    background: var(--accent);
    color: var(--black);
}


/* ============================================
   DISCUSSION / REFLECTIONS — Redesigned
   ============================================ */

.discovery-discussion {
    padding: 4rem 0;
    border-top: 1px solid var(--smoke);
}

.discussion-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--white);
    margin-bottom: 1.5rem;
}

/* --- Compose Area (posting) --- */
.posting-area {
    margin-bottom: 2rem;
}

.compose-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.compose-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--black);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.compose-body {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--smoke);
    border-radius: 4px;
    background: var(--off-black);
    overflow: visible;
    transition: border-color 0.3s;
    position: relative;
}

.compose-body:focus-within {
    border-color: var(--accent-dim);
}

.compose-body textarea {
    width: 100%;
    padding: 0.75rem 0.75rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--white);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    min-height: 44px;
    max-height: 200px;
    line-height: 1.5;
}

.compose-body textarea::placeholder {
    color: var(--ash);
}

.compose-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-top: 1px solid rgba(42, 42, 42, 0.5);
}

.compose-tools {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    position: relative;
}

.compose-tool {
    background: none;
    border: none;
    color: var(--ash);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.compose-tool:hover {
    color: var(--accent);
    background: rgba(201, 168, 76, 0.08);
}

.compose-tool svg {
    display: block;
}

#emoji-picker-container {
    position: absolute;
    z-index: 100;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
}

.compose-submit {
    padding: 0.35rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--accent);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.compose-submit:hover {
    background: var(--bone);
}

.compose-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

/* --- Media Preview (before posting) --- */
.media-preview {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
}

.media-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--smoke);
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    border: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-preview-remove:hover {
    background: #c44;
}


/* --- Login Prompt (not authenticated) --- */
.login-prompt {
    padding: 1.5rem 0;
}

.login-prompt p {
    font-size: 0.85rem;
    color: var(--ash);
    font-style: italic;
}


/* --- Comment Feed --- */
.comment-list {
    margin-bottom: 2rem;
}

.comments-loading,
.comments-empty {
    font-size: 0.9rem;
    color: var(--ash);
    font-style: italic;
    padding: 1.5rem 0;
}

.comment-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(42, 42, 42, 0.4);
}

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

.comment-row {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
}

.comment-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--black);
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

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

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

.comment-author {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--bone);
}

.comment-time {
    font-size: 0.65rem;
    color: var(--ash);
}

.comment-delete {
    background: none;
    border: none;
    color: var(--ash);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 0.2rem;
    line-height: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.comment-item:hover .comment-delete {
    opacity: 1;
}

.comment-delete:hover {
    color: #c44;
}

.comment-body {
    font-size: 0.9rem;
    color: var(--silver);
    line-height: 1.6;
}

.comment-body strong {
    color: var(--white);
    font-weight: 500;
}

.comment-body em {
    color: var(--bone);
}

/* --- Comment Transcript --- */
.comment-transcript {
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(201, 168, 76, 0.04);
    border-left: 2px solid var(--accent-dim);
    border-radius: 0 4px 4px 0;
    font-size: 0.82rem;
    color: var(--silver);
    line-height: 1.6;
}

.comment-transcript--pending {
    opacity: 0.6;
    font-style: italic;
}

.transcript-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

/* --- Comment Media --- */
.comment-attachments {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-media {
    border-radius: 6px;
    border: 1px solid var(--smoke);
    background: var(--charcoal);
}

.comment-media--img {
    max-width: 320px;
    max-height: 280px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-media--img:hover {
    opacity: 0.85;
}

.comment-media--video {
    max-width: 360px;
    max-height: 280px;
}

.comment-media--audio {
    width: 100%;
    max-width: 360px;
}

.comment-item--new {
    animation: slideIn 0.35s var(--ease-out);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Reply Threads --- */
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--ash);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comment-reply-btn:hover {
    color: var(--accent);
}

.comment-reply-toggle {
    background: none;
    border: none;
    color: var(--accent-dim);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.3rem 0 0;
    transition: color 0.2s;
}

.comment-reply-toggle:hover {
    color: var(--accent);
}

.comment-reply-toggle::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.2s;
}

.comment-reply-toggle--open::before {
    transform: rotate(90deg);
}

.comment-replies {
    margin-left: 2rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--accent-dim);
    margin-top: 0.25rem;
}

.comment-reply-item {
    padding: 0.3rem 0;
}

.comment-reply-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-reply-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--black);
    font-size: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-reply-content {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.comment-reply-author {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--bone);
}

.comment-reply-time {
    font-size: 0.6rem;
    color: var(--ash);
}

.comment-reply-item .comment-delete {
    opacity: 0;
    margin-left: auto;
}

.comment-reply-item:hover .comment-delete {
    opacity: 1;
}

.comment-reply-body {
    font-size: 0.78rem;
    color: var(--silver);
    line-height: 1.4;
    padding-left: 1.4rem;
}

/* Reply compose */
.comment-reply-compose {
    padding: 0.3rem 0;
}

.comment-reply-compose-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-reply-input {
    flex: 1;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(42, 42, 42, 0.5);
    border-radius: 4px;
    color: var(--silver);
    font-size: 0.78rem;
    font-family: var(--font-sans);
    padding: 0.3rem 0.5rem;
    resize: none;
    line-height: 1.4;
}

.comment-reply-input:focus {
    outline: none;
    border-color: var(--accent-dim);
}

.comment-reply-post {
    background: var(--accent-dim);
    border: none;
    color: var(--black);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.comment-reply-post:hover {
    background: var(--accent);
}


/* ============================================
   COMMENT COLLAPSE + AUTHOR PANEL
   ============================================ */

/* --- Collapse toggle on top-level comments --- */
.comment-collapse-toggle {
    background: none;
    border: none;
    color: var(--ash);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0 0.2rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.comment-collapse-toggle:hover {
    opacity: 1;
    color: var(--accent);
}

.comment-item.comment-collapsed .comment-body,
.comment-item.comment-collapsed .comment-attachments,
.comment-item.comment-collapsed .comment-transcript,
.comment-item.comment-collapsed .comment-reply-btn,
.comment-item.comment-collapsed .comment-reply-toggle,
.comment-item.comment-collapsed .comment-replies {
    display: none !important;
}

/* Override: when collapsed but has matching replies, show them */
.comment-item.comment-collapsed.comment-show-replies .comment-replies {
    display: block !important;
}

/* Dimmed state for filtered-out comments */
.comment-item.comment-filtered-dim {
    opacity: 0.35;
}

.comment-item.comment-filtered-dim:hover {
    opacity: 0.6;
}

/* Reply dim (non-matching replies when filtering) */
.comment-reply-item.comment-reply-dim {
    opacity: 0.3;
}

/* --- Voices panel (comment author filter) --- */
.comment-author-panel {
    position: sticky;
    top: 5rem;
    float: right;
    margin-right: -140px;
    width: 120px;
    z-index: 10;
    padding: 0.5rem 0;
}

.comment-author-panel-label {
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ash);
    margin-bottom: 0.4rem;
    padding-left: 0.25rem;
}

.comment-author-panel-authors {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.comment-author-panel-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.comment-author-panel-btn:hover {
    background: rgba(201, 168, 76, 0.06);
    border-color: var(--smoke);
}

.comment-author-panel-btn--active {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--accent-dim);
}

.comment-author-panel-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--smoke);
    color: var(--ash);
    font-size: 0.55rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.comment-author-panel-btn--active .comment-author-panel-avatar {
    background: var(--accent-dim);
    color: var(--black);
}

.comment-author-panel-name {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    color: var(--ash);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.comment-author-panel-btn--active .comment-author-panel-name {
    color: var(--bone);
}

.comment-author-panel-count {
    font-size: 0.55rem;
    color: var(--smoke);
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.2s;
}

.comment-author-panel-btn--active .comment-author-panel-count {
    color: var(--accent);
}


/* ============================================
   RECORDER MODAL (VIDEO + AUDIO)
   ============================================ */

.recorder-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recorder-inner {
    background: var(--off-black);
    border: 1px solid var(--smoke);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 520px;
    width: 90%;
    text-align: center;
}

.recorder-preview {
    width: 100%;
    max-height: 360px;
    border-radius: 6px;
    background: var(--charcoal);
    margin-bottom: 1rem;
}

.recorder-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.recorder-btn {
    padding: 0.5rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--smoke);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.recorder-btn--start {
    background: #c44;
    color: var(--white);
    border-color: #c44;
}

.recorder-btn--start:hover {
    background: #d55;
}

.recorder-btn--stop {
    background: var(--accent);
    color: var(--black);
    border-color: var(--accent);
}

.recorder-btn--stop:hover {
    background: var(--bone);
}

.recorder-btn--cancel {
    background: transparent;
    color: var(--ash);
}

.recorder-btn--cancel:hover {
    color: var(--white);
    border-color: var(--ash);
}

.recorder-timer {
    font-size: 1.5rem;
    font-family: var(--font-sans);
    font-weight: 300;
    color: #c44;
    margin-top: 0.75rem;
    letter-spacing: 0.05em;
}

.recorder-mode-chooser {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: 2rem 0;
}

.recorder-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--smoke);
    border-radius: 8px;
    color: var(--silver);
    padding: 1.5rem 2.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.recorder-mode-btn:hover {
    border-color: var(--accent);
    color: var(--white);
}

.recorder-audio-vis {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    color: var(--silver);
    margin-bottom: 1rem;
}

.recorder-audio-vis.recording {
    color: #c44;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.media-preview-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--charcoal);
    border-radius: 6px;
    color: var(--accent);
}


/* ============================================
   IMAGE LIGHTBOX (click to enlarge)
   ============================================ */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ============================================
   RESPONSIVE
   ============================================ */

/* ============================================
   INLINE ANNOTATIONS
   ============================================ */

/* --- Text highlights via CSS Custom Highlight API --- */
::highlight(tap-annotation) {
    background-color: rgba(201, 168, 76, 0.08);
    text-decoration: underline;
    text-decoration-color: rgba(201, 168, 76, 0.35);
    text-underline-offset: 2px;
    text-decoration-thickness: 1.5px;
}

::highlight(tap-annotation-active) {
    background-color: rgba(201, 168, 76, 0.18);
    text-decoration: underline;
    text-decoration-color: rgba(201, 168, 76, 0.6);
    text-underline-offset: 2px;
    text-decoration-thickness: 2px;
}

::highlight(tap-annotation-composing) {
    background-color: rgba(201, 168, 76, 0.22);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 2px;
    text-decoration-thickness: 2px;
}

/* --- Margin indicators --- */
.annotation-gutter {
    position: absolute;
    left: -28px;
    top: 0;
    width: 20px;
    height: 100%;
    pointer-events: none;
}

.annotation-marker {
    position: absolute;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    cursor: pointer;
    pointer-events: all;
    transition: opacity 0.2s, transform 0.2s;
}

.annotation-marker:hover {
    opacity: 1;
    transform: scale(1.4);
}

.annotation-marker--count {
    width: auto;
    height: auto;
    border-radius: 8px;
    padding: 0 5px;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--black);
    background: var(--accent);
    opacity: 0.7;
    line-height: 16px;
    text-align: center;
}

.annotation-marker--count:hover {
    opacity: 1;
}

/* --- Floating annotate button (on text selection) --- */
.annotate-trigger {
    position: absolute;
    z-index: 50;
    background: var(--accent);
    color: var(--black);
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: background 0.15s;
    white-space: nowrap;
}

.annotate-trigger:hover {
    background: var(--bone);
}

/* --- Annotation thread (inline below paragraph) --- */
.annotation-thread {
    margin: 0.4rem 0 0.75rem;
    padding: 0;
    background: none;
    border-left: 2px solid var(--accent-dim);
    border-radius: 0;
    animation: slideIn 0.25s var(--ease-out);
}

.annotation-thread-header {
    display: none;
}

.annotation-thread-label {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.annotation-thread-close {
    background: none;
    border: none;
    color: var(--ash);
    cursor: pointer;
    padding: 0.15rem;
    line-height: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.annotation-thread-close:hover {
    color: var(--white);
}

/* --- Quoted passage in thread --- */
.annotation-quote {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-style: italic;
    color: var(--bone);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-left: 2px solid rgba(201, 168, 76, 0.2);
    line-height: 1.6;
    max-height: 4.8em;
    overflow: hidden;
}

/* --- Individual annotation item --- */
.annotation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
}

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

.annotation-item-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.annotation-item-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--black);
    font-size: 0.55rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.annotation-item-content {
    flex: 1;
    min-width: 0;
}

.annotation-item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.annotation-item-author {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--bone);
}

.annotation-item-time {
    font-size: 0.6rem;
    color: var(--ash);
}

.annotation-item-delete {
    background: none;
    border: none;
    color: var(--ash);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 0.15rem;
    line-height: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.annotation-item:hover .annotation-item-delete {
    opacity: 1;
}

.annotation-item-delete:hover {
    color: #c44;
}

.annotation-item-body {
    font-size: 0.82rem;
    color: var(--silver);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

/* --- Replies within an annotation --- */
.annotation-replies {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
}

/* --- Reply compose (inside thread) --- */
.annotation-reply-compose {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(42, 42, 42, 0.3);
}

.annotation-reply-compose textarea {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--white);
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid var(--smoke);
    border-radius: 4px;
    outline: none;
    resize: none;
    min-height: 32px;
    max-height: 100px;
    line-height: 1.4;
}

.annotation-reply-compose textarea::placeholder {
    color: var(--ash);
}

.annotation-reply-compose textarea:focus {
    border-color: var(--accent-dim);
}

.annotation-reply-submit {
    padding: 0.3rem 0.7rem;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--accent);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    align-self: flex-end;
}

.annotation-reply-submit:hover {
    background: var(--bone);
}

/* --- Annotation compose (inline below paragraph) --- */
.annotation-compose {
    margin: 0.75rem 0 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(20, 20, 20, 0.7);
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
    animation: slideIn 0.25s var(--ease-out);
}

.annotation-compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.annotation-compose-label {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.annotation-compose textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--white);
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid var(--smoke);
    border-radius: 4px;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.annotation-compose textarea::placeholder {
    color: var(--ash);
}

.annotation-compose textarea:focus {
    border-color: var(--accent-dim);
}

.annotation-compose-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.annotation-compose-cancel {
    padding: 0.3rem 0.7rem;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ash);
    background: transparent;
    border: 1px solid var(--smoke);
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.2s;
}

.annotation-compose-cancel:hover {
    color: var(--white);
}

.annotation-compose-submit {
    padding: 0.3rem 0.7rem;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--accent);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.annotation-compose-submit:hover {
    background: var(--bone);
}

/* --- Author filter panel (floating) --- */
.annotation-panel {
    position: sticky;
    top: 5rem;
    float: right;
    margin-right: -140px;
    width: 120px;
    z-index: 10;
    padding: 0.5rem 0;
}

.annotation-panel-label {
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ash);
    margin-bottom: 0.4rem;
    padding-left: 0.25rem;
}

.annotation-panel-authors {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.annotation-panel-author {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.annotation-panel-author:hover {
    background: rgba(201, 168, 76, 0.06);
    border-color: var(--smoke);
}

.annotation-panel-author--active {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--accent-dim);
}

.annotation-panel-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--smoke);
    color: var(--ash);
    font-size: 0.55rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.annotation-panel-author--active .annotation-panel-avatar {
    background: var(--accent-dim);
    color: var(--black);
}

.annotation-panel-name {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    color: var(--ash);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.annotation-panel-author--active .annotation-panel-name {
    color: var(--bone);
}

.annotation-panel-count {
    font-size: 0.55rem;
    color: var(--smoke);
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.2s;
}

.annotation-panel-author--active .annotation-panel-count {
    color: var(--accent);
}

/* --- Make discovery-content paragraphs relative for gutter positioning --- */
.discovery-content .container--narrow {
    position: relative;
}


@media (max-width: 768px) {
    .discovery-grid {
        grid-template-columns: 1fr;
    }

    .discovery-page-header {
        padding: 7rem 0 2rem;
    }

    .comment-media--img,
    .comment-media--video {
        max-width: 100%;
    }

    .recorder-inner {
        width: 95%;
        padding: 1rem;
    }

    /* Annotation gutter moves to right side on mobile */
    .annotation-gutter {
        left: auto;
        right: -16px;
        width: 12px;
    }

    .annotation-marker {
        width: 6px;
        height: 6px;
    }

    .annotation-marker--count {
        font-size: 0.55rem;
        padding: 0 3px;
    }

    /* Panel moves inline on mobile */
    .annotation-panel {
        float: none;
        position: relative;
        top: 0;
        margin-right: 0;
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .annotation-panel-authors {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .annotation-panel-author {
        width: auto;
    }

    /* Comment author panel goes inline on mobile */
    .comment-author-panel {
        float: none;
        position: relative;
        top: 0;
        margin-right: 0;
        width: 100%;
        margin-bottom: 1rem;
    }

    .comment-author-panel-authors {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .comment-author-panel-btn {
        width: auto;
    }
}
