/* Calcula3D · identidade TRAXTER
   Navy profundo como base, âmbar só para ação e destaque (até ~10% da área).
   Layout: cabeçalho de marca, introdução curta e grade de duas colunas
   (peça + negócio à esquerda, resultados fixos à direita). No celular, a ordem é
   peça, resultados, negócio. */
:root {
  --bg: #05070D;
  --navy: #0B1428;
  --surface: #14213D;
  --surface-2: #1B2C50;
  --line: rgba(185, 200, 230, .16);
  --text: #EEF2FA;
  --muted: #B9C8E6;
  --soft: #8FA5D0;
  --amber: #FCA311;
  --amber-2: #FDB52F;
  --ok: #5FD3A3;
  --bad: #FF8A80;
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-body);
  overflow-x: hidden;
}
a { color: var(--amber-2); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
button, input { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: #05070D; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---- marca ---- */
.sym { display: inline-block; position: relative; width: 1em; height: 1em; flex: none; font-size: 30px; }
.sym i { position: absolute; background: #fff; display: block; }
.sym i:nth-child(1) { left: .14em; top: .11em; width: .72em; height: .20em; border-radius: .045em; }
.sym i:nth-child(2) { left: .40em; top: .36em; width: .20em; height: .28em; border-radius: .045em; }
.sym i:nth-child(3) { left: .40em; top: .69em; width: .20em; height: .20em; border-radius: 50%; background: var(--amber); }
.wm { display: inline-flex; align-items: baseline; font: 800 22px/1 var(--font-display); font-stretch: 110%; letter-spacing: -.03em; color: #fff; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; }
.tag { font: 500 13px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; }

/* ---- texto ---- */
.hero { padding-block: 20px 22px; max-width: 70ch; }
h1, h2, h3 { font-family: var(--font-display); font-stretch: 108%; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(28px, 5.2vw, 46px); line-height: 1.05; }
h2 { font-weight: 700; font-size: 21px; line-height: 1.2; }
h3 { font-weight: 700; font-size: 16px; margin: 20px 0 10px; color: var(--muted); }
.hero p { color: var(--muted); font-size: 17px; margin: 14px 0 0; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 16px; }
.lbl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.lbl.hot { color: var(--amber-2); }

/* ---- grade ---- */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: "peca res" "perfil res";
  gap: 20px;
  align-items: start;
}
.sec-peca { grid-area: peca; }
.sec-perfil { grid-area: perfil; }
.sec-res {
  grid-area: res;
  position: sticky; top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  display: grid; gap: 14px;
  padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: #263A5E transparent;
}
@media (max-width: 920px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "peca" "res" "perfil"; }
  .sec-res { position: static; max-height: none; overflow: visible; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.card + .card { margin-top: 0; }

/* ---- campos ---- */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; }
.field { min-width: 0; margin-bottom: 0; display: grid; gap: 4px; align-content: start; }
.sec-peca > .field { margin-bottom: 12px; }
.field > label { font-size: 13px; font-weight: 600; }
.inp { display: flex; align-items: center; background: var(--navy); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.inp:focus-within { border-color: var(--amber); }
.inp input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px; outline: none; }
.inp .u { padding: 0 10px; color: var(--soft); font: 500 13px var(--font-mono); white-space: nowrap; }
.inp .u:first-child { padding-right: 0; }
.inp input.inv, .inp:has(input.inv) { border-color: var(--bad); }
.inp.sm input { padding: 6px 8px; width: 7ch; }
.help { margin: 0; font-size: 12.5px; color: var(--soft); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--amber); }

/* ---- botões ---- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; }
.btn:hover { background: #243865; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #05070D; }
.btn.primary:hover { background: var(--amber-2); }
.btn.sm { padding: 5px 12px; min-height: 34px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- custo ---- */
.custo .total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0 8px; flex-wrap: wrap; }
.custo .total output { font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 6px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: middle; }
.tbl th { color: var(--muted); padding-right: 12px; }
.tbl td { text-align: right; white-space: nowrap; }
.tbl thead th { color: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
.tbl tr.sum th, .tbl tr.sum td { color: var(--text); font-weight: 600; }
.tbl.tiers td { text-align: left; }
.scroll { overflow-x: auto; margin-top: 12px; }

/* ---- canais ---- */
.canais { display: grid; gap: 14px; }
.canal h3 { margin: 0 0 12px; color: var(--text); font-size: 17px; }
.precos { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; align-items: end; }
.p-sug output { display: block; font-size: 34px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px; }
.p-min output { display: block; font-size: 18px; margin-top: 2px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0 12px; }
.stats div { background: var(--navy); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stats dt { font-size: 12px; color: var(--soft); }
.stats dd { margin: 2px 0 0; font-size: 16px; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.notes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.notes:empty { display: none; }
.notes li { background: rgba(252, 163, 17, .12); color: var(--amber-2); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.det { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.det summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.det[open] summary { margin-bottom: 10px; }
.det-foot { margin-top: 12px; }

/* ---- peças salvas ---- */
.salvas { margin-top: 20px; }
.salvas-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lista li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; background: var(--navy); border-radius: 10px; padding: 10px 12px; }
.lista li.vazio { color: var(--muted); }
.si { display: grid; min-width: 0; }
.si strong { overflow-wrap: anywhere; }
.si span { color: var(--muted); font-size: 13px; }
.sb { display: flex; gap: 8px; }

/* ---- rodapé e aviso ---- */
.foot { padding-block: 28px 56px; color: var(--soft); font-size: 13px; }
.foot p { margin: 0 0 8px; max-width: 90ch; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom, 0px)); background: var(--text); color: #05070D; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 40; max-width: min(92vw, 420px); }

@media (max-width: 480px) {
  .precos { grid-template-columns: 1fr; }
  .p-sug output { font-size: 30px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background .15s ease; }
}
