:root {
  color-scheme: dark;
  --bg: #08080a;
  --surface: #131316;
  --surface-2: #1b1b20;
  --line: #2a2a31;
  --ink: #f6f6f8;
  --ink-2: #b4b4bd;
  --ink-3: #85858f;
  --red: #fe2c55;
  --red-dark: #c5163a;
  --red-wash: #2a0d15;
  --good: #3ddc84;
  --warn: #ffb020;
  --series-sold: #2a9fd6;
  --series-spend: #fe2c55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
a { color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); outline: none; }
label { display: block; font-size: 13px; color: var(--ink-2); }
label input, label select { margin-top: 5px; color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--red-dark); color: #ff8ba2; }
.btn-block { width: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: #000; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.topbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-wrap select { min-width: 190px; min-height: 38px; }

.tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; background: #000; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 12px; cursor: pointer;
  color: var(--ink-2); font-weight: 600; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--red); }

.container { max-width: 1180px; margin: 0 auto; padding: 20px 24px 56px; }
.tab-panel > * + * { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-row button, .chip {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.filter-row button:hover, .chip:hover { color: var(--ink); border-color: var(--ink-3); }
.filter-row button.active { background: var(--red); border-color: var(--red); color: #fff; }
#last-sync { margin-left: auto; }

.notice { background: var(--red-wash); border: 1px solid var(--red-dark); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.notice.ok { background: var(--surface); border-color: var(--line); }

.hero {
  background: linear-gradient(135deg, #2a0810 0%, var(--surface) 60%);
  border: 1px solid var(--red-dark); border-radius: 14px; padding: 22px;
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ff8ba2; }
.hero h2 { font-size: 24px; line-height: 1.25; margin-top: 6px; }
.hero p { margin-top: 6px; color: var(--ink-2); max-width: 760px; }
.hero ol { margin: 12px 0 0; padding-left: 20px; }
.hero li + li { margin-top: 4px; }
.origin { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--ink-3); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--ink-2); }
.kpi-value { font-size: clamp(18px, 1.9vw, 23px); white-space: nowrap; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

.stage-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 8px; }
.stage-step { font-size: 12px; color: var(--ink-3); border-top: 3px solid var(--line); padding-top: 6px; }
.stage-step.done { border-color: var(--red-dark); color: var(--ink-2); }
.stage-step.current { border-color: var(--red); color: var(--ink); font-weight: 700; }

.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend-key { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 6px; }
.key-sold { background: var(--series-sold); }
.key-spend { background: var(--series-spend); }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart text { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart text.direct { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.tooltip {
  position: fixed; z-index: 30; pointer-events: none; background: #000; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 130px; box-shadow: 0 6px 22px rgba(0,0,0,.6);
}
.tooltip .tip-date { color: var(--ink-3); margin-bottom: 4px; }
.tooltip .tip-row { display: flex; align-items: center; gap: 6px; }
.tooltip strong { font-size: 13px; font-variant-numeric: tabular-nums; }

.funnel-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.funnel-row:first-of-type { border-top: 0; }
.funnel-name { font-weight: 600; font-size: 14px; }
.funnel-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.funnel-note { font-size: 12px; color: var(--ink-3); }
.status { font-size: 12px; font-weight: 600; text-align: right; }
.status.good { color: var(--good); }
.status.bad { color: #ff8ba2; }
.status.none { color: var(--ink-3); }

.action { padding: 14px 0; border-top: 1px solid var(--line); }
.action:first-of-type { border-top: 0; padding-top: 2px; }
.action-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; }
.action p { color: var(--ink-2); margin-top: 3px; }
.action ol { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tag.urgent, .tag.desligar { background: var(--red); border-color: var(--red); color: #fff; }
.tag.watch, .tag.corrigir { border-color: var(--warn); color: var(--warn); }
.tag.do, .tag.manter { border-color: var(--good); color: var(--good); }
.tag.escalar { background: var(--good); border-color: var(--good); color: #05210f; }
.tag.alias { color: var(--ink); background: var(--surface-2); }

.table-wrap { overflow-x: auto; margin: 0 -18px -18px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: right; color: var(--ink-3); font-weight: 600; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 230px; padding-left: 18px; }
.camp-name { font-weight: 600; overflow-wrap: anywhere; }
.camp-reason { display: block; color: var(--ink-2); margin-top: 4px; font-size: 12px; }
.bad-value { color: #ff8ba2; font-weight: 600; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-top: 12px; }
.form-error { color: #ff8ba2; font-size: 13px; }
.account-card { display: flex; flex-direction: column; gap: 4px; }
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.empty { text-align: center; padding: 42px 18px; }
.empty img { width: 42px; height: 42px; margin-bottom: 10px; }
.empty p { margin: 6px auto 14px; max-width: 520px; color: var(--ink-2); }

.budget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.budget { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.budget b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.budget.main { outline: 1px solid var(--red); }
.step { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; color: var(--ink); font-size: 14px; }
.step input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--red); }
.step:has(input:checked) span { color: var(--ink-3); text-decoration: line-through; }
.step-group { margin-top: 14px; }

.upload-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.upload-card form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.upload-card input[type="file"] { max-width: 260px; }
.upload-card input[type="date"] { width: 160px; }
.quick-questions { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.mentor-form { display: grid; gap: 10px; justify-items: start; }
.mentor-answer { margin-top: 14px; padding: 14px; background: var(--surface-2); border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; white-space: pre-wrap; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 0%, #3a0a16 0%, #000 55%); }
.login-card { width: 100%; max-width: 380px; background: #0d0d10; border: 1px solid var(--line); border-radius: 16px; padding: 30px 26px; text-align: center; }
.login-logo { width: 54px; height: 54px; }
.login-card h1 { font-size: 22px; margin-top: 10px; }
.login-card form { text-align: left; margin-top: 18px; display: grid; gap: 12px; }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .topbar, .tabs { padding-left: 16px; padding-right: 16px; }
  .container { padding: 16px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-controls, .select-wrap { width: 100%; }
  .topbar-controls .btn-primary { flex: 1; }
  .hero h2 { font-size: 21px; }
  #last-sync { margin-left: 0; width: 100%; }
}

.hero h2, .action-title { overflow-wrap: anywhere; }

.dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog::backdrop { background: rgba(0, 0, 0, .75); }
.dialog h2 { font-size: 19px; margin-bottom: 6px; }
.dialog-error { border-color: var(--red); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.fact { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.fact b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.alert-list { margin: 10px 0 0; padding: 0; list-style: none; }
.alert-list li { padding: 8px 10px; border-left: 3px solid var(--warn); background: var(--surface-2); border-radius: 0 6px 6px 0; margin-top: 6px; font-size: 14px; }
.single-day { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.single-day input { width: 16px; height: 16px; margin: 0; accent-color: var(--red); flex: none; }
.export-steps { margin: 12px 0 0; padding-left: 22px; }
.export-steps > li { padding: 8px 0; }
.export-steps ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.problem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.user-name { font-weight: 650; overflow-wrap: anywhere; }
.user-row .btn { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.credentials { background: var(--surface-2); border-radius: 8px; padding: 12px; margin-top: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.warn-banner { border-color: var(--warn); }
@media (max-width: 620px) { .problem { grid-template-columns: minmax(0, 1fr); } .facts { grid-template-columns: minmax(0, 1fr); } }
.link-btn { background: none; border: 0; padding: 0; color: #ff8ba2; font-weight: 600; font-size: inherit; cursor: pointer; text-decoration: underline; }
.copy-chip { background: var(--red-wash); border: 1px solid var(--red-dark); color: #ff8ba2; border-radius: 6px; padding: 2px 8px; font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.copy-chip:hover { border-color: var(--red); color: #fff; }
.mark-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
.step-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 22px 0 8px; }
.step-number { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; font-size: 13px; flex: none; }
.export-warning { border-left: 3px solid var(--warn); background: var(--surface-2); border-radius: 0 6px 6px 0; padding: 8px 10px; margin: 8px 0; font-size: 14px; }
@media (max-width: 620px) { .mark-row { grid-template-columns: minmax(0, 1fr); } }
.field-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.calc-result { margin-top: 16px; }
.calc-lines { background: var(--surface-2); border-radius: 10px; padding: 6px 14px; margin-bottom: 10px; }
.calc-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.calc-lines > div:first-child { border-top: 0; }
.calc-lines b { font-variant-numeric: tabular-nums; }
.calc-total { font-size: 18px; font-weight: 700; }
.calc-total b { color: #ff8ba2; font-size: 22px; }
.calc-formula { font-size: 17px; font-weight: 700; margin: 10px 0; }
.start-step { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.start-step:first-of-type { border-top: 0; }
.start-step.current { color: var(--ink); font-weight: 650; }
.start-text { flex: 1; min-width: 0; }
.start-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 13px; flex: none; }
.start-step.current .start-mark { background: var(--red); color: #fff; }
.good-value { color: var(--good); font-weight: 600; }
.notice-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { width: 220px; }
#period-filter { margin-bottom: 16px; }

#brief:not(:empty) { margin-bottom: 16px; }
#brief > * + * { margin-top: 16px; }
.brief { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface); }
.brief-wait { border-color: #1f7a4a; background: linear-gradient(135deg, #0c2418 0%, var(--surface) 60%); }
.brief-wait .eyebrow { color: var(--good); }
.brief-grow { border-color: var(--good); background: linear-gradient(135deg, #0c2418 0%, var(--surface) 60%); }
.brief-grow .eyebrow { color: var(--good); }
.brief-attention { border-color: var(--warn); background: linear-gradient(135deg, #2a1f08 0%, var(--surface) 60%); }
.brief-attention .eyebrow { color: var(--warn); }
.brief-urgent { border-color: var(--red); background: linear-gradient(135deg, #2a0810 0%, var(--surface) 60%); }
.brief h2 { font-size: 26px; line-height: 1.2; margin-top: 6px; overflow-wrap: anywhere; }
.brief-summary { margin-top: 10px; font-size: 16px; max-width: 860px; }
.brief-early { margin-top: 6px; color: var(--ink-2); }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.brief-col { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.brief-col h3 { margin-bottom: 6px; }
.brief-col .step:first-of-type { border-top: 0; }
.brief-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.brief-list li + li { margin-top: 8px; }
.brief-notes { margin-top: 14px; }
.brief-note { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.brief-note summary { cursor: pointer; font-weight: 600; color: var(--warn); }
.brief-note p, .brief-note ol { color: var(--ink-2); margin: 6px 0 0; }
.brief-note ol { padding-left: 20px; }
.fold summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.fold-title { font-weight: 650; font-size: 16px; }
.fold[open] summary { margin-bottom: 12px; }
.filter-label { color: var(--ink-3); font-size: 13px; margin-right: 4px; }
@media (max-width: 620px) { .brief { padding: 16px; } .brief h2 { font-size: 22px; } .filter-label { width: 100%; } }
.guide-switch { margin-bottom: 16px; }
.pre-campaign { border-top: 1px solid var(--line); padding: 12px 0; }
.pre-campaign[open] summary { margin-bottom: 4px; }
.decision-chip { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; padding: 8px 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.decision-chip > span:first-child { font-weight: 700; }
.gate-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.gate-icon { font-weight: 700; color: var(--ink-3); text-align: center; }
.gate-ok .gate-icon { color: var(--good); }
.gate-bad .gate-icon { color: #ff8ba2; }
.pre-campaign .step-group:first-of-type { margin-top: 8px; }
@media (max-width: 620px) { .gate-row { grid-template-columns: 24px minmax(0, 1fr); } .gate-row > :last-child { grid-column: 2; } }

.upload-flat form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.upload-flat input[type="file"] { max-width: 300px; }
.upload-flat input[type="date"] { width: 160px; }
.account-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-section + .form-row { margin-top: 8px; }
.matrix-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 6px 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.matrix-symptom { font-weight: 600; font-size: 14px; }
.matrix-result .tag { margin-bottom: 4px; white-space: normal; }

@media (max-width: 620px) {
  /* Topo: rola com a página; só as abas ficam fixas. */
  .topbar { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 16px; }
  .topbar-controls { display: contents; }
  .select-wrap { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .select-wrap select { min-width: 0; width: 100%; }
  #logout { grid-column: 2; grid-row: 1; min-height: 36px; padding: 6px 12px; }
  #open-tiktok { grid-column: 1 / -1; grid-row: 3; width: 100%; }
  .brand { min-width: 0; font-size: 15px; }
  .tabs { position: sticky; top: 0; z-index: 10; gap: 0; padding: 0 8px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { min-height: 46px; padding: 12px 10px; font-size: 14px; }

  /* Evita o zoom automático do iPhone ao tocar em um campo. */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  input[type="checkbox"] { min-height: 0; }
  .btn { min-height: 44px; }
  .card { padding: 16px; }
  .btn-row .btn, .card > .btn, .form-row .btn, .upload-flat .btn { width: 100%; }
  .btn-row { flex-direction: column; }
  .user-row .btn-row { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .user-row .btn-row .btn { width: auto; flex: 1; }

  .filter-row button { flex: 1; min-height: 40px; }
  .chip { min-height: 38px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 19px; }
  .kpi-label, .kpi-note { font-size: 12px; overflow-wrap: anywhere; }

  .brief h2 { font-size: 21px; }
  .brief-summary { font-size: 15px; }
  .brief-col { padding: 12px; }
  .decision-chip { flex-direction: column; align-items: flex-start; }

  .fold summary { align-items: flex-start; flex-direction: column; gap: 2px; }
  .upload-flat form { flex-direction: column; align-items: stretch; }
  .upload-flat input[type="file"], .upload-flat input[type="date"] { width: 100%; max-width: none; }
  .upload-flat label { width: 100%; }
  .single-day { width: 100%; }

  .form-row { grid-template-columns: minmax(0, 1fr); }
  .time-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .time-form label:first-child, .time-form .btn { grid-column: 1 / -1; }
  .inline-form { width: 100%; }
  .inline-form input { flex: 1; width: auto; min-width: 0; }
  .inline-form .btn { flex: none; width: auto; }

  /* Tabelas viram cartões, sem arrastar para o lado. */
  .table-wrap { overflow: visible; margin: 0; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { background: var(--surface-2); border-radius: 10px; padding: 12px; margin-top: 10px; }
  td, th:first-child, td:first-child { padding: 0; border: 0; text-align: right; white-space: normal; min-width: 0; }
  td { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; font-size: 14px; }
  td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; font-weight: 500; text-align: left; flex: none; }
  td:first-child { display: block; text-align: left; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
  td:first-child::before { content: none; }
  td[data-label="Pedidos na loja"], td[data-label="Dias"] { font-size: 14px; }
  td:empty { display: none; }

  .matrix-row, .problem { grid-template-columns: minmax(0, 1fr); }
  .mark-row { padding: 11px 0; }
  .step { padding: 11px 0; }
  .step input { width: 22px; height: 22px; }
  .dialog { padding: 18px; }
  .dialog .btn-row .btn { width: 100%; }
  .login-card { padding: 26px 20px; }
}
