/* =====================================================================================================
   Raio-X do arquivo fatiado (/raio-x) — F22. Arquivo PRÓPRIO, como o da calculadora pública: página anônima,
   SSR estático, mobile-first, sem o tema/chrome do app. Paleta Nord da marca escrita literal (mesmos tokens
   da calculadora-publica.css). Blocos 1-2 do protótipo docs/features/raio-x/prototipo-raio-x-gcode.html.
   ===================================================================================================== */
.raiox {
  --canvas: #222834; --surface: #2a313f; --surface2: #242b38; --border: #3b4252;
  --text: #d8dee9; --text-hi: #eceff4; --muted: #94a0b4;
  --accent: #f1880d; --accent-soft: rgba(241, 136, 13, .12); --accent-border: rgba(241, 136, 13, .35);
  --success: #a3be8c; --danger: #bf616a;
  --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  color: var(--text);
  line-height: 1.6;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}
body:has(.raiox) {
  margin: 0;
  background: #222834;
  background-image:
    radial-gradient(circle at 50% 56%, rgba(59, 66, 82, .55) 0 2px, transparent 2.6px),
    radial-gradient(circle at 50% 46%, rgba(0, 0, 0, .28) 0 1.8px, transparent 2.4px);
  background-size: 24px 24px;
}
.raiox * { box-sizing: border-box; }
.raiox h1, .raiox h3, .raiox p, .raiox ul { margin: 0; }
.raiox a { color: var(--accent); }
.raiox .wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.raiox [hidden] { display: none !important; }

/* ---- cabeçalho ---- */
.raiox header.top { border-bottom: 1px solid var(--border); background: rgba(34, 40, 52, .9); backdrop-filter: blur(8px); padding: 16px 0; }
.raiox .top-in { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.raiox .top h1 { font-size: 22px; color: var(--text-hi); letter-spacing: -.3px; }
.raiox .top .sub { font-size: 13.5px; color: var(--muted); }
.raiox main { padding: 22px 0 60px; }

/* ---- painéis e tags ---- */
.raiox .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 18px; margin-bottom: 16px; }
.raiox .panel > h3 { font-size: 15px; color: var(--text-hi); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.raiox .hint { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.raiox .num { font: 600 11px var(--mono); color: var(--accent); border: 1px solid var(--accent-border); background: var(--accent-soft); border-radius: 5px; width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.raiox .tag { font: 600 10px var(--mono); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; background: var(--surface2); }
.raiox .tag.lido { color: var(--success); border-color: rgba(163, 190, 140, .4); background: rgba(163, 190, 140, .10); }
.raiox .btn { border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 8px; font: 600 13px inherit; padding: 9px 16px; cursor: pointer; display: inline-block; text-align: center; text-decoration: none; }
.raiox .btn:hover { border-color: var(--accent-border); color: var(--text-hi); }
.raiox .btn.acc { background: var(--accent); border-color: var(--accent); color: #231905; }
.raiox .btn.acc:hover { color: #231905; }
.raiox .btn.sm { font-size: 12px; padding: 5px 10px; }
.raiox .btn:disabled { opacity: .5; cursor: default; }

/* ---- entrada: dropzone ---- */
.raiox .drop {
  border: 2px dashed var(--border); border-radius: 14px; padding: 38px 20px; text-align: center; cursor: pointer;
  background: var(--surface); transition: border-color .15s, background .15s;
}
.raiox .drop:hover, .raiox .drop.sobre { border-color: var(--accent); background: var(--accent-soft); }
.raiox .drop .t { font-size: 17px; color: var(--text-hi); font-weight: 600; }
.raiox .drop .s { font-size: 13px; color: var(--muted); margin-top: 6px; }
.raiox .drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.raiox .drop .ext { display: inline-flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.raiox .drop .ext span { font: 600 11px var(--mono); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; color: var(--text); background: var(--canvas); }
.raiox .privacidade { font-size: 12.5px; color: var(--muted); margin-top: 12px; text-align: center; }
.raiox .privacidade b { color: var(--text); }

/* ---- progresso ---- */
.raiox .progresso { margin-top: 14px; }
.raiox .progresso .barra { height: 8px; border-radius: 6px; background: var(--canvas); border: 1px solid var(--border); overflow: hidden; }
.raiox .progresso .barra i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.raiox .progresso .l { font: 12px var(--mono); color: var(--muted); margin-top: 6px; }

/* ---- aviso ---- */
.raiox .aviso { border-left: 3px solid var(--danger); background: rgba(191, 97, 106, .10); border-radius: 0 10px 10px 0; padding: 12px 14px; margin-top: 14px; font-size: 13.5px; }
.raiox .aviso b { color: var(--text-hi); }

/* ---- barra do arquivo lido ---- */
.raiox .arquivo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.raiox .arquivo .nome { font: 600 13px var(--mono); color: var(--text-hi); word-break: break-all; }
.raiox .arquivo .outro { margin-left: auto; }

/* ---- 1. O QUE VOCÊ USOU (chips) ---- */
.raiox .chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 9px; }
.raiox .chip { background: var(--canvas); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; }
.raiox .chip .k { font: 600 9.5px var(--mono); letter-spacing: .9px; text-transform: uppercase; color: var(--muted); }
.raiox .chip .v { font: 600 14px var(--mono); color: var(--text-hi); margin-top: 2px; word-break: break-word; }
.raiox .chip.alerta { border-color: var(--accent-border); background: var(--accent-soft); }
.raiox .chip.alerta .v { color: var(--accent); }

/* ---- 2. PLACAS E FILAMENTOS (tabela) ---- */
.raiox .tabela-wrap { overflow-x: auto; }
.raiox table.placas { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.raiox table.placas th { font: 600 9.5px var(--mono); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); text-align: right; padding: 6px 5px; border-bottom: 1px solid var(--border); }
.raiox table.placas th:first-child, .raiox table.placas th:nth-child(2) { text-align: left; }
.raiox table.placas td { padding: 8px 5px; border-bottom: 1px dashed var(--border); text-align: right; font-family: var(--mono); color: var(--text-hi); white-space: nowrap; }
.raiox table.placas td:first-child, .raiox table.placas td:nth-child(2) { text-align: left; font-family: inherit; color: var(--text); white-space: normal; }
.raiox table.placas td .faixa { display: block; font: 11px var(--mono); color: var(--muted); }
.raiox table.placas tr.total td { border-bottom: none; border-top: 1px solid var(--border); padding-top: 11px; font-weight: 700; color: var(--text-hi); }
.raiox table.placas tr.total td:first-child { font-weight: 600; }
.raiox .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; border: 1px solid rgba(255, 255, 255, .18); }
.raiox .cores { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.raiox .cores span { display: inline-flex; align-items: center; font: 12.5px var(--mono); color: var(--text); background: var(--canvas); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; }
.raiox .exato { border-left: 2px solid var(--accent-border); padding-left: 11px; margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.raiox .exato b { color: var(--text); }

/* ---- ponte para a calculadora ---- */
.raiox .ponte { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.raiox .ponte p { font-size: 13px; color: var(--muted); flex: 1 1 260px; }
.raiox .rodape { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 24px; }

/* =====================================================================================================
   FASE 2 — blocos 3-5 do protótipo: "para onde foi" (barra + tabela g/min/R$), achados marcáveis e
   "quanto vale por mês". As cores das fatias seguem o protótipo: a peça é neutra DE PROPÓSITO — o olho tem
   que cair no desperdício (suporte, purga), não no que é inevitável.
   ===================================================================================================== */
.raiox { --info: #81a1c1; --c-paredes: #81a1c1; --c-preenchimento: #5e81ac; --c-superficies: #88c0d0;
  --c-suporte: #bf616a; --c-aderencia: #b48ead; --c-purga: #f1880d; --c-outros: #4c566a; }
.raiox .tag.estimativa { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.raiox .tag.exata { color: var(--success); border-color: rgba(163, 190, 140, .4); background: rgba(163, 190, 140, .10); }

/* ---- progresso e aviso da fase 2 (o Worker está lendo o corpo do arquivo) ---- */
.raiox .f2progresso { display: flex; align-items: center; gap: 10px; font: 12px var(--mono); color: var(--muted); margin: 4px 0 14px; }
.raiox .f2progresso .barra { flex: 1; height: 6px; border-radius: 6px; background: var(--canvas); border: 1px solid var(--border); overflow: hidden; }
.raiox .f2progresso .barra i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.raiox .f2aviso { border-left: 3px solid var(--border); background: var(--surface2); border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.raiox .f2aviso b { color: var(--text); }
.raiox .f2aviso code { font: 12px var(--mono); color: var(--text-hi); }

/* ---- custos editáveis (preço do kg, custo-hora, peças/mês) ---- */
.raiox .custos { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.raiox .campo { flex: 1; min-width: 132px; }
.raiox .campo label { display: block; font: 600 10.5px var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.raiox .campo input { width: 100%; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; color: var(--text-hi); font: 14px var(--mono); padding: 8px 10px; }
.raiox .campo input:focus { outline: none; border-color: var(--accent); }
/* #268: o preço do kg sai calculado de "paguei R$ X por Y g". */
.raiox .kg-calc { margin: -8px 0 14px; font-size: 12.5px; color: var(--muted); }
.raiox .kg-calc:empty { display: none; }
.raiox .kg-calc b { font-family: var(--mono); color: var(--text-hi); }
.raiox .kg-calc b.alerta { color: var(--accent); }

/* ---- barra proporcional + legenda ---- */
.raiox .barra-partes { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 4px; }
.raiox .barra-partes div { position: relative; transition: width .25s; min-width: 0; }
.raiox .barra-partes div span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px var(--mono); color: rgba(0, 0, 0, .62); }
.raiox .legenda { display: flex; flex-wrap: wrap; gap: 13px; margin: 10px 0 14px; font-size: 12px; color: var(--muted); }
.raiox .legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---- tabela "para onde foi" ---- */
.raiox table.partes { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.raiox table.partes th { font: 600 9.5px var(--mono); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); text-align: right; padding: 6px 5px; border-bottom: 1px solid var(--border); }
.raiox table.partes th:first-child { text-align: left; }
.raiox table.partes td { padding: 8px 5px; border-bottom: 1px dashed var(--border); text-align: right; font-family: var(--mono); color: var(--text-hi); white-space: nowrap; vertical-align: top; }
.raiox table.partes td:first-child { text-align: left; font-family: inherit; color: var(--text); white-space: normal; }
.raiox table.partes td .faixa { display: block; font: 11px var(--mono); color: var(--muted); }
.raiox table.partes td .faixa.ok { color: var(--success); }
.raiox table.partes tr.total td { border-bottom: none; border-top: 1px solid var(--border); padding-top: 11px; font-weight: 700; color: var(--text-hi); }
.raiox table.partes tr.total td:first-child { font-weight: 600; }
.raiox table.partes .sw { width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; border: none; }
.raiox details.placa-partes { margin-top: 12px; border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; }
.raiox details.placa-partes summary { cursor: pointer; font-size: 13px; color: var(--text); }
.raiox details.placa-partes summary b { font-family: var(--mono); color: var(--text-hi); }
.raiox details.placa-partes table.partes { margin-top: 8px; font-size: 12.5px; }

/* ---- achados ---- */
.raiox .achado { background: var(--canvas); border: 1px solid var(--border); border-left-width: 3px; border-radius: 10px; padding: 13px 15px; margin-bottom: 10px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.raiox .achado.alto { border-left-color: var(--danger); }
.raiox .achado.medio { border-left-color: var(--accent); }
.raiox .achado.nota { border-left-color: var(--info); }
.raiox .achado .marca { padding-top: 2px; }
.raiox .achado input[type=checkbox] { appearance: none; width: 19px; height: 19px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface2); cursor: pointer; display: grid; place-items: center; flex: none; margin: 0; }
.raiox .achado input[type=checkbox]:checked { border-color: var(--accent); background: var(--accent-soft); }
.raiox .achado input[type=checkbox]:checked::after { content: "\2713"; font: 700 12px var(--mono); color: var(--accent); }
.raiox .achado .t { font-size: 14px; color: var(--text-hi); font-weight: 650; margin-bottom: 3px; }
.raiox .achado .ev { font: 12.5px var(--mono); color: var(--accent); margin-bottom: 6px; }
.raiox .achado.nota .ev { color: var(--info); }
.raiox .achado p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.raiox .achado .ganho { text-align: right; white-space: nowrap; }
.raiox .achado .ganho .g { font: 700 15px var(--mono); color: var(--success); }
.raiox .achado .ganho .d { font: 11px var(--mono); color: var(--muted); }
.raiox .achado .ganho .na { font: 11.5px var(--mono); color: var(--muted); font-style: italic; }
@media (max-width: 720px) {
  .raiox .achado { grid-template-columns: 26px minmax(0, 1fr); }
  .raiox .achado .ganho { grid-column: 2; text-align: left; margin-top: 4px; }
}
.raiox .naofaz { border: 1px dashed var(--border); border-radius: 10px; padding: 13px 15px; margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.62; }
.raiox .naofaz b { color: var(--text); display: block; margin-bottom: 5px; font-size: 13px; }
.raiox .naofaz ul { margin: 0; padding-left: 17px; }
.raiox .naofaz li { margin-bottom: 3px; }

/* ---- quanto vale por mês ---- */
.raiox .valor { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 12px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.raiox .valor .l { font-size: 13px; color: var(--text); }
.raiox .valor .l small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.raiox .valor .v { font: 800 30px var(--mono); color: var(--accent); white-space: nowrap; }
.raiox .valor .v small { display: block; font: 600 11.5px var(--mono); color: var(--muted); text-align: right; }
.raiox .cta-lista { list-style: none; padding: 0; margin: 8px 0 12px; flex-basis: 100%; }
.raiox .cta-lista li { font-size: 12.5px; color: var(--muted); padding: 3px 0 3px 19px; position: relative; }
.raiox .cta-lista li::before { content: "\2713"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.raiox .ponte .t { color: var(--text-hi); font-weight: 650; font-size: 15px; flex-basis: 100%; }

/* ---- Canal de WhatsApp comercial (#270 — BotaoWhatsApp) ----
   O bloco .wa-* mora no app.css (carregado em toda página pelo App.razor). Aqui só a cor: o ".raiox a" acima
   é mais específico e pintaria os links de laranja. MESMO acerto na calculadora-publica.css — mexeu num, mexa no outro. */
.raiox a.wa-btn { color: #d9fbe6; }
.raiox a.wa-btn:hover { color: #fff; }
.raiox a.wa-link { color: #9ee6b9; }
.raiox a.wa-link:hover { color: #d9fbe6; }
.raiox a.wa-flutuante, .raiox a.wa-flutuante:hover { color: #0b2e17; }
