
/* Toolbar alignment + unread badge */
.reader-toolbar-inner {
    justify-content: flex-end;
}

.reader-toolbar-pill {
    position: relative;
}

.reader-toolbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 7px;
    padding: 0 6px;
    border-radius: 999px;
    background: #1B4079;
    color: #fff;
    font-size: .72rem;
    line-height: 1;
}

/* Work kudos */
.work-kudos-strip {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #EEF2F0;
}

.work-kudos-form {
    margin: 0;
}

.work-kudos-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.work-kudos-heart {
    color: #A5ABA8;
    font-size: 1.5rem;
    line-height: 1;
}

.work-kudos-button.is-active .work-kudos-heart {
    color: #C83434;
}

.work-kudos-count {
    min-width: 24px;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* Personal chapter reaction in Work page chapter index */
.chapter-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px auto;
    align-items: center;
    gap: 14px;
}

.chapter-list-title {
    min-width: 0;
}

.chapter-user-reaction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 32px;
    border-radius: 7px;
    background: #F1F3F2;
    font-size: 1.15rem;
}

.chapter-meta {
    text-align: right;
    white-space: nowrap;
}

/* Chapter reactions */
.chapter-react-panel {
    margin: 24px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.chapter-react-panel h2 {
    margin: 0 0 12px;
    color: var(--accent);
}

.chapter-reaction-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chapter-reaction-options form {
    margin: 0;
}

.chapter-reaction-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F2F4F3;
    font-size: 1.35rem;
    cursor: pointer;
}

.chapter-reaction-button:hover {
    border-color: var(--tag);
    background: #E7EEE4;
}

.chapter-reaction-button.is-selected {
    border-color: #76906F;
    background: var(--tag);
    box-shadow: inset 0 0 0 1px #76906F;
}

/* Comments */
.chapter-comments {
    margin-top: 28px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.chapter-comments-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.chapter-comments-heading h2 {
    margin: 0;
    color: var(--accent);
}

.chapter-comments-heading > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--highlight);
    color: #24351C;
    font-size: .78rem;
    font-weight: 800;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-card {
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FAFBFA;
}

.comment-card-heading,
.message-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--accent);
}

.comment-card-heading time,
.message-card-heading time {
    color: var(--muted);
    font-size: .82rem;
}

.comment-card p,
.message-card p {
    margin-bottom: 0;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.comment-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--accent);
    font-weight: 800;
}

.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    font: inherit;
}

.comment-form .account-primary-button {
    align-self: flex-start;
}

.comment-moderation-note,
.comment-login-note {
    color: var(--muted);
    font-size: .85rem;
}

.comment-pending-note {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #B7CA7D;
    border-radius: 7px;
    background: #F3F7E9;
    color: #334623;
}

/* Messages */
.messages-page {
    max-width: 820px;
    margin: 0 auto;
}

.messages-heading h1 {
    color: var(--accent);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-card {
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel);
}

.message-card.is-unread {
    border-color: #B7CA7D;
    background: #F6F9EE;
}

@media (max-width: 700px) {
    .chapter-list li {
        grid-template-columns: minmax(0, 1fr) 40px;
    }

    .chapter-meta {
        grid-column: 1 / -1;
        text-align: left;
    }
}


.chapter-reaction-button.is-selected {
    border-color: #1B4079;
    background: #1B4079;
    color: #FFFFFF;
    box-shadow: inset 0 0 0 1px #1B4079;
}

.chapter-reaction-button.is-selected:hover {
    background: #14315E;
    border-color: #14315E;
}


.public-author-reply {
    margin-top: 12px;
    padding: 10px 12px;
    border-left: 4px solid #4D7C8A;
    border-radius: 6px;
    background: #EEF3F2;
}

.public-author-reply strong {
    color: #1B4079;
}

.public-author-reply p {
    margin-bottom: 0;
}


.message-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.message-reply-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 32px;
    border: 1px solid #7E9E79;
    border-radius: 7px;
    background: var(--tag);
    color: #17351A;
    text-decoration: none;
    font-weight: 800;
}

.message-reply-pill:hover {
    background: #9DB995;
    color: #17351A;
}

.message-sender {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 400;
}

.message-reply-page textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    font: inherit;
}

.quoted-message {
    margin: 16px 0;
    padding: 12px 14px;
    border-left: 4px solid var(--accent-secondary);
    border-radius: 6px;
    background: #F2F6F5;
}


.message-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.message-view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid #7E9E79;
    border-radius: 7px;
    background: var(--tag);
    color: #17351A;
    text-decoration: none;
    font-weight: 800;
}

.message-view-link:hover {
    background: #9DB995;
    color: #17351A;
}

.message-reply-pill {
    display: none !important;
}


/* ============================================================
   Reader toolbar alignment fix
   ============================================================ */

.reader-toolbar .site-shell.reader-toolbar-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: min(1120px, calc(100% - 32px));
    margin-left: auto !important;
    margin-right: auto !important;
}

.reader-toolbar-pill {
    flex: 0 0 auto;
}
