/* acione — green & white, diamond motif */
:root {
  --green-900: #063d27;
  --green-700: #0b6b43;
  --green-600: #0f8a56;
  --green-100: #dff3e8;
  --green-50: #f1faf5;
  --white: #ffffff;
  --border: #d5e6dc;
  --text: #12241b;
  --muted: #5d7468;
  --up: #0b7a4b;
  --down: #c5362f;
  /* Diamond lattice tiles */
  --lattice-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cpath d='M18 2 34 18 18 34 2 18z' fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1'/%3E%3C/svg%3E");
  --lattice-green: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cpath d='M18 2 34 18 18 34 2 18z' fill='none' stroke='%230b6b43' stroke-opacity='.07' stroke-width='1'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
/* Room for the scrollbar on every page, so a short page (no scrollbar) does
   not sit a few pixels to the right of a long one. */
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--white) var(--lattice-green);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 32px;
  /* line up with the 1280px page container */
  padding: 0 max(16px, calc((100% - 1280px) / 2 + 16px)); height: 56px;
  background: var(--green-900); color: var(--white);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: Bahnschrift, "DIN Alternate", "Segoe UI", sans-serif;
  font-weight: 700; font-size: 21px; letter-spacing: .16em;
  text-transform: uppercase; line-height: 1;
}
.brand span { display: flex; align-items: center; padding-top: 2px; }   /* Bahnschrift caps sit high */
.brand i {                /* diamond standing in for the O */
  width: 12px; height: 12px; margin: -2px 8px 0 4px;
  background: #7dffb8; transform: rotate(45deg);
}
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { padding: 17px 2px; color: rgba(255, 255, 255, .7); }
.topbar nav a:hover { color: var(--white); }
.topbar nav a.active { color: var(--white); border-bottom: 2px solid var(--white); }

/* Hero band */
.hero {
  background: var(--green-700) var(--lattice-light);
  color: var(--white);
  padding: 28px 0 64px;
}
.hero-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 16px;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
}
.hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .8); }
.hero p.live { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.hero p.live::before {   /* diamond status light */
  content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: #7dffb8;
}
.hero p.live.stale::before { background: #ffd27d; }
.actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-block; cursor: pointer;
  padding: 9px 16px;
  background: var(--white); color: var(--green-700); font-weight: 700;
}
.btn:hover { background: var(--green-100); }
.btn.solid { background: var(--green-700); color: var(--white); }
.btn.solid:hover { background: var(--green-600); }
input[type="file"]:focus-visible + .btn { outline: 2px solid var(--white); outline-offset: 2px; }
select {
  padding: 9px 10px; font: inherit;
  background: var(--white); color: var(--text); border: 0;
}

main { max-width: 1280px; margin: -40px auto 0; padding: 0 16px 64px; }

.flash {
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--white); border: 1px solid; font-weight: 500;
}
.flash.success { color: var(--up); border-color: var(--up); }
.flash.error { color: var(--down); border-color: var(--down); }

/* Summary cards */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.card, .panel, .empty {
  background: var(--white); border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(6, 61, 39, .06);
}
.card { padding: 16px; position: relative; overflow: hidden; }
.card::after {            /* corner diamond */
  content: ""; position: absolute; right: -14px; top: -14px;
  width: 44px; height: 44px; transform: rotate(45deg);
  background: var(--green-100);
}
.card span { display: block; color: var(--muted); font-size: 13px; }
.card strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--green-900); }
.card dl { margin: 6px 0 0; font-size: 13px; }           /* figures under the main one */
.card dl div { display: flex; justify-content: space-between; gap: 12px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--green-900); }

/* Panels */
.panel { padding: 16px; margin-bottom: 16px; scroll-margin-top: 68px; }
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 8px;
}
.panel h2 { display: flex; align-items: center; gap: 10px; color: var(--green-900); }
.panel h2::before {       /* diamond bullet */
  content: ""; width: 9px; height: 9px; flex: none;
  transform: rotate(45deg); background: var(--green-600);
}
.panel-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.panel-total span { margin-left: 6px; font-weight: 500; }
.panel-total b { font-weight: 600; }
.panel-total .received { margin-left: 14px; font-size: 13px; font-weight: 400; color: var(--muted); }
/* A section's return by period: valuation, received, total */
.sums {
  display: flex; flex-wrap: wrap; gap: 6px 40px; padding: 10px 12px; margin-bottom: 8px;
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted);
  background: var(--green-50); border: 1px solid var(--green-100);
}
.sums div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.sums .period { font-weight: 600; color: var(--green-900); }
.sums b { margin-left: 4px; font-weight: 600; color: var(--text); }
.sums b[data-sum="pa"] { font-weight: 700; }
.sums b.up { color: var(--up); }
.sums b.down { color: var(--down); }
.modal-head .panel-total .received { color: var(--white); }

/* Allocation */
.alloc { margin-top: 10px; }
.alloc-row {
  display: grid; grid-template-columns: 190px 1fr 70px 120px;
  gap: 12px; align-items: center; padding: 6px 4px;
}
.alloc-row:hover { background: var(--green-50); }
.alloc-bar { height: 8px; background: var(--green-100); }
.alloc-bar i {
  display: block; position: relative; height: 100%; min-width: 2px;
  background: var(--green-600);
}
.alloc-bar i::after {     /* diamond cap */
  content: ""; position: absolute; right: 0; top: 50%; box-sizing: border-box;
  width: 14px; height: 14px; transform: translate(50%, -50%) rotate(45deg);
  background: var(--green-700); border: 2px solid var(--white);
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
td:first-child { min-width: 190px; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
th.num { text-align: right; }
th.center, td.center { text-align: center; }
/* Header of a two-line column: names the small second line of its cells */
.th-label { display: inline-block; vertical-align: middle; }
.th-label small { display: block; font-size: 11px; font-weight: 400; }
td .sub.up { color: var(--up); }
td .sub.down { color: var(--down); }
td { padding: 9px 10px; border-bottom: 1px solid var(--green-100); }
td:not(:first-child) { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--green-50); }
.asset { font-weight: 600; }
.sub, .event { color: var(--muted); font-size: 12px; }

/* Empty state */
.empty { padding: 56px 24px; text-align: center; }
.empty p { margin: 6px auto 20px; max-width: 420px; }
.gem {
  width: 44px; height: 44px; margin: 6px auto 26px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--green-600), var(--green-900));
  box-shadow: 0 0 0 8px var(--green-100);
}

@media (max-width: 640px) {
  .alloc-row { grid-template-columns: 1fr 60px 110px; }
  .alloc-bar { grid-column: 1 / -1; order: 4; }
}

/* Header sort + filter (tables.js) */
.th-btn {
  display: inline-grid; place-items: center; vertical-align: middle;
  margin: -2px 0 0 6px; padding: 0; width: 18px; height: 18px;
  font: inherit; font-size: 10px; line-height: 1; cursor: pointer;
  color: var(--green-700); background: var(--white); border: 1px solid var(--border);
}
.th-btn:hover, .th-btn[aria-expanded="true"] { border-color: var(--green-600); background: var(--green-50); }
.th-btn.active { color: var(--white); background: var(--green-700); border-color: var(--green-700); }
.th-menu {
  position: fixed; z-index: 20; width: 250px; padding: 6px; font-size: 14px;
  background: var(--white); border: 1px solid var(--green-700);
  box-shadow: 0 8px 24px rgba(6, 61, 39, .18);
}
.th-menu button {
  display: block; width: 100%; padding: 7px 8px; text-align: left;
  font: inherit; color: var(--text); background: none; border: 0; cursor: pointer;
}
.th-menu button:hover:not(:disabled) { background: var(--green-50); }
.th-menu button:disabled { color: var(--muted); opacity: .6; cursor: default; }
.th-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.th-menu input[type="search"] {
  width: 100%; padding: 6px 8px; font: inherit;
  border: 1px solid var(--border); outline-color: var(--green-600);
}
.th-values {
  max-height: 210px; overflow-y: auto; margin: 6px 0;
  border: 1px solid var(--border); padding: 4px;
}
.th-values label { display: block; padding: 3px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-values label:hover { background: var(--green-50); }
.th-values label.all { font-weight: 600; }
.th-values input { accent-color: var(--green-700); }
/* Totalizer: sums of the rows left visible by the filters */
.totalizer {
  display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--green-50); border: 1px solid var(--green-100);
  font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.totalizer b { font-weight: 600; margin-left: 4px; }
.totalizer [data-count] { margin-left: 0; color: var(--green-900); }
.totalizer .net { margin-left: auto; font-size: 15px; color: var(--green-900); }
.no-match td { text-align: center; color: var(--muted); padding: 18px; }
tr[hidden], .th-values label[hidden] { display: none; }

/* Expand button + full-detail pop-up */
.panel-total { display: flex; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 12px;
  padding: 0; cursor: pointer; color: var(--green-700);
  background: var(--white); border: 1px solid var(--border);
}
.icon-btn:hover { background: var(--green-700); border-color: var(--green-700); color: var(--white); }
.modal {
  width: 97vw; max-width: none; max-height: 92vh; padding: 0;
  border: 1px solid var(--green-700); color: var(--text); background: var(--white);
  box-shadow: 0 24px 64px rgba(6, 61, 39, .35);
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(6, 61, 39, .55); }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; color: var(--white);
  background: var(--green-700) var(--lattice-light);
}
.modal-head h2 { display: flex; align-items: center; gap: 10px; color: var(--white); }
.modal-head h2::before {
  content: ""; width: 9px; height: 9px; flex: none;
  transform: rotate(45deg); background: var(--white);
}
.modal-head .up, .modal-head .down { color: var(--white); opacity: .85; }
.modal .table-wrap { overflow: auto; padding: 0 16px 12px; }
.modal table { font-size: 13px; }
.modal th { position: sticky; top: 0; z-index: 1; background: var(--white); padding-top: 14px; }
.modal td:first-child { min-width: 200px; }

/* Scroll-to-top button */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 9;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  cursor: pointer; color: var(--white); background: var(--green-700);
  border: 1px solid var(--white); box-shadow: 0 4px 14px rgba(6, 61, 39, .3);
  transition: opacity .15s;
}
.to-top:hover { background: var(--green-900); }
.to-top[hidden] { display: none; }

/* Dashboard, Statement, Imports */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; }   /* panels in a row share one height */
.grid-2 .panel { margin-bottom: 0; }
.panel-head .more { font-size: 13px; font-weight: 600; color: var(--green-700); }
.panel-head .more:hover { text-decoration: underline; }
.alloc.compact .alloc-row { grid-template-columns: 175px 1fr 62px 110px; }
.alloc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.left { text-align: left; }
td.wrap { white-space: normal; }
.bar-cell { width: 22%; min-width: 80px; }
.file-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.file-form input[type="file"] {
  padding: 7px; font: inherit; color: var(--text);
  background: var(--green-50); border: 1px solid var(--border);
}
.file-form .btn { border: 0; font: inherit; font-weight: 700; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 table { font-size: 13px; }
.grid-2 th, .grid-2 td { padding-left: 6px; padding-right: 6px; }

/* Import drop zone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 16px; cursor: pointer; text-align: center;
  background: var(--green-50) var(--lattice-green);
  border: 2px dashed var(--green-600);
  transition: background-color .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background-color: var(--green-100); border-color: var(--green-900); }
.dropzone.busy { pointer-events: none; opacity: .7; }
.dropzone-title { font-size: 16px; font-weight: 700; color: var(--green-900); }
input[type="file"]:focus-visible + .dropzone { outline: 2px solid var(--green-900); outline-offset: 2px; }
.gem.small { width: 26px; height: 26px; margin: 4px auto 14px; box-shadow: 0 0 0 5px var(--green-100); }

/* Account tabs on the Statement page */
.tabs { display: flex; background: var(--white); }
.tabs a { padding: 9px 16px; font-weight: 600; color: var(--green-700); }
.tabs a:hover { background: var(--green-100); }
.tabs a.active { background: var(--green-900); color: var(--white); }

/* Carteiras recomendadas */
.btn { border: 0; font: inherit; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.actions form { display: contents; }
.link { color: var(--green-700); }
.link:hover { text-decoration: underline; }
.link-btn {
  padding: 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--green-700); background: none; border: 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--down); }
.row-actions { text-align: right; }
.row-actions > * { margin-left: 14px; }
.row-actions form, td form { display: inline; }
.badge {
  display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 700;
  color: var(--white); background: var(--green-700);
}
.chip {
  display: inline-block; margin: 2px 6px 2px 0; padding: 2px 8px; font-size: 12px;
  background: var(--green-50); border: 1px solid var(--green-100); white-space: nowrap;
}
.chip b { font-weight: 600; color: var(--green-900); }
.notes { margin: 0; color: var(--muted); }
.gap { font-weight: 600; }
.gap.buy { color: var(--up); }
.gap.sell { color: var(--down); }
/* Current share as a bar with a diamond at the target share */
.target-bar { display: block; position: relative; height: 8px; background: var(--green-100); }
.target-bar i { display: block; height: 100%; background: var(--green-600); }
.target-bar b {
  position: absolute; top: 50%; box-sizing: border-box; width: 12px; height: 12px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--white); border: 2px solid var(--green-900);
}

/* Carteira editor */
.editor input[type="text"], .editor textarea {
  display: block; width: 100%; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--white); border: 1px solid var(--border); outline-color: var(--green-600);
}
.editor label { font-size: 12px; font-weight: 600; color: var(--muted); }
.editor label input, .editor label textarea { margin-top: 4px; font-weight: 400; }
.editor select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--white); border: 1px solid var(--border); border-radius: 0; outline-color: var(--green-600);
}
.c-carteira-label { display: block; max-width: 420px; }
.editor .grid-2 { margin-bottom: 16px; }
.editor .tabs + .btn, .tabs + .btn { margin-left: 4px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .wide { grid-column: 1 / -1; }
.pct-input { text-align: right; font-variant-numeric: tabular-nums; }
.category { padding: 14px; margin-bottom: 12px; background: var(--green-50); border: 1px solid var(--border); }
.category-head { display: grid; grid-template-columns: 1fr 110px auto; gap: 12px; align-items: end; }
.category-head .link-btn { padding-bottom: 9px; }
.types { margin: 12px 0; padding: 8px 10px; border: 1px solid var(--border); background: var(--white); }
.types legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.types label { display: inline-block; margin: 2px 14px 2px 0; font-size: 13px; font-weight: 400; color: var(--text); cursor: pointer; }
.types label.off { color: var(--muted); opacity: .55; cursor: default; }
.types input { accent-color: var(--green-700); }
.assets-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.assets-head .muted { font-weight: 400; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 14px; }
.asset-row { display: grid; grid-template-columns: 1fr 76px 28px; gap: 6px; align-items: center; }
.asset-row .icon-btn { margin-left: 0; font-size: 16px; }
.asset-tools { display: flex; gap: 16px; margin-top: 8px; }
.sum.ok { color: var(--up); }
.sum.bad { color: var(--down); }
@media (max-width: 640px) {
  .fields, .category-head { grid-template-columns: 1fr; }
}
.fixed-income[hidden] { display: none; }
.fixed-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; padding: 4px 0; }
.fixed-fields label { display: block; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); cursor: default; }

/* Invest */
.cash-form { display: flex; align-items: flex-end; gap: 12px; }
.cash-form label { display: block; margin-bottom: 4px; font-size: 12px; color: rgba(255, 255, 255, .8); }
.cash-box { display: flex; align-items: stretch; background: var(--white); }
.cash-box span { align-self: center; padding-left: 12px; color: var(--muted); }
.cash-box input {
  width: 110px; padding: 9px 12px 9px 6px; font: inherit; font-weight: 600; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--green-900); background: none; border: 0; outline: 0;
}
.cash-box:focus-within { outline: 2px solid var(--white); outline-offset: 2px; }
.cash-box button {
  padding: 0 16px; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--white); background: var(--green-900); border: 0;
}
.cash-box button:hover { background: var(--green-600); }
.cash-note { display: block; margin-top: 6px; font-size: 12px; text-align: right; color: rgba(255, 255, 255, .65); }
.cash-note:hover { color: var(--white); }
.criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 4px; }
.criterion { padding: 12px 14px; background: var(--green-50); border: 1px solid var(--green-100); }
.criterion span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.criterion strong { font-size: 18px; color: var(--green-900); font-variant-numeric: tabular-nums; }
.criterion em { font-style: normal; font-weight: 400; font-size: 13px; color: var(--muted); }
.buy-qty { font-weight: 700; color: var(--up); }
.sell-qty { font-weight: 700; color: var(--down); }
.panel-note { margin: 0; color: var(--muted); }
.hero a.underline { text-decoration: underline; }
/* Tables with many columns: no wide first column, tighter cells */
table.dense td:first-child { min-width: 0; }
table.dense th, table.dense td { padding-left: 6px; padding-right: 6px; }
.editor label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--text); cursor: pointer; }
.editor label.check input { margin: 0; accent-color: var(--green-700); }

/* Accounts: header user area, sign-in pages, settings */
.topbar .user { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.topbar .user a { padding: 17px 2px; color: rgba(255, 255, 255, .7); }
.topbar .user a:hover, .topbar .user button:hover { color: var(--white); }
.topbar .user a.active { color: var(--white); border-bottom: 2px solid var(--white); }
.topbar .user form { display: contents; }
.topbar .user button {
  padding: 0; font: inherit; cursor: pointer;
  color: rgba(255, 255, 255, .7); background: none; border: 0;
}
/* Sign-in pages: one card in the middle of a green page */
main.auth {
  display: grid; place-items: center; max-width: none; margin: 0; padding: 32px 16px;
  min-height: calc(100vh - 56px);
  background: var(--green-700) var(--lattice-light);
}
.auth-box { width: 100%; max-width: 420px; margin-bottom: 8vh; }
.auth .panel { margin: 0; padding: 28px; box-shadow: 0 12px 40px rgba(6, 61, 39, .35); }
.auth h1 { margin-bottom: 18px; font-size: 22px; color: var(--green-900); }
.form .field { margin-bottom: 14px; }
.form label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.form input[type="text"], .form input[type="email"], .form input[type="password"] {
  display: block; width: 100%; padding: 9px 10px; font: inherit; color: var(--text);
  background: var(--white); border: 1px solid var(--border); outline-color: var(--green-600);
}
.field-error { display: block; margin-top: 4px; font-size: 12px; color: var(--down); }
.form .btn { margin-top: 4px; }
.form-links { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0 0; font-weight: 600; }

/* Asset pop-up: chart + key figures (chart.js) */
.chartable { cursor: pointer; }
.chartable:hover, .chartable:focus-visible { color: var(--green-700); text-decoration: underline; outline: 0; }
.asset-modal { width: min(1400px, 97vw); height: 92vh; }
.asset-modal .modal-head h2 small { font-size: 13px; font-weight: 400; opacity: .85; }
.asset-quote { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.asset-quote b { font-size: 18px; }
.asset-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.asset-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 8px 12px 16px; }
.asset-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.seg { display: flex; }
.seg button {
  padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--green-700); background: var(--white); border: 1px solid var(--border); margin-left: -1px;
}
.seg button:first-child { margin-left: 0; }
.seg.loose { flex-wrap: wrap; gap: 4px; }
.seg.loose button { margin-left: 0; }
.seg button:hover { background: var(--green-50); }
.seg button.on { color: var(--white); background: var(--green-700); border-color: var(--green-700); }
.seg button[hidden] { display: none; }
.asset-readout {
  display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 20px; margin: 10px 0 4px;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.asset-readout b { font-weight: 600; color: var(--text); }
.asset-readout b.up { color: var(--up); }
.asset-readout b.down { color: var(--down); }
.asset-chart { flex: 1; min-height: 240px; }
.asset-modal.loading .asset-chart, .asset-modal.loading .asset-tools { visibility: hidden; }
.asset-status { position: absolute; left: 16px; top: 120px; margin: 0; }
.asset-side { overflow-y: auto; padding: 12px 16px; border-left: 1px solid var(--border); background: var(--green-50); }
.asset-side section + section { margin-top: 14px; }
.asset-side h3 { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--green-900); text-transform: uppercase; letter-spacing: .04em; }
.asset-side dl { margin: 0; }
.asset-side dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--green-100); font-size: 13px; }
.asset-side dt { color: var(--muted); }
.asset-side dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .asset-body { grid-template-columns: 1fr; overflow-y: auto; }
  .asset-chart { min-height: 320px; flex: none; }
  .asset-side { border-left: 0; border-top: 1px solid var(--border); overflow: visible; }
}
/* The chart library lays itself out with a <table>: keep the app's table
   styles (wide first column, cell padding, row hover) out of it. */
.asset-chart table { width: auto; }
.asset-chart td, .asset-chart td:first-child { min-width: 0; padding: 0; border: 0; white-space: normal; }
.asset-chart tr:hover { background: none; }
.note-mark { margin-left: 2px; font-weight: 600; color: var(--down); }
.footnote { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

/* Invest: prefixado / pós-fixado by term, under the fixed-income criteria. */
.outlook { margin-top: 12px; }
.criterion.stack em { display: block; }
.outlook:not(.all) tr.more { display: none; }
.outlook-more { margin-top: 8px; }

/* A second table inside a panel (Invest: FGC cover) gets its own small heading. */
.sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 8px; }
.sub-head h3 { margin: 0; font-size: 12px; font-weight: 700; color: var(--green-900); text-transform: uppercase; letter-spacing: .04em; }

/* Every dropdown: our own arrow, so it keeps a margin from the right edge
   (the browser's sits against it). */
select, .editor select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230b6b43' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px;
}
