:root {
    color-scheme: light;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #eef2f7;
    --text: #101828;
    --muted: #667085;
    --border: #d9e0ea;
    --primary: #0f3b67;
    --primary-2: #121938;
    --accent: #13b5a6;
    --danger: #c2410c;
    --shadow: 0 18px 55px rgba(16, 24, 40, .10);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1117;
    --surface: #151a23;
    --surface-2: #1f2633;
    --text: #f3f6fb;
    --muted: #a7b0c0;
    --border: #2e3748;
    --primary: #57a7ff;
    --primary-2: #e7edf8;
    --accent: #33d3bd;
    --shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; }
.brand img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: #fff; }
.topbar nav { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    gap: 34px;
    align-items: start;
    flex: 1;
}
.hero-copy { padding: 80px 0; position: sticky; top: 0; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 13px; text-transform: uppercase; font-weight: 780; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 68px); line-height: .98; letter-spacing: 0; }
h2 { margin: 4px 0 0; font-size: 24px; }
.hero-copy p:not(.eyebrow) { color: var(--muted); font-size: 19px; line-height: 1.6; max-width: 560px; }
button, .link-button {
    border: 0;
    border-radius: 8px;
    min-height: 42px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.primary { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; }
[data-theme="dark"] .primary { color: #09111c; background: linear-gradient(135deg, #f3f7ff, var(--primary)); }
.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.small { min-height: 36px; font-size: 13px; }
.briefing-panel, .login-card, .result-card, .side-panel {
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.briefing-panel { padding: 24px; }
.progress-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.progress-head span, .progress-head strong { color: var(--muted); font-size: 13px; }
.progress {
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin: 18px 0 26px;
}
.progress span { display: block; height: 100%; width: 5%; background: var(--accent); transition: width .25s ease; }
.step { display: none; animation: rise .2s ease; }
.step.active { display: grid; gap: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    min-height: 44px;
    padding: 11px 12px;
    font: inherit;
    outline: none;
}
textarea { min-height: 118px; resize: vertical; line-height: 1.45; }
textarea.large { min-height: 220px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.check-grid, .radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.check-grid.dense { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-grid label, .radio-grid label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    min-height: 46px;
}
.check-grid input, .radio-grid input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.repeat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
[data-repeat="references"] .repeat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.footer {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 0;
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}
.center-page { min-height: 68vh; display: grid; place-items: center; padding: 20px; }
.login-card, .result-card { width: min(460px, 100%); padding: 28px; display: grid; gap: 16px; }
.login-card h1, .result-card h1 { font-size: 32px; line-height: 1.1; }
.result-card p { color: var(--muted); line-height: 1.6; }
.success-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #04211d; font-size: 30px; font-weight: 800; }
.alert { color: var(--danger); margin: 0; }
.admin-layout { width: min(1180px, calc(100% - 32px)); margin: 22px auto; display: grid; gap: 22px; }
.admin-head, .filters, .row-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.admin-head h1 { font-size: 42px; }
.admin-head p { color: var(--muted); margin: 8px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stats-grid article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.stats-grid span { color: var(--muted); font-size: 13px; }
.stats-grid strong { display: block; font-size: 30px; margin-top: 6px; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.filters input { flex: 1 1 320px; }
.filters select { width: 190px; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
td small { color: var(--muted); }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.status.novo { color: #0f766e; }
.status.analise { color: #7c3aed; }
.status.convertido { color: #15803d; }
.status.arquivado { color: #64748b; }
.empty { text-align: center; color: var(--muted); }
.back-link { color: var(--muted); font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 310px 1fr; gap: 18px; align-items: start; }
.side-panel { padding: 16px; display: grid; gap: 14px; position: sticky; top: 18px; }
.answer-list { display: grid; gap: 10px; }
.answer-list article { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.answer-list span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.answer-list p { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.55; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .hero-copy { position: static; padding: 28px 0 0; }
    .two, .three, .check-grid.dense, .stats-grid, .detail-grid { grid-template-columns: 1fr; }
    .side-panel { position: static; }
}

@media (max-width: 640px) {
    h1 { font-size: 38px; }
    .briefing-panel { padding: 16px; }
    .check-grid, .radio-grid, .repeat-row, [data-repeat="references"] .repeat-row { grid-template-columns: 1fr; }
    .footer, .admin-head, .filters { align-items: stretch; flex-direction: column; }
    .form-actions { flex-direction: column-reverse; }
    button, .link-button { width: 100%; }
}


/* SyntaxWeb code-editor briefing skin */
:root {
    --bg: #f6f5fb;
    --surface: #ffffff;
    --surface-2: #efedf8;
    --text: #1c1b2b;
    --muted: #6c6a85;
    --border: #dedcf0;
    --primary: #6a4dff;
    --primary-2: #111227;
    --accent: #6a4dff;
    --accent-2: #b8860b;
    --shadow: 0 24px 70px rgba(32, 27, 65, .12);
}

[data-theme=dark] {
    --bg: #0d0e14;
    --surface: #14151f;
    --surface-2: #1a1b28;
    --text: #e7e6f0;
    --muted: #8b8aa3;
    --border: #2a2b3d;
    --primary: #b7a4ff;
    --primary-2: #f5c76e;
    --accent: #b7a4ff;
    --accent-2: #f5c76e;
    --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

body { background: var(--bg); }
.topbar { width: min(1240px, calc(100% - 32px)); }
.brand img { border-radius: 10px; }
.icon-button { border-radius: 999px; }
.hero {
    width: min(1240px, calc(100% - 32px));
    grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
    gap: 42px;
}
.hero-copy { padding: 92px 0 36px; }
.eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: lowercase;
    color: var(--muted);
    font-weight: 650;
}
.hero-copy h1 { max-width: 610px; }
.hero-copy h1 span { color: var(--accent); }
.hero-copy p:not(.eyebrow) { max-width: 520px; font-size: 17px; }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 12.5px;
}
.hero-meta span {
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border-radius: 999px;
    padding: 8px 11px;
}
.primary {
    border-radius: 10px;
    color: #0d0e14;
    background: var(--accent);
}
[data-theme=dark] .primary { color: #0d0e14; background: var(--accent); }
.secondary {
    border-radius: 10px;
    background: transparent;
    color: var(--text);
}
.briefing-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 720px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.step-gutter {
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, var(--bg));
    padding: 18px 12px;
    max-height: calc(100vh - 110px);
    position: sticky;
    top: 18px;
    overflow: auto;
}
.gutter-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px 16px;
    color: var(--accent);
    font-weight: 800;
    font-size: 14px;
}
.gutter-brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #fff;
    object-fit: cover;
}
.gutter-list { display: grid; gap: 2px; }
.gutter-line {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.gutter-line:not(:disabled):hover,
.gutter-line.active { background: var(--surface-2); color: var(--text); }
.gutter-line.done .line-no { color: var(--accent-2); }
.gutter-line.active .line-no { color: var(--accent); }
.gutter-line:disabled { cursor: not-allowed; opacity: .58; }
.line-no { width: 22px; flex: 0 0 22px; }
.line-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.line-check { opacity: 0; color: var(--accent-2); }
.gutter-line.done .line-check { opacity: 1; }
.briefing-panel {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 34px 32px 40px;
    background: var(--surface);
}
.progress {
    height: 4px;
    margin: 0 0 10px;
    background: var(--border);
}
.progress span { background: var(--accent); }
.step-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}
.autosave-dot { color: var(--muted); }
.progress-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    margin-bottom: 28px;
}
.step-index {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--accent);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.progress-head h2 { margin: 0 0 7px; font-size: 25px; }
.progress-head p { margin: 0; color: var(--muted); line-height: 1.45; }
.progress-head strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.step.active { gap: 20px; }
input, textarea, select {
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 88%, var(--bg));
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.check-grid, .radio-grid { display: flex; flex-wrap: wrap; }
.check-grid.dense { display: flex; flex-wrap: wrap; }
.check-grid label, .radio-grid label {
    width: auto;
    min-height: 38px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
    padding: 9px 13px;
    font-size: 13.5px;
}
.check-grid label:has(input:checked),
.radio-grid label:has(input:checked) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface-2);
}
.repeat-row {
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
    border-radius: 10px;
    padding: 12px;
}
.form-actions { margin-top: 34px; }
.success-mark { color: #0d0e14; background: var(--accent); }

@media (max-width: 980px) {
    .hero { grid-template-columns: 1fr; }
    .briefing-workspace { grid-template-columns: 1fr; }
    .step-gutter { display: none; }
    .briefing-panel { border-radius: 10px; }
}

@media (max-width: 640px) {
    .hero { width: min(100% - 22px, 1240px); margin-top: 4px; }
    .hero-copy { padding: 36px 0 12px; }
    .briefing-panel { padding: 22px 16px; }
    .progress-head { grid-template-columns: 1fr; gap: 10px; }
    .step-index { font-size: 22px; }
    .check-grid label, .radio-grid label { width: 100%; }
}

[hidden] { display: none !important; }

.hero.is-form-active { grid-template-columns: minmax(0, 1fr); }
.hero.is-form-active .hero-copy { display: none; }
.hero.is-form-active .briefing-workspace { width: min(920px, 100%); justify-self: center; }

.primary { color: #fff !important; }
[data-theme=dark] .primary { color: #fff !important; }
.form-actions [data-prev]::before { content: "←"; font-size: 14px; line-height: 1; }
.form-actions [data-next]::after { content: "→"; font-size: 14px; line-height: 1; }
.form-actions [data-submit]::after { content: "✓"; font-size: 14px; line-height: 1; }
