@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');
:root{--black:#0d0d0c;--coal:#171612;--gold:#c7962e;--gold-light:#edc66f;--cream:#f5f0e6;--paper:#fffdf8;--ink:#1b1a17;--muted:#6f6a60;--line:#ded5c4;--success:#2e7650;color-scheme:light}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-height:100vh;color:var(--ink);background:radial-gradient(circle at 12% 0,#3a2a0e 0,transparent 28rem),linear-gradient(145deg,#0a0a09,#1a1813 55%,#0b0b0a);font:15px/1.5 Manrope,"Segoe UI",sans-serif}
body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.18;background-image:linear-gradient(90deg,transparent 49.8%,#fff1 50%,transparent 50.2%);background-size:56px 56px}
.shell{position:relative;width:min(1180px,calc(100% - 32px));margin:auto;padding:34px 0 40px}.hero{display:grid;grid-template-columns:1.08fr .92fr;min-height:350px;overflow:hidden;border:1px solid #d5aa4a88;border-radius:24px;background:var(--coal);box-shadow:0 26px 70px #0008}
.brand-panel{display:flex;align-items:center;justify-content:center;min-width:0;padding:16px;background:radial-gradient(circle at 45% 42%,#fff 0,#f4ecdd 50%,#ded0b4 100%);border-right:1px solid #c7962e55}.brand-lockup{position:relative;width:min(100%,590px)}.brand-lockup img{display:block;width:100%;height:auto;clip-path:inset(0 0 17% 0);filter:drop-shadow(0 18px 17px #6b4b1233)}.brand-signature{position:absolute;right:6.5%;bottom:14.6%;color:#b88318;font:600 clamp(.62rem,1vw,.82rem)/1 Manrope,sans-serif;letter-spacing:.08em;text-shadow:0 1px #fff8;white-space:nowrap}
.hero-copy{display:flex;flex-direction:column;justify-content:center;padding:48px 48px 42px;color:#f8f4e9}.eyebrow{margin:0;color:var(--gold);font-size:.7rem;font-weight:800;letter-spacing:.18em}.hero h1{margin:12px 0 18px;font:600 clamp(2.2rem,4.5vw,4.5rem)/1.02 "Playfair Display",Georgia,serif;letter-spacing:-.04em}.hero h1 strong{color:var(--gold-light);font-weight:700}.hero-description{max-width:430px;margin:0;color:#d0cabd;font-size:1.03rem}.security-note{display:flex;align-items:center;gap:9px;margin-top:30px;color:#aaa396;font-size:.78rem}.security-note span{width:8px;height:8px;border-radius:50%;background:var(--gold);box-shadow:0 0 0 5px #c7962e1f}
.card{margin-top:22px;padding:26px;border:1px solid var(--line);border-radius:18px;background:linear-gradient(145deg,#fffdf9,#f6efe3);box-shadow:0 18px 45px #0004}.section-title{display:flex;align-items:center;gap:15px}.section-title h2,.card h2{margin:2px 0 0;font:700 clamp(1.25rem,2vw,1.7rem)/1.2 "Playfair Display",Georgia,serif}.section-number{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border:1px solid #c7962e88;border-radius:50%;color:var(--gold);background:#181713;font-weight:800}.section-number.success{color:white;background:var(--success);border-color:var(--success)}
.upload-controls{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:14px;margin-top:21px}.file-picker{display:flex;align-items:center;gap:14px;min-width:0;padding:15px 17px;border:1px dashed #b69554;border-radius:12px;background:#fff;cursor:pointer;transition:.2s}.file-picker:hover{border-color:var(--gold);background:#fffaf0}.file-picker>span:last-child{min-width:0}.file-picker strong{display:block}.file-picker small{display:block;overflow:hidden;margin-top:2px;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}.file-icon{display:grid;place-items:center;width:45px;height:45px;flex:0 0 45px;border-radius:9px;color:var(--gold-light);background:var(--coal);font-size:.72rem;font-weight:800;letter-spacing:.08em}input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}button{display:inline-flex;align-items:center;justify-content:center;gap:12px;border:0;border-radius:10px;padding:0 21px;color:#17130a;background:linear-gradient(135deg,var(--gold-light),var(--gold));box-shadow:0 8px 20px #8e631a35;font:800 .88rem Manrope,sans-serif;cursor:pointer;transition:transform .18s,filter .18s}button:hover{filter:brightness(1.06);transform:translateY(-1px)}button.secondary,.material-settings-button{color:#eee7d7;background:#26231d;box-shadow:none}
.alert{display:flex;gap:10px;margin-top:22px;padding:17px 20px;border:1px solid #ce7878;border-radius:12px;color:#752020;background:#fff1f1}.result-header{display:flex;align-items:end;justify-content:space-between;gap:24px;margin:38px 0 18px;color:white}.result-header h2{margin:2px 0 0;font:700 clamp(1.4rem,2.4vw,2rem) "Playfair Display",Georgia,serif}.actions{display:flex;gap:10px}.actions button{min-height:45px}
.notice{margin-top:14px;padding:12px 16px;border-radius:10px}.success-notice{border:1px solid #75a888;color:#1e5b39;background:#effaf3}.validation-alert{display:grid;grid-template-columns:auto 1fr}.validation-alert ol{grid-column:1/-1;margin:6px 0 0;padding-left:22px}.validation-alert li+li{margin-top:3px}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.metrics article{position:relative;overflow:hidden;padding:21px;border:1px solid #c7962e55;border-radius:14px;color:white;background:linear-gradient(145deg,#211f1a,#12110f)}.metrics article:after{content:"";position:absolute;width:80px;height:80px;right:-35px;top:-35px;border:1px solid #c7962e44;border-radius:50%}.metrics span{display:block;color:#aaa396;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.11em}.metrics strong{display:inline-block;margin-top:7px;color:var(--gold-light);font:700 2rem/1 "Playfair Display",Georgia,serif}.metrics small{margin-left:5px;color:#928b7f}
.data-card{padding:0;overflow:hidden}.card-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;padding:23px 25px 18px}.card-heading>span{color:var(--muted);font-size:.76rem}.table-wrap{overflow:auto;border-top:1px solid var(--line)}.table-wrap.tall{max-height:455px}table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{padding:12px 15px;border-bottom:1px solid #e9e1d3;text-align:right}thead th{position:sticky;z-index:1;top:0;color:#f4ead4;background:#191713;font-size:.72rem;text-transform:uppercase;letter-spacing:.07em}th:last-child,td:last-child{text-align:left}tbody tr:nth-child(even){background:#f7f1e7}tbody tr:hover{background:#efe4d0}.material-code{display:inline-block;min-width:42px;padding:3px 8px;border-radius:6px;color:#372608;background:#eac874;text-align:center;font-size:.78rem}tfoot th{position:static;color:#17130a;background:linear-gradient(90deg,#d4a43d,#f0ce80)}
.toast{position:fixed;z-index:10;right:22px;bottom:22px;display:none;padding:13px 17px;border:1px solid #d8b862;border-radius:10px;color:white;background:#1a2e22;box-shadow:0 12px 30px #0008}footer{display:flex;align-items:center;justify-content:center;gap:13px;padding:26px 0 0;color:#8f887b}footer span{color:var(--gold);font-weight:800;letter-spacing:.18em}footer i{width:34px;height:1px;background:#6d6047}footer small{font-size:.75rem}
@media(max-width:850px){.hero{grid-template-columns:1fr}.brand-panel{border-right:0;border-bottom:1px solid #c7962e55}.brand-lockup{max-width:520px}.hero-copy{padding:34px}.metrics{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){.shell{width:calc(100% - 18px);padding-top:9px}.hero{border-radius:16px}.brand-panel{padding:6px}.hero-copy{padding:27px 22px}.upload-controls{grid-template-columns:1fr}.upload-controls button{min-height:50px}.result-header{display:block}.actions{margin-top:15px}.actions button{flex:1}.metrics{grid-template-columns:1fr 1fr}.card{padding:18px}.data-card{padding:0}.card-heading{padding:19px}.card-heading>span{display:none}th,td{padding:10px 12px}footer small{display:none}}

/* Layout compacto: a tela inicial ocupa apenas a área visível do navegador. */
html,body{height:100%}
body:not(:has(.result-header)):not(:has(.alert)){overflow-y:hidden}
.shell{width:min(1180px,calc(100% - 24px));padding:clamp(8px,1.8vh,18px) 0;min-height:100dvh}
.hero{grid-template-columns:48% 52%;grid-template-rows:minmax(0,1fr);min-height:0;height:clamp(220px,43dvh,286px);border-radius:18px}
.brand-panel{position:relative;height:auto;min-height:0;overflow:hidden;padding:8px;background:#050505;border-right:1px solid #c7962e55}
.brand-lockup{position:absolute;inset:8px 7% 16px;width:auto;height:auto;max-width:none;aspect-ratio:auto}
.brand-lockup img{width:100%;height:100%;object-fit:contain;clip-path:inset(0 0 17% 0);filter:drop-shadow(0 10px 14px #0008)}
.brand-signature{z-index:2;right:7%;bottom:6px;color:var(--gold-light);font-size:clamp(.58rem,.8vw,.76rem);text-shadow:0 1px 2px #000}
.hero-copy{padding:clamp(20px,3.1vw,38px)}
.hero h1{margin:7px 0 10px;font-size:clamp(1.75rem,3.6vw,3.35rem);line-height:.98}
.hero-description{font-size:clamp(.78rem,1.15vw,.95rem);line-height:1.4}
.security-note{margin-top:clamp(10px,2vh,18px);font-size:.7rem}
.card{margin-top:clamp(8px,1.4vh,14px);padding:clamp(13px,2vh,19px);border-radius:15px}
.section-title{gap:11px}
.section-title h2,.card h2{font-size:clamp(1.05rem,1.8vw,1.42rem)}
.section-number{width:36px;height:36px;flex-basis:36px;font-size:.78rem}
.upload-controls{gap:10px;margin-top:clamp(8px,1.4vh,13px)}
.file-picker{gap:11px;padding:9px 13px}
.file-icon{width:38px;height:38px;flex-basis:38px;font-size:.65rem}
.upload-controls button{min-height:58px;padding:0 18px}
footer{padding:clamp(7px,1.5vh,14px) 0 0;line-height:1}

@media(max-width:850px) and (min-width:621px){
  .hero{grid-template-columns:46% 54%;height:clamp(215px,42dvh,270px)}
  .brand-panel{border-right:1px solid #c7962e55;border-bottom:0}
  .brand-lockup{max-width:430px}
  .hero-copy{padding:20px}
  .hero h1{font-size:clamp(1.65rem,4.2vw,2.5rem)}
  .security-note{margin-top:10px}
}

@media(max-width:620px){
  body:not(:has(.result-header)):not(:has(.alert)){overflow-y:auto}
  .shell{width:calc(100% - 14px);padding:7px 0;min-height:100dvh}
  .hero{grid-template-columns:42% 58%;height:clamp(190px,38dvh,235px);border-radius:13px}
  .brand-panel{padding:3px;border-right:1px solid #c7962e55;border-bottom:0}
  .brand-lockup{max-width:300px}
  .hero-copy{padding:13px}
  .hero h1{font-size:clamp(1.2rem,5.8vw,1.8rem)}
  .hero-description{font-size:.68rem}
  .security-note{display:none}
  .upload-controls{grid-template-columns:minmax(0,1fr) auto auto}
  .upload-controls button{min-height:52px;padding:0 12px;font-size:.74rem}
  .upload-controls .material-settings-button{padding:0 7px;font-size:.62rem}
  .file-picker{padding:7px 9px}
  .file-icon{width:34px;height:34px;flex-basis:34px}
  footer{padding-top:7px}
}

/* Versão compacta final: cabeçalho menor e nome METRUS com maior contraste. */
.hero{height:clamp(160px,31dvh,200px)}
.brand-lockup{inset:5px 7% 11px}
.brand-lockup::before{content:"";position:absolute;z-index:0;left:4%;right:2%;bottom:12%;height:27%;border-radius:50%;background:radial-gradient(ellipse at center,#f1cf786e 0,#b9862638 42%,transparent 74%);filter:blur(8px)}
.brand-lockup img{position:relative;z-index:1;filter:drop-shadow(0 0 1px #f4d47dcc) drop-shadow(0 0 5px #c7962e66) drop-shadow(0 7px 10px #000b)}
.brand-signature{right:7%;bottom:4px}
.hero-copy{padding:clamp(15px,2.6vw,30px)}
.hero h1{font-size:clamp(1.55rem,3.1vw,2.85rem)}
.hero-description{font-size:clamp(.72rem,1vw,.88rem)}
.security-note{margin-top:clamp(7px,1.2vh,12px);font-size:.66rem}
body:not(:has(.result-header)):not(:has(.alert)){overflow:hidden}

/* A página de resultados fica presa à janela; somente as tabelas rolam. */
body:has(.result-header){height:100dvh;overflow:hidden}
.shell:has(.result-header){display:grid;width:min(1240px,calc(100% - 20px));height:100dvh;min-height:0;padding:8px 0;grid-template-columns:minmax(0,1.72fr) minmax(250px,1fr);grid-template-rows:clamp(105px,19dvh,130px) 58px 58px minmax(0,1fr) 18px;gap:8px 10px;overflow:hidden}
.shell:has(.result-header)>.hero{grid-column:1/-1;grid-row:1;height:100%;min-height:0}
.shell:has(.result-header)>.upload-card{grid-column:1;grid-row:2;min-width:0;margin:0;padding:7px 9px;border-radius:11px}
.shell:has(.result-header)>.upload-card .section-title{display:none}
.shell:has(.result-header)>.upload-card .upload-controls{height:44px;margin:0;gap:7px}
.shell:has(.result-header)>.upload-card .file-picker{height:44px;padding:5px 9px;gap:8px}
.shell:has(.result-header)>.upload-card .file-icon{width:31px;height:31px;flex-basis:31px}
.shell:has(.result-header)>.upload-card button{min-height:44px;padding:0 12px;font-size:.74rem}
.shell:has(.result-header)>.result-header{grid-column:2;grid-row:2;min-width:0;margin:0;padding:7px 9px;border:1px solid #c7962e55;border-radius:11px;background:#171612;align-items:center}
.shell:has(.result-header)>.result-header .section-title{display:none}
.shell:has(.result-header)>.result-header .actions{width:100%;height:42px;gap:7px}
.shell:has(.result-header)>.result-header .actions button{flex:1;min-width:0;min-height:42px;padding:0 8px;font-size:.68rem;line-height:1.1}
.shell:has(.result-header)>.metrics{grid-column:1/-1;grid-row:3;min-height:0;gap:8px}
.shell:has(.result-header)>.metrics article{padding:8px 13px;border-radius:10px}
.shell:has(.result-header)>.metrics article::after{width:52px;height:52px}
.shell:has(.result-header)>.metrics span{font-size:.61rem}
.shell:has(.result-header)>.metrics strong{margin-top:3px;font-size:1.3rem}
.shell:has(.result-header)>.metrics small{font-size:.67rem}
.shell:has(.result-header)>.converted-card{grid-column:1;grid-row:4}
.shell:has(.result-header)>.summary-card{grid-column:2;grid-row:4}
.shell:has(.result-header)>.data-card{display:flex;min-width:0;min-height:0;margin:0;padding:0;flex-direction:column;border-radius:12px;overflow:hidden}
.shell:has(.result-header)>.data-card .card-heading{flex:0 0 auto;min-height:38px;padding:7px 10px;align-items:center}
.shell:has(.result-header)>.data-card .card-heading .eyebrow{font-size:.56rem}
.shell:has(.result-header)>.data-card .card-heading h2{font-size:.95rem}
.shell:has(.result-header)>.data-card .card-heading>span{font-size:.61rem}
.shell:has(.result-header)>.data-card .table-wrap,.shell:has(.result-header)>.data-card .table-wrap.tall{flex:1;min-height:0;max-height:none;overflow:auto}
.shell:has(.result-header)>.data-card table{table-layout:fixed;font-size:.69rem}
.shell:has(.result-header)>.data-card th,.shell:has(.result-header)>.data-card td{height:27px;padding:5px 5px;overflow:hidden;text-overflow:ellipsis}
.shell:has(.result-header)>.data-card thead th{padding-right:3px;padding-left:3px;font-size:.53rem;letter-spacing:0}
.shell:has(.result-header)>.converted-card th:nth-child(1){width:52px}
.shell:has(.result-header)>.converted-card th:nth-child(2){width:70px}
.shell:has(.result-header)>.converted-card th:nth-child(3),.shell:has(.result-header)>.converted-card th:nth-child(4){width:66px}
.shell:has(.result-header)>.converted-card th:nth-child(5){width:70px}
.shell:has(.result-header)>.summary-card th{width:20%}
.shell:has(.result-header)>.data-card .material-code{min-width:34px;padding:2px 5px;font-size:.66rem}
.shell:has(.result-header)>footer{grid-column:1/-1;grid-row:5;min-height:0;padding:0;font-size:.66rem}

@media(max-height:650px){
  .shell:has(.result-header){grid-template-rows:90px 50px 50px minmax(0,1fr) 14px;gap:6px 8px;padding:5px 0}
  .shell:has(.result-header) .hero-description,.shell:has(.result-header) .security-note{display:none}
  .shell:has(.result-header) .hero h1{margin:4px 0;font-size:clamp(1.25rem,2.6vw,2.1rem)}
  .shell:has(.result-header)>.upload-card,.shell:has(.result-header)>.result-header{padding:3px 6px}
  .shell:has(.result-header)>.upload-card .upload-controls,.shell:has(.result-header)>.upload-card .file-picker,.shell:has(.result-header)>.upload-card button,.shell:has(.result-header)>.result-header .actions{height:42px;min-height:42px}
  .shell:has(.result-header)>.metrics article{padding:5px 10px}
  .shell:has(.result-header)>.metrics strong{font-size:1.08rem}
  .shell:has(.result-header)>.data-card .card-heading{min-height:32px;padding:4px 8px}
  .shell:has(.result-header)>.data-card .card-heading h2{font-size:.82rem}
}

@media(max-width:850px){
  .hero{grid-template-columns:46% 54%;grid-template-rows:minmax(0,1fr);height:160px}
  .brand-panel{border-right:1px solid #c7962e55;border-bottom:0}
  .hero-copy{padding:14px}
  .hero h1{font-size:clamp(1.2rem,4vw,1.85rem)}
  .hero-description{font-size:.67rem}
  .security-note{margin-top:6px;font-size:.58rem}
  .shell:has(.result-header)>.hero{height:100%}
  .shell:has(.result-header)>.metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
  .shell:has(.result-header)>.metrics article{display:flex;align-items:center;justify-content:space-between;gap:4px}
  .shell:has(.result-header)>.metrics strong{margin:0;font-size:.96rem}
  .shell:has(.result-header)>.metrics small{display:none}
}

/* Resultados mais largos, unidades do resumo e ordenação das colunas. */
.shell:has(.result-header){width:calc(100% - 8px);max-width:none}
.summary-card .card-heading{gap:5px}
.unit-switch{display:grid;grid-template-columns:repeat(3,auto);gap:3px;margin-left:auto;padding:2px;border:1px solid #c7962e66;border-radius:7px;background:#171612}
.unit-switch .unit-button{min-height:24px;padding:0 7px;border-radius:5px;color:#bdb5a5;background:transparent;box-shadow:none;font-size:.55rem;font-weight:700;white-space:nowrap}
.unit-switch .unit-button:hover{color:#fff;transform:none}
.unit-switch .unit-button.active{color:#17130a;background:linear-gradient(135deg,var(--gold-light),var(--gold))}
th.sortable{position:sticky;padding-right:12px!important;cursor:pointer;user-select:none}
th.sortable::after{content:"⇅";position:absolute;right:3px;color:#b9a477;font-size:.6rem;opacity:.65}
th.sortable[data-sort-direction="asc"]::after{content:"↑";color:var(--gold-light);opacity:1}
th.sortable[data-sort-direction="desc"]::after{content:"↓";color:var(--gold-light);opacity:1}
th.sortable:focus-visible{outline:2px solid var(--gold-light);outline-offset:-2px}
.summary-card th:last-child,.summary-card td:last-child{text-align:right}

@media(max-width:900px){
  .summary-card .card-heading{padding-right:5px!important;padding-left:7px!important}
  .unit-switch{gap:1px}
  .unit-switch .unit-button{padding:0 3px;font-size:.45rem}
  .summary-card .card-heading h2{font-size:.72rem!important}
  th.sortable{padding-right:9px!important}
  th.sortable::after{right:1px;font-size:.5rem}
}

/* Refinamento visual: largura centralizada, logotipo dominante e títulos legíveis. */
.shell:has(.result-header){width:min(1240px,calc(100% - 20px));max-width:1240px}
.hero{grid-template-columns:56% 44%}
.brand-lockup{inset:2px 3% 6px}
.brand-signature{right:4%;bottom:3px}
.hero-copy{padding:clamp(12px,2vw,24px)}
.hero h1{font-size:clamp(1.35rem,2.5vw,2.35rem);line-height:.96}
.hero-description{font-size:clamp(.68rem,.9vw,.82rem);line-height:1.3}
.shell:has(.result-header) .hero h1{font-size:clamp(1.08rem,2vw,1.75rem)}
.shell:has(.result-header) .hero-copy{padding:8px 14px}
.shell:has(.result-header)>.result-header .actions{gap:5px}
.shell:has(.result-header)>.result-header .actions .clear-button{flex:0 0 54px;color:#f0dfbd;background:#4b3720;box-shadow:none}
.shell:has(.result-header)>.data-card thead th{height:34px;padding:4px 12px 4px 4px!important;font-size:.66rem;line-height:1.05;letter-spacing:0;white-space:normal}
.shell:has(.result-header)>.data-card thead th.sortable::after{right:3px;font-size:.65rem}

@media(max-width:850px){
  .hero{grid-template-columns:56% 44%}
  .hero h1{font-size:clamp(1.05rem,3.1vw,1.45rem)}
  .hero-description{font-size:.6rem}
  .shell:has(.result-header) .hero h1{font-size:clamp(.95rem,2.8vw,1.25rem)}
  .shell:has(.result-header)>.result-header .actions .clear-button{flex-basis:45px;padding:0 3px;font-size:.58rem}
  .shell:has(.result-header)>.data-card thead th{height:32px;padding-right:9px!important;font-size:.58rem}
}

/* Cabeçalhos sem cortes e colunas redistribuídas. */
.shell:has(.result-header)>.data-card thead th{
  overflow:visible;
  text-overflow:clip;
  white-space:nowrap;
}
.shell:has(.result-header)>.converted-card th:nth-child(1){width:45px}
.shell:has(.result-header)>.converted-card th:nth-child(2){width:89px}
.shell:has(.result-header)>.converted-card th:nth-child(3){width:70px}
.shell:has(.result-header)>.converted-card th:nth-child(4){width:62px}
.shell:has(.result-header)>.converted-card th:nth-child(5){width:72px}
.shell:has(.result-header)>.converted-card th:nth-child(6){width:auto}
.shell:has(.result-header)>.converted-card table{min-width:620px}
.shell:has(.result-header)>.summary-card th:nth-child(1){width:17%}
.shell:has(.result-header)>.summary-card th:nth-child(2){width:22%}
.shell:has(.result-header)>.summary-card th:nth-child(3){width:27%}
.shell:has(.result-header)>.summary-card th:nth-child(4){width:19%}
.shell:has(.result-header)>.summary-card th:nth-child(5){width:15%}
.shell:has(.result-header)>.summary-card table{min-width:440px}
.shell:has(.result-header)>.converted-card .card-heading h2{
  font-size:clamp(.72rem,1.05vw,.95rem);
  white-space:nowrap;
}
.converted-card,.summary-card{text-transform:uppercase}
.converted-card .heading-count{
  color:#8d8679;
  font-family:Manrope,"Segoe UI",sans-serif;
  font-size:.72em;
  font-weight:500;
  letter-spacing:0;
  text-transform:uppercase;
}
.site-counters{color:var(--gold-light);font-weight:700}
.app-version{color:var(--gold-light);font-size:.72em;font-weight:700}
.exit-form{margin:0}
.exit-button{min-height:24px;padding:0 10px;border:1px solid #9f7627;border-radius:6px;color:#eee7d7;background:#26231d;box-shadow:none;font-size:.56rem;letter-spacing:.06em}
.exit-button:hover{color:#17130a;background:var(--gold-light);transform:none}
.exit-page{display:grid;min-height:100dvh;place-items:center;padding:20px;background:radial-gradient(circle at top,#2b2519 0,#11100e 55%)}
.exit-panel{width:min(620px,100%);padding:34px;border:1px solid #9f7627;border-radius:18px;text-align:center;background:#181612;box-shadow:0 24px 70px #0009}
.exit-panel img{display:block;width:min(330px,75%);max-height:130px;margin:0 auto 22px;object-fit:contain}
.exit-panel h1{margin:5px 0 10px;color:#f4ead6;font:700 clamp(1.55rem,4vw,2.45rem) "Playfair Display",Georgia,serif}
.exit-panel>p:not(.eyebrow){color:#bdb5a5}
.exit-shortcut{margin:24px 0 16px!important;color:#eee7d7!important;font-weight:700}
.exit-shortcut kbd{display:inline-block;min-width:38px;padding:5px 8px;border:1px solid #c49a45;border-bottom-width:3px;border-radius:6px;color:#17130a;background:var(--gold-light);font:800 .8rem Manrope,sans-serif}
.exit-panel>small{color:#9f8b66}
.file-picker small{
  overflow:visible;
  text-overflow:clip;
  font-size:.7rem;
}

/* Filtros múltiplos e resumo recalculado. */
.table-tools{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:.61rem;white-space:nowrap}
.table-tools #clear-filters{min-height:24px;padding:0 7px;border-radius:6px;font-size:.53rem;box-shadow:none}
.converted-card thead tr:first-child th{top:0}
.converted-card thead .filter-row th{
  top:34px;
  z-index:2;
  height:29px!important;
  padding:3px!important;
  overflow:visible;
  background:#2b2821;
}
.filter-button{
  position:relative;
  display:block;
  width:100%;
  min-width:0;
  min-height:21px;
  overflow:hidden;
  padding:0 14px 0 5px;
  border:1px solid #66583b;
  border-radius:5px;
  color:#d8d0c0;
  background:#161510;
  box-shadow:none;
  font-size:.49rem;
  line-height:1;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.filter-button::after{content:"▾";position:absolute;right:4px;color:var(--gold-light)}
.filter-button:hover{transform:none}
.filter-button.active{color:#18140c;background:var(--gold-light);border-color:var(--gold-light)}
.filter-popover{
  position:fixed;
  z-index:100;
  width:min(310px,calc(100vw - 16px));
  padding:10px;
  border:1px solid #b88c35;
  border-radius:9px;
  color:#eee8dc;
  background:#1b1915;
  box-shadow:0 14px 35px #000a;
  font:600 .72rem/1.3 Manrope,"Segoe UI",sans-serif;
}
.filter-popover>strong{display:block;margin-bottom:7px;color:var(--gold-light);text-transform:uppercase}
.filter-popover-controls{display:flex;gap:6px;margin-bottom:7px}
.filter-popover-controls button{min-height:25px;padding:0 8px;border-radius:5px;font-size:.58rem;box-shadow:none}
.filter-search{
  width:100%;
  height:30px;
  margin-bottom:7px;
  padding:0 9px;
  border:1px solid #685b40;
  border-radius:6px;
  color:#f5efe3;
  background:#0f0e0c;
  font:600 .68rem Manrope,"Segoe UI",sans-serif;
  outline:none;
}
.filter-search:focus{border-color:var(--gold-light);box-shadow:0 0 0 2px #c7962e33}
.description-filter-hint{display:block;margin:-1px 1px 8px;color:#aaa18f;font-size:.58rem;font-weight:500}
.clear-description-filter{min-height:27px;padding:0 9px;border-radius:5px;font-size:.58rem;box-shadow:none}
.filter-options{max-height:210px;overflow:auto;border-top:1px solid #655536;border-bottom:1px solid #655536}
.filter-options label{display:flex;align-items:center;gap:7px;padding:5px 3px;border-bottom:1px solid #ffffff0d;cursor:pointer}
.filter-options label:hover{background:#ffffff0b}
.filter-options input{accent-color:var(--gold)}
.filter-options span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filter-status{color:var(--gold);font-family:Manrope,"Segoe UI",sans-serif;font-size:.62em;font-weight:700;letter-spacing:.04em}
.filter-result-info{display:block;margin-top:2px;color:#8d8679;font-size:.54rem;font-weight:600}
.summary-card th:last-child,.summary-card td:last-child{padding-right:14px!important}
.empty-filter-result td{padding:18px!important;color:#7c7569;text-align:center!important;font-style:italic}
.active-filter-bar{
  display:flex;
  flex:0 0 auto;
  min-height:34px;
  align-items:center;
  gap:7px;
  padding:4px 7px;
  border-top:1px solid #d8ccb7;
  background:#eee4d2;
}
.active-filter-bar[hidden]{display:none}
.active-filter-tags{display:flex;min-width:0;flex:1;gap:5px;overflow-x:auto}
.active-filter-tag{
  display:flex;
  align-items:center;
  gap:4px;
  max-width:210px;
  flex:0 0 auto;
  padding:3px 6px;
  border:1px solid #c4a460;
  border-radius:999px;
  color:#4b3712;
  background:#fff8e9;
  font-size:.52rem;
  font-weight:700;
  white-space:nowrap;
}
.active-filter-tag>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.remove-filter-tag{
  width:17px;
  height:17px;
  min-height:17px;
  flex:0 0 17px;
  padding:0;
  border:0;
  border-radius:50%;
  color:#624712;
  background:#dfc98f;
  box-shadow:none;
  font-size:.68rem;
  line-height:17px;
}
.remove-filter-tag:hover{transform:none;background:#cfa94e}
.filtered-actions{display:flex;flex:0 0 auto;gap:4px}
.filtered-actions button{min-height:25px;padding:0 7px;border-radius:5px;font-size:.52rem;box-shadow:none;white-space:nowrap}
.report-menu{position:relative;display:flex;flex:1;min-width:0}
.report-menu summary{display:flex;width:100%;min-height:45px;align-items:center;justify-content:center;padding:0 9px;border-radius:10px;color:#eee7d7;background:#26231d;font-size:.68rem;font-weight:800;cursor:pointer;list-style:none}
.report-menu summary::-webkit-details-marker{display:none}
.report-menu>div{position:absolute;z-index:20;right:0;top:calc(100% + 4px);min-width:125px;overflow:hidden;border:1px solid #a87d2c;border-radius:7px;background:#191713;box-shadow:0 10px 25px #0009}
.report-menu a{display:block;padding:8px 10px;color:#eee7d7;text-decoration:none;font-size:.65rem;white-space:nowrap}
.report-menu a:hover{color:#17130a;background:var(--gold-light)}
.warnings-button{color:#5a3900!important;background:#f2cf7f!important}
.app-dialog{width:min(520px,calc(100% - 24px));max-height:calc(100dvh - 30px);overflow:auto;padding:0;border:1px solid #b88c35;border-radius:14px;color:#28241d;background:#fbf6eb;box-shadow:0 24px 70px #000b}
.app-dialog::backdrop{background:#000b;backdrop-filter:blur(2px)}
.app-dialog form,.warnings-dialog>div{padding:18px}
.app-dialog header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}
.app-dialog h2{margin:2px 0 0;font:700 1.45rem "Playfair Display",Georgia,serif}
.dialog-close{width:34px;height:34px;min-height:34px;padding:0;border-radius:50%;font-size:1.2rem;box-shadow:none}
.dialog-description{margin:0 0 12px;color:var(--muted);font-size:.78rem}
.material-form-head,.material-form-row{display:grid;grid-template-columns:1fr 1fr 34px;gap:8px;align-items:center}
.material-form-head{padding:0 4px 5px;color:#665c4b;font-size:.66rem;font-weight:800;text-transform:uppercase}
.material-rows{display:grid;gap:7px;max-height:310px;overflow:auto}
.material-form-row input{min-width:0;height:36px;padding:0 9px;border:1px solid #cbbd9f;border-radius:7px;background:white;font:600 .78rem Manrope,sans-serif}
.remove-material{width:32px;height:32px;min-height:32px;padding:0;border-radius:6px;color:#7c2929;background:#f1d7d2;box-shadow:none}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.dialog-actions button{min-height:38px}
.warnings-dialog ol{margin:0;padding-left:24px}.warnings-dialog li+li{margin-top:7px}

@media(max-width:850px){
  .converted-card thead .filter-row th{top:32px}
  .table-tools>span{display:none}
  .table-tools #clear-filters{padding:0 4px;font-size:.46rem}
  .active-filter-tag{max-width:120px;font-size:.46rem}
  .filtered-actions button{padding:0 4px;font-size:.45rem}
  .shell:has(.result-header)>.result-header .actions{gap:3px}
  .report-menu summary{padding:0 4px;font-size:.55rem}
}
