:root {
    --blue: #003781;
    --blue-dark: #002f6c;
    --cyan: #00a0df;
    --green: #0f7b5f;
    --red: #b42318;
    --amber: #9a5b00;
    --ink: #101828;
    --muted: #667085;
    --line: #d0d5dd;
    --soft: #f2f4f7;
    --paper: #ffffff;
    --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f8fafc;
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

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

.shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 24px 0;
}

.embed-view .shell {
    width: 100%;
    padding: 0;
}

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

.embed-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.15;
}

h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 18px;
}

h2 span,
.counter {
    display: inline-flex;
    min-width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}

.lead,
.meta-line {
    color: var(--muted);
}

.notice {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.notice.success {
    background: #e8f5f0;
    color: var(--green);
}

.notice.error {
    background: #fef3f2;
    color: var(--red);
}

.notice.warning {
    background: #fff7e6;
    color: var(--amber);
}

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

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

label,
.field {
    display: grid;
    gap: 7px;
}

label > span,
.field > span {
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

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

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: 3px solid rgba(0, 160, 223, 0.18);
    border-color: var(--cyan);
}

small {
    color: var(--red);
    font-size: 13px;
}

button,
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button.primary,
.button.primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

button.danger {
    border-color: #fda29b;
    color: var(--red);
}

button:hover,
.button:hover {
    border-color: var(--blue);
}

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

.choice-row {
    display: grid;
    gap: 10px;
}

.choice {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.choice input {
    width: auto;
}

.fixed-choice {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--soft);
    font-weight: 700;
}

.top-nav,
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.top-nav {
    margin-bottom: 18px;
    padding: 12px 0;
}

.top-nav div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.top-nav a {
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--ink);
    text-decoration: none;
}

.top-nav a.active {
    background: var(--blue);
    color: #fff;
}

.page-title-row {
    margin-bottom: 18px;
}

.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.tab-row a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

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

.tab-row span {
    color: inherit;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    background: var(--soft);
    color: #344054;
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

.empty {
    color: var(--muted);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.link-grid a {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    color: var(--ink);
    text-decoration: none;
}

.link-grid span {
    color: var(--muted);
    font-size: 13px;
}

.link-grid a:hover {
    border-color: var(--blue);
}

.status-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.status-board > section {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfe;
}

.question-card {
    display: grid;
    min-width: 0;
    gap: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.question-meta,
.question-source {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.question-text {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.question-source {
    margin: 0;
}

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

.table-actions {
    min-width: 180px;
}

.table-actions form {
    margin: 0;
}

.table-actions button {
    min-height: 38px;
    padding: 8px 10px;
}

.moderator-view {
    background: #0b1220;
    color: #fff;
}

.moderator-view .shell {
    width: min(1180px, calc(100vw - 32px));
    padding: 20px 0;
}

.moderator-shell {
    display: grid;
    gap: 18px;
}

.moderator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    padding-bottom: 16px;
}

.moderator-header .eyebrow {
    color: #79d3ff;
}

.moderator-header h1 {
    font-size: 34px;
}

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

.moderator-question {
    display: grid;
    min-width: 0;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
}

.moderator-question p {
    margin: 0;
    font-size: clamp(20px, 3vw, 32px);
    line-height: 1.25;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.moderator-question footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #b9c4d5;
}

.moderator-question footer span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.moderator-question button {
    border-color: #79d3ff;
    background: #79d3ff;
    color: #07111f;
}

.moderator-empty {
    display: grid;
    min-height: 45vh;
    place-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    color: #b9c4d5;
    font-size: 24px;
}

.asked-log {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    color: #b9c4d5;
}

.asked-log h2 {
    display: block;
    color: #fff;
}

.asked-log p {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 860px) {
    .shell {
        width: min(100vw - 20px, 720px);
        padding: 10px 0;
    }

    .panel {
        padding: 18px;
    }

    .top-nav,
    .page-title-row,
    .moderator-question footer {
        align-items: stretch;
        flex-direction: column;
    }

    .status-board {
        grid-template-columns: 1fr;
    }

    .moderator-header h1 {
        font-size: 28px;
    }
}
