/* Invoice reading dialog (invoices.js). Uses the ui.css tokens. */
dialog.inv-dialog{width:min(860px,calc(100vw - 32px));max-width:none;padding:0}
.inv{display:flex;flex-direction:column;max-height:calc(100dvh - 48px)}
.inv .form-dialog-head{flex:none}
.inv .form-dialog-actions{flex:none;justify-content:flex-end;flex-wrap:wrap}
.inv-body{flex:1;min-height:0;overflow:auto;padding:18px 22px 8px}
.inv-body p{margin:0}

.inv-drop{display:flex;flex-direction:column;align-items:center;gap:6px;padding:34px 18px;border:1.5px dashed var(--line-strong);border-radius:var(--r-lg);background:var(--panel);text-align:center;cursor:pointer;color:var(--ink);transition:border-color .15s,background-color .15s}
.inv-drop:hover,.inv-drop.over,.inv-drop:focus-within{border-color:var(--brand);background:var(--brand-soft)}
.inv-drop input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.inv-drop svg{width:34px;height:34px;fill:none;stroke:var(--brand);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;margin-bottom:4px}
.inv-drop strong{font-size:14px;font-weight:600}
.inv-drop span{font-size:12.5px}
.inv-privacy{font-size:12.5px;margin:12px 2px 0 !important;line-height:1.5}

.inv-recent{margin-top:18px}
.inv-recent h4{margin:0 0 6px;font-size:12px;font-weight:600;color:var(--fg-muted);text-transform:uppercase;letter-spacing:.04em}
.inv-recent ul{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden}
.inv-recent li+li{border-top:1px solid var(--line)}
.inv-recent-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;width:100%;padding:9px 12px;border:0;border-radius:0;background:none;color:var(--ink);font:inherit;font-size:13px;text-align:left;cursor:pointer}
.inv-recent-item:hover{background:var(--hover)}
.inv-file{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inv-when{font-size:12px;white-space:nowrap}
.inv-st{font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:var(--r-full);background:var(--line-soft);color:var(--fg-muted);white-space:nowrap}
.inv-st-read{background:var(--info-soft);color:var(--info-fg)}
.inv-st-applied{background:var(--ok-soft);color:var(--ok-fg)}
.inv-st-failed{background:var(--bad-soft);color:var(--bad-fg)}

.inv-reading{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px 12px 36px;text-align:center}
.inv-reading strong{font-size:14.5px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.inv-reading .muted{font-size:13px;max-width:46ch}
.inv-spin{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--brand);animation:inv-spin .8s linear infinite;margin-bottom:6px}
@keyframes inv-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.inv-spin{animation-duration:2.4s}}
.inv-error{padding:16px 0;color:var(--ink);font-size:14px}

.inv-notes{display:grid;gap:6px;margin-bottom:14px;padding:10px 12px;border-radius:var(--r-md);background:var(--info-soft);color:var(--info-fg);font-size:13px;line-height:1.45}
.inv-top{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px;margin-bottom:16px}
.inv-top>label{display:flex;flex-direction:column;gap:5px;font-size:12.5px;font-weight:500;color:var(--fg-muted)}
.inv-top .inv-over{grid-column:1/-1;flex-direction:row;align-items:center;gap:8px;font-weight:400;color:var(--ink);font-size:13px;cursor:pointer}
.inv-top .inv-over input{width:16px;height:16px;margin:0;accent-color:var(--brand)}

.inv-line{border:1px solid var(--line);border-radius:var(--r-lg);margin-bottom:12px;background:var(--panel)}
.inv-line header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;border-bottom:1px solid var(--line)}
.inv-line header>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.inv-line header strong{font-size:14px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.inv-line header .muted{font-size:12.5px}
.inv-w{display:flex;align-items:center;gap:8px;flex:none;font-size:12.5px;color:var(--fg-muted)}
.inv-w select{min-width:0;width:auto}
.inv-desc{padding:8px 14px 0;font-size:12.5px;overflow-wrap:anywhere}
.inv-line ul{list-style:none;margin:0;padding:6px 14px 8px}
.inv-row{display:flex;align-items:flex-start;gap:10px;padding:7px 0;font-size:13.5px;color:var(--ink)}
.inv-row+.inv-row{border-top:1px solid var(--line-soft)}
.inv-row>input{flex:none;width:16px;height:16px;margin:2px 0 0;accent-color:var(--brand)}
.inv-row>label,.inv-row>span{flex:1;min-width:0;cursor:pointer;overflow-wrap:anywhere}
.inv-row small{display:block;font-size:12px;color:var(--fg-muted);margin-top:2px}
.inv-row small.ok{color:var(--ok-fg)}
.inv-row>select{flex:none;width:auto;max-width:42%}
.inv-row.off{opacity:.65}
.inv-row.off>span{cursor:default}
.inv-row.note{padding-bottom:2px}
.inv-row code{font-family:var(--font-mono);font-size:12.5px;padding:1px 5px;border-radius:var(--r-xs);background:var(--line-soft)}
.inv-new{font-size:11.5px;font-weight:600;padding:1px 7px;border-radius:var(--r-full);background:var(--brand-soft);color:var(--brand-text)}
.inv-other{margin:4px 0 12px;font-size:13px}
.inv-other summary{cursor:pointer;color:var(--fg-muted);padding:4px 0}
.inv-other ul{list-style:none;margin:6px 0 0;padding:0}
.inv-other li{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-top:1px solid var(--line-soft)}
.inv-other li span:first-child{min-width:0;overflow-wrap:anywhere}
.inv-other li .muted{white-space:nowrap}
.inv-tax,.inv-none{font-size:12.5px;margin:0 0 8px !important}
.inv .form-error:empty{display:none}
/* Legacy dialog rules shrink .muted text and leave selects too little room for their arrow. */
dialog.inv-dialog .inv-row.note span{font-size:13px;line-height:1.45}
dialog.inv-dialog .inv-other li span{font-size:13px}
dialog.inv-dialog .inv-other li .muted{font-size:12.5px}
dialog.inv-dialog select{padding-right:32px;text-overflow:ellipsis}

@media (max-width:640px){
  .inv-body{padding:14px 16px 6px}
  .inv-top{grid-template-columns:minmax(0,1fr)}
  .inv-line header{flex-direction:column;align-items:stretch}
  .inv-w{justify-content:space-between}
  .inv-row{flex-wrap:wrap}
  .inv-row>select{max-width:none;margin-left:26px}
  .inv-recent-item{grid-template-columns:minmax(0,1fr) auto}
  .inv-when{display:none}
}
