
:root{font-size:16px}
body{font-size:1rem}
.button,.text-button,.field,.field input,.field textarea,select{font-size:.875rem}
.button{min-height:42px}
.top-inner{min-height:76px}
.nav a{font-size:.875rem}
.page-head{align-items:center}
.page-head h1{font-size:clamp(2rem,3.5vw,3rem)}
.section-head p,.modal-body>p,.wizard-intro,.guide p{font-size:.875rem}
.lines th{font-size:.75rem;letter-spacing:.035em}
.article-name,.num{font-size:.875rem}
.pill{font-size:.75rem;padding:5px 8px;line-height:1.35}
.ref,.table-foot,.local,.hero-note{font-size:.75rem}
.lines td{padding-block:16px}
.lines th:first-child{width:31%}
.lines th:nth-child(5){width:26%}
.review-tabs{display:flex;gap:5px;align-items:center;margin:25px 0 16px;border-bottom:1px solid #d9e0ea}
.review-tabs button{position:relative;border:0;background:transparent;padding:11px 16px 14px;color:#596b82;font-size:.875rem;font-weight:650}
.review-tabs button.active{color:#55449b}
.review-tabs button.active:after{content:"";position:absolute;height:3px;border-radius:3px;bottom:-1px;left:12px;right:12px;background:#7463bf}
.main[data-panel="receipt"]>.detail,.main[data-panel="prices"]>.detail{display:none}
.receipt-card{overflow:hidden}
.receipt-card>.section-head{padding-bottom:18px}
.receipt-toolbar{display:flex;align-items:center;gap:22px;flex-wrap:wrap;padding:0 26px 15px}
.receipt-toolbar .check-line{margin:0;margin-right:auto;font-size:.875rem}
.receipt-warning{margin:0 24px 16px}
.scroll-table{overflow:auto}
.receipt-table{width:100%;border-collapse:collapse;font-size:.875rem}
.receipt-table th{background:#f6f8fb;color:#596b82;text-align:left;font-size:.75rem;white-space:nowrap;border-block:1px solid #e1e6ed;padding:13px 16px}
.receipt-table td{padding:16px;vertical-align:top;border-bottom:1px solid #e7ebf1;line-height:1.5;font-variant-numeric:tabular-nums}
.receipt-table th:first-child,.receipt-table td:first-child{padding-left:26px}
.receipt-table strong{font-weight:650}
.receipt-table small{display:block;color:#5c6e83;font-size:.75rem;margin-top:6px}
.receipt-table .pill{margin-bottom:4px;white-space:normal}
.receipt-table td:nth-child(2),.receipt-table td:nth-child(3),.receipt-table td:nth-child(4){white-space:nowrap}
.empty-receipt{text-align:center;padding:48px 28px}
.empty-receipt h2{font-size:1.5rem;letter-spacing:-.04em;margin:16px 0 8px}
.empty-receipt p{color:#52657d;max-width:470px;line-height:1.6;margin:0 auto 20px}
.guide-hero{display:grid;grid-template-columns:1.1fr 1fr;gap:32px;padding:30px;margin-bottom:20px}
.guide-hero h2{font-size:1.65rem;letter-spacing:-.04em;margin:13px 0 8px}
.guide-hero p{font-size:.9375rem;line-height:1.6;color:#53657d;max-width:420px;margin-bottom:20px}
.guide-files{border-left:1px solid #e1e6ed;padding-left:26px;display:flex;flex-direction:column;justify-content:center}
.guide-files a{display:flex;align-items:center;flex-wrap:wrap;gap:10px;color:#334461;font-size:.875rem;padding:13px 0}
.guide-files a+a{border-top:1px solid #e8ecf2}
.guide-files small{margin-left:auto;color:#5d6f83;font-size:.75rem}
.document-actions{margin-top:8px}
.document-action{display:flex;align-items:center;gap:11px;padding:14px 0;border-bottom:1px solid #e7ebf1}
.document-action>div{flex:1;min-width:0}
.document-action strong{display:block;overflow-wrap:anywhere;font-size:.9375rem}
.document-action small{display:block;color:#5c6f84;font-size:.75rem;line-height:1.6}
.receipt-title{margin:22px 0 4px;font-size:1rem}
.add-receipt{margin-top:18px}
.receipt-doc{padding:14px;border:1px solid #dbe2eb;border-radius:9px;margin-top:12px}
.receipt-doc summary{cursor:pointer;font-weight:650;font-size:.9375rem}
dialog.wide{width:min(1020px,calc(100% - 32px));max-height:92dvh}
.modal-head{position:sticky;top:0;background:#fff;z-index:2}
.modal-foot{position:sticky;bottom:0;z-index:2;box-shadow:0 -4px 10px #1b294005}
.editor-source{border-radius:12px;background:#f7f8fc;border:1px solid #e0e5ef;padding:14px 18px}
.editor-source .file-drop{margin-top:0;background:white}
.editor-shortcuts{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 18px;margin-top:8px}
.editor-shortcuts .text-button{font-size:.8125rem}
.read-progress{display:flex;align-items:center;gap:8px;font-size:.8125rem;color:#574498;line-height:1.5}
.read-progress:not(:empty){margin-top:9px}
.read-progress button{margin-left:auto}
.spinner{width:15px;height:15px;display:inline-block;border:2px solid #d8d1ef;border-top-color:#6653af;border-radius:50%;animation:spin 1s linear infinite;flex-shrink:0}
@keyframes spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.spinner{animation:none}}
.original-preview{padding:10px;border:1px solid #dfe6ef;background:#f9fafd;border-radius:9px;margin-top:12px;text-align:center;font-size:.875rem}
.original-preview img{max-width:100%;max-height:240px;object-fit:contain}
.editor-fields{margin:18px 0 0;padding:0;border:0;min-width:0}
.editor-table-wrap{overflow:auto;border:1px solid #dce3ec;border-radius:9px;background:#fff}
.editor-table{width:100%;border-collapse:collapse;text-align:left}
.editor-table th{font-size:.75rem;color:#5b6b80;background:#f6f8fb;padding:10px;font-weight:650;white-space:nowrap}
.editor-table td{padding:6px 5px;border-top:1px solid #e6ebf1;vertical-align:middle}
.editor-table input{width:100%;min-width:65px;font-size:.875rem;line-height:1.4;padding:8px;border:1px solid #d3dce8;border-radius:6px}
.editor-table th:nth-child(2){width:30%}
.editor-table td:nth-child(2) input{min-width:180px}
.editor-table td:first-child input{min-width:85px}
.editor-table td.num{white-space:nowrap;padding-inline:10px;font-size:.8125rem}
.add-line{margin:8px 0}
.editor-totals{display:grid;grid-template-columns:minmax(180px,1fr) 1fr;align-items:center;gap:20px;background:#f6f8fb;border-radius:10px;padding:14px 18px;margin:8px 0 5px}
.editor-totals .field{margin:0;font-size:.8125rem}
.editor-totals>div{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.editor-totals span{font-size:.8125rem;color:#536980}
.editor-totals strong{font-size:1.5rem;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.editor-totals small{font-size:.75rem}
.net-ok{color:#236b55}
.net-error{color:#a04026}
.paste-panel{padding:15px;background:#f7f8fc;border:1px solid #dfe5ed;border-radius:9px;margin-top:12px}
.paste-panel h3{font-size:1rem}
.paste-panel .button{margin-top:12px}
.source-text{font-size:.8125rem;margin-top:16px}
.source-text summary{cursor:pointer;color:#5e4b9f}
.source-text pre{max-height:230px;overflow:auto;white-space:pre-wrap;padding:12px;background:#f5f7fa;border-radius:6px;line-height:1.6}
.error{font-size:.875rem}
.steps{gap:26px}
.steps li{font-size:.8125rem}
@media(max-width:720px){
  .guide-hero{grid-template-columns:1fr;gap:20px;padding:22px}
  .guide-files{border-left:0;border-top:1px solid #e1e6ed;padding-left:0;padding-top:10px}
  .receipt-toolbar{gap:12px;padding-inline:17px}
  .receipt-card>.section-head{display:flex;flex-wrap:wrap}
  .page-head .actions{width:100%}
  .actions .button{flex-grow:1;font-size:.8125rem}
  .editor-totals{padding:12px;gap:12px}
  .receipt-table th:first-child,.receipt-table td:first-child{padding-left:17px}
  .nav a{font-size:.8125rem}
  .review-tabs button{font-size:.8125rem;padding-inline:11px}
}
@media(max-width:560px){
  .receipt-table thead{display:none}
  .receipt-table,.receipt-table tbody{display:block}
  .receipt-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 5px;padding:16px;border-top:1px solid #e1e7ef}
  .receipt-table td,.receipt-table td:first-child{border:0;padding:0;white-space:normal!important;min-width:0;overflow-wrap:anywhere;font-size:.8125rem}
  .receipt-table td:first-child,.receipt-table td:last-child{grid-column:1/-1}
  .receipt-table td[data-title]:before{content:attr(data-title);display:block;font-size:.75rem;color:#60748b;margin-bottom:2px}
  .receipt-table td:first-child small{margin-top:2px}
  .editor-totals{grid-template-columns:1fr}
  .editor-totals>div{align-items:flex-start}
  .editor-source{padding:12px}
  .read-progress{align-items:flex-start;flex-wrap:wrap}
  .editor-shortcuts .text-button{font-size:.75rem}
  .receipt-warning{margin-inline:17px}
  .section-head h2{font-size:1.25rem}
  .lines [data-col]:before{font-size:.75rem}
  .lines .num,.article-name{font-size:.875rem}
}
@media print{
  .receipt-card{border:0;box-shadow:none;margin-top:18px}
  .receipt-card .section-head{padding:0}
  .receipt-card .section-head p{font-size:9pt;margin:3pt 0}
  .receipt-card .receipt-table{display:table!important}.receipt-card td[data-title]:before{display:none}
  .receipt-card tbody{display:table-row-group!important}
  .receipt-card tr{display:table-row!important}
  .receipt-card td{display:table-cell!important;font-size:8.5pt!important}
  .receipt-card .pill{background:none;padding:0;color:#000}
  .receipt-warning{margin:4pt 0;padding:5pt}
}

.review-meta{display:flex;align-items:center;gap:1rem;padding:1rem 1.25rem;margin:1rem 0;flex-wrap:wrap}.review-meta>div{flex:1;min-width:15rem}.review-meta p{margin:.35rem 0 0;color:#40516b}.review-meta .due-warning{color:#9a3412;font-weight:700}.storage-notice{padding:.75rem 1rem;margin-bottom:1rem;border:1px solid #bdc9dd;border-radius:.7rem;color:#263d5e;background:#f2f6fd;font-size:.9rem}.history-search{max-width:32rem;margin-bottom:1rem}@media(max-width:600px){.review-meta .button{width:100%}}

.hero-expanded{grid-template-columns:1fr 1.2fr}.breakdown{border-left:1px solid #ffffff55;padding-left:1rem;display:grid;gap:.45rem;font-size:.83rem;color:#eff4ff}.breakdown span{display:flex;justify-content:space-between;gap:.5rem}.hero-explain{grid-column:1/-1}.lines td small{color:#53647b}@media(max-width:560px){.hero-expanded{grid-template-columns:1fr}.hero-explain{grid-column:auto}.breakdown{border-left:0;padding-left:0}.lines tr{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"name name" "pedido recibido" "factura diferencia" "state state"}.lines td:nth-child(2){grid-area:pedido}.lines td:nth-child(3){grid-area:recibido}.lines td:nth-child(4){grid-area:factura}.lines td:nth-child(5){grid-area:diferencia}.lines td:nth-child(6){grid-area:state}.lines td:nth-child(7){display:none}}

.claim-fields{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:560px){.claim-fields{grid-template-columns:1fr;gap:0}}

.history-controls{display:flex;flex-wrap:wrap;gap:.8rem;margin:0 0 1rem}.history-controls label{display:grid;gap:.35rem;font-size:.85rem;font-weight:600;min-width:10rem;flex:1}.history-controls select{font-size:.9rem}

.history-totals{padding:1rem;margin-bottom:1rem}.history-totals summary{font-weight:700;cursor:pointer}.history-totals p{font-size:.85rem;line-height:1.5;color:#40516b;margin:.7rem 0}.history-totals .receipt-table{margin-top:.5rem}

.sort-label{display:flex;align-items:center;gap:.4rem;margin-left:auto;font-size:.8rem;color:#40516b}.sort-label select{width:auto;font-size:.85rem}.inline-check{display:flex;align-items:center;gap:.3rem;margin-top:.45rem;color:#40516b;font-size:.8rem}.inline-check input{width:1rem;height:1rem;accent-color:#5446b4}

.help-faq{margin-top:1rem;padding:1.4rem}.help-faq h2{font-size:1.3rem;margin-bottom:.6rem}.help-faq details{border-top:1px solid #dfe5ec;padding:.9rem 0}.help-faq summary{cursor:pointer;font-weight:650}.help-faq p{color:#40516b;line-height:1.6;margin:.6rem 0 0}

.history-advanced{padding:1rem;margin-bottom:1rem}.history-advanced>p{font-size:.9rem;color:#40516b}.history-advanced .history-controls{margin:.7rem 0}.history-controls input{width:100%;border:1px solid #cad3df;border-radius:7px;padding:8px 10px;min-width:0}.history-filter-actions,.history-pagination{display:flex;gap:.5rem;flex-wrap:wrap}.history-pagination{justify-content:space-between;align-items:center;margin:1rem 0;color:#40516b;font-size:.9rem}.history-pagination div{display:flex;gap:.5rem}

.template-add{margin-top:1rem}

.quick-summary{margin-top:.5rem;font-weight:650;color:#eef3ff}

.calculation{border:1px solid #dfe5ec;border-radius:8px;padding:.8rem;margin-top:.8rem}.calculation summary{cursor:pointer;font-weight:700}.calculation p{margin:.4rem 0;color:#40516b}.theme-switch{margin-left:0}.file-drop:has(input:focus-visible){outline:3px solid #7468cc}
html[data-theme="oscuro"]{--ink:#eff4ff;--muted:#c1cfe2;--soft:#b4c3d6;--rule:#465976;--page:#111a2a;--violet:#c3baff;background:#111a2a;color:#eff4ff;color-scheme:dark}html[data-theme="oscuro"] body{background:#111a2a}html[data-theme="oscuro"] .top,html[data-theme="oscuro"] .card,html[data-theme="oscuro"] .documents,html[data-theme="oscuro"] dialog,html[data-theme="oscuro"] .button,html[data-theme="oscuro"] input,html[data-theme="oscuro"] select,html[data-theme="oscuro"] textarea,html[data-theme="oscuro"] .search{background:#1b2940;color:#eff4ff;border-color:#526583}html[data-theme="oscuro"] .button.primary{background:#565099;color:white}html[data-theme="oscuro"] .modal-foot,html[data-theme="oscuro"] .file-drop,html[data-theme="oscuro"] .steps,html[data-theme="oscuro"] .suggestion,html[data-theme="oscuro"] .storage-notice,html[data-theme="oscuro"] .history-advanced{background:#243550;color:#eff4ff}html[data-theme="oscuro"] .history-advanced p,html[data-theme="oscuro"] .review-meta p,html[data-theme="oscuro"] .help-faq p,html[data-theme="oscuro"] .history-totals p,html[data-theme="oscuro"] .calculation p{color:#d5e0ef}html[data-theme="oscuro"] .pill.equal{background:#174e40;color:#d8fff1}html[data-theme="oscuro"] .pill.diff,html[data-theme="oscuro"] .warning{background:#683f17;color:#fff2ce}html[data-theme="oscuro"] .pill.pending{background:#4b416d;color:#fff}html[data-theme="oscuro"] .hero{background:#202c4a}

.getting-started{padding-bottom:1rem;margin-bottom:1rem}.step-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;padding:1rem 1.5rem}.step-card{display:flex;gap:.7rem;border:1px solid var(--rule);border-radius:10px;padding:1rem}.step-card h3{font-size:1rem}.step-card p{font-size:.85rem;color:var(--muted);line-height:1.5;margin-top:.3rem}.guide-example-toggle{margin:1rem 0}.glossary dt{font-weight:700;margin-top:.7rem}.glossary dd{margin:.2rem 0;color:var(--muted)}.guide-downloads{display:grid;gap:.5rem;margin-top:.8rem}.help-faq li{margin:.5rem 0;line-height:1.5}@media(max-width:700px){.step-cards{grid-template-columns:1fr}}

.tour-bubble{display:flex;align-items:center;gap:.7rem;padding:1rem;margin-bottom:1rem;border-left:5px solid #7063c7}.tour-bubble div{flex:1}.tour-bubble p{font-size:.9rem;color:var(--muted);line-height:1.5;margin-top:.3rem}@media(max-width:600px){.tour-bubble{flex-wrap:wrap}.tour-bubble div{flex-basis:100%}}
html[data-theme="oscuro"] .local,html[data-theme="oscuro"] .local svg,html[data-theme="oscuro"] .crumb,html[data-theme="oscuro"] .overline,html[data-theme="oscuro"] .sort-label,html[data-theme="oscuro"] .inline-check,html[data-theme="oscuro"] .review-tabs button,html[data-theme="oscuro"] .lines td small{color:#cbd8eb}
html[data-theme="oscuro"] .review-tabs button.active,html[data-theme="oscuro"] .nav a[aria-current]{color:#ded8ff}
html[data-theme="oscuro"] .lines th,html[data-theme="oscuro"] .receipt-table th,html[data-theme="oscuro"] .editor-table th{background:#293b58;color:#f2f6ff}
html[data-theme="oscuro"] input::placeholder,html[data-theme="oscuro"] textarea::placeholder{color:#b4c5dc;opacity:1}
