/* ==========================================================================
   ui/styles/components.css — material dos componentes do terminal novo.
   Material: superficie solida, borda de 1px, rim light discreto e sombra curta.
   Nada de vidro em todos os cards, nada de neon, nada de gradiente decorativo.
   O dourado marca selecao e acao principal, nunca todos os numeros.
   ========================================================================== */

/* ------------------------------------------------------------------ paineis */
.panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--pad-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.panel__title {
  font-size: var(--fs-section);
  line-height: var(--lh-section);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-3) var(--pad-panel) 0;
}

.panel-meta__item {
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  color: var(--text-muted);
}

/* --------------------------------------------------------- barra lateral -- */
.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 56px;
  min-height: 52px;
  padding: var(--space-2) 0;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color var(--motion-hover) var(--motion-ease),
    background var(--motion-hover) var(--motion-ease),
    border-color var(--motion-hover) var(--motion-ease);
  position: relative;
}

.rail-item__label {
  font-size: 9.5px;
  line-height: 1.1;
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
}

.rail-item:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.rail-item[aria-current="page"] {
  color: var(--accent);
  background: var(--surface-raised);
  border-color: var(--border-subtle);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* --------------------------------------------------------------- cabecalho -- */
.app-header__title {
  font-size: var(--fs-screen-title);
  line-height: var(--lh-screen-title);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}

.app-header__context {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  color: var(--text-muted);
  min-width: 0;
}

.app-header__brand {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.app-header__sep {
  color: var(--border-control);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 260px;
  padding: 6px var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill--sm {
  max-width: 190px;
  padding: 4px var(--space-2);
}

.status-pill__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill[data-state="ready"] .status-pill__dot { background: var(--buy); }
.status-pill[data-state="loading"] .status-pill__dot { background: var(--accent); }
.status-pill[data-state="stale"] .status-pill__dot { background: var(--warning); }
.status-pill[data-state="empty"] .status-pill__dot { background: var(--text-muted); }
.status-pill[data-state="unavailable"] .status-pill__dot { background: var(--warning); }
.status-pill[data-state="error"] .status-pill__dot { background: var(--danger); }

.fixture-flag {
  padding: 4px var(--space-2);
  border: 1px solid rgb(237 200 117 / 45%);
  border-radius: var(--radius-control);
  background: rgb(237 200 117 / 12%);
  color: var(--warning);
  font-size: 11px;
  line-height: 1.4;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--h-control);
  max-width: 300px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
  text-align: left;
  transition: border-color var(--motion-hover) var(--motion-ease);
}

.account-chip:hover { border-color: var(--border-control); }

.account-chip__text { display: flex; flex-direction: column; min-width: 0; }
.account-chip__name {
  font-size: var(--fs-label);
  line-height: 1.25;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip__detail {
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--h-control);
  height: var(--h-control);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
  transition: color var(--motion-hover) var(--motion-ease),
    border-color var(--motion-hover) var(--motion-ease);
}

.icon-btn:hover { color: var(--text-primary); border-color: var(--border-control); }

.menu { position: relative; }

.menu__pop {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-sheet);
  min-width: 220px;
  padding: var(--space-2);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-dialog);
}

.menu__item {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  text-align: left;
  font-size: var(--fs-body);
}

.menu__item:hover { background: var(--surface-hover); color: var(--text-primary); }

.menu__meta {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-label);
  color: var(--text-muted);
}

/* ---------------------------------------------------------- faixa de conta -- */
.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-1);
  padding: 14px 16px;
  background: linear-gradient(180deg, #181c22 0%, #111418 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-panel);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  min-width: 0;
  transition: border-color var(--motion-hover), transform var(--motion-hover), box-shadow var(--motion-hover);
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.metric-card__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: var(--lh-label);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card__value {
  font-size: 24px;
  line-height: 1.25;
  font-weight: var(--weight-bold);
  font-family: var(--font-num);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.02em;
  margin: 4px 0;
}

.metric-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.metric-card__meta [data-unit] {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-num);
  font-weight: var(--weight-medium);
}

.metric-card__meta [data-source] {
  color: var(--text-muted);
  font-size: 10.5px;
}

.metric-card[data-state="ready"] .metric-card__value { color: var(--text-primary); }
.metric-card[data-state="loading"] .metric-card__value,
.metric-card[data-state="idle"] .metric-card__value { color: var(--text-muted); }
.metric-card[data-state="stale"] { border-color: rgb(237 200 117 / 38%); }
.metric-card[data-state="stale"] .metric-card__value { color: var(--warning); }
.metric-card[data-state="unavailable"] { border-style: dashed; }
.metric-card[data-state="error"] { border-color: rgb(232 131 122 / 45%); }
.metric-card[data-state="error"] .metric-card__value { color: var(--danger); }
.metric-card[data-positive="true"] .metric-card__value { color: var(--buy); }
.metric-card[data-positive="false"] .metric-card__value { color: var(--sell); }

/* ------------------------------------------------------------------ grafico */
.chart-panel__head { align-items: center; }

.chart-panel__context { min-width: 0; }

.symbol-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--h-control);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.symbol-button:hover { border-color: var(--border-control); }

.symbol-button__name {
  font-size: var(--fs-section);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
}

.symbol-button__meta {
  font-size: 11px;
  color: var(--text-muted);
}

.quote {
  display: flex;
  gap: var(--space-5);
}

.quote__cell { text-align: right; }

.quote__cell dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.quote__cell dd {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.chart-panel__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--pad-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.tf-strip {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}

.tf-btn {
  min-width: 46px;
  min-height: var(--h-control-sm);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-family: var(--font-num);
  font-size: var(--fs-label);
  font-weight: var(--weight-medium);
  transition: color var(--motion-hover) var(--motion-ease),
    background var(--motion-hover) var(--motion-ease);
}

.tf-btn:hover { color: var(--text-primary); background: var(--surface-hover); }

.tf-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgb(217 183 124 / 42%);
}

.chart-panel__actions { display: flex; gap: var(--space-2); }

/* Rodape do painel do grafico — P01.1: tres colunas (resumo / botoes / equilibrio)
   para o grupo de avaliacao ficar exatamente no centro util do painel. */
.chart-panel__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--pad-panel) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.chart-panel__foot-balance {
  display: block;
  min-width: 0;
}

.study-summary { min-width: 0; }
.study-summary__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.study-summary__text {
  font-size: var(--fs-body);
  color: var(--text-secondary);
}
.study-summary__source {
  font-size: 11px;
  color: var(--text-muted);
}
.study-summary__source[data-state="stale"] { color: var(--warning); }
.study-summary__source[data-state="error"] { color: var(--danger); }

.chart-panel__evaluate {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex: 0 0 auto;
}

/* Botoes de avaliacao — P01.1: maiores e clicaveis, sem transform: scale.
   A cor semantica continua em contorno e texto: o estado normal nunca parece
#btn-avaliar-compra,
#btn-avaliar-venda {
  position: relative;
  min-width: 190px;
  min-height: 52px;
  padding-inline: 24px;
  font-size: 15px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.03em;
  border-radius: var(--radius-control);
  transition: all var(--motion-hover) var(--motion-ease);
  cursor: pointer;
}

#btn-avaliar-compra {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.16) 0%, rgba(34, 197, 94, 0.08) 100%);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#btn-avaliar-compra:hover {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.28) 0%, rgba(34, 197, 94, 0.16) 100%);
  border-color: rgba(34, 197, 94, 0.7);
  color: #86efac;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

#btn-avaliar-compra:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.2);
}

#btn-avaliar-venda {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.16) 0%, rgba(239, 68, 68, 0.08) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#btn-avaliar-venda:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.28) 0%, rgba(239, 68, 68, 0.16) 100%);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fca5a5;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

#btn-avaliar-venda:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.2);
}

/* --------------------------------------------------------------- botoes ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--h-control);
  padding: 0 var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background var(--motion-hover) var(--motion-ease),
    border-color var(--motion-hover) var(--motion-ease),
    transform var(--motion-hover) var(--motion-ease);
}

.btn:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-control); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--quiet {
  min-height: var(--h-control-sm);
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-label);
}

.btn--ghost { background: transparent; }

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--weight-semibold);
}

.btn--accent:hover:not(:disabled) { background: #e3c58f; border-color: #e3c58f; }

/* Compra e venda: cor semantica em traco e texto, sem preenchimento que possa
   ser lido como ordem ja enviada (spec secao 4.5). */
#oracle-dashboard-root #btn-avaliar-compra {
  border-color: rgb(113 201 164 / 45%);
  color: var(--buy);
}
#oracle-dashboard-root #btn-avaliar-venda {
  border-color: rgb(242 147 137 / 45%);
  color: var(--sell);
}
#oracle-dashboard-root #btn-avaliar-compra:hover {
  background: rgb(113 201 164 / 10%);
  border-color: var(--buy);
}
#oracle-dashboard-root #btn-avaliar-venda:hover {
  background: rgb(242 147 137 / 10%);
  border-color: var(--sell);
}

/* ------------------------------------------------------------------ estados */
.stage-state {
  position: absolute;
  inset: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5);
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-panel);
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 9px,
      rgb(255 255 255 / 1.6%) 9px 18px
    );
}

.stage-state__title {
  font-size: var(--fs-section);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}

.stage-state__text {
  max-width: 46ch;
  font-size: var(--fs-body);
  color: var(--text-muted);
}

.stage-state[data-state="error"] { border-color: rgb(232 131 122 / 45%); }
.stage-state[data-state="error"] .stage-state__title { color: var(--danger); }
.stage-state[data-state="stale"] { border-color: rgb(237 200 117 / 40%); }
.stage-state[data-state="stale"] .stage-state__title { color: var(--warning); }
.stage-state[data-state="unavailable"] .stage-state__title { color: var(--warning); }
.stage-state[data-state="ready"] { display: none; }

/* ----------------------------------------------------------------- copiloto */
.copilot-panel__head { align-items: center; }

.copilot-panel__context {
  font-size: var(--fs-label);
  color: var(--text-muted);
}

.briefing {
  display: flex;
  flex-direction: column;
  max-height: 360px;
  margin: var(--space-4) var(--pad-panel) 0;
  padding: var(--space-4);
  background: linear-gradient(180deg, #181c22 0%, #121418 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.briefing__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.briefing__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: var(--weight-bold);
}

.briefing__title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.briefing__time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-num);
}

.briefing__text {
  flex: 1 1 auto;
  min-height: 80px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--space-2);
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-secondary);
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 183, 124, 0.35) transparent;
}

.briefing__text::-webkit-scrollbar {
  width: 6px;
}
.briefing__text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
}
.briefing__text::-webkit-scrollbar-thumb {
  background: rgba(217, 183, 124, 0.25);
  border-radius: 999px;
}
.briefing__text::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Cards estruturados das seções da análise de IA */
.briefing-card {
  margin-bottom: var(--space-2);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-control);
}
.briefing-card:last-child {
  margin-bottom: 0;
}

.briefing-card__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 10px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.briefing-tag--panorama {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.briefing-tag--oportunidade {
  background: rgba(113, 201, 164, 0.12);
  color: #71c9a4;
  border: 1px solid rgba(113, 201, 164, 0.25);
}
.briefing-tag--risco {
  background: rgba(242, 147, 137, 0.12);
  color: #f29389;
  border: 1px solid rgba(242, 147, 137, 0.25);
}
.briefing-tag--decisao {
  background: rgba(237, 200, 117, 0.16);
  color: #edc875;
  border: 1px solid rgba(237, 200, 117, 0.35);
}

.briefing-card__body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}
.briefing-card__body strong {
  color: #ffffff;
  font-weight: var(--weight-semibold);
}

.briefing__foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#btn-ouvir-briefing {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(217, 183, 124, 0.08);
  border: 1px solid rgba(217, 183, 124, 0.28);
  color: var(--accent);
  font-weight: var(--weight-medium);
  transition: all var(--motion-hover);
}
#btn-ouvir-briefing:hover:not(:disabled) {
  background: rgba(217, 183, 124, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(217, 183, 124, 0.25);
}
#btn-ouvir-briefing[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(217, 183, 124, 0.4);
}

.briefing[data-state="stale"] { border-left-color: var(--warning); }
.briefing[data-state="error"] { border-left-color: var(--danger); }

.chat {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  margin-top: var(--space-4);
  padding: 0 var(--pad-panel);
}

.chat__stream { display: flex; flex-direction: column; gap: var(--space-3); }

.chat__empty,
.empty-note {
  padding: var(--space-4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: var(--fs-label);
  line-height: 1.6;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--pad-panel) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}

.composer__input {
  width: 100%;
  min-height: 62px;
  max-height: 160px;
  padding: var(--space-3);
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  resize: vertical;
}

.composer__input::placeholder { color: var(--text-muted); }

.composer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.composer__voice { min-width: 0; }

.select {
  min-height: var(--h-control-sm);
  max-width: 100%;
  padding: 0 var(--space-2);
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  font-size: var(--fs-label);
}

/* ------------------------------------------------------------------- abas --- */
.lower-zone { gap: var(--space-3); }

.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  border-bottom: 0;
}

.tab {
  min-height: var(--h-control-sm);
  padding: 0 var(--space-4);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  transition: color var(--motion-hover) var(--motion-ease),
    background var(--motion-hover) var(--motion-ease);
}

.tab:hover { color: var(--text-primary); background: var(--surface-hover); }

.tab[aria-selected="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tabs__note {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

.tab-panel {
  padding: var(--space-4) var(--pad-panel) var(--space-5);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}

/* ------------------------------------------------------------------ tabelas */
.data-table { font-size: var(--fs-body); }

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3);
  border-bottom: 1px solid rgb(48 52 58 / 55%);
  color: var(--text-secondary);
}

.data-table th.is-num,
.data-table td.is-num {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.data-table__empty {
  padding: var(--space-5) var(--space-3);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-label);
}

.position-cards { display: none; }

/* ----------------------------------------------------------------- atividade */
.activity { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }

/* ------------------------------------------------------------------ mobile -- */
.mobilenav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--h-mobilenav);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: var(--weight-medium);
}

.mobilenav-item[aria-current="page"] { color: var(--accent); }

/* ------------------------------------------------------------------- folhas -- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(4 6 10 / 62%);
}

.sheet[hidden] { display: none; }

.sheet__panel {
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 16px));
  max-height: min(84dvh, 720px);
  margin: 0 var(--space-2) var(--space-2);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-dialog);
  animation: dialog-in var(--motion-dialog) var(--motion-ease) both;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--pad-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.sheet__title {
  font-size: var(--fs-section);
  font-weight: var(--weight-semibold);
}

.sheet__body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--pad-panel);
  padding-bottom: max(var(--pad-panel), var(--safe-bottom));
}

.sheet__nav { display: flex; flex-direction: column; gap: var(--space-1); }

.sheet__nav-item {
  min-height: var(--h-control);
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  text-align: left;
  color: var(--text-secondary);
}

.sheet__nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }

.study-list { display: flex; flex-direction: column; gap: var(--space-2); }

.study-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  text-align: left;
}

.study-item strong { font-size: var(--fs-body); color: var(--text-primary); }
.study-item span { font-size: var(--fs-label); color: var(--text-muted); }

.study-item[aria-pressed="true"] {
  border-color: rgb(217 183 124 / 45%);
  background: var(--accent-soft);
}

/* --------------------------------------------------------- formularios ------ */
.field-group {
  margin: 0 0 var(--space-5);
  padding: 0;
  border: 0;
}

.field-group legend {
  padding: 0 0 var(--space-2);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}

.field-group__hint {
  margin-top: var(--space-2);
  font-size: var(--fs-label);
  color: var(--text-muted);
}

.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label { font-size: var(--fs-label); color: var(--text-secondary); }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}

.segmented__item {
  min-height: var(--h-control-sm);
  padding: 0 var(--space-4);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: var(--weight-medium);
}

.segmented__item[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--h-control);
  color: var(--text-secondary);
  font-size: var(--fs-body);
}

.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ------------------------------------------------------------- plano -------- */
.plan-card {
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
}

.plan-card__title {
  font-size: var(--fs-section);
  color: var(--accent);
  letter-spacing: 0.08em;
}

.plan-card__price {
  margin: var(--space-2) 0 var(--space-4);
  font-size: 30px;
  font-weight: var(--weight-semibold);
}

.plan-card__price span { font-size: var(--fs-body); color: var(--text-muted); }

.plan-card__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

.plan-card__list li { padding-left: var(--space-4); position: relative; }
.plan-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.plan-card__note {
  margin-top: var(--space-3);
  font-size: var(--fs-label);
  color: var(--text-muted);
}

/* --------------------------------------------------------------- identidade - */
.identity {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}

.identity__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--fs-label);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.identity__row span { color: var(--text-secondary); }
.identity__row span[data-state="stale"] { color: var(--warning); }
.identity__row span[data-state="error"] { color: var(--danger); }
.identity__row span[data-state="ready"] { color: var(--buy); }

.account-drawer-section { margin-bottom: var(--space-4); }
.field-group__title { margin-bottom: var(--space-2) !important; font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.account-list { display: flex; flex-direction: column; gap: var(--space-2); }
.account-list__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--surface-raised); }
.account-list__info { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.account-list__info strong { overflow-wrap: anywhere; font-size: var(--fs-body); }
.account-list__info span { color: var(--text-muted); font-size: var(--fs-label); overflow-wrap: anywhere; }
.account-list__switch { flex: 0 0 auto; min-height: 40px; }
.account-form-details { margin-bottom: var(--space-4); }
.account-form-details > summary { display: inline-flex; list-style: none; }
.account-form-details > summary::-webkit-details-marker { display: none; }
.account-form { display: grid; gap: var(--space-3); margin-top: var(--space-3); padding: var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--surface-sunken); }
.account-form .btn { min-height: var(--h-control); }
.account-form .field-group__hint[data-state="ready"] { color: var(--buy); }
.account-form .field-group__hint[data-state="error"] { color: var(--danger); }

.symbol-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
.symbol-option { display: flex; align-items: center; width: 100%; min-height: var(--h-control); padding: 0 var(--space-3); border: 1px solid var(--border-subtle) !important; border-radius: var(--radius-control); background: var(--surface-raised) !important; font-family: var(--font-num) !important; text-align: left; }
.symbol-option:hover, .symbol-option:focus-visible { border-color: var(--accent) !important; background: var(--accent-soft) !important; }

/* -------------------------------------------------- notas desta etapa (P01) - */
.dev-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--h-mobilenav) + var(--safe-bottom) + var(--space-2));
  z-index: var(--z-development-note);
  transform: translateX(-50%);
  max-width: min(720px, calc(100vw - 24px));
  padding: var(--space-2) var(--space-4);
  background: rgb(20 22 25 / 94%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.dev-banner strong { color: var(--warning); font-weight: var(--weight-semibold); }

.dev-note {
  padding: var(--space-3);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-control);
  font-size: var(--fs-label);
  line-height: 1.6;
  color: var(--text-muted);
}

/* Botao ainda nao conectado: marca a pendencia em vez de fingir sucesso.
   O JS aplica data-dev-state="pendente" e um title explicando a etapa. */
#oracle-dashboard-root [data-dev-state="pendente"] {
  border-style: dashed;
}

#oracle-dashboard-root [data-dev-state="pendente"]::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-radius: 50%;
  border: 1px solid var(--warning);
}

/* ------------------------------------------------------------ avaliação P05 - */
.evaluation-dialog {
  width: min(760px, calc(100vw - 24px));
  max-width: none;
  max-height: min(760px, calc(var(--usable-vh, 100dvh) - 24px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--text-primary);
  background: var(--surface-panel);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-dialog);
}

.evaluation-dialog::backdrop {
  background: rgb(4 5 6 / 78%);
  backdrop-filter: blur(3px);
}

.evaluation-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(760px, calc(var(--usable-vh, 100dvh) - 24px));
}

.evaluation-header,
.evaluation-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.evaluation-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.evaluation-title {
  margin-top: var(--space-1) !important;
  font-size: var(--fs-section);
  line-height: var(--lh-section);
}

.evaluation-context {
  margin-top: var(--space-1) !important;
  color: var(--text-muted);
  font-family: var(--font-num);
  font-size: var(--fs-label);
}

.evaluation-close {
  flex: 0 0 auto;
}

.evaluation-body {
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-5);
  overscroll-behavior: contain;
}

.evaluation-body > .status-pill {
  width: fit-content;
  max-width: 100%;
  margin-bottom: var(--space-4);
}

.evaluation-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-5) !important;
}

.evaluation-grid > div {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}

.evaluation-grid dt {
  color: var(--text-muted);
  font-size: var(--fs-label);
}

.evaluation-grid dd {
  margin-top: var(--space-1) !important;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: var(--weight-semibold);
}

.evaluation-analysis {
  padding: var(--space-4);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--surface-sunken);
}

.evaluation-analysis h3 {
  margin-bottom: var(--space-2) !important;
  color: var(--accent);
  font-size: var(--fs-label);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.evaluation-analysis p {
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.evaluation-analysis .evaluation-source {
  margin-top: var(--space-3) !important;
  color: var(--text-muted);
  font-size: var(--fs-label);
}

.evaluation-blockers {
  margin-top: var(--space-4) !important;
  padding: var(--space-3);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--warning);
  font-size: var(--fs-label);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.evaluation-pin {
  display: grid;
  gap: var(--space-2);
  max-width: 360px;
  margin-top: var(--space-4);
}

.evaluation-pin > span {
  color: var(--text-primary);
  font-size: var(--fs-label);
  font-weight: var(--weight-semibold);
}

.evaluation-pin input {
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
  color: var(--text-primary);
  font: inherit;
}

.evaluation-pin small {
  color: var(--text-muted);
  font-size: var(--fs-label);
  line-height: 1.45;
}

.evaluation-footer {
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-raised);
}

.evaluation-footer .btn {
  min-height: var(--h-dialog-footer);
}

.evaluation-confirm {
  min-width: 220px;
  margin-left: auto;
}

.evaluation-footer .btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}

/* Fallback para WebViews sem HTMLDialogElement: a folha continua modal,
   centralizada e rolável mesmo quando showModal()/::backdrop não existem. */
.evaluation-dialog.is-open {
  position: fixed;
  z-index: var(--z-dialog);
  inset: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: var(--space-2);
  overflow: hidden;
  background: rgb(4 5 6 / 78%);
  border: 0;
  border-radius: 0;
  backdrop-filter: blur(3px);
}

.evaluation-dialog.is-open .evaluation-layout {
  width: min(760px, calc(100vw - 16px));
  max-height: min(760px, calc(100vh - 16px));
  overflow: hidden;
  background: var(--surface-panel);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-dialog);
}

@media (max-width: 520px) {
  .evaluation-dialog.is-open {
    padding: var(--space-1);
  }

  .evaluation-dialog.is-open .evaluation-layout {
    width: calc(100vw - 8px);
    max-height: calc(100vh - 8px);
    border-radius: 16px;
  }
}

/* ==========================================================================
   Card de notícias — níveis de importância 1 a 3
   A importância vem calculada do servidor; aqui só a apresentação.
   ========================================================================== */
.news-panel { display: flex; flex-direction: column; gap: var(--space-3); }
.news-panel__head { align-items: flex-start; gap: var(--space-3); }
.news-panel__tools { display: flex; align-items: center; gap: var(--space-2); }
.panel__hint {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
}
.news-panel__body { display: flex; flex-direction: column; gap: var(--space-3); }
.news-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-label);
}
.news-panel__note {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.news-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}
.news-item[data-level="3"] { border-left: 3px solid var(--accent); }
.news-item[data-level="2"] { border-left: 3px solid var(--warning); }
.news-item[data-level="1"] { border-left: 3px solid var(--border-subtle); }
.news-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}
.news-item__level {
  flex: none;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}
.news-item__level[data-level="3"] { background: var(--accent-soft); color: var(--accent); }
.news-item__level[data-level="2"] { background: rgb(237 200 117 / 12%); color: var(--warning); }
.news-item__title {
  color: var(--text-primary);
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  line-height: var(--lh-body);
  text-decoration: none;
}
a.news-item__title:hover { color: var(--accent); text-decoration: underline; }
.news-item__meta { margin: 0; color: var(--text-muted); font-size: var(--fs-label); }
.news-item__sentiment {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 11px;
}
.news-item__sentiment[data-state="positive"] { color: var(--buy); }
.news-item__sentiment[data-state="negative"] { color: var(--sell); }
.news-item__summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
}
@media (max-width: 720px) {
  .news-panel__head { flex-direction: column; }
}
