* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --twitter-blue: #e8893a;
    --twitter-dark: #cc6c22;
    --ink: #292f33;
    --muted: #657786;
    --line: #e1e8ed;
    --page: #f5e9dd;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

.bop-page {
    --twitter-blue: #3385f5;
    --twitter-dark: #2464c0;
    --page: #eef5ff;
}

.bop-page .topbar {
    border-bottom-color: var(--twitter-dark);
    background: var(--twitter-blue);
}

.bop-page .box-title {
    background: #f2f7ff;
}

.bop-page .room-message {
    background: #f2f7ff;
}

a {
    color: var(--twitter-blue);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    color: var(--twitter-dark);
    text-decoration: underline;
}

button,
input,
textarea {
    font: inherit;
}

button {
    padding: 7px 14px;
    border: 1px solid var(--twitter-blue);
    border-radius: 999px;
    background: var(--twitter-blue);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

button:hover {
    border-color: var(--twitter-dark);
    background: var(--twitter-dark);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

input,
textarea {
    border: 1px solid #ccd6dd;
    border-radius: 5px;
    background: #ffffff;
    color: var(--ink);
    padding: 9px 11px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
textarea:focus {
    border-color: var(--twitter-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.15);
}

textarea {
    resize: vertical;
}

.topbar {
    min-height: 52px;
    padding: 10px max(16px, calc((100% - 960px) / 2));
    border-bottom: 1px solid #cc6c22;
    background: #e8893a;
    color: #ffffff;
}

.topbar-title {
    margin-right: 20px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.topbar a {
    margin-right: 15px;
    color: #ffffff;
    font-weight: 600;
}

.topbar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.topbar-right {
    float: right;
    color: rgba(255, 255, 255, 0.95);
}

.clear {
    clear: both;
}

.page {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 22px 12px 32px;
}

.notice {
    margin-bottom: 12px;
    padding: 12px 15px;
    border: 1px solid #f0d2b7;
    border-radius: 6px;
    background: #fff8f1;
    color: #785638;
}

.notice a {
    font-weight: 600;
}

.box,
.post,
.replies,
.profile {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(41, 47, 51, 0.05);
}

.box-title {
    padding: 11px 15px;
    border-bottom: 1px solid var(--line);
    background: #f5f8fa;
    font-weight: 700;
}

.box-body {
    padding: 15px;
}

.toolbar {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.toolbar input {
    flex: 1;
    min-width: 0;
}

.auth-panel {
    display: none;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f5f8fa;
}

.auth-columns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.auth-column {
    min-width: 250px;
    flex: 1;
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    margin-bottom: 5px;
    color: #3b4b54;
    font-weight: 700;
}

.field input {
    width: 100%;
    max-width: 400px;
}

.field textarea {
    width: 100%;
    min-height: 180px;
}

.brand-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.field select {
    width: 100%;
    max-width: 400px;
}

input[type="file"] {
    display: block;
    width: 100%;
    max-width: 520px;
    margin-top: 6px;
}

.post-form textarea {
    width: 100%;
    min-height: 180px;
}

.post-form input[type="text"] {
    width: 100%;
    max-width: 600px;
}

.visibility {
    margin-top: 10px;
}

.visibility label {
    color: var(--muted);
}

.visibility input {
    accent-color: var(--twitter-blue);
}

.form-actions {
    margin-top: 10px;
}

.form-actions button + button {
    margin-left: 5px;
    border-color: #ccd6dd;
    background: #ffffff;
    color: #536471;
}

.form-actions button + button:hover {
    border-color: #aab8c2;
    background: #f5f8fa;
}

.status {
    margin-left: 8px;
    color: var(--muted);
}

.feed {
    width: 100%;
}

.post {
    margin-bottom: 10px;
}

.post-header {
    padding: 13px 16px 10px;
}

.post-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.post-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.post-meta a {
    font-size: inherit;
    font-weight: 600;
}

.post-actions {
    margin-top: 8px;
}

.post-actions button {
    padding: 4px 10px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}

.post-actions button:hover {
    border-color: transparent;
    background: #fff0f0;
    color: #c0392b;
}

.replies {
    padding: 15px;
}

.replies h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.reply {
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.reply-header {
    color: var(--muted);
    font-size: 12px;
}

.reply-body {
    overflow-wrap: anywhere;
    padding-top: 4px;
}

.reply-body p:first-child {
    margin-top: 0;
}

.reply-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.reply-form label,
.reply-form textarea {
    display: block;
    width: 100%;
}

.reply-form label {
    margin-bottom: 6px;
    font-weight: 700;
}

.reply-form textarea {
    min-height: 80px;
}

.reply-login {
    padding-top: 12px;
    color: var(--muted);
}

.post-body {
    padding: 4px 16px 16px;
    overflow-wrap: anywhere;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.post-body video {
    display: block;
    max-width: 100%;
    max-height: 480px;
    margin: 12px 0;
    border-radius: 5px;
    background: #111111;
}

.profile-body > p:first-child img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
}

.post-body pre {
    overflow-x: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f5f8fa;
}

.post-body code {
    border-radius: 3px;
    background: #f5f8fa;
    padding: 2px 4px;
}

.post-body pre code {
    padding: 0;
    background: transparent;
}

.post-body blockquote {
    margin-left: 0;
    padding-left: 12px;
    border-left: 3px solid var(--twitter-blue);
    color: var(--muted);
}

.empty {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.profile-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #f5f8fa;
}

.profile-username {
    font-size: 18px;
    font-weight: 700;
}

.profile-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.profile-body {
    padding: 16px;
    overflow-wrap: anywhere;
}

.profile-editor {
    display: none;
}

.hidden {
    display: none !important;
}

.error {
    color: #c0392b;
}

.success {
    color: #238636;
}

.footer {
    margin-top: 20px;
    padding: 14px 0 4px;
    border-top: 1px solid #ccd6dd;
    color: var(--muted);
    font-size: 12px;
}

.room-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 12px;
}

.room-list {
    display: grid;
    gap: 8px;
}

.room-list button {
    width: 100%;
    text-align: left;
}

.room-chat {
    display: flex;
    min-height: 360px;
    flex-direction: column;
}

.room-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    max-height: 55vh;
    min-height: 220px;
    overflow-y: auto;
    padding: 12px;
}

.room-message {
    overflow-wrap: anywhere;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f5f8fa;
}

.room-message-meta {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 12px;
}

.room-message-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.room-message-form input {
    flex: 1;
    min-width: 0;
}

.room-challenge {
    margin-top: 12px;
}

@media (max-width: 600px) {
    .room-layout {
        grid-template-columns: 1fr;
    }

    .room-message-form {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 10px 12px;
    }

    .topbar-right {
        float: none;
        display: block;
        margin-top: 7px;
    }

    .page {
        padding: 14px 8px 24px;
    }

    .auth-column {
        width: 100%;
        min-width: 0;
    }

    .notice,
    .box-body,
    .auth-panel {
        padding: 11px;
    }
}
