*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f6f7f8;
    color: #1c1c1c;
    line-height: 1.5;
}

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #edeff1;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff4500;
    margin-bottom: 0.25rem;
}

.auth-card h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #576069;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1c1c1c;
}

.form-group input {
    padding: 0.625rem 0.75rem;
    border: 1px solid #edeff1;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: #0079d3;
}

/* Buttons */
.btn {
    padding: 0.625rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.btn-primary {
    background: #ff4500;
    color: #fff;
}

.btn-primary:hover {
    background: #e03d00;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

/* Alerts */
.alert {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #fff8f7;
    border: 1px solid #ff4500;
    color: #ff4500;
}

.alert-success {
    background: #f0faf0;
    border: 1px solid #46d160;
    color: #1a7f37;
}

/* Footer link */
.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: #576069;
}

.auth-footer a {
    color: #0079d3;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid #edeff1;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ff4500;
    text-decoration: none;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-username {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1c1c1c;
    margin-right: 0.5rem;
}

/* Buttons - add to existing btn styles */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-ghost {
    background: transparent;
    color: #0079d3;
    border: 1px solid #0079d3;
}

.btn-ghost:hover {
    background: #e8f0fe;
}

/* Layout */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.75rem;
    color: #878a8c;
    border-top: 1px solid #edeff1;
    margin-top: 2rem;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 500;
}

/* Board list */
.board-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.board-card {
    background: #fff;
    border: 1px solid #edeff1;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.15s;
}

.board-card:hover {
    border-color: #0079d3;
}

.board-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: #0079d3;
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
}

.board-card-title:hover {
    text-decoration: underline;
}

.board-card-description {
    font-size: 0.875rem;
    color: #576069;
}

.board-card-description.muted {
    font-style: italic;
    color: #878a8c;
}

.board-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.board-card-members {
    font-size: 0.8125rem;
    color: #878a8c;
    white-space: nowrap;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}

.badge-private {
    background: #f6f7f8;
    color: #576069;
    border: 1px solid #edeff1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #576069;
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Board header */
.board-header {
    background: #fff;
    border: 1px solid #edeff1;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.board-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1c1c1c;
    margin-bottom: 0.375rem;
}

.board-description {
    font-size: 0.875rem;
    color: #576069;
    margin-bottom: 0.75rem;
}

.board-description.muted {
    font-style: italic;
    color: #878a8c;
}

.board-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #878a8c;
    flex-wrap: wrap;
}

.meta-divider {
    color: #edeff1;
}

.board-header-actions {
    flex-shrink: 0;
}

/* Board content */
.board-content {
    display: flex;
    gap: 1.5rem;
}

.posts {
    flex: 1;
}
.inline-form {
    display: inline;
    margin: 0;
}

@media (max-width: 768px) {
    .page-header,
    .board-card,
    .board-header,
    .board-content {
        flex-direction: column;
        align-items: stretch;
    }

    .board-card-meta,
    .board-header-actions {
        margin-left: 0;
    }
}

/* Post form */
.post-form-container {
    max-width: 740px;
    margin: 0 auto;
}

.post-form-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-form-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

.post-form-board {
    font-size: 0.875rem;
    color: #878a8c;
}

.post-form-board a {
    color: #0079d3;
    text-decoration: none;
    font-weight: 500;
}

.post-form-board a:hover {
    text-decoration: underline;
}

/* Post type tabs */
.post-type-tabs {
    display: flex;
    border-bottom: 1px solid #edeff1;
    margin-bottom: 1rem;
}

.post-type-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #878a8c;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.post-type-tab:hover {
    color: #1c1c1c;
    background: #f6f7f8;
}

.post-type-tab.active {
    color: #0079d3;
    border-bottom-color: #0079d3;
}

/* Post form */
.post-form {
    background: #fff;
    border: 1px solid #edeff1;
    border-radius: 8px;
    padding: 1.25rem;
}

.post-form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #edeff1;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}

.post-form textarea:focus {
    border-color: #0079d3;
}

.form-hint {
    font-size: 0.75rem;
    color: #878a8c;
    margin-top: 0.25rem;
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Post list */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.post-card {
    background: #fff;
    border: 1px solid #edeff1;
    border-radius: 8px;
    display: flex;
    gap: 0;
    transition: border-color 0.15s;
    overflow: hidden;
}

.post-card:hover {
    border-color: #898989;
}

/* Vote column */
.post-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: #f8f9fa;
    min-width: 48px;
}

.btn-vote {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #878a8c;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.btn-vote-up:hover {
    color: #ff4500;
    background: #fff0ec;
}

.btn-vote-down:hover {
    color: #7193ff;
    background: #edf0ff;
}

.post-score {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1c1c1c;
}

/* Post content */
.post-content {
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #878a8c;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}

.post-author {
    color: #1c1c1c;
    font-weight: 500;
}

.post-title {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: #1c1c1c;
    text-decoration: none;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.post-title:hover {
    color: #0079d3;
}

.post-url a {
    font-size: 0.75rem;
    color: #878a8c;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 400px;
}

.post-url a:hover {
    text-decoration: underline;
}

/* Post type badges */
.post-type-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    text-transform: lowercase;
}

.badge-text {
    background: #e8f0fe;
    color: #185fa5;
}

.badge-url {
    background: #fff0ec;
    color: #993c1d;
}

.btn-vote:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-vote.active {
    color: #ff4500;
    font-weight: 700;
}

.btn-vote-down.active {
    color: #7193ff;
}

/* Post view */
.post-view-container {
    max-width: 740px;
    margin: 0 auto;
}

.post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    color: #878a8c;
}

.breadcrumb-link {
    color: #0079d3;
    text-decoration: none;
    font-weight: 500;
}

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

.breadcrumb-current {
    color: #878a8c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.post-card-full {
    margin-bottom: 1.5rem;
}

.post-view-title {
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1c1c1c;
}

.post-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #1c1c1c;
    white-space: pre-wrap;
}

.post-external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #0079d3;
    font-size: 0.875rem;
    word-break: break-all;
}

.post-external-link:hover {
    text-decoration: underline;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edeff1;
}

.btn-danger {
    background: transparent;
    color: #ff4500;
    border: 1px solid #ff4500;
}

.btn-danger:hover {
    background: #fff0ec;
}

/* Comments */
.comments-section {
    background: #fff;
    border: 1px solid #edeff1;
    border-radius: 8px;
    padding: 1.25rem;
}

.comments-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #edeff1;
}

/* Comments */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-card {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #edeff1;
}

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

.comment-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    min-width: 32px;
    flex-shrink: 0;
}

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

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #878a8c;
    margin-bottom: 0.375rem;
}

.comment-author {
    font-weight: 500;
    color: #1c1c1c;
}

.comment-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1c1c1c;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.comment-deleted {
    color: #878a8c;
    font-style: italic;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-owner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-reply-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-edit-form textarea,
.comment-reply-form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #edeff1;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s;
}

.comment-edit-form textarea:focus,
.comment-reply-form textarea:focus {
    border-color: #0079d3;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.comment-replies {
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid #edeff1;
}

.add-comment-form {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #edeff1;
}

.add-comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #edeff1;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}

.add-comment-form textarea:focus {
    border-color: #0079d3;
}