:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #111622; color: #e9eff8; }
body { margin: 0; }
main { width: min(100% - 32px, 1140px); margin: 24px auto 56px; }
a { color: #a9d6ff; }
h1 { margin: 14px 0 8px; font-size: clamp(22px, 4vw, 32px); }
h2 { font-size: 19px; }
p, small { color: #c6d1df; line-height: 1.55; }
button, input { font: inherit; }
button, input[type="search"], input[type="date"] { color: inherit; border: 1px solid #5a6c86; border-radius: 6px; background: #182334; padding: 8px 12px; }
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .55; }
#apply { background: #fcb365; color: #211608; border-color: #fcb365; font-weight: 700; }
.controls { padding: 14px; border: 1px solid #394a62; border-radius: 8px; background: #172130; }
.controls p { margin: 8px 0 0; }
#listing-expiry { margin-bottom: 16px; }
#listing-expiry [hidden] { display: none; }
#expiry-runs { max-height: 128px; overflow: auto; padding: 2px; }
#expiry-runs button { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.table-wrap { overflow: auto; border: 1px solid #394a62; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 700px; text-align: left; font-size: 14px; }
th, td { padding: 12px; vertical-align: top; border-bottom: 1px solid #394a62; }
th { background: #223148; }
#select-column, .selection-cell { width: 64px; text-align: center; white-space: nowrap; }
.selection-cell { padding: 4px 8px; vertical-align: middle; }
.selection-hit { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 6px; }
.selection-hit input { width: 22px; height: 22px; margin: 0; }
.selectable-row, .selectable-row .selection-hit, .selectable-row .selection-hit input { cursor: pointer; }
.selectable-row:hover > td { background: #1a2739; }
.selected-row > td, .selected-row:hover > td { background: #203854; }
.selected-row .selection-cell { box-shadow: inset 3px 0 #9fcfff; }
.selection-hit:focus-within { outline: 2px solid #9fcfff; outline-offset: -2px; }
td:nth-child(4) { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td .issue { color: #ffc383; margin-top: 6px; }
ul { padding-left: 20px; }
li + li { margin-top: 8px; }
li button { margin-left: 12px; }
[hidden] { display: none !important; }
#settings h2 { margin: 0 0 12px; }
.scope-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend { font-size: 14px; font-weight: 700; padding: 0 0 5px; }
input[type="number"], select { font: inherit; color: inherit; background: #111b28; border: 1px solid #5a6c86; border-radius: 6px; padding: 8px; }
input[type="number"] { width: min(100%, 120px); box-sizing: border-box; }
input[type="checkbox"] { accent-color: #fcb365; }
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.help { font-size: 13px; }
#settings .help { margin: 6px 0 12px; }
.primary { background: #fcb365; border-color: #fcb365; color: #211608; font-weight: 700; }
.compact { margin-top: 12px; padding: 10px 14px; }
summary { cursor: pointer; }
summary + p { margin: 8px 0; }
.summary button[aria-pressed="true"], button[aria-pressed="true"] { border-color: #9fcfff; background: #274460; }
.summary:empty { display: none; }
.identity { display: flex; gap: 10px; align-items: start; }
.thumb { padding: 0; border: 0; background: none; flex: none; }
.thumb img { display: block; width: 42px; height: 60px; object-fit: contain; border-radius: 4px; }
.expiry-price-entry { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.expiry-price-entry input { width: 68px; padding: 5px 6px; }
.expiry-price-entry input:invalid { border-color: #ffc383; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.row-actions button { padding: 4px 7px; font-size: 12px; }
dialog { width: min(520px, calc(100% - 56px)); max-height: 76vh; border: 1px solid #5a6c86; border-radius: 10px; background: #172130; color: #e9eff8; }
dialog::backdrop { background: #0009; }
#detail[open]:has(.expiry-confirmation) {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
#detail:has(.expiry-confirmation) > .actions { flex: none; margin: 0; }
#detail:has(.expiry-confirmation) > #detail-body,
.expiry-confirmation { display: flex; flex-direction: column; min-height: 0; }
.expiry-confirmation > p { flex: none; margin: 8px 0; }
.expiry-confirmation-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #394a62;
  border-radius: 6px;
  padding-inline: 12px;
  overflow-wrap: anywhere;
}
.expiry-confirmation-list li:last-child p:last-child { margin-bottom: 0; }
.expiry-confirmation .expiry-confirmation-footer { flex: none; justify-content: flex-end; margin: 12px 0 0; }
dialog h2 { flex: 1; }
dialog img { display: block; max-width: 100%; max-height: 67vh; margin: auto; object-fit: contain; }
@media (max-width: 640px) { .scope-fields { grid-template-columns: 1fr; } }
