:root {
    color-scheme: light;
    --bg: #f3f6fa;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e0ea;
    --brand: #0f766e;
    --brand-dark: #0b5f59;
    --brand-soft: #e7f5f3;
    --danger: #b42318;
    --danger-soft: #fff1f0;
    --warn: #b54708;
    --warn-soft: #fff7ed;
    --ok: #047857;
    --ok-soft: #ecfdf3;
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--brand);
}

.page {
    min-height: 100vh;
    padding: 28px 16px;
}

.container {
    width: min(980px, 100%);
    margin: 0 auto;
}

.narrow {
    width: min(640px, 100%);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.title {
    margin: 0;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.1;
}

.subtitle {
    margin: 8px 0 0;
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:active,
.button:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
}

button.secondary,
.button.secondary {
    background: #eef4f3;
    color: var(--brand-dark);
}

button.secondary:hover,
.button.secondary:hover {
    background: #dcebea;
}

button.danger {
    background: var(--danger);
}

button.warn {
    background: var(--warn);
}

button.danger-light {
    background: var(--danger-soft);
    color: var(--danger);
}

button.danger-light:hover {
    background: #fee4e2;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-page {
    background:
        linear-gradient(180deg, #eaf2f6 0, rgba(234, 242, 246, 0) 260px),
        var(--bg);
}

.admin-container {
    width: min(1120px, 100%);
}

.admin-topbar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.07);
    padding: 18px;
}

.message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    display: none;
}

.message.show {
    display: block;
}

.message.ok {
    background: #ecfdf3;
    color: #05603a;
}

.message.error {
    background: #fef3f2;
    color: #912018;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
}

.settings-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) 120px auto auto;
    align-items: end;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
    padding: 14px;
    margin-bottom: 14px;
}

.settings-title {
    margin: 0;
    font-size: 17px;
}

.settings-copy {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.settings-field {
    gap: 5px;
    font-size: 13px;
}

.settings-field input {
    padding: 9px 10px;
}

.settings-number input {
    min-height: 40px;
}

.settings-check {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.settings-check input {
    width: auto;
}

.field-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.tab {
    flex: 1 1 150px;
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    box-shadow: none;
}

.tab.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.question-list {
    display: grid;
    gap: 14px;
}

.question-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
    padding: 18px;
}

.question-card.is-pinned {
    border-color: #14b8a6;
    box-shadow: 0 14px 34px rgba(15, 118, 110, 0.16);
}

.question-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.question-author {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--muted);
    font-size: 14px;
    margin-top: 2px;
}

.question-content {
    white-space: pre-wrap;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.45;
    margin: 0;
    min-width: 0;
}

.question-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #edf1f6;
}

.question-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 7px;
    width: max-content;
    max-width: 100%;
    margin-top: 1px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.question-actions button {
    flex: 0 0 auto;
    min-height: 34px;
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.action-approve {
    background: var(--ok);
}

.action-approve:hover {
    background: #036747;
}

.action-reject {
    background: var(--danger);
}

.action-reject:hover {
    background: #912018;
}

.action-hide {
    background: var(--warn);
}

.action-hide:hover {
    background: #93370d;
}

.action-pin {
    background: #1d4ed8;
}

.action-pin:hover {
    background: #1e40af;
}

.action-delete {
    background: #475467;
}

.action-delete:hover {
    background: #344054;
}

.question-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    background: #eef2f6;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.badge-live {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fff;
}

.projector {
    min-height: 100vh;
    background: #07141f;
    background-position: center;
    background-size: cover;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    padding: 48px;
    --projector-font-size: 72px;
}

.projector-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: #b7c3d0;
    font-size: clamp(18px, 2vw, 28px);
}

.projector-main {
    flex: 1;
    display: grid;
    place-items: center;
    text-align: center;
}

.projector-question {
    width: min(1200px, 100%);
}

.projector-text {
    font-size: clamp(36px, var(--projector-font-size), 120px);
    line-height: 1.16;
    font-weight: 700;
    margin: 0;
}

.projector-meta {
    margin-top: 34px;
    color: #cbd5e1;
    font-size: clamp(22px, 3vw, 38px);
}

.projector-empty {
    color: #b7c3d0;
    font-size: clamp(32px, 5vw, 68px);
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel {
        padding: 18px;
    }

    .question-head {
        flex-direction: column;
    }

    .question-badges {
        justify-content: flex-start;
    }

    .question-body {
        grid-template-columns: 1fr;
    }

    .question-actions {
        justify-content: flex-start;
        width: auto;
        max-width: 100%;
    }

    .settings-panel {
        grid-template-columns: 1fr;
    }

    .projector {
        padding: 24px;
    }
}
