:root {
    --bg: #090b0f;
    --panel: #11151b;
    --panel-2: #171c24;
    --border: #252c36;
    --text: #f4f6f8;
    --muted: #8f99a8;
    --accent: #34d399;
    --accent-strong: #10b981;
    --danger: #fb7185;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    isolation: isolate;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* Halo neon verde fixo, atrás do conteúdo e sem interceptar cliques. */
body::before {
    content: "";
    position: fixed;
    inset: -40px;
    z-index: -1;
    pointer-events: none;
    filter: blur(26px);
    background:
        radial-gradient(ellipse 660px 310px at 8% 7%, rgba(52, 211, 153, 0.136) 0%, rgba(16, 185, 129, 0.06) 35%, rgba(16, 185, 129, 0.0144) 65%, transparent 100%),
        radial-gradient(ellipse 350px 460px at 24% 0%, rgba(16, 185, 129, 0.096) 0%, rgba(16, 185, 129, 0.028) 45%, transparent 95%),
        radial-gradient(ellipse 490px 220px at 32% 18%, rgba(52, 211, 153, 0.048) 0%, transparent 100%),
        radial-gradient(ellipse 360px 520px at 96% 35%, rgba(16, 185, 129, 0.092) 0%, rgba(16, 185, 129, 0.032) 45%, transparent 100%),
        radial-gradient(ellipse 550px 260px at 84% 54%, rgba(52, 211, 153, 0.036) 0%, transparent 100%),
        radial-gradient(ellipse 650px 280px at 35% 97%, rgba(52, 211, 153, 0.036) 0%, transparent 100%);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -.045em;
}

h2 {
    margin-bottom: 0;
    font-size: 1.3rem;
}

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

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(17, 21, 27, .92);
    box-shadow: var(--shadow);
}

.form-panel {
    margin-bottom: 20px;
    padding: 22px;
}

.panel-heading,
.section-title,
.card-top,
.card-footer,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: var(--panel-2);
    font-size: 1.35rem;
}

form {
    margin-top: 20px;
}

label {
    display: block;
    margin: 14px 0 8px;
    color: #cbd2da;
    font-size: .9rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: #0d1117;
    transition: border-color .18s ease, box-shadow .18s ease;
}

input,
select {
    min-height: 46px;
    padding: 0 14px;
}

textarea {
    resize: vertical;
    min-height: 120px;
    padding: 14px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(52, 211, 153, .75);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .11);
}

.form-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.btn {
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 800;
}

.btn-primary {
    color: #04110c;
    background: var(--accent);
}

.btn-primary:hover {
    background: #6ee7b7;
}

.btn-secondary {
    color: #d3dae3;
    border-color: var(--border);
    background: var(--panel-2);
}

.form-status {
    min-height: 20px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .88rem;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 14px;
    margin-bottom: 34px;
    padding: 14px;
}

.search-wrap {
    position: relative;
}

.search-wrap input {
    padding-left: 44px;
    padding-right: 72px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.35rem;
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: .78rem;
    font-weight: 700;
}

select {
    cursor: pointer;
}

.section-title {
    margin-bottom: 14px;
}

.counter {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--panel);
    font-size: .8rem;
}

.cards {
    display: grid;
    gap: 14px;
}

.question-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(23, 28, 36, .96), rgba(15, 19, 25, .96));
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    transition: transform .18s ease, border-color .18s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    border-color: #35404e;
}

.card-top {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: .78rem;
}

.question-number {
    color: var(--accent);
    font-weight: 900;
}

.question-text {
    margin-bottom: 16px;
    font-size: clamp(1.25rem, 1.05rem + .65vw, 1.55rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.answer-box {
    padding: 15px;
    border-left: 3px solid var(--accent);
    border-radius: 4px 12px 12px 4px;
    background: rgba(52, 211, 153, .055);
}

.answer-label {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.answer-text {
    margin-bottom: 0;
    color: #d9dfe6;
    white-space: pre-wrap;
    line-height: 1.58;
}

.card-footer {
    justify-content: flex-end;
    margin-top: 15px;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #cbd2da;
    background: #0e1218;
    font-size: .84rem;
    font-weight: 800;
}

.like-btn:hover,
.like-btn.liked {
    border-color: rgba(52, 211, 153, .55);
    color: #dffbee;
    background: rgba(52, 211, 153, .08);
}

.like-btn.liked {
    cursor: default;
    opacity: .88;
}

.like-count {
    min-width: 20px;
    color: var(--accent);
    text-align: center;
}

.empty-state {
    padding: 56px 24px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state h3 {
    color: var(--text);
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent);
    background: var(--panel);
    font-weight: 900;
}

.hidden {
    display: none !important;
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 24px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar .btn {
        width: 100%;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .question-card {
        padding: 16px;
    }
}

/* Complementos dos novos controles; estilo existente preservado. */
.card-meta { display: grid; gap: 4px; text-align: right; overflow-wrap: anywhere; }
.card-footer { flex-wrap: wrap; }
.dislike-btn {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 38px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 999px;
    color: #cbd2da; background: #0e1218; font-size: .84rem; font-weight: 800;
}
.dislike-btn:hover, .dislike-btn.disliked {
    border-color: rgba(251, 113, 133, .4);
    background: rgba(251, 113, 133, .06);
}
.dislike-btn.disliked { cursor: default; opacity: .88; }
.dislike-count { min-width: 20px; color: var(--danger); text-align: center; }
.confirmation-dialog {
    width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
    padding: 22px; color: var(--text); background: var(--panel);
    overflow-y: auto;
}
.confirmation-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.confirmation-dialog h2 { line-height: 1.45; }
.confirmation-dialog .form-actions { flex-wrap: wrap; }
.confirmation-dialog button:disabled { cursor: wait; opacity: .65; }

.motivos-btn { border: 0; padding: 6px 0; color: var(--muted); background: transparent; font-size: .78rem; }
.motivos-btn:hover { color: var(--text); text-decoration: underline; }
.motivos-list { padding-left: 24px; }
.motivos-list li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.motivos-list p { margin-bottom: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.motivos-list time { color: var(--muted); font-size: .78rem; }

/* Reflexos localizados: a luz ambiente encontra as bordas das caixas. */
.controls,
.form-panel,
.question-card {
    position: relative;
}

@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
    .controls::before,
    .form-panel::before,
    .question-card::before {
        content: "";
        position: absolute;
        inset: -1px;
        padding: 1px;
        border-radius: inherit;
        pointer-events: none;
        background:
            radial-gradient(ellipse 560px 200px at 12% 0%, rgba(110, 231, 183, .28) 0%, rgba(52, 211, 153, .10) 35%, rgba(52, 211, 153, .035) 65%, transparent 100%),
            radial-gradient(ellipse 420px 240px at 100% 72%, rgba(52, 211, 153, .18) 0%, rgba(52, 211, 153, .055) 40%, transparent 100%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
    }
}

.question-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

/* Cabeçalho compacto, inclusive para HTML antigo ainda carregado. */
.question-number { display: none; }
.question-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
    column-gap: 20px;
    row-gap: 14px;
}
.question-card .card-top { display: contents; }
.question-card .question-text {
    grid-column: 1; grid-row: 1;
    min-width: 0; margin: 0; color: var(--text);
    align-self: start;
}
.question-card .card-meta {
    grid-column: 2; grid-row: 1;
    min-width: 0; line-height: 1.5;
    color: var(--muted); font-size: .78rem;
    align-self: start;
}
.question-card .answer-box { grid-column: 1 / -1; grid-row: 2; }
.question-card .card-footer {
    grid-column: 1 / -1; grid-row: 3; margin-top: 0;
}
@media (max-width: 720px) {
    .question-card { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
    .question-card .card-meta { grid-column: 1; grid-row: 2; text-align: left; }
    .question-card .answer-box { grid-row: 3; }
    .question-card .card-footer { grid-row: 4; }
}

/* Acabamento visual: ícones, leitura, autoria e feedback. */
.ui-icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.thumbs-down { transform: rotate(180deg); }
.btn, .copy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; }
.search-icon { display: flex; }
.question-text { font-weight: 650; letter-spacing: -.02em; }
.answer-text { font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.answer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.answer-heading .answer-label { margin-bottom: 0; }
.copy-btn { border: 0; border-radius: 6px; padding: 4px 6px; color: var(--muted); background: transparent; font-size: .75rem; }
.copy-btn:hover { color: var(--accent); background: rgba(52, 211, 153, .06); }
.card-meta.author-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.author-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid rgba(52, 211, 153, .2); border-radius: 50%; color: var(--accent); background: rgba(52, 211, 153, .055); font-weight: 600; }
.author-details { display: grid; gap: 4px; min-width: 0; }
.author-name { color: #bac4cf; overflow-wrap: anywhere; }
.author-details time { color: var(--muted); font-size: .72rem; }
.like-btn, .dislike-btn { font-weight: 550; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.like-count, .dislike-count { font-size: .9rem; font-weight: 750; }
.card-footer { gap: 10px; }
.motivos-btn { margin-right: 2px; }
.btn, .copy-btn, .icon-btn { transition: background .18s ease, border-color .18s ease, color .18s ease; }
.question-card:hover { transform: none; border-color: rgba(52, 211, 153, .28); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(420px, calc(100% - 32px)); padding: 14px 18px; border: 1px solid rgba(52, 211, 153, .3); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(251, 113, 133, .4); }
@media (max-width: 720px) {
    .card-meta.author-meta { justify-content: flex-start; }
    .toast { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .question-card, .btn, .copy-btn, .icon-btn, .like-btn, .dislike-btn, .toast { transition: none; }
}

/* Títulos leves, mantendo a hierarquia e os tamanhos atuais. */
h1 { font-weight: 550; letter-spacing: -.035em; }
h2 { font-weight: 500; letter-spacing: -.015em; }
.question-text { font-weight: 500; letter-spacing: -.015em; }
.empty-state h3 { font-weight: 500; }

/* No desktop, a inicial fecha o bloco do autor à direita. */
@media (min-width: 721px) {
    .card-meta.author-meta .author-avatar { order: 1; }
}
