/* Statement and e-invoice tools (moneytool.html). Linked in-page; no inline styles (CSP). */
.mt-card .tool { padding: 14px 18px 18px; }
.mt-try { margin: 12px 0 0; font-size: .92rem; color: var(--hx-muted); }
.mt-pdf-note { display: flex; gap: 10px; align-items: flex-start; max-width: 780px; margin: 14px auto 0; font-size: .92rem;
  color: var(--hx-text); text-align: left; }
.mt-pdf-note .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--hx-brand); }

.mt-forms { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.mt-radio { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--hx-line);
  border-radius: 10px; cursor: pointer; font-size: .95rem; color: var(--hx-text); background: #fff; }
.mt-radio input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--hx-brand); flex: none; }
.mt-radio:has(input:checked) { border-color: var(--hx-brand); background: #EFF6FF; }
.mt-radio strong { color: var(--hx-ink); margin-right: 4px; }

.mt-map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 14px; margin: 0 0 8px; }
.mt-map-head .linkish { min-height: 44px; }
.mt-map-h { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--hx-ink); font-size: 1.08rem;
  min-width: 0; overflow-wrap: anywhere; }
.mt-map-h .ico { width: 22px; height: 22px; color: #fff; background: var(--leaf); border-radius: 50%; padding: 3px; stroke-width: 3; flex: none; }
.mt-cols { border: 1px solid var(--hx-line); border-radius: 10px; padding: 0 12px; margin: 0 0 14px; background: #F8FAFC; }
.mt-cols summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 650;
  color: var(--hx-ink); font-size: .95rem; }
.mt-cols-sum { font-weight: 400; color: var(--hx-muted); font-size: .88rem; overflow-wrap: anywhere; }
.mt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; padding: 4px 0 10px; }
.mt-field { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: var(--hx-muted); min-width: 0; border: 0; padding: 0; margin: 0; }
.mt-field legend { padding: 0; margin-bottom: 4px; }
.mt-sel { font: inherit; font-size: .93rem; color: var(--hx-ink); min-height: 40px; padding: 6px 8px; border: 1px solid #CBD5E1;
  border-radius: 8px; background: #fff; width: 100%; max-width: 100%; min-width: 0; }
.mt-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; margin: 0 0 14px; }
.mt-opts fieldset.mt-field { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.mt-opts fieldset.mt-field legend { width: 100%; }
.mt-opts .mt-radio { flex: 1 1 100px; }
.mt-sub { font-size: 1.05rem; margin: 22px 0 8px; color: var(--hx-ink); }
.mt-hint { font-weight: 400; color: var(--hx-muted); font-size: .88rem; margin-left: 6px; }
.mt-meta { display: block; font-size: .8rem; color: var(--hx-muted); font-weight: 400; }
.mt-changed { color: #92400E; }
.mt-empty { color: var(--hx-muted); margin: 8px 0; }
.mt-card .tx tr.mt-total td { font-weight: 700; border-top: 2px solid var(--hx-line); background: #F8FAFC; }
.mt-card .tx tr.mt-muted td { color: var(--hx-muted); }
.mt-card .tx td.desc { overflow-wrap: anywhere; min-width: 180px; }
.mt-rowsel { min-height: 36px; padding: 4px 6px; font-size: .86rem; width: auto; min-width: 140px; }
.mt-guidance { margin-top: 0; }

/* Bars: label, bar (an SVG rect, so no inline style), value */
.mt-chart { margin: 0 0 6px; }
.mt-bar { display: grid; grid-template-columns: minmax(90px, 9rem) minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 0 8px;
  font-size: .9rem; }
.mt-bar-l { color: var(--hx-ink); overflow-wrap: anywhere; }
.mt-bar-v { color: var(--hx-text); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .86rem; }
.mt-bar-svg { display: block; width: 100%; height: 14px; }
.mt-bar-track { fill: #F1F5F9; }
.mt-bar-fill { fill: var(--hx-brand); }
.mt-bar-fill:hover { fill: #1E40AF; }
.mt-cols-chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 0 0 4px; border-bottom: 1px solid var(--hx-line);
  overflow-x: auto; }
.mt-col { flex: 1 1 0; min-width: 44px; max-width: 90px; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.mt-col-svg { display: block; width: 70%; height: 130px; }
.mt-col-v { font-size: .74rem; color: var(--hx-text); font-variant-numeric: tabular-nums; margin-bottom: 4px; white-space: nowrap; }
.mt-col-l { font-size: .74rem; color: var(--hx-muted); margin-top: 6px; white-space: nowrap; }

/* E-invoice */
.ei-format { color: var(--hx-muted); font-size: .9rem; margin: -4px 0 12px; overflow-wrap: anywhere; }
.ei-verdict strong { display: block; }
.ei-verdict span { font-size: .92rem; }
.ei-parties, .ei-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0 0; }
.ei-party { border: 1px solid var(--hx-line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.ei-party h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hx-muted); margin: 0 0 6px; }
.ei-name { font-weight: 700; color: var(--hx-ink); margin: 0 0 4px; overflow-wrap: anywhere; }
.ei-line { margin: 0 0 2px; font-size: .92rem; overflow-wrap: anywhere; }
.ei-missing { color: var(--bad); font-size: .92rem; }
.ei-ids { margin: 8px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; font-size: .86rem; }
.ei-ids div { display: contents; }
.ei-ids dt { color: var(--hx-muted); }
.ei-ids dd { margin: 0; overflow-wrap: anywhere; color: var(--hx-ink); }
.ei-totals { min-width: 0; }
.ei-paydl { margin-bottom: 8px; }
.ei-group { font-size: .92rem; margin: 16px 0 6px; color: var(--hx-ink); }
.ei-checklist { list-style: none; padding: 0; margin: 0; border: 1px solid var(--hx-line); border-radius: 10px; overflow: hidden; }
.ei-checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-top: 1px solid #F1F5F9; font-size: .9rem; }
.ei-checklist li:first-child { border-top: 0; }
.ei-mark { flex: none; min-width: 44px; text-align: center; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 99px; padding: 2px 8px; }
.ei-check-b { min-width: 0; overflow-wrap: anywhere; }
.is-ok .ei-mark { background: var(--leaf-soft); color: #1f5636; }
.is-bad { background: var(--bad-soft); }
.is-bad .ei-mark { background: var(--bad); color: #fff; }
.is-na .ei-mark { background: #F1F5F9; color: var(--hx-muted); }
.ei-note { font-size: .9rem; color: var(--hx-text); margin: 14px 0 0; padding: 12px 14px; background: #F8FAFC; border-radius: 10px; }
.ei-all { margin: 12px 0 0; }
.ei-all summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--hx-brand); }
.mt-card [tabindex="-1"]:focus { outline: none; }
.mt-sources li { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .mt-card .tool { padding: 12px; }
  .ei-parties, .ei-cols { grid-template-columns: minmax(0, 1fr); }
  .mt-bar { grid-template-columns: minmax(70px, 6.5rem) minmax(0, 1fr) auto; gap: 8px; }
  .mt-hint { display: block; margin: 2px 0 0; }
  .mt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Payment rows as cards on a phone, so the category menu is always in reach. */
  .mt-card table#mt-rows { min-width: 0; }
  #mt-rows thead { display: none; }
  #mt-rows tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid #F1F5F9; }
  #mt-rows td { padding: 0; border: 0; }
  #mt-rows td.desc { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  #mt-rows td:last-child { grid-column: 1 / -1; }
  #mt-rows .mt-rowsel { width: 100%; margin-top: 4px; }
  #mt-totals td:first-child { white-space: nowrap; }
  .mt-card table#mt-subs { min-width: 0; }
  .mt-card .table-wrap:has(> #mt-subs) { max-height: none; overflow: visible; }
  #mt-subs thead { display: none; }
  #mt-subs tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 12px; border-bottom: 1px solid #F1F5F9; }
  #mt-subs td { padding: 0; border: 0; text-align: left; }
  #mt-subs td:first-child { grid-column: 1 / -1; }
  #mt-subs td[data-l]::before { content: attr(data-l); display: block; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .05em; color: var(--hx-muted); }
  #mt-subs tr.mt-total { grid-template-columns: minmax(0, 1fr) auto; }
  #mt-subs tr.mt-total td:first-child { grid-column: auto; }
  #mt-subs td.mt-skip { display: none; }
}

/* PDF invoice to ZUGFeRD (_mt_zugferd.html) */
.hx-card.mt-card:has(#zf-form:not([hidden])) { max-width: 1120px; }
.zf-lines .zf-unit { min-width: 7.5em; }
.zf-lines .zf-rate { min-width: 6.5em; }
.zf-intro { margin: 0 0 12px; font-size: .92rem; color: var(--hx-text); }
.zf-box { border: 1px solid var(--hx-line); border-radius: 10px; padding: 8px 14px 14px; margin: 0 0 14px; min-width: 0; }
.zf-box > legend { font-weight: 700; color: var(--hx-ink); padding: 0 6px; font-size: 1rem; }
.zf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; }
.zf-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .86rem; color: var(--hx-muted); }
.zf-wide { grid-column: span 2; }
.zf-l { color: var(--hx-text); font-weight: 600; }
.zf-req { color: var(--bad); }
.zf-in.is-empty { background: #FFFBEB; border-color: #F5D58A; }
.zf-in.is-bad, .zf-in[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
.zf-vatmode { border: 0; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.zf-vatmode legend { margin-bottom: 6px; padding: 0; }
.zf-parties, .zf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.mt-card .table-wrap.zf-lines-wrap { margin: 0 0 8px; max-height: none; overflow-y: visible; }
.mt-card .tx.zf-lines { min-width: 860px; }
.zf-lines td { vertical-align: middle; padding: 6px 4px; }
.zf-lines .zf-name { min-width: 220px; }
.zf-lines .zf-num { width: 7.5em; text-align: right; }
.zf-lines .zf-qty { width: 5.5em; }
.zf-lines .mt-sel { min-height: 40px; }
.zf-rm { min-width: 44px; min-height: 44px; font-size: 1.3rem; text-decoration: none; color: var(--hx-muted); }
.zf-net { white-space: nowrap; font-variant-numeric: tabular-nums; }
.zf-totals .zf-num { width: 9em; text-align: right; }
.zf-totals thead th { position: static; }
.zf-totals td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.zf-checks .alert ul { margin-top: 6px; }
.zf-checks .alert li { margin: 4px 0; }
.zf-checks .linkish { text-align: left; color: inherit; }
.zf-confirm { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: .95rem; color: var(--hx-ink); cursor: pointer; }
.zf-confirm input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--hx-brand); }
.zf-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.zf-out-item .btn { width: 100%; min-height: 48px; }
.zf-out-item .btn[disabled] { opacity: .5; cursor: not-allowed; }
.zf-out-item .mt-meta { margin-top: 6px; }
.zf-done { margin-top: 14px; }
@media (max-width: 640px) {
  .zf-parties, .zf-cols, .zf-out { grid-template-columns: minmax(0, 1fr); }
  .zf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .zf-wide { grid-column: 1 / -1; }
  .zf-box { padding: 6px 10px 12px; }
  /* Lines as cards on a phone. */
  .mt-card .tx.zf-lines { min-width: 0; }
  .mt-card .table-wrap.zf-lines-wrap { max-height: none; overflow: visible; }
  .zf-lines thead { display: none; }
  .zf-lines tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--hx-line); }
  .zf-lines td { padding: 0; border: 0; min-width: 0; }
  .zf-lines td:first-child { grid-column: 1 / -1; }
  .zf-lines td[data-l]::before { content: attr(data-l); display: block; font-size: .74rem; color: var(--hx-muted); margin-bottom: 2px; text-align: left; }
  .zf-lines .zf-name { min-width: 0; width: 100%; }
  .zf-lines .zf-num, .zf-lines .mt-sel, .zf-lines .zf-unit, .zf-lines .zf-rate { width: 100%; min-width: 0; }
  .zf-lines td.zf-net { align-self: end; text-align: left; font-weight: 650; color: var(--hx-ink); padding-bottom: 10px; }
  .zf-lines td:last-child { justify-self: end; align-self: end; }
  .zf-totals { width: 100%; }
  .zf-totals .zf-num { width: 100%; min-width: 0; }
  .zf-totals th, .zf-totals td { padding: 6px 4px; }
}

/* Closing step into the core tool */
.mt-next { padding: 56px 0; }
.mt-next p { max-width: 640px; margin-left: auto; margin-right: auto; }
@media (max-width: 640px) { .mt-next { padding: 40px 0; } .mt-next .btn { width: 100%; } }
.mt-forms-one { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--hx-line); border-radius: 10px; background: #F8FAFC; font-size: .95rem; color: var(--hx-text); }

/* NF-e XML to DANFE and FatturaPA to Excel (invtool.html, 28 Oct 2026) */
.df-actions, .fa-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 12px; }
.df-actions .btn, .fa-actions .btn { min-height: 44px; }
.fa-csv-note { margin: -4px 0 12px; }
.df-st { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 99px; padding: 3px 10px; line-height: 1.3; }
.df-st.is-ok { background: var(--leaf-soft); color: #1f5636; }
.df-st.is-warn { background: #FEF3C7; color: #92400E; }
.df-st.is-bad { background: var(--bad-soft); color: var(--bad); border-radius: 8px; font-weight: 600; }
.hx-card.mt-card:has(#df-out:not([hidden])), .hx-card.mt-card:has(#fa-out:not([hidden])), .hx-card.mt-card:has(#wh-out:not([hidden])) { max-width: 1120px; }
.wh-boxes { margin: 6px 0 12px; padding-left: 1.4em; }
.wh-boxes li { margin: 0 0 4px; }
.wh-boxes .zf-confirm { margin: 6px 0; font-size: .9rem; }
.wh-appr { margin: 4px 0 10px; }
.wh-appr-row { margin: 0 0 8px; }
.wh-make { margin: 16px 0 8px; }
.wh-maptable td { vertical-align: middle; }
.wh-maptable .mt-sel { min-width: 200px; }
@media (max-width: 640px) {
  .wh-make .btn { width: 100%; }
  .wh-maptable .mt-sel { min-width: 0; width: 100%; }
  .mt-card .table-wrap:has(> .wh-maptable) { max-height: none; overflow: visible; }
  .wh-maptable, .wh-maptable tbody { display: block; width: 100%; }
  .wh-maptable thead { display: none; }
  .wh-maptable tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid #F1F5F9; }
  .wh-maptable td { padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .wh-maptable td:last-child { grid-column: 1 / -1; }
  .mt-card .tx.wh-rows { min-width: 0; }
  .mt-card .table-wrap:has(> .wh-rows) { max-height: none; overflow: visible; }
  .wh-rows thead { display: none; }
  .wh-rows tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid #F1F5F9; }
  .wh-rows td { padding: 0; border: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  .wh-rows td:first-child { display: none; }
  .wh-rows td.desc { grid-column: 1 / -1; min-width: 0; }
  .wh-rows td.num { text-align: left; white-space: normal; }
  .wh-rows td[data-l]::before { content: attr(data-l); display: block; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .05em; color: var(--hx-muted); }
}
.fa-dupes { margin: -4px 0 12px; color: #92400E; font-size: .9rem; }
.mt-card .tx.df-list td, .mt-card .tx.fa-list td { vertical-align: middle; }
.df-dl { min-height: 40px; white-space: nowrap; }
.fa-view { min-height: 40px; }
.fa-list abbr { text-decoration: none; cursor: help; }
.fa-detail { margin: 18px 0 0; padding: 14px 16px; border: 1px solid var(--hx-line); border-radius: 12px; background: #fff; }
.fa-detail .ei-party h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hx-muted); margin: 0 0 6px; }
.fa-detail .facts { margin: 12px 0 0; }
@media (max-width: 640px) {
  .df-actions .btn, .fa-actions .btn { flex: 1 1 100%; }
  .mt-card .tx.df-list, .mt-card .tx.fa-list { min-width: 0; }
  .df-list thead, .fa-list thead { display: none; }
  .df-list tr, .fa-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px;
    border-bottom: 1px solid #F1F5F9; }
  .df-list td, .fa-list td { padding: 0; border: 0; text-align: left; min-width: 0; }
  .df-list td.desc, .fa-list td.desc { grid-column: 1 / -1; }
  .df-list tr.df-bad td { grid-column: 1 / -1; }
  .mt-card .table-wrap:has(> .df-list), .mt-card .table-wrap:has(> .fa-list) { max-height: none; overflow: visible; }
  .df-list td[data-l]::before, .fa-list td[data-l]::before { content: attr(data-l); display: block; font-size: .72rem;
    text-transform: uppercase; letter-spacing: .05em; color: var(--hx-muted); }
  .fa-list tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fa-list td.num { text-align: left; }
  .fa-list td:last-child { grid-column: 1 / -1; }
  .fa-detail { padding: 12px; }
}

/* KSeF invoice viewer (30 Oct 2026): the open invoice prints alone as a readable copy. */
.ks-doc-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.ks-doc-head .mt-sub { margin: 0; }
.ks-flags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 0; }
.ks-flags li { font-size: .86rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef4ff; color: var(--hx-ink); }
.ks-corr { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--hx-line); }
.ks-corr p { margin: 0 0 4px; font-size: .92rem; overflow-wrap: anywhere; }
.ks-totals dd { font-weight: 700; }
.ks-before td { color: var(--hx-muted); text-decoration: line-through; }
.ks-notes { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; overflow-wrap: anywhere; }
@media print {
  html.ks-printing body * { visibility: hidden !important; }
  html.ks-printing #ks-detail, html.ks-printing #ks-detail * { visibility: visible !important; }
  html.ks-printing #ks-detail { position: absolute; left: 0; top: 0; width: 100%; border: 0; padding: 0; margin: 0; }
  html.ks-printing .ks-print-btn, html.ks-printing .ks-noprint { display: none !important; }
  html.ks-printing .table-wrap { overflow: visible !important; }
}
.ks-verify { margin: 14px 0 0; }
.ks-verify p { margin: 0 0 4px; font-size: .92rem; overflow-wrap: anywhere; }
