/* Painel Wheel B3 — tema claro e componentes. */
:root {
  color-scheme: light;
  --bg: #F3F6F3; --surface: #FFFFFF; --ink: #1B2B24; --muted: #63736A; --line: #D9E2DC;
  --brand: #153D32; --brand2: #24755E; --brand-soft: #E8F1EB; --on-brand: #FFFFFF;
  --good: #16734D; --good-bg: #E5F3EB; --warn: #8A5B0B; --warn-bg: #FBF2DE;
  --bad: #A53F3F; --bad-bg: #F8E9E7;
  --seg-stock: #D0A24B; --seg-put: #48A18A; --seg-free: #E5ECE7;
  --cdi: #87958D; --field: #F8FAF8; --shadow: rgba(27, 43, 36, .07);
  --mod-swing: #2F6FB0; --mod-day: #B4632A; --mod-opt: #7A4FA8;
  --line-strong: #AABCB1; --row-hover: #F8FBF8; --btn-hover: #153D32; --logo-accent: #76D1A9; --logo-bg: #153D32;
  --hdr-bg: linear-gradient(100deg, #FFFFFF 0%, #FFFFFF 45%, #EEF5F0 100%);
}

/* Tema escuro (Ajustes → Aparência). Mesma identidade verde, superfícies escuras e contraste AA. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1714; --surface: #16211D; --ink: #E4ECE7; --muted: #9DAEA5; --line: #2A3933;
  --brand: #8FD4B6; --brand2: #2E9C7C; --brand-soft: #1B2E27; --on-brand: #FFFFFF;
  --good: #5CC99A; --good-bg: #16302A; --warn: #E7B661; --warn-bg: #352A14;
  --bad: #F08F86; --bad-bg: #3A201D;
  --seg-stock: #C9A055; --seg-put: #3E9C84; --seg-free: #26342E;
  --cdi: #7F8E86; --field: #1B2722; --shadow: rgba(0, 0, 0, .35);
  --mod-swing: #4F8FD6; --mod-day: #C9773D; --mod-opt: #9672C9;
  --line-strong: #3E5148; --row-hover: #1C2924; --btn-hover: #24806A; --logo-accent: #8FE0BC; --logo-bg: #1F5A48;
  --hdr-bg: linear-gradient(100deg, #16211D 0%, #16211D 45%, #18302A 100%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums;
}
a { color: var(--brand2); }

/* ---------- Estrutura ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px 22px 56px; }
h2 { color: var(--brand); font-size: 19px; margin: 24px 0 10px; font-weight: 700; }
h2:first-child { margin-top: 0; }
.lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 17px; margin: 0 0 14px; box-shadow: 0 2px 8px var(--shadow); }
.card > b:first-child, .card-title { display: block; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.cols > * { min-width: 0; }
@media (min-width: 900px) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cols:has(> :nth-child(2):empty) { grid-template-columns: minmax(0, 1fr); }

.hero { background: linear-gradient(110deg, var(--brand-soft), var(--field)); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--brand2); border-radius: 8px; padding: 20px; margin: 0 0 14px; box-shadow: 0 2px 8px var(--shadow); }
.hero .lbl { color: var(--muted); font-size: 13px; }
.hero .big { color: var(--brand); font-size: 32px; font-weight: 700; line-height: 1.2; }
.hero .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }

.badge { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; display: inline-block; }
.badge.ok, .badge.green { background: var(--good-bg); color: var(--good); }
.badge.warn, .badge.yellow { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .badge.red { background: var(--bad-bg); color: var(--bad); }
.badge.info, .badge.neutral { background: var(--field); color: var(--muted); border: 1px solid var(--line); }
.badge.positive { background: var(--good-bg); color: var(--good); }
.badge.negative { background: var(--bad-bg); color: var(--bad); }

.therm { position: relative; margin: 18px 0 8px; height: 26px; border-radius: 6px; overflow: hidden; display: flex; background: var(--seg-free); }
.therm i { display: block; height: 100%; transition: width .4s; }
.therm .s { background: var(--seg-stock); }
.therm .p { background: var(--seg-put); }
.mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--brand); opacity: .95; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; opacity: .95; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.alerts { display: grid; gap: 8px; margin: 0 0 12px; }
.al { border-radius: 8px; padding: 11px 13px; font-size: 14px; border: 1px solid transparent; }
.al.bad { background: var(--bad-bg); color: var(--bad); }
.al.warn { background: var(--warn-bg); color: var(--warn); }
.al.info { background: var(--surface); border-color: var(--line); color: var(--muted); }
.al.ok { background: var(--good-bg); color: var(--good); }

.kgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 700px) { .kgrid { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; box-shadow: 0 1px 4px var(--shadow); }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { color: var(--brand); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.tile .h { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); } .muted { color: var(--muted); }
.note, .hint { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.err { font-size: 13px; color: var(--bad); margin: 6px 0 0; }
.msg { font-size: 13px; color: var(--good); margin: 6px 0 0; }

svg.chart { width: 100%; height: auto; display: block; }
.chart .ax { fill: var(--muted); font-size: 9px; }
.chart.bars .ax { font-size: 11.5px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .l-strat { fill: none; stroke: var(--brand2); stroke-width: 2.2; stroke-linejoin: round; }
.chart .l-cdi { fill: none; stroke: var(--cdi); stroke-width: 1.6; stroke-dasharray: 4 3; }
.lg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; margin-top: 8px; }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------- Formulários ---------- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .grid2.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
label { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
input, select, textarea {
  width: 100%; margin-top: 5px; font: inherit; font-size: 15px; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0 9px 0 0; accent-color: var(--brand2); vertical-align: middle; flex: none; }
.chk { display: flex; align-items: center; font-size: 14px; color: var(--ink); padding: 7px 0; cursor: pointer; }
textarea { min-height: 110px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand2); outline-offset: 2px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 14px; border: 1px solid transparent; border-radius: 8px; padding: 10px 15px;
  min-height: 42px; background: var(--brand2); color: #fff; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: var(--btn-hover); box-shadow: 0 2px 6px var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.sec { background: var(--surface); color: var(--brand); border: 1px solid var(--line); }
.btn.sec:hover { background: var(--brand-soft); border-color: var(--line-strong); }
.btn.dng { background: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
details.card > summary { font-weight: 700; cursor: pointer; }
details.card[open] > summary { margin-bottom: 10px; }
.form-section-title { color: var(--brand); font-size: 13px; margin: 14px 0 2px; }
.advanced-params { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.advanced-params > summary { color: var(--brand2); font-size: 13px; font-weight: 600; cursor: pointer; }
.advanced-params[open] > summary { margin-bottom: 6px; }
.page-help { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 18px 0 0; box-shadow: 0 2px 8px var(--shadow); }
.page-help > summary { color: var(--brand); font-weight: 700; cursor: pointer; }
.page-help[open] > summary { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.page-help-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; padding-top: 10px; }
.page-help-content h3 { color: var(--brand2); font-size: 13px; margin: 0 0 3px; }
.page-help-content p { color: var(--muted); font-size: 12.5px; margin: 0; }
@media (max-width: 620px) { .page-help-content { grid-template-columns: 1fr; } }

/* ---------- Listas ---------- */
.op { border-top: 1px solid var(--line); padding: 12px 0; }
.op:first-child { border-top: 0; padding-top: 0; }
.op .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.op .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.op .btns { margin-top: 8px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--field); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.inl { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; }

.table-wrap { overflow-x: auto; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { background: var(--field); color: var(--muted); font-weight: 600; font-size: 12px; }
tbody tr:hover { background: var(--row-hover); }
td.l, th.l { text-align: left; white-space: normal; }

/* ---------- Semáforo ---------- */
.sig-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .sig-grid { grid-template-columns: 1fr 1fr; } }
.sig { border-left: 4px solid var(--line); }
.sig.green { border-left-color: var(--good); }
.sig.yellow { border-left-color: var(--warn); }
.sig.red { border-left-color: var(--bad); }
.sig .vals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; font-size: 12.5px; margin: 8px 0; }
.sig .vals b { display: block; font-size: 14px; color: var(--ink); }
.sig .vals span { color: var(--muted); }
ul.ck { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13px; }
ul.ck li { padding: 2px 0; }
.sugg { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; margin-top: 6px; }

.verd { border-radius: 8px; padding: 15px; margin: 0 0 14px; }
.verd.ok { background: var(--good-bg); color: var(--good); }
.verd.warn { background: var(--warn-bg); color: var(--warn); }
.verd.bad { background: var(--bad-bg); color: var(--bad); }

.news { border-top: 1px solid var(--line); padding: 10px 0; }
.news:first-child { border-top: 0; padding-top: 0; }
.news .t { font-weight: 600; }
.news .m { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.news select { width: auto; min-height: 30px; padding: 3px 6px; font-size: 12.5px; margin: 0; }

.routine li { display: flex; align-items: center; gap: 8px; }
.progress { height: 8px; border-radius: 99px; background: var(--field); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 10px; }
.progress i { display: block; height: 100%; background: var(--good); }

.loading { color: var(--muted); font-size: 14px; padding: 20px 0; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: 8px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px);
  box-shadow: 0 6px 24px rgba(20, 42, 31, .18);
}
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 620px) {
  main { padding: 18px 12px 44px; }
  .card { padding: 14px; }
  .hero { padding: 16px; }
  .hero .big { font-size: 29px; }
  .kgrid { gap: 7px; }
  .tile { padding: 10px; }
  .tile .v { font-size: 18px; }
  .sig .vals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
  .grid2, .grid2.wide { grid-template-columns: minmax(0, 1fr); }
  .page-help { padding: 12px; }
}

/* ---------- Modalidades (Swing, Day Trade, Opções) ---------- */
.mod-tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px; color: #fff; margin-bottom: 6px; }
.mod-tag.swing { background: var(--mod-swing); }
.mod-tag.day { background: var(--mod-day); }
.mod-tag.opt { background: var(--mod-opt); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 0 0 14px; }
.toolbar > label { min-width: 170px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 9px 14px; cursor: pointer; min-height: 42px; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; font-size: 12.5px; margin: 8px 0; }
.levels span { color: var(--muted); display: block; }
.levels b { color: var(--ink); font-size: 14px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--field); color: var(--ink); }
.pill.sup { border-color: var(--good); background: var(--good-bg); }
.pill.res { border-color: var(--bad); background: var(--bad-bg); }
tr.clickable { cursor: pointer; }
tr.selected td { background: var(--brand-soft); }
.calc-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .calc-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.big-number { font-size: 26px; font-weight: 700; color: var(--brand); }
.report-text { white-space: pre-wrap; font-family: inherit; font-size: 13.5px; margin: 0; line-height: 1.55; }
@media (max-width: 620px) {
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar > label { min-width: 0; flex: 1 1 140px; }
}

/* ---------- Operações: áreas separadas por modalidade ---------- */
.ops-tabs { margin: 0 0 14px; }
.ops-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.opt { background: var(--mod-opt); } .dot.swing { background: var(--mod-swing); } .dot.day { background: var(--mod-day); }
.ops-area { border-top: 3px solid var(--line); padding-top: 12px; }
.ops-area.opt { border-top-color: var(--mod-opt); } .ops-area.swing { border-top-color: var(--mod-swing); }
.ops-area h2 { margin-top: 18px; }
.op.opt { border-left: 4px solid var(--mod-opt); padding-left: 10px; }
.op.swing { border-left: 4px solid var(--mod-swing); padding-left: 10px; }
.ops-area .op:first-child { padding-top: 12px; }
.ops-area .kgrid + details.card { margin-top: 12px; }

/* ---------- Paginação e agenda do Painel ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--muted); margin: 0; }
.pager .btn[disabled] { opacity: .45; cursor: default; }
.ag-group { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.ag-group:first-child { margin-top: 0; }
.ag-group.today { color: var(--bad); }
.ag-group.tomorrow { color: var(--warn); }
.ag-ev { padding: 9px 0; }
.ag-ev.strong { border-left: 4px solid var(--bad); padding-left: 10px; }
.ag-time { font-variant-numeric: tabular-nums; color: var(--brand); }
.ag-title { min-width: 0; overflow-wrap: anywhere; }
.al-action { display: flex; flex-direction: column; gap: 8px; }
.al-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-quote { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; }
.quick-quote input { width: 92px; min-height: 36px; }

/* ---------- Telas estreitas: seletores em linha quebram em vez de vazar ---------- */
@media (max-width: 620px) {
  .segmented { display: flex; flex-wrap: wrap; max-width: 100%; }
  .segmented button { flex: 1 1 auto; padding-inline: 10px; }
  .segmented button + button { border-left: 1px solid var(--line); }
  .pager { justify-content: center; }
  .pager .pager-info { order: -1; width: 100%; text-align: center; }
  .quick-quote { width: 100%; }
  .quick-quote input { flex: 1 1 80px; }
}

/* ---------- Painel: agenda compacta ---------- */
.agenda-card { padding: 0; }
.agenda-card > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.agenda-card > summary .card-title { margin: 0; }
.agenda-card[open] > summary { border-bottom: 1px solid var(--line); }
.agenda-card .ag-scroll { max-height: 300px; overflow-y: auto; padding: 4px 14px 8px; overscroll-behavior: contain; }
.agenda-card .pager { margin: 0; padding: 8px 14px 12px; border-top: 1px solid var(--line); }
.ag-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.ag-group + .ag-row { border-top: 0; }
.ag-row.strong { box-shadow: inset 3px 0 0 var(--bad); padding-left: 8px; }
.ag-row .ag-time { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); padding-top: 1px; }
.ag-main { display: flex; flex-direction: column; min-width: 0; }
.ag-row .ag-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-row .ag-meta { font-size: 11.5px; color: var(--muted); }
.ag-row .badge { font-size: 11px; padding: 2px 7px; }
.cols-top { align-items: start; margin-top: 18px; }
.al-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Ordens planejadas: sugestão automática ---------- */
.rm-sugg { background: var(--brand-soft); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin: 8px 0; font-size: 13.5px; }
.rm-sugg.warn { background: var(--warn-bg); color: var(--warn); }
.rm-sugg span { color: var(--muted); font-size: 12.5px; }
input[readonly], select:disabled { background: var(--field); color: var(--muted); cursor: default; border-style: dashed; }

/* ---------- Preço-Justo: tabela inteira na tela, sem rolagem lateral ---------- */
.pj-sort { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.pj-sort label { min-width: 180px; }
.pj-table { width: 100%; table-layout: auto; border-collapse: collapse; }
.pj-table th, .pj-table td { padding: 6px 4px; font-size: 12px; white-space: nowrap; }
.pj-table th { white-space: normal; line-height: 1.15; vertical-align: bottom; cursor: pointer; user-select: none; }
.pj-table td .badge { font-size: 11.5px; padding: 2px 5px; white-space: normal; display: inline-block; line-height: 1.15; }
@media (max-width: 1239px) {
  .pj-table, .pj-table tbody { display: block; }
  .pj-table thead { display: none; }
  .pj-table tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 2px 8px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--surface); padding: 8px 10px; margin-bottom: 8px; }
  .pj-table td { display: block; text-align: left; border: 0; padding: 2px 0; font-size: 13px; white-space: normal; }
  .pj-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .pj-table td:first-child { grid-column: 1 / -1; font-size: 15px; padding-bottom: 4px; }
  .pj-table td:first-child::before { display: none; }
  .pj-table tr.empty { display: block; }
  .pj-table tr.empty td::before { display: none; }
}
@media (min-width: 1240px) { .pj-sort { display: none; } }

/* ---------- Cotações do mercado (tabela comprimida em colunas) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.qb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 6px; }
.qb-head .qb-search { flex: 1 1 160px; min-width: 140px; margin: 0; }
.qb-head .qb-sort { flex: 0 1 170px; margin: 0; }
.qb-head input, .qb-head select { min-height: 36px; }
.qb { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); column-gap: 22px; align-content: start; font-size: 12.5px;
  max-height: 360px; overflow-x: hidden; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; background: var(--surface); }
.qb-row { display: grid; grid-template-columns: 64px 1fr 58px; align-items: baseline; gap: 6px; padding: 3px 0; border-bottom: 1px dotted var(--line);
  font-variant-numeric: tabular-nums; }
.qb-row b { font-size: 12.5px; }
.qb-row .px { text-align: right; }
.qb-row .chg { text-align: right; font-size: 11.5px; font-weight: 600; }
.qb-row.mine b::after { content: " ●"; color: var(--brand2); font-size: 9px; }

/* ---------- Tabelas que viram cartões em telas estreitas (Radar: variáveis externas) ---------- */
.stack-table { width: 100%; border-collapse: collapse; }
.stack-table th, .stack-table td { padding: 8px 8px; font-size: 13px; vertical-align: top; white-space: nowrap; }
.stack-table td.sum { white-space: normal; min-width: 220px; line-height: 1.4; max-width: 420px; }
.stack-table tr.market td { background: var(--brand-soft); }
.stack-table .muted.small { font-size: 11.5px; white-space: normal; }
.sbar { position: relative; display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--field); border: 1px solid var(--line);
  vertical-align: middle; margin-right: 8px; overflow: hidden; }
.sbar .mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .6; }
.sbar .fill { position: absolute; top: 0; bottom: 0; }
.sbar .fill.pos { background: var(--good); } .sbar .fill.neg { background: var(--bad); }
.stack-table td.sc { white-space: nowrap; }
@media (max-width: 899px) {
  .stack-table, .stack-table tbody { display: block; }
  .stack-table thead { display: none; }
  .stack-table tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 12px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--surface); padding: 10px 12px; margin-bottom: 8px; }
  .stack-table td { display: block; text-align: left; border: 0; padding: 2px 0; white-space: normal; }
  .stack-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .stack-table td.sum { grid-column: 1 / -1; max-width: none; min-width: 0; }
  .stack-table td:first-child { grid-column: 1 / -1; font-size: 15px; }
  .stack-table td:first-child::before { display: none; }
  .stack-table tr.market { background: var(--brand-soft); }
}

/* ---------- Radar: coluna Resumo com leitura fluida ---------- */
.stack-table td.sum { min-width: 300px; max-width: 480px; font-size: 13.5px; line-height: 1.55; text-wrap: pretty; hyphens: auto; }
.sum-body p { margin: 0 0 5px; overflow-wrap: anywhere; }
.sum-body p.lead { font-weight: 600; color: var(--ink); }
.sum-body p:not(.lead):not(.s-note) { color: var(--ink); opacity: .86; padding-left: 10px; border-left: 2px solid var(--line); }
.sum-body .s-note { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 6px; line-height: 1.4; }
.sum-body.clamp { max-height: 6.3em; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.linkbtn { background: none; border: 0; padding: 2px 0; margin-top: 2px; color: var(--brand); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline; }
@media (max-width: 899px) { .stack-table td.sum { min-width: 0; max-width: none; } }

/* ---------- Operações: "Em aberto" (real) x "Planejadas" (lembrete) ---------- */
section.sec { margin-top: 22px; }
.sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.sec-head h2 { margin: 0; }
.sec-sub { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.sec-tag { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.sec-tag.live { background: var(--ink); color: var(--surface); }
.sec-tag.plan { background: transparent; color: var(--ink); border: 1.5px dashed var(--muted); }
.card.live { border-left: 4px solid var(--ink); }
.card.planned { border: 1.5px dashed var(--muted); background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 14px, var(--field) 14px, var(--field) 15px); }
.card.planned > summary { font-weight: 700; }
section.sec.planned { padding-top: 14px; border-top: 1px dashed var(--line); }
.plan-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-bottom: 10px; }
.plan-filters label { margin: 0; min-width: 120px; flex: 0 1 150px; }
.plan-filters label:has(select[name=sort]) { flex-basis: 200px; }
.plan-filters label.grow { flex: 1 1 220px; }
.plan-filters input, .plan-filters select { min-height: 36px; background: var(--surface); }
.plan-count { margin: 2px 0 6px; }
.plan-table td.note { white-space: normal; min-width: 130px; max-width: 220px; font-size: 12.5px; }
.plan-table td.acts { white-space: normal; }
.plan-table td.acts .btn { margin: 0 4px 4px 0; }
.plan-table th, .plan-table td { padding: 7px 6px; font-size: 12.5px; }
.plan-table tr.overdue td { background: var(--bad-bg); }
.plan-table tr.done td { opacity: .6; }
.plan-table tr.empty td { background: transparent; }
@media (max-width: 899px) { .plan-table tr.empty { display: block; } .plan-table tr.empty td::before { display: none; } .plan-table td.note { max-width: none; } }

/* ---------- Resumo das operações ---------- */
.sum-table { width: 100%; border-collapse: collapse; }
.sum-table th, .sum-table td { padding: 7px 8px; font-size: 13px; white-space: nowrap; }
.sum-table td .muted.small { white-space: normal; font-size: 11.5px; }
.sum-table tr.overdue td { background: var(--bad-bg); }
.sec-head .btn { margin-left: auto; }
@media (max-width: 899px) { .sum-table td { white-space: normal; } }

/* ======================================================================
   Cabeçalho e menu principal
   ====================================================================== */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand2); color: #fff; padding: 10px 14px;
  border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--brand2); outline-offset: 2px; }
main:focus { outline: none; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.site-header { background: var(--hdr-bg); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hdr { max-width: 1240px; margin: 0 auto; padding: 14px 22px; display: flex; align-items: center; gap: 18px; position: relative; min-height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; position: relative; z-index: 1; }
.logo-mark { width: 42px; height: 42px; flex: none; filter: drop-shadow(0 2px 6px var(--shadow)); }
.logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.logo-text b { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--brand); white-space: nowrap; }
.logo-text b em { font-style: normal; color: var(--brand2); }
/* Selo "Beta" ao lado do nome: discreto, na cor da marca, para indicar versão em evolução */
.beta-tag { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 7px; border: 1px solid var(--brand2);
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand2);
  line-height: 1.5; position: relative; top: -2px; }
.logo-text small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hdr-market { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; order: 3; }
.hdr-actions { order: 4; }
.mkt-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; }
.mkt-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.mkt-status.open { color: var(--good); border-color: var(--good); }
.mkt-status.open i { background: var(--good); animation: pulse 2s infinite; }
.mkt-status.pre { color: var(--warn); border-color: var(--warn); }
.mkt-status.pre i { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(92, 201, 154, .55); } 70% { box-shadow: 0 0 0 7px rgba(92, 201, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(92, 201, 154, 0); } }
@media (prefers-reduced-motion: reduce) { .mkt-status.open i { animation: none; } }
.mkt-quote { display: inline-flex; flex-direction: column; padding: 4px 11px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  line-height: 1.15; min-width: 92px; }
.mkt-quote small { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.mkt-quote b { font-size: 14px; color: var(--ink); white-space: nowrap; }
.mkt-quote em { font-style: normal; font-size: 11.5px; font-weight: 700; }
.mkt-quote em.up { color: var(--good); }
.mkt-quote em.down { color: var(--bad); }

.hdr-illus { flex: 0 1 300px; min-width: 160px; height: 62px; margin-left: auto; opacity: .9; pointer-events: none; }
.hdr-illus + .hdr-actions { margin-left: 0; }
.hdr-actions { display: flex; align-items: center; gap: 6px; position: relative; z-index: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--brand); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--brand-soft); }
#theme_toggle .i-sun { display: none; }
:root[data-theme="dark"] #theme_toggle .i-sun { display: block; }
:root[data-theme="dark"] #theme_toggle .i-moon { display: none; }
.menu-btn { display: none; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--brand2);
  background: var(--brand2); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.menu-btn .menu-current { display: none; }

/* --- barra horizontal (computador) --- */
.mainnav { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px var(--shadow); }
.mainnav-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: stretch; }
.drawer-head { display: none; }
.nav-group { display: flex; align-items: stretch; }
.nav-group + .nav-group { border-left: 1px solid var(--line); margin-left: 6px; padding-left: 6px; }
.nav-group:last-child { margin-left: auto; border-left: 0; }
.nav-group-label { display: none; }
.nav-group ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 7px; height: 52px; padding: 0 11px; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; transition: color .15s, background .15s, border-color .15s; }
.nav-link .ico { width: 18px; height: 18px; }
.nav-link:hover { color: var(--brand); background: var(--field); }
.nav-link[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand2); background: var(--brand-soft); }
.nav-link.mod .ico { stroke-width: 2.2; }
.nav-link.swing .ico { color: var(--mod-swing); }
.nav-link.day .ico { color: var(--mod-day); }
.nav-link.opt .ico { color: var(--mod-opt); }
@media (max-width: 1239px) and (min-width: 1100px) {
  .nav-link { padding: 0 8px; font-size: 13.5px; gap: 5px; }
  .nav-link .ico { width: 16px; height: 16px; }
}

/* --- tablet e celular: cabeçalho fixo + menu lateral --- */
@media (max-width: 1099px) {
  .site-header { position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 12px var(--shadow); }
  .hdr { padding: 10px 16px; min-height: 64px; gap: 12px; }
  .hdr-illus { flex-basis: 200px; height: 52px; }
  .menu-btn { display: inline-flex; }
  .mainnav { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); z-index: 60; border: 0; border-left: 1px solid var(--line);
    box-shadow: -12px 0 40px rgba(0, 0, 0, .25); transform: translateX(105%); transition: transform .22s ease, visibility .22s; overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom); visibility: hidden; }
  .mainnav.open { transform: none; visibility: visible; }
  .mainnav-inner { display: block; padding: 0 0 24px; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: var(--surface); z-index: 1; }
  .drawer-head b { font-size: 16px; color: var(--brand); }
  .nav-group { display: block; padding: 10px 10px 0; }
  .nav-group + .nav-group { border-left: 0; margin-left: 0; padding-left: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
  .nav-group:last-child { margin-left: 0; }
  .nav-group-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; }
  .nav-group ul { flex-direction: column; gap: 2px; }
  .nav-link { height: 48px; border-bottom: 0; border-left: 3px solid transparent; border-radius: 8px; padding: 0 12px; font-size: 15px; }
  .nav-link .ico { width: 20px; height: 20px; }
  .nav-link[aria-current="page"] { border-left-color: var(--brand2); }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(8, 16, 12, .45); z-index: 55; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) { .mainnav { transition: none; } }
@media (max-width: 860px) {
  .hdr-market .mkt-quote { display: none; }
  .hdr-illus { display: none; }
  .hdr-market { margin-left: auto; }
}
@media (max-width: 620px) {
  .hdr { padding: 8px 12px; min-height: 58px; gap: 8px; }
  .logo-mark { width: 36px; height: 36px; }
  .logo-text b { font-size: 16.5px; }
  .logo-text small { display: none; }
  .hdr-market { display: none; }
  .hide-sm { display: none; }
  .icon-btn { width: 40px; height: 40px; }
  .menu-btn { height: 40px; padding: 0 12px; }
  .menu-btn .menu-label { display: none; }
  .menu-btn .menu-current { display: inline; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Celular estreito: o nome da tela não cabe ao lado do logo; o botão volta a dizer "Menu". */
@media (max-width: 430px) {
  .menu-btn .menu-current { display: none; }
  .menu-btn .menu-label { display: inline; }
}

/* --- Ajustes: escolha de tema --- */
.theme-pick { border: 0; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.theme-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--surface); color: var(--ink); }
.theme-opt:has(input:checked) { border-color: var(--brand2); box-shadow: 0 0 0 2px var(--brand-soft); }
.theme-opt input { accent-color: var(--brand2); width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
.theme-opt span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.theme-opt small { color: var(--muted); font-size: 12px; }
.theme-swatch { width: 38px; height: 28px; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.theme-swatch.light { background: linear-gradient(135deg, #FFFFFF 50%, #E8F1EB 50%); }
.theme-swatch.dark { background: linear-gradient(135deg, #16211D 50%, #1B2E27 50%); }
.theme-swatch.auto { background: linear-gradient(135deg, #FFFFFF 50%, #16211D 50%); }

/* --- submenu "Ferramentas" e grupos (computador) --- */
.nav-more { display: flex; align-items: center; gap: 7px; height: 52px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.nav-more .ico { width: 18px; height: 18px; }
.nav-more .caret { width: 14px; height: 14px; transition: transform .15s; }
.nav-more[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-more:hover { color: var(--brand); background: var(--field); }
.nav-more.current { color: var(--brand); border-bottom-color: var(--brand2); background: var(--brand-soft); }
.has-menu { position: relative; }
@media (min-width: 1100px) {
  /* Sistema: Ajustes e Administração ficam nos ícones do cabeçalho; "Convidar amigos" fica à vista na barra */
  .g-sys .nav-group-label, .g-sys li:not(:has(> [data-tab="convites"])) { display: none; }
  .g-tools { margin-left: auto; border-left: 0 !important; }
  .has-menu > ul { display: none; position: absolute; right: 0; top: 100%; min-width: 230px; flex-direction: column; gap: 2px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px var(--shadow), 0 2px 6px var(--shadow); z-index: 35; }
  .has-menu > ul.show { display: flex; }
  .has-menu > ul .nav-link { height: 42px; border-bottom: 0; border-left: 3px solid transparent; border-radius: 6px; }
  .has-menu > ul .nav-link[aria-current="page"] { border-left-color: var(--brand2); }
}
@media (max-width: 1099px) { .nav-more { display: none; } .has-menu > ul { display: flex; } }
.mainnav-inner { overflow: visible; }
.agenda-card > .pager-info { padding: 8px 14px 12px; margin: 0; }

/* Cabeçalho: cotações numa linha; ilustração só onde há espaço */
.hdr-market { flex-wrap: nowrap; }
.logo { flex: 0 1 auto; }
@media (max-width: 1279px) { .hdr-illus { display: none; } .hdr-market { margin-left: auto; } }
@media (max-width: 400px) { .logo-text b { font-size: 15px; } .logo { gap: 8px; } }
@media (max-width: 359px) { .logo-text { display: none; } }

/* --- gráficos do Resumo --- */
.chart .l-proj { fill: none; stroke-width: 2; stroke-dasharray: 6 4; stroke-linejoin: round; }
.sw.dash { background: none; border-top: 3px dashed currentColor; height: 0; }
.chart .bar-real { fill: var(--brand2); }
.chart .bar-proj { fill: color-mix(in srgb, var(--mod-opt) 35%, transparent); stroke: var(--mod-opt); stroke-width: 1.5; stroke-dasharray: 4 2; }
.chart .bar-real.neg, .chart .bar-proj.neg { fill: var(--bad); stroke: var(--bad); }
.stackbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--field); border: 1px solid var(--line); }
.stackbar span { display: block; min-width: 0; }
.chart-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.chart .l-evo { fill: none; stroke: var(--brand2); stroke-width: 2.6; stroke-linejoin: round; }
.chart .evo-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.evo-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 6px 0 10px; }
.evo-filters > div, .evo-filters > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.evo-filters select { width: auto; min-width: 150px; }
.evo-filters .segmented button { padding: 6px 10px; font-size: 12.5px; }
@media (max-width: 620px) { .evo-filters .segmented { display: flex; } .evo-filters .segmented button { flex: 1; } }

/* aviso: ordens vão no home broker do usuário; o Painel só simula */
.broker-note { margin: 0 0 14px; border-left: 4px solid var(--brand2); color: var(--ink); }

/* gregas da estrutura */
.greeks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.greek { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--field); min-width: 0; }
.greek-k { font-size: 12px; font-weight: 600; color: var(--muted); }
.greek-k span { font-weight: 400; }
.greek-v { font-size: 19px; font-weight: 700; color: var(--ink); margin: 2px 0 4px; overflow-wrap: anywhere; }
.greek-v.good { color: var(--good); } .greek-v.bad { color: var(--bad); }
.greek-h { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
@media (max-width: 899px) { .greeks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .greeks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Aprenda --- */
.learn-tabs { margin: 18px 0 4px; }
.learn-player video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 6px; }
.learn-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.learn-controls label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.learn-controls select { width: auto; min-width: 90px; }
.learn-file b { display: block; margin-top: 6px; color: var(--brand); }
.learn-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.learn-search { flex: 1 1 240px; max-width: 420px; }
@media (max-width: 620px) { .learn-search { max-width: none; } .learn-controls { gap: 8px; } }
.gl-table td, .gl-table th { white-space: normal; }
.gl-table td p { margin: 0 0 4px; }
.gl-table td p:last-child { margin-bottom: 0; }
@media (min-width: 621px) { .gl-table td:first-child { width: 22%; } .gl-table td:last-child { width: 18%; } }
.learn-doc { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); margin: 0; }
.learn-doc:hover { border-color: var(--brand2); }
.learn-doc b { color: var(--brand); }
.learn-doc .chip { align-self: flex-start; }
.learn-file .btns { align-items: center; }
.learn-file .btn { display: inline-flex; align-items: center; min-height: 36px; }

/* subtítulo da logo sempre completo: quem encolhe é a ilustração */
.logo { flex: 0 0 auto; }
.logo-text small { overflow: visible; text-overflow: clip; }
/* cabeçalho: a ilustração usa só o espaço que sobra; sem folga, some (nunca empurra o menu para fora) */
.hdr-illus { flex: 1 1 0; min-width: 0; max-width: 300px; margin-left: auto; }
@media (max-width: 1279px) { .hdr-illus { display: none; } .hdr-market { margin-left: auto; } }
@media (max-width: 1099px) { .hdr-market .mkt-quote { display: none; } }
@media (max-width: 860px) {
  .hdr-market { flex: 0 1 auto; min-width: 0; }
  .mkt-status { min-width: 0; max-width: 100%; }
  .mkt-status > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 760px) { .hdr-market { display: none; } .hdr-actions, .hdr-illus + .hdr-actions { margin-left: auto; } }

/* --- Aprenda: perguntas frequentes de opções --- */
.faq { padding: 6px 17px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 12px 4px 12px 0; min-height: 44px; list-style-position: inside; }
.faq-item > summary:hover { color: var(--brand2); }
.faq-item[open] > summary { padding-bottom: 4px; }
.faq-item p { margin: 0 0 12px 1.15em; color: var(--ink); max-width: 75ch; }
.faq-note { margin: 10px 0 8px; }
.hero .hero-howto { margin-top: 8px; }
.hero .hero-howto a { font-weight: 600; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Gráficos do Resumo: amostras de linha, dica ao passar o mouse --- */
.chart .l-proj { stroke-linecap: round; }
.sw-line { width: 34px; height: 12px; margin-right: 6px; vertical-align: middle; flex: none; }
.lg span { display: inline-flex; align-items: center; }
.sw.sw-bar { width: 12px; height: 12px; border-radius: 2px; background: var(--brand2); }
.sw.sw-bar.proj { background: color-mix(in srgb, var(--mod-opt) 35%, transparent); border: 1.5px dashed var(--mod-opt); }
.chart-wrap { position: relative; }
.chart-wrap svg.chart { touch-action: pan-y; cursor: crosshair; border-radius: 6px; }
.chart-wrap svg.chart:focus-visible { outline: 3px solid var(--brand2); outline-offset: 2px; }
.chart .tip-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .tip-dots { pointer-events: none; }
.chart-tip { position: absolute; top: 8px; z-index: 5; min-width: 170px; max-width: 260px; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 6px 20px var(--shadow); padding: 8px 10px; font-size: 12.5px; display: grid; gap: 3px; }
.chart-tip > b { color: var(--brand); font-size: 13px; }
.chart-tip span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip span b { margin-left: auto; padding-left: 10px; }
.chart-tip .sw { width: 10px; height: 10px; border-radius: 50%; margin: 0; }
.card-head { margin-bottom: 8px; align-items: center; }
.card-head > .card-title { flex: 1 1 320px; margin: 0; }

/* ---------- Perfil de acesso (Fase 2) ---------- */
.access-banner { background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600; text-align: center;
  padding: 8px 16px; border-bottom: 1px solid var(--line); }
.ro-note { margin-bottom: 12px; }
button:disabled[data-act], button:disabled[data-ract], button:disabled[data-done], button:disabled[data-plan] { cursor: not-allowed; }

/* ---------- Modal "Atualizar dados" (Admin) ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 42, 31, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(20, 42, 31, .25); }
.modal h3 { margin: 0 0 6px; }
.pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pick.off { opacity: .6; cursor: default; }
.pick input { margin-top: 3px; }
.pick small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.btn.xs { padding: 3px 9px; font-size: 12px; min-height: 0; line-height: 1.4; }

/* ---------- Administração ---------- */
.adm-table tr.inactive td { opacity: .6; }
.adm-table .edit-row td { background: var(--surface); }
.adm-table .small { font-size: 12px; }

/* ---------- Backtest de valuation ---------- */
.val-table tr.hl td { background: var(--good-bg); }
.val-table .small { font-size: 12px; font-weight: 400; }
.val-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }

/* ---------- Aprenda: estruturas ---------- */
.learn-struct .analogia { font-style: italic; color: var(--muted); margin: 4px 0 8px; }
.learn-struct .chart.payoff { margin: 4px 0; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.mini-table th, .mini-table td { padding: 4px 3px; text-align: center; border-bottom: 1px solid var(--line); }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
@media (max-width: 620px) { .mini-table { font-size: 11.5px; } }

/* Dica do indicador: título com sublinhado pontilhado; a explicação aparece ao passar o mouse */
.has-tip { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

/* Registro de estrutura: célula Série com o seletor em cima e o código embaixo, sem estourar a tabela */
.reg-table td { vertical-align: top; }
.reg-table .reg-serie { min-width: 200px; max-width: 260px; }
.reg-table .reg-serie select, .reg-table .reg-serie input { display: block; width: 100%; max-width: 100%; box-sizing: border-box; }
.reg-table .reg-serie input { margin-top: 4px; }
.reg-table input[type=number] { max-width: 100px; }
.reg-table input[type=date] { max-width: 150px; }
@media (max-width: 900px) { .reg-table .reg-serie { max-width: none; } }

.modal.modal-wide { max-width: 860px; }
.modal .levels { margin: 8px 0; }

/* Estruturas: sugestão que está montada na seção 2 */
#es_sugestoes tr .picked-tag{display:none}
#es_sugestoes tr.picked .picked-tag{display:inline-block}
#es_sugestoes tr.picked td{background:var(--brand-soft)}
#es_sugestoes tr.picked td:first-child{box-shadow:inset 4px 0 0 var(--brand2)}

/* ---------- Convidar amigos (Fase 2; wireframe em docs/fase2/wireframe) ---------- */
.cv-small { font-size: 12.5px; }
.cv-wrap { display: grid; gap: 16px; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.cv-quota { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -6px 0 14px; }
.cv-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cv-tab { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 56px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; }
.cv-tab .ico { width: 22px; height: 22px; }
.cv-tab:hover { border-color: var(--line-strong); color: var(--brand); }
.cv-tab[aria-selected="true"] { border-color: var(--brand2); background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand2); }
.cv-form label { margin-top: 12px; }
.cv-form label:first-child { margin-top: 0; }
.cv-form textarea { min-height: 112px; resize: vertical; }
.cv-form [aria-invalid="true"] { border-color: var(--bad); }
.cv-form [aria-invalid="true"] + .field-hint, #cv_email_hint, #cv_tel_hint { min-height: 1em; }
.cv-count { font-size: 12px; color: var(--muted); text-align: right; margin-top: 3px; }
.cv-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.cv-actions .btn { min-height: 46px; font-size: 15px; padding-left: 20px; padding-right: 20px; display: inline-flex; gap: 8px; align-items: center; }
#cv_status { margin-bottom: 12px; }
.cv-link-box { display: flex; gap: 8px; align-items: stretch; margin: 10px 0 6px; }
.cv-link-box input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.cv-link-box .btn { white-space: nowrap; }
.cv-how { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; counter-reset: s; }
.cv-how li { counter-increment: s; position: relative; padding-left: 36px; font-size: 14px; color: var(--muted); }
.cv-how li b { color: var(--ink); }
.cv-how li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand2); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.cv-list td .btns { margin: 0; flex-wrap: wrap; gap: 6px; }
.cv-list td .btns .btn { white-space: nowrap; }
.cv-empty { text-align: center; padding: 22px 12px; color: var(--muted); }
.cv-empty .ico { width: 36px; height: 36px; color: var(--line-strong); }
.wa-btn { background: #1E8E4E; }
.wa-btn:hover { background: #17733F; }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--brand2); text-decoration: underline; cursor: pointer; min-height: 0; }
.mail-prev { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.mail-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.mail-meta b { color: var(--ink); }
.mail-body { background: #fff; color: #1B2B24; border-radius: 10px; overflow: hidden; border: 1px solid #D9E2DC; max-width: 560px; margin: 0 auto; }
.mail-top { background: #153D32; color: #fff; padding: 14px 20px; font-weight: 700; }
.mail-in { padding: 20px; font-size: 14.5px; line-height: 1.55; }
.mail-in h4 { font-size: 19px; color: #153D32; margin: 0 0 10px; }
.mail-quote { border-left: 4px solid #24755E; background: #E8F1EB; padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; font-style: italic; }
.mail-quote small { display: block; font-style: normal; color: #63736A; margin-top: 4px; }
.mail-cta { display: block; width: fit-content; margin: 16px auto 6px; background: #24755E; color: #fff; font-weight: 700; padding: 12px 26px; border-radius: 8px; }
.mail-foot { border-top: 1px solid #D9E2DC; padding: 12px 20px; font-size: 12px; color: #63736A; background: #F8FAF8; }
@media (max-width: 899px) { .cv-wrap { grid-template-columns: minmax(0, 1fr); } }

/* Etiqueta "novo" no item Convidar amigos (Fase 2) e dicas de campo dentro do app */
.nav-link[data-tab="convites"]::after { content: "novo"; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 99px; background: var(--brand2); color: #fff; }
#view .field-hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; min-height: 1em; }

/* ---------- Tour guiado dos módulos ---------- */
.tour-back { position: fixed; inset: 0; z-index: 60; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(10, 26, 20, .55); outline: 3px solid var(--logo-accent);
  pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour-back.nospot { background: rgba(10, 26, 20, .55); }
.tour-bubble { position: fixed; width: min(420px, calc(100vw - 24px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.tour-bubble.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-bubble.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; transform: none; border-radius: 14px 14px 0 0;
  max-height: 56vh; overflow: auto; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.tour-bubble.sheet.center { top: auto !important; }
.tour-bubble.loading .tour-text { opacity: .6; }
.tour-head { display: flex; align-items: center; justify-content: space-between; }
.tour-progress { font-size: 12px; font-weight: 700; color: var(--brand2); letter-spacing: .02em; }
.tour-x { border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; }
.tour-x:hover { background: var(--field); color: var(--ink); }
.tour-title { font-size: 18px; margin: 2px 0 6px; color: var(--brand); }
.tour-title:focus { outline: none; }
.tour-text { margin: 0 0 8px; font-size: 14.5px; line-height: 1.55; }
.tour-sub { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.tour-term { border: 0; background: none; padding: 0; font: inherit; color: var(--brand2); text-decoration: underline dotted; cursor: help; }
.tour-def { background: var(--brand-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 0 0 8px; }
.tour-def .linklike { display: block; margin-top: 6px; }
.tour-warn { font-size: 11.5px; color: var(--muted); margin: 0 0 10px; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tour-gap { flex: 1; }
.tour-index { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: 40vh; overflow: auto; }
.tour-index button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--field); color: var(--ink); border-radius: 8px;
  padding: 7px 9px; font: inherit; font-size: 13px; cursor: pointer; min-height: 36px; }
.tour-index button[aria-current="step"] { border-color: var(--brand2); background: var(--brand-soft); font-weight: 700; }
.tour-index .muted { display: block; padding: 7px 9px; font-size: 12.5px; }
.tour-cta { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 699px) { .tour-index { grid-template-columns: 1fr; } .tour-actions .btn { min-height: 40px; } }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

.drawer-head .tour-drawer { margin-left: auto; margin-right: 6px; display: inline-flex; gap: 6px; align-items: center; }
.drawer-head .tour-drawer .ico { width: 16px; height: 16px; }

/* Giro da Semana / Fechamento do mes: a edicao aparece num iframe da versao web (/giro/<slug>). */
.giro-edit { display: grid; gap: 10px; margin-top: 12px; }
.giro-edit label { display: grid; gap: 4px; }
.giro-edit textarea { font-family: inherit; font-size: 14px; min-height: 80px; }
.giro-frame { display: block; width: 100%; height: 1600px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }

/* Feedback: botão fixo no canto inferior direito (todas as telas) e painel acima dele. Fica abaixo de janelas,
   menu do celular e tour (z-index 40+), para não cobrir nada que a pessoa esteja fazendo. */
.fb-fab { position: fixed; right: 20px; bottom: 20px; z-index: 35; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--brand2); color: var(--on-brand);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px var(--shadow), 0 1px 3px rgba(0, 0, 0, .18); }
.fb-fab:hover { background: var(--btn-hover); }
.fb-fab:focus-visible { outline: 3px solid var(--logo-accent); outline-offset: 2px; }
.fb-fab svg { width: 20px; height: 20px; flex: none; }
.fb-panel { position: fixed; right: 20px; bottom: 76px; z-index: 36; width: min(400px, calc(100vw - 24px));
  max-height: calc(100vh - 100px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px 16px; box-shadow: 0 12px 32px var(--shadow), 0 2px 6px rgba(0, 0, 0, .12); }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fb-title { margin: 0; font-size: 17px; color: var(--brand); }
.fb-title:focus { outline: none; }
.fb-x { border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; }
.fb-x:hover { background: var(--field); color: var(--ink); }
.fb-sub { margin: 4px 0 10px; font-size: 13.5px; color: var(--muted); }
.fb-group { display: block; border: 0; margin: 0 0 10px; padding: 0; font-size: 14px; font-weight: 600; }
.fb-group legend { padding: 0; margin-bottom: 6px; }
.fb-group .muted { font-weight: 400; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chip { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.fb-chip.sm { min-height: 32px; font-size: 13px; font-weight: 500; }
.fb-chip:hover { border-color: var(--line-strong); background: var(--field); }
.fb-chip[aria-checked="true"], .fb-chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand2); color: var(--brand); }
.fb-chip[aria-pressed="true"]::before { content: "✓ "; }
.fb-notas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fb-notas button { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 2px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.fb-notas button b { font-size: 16px; }
.fb-notas button span { font-size: 11.5px; color: var(--muted); }
.fb-notas button:hover { background: var(--field); }
.fb-notas button[aria-checked="true"] { background: var(--brand-soft); border-color: var(--brand2); }
.fb-notas button[aria-checked="true"] span { color: var(--brand); }
.fb-group textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 14px; font-weight: 400; min-height: 72px; resize: vertical; }
.fb-count { display: block; text-align: right; font-weight: 400; margin-top: 2px; }
.fb-contato { font-size: 13.5px; gap: 8px; padding: 2px 0; }
.fb-meta { margin: 4px 0 0; }
/* Botões sempre visíveis no rodapé do painel, mesmo quando o conteúdo rola. */
.fb-actions { position: sticky; bottom: -16px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  margin: 0 -16px -16px; padding: 10px 16px 14px; background: var(--surface); border-top: 1px solid var(--line); }
/* Celular: botão só com o ícone (não cobre o conteúdo) e painel como folha na parte de baixo. */
@media (max-width: 699px) {
  .fb-fab { right: 14px; bottom: 14px; width: 48px; height: 48px; padding: 0; justify-content: center; }
  .fb-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fb-panel { left: 0; right: 0; bottom: 0; width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; border-bottom: 0; }
}
/* Administração → Feedback */
.fb-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.fb-msg { white-space: pre-wrap; overflow-wrap: anywhere; }
