/* ==========================================================================
   Cofre de Prata — sistema visual
   Conceito: um "livro-caixa" de mercador. Escuro por padrão (gamers), prata
   como identidade, ouro reservado para marca, destaque e ação principal.
   Layout: barra lateral (desktop) · ícones (tablet) · barra inferior (celular).
   ========================================================================== */

:root {
  /* tema escuro (padrão) */
  --bg: #0a0e14;
  --bg-glow-1: rgba(120, 150, 190, .10);
  --bg-glow-2: rgba(228, 185, 91, .05);
  --surface: #10161f;
  --surface-2: #151d28;
  --surface-3: #1c2633;
  --raise: #1a2330;
  --line: #243040;
  --line-soft: #1a2430;
  --fg: #e8edf3;
  --fg-2: #b4bfcd;
  --muted: #7d8a9c;
  --silver: #c7d1dc;
  --silver-2: #8e9bab;
  --gold: #e6bc5e;
  --gold-2: #c1913a;
  --gold-ink: #1b1406;
  --accent: #7fb3ff;
  --accent-soft: rgba(127, 179, 255, .14);
  --good: #41d192;
  --good-soft: rgba(65, 209, 146, .13);
  --bad: #ff6f66;
  --bad-soft: rgba(255, 111, 102, .13);
  --warn: #f2b24c;
  --warn-soft: rgba(242, 178, 76, .14);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, .5);
  --skel-a: #151d28;
  --skel-b: #1f2a38;
  --overlay: rgba(4, 7, 11, .62);

  /* cidades (cores de identidade do jogo) */
  --c-caerleon: #e0524a;
  --c-bridgewatch: #e3963a;
  --c-fortsterling: #d9e2ec;
  --c-lymhurst: #6cc05a;
  --c-martlock: #5c95e6;
  --c-thetford: #a877dc;
  --c-brecilien: #45c2b3;
  --c-blackmarket: #8a8f99;

  /* tiers e encantamentos (cores do jogo) */
  --t1: #8d8d8d; --t2: #8d8d8d; --t3: #6fae59; --t4: #4f8fe0; --t5: #d9463f;
  --t6: #e0822e; --t7: #e6c53c; --t8: #eef1f4;
  --e1: #4ccf7a; --e2: #4aa6ff; --e3: #b06cff; --e4: #f0c44a;

  --f-brand: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --r-lg: 16px;
  --r: 12px;
  --r-sm: 8px;
  --side-w: 248px;
  --top-h: 64px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1f5;
  --bg-glow-1: rgba(80, 120, 180, .10);
  --bg-glow-2: rgba(200, 150, 50, .07);
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #ebeff4;
  --raise: #ffffff;
  --line: #d9e0e9;
  --line-soft: #e7ecf2;
  --fg: #111821;
  --fg-2: #3a4656;
  --muted: #637083;
  --silver: #4e5b6c;
  --silver-2: #7a8697;
  --gold: #a9791b;
  --gold-2: #8a6114;
  --gold-ink: #ffffff;
  --accent: #2563c9;
  --accent-soft: rgba(37, 99, 201, .1);
  --good: #13885a;
  --good-soft: rgba(19, 136, 90, .1);
  --bad: #cc3a30;
  --bad-soft: rgba(204, 58, 48, .09);
  --warn: #b16f08;
  --warn-soft: rgba(177, 111, 8, .1);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-pop: 0 18px 50px rgba(16, 24, 40, .18);
  --skel-a: #eef1f5;
  --skel-b: #e2e7ee;
  --overlay: rgba(20, 28, 40, .38);
  --c-fortsterling: #8a9bb0;
  --t8: #9aa6b4;
  --t7: #c9a41e;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 12% -8%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, var(--bg-glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font: 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, .mono { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.xs { font-size: .74rem; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.gold { color: var(--gold); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 24px; height: 24px; }

/* ---------- barra de progresso global ---------- */
.netbar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .25s; }
.netbar.on { opacity: 1; }
.netbar::before {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold), var(--silver), transparent);
  animation: netbar 1.1s ease-in-out infinite;
}
@keyframes netbar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, transparent));
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand svg { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .35)); }
.brand b { display: block; font: 700 1.08rem/1.1 var(--f-brand); letter-spacing: .08em; }
.brand small { display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: grid; gap: 2px; }
.nav-sec { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--fg-2); font-weight: 600; font-size: .93rem; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--fg); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--gold), var(--gold-2));
}
.nav a[aria-current="page"] .ico { color: var(--gold); }
.side-foot { margin-top: auto; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-soft); font-size: .78rem; color: var(--muted); }
.side-foot b { color: var(--fg-2); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: 1px; }
.dot.live { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.off { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

.maincol { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .brand { display: none; padding: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.gsearch { position: relative; flex: 1 1 420px; max-width: 520px; }
.gsearch .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gsearch input { width: 100%; padding-left: 40px; padding-right: 54px; height: 40px; background: var(--surface-2); }
.gsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font: 600 .7rem var(--f-num); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; background: var(--surface); }

.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 28px 80px; display: grid; gap: 22px; }
.foot { max-width: 1320px; margin: 0 auto; width: 100%; padding: 0 28px 40px; color: var(--muted); font-size: .8rem; display: flex; gap: 8px 22px; flex-wrap: wrap; }

.bnav { display: none; }

/* ---------- cabeçalho de página ---------- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.phead h1 { font: 700 clamp(1.5rem, 1.2rem + 1.2vw, 2.05rem)/1.1 var(--f-brand); letter-spacing: .03em; }
.phead .eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.phead p { color: var(--fg-2); max-width: 66ch; margin-top: 8px; }
.phead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stamp { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-b { padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); flex-wrap: nowrap; }
.card-h > div:first-child { min-width: 0; flex: 1 1 200px; }
.card-h > .btn, .card-h > a.btn { flex: none; }
.card-h h2, .card-h h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-h .sub { font-size: .8rem; color: var(--muted); font-weight: 500; margin-top: 2px; }
.card-h .ico { color: var(--silver-2); }
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stick { position: sticky; top: calc(var(--top-h) + 16px); }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }

/* ---------- KPIs ---------- */
.kpi { padding: 18px 20px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.kpi .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .val { font: 600 1.7rem/1.15 var(--f-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .val.gold { color: var(--gold); }
.kpi .meta { font-size: .8rem; color: var(--muted); }
.kpi .spark { margin-top: 6px; height: 42px; }
.kpi.feature { background: linear-gradient(145deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 55%); border-color: color-mix(in srgb, var(--gold) 22%, var(--line-soft)); }

/* ---------- controles ---------- */
input[type=text], input[type=search], input[type=number], input[type=tel], input[type=password], input[type=email], select {
  font: inherit; font-size: .93rem; color: var(--fg); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); height: 40px; padding: 0 12px; min-width: 0; width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=number] { font-family: var(--f-num); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input::placeholder { color: var(--muted); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .lbl-s { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: .75rem; color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 16px 18px; align-items: flex-end; }
.controls .field { flex: 0 1 auto; }
.controls .grow { flex: 1 1 260px; }
.w-sm { width: 110px; }
.w-md { width: 170px; }

.btn {
  --bb: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--bb);
  background: var(--surface-2); color: var(--fg); font: 600 .9rem var(--f-body); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 92%, #fff), var(--gold-2));
  border-color: var(--gold-2); color: var(--gold-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--gold) 22%, transparent);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--fg); }
.btn.icon { width: 40px; padding: 0; }
.btn.sm { height: 32px; padding: 0 12px; font-size: .82rem; }
.btn.icon.sm { width: 32px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.busy { pointer-events: none; }
.btn.busy .ico { animation: spin .8s linear infinite; }
.star.on { color: var(--gold); }
.star.on .ico { fill: var(--gold); }

/* controle segmentado (tiers, encantamentos, opções) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button {
  border: 0; background: transparent; color: var(--fg-2); font: 600 .84rem var(--f-body); height: 30px; padding: 0 11px;
  border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--fg); background: var(--surface-3); }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--fg); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 8px rgba(0,0,0,.22), 0 0 0 1px var(--line); }
.seg.tiers button[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--line), inset 0 -2px 0 var(--tc, var(--gold)); }
.seg button[disabled] { opacity: .35; pointer-events: none; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: .88rem; font-weight: 600; color: var(--fg-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--silver-2); transition: transform .2s, background .2s; }
.switch input:checked + .tr { background: color-mix(in srgb, var(--gold) 30%, var(--surface-3)); border-color: var(--gold-2); }
.switch input:checked + .tr::after { transform: translateX(16px); background: var(--gold); }
.switch input:focus-visible + .tr { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- selos ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; border: 1px solid var(--line); color: var(--fg-2); background: var(--surface-2); white-space: nowrap; }
.chip.fresh { color: var(--good); background: var(--good-soft); border-color: transparent; }
.chip.ok { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip.old { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.chip.risk { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.chip.gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); border-color: transparent; }
.chip.acc { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.city { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.city::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--cc, var(--muted)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cc, var(--muted)) 22%, transparent); flex: none; }

.tb { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 5px; font: 700 .7rem/1 var(--f-num);
  color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 38%, transparent); }
.tb i { font-style: normal; color: var(--ec, inherit); }

/* ---------- item (ícone + nome) ---------- */
.item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item .ic { width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--surface-3); position: relative; overflow: hidden; }
.item .ic img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; }
.item .ic img.ok { opacity: 1; }
.item .ic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-soft); pointer-events: none; }
.item .nm { min-width: 0; display: grid; gap: 2px; }
.item .nm b { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.item .nm b > span { overflow: hidden; text-overflow: ellipsis; }
.item .nm small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.lg .ic { width: 72px; height: 72px; border-radius: 14px; }
.item.lg .nm b { font-size: 1.25rem; font-family: var(--f-body); font-weight: 700; white-space: normal; }
.item.sm .ic { width: 32px; height: 32px; border-radius: 8px; }

/* ---------- tabelas ---------- */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.t th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.t th.n, .t td.n { text-align: right; }
.t th.sortable { cursor: pointer; }
.t th.sortable:hover { color: var(--fg); }
.t th .ar { display: inline-block; width: 10px; opacity: .3; }
.t th[aria-sort] .ar { opacity: 1; color: var(--gold); }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
.t td.n { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover { background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.top1 td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.t .sub { display: block; font-size: .74rem; color: var(--muted); font-family: var(--f-body); margin-top: 2px; }
.t td .item { min-width: 230px; }
.t td.wrap { white-space: normal; min-width: 200px; max-width: 280px; line-height: 1.35; }
.t tr.detail td { white-space: normal; background: var(--surface-2); }
.more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line-soft); }
.tfoot-note { padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: .78rem; color: var(--muted); }

/* ---------- listas de oportunidade ---------- */
.olist { list-style: none; margin: 0; padding: 6px; display: grid; }
.olist a, .olist .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--fg); }
.olist a:hover { background: var(--surface-2); text-decoration: none; }
.olist .val { text-align: right; font-family: var(--f-num); font-weight: 600; font-variant-numeric: tabular-nums; }
.olist .val small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.rank { counter-reset: r; }

/* ---------- carregamento ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; flex: none; }
.skel { border-radius: 6px; background: linear-gradient(90deg, var(--skel-a) 0, var(--skel-b) 120px, var(--skel-a) 240px) var(--skel-a); background-size: 800px 100%; animation: shimmer 1.3s linear infinite; }
.skel-row { display: grid; grid-template-columns: 42px 1fr 90px; gap: 12px; align-items: center; padding: 10px 12px; }
.skel-row .a { height: 42px; border-radius: 10px; }
.skel-row .b { height: 12px; }
.skel-row .b + .b { width: 60%; margin-top: 8px; }
.skel-row .c { height: 14px; }
.loadmsg { display: flex; align-items: center; gap: 12px; padding: 14px 20px; font-size: .86rem; color: var(--fg-2); }
.loadmsg .bar { flex: 1; max-width: 220px; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.loadmsg .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: inherit; transition: width .3s; }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty .ico { width: 32px; height: 32px; color: var(--silver-2); opacity: .7; }
.empty b { color: var(--fg-2); font-size: .95rem; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; color: var(--fg-2); }
.notice .ico { margin-top: 1px; }
.notice.err { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); color: var(--fg); }
.notice.err .ico { color: var(--bad); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); color: var(--fg); }
.notice.warn .ico { color: var(--warn); }

/* ---------- seletor de item (autocomplete) ---------- */
.picker { position: relative; }
.picker .ico.lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.picker input { padding-left: 40px; height: 46px; font-size: 1rem; }
.pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: min(420px, 60vh); overflow-y: auto;
  background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px;
}
.pop .opt { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pop .opt[aria-selected="true"], .pop .opt:hover { background: var(--surface-3); }
.pop .opt img { width: 36px; height: 36px; flex: none; }
.pop .opt .nm { min-width: 0; flex: 1; }
.pop .opt .nm b { display: block; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .opt .nm small { color: var(--muted); font-size: .74rem; }
.pop .none { padding: 16px; color: var(--muted); font-size: .88rem; text-align: center; }
.pop .grp { padding: 8px 10px 4px; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pop mark { background: none; color: var(--gold); font-weight: 700; }

/* ---------- gráficos ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { fill: var(--muted); font: 11px var(--f-num); }
.chart .grid-l { stroke: var(--line-soft); }
.chart .tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: var(--raise); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: .8rem; transform: translate(-50%, -100%); opacity: 0; transition: opacity .12s;
}
.chart .tip.on { opacity: 1; }
.chart .tip .d { color: var(--muted); font-size: .72rem; margin-bottom: 4px; }
.chart .tip .r { display: flex; justify-content: space-between; gap: 14px; font-family: var(--f-num); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend button { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: 600 .8rem var(--f-body); cursor: pointer; }
.legend button i { width: 10px; height: 10px; border-radius: 3px; background: var(--cc); opacity: .35; }
.legend button[aria-pressed="true"] { color: var(--fg); border-color: color-mix(in srgb, var(--cc) 55%, var(--line)); background: color-mix(in srgb, var(--cc) 10%, var(--surface-2)); }
.legend button[aria-pressed="true"] i { opacity: 1; }

/* barras de preço por cidade */
.cbars { display: grid; gap: 4px; padding: 8px 12px 14px; }
.cbar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 128px 128px; gap: 16px; align-items: center; padding: 9px 8px; border-radius: 10px; }
.cbar:hover { background: var(--surface-2); }
.cbar.best { background: color-mix(in srgb, var(--good) 8%, transparent); }
.cbar .track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); }
.cbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 55%, transparent), var(--cc)); transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.cbar .mk { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--fg); opacity: .8; transform: translateX(-1px); }
.cbar .v { text-align: right; font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 600; }
.cbar .v small { display: block; font-family: var(--f-body); font-weight: 500; font-size: .72rem; color: var(--muted); }
.cbar.head { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-block: 4px; }
.cbar.head:hover { background: none; }

/* resumo com 3–4 números */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.facts > div { padding: 16px 20px; display: grid; gap: 3px; border-right: 1px solid var(--line-soft); min-width: 0; }
.facts > div:last-child { border-right: 0; }
.facts .lbl { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts .v { font: 600 1.2rem var(--f-num); font-variant-numeric: tabular-nums; }
.facts .m { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- lista chave/valor ---------- */
dl.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; margin: 0; font-size: .9rem; }
dl.kv dt { color: var(--fg-2); min-width: 0; }
dl.kv dd { margin: 0; text-align: right; font-family: var(--f-num); font-variant-numeric: tabular-nums; }
dl.kv .hr { grid-column: 1 / -1; height: 1px; background: var(--line-soft); }
dl.kv .tot dt, dl.kv .tot dd { font-weight: 700; color: var(--fg); }

.bigv { font: 700 clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem)/1.05 var(--f-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* canais de venda (craft) */
.channels { display: grid; gap: 8px; }
.chan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--surface-2); }
.chan.best { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 7%, var(--surface-2)); }
.chan .n { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chan .p { text-align: right; font: 700 1.05rem var(--f-num); }
.chan .m { font-size: .78rem; color: var(--muted); }
.chan .r { text-align: right; font-size: .78rem; color: var(--muted); font-family: var(--f-num); }

/* materiais editáveis */
.mats { display: grid; gap: 8px; }
.mat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 140px); grid-template-areas: "item sub" "sel inp"; gap: 10px 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-soft); }
.mat .item { grid-area: item; }
.mat select { grid-area: sel; }
.mat input { grid-area: inp; }
.mat .sub { grid-area: sub; }
.mat .item .nm b, .mat .item .nm small { white-space: normal; }
.mat input, .mat select { height: 36px; font-size: .86rem; }
.mat .sub { text-align: right; font-family: var(--f-num); font-weight: 600; }
.mat .sub small { display: block; font-family: var(--f-body); color: var(--muted); font-weight: 500; font-size: .72rem; }
.mat.edited input { border-color: var(--gold-2); }

/* rota */
.route { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route .arrow { color: var(--muted); }

/* barras simples (jogadores) */
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: 140px minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: .86rem; }
.hb .track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.hb .fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--silver-2), var(--silver)); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.hb .v { text-align: right; font-family: var(--f-num); }

/* perfil */
.avatar { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font: 700 1.6rem var(--f-brand); color: var(--gold-ink); background: linear-gradient(145deg, var(--gold), var(--gold-2)); flex: none; }
.profile { display: flex; gap: 16px; align-items: center; }
.profile h2 { font: 700 1.4rem var(--f-body); }

/* cidades */
.citycard { overflow: hidden; }
.citycard .banner { height: 6px; background: linear-gradient(90deg, var(--cc), color-mix(in srgb, var(--cc) 30%, transparent)); }
.citycard h3 { font: 700 1.15rem var(--f-brand); letter-spacing: .04em; }
.citycard ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.citycard li { font-size: .78rem; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--fg-2); }
.heat td.cell { text-align: right; font-family: var(--f-num); font-variant-numeric: tabular-nums; position: relative; }
.heat td.cell span { position: relative; z-index: 1; }

/* guia */
.guide h2 { font: 700 1.15rem var(--f-body); }
.guide ol, .guide ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--fg-2); }
.guide p { color: var(--fg-2); }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.meter i.on { background: var(--mc, var(--gold)); }

/* ---------- toasts, modal, folha ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--raise); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: .88rem; animation: tin .25s ease-out; }
.toast.err { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.toast.err .ico { color: var(--bad); }
.toast.ok .ico { color: var(--good); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--overlay); backdrop-filter: blur(3px); animation: fade .18s; }
.modal .box { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.modal .box .card-h { position: sticky; top: 0; background: var(--surface); z-index: 1; }
@keyframes fade { from { opacity: 0; } }

.sheet { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: flex; align-items: flex-end; animation: fade .18s; }
.sheet .box { width: 100%; background: var(--surface); border-radius: 20px 20px 0 0; border: 1px solid var(--line); padding: 10px 14px calc(18px + env(safe-area-inset-bottom, 0px)); animation: up .22s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }

.msearch { position: fixed; inset: 0; z-index: 75; background: var(--bg); padding: 14px 16px; display: grid; align-content: start; gap: 12px; }
.msearch .pop { position: static; max-height: none; box-shadow: none; border: 0; background: none; padding: 0; }

/* ---------- animação de entrada ---------- */
.reveal { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.flash { animation: flash .9s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--gold) 16%, transparent); } }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbar { grid-template-columns: 130px minmax(0, 1fr) 110px 110px; }
}
@media (max-width: 1120px) {
  :root { --side-w: 76px; }
  .side { padding: 16px 10px; align-items: center; }
  .side .brand { padding: 4px 0 16px; }
  .side .brand > div, .nav a span, .nav-sec, .side-foot { display: none; }
  .nav a { justify-content: center; padding: 12px; }
  .nav a[aria-current="page"]::before { left: -10px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .stick { position: static; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(2) { border-right: 0; }
  .facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 820px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .cbar { grid-template-columns: minmax(0, 1fr) 100px 100px; gap: 10px; }
  .cbar .track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) {
  :root { --top-h: 58px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { padding: 0 16px; gap: 8px; }
  .topbar .brand { display: flex; }
  .topbar .brand b { font-size: .98rem; }
  .topbar .brand small { display: none; }
  .topbar .brand svg { width: 32px; height: 32px; }
  .gsearch { display: none; }
  .top-actions .hide-m { display: none; }
  .page { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .foot { padding: 0 16px calc(90px + env(safe-area-inset-bottom, 0px)); }
  .card-b { padding: 16px; }
  .card-h { padding: 14px 16px; flex-wrap: wrap; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid { gap: 16px; }
  .kpi { padding: 14px 16px; }
  .kpi .val { font-size: 1.3rem; }
  .controls { gap: 14px; }
  .controls .field, .controls .grow { flex: 1 1 100%; }
  .controls .field.half { flex: 1 1 calc(50% - 7px); }
  .controls .btn { flex: 1 1 auto; }
  .controls .field > .btn { width: 100%; }
  .w-sm, .w-md { width: 100%; }
  .seg { display: flex; }
  .seg button { flex: 1 0 auto; }
  .hb { grid-template-columns: 100px minmax(0, 1fr) 70px; }
  .facts .v { font-size: 1.02rem; }
  .toasts { right: 16px; left: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: auto; }

  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-soft);
  }
  .bnav a, .bnav button { display: grid; justify-items: center; gap: 3px; padding: 7px 2px; border: 0; background: none; color: var(--muted); font: 600 .66rem var(--f-body); border-radius: 10px; cursor: pointer; }
  .bnav a[aria-current="page"] { color: var(--gold); }
  .bnav a:hover { text-decoration: none; }
  .sheet .nav a { justify-content: flex-start; }
  .sheet .nav a span { display: inline; }

  /* tabelas viram cartões */
  table.t.rt thead { display: none; }
  table.t.rt, .t.rt tbody, .t.rt tr, .t.rt td { display: block; }
  .t.rt tr { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .t.rt tbody tr:last-child { border-bottom: 0; }
  .t.rt td { padding: 0; border: 0; white-space: normal; text-align: left !important; min-width: 0; }
  .t.rt td[data-l]::before { content: attr(data-l); display: block; font: 700 .64rem var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .t.rt td.full { grid-column: 1 / -1; }
  .t.rt td.hide-m { display: none; }
  .t.rt td .item { min-width: 0; }
  .t.rt td.wrap { max-width: none; min-width: 0; }
  .t tr.top1 td:first-child { box-shadow: none; }
  .t.rt tr.top1 { box-shadow: inset 3px 0 0 var(--gold); }
  .tw { overflow-x: visible; }
  .tw.keep { overflow-x: auto; }
  .tw.keep table.t { min-width: 640px; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi .val { font-size: 1.12rem; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spinner, .btn.busy .ico { animation: spin 2s linear infinite !important; }
}

/* ---------- conta do usuário no topo ---------- */
.brand img { display: block; }
.side .brand .brand-full { width: 200px; height: auto; }
.side .brand .brand-mark { display: none; }
.topbar .brand img { height: 31px; width: auto; }
.umenu { position: relative; }
.uavatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--gold-2); background: linear-gradient(145deg, var(--gold), var(--gold-2)); color: var(--gold-ink); font: 700 1rem var(--f-brand); cursor: pointer; box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 22%, transparent); }
.udrop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; z-index: 60; display: grid; animation: rise .16s ease-out; }
.udrop .uhead { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; display: grid; gap: 2px; }
.udrop .uhead small { color: var(--muted); font-size: .76rem; }
.udrop a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--fg-2); font-weight: 600; font-size: .88rem; }
.udrop a:hover { background: var(--surface-3); color: var(--fg); text-decoration: none; }
.notice.renew { align-items: center; }
.notice.renew > div { flex: 1; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--fg); }
@media (max-width: 1120px) {
  .side .brand .brand-full { display: none; }
  .side .brand .brand-mark { display: block; }
}
@media (max-width: 720px) {
  .uavatar { width: 34px; height: 34px; }
}

/* ---------- ferramentas Pro ---------- */
.meter-bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.meter-bar.warn i { background: linear-gradient(90deg, var(--warn), var(--bad)); }
.route-steps { display: grid; gap: 22px; }
.rstep { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.rnum { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 800 1.05rem var(--f-brand); color: var(--gold-ink); background: linear-gradient(145deg, var(--gold), var(--gold-2)); }
.rbody { min-width: 0; display: grid; gap: 10px; }
.rbody h3 { font-size: 1.02rem; margin-top: 9px; }
.rcity { border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.rcity-h { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; }
.rlist { list-style: none; margin: 0; padding: 4px 6px; display: grid; }
.rlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 8px; }
.rlist li + li { border-top: 1px dashed var(--line-soft); }
.rlist li b { white-space: nowrap; }
.rlist .item { min-width: 0; }
.load-bar { height: 16px; border-radius: 8px; background: var(--surface-3); overflow: hidden; position: relative; }
.load-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--silver-2), var(--silver)); }
.load-bar i.money { background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.alert-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.alert-card:last-child { border-bottom: 0; }
.alert-card.hit { background: color-mix(in srgb, var(--good) 9%, transparent); box-shadow: inset 3px 0 0 var(--good); }
.alert-card.off { opacity: .55; }
.alert-card .cond { font-size: .86rem; color: var(--fg-2); }
.alert-card .now { font: 600 .95rem var(--f-num); }
.alert-card .acts { display: flex; gap: 6px; }
.dist { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 6px; max-width: 280px; }
.dist i { display: block; height: 100%; background: var(--accent); }
.radar-live { display: inline-flex; align-items: center; gap: 10px; }
.radar-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good-soft); animation: ping 1.6s infinite; }
.radar-dot.off { background: var(--muted); animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.isel-cur { align-self: end; min-width: 0; }
@media (max-width: 720px) {
  .rstep { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .rnum { width: 32px; height: 32px; font-size: .9rem; }
  .alert-card { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Fabricar ou vender ---------- */
.verdict { overflow: hidden; }
.verdict.fab { border-color: color-mix(in srgb, var(--good) 40%, var(--line-soft)); background: linear-gradient(160deg, color-mix(in srgb, var(--good) 9%, var(--surface)), var(--surface) 55%); }
.verdict.ing { border-color: color-mix(in srgb, var(--bad) 40%, var(--line-soft)); background: linear-gradient(160deg, color-mix(in srgb, var(--bad) 8%, var(--surface)), var(--surface) 55%); }
.verdict.tie { border-color: color-mix(in srgb, var(--warn) 40%, var(--line-soft)); }
.verdict-b { display: flex; justify-content: space-between; gap: 20px 32px; align-items: center; flex-wrap: wrap; }
.verdict-t { display: grid; gap: 8px; min-width: 0; flex: 1 1 360px; }
.verdict-t h2 { font: 700 clamp(1.3rem, 1.1rem + 1vw, 1.8rem)/1.15 var(--f-brand); }
.verdict-t p { color: var(--fg-2); max-width: 62ch; }
.verdict-t .chip { justify-self: start; }
.verdict-n { text-align: right; display: grid; gap: 4px; }
.vs { border-top: 1px solid var(--line-soft); display: grid; gap: 12px; }
.vs-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 120px; gap: 14px; align-items: center; font-size: .9rem; }
.vs-row b { text-align: right; }
.fb-list { display: grid; gap: 8px; }
.fb-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 120px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-soft); }
.fb-row input { height: 36px; font-size: .86rem; }
.fb-row input.edited { border-color: var(--gold-2); }
.fb-row .item .nm b, .fb-row .item .nm small { white-space: normal; }
.fb-val { text-align: right; font-family: var(--f-num); font-weight: 600; }
.fb-val small { display: block; font-family: var(--f-body); font-weight: 500; font-size: .72rem; color: var(--muted); }
.chain { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.chain-step { position: relative; display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--surface-2); }
.chain-step.best { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 8%, var(--surface-2)); }
.chain-step .chip { position: absolute; top: 12px; right: 12px; }
.chain-n { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 800 .85rem var(--f-brand); background: var(--surface-3); color: var(--fg-2); }
.chain-step.best .chain-n { background: linear-gradient(145deg, var(--gold), var(--gold-2)); color: var(--gold-ink); }
.chain-b { display: grid; gap: 4px; min-width: 0; }
.chain-b small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.chain-v b { font: 700 1.25rem var(--f-num); }
.chain-v small { display: block; font-size: .76rem; font-family: var(--f-num); }
.chain-arrow { display: grid; place-items: center; color: var(--muted); }
@media (max-width: 900px) {
  .chain { grid-template-columns: minmax(0, 1fr); }
  .chain-arrow { transform: rotate(90deg); height: 18px; }
}
@media (max-width: 720px) {
  .verdict-n { text-align: left; }
  .vs-row { grid-template-columns: minmax(0, 1fr) 100px; }
  .vs-row .load-bar { grid-column: 1 / -1; grid-row: 2; }
  .fb-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .fb-row .item { grid-column: 1 / -1; }
}
