/* Invoices: drop zone, uploads, list, "already uploaded" dialog. */
#drop { border: 2px dashed var(--field-border); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--accent) 4%, var(--panel));
        padding: 32px var(--space-4); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
#drop:hover, #drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
#drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#drop .drop-icon { display: block; margin: 0 auto var(--space-2); color: var(--accent); }
#drop .drop-title { font-size: var(--text-xl); }
#drop strong { color: var(--accent-text); }
#drop .sub { margin: 6px 0 0; }
#dupdlg { max-width: min(560px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: var(--radius-xl);
          background: var(--panel); color: var(--text); padding: var(--space-5); overflow-wrap: anywhere; }
#dupdlg::backdrop { background: var(--backdrop); }
#dupdlg h2 { font-size: var(--text-xl); margin: 0 0 var(--space-2); }
#dupdlg ul { margin: var(--space-2) 0; padding-left: 18px; max-height: 40vh; overflow-y: auto; }
#dupdlg .sub { margin: var(--space-2) 0 0; }
#library h2 { margin: 0; }
#library td.sup a { color: var(--text); font-weight: 600; text-decoration: none; }
#library td.sup a:hover { color: var(--accent-text); text-decoration: underline; }
#library table { min-width: 640px; }
#library tbody tr { cursor: pointer; }
#library tbody tr:hover td { background: var(--bg); }
#library tbody tr.open td { background: var(--bg); }  /* the invoice open in Review */
#queue h2 { margin: 0; }
#queue-clear { margin-left: auto; }
/* minmax(0, …): a grid item is as wide as its content by default, so a long file name
   would push the row out of the card instead of being cut with an ellipsis. */
#queue-rows { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
#queue-rows li { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-1) 6px; border-radius: var(--radius-md); }
#queue-rows li .qname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#queue-rows li .qstate { color: var(--muted); max-width: 70%; text-align: right; overflow-wrap: anywhere; }
#queue-rows li .qstate a { display: inline-flex; align-items: center; min-height: var(--control-h-sm); }
#queue-rows li.failed .qstate { color: var(--err); }
#queue-rows li.done .qstate { color: var(--ok-text); }
#queue-rows li .qstate button { margin-left: var(--space-2); }
/* Open, as a button: it reads like the Open link. */
#queue-rows li .qstate button.ghost { margin-left: 0; padding: 0; font: inherit; text-decoration: underline; }
#queue-rows li.done, #queue-rows li.skipped[data-open] { cursor: pointer; }
#queue-rows li.done:hover, #queue-rows li.skipped[data-open]:hover, #queue-rows li.open { background: var(--bg); }
#lib-empty { margin: 0; }
@media (max-width: 640px) {
  /* The state goes under the file name. */
  #queue-rows li { flex-wrap: wrap; row-gap: 0; }
  #queue-rows li .qname { flex-basis: 100%; }
  #queue-rows li .qstate { max-width: none; text-align: left; }
  #library th:nth-child(2), #library td:nth-child(2), #library th:nth-child(6), #library td:nth-child(6), #library th:nth-child(7), #library td:nth-child(7) { display: none; }
  #library td:nth-child(5) { white-space: normal; }
  #library td:nth-child(5) .pill { margin: 1px 0; }
  #library table { min-width: 0; }
  #library th, #library td { padding-left: var(--space-1); padding-right: var(--space-1); }
}
/* Extraction off (/config): the zone stays in place, greyed, and takes no file. */
#drop[aria-disabled=true] { cursor: default; border-color: var(--border); background: var(--bg); color: var(--muted); }
#drop[aria-disabled=true]:hover { border-color: var(--border); background: var(--bg); }
#drop[aria-disabled=true] .drop-icon, #drop[aria-disabled=true] strong { color: var(--muted); }
#extract-off { margin: 0 0 var(--space-3); }
