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

:root {
    --clr-bg:         #f5f4f0;
    --clr-surface:    #ffffff;
    --clr-border:     #e2e0d8;
    --clr-border-md:  #c8c6bc;
    --clr-text:       #1a1a18;
    --clr-muted:      #6b6a64;
    --clr-accent:     #1D9E75;
    --clr-accent-bg:  #E1F5EE;
    --clr-accent-txt: #0F6E56;
    --clr-danger:     #A32D2D;
    --clr-danger-bg:  #FCEBEB;
    --clr-new-bg:     #E1F5EE;
    --clr-new-bdr:    #1D9E75;
    --radius-md:      8px;
    --radius-lg:      12px;
    --shadow:         0 1px 3px rgba(0,0,0,0.07);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--clr-bg);
    color: var(--clr-text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Layout ── */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* ── Header ── */
.site-header {
    text-align: center;
    margin-bottom: 2rem;
}
.site-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.site-header p {
    font-size: 13px;
    color: var(--clr-muted);
    margin-top: 4px;
}

/* ── Card ── */
.card {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* ── Form ── */
label {
    display: block;
    font-size: 13px;
    color: var(--clr-muted);
    margin-bottom: 5px;
    font-weight: 500;
}
input[type="text"],
textarea {
    width: 100%;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    border: 0.5px solid var(--clr-border-md);
    border-radius: var(--radius-md);
    background: var(--clr-bg);
    color: var(--clr-text);
    outline: none;
    transition: border-color 0.15s;
    resize: vertical;
}
input[type="text"]:focus,
textarea:focus {
    border-color: var(--clr-accent);
    background: #fff;
}
textarea { min-height: 110px; }
.field { margin-bottom: 1rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 0.5px solid transparent;
    transition: opacity 0.15s, background 0.15s;
}
.btn-primary {
    background: var(--clr-text);
    color: #fff;
}
.btn-primary:hover { opacity: 0.82; }
.btn-outline {
    background: transparent;
    color: var(--clr-text);
    border-color: var(--clr-border-md);
}
.btn-outline:hover { background: var(--clr-bg); }
.btn-danger {
    background: transparent;
    color: var(--clr-danger);
    border-color: #F09595;
}
.btn-danger:hover { background: var(--clr-danger-bg); }
.btn-sm { padding: 4px 11px; font-size: 12px; }

/* ── Status message ── */
.status-msg {
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}
.status-msg.ok  { color: var(--clr-accent-txt); }
.status-msg.err { color: var(--clr-danger); }

/* ── Moderator top bar ── */
.mod-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}
.mod-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mod-bar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Live indicator ── */
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--clr-accent);
    animation: blink 1.6s infinite;
    flex-shrink: 0;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.25} }

/* ── Filters ── */
.filters {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 4px 13px;
    border-radius: 99px;
    font-size: 12px;
    font-family: inherit;
    border: 0.5px solid var(--clr-border-md);
    background: transparent;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.filter-btn.active {
    background: var(--clr-text);
    color: #fff;
    border-color: transparent;
}

/* ── Count chip ── */
.chip {
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--clr-bg);
    border: 0.5px solid var(--clr-border);
    color: var(--clr-muted);
}

/* ── Question cards ── */
.q-list { display: flex; flex-direction: column; gap: 10px; }

.q-card {
    background: var(--clr-surface);
    border: 0.5px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    transition: opacity 0.2s;
}
.q-card.is-answered {
    opacity: 0.55;
}
.q-card.is-answered .q-text {
    text-decoration: line-through;
    color: var(--clr-muted);
}
.q-card.is-new {
    border-color: var(--clr-new-bdr);
    background: var(--clr-new-bg);
    animation: slideIn 0.35s ease;
}
@keyframes slideIn {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0); }
}

.q-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.q-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-muted);
}
.q-time {
    font-size: 12px;
    color: var(--clr-muted);
}
.q-text {
    font-size: 14px;
    line-height: 1.55;
}
.q-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.badge {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    font-weight: 500;
}
.badge-open     { background: var(--clr-accent-bg); color: var(--clr-accent-txt); }
.badge-answered { background: var(--clr-bg); color: var(--clr-muted); border: 0.5px solid var(--clr-border-md); }

/* ── Empty state ── */
.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--clr-muted);
    font-size: 14px;
}

/* ── Footer link ── */
.page-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 13px;
    color: var(--clr-muted);
}
.page-link a {
    color: var(--clr-accent-txt);
    text-decoration: none;
    font-weight: 500;
}
.page-link a:hover { text-decoration: underline; }
