html {
    color-scheme: light;
}
:root {
    --bg: #ffffff;
    --surface: #f8fafc;
    --surface-hover: #f1f5f9;
    --text: #111827;
    --text-muted: #6b7280;
    --primary: #10a37f;
    --primary-hover: #0d8a6b;
    --border: #e5e7eb;
    --success-bg: #ecfdf5;
    --success-text: #166534;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111827;
    --surface: #1f2937;
    --surface-hover: #374151;
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --primary: #10a37f;
    --primary-hover: #13b68c;
    --border: #374151;
    --success-bg: #064e3b;
    --success-text: #d1fae5;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
}
a {
    color: inherit;
    text-decoration: none;
}
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand {
    font-size: 1.25rem;
    font-weight: 700;
}
.nav-links {
    display: flex;
    gap: 1rem;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}
.nav-links a:hover {
    background: var(--surface-hover);
}
/* Typography */
h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.2;
}
p {
    color: var(--text-muted);
    line-height: 1.6;
}
/* Forms */
input,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}
textarea {
    min-height: 140px;
    resize: vertical;
}
button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.75rem;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
}
button:hover {
    background: var(--primary-hover);
}
/* Flash Messages */
.flash-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    background: var(--success-bg);
    color: var(--success-text);
}
/* Cards */
.card {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    color: var(--text);
}
/* Footer */
.footer {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}
/* Writs */
.writ-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}
.writ-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.writ-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 600;
}
.writ-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.writ-content {
    margin-top: 0.75rem;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}
.writ-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.writ-actions form {
    margin: 0;
}
.writ-actions .icon-button {
    width: 2rem;
    height: 2rem;
}
.writ-actions a:hover,
.writ-actions button:hover {
    color: var(--primary);
}
/* Comments */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.comment-actions form {
    margin: 0;
}
.comment-reply {
    width: calc(90% - 3rem);
    margin-top: 0.75rem;
    margin-left: auto;

    padding: 1rem;

    background: var(--surface-hover);

    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);

    border-radius: 0.75rem;
}
.comment-reply .comment-actions {
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.comment-reply .icon-button {
    width: 1.5rem;
    height: 1.5rem;

    font-size: 0.75rem;
}
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}
.comment-reply .writ-content {
    font-size: 0.95rem;
}

.comment-reply .writ-meta {
    font-size: 0.8rem;
}
.icon-button:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.icon-button.danger:hover {
    color: #ef4444;
}
/* Theme Toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}
.theme-toggle:hover {
    background: var(--surface-hover);
}
.theme-toggle-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}
.theme-toggle-fab:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
}
.theme-toggle-fab i {
    font-size: 1.1rem;
}
/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1.5rem 1rem;
    }
    .theme-toggle-fab {
        right: 1rem;
        bottom: 1rem;
    }
    .comment-actions {
        gap: 0.4rem;
    }
}


/* Up Down Vote */
.vote-count {
    min-width: 1.5rem;

    text-align: center;

    color: var(--text-muted);

    font-size: 0.9rem;
    font-weight: 600;
}

.icon-button.active {
    color: var(--primary);
}
.icon-button.downvote.active {
    color: #ef4444;
}

/* Notification Bell Red Count Mark */
.notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 18px;
    height: 18px;

    margin-left: 6px;

    border-radius: 999px;

    background: #ef4444;
    color: #fff;

    font-size: 11px;
    font-weight: 700;

    padding: 0 5px;
}