:root {
    --ccf-ink: #171a20;
    --ccf-muted: #4b5563;
    --ccf-line: #d7dce3;
    --ccf-soft: #f4f6f8;
    --ccf-gold: #c69214;
    --ccf-gold-dark: #8a6300;
    --ccf-danger: #9f1d20;
}

.ccf-messages,
.ccf-move-page {
    max-width: 1180px;
    margin: 34px auto 60px;
    color: var(--ccf-ink);
}

.ccf-messages *,
.ccf-move-page * {
    box-sizing: border-box;
}

.ccf-messages-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.ccf-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--ccf-gold-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.ccf-messages h1,
.ccf-move-page h1 {
    margin: 0;
    color: var(--ccf-ink);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
}

.ccf-messages h2,
.ccf-move-page h2,
.ccf-messages strong,
.ccf-move-page strong,
.ccf-messages label,
.ccf-move-page label {
    color: var(--ccf-ink);
}

.ccf-messages-head p,
.ccf-move-form p,
.ccf-empty,
.ccf-empty-panel p,
.ccf-compose small,
.ccf-dialog-head small,
.ccf-conversation small,
.ccf-member-results small {
    color: var(--ccf-muted);
}

.ccf-button,
.ccf-messages a.ccf-button,
.ccf-move-page a.ccf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid #765500;
    border-radius: 8px;
    background: var(--ccf-gold);
    color: #111 !important;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.ccf-button:hover,
.ccf-button:focus-visible {
    background: #e0ad2f;
    color: #080808 !important;
}

.ccf-button-secondary,
.ccf-messages a.ccf-button-secondary {
    background: #fff;
    color: var(--ccf-ink) !important;
    border-color: #9aa3af;
}

.ccf-messages-layout {
    display: grid;
    grid-template-columns: minmax(230px, 30%) minmax(0, 1fr);
    min-height: 590px;
    overflow: hidden;
    border: 1px solid var(--ccf-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(18, 24, 33, .08);
}

.ccf-conversations {
    padding: 20px 14px;
    border-right: 1px solid var(--ccf-line);
    background: var(--ccf-soft);
}

.ccf-conversations h2 {
    margin: 0 8px 14px;
    font-size: 18px;
}

.ccf-conversation,
.ccf-member-results a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 9px;
    color: var(--ccf-ink) !important;
    text-decoration: none;
}

.ccf-conversation:hover,
.ccf-conversation:focus-visible,
.ccf-conversation.is-active,
.ccf-member-results a:hover,
.ccf-member-results a:focus-visible {
    background: #fff;
    box-shadow: 0 2px 10px rgba(18, 24, 33, .08);
}

.ccf-conversation span,
.ccf-member-results span {
    min-width: 0;
}

.ccf-conversation strong,
.ccf-member-results strong,
.ccf-conversation small,
.ccf-member-results small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ccf-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.ccf-dialog {
    display: flex;
    min-width: 0;
    flex-direction: column;
    background: #fff;
}

.ccf-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ccf-line);
}

.ccf-dialog-head > div {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ccf-dialog-head strong,
.ccf-dialog-head small {
    display: block;
}

.ccf-text-button {
    padding: 7px 4px;
    border: 0;
    background: transparent;
    color: var(--ccf-danger);
    font-weight: 700;
    cursor: pointer;
}

.ccf-message-stream {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    max-height: 560px;
    min-height: 370px;
    padding: 22px;
    overflow-y: auto;
    background: #fafbfc;
}

.ccf-message {
    align-self: flex-start;
    max-width: min(75%, 680px);
    padding: 11px 14px 7px;
    border: 1px solid var(--ccf-line);
    border-radius: 12px 12px 12px 3px;
    background: #fff;
    color: var(--ccf-ink);
    overflow-wrap: anywhere;
}

.ccf-message.is-mine {
    align-self: flex-end;
    border-color: #d4b766;
    border-radius: 12px 12px 3px 12px;
    background: #fff5cf;
}

.ccf-message a {
    color: #07599c !important;
    text-decoration: underline;
}

.ccf-message time {
    display: block;
    margin-top: 5px;
    color: #596273;
    font-size: 11px;
    text-align: right;
}

.ccf-compose {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--ccf-line);
    background: #fff;
}

.ccf-compose label,
.ccf-member-search label,
.ccf-move-form label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
}

.ccf-compose textarea,
.ccf-member-search input,
.ccf-move-form select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #8b95a3;
    border-radius: 8px;
    background: #fff;
    color: var(--ccf-ink);
}

.ccf-compose textarea {
    min-height: 105px;
    resize: vertical;
}

.ccf-compose > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
}

.ccf-new-dialog,
.ccf-empty-panel {
    padding: 26px;
}

.ccf-new-dialog h2,
.ccf-empty-panel h2 {
    margin-top: 0;
}

.ccf-member-search > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.ccf-member-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.ccf-notice {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #aab3bf;
    border-left-width: 5px;
    border-radius: 8px;
    background: #fff;
    color: var(--ccf-ink);
}

.ccf-notice-success {
    border-left-color: #1d7a3f;
    background: #effaf3;
}

.ccf-notice-error {
    border-left-color: var(--ccf-danger);
    background: #fff1f1;
}

.ccf-notice-info {
    border-left-color: #236da3;
    background: #eef7ff;
}

.ccf-pm-settings {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--ccf-line);
    border-radius: 9px;
    background: #fff;
    color: var(--ccf-ink);
}

.ccf-pm-settings summary {
    color: var(--ccf-ink);
    font-weight: 800;
    cursor: pointer;
}

.ccf-pm-settings form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
}

.ccf-author-message-link,
.ccf-move-post-action a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: #245f91 !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.ccf-author-message-link:hover,
.ccf-author-message-link:focus-visible,
.ccf-move-post-action a:hover,
.ccf-move-post-action a:focus-visible {
    color: #123e63 !important;
    text-decoration: underline;
}

.ccf-move-post-action {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #c6ccd4;
    text-align: right;
}

.ccf-profile-message-action {
    margin: 18px 0;
}

.ccf-source-post,
.ccf-move-form {
    margin-top: 22px;
    padding: 22px;
    border: 1px solid var(--ccf-line);
    border-radius: 12px;
    background: #fff;
    color: var(--ccf-ink);
}

.ccf-source-post h2 {
    margin-top: 0;
}

.ccf-source-post dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ccf-source-post dl div {
    padding: 10px;
    border-radius: 7px;
    background: var(--ccf-soft);
}

.ccf-source-post dt {
    color: var(--ccf-muted);
    font-size: 12px;
    font-weight: 700;
}

.ccf-source-post dd {
    margin: 3px 0 0;
    color: var(--ccf-ink);
    font-weight: 700;
}

.ccf-source-post blockquote {
    margin: 18px 0 0;
    padding: 14px 16px;
    border-left: 4px solid var(--ccf-gold);
    background: #fffbec;
    color: var(--ccf-ink);
}

.ccf-move-form select {
    margin-bottom: 10px;
}

@media (max-width: 760px) {
    .ccf-messages,
    .ccf-move-page {
        margin: 22px 10px 44px;
    }

    .ccf-messages-head,
    .ccf-pm-settings form {
        align-items: stretch;
        flex-direction: column;
    }

    .ccf-messages-layout {
        grid-template-columns: 1fr;
    }

    .ccf-conversations {
        max-height: 260px;
        border-right: 0;
        border-bottom: 1px solid var(--ccf-line);
        overflow-y: auto;
    }

    .ccf-message {
        max-width: 90%;
    }

    .ccf-compose > div,
    .ccf-dialog-head {
        align-items: stretch;
        flex-direction: column;
    }

    .ccf-member-results,
    .ccf-source-post dl {
        grid-template-columns: 1fr;
    }
}
