/* delivery-log.css — Delivery Log tab */

#view-delivery-log { flex: 1; overflow-y: auto; }
.dl-app { max-width: 1480px; margin: 1.5rem auto; padding: 0 1.25rem; font-family: var(--font-sans); color: var(--text); }

.dl-hdr { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .75rem; }
.dl-hdr h2 { font-size: 20px; font-weight: 700; margin: 0; }
.dl-hdr p { font-size: 13px; color: var(--text-faint); margin: 2px 0 0; }

/* Delivery price A/B test card */
.dl-ab-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 16px; }
.dl-ab-hdr { display: flex; align-items: center; gap: 10px; }
.dl-ab-hdr h3 { font-size: 15px; font-weight: 700; margin: 0; }
.dl-ab-hdr .dl-refresh-btn { margin-left: auto; align-self: center; }
.dl-ab-salt { font-size: 10px; font-weight: 600; color: var(--text-faint); background: var(--surface2);
  border: 1px solid var(--border-light); border-radius: 4px; padding: 1px 6px; margin-left: 6px;
  font-family: var(--font-mono, monospace); }
.dl-ab-meta { font-size: 12px; color: var(--text-dim); margin: 6px 0 10px; }
.dl-ab-tbl td, .dl-ab-tbl th { font-size: 12px; }
.dl-ab-tbl tbody tr { cursor: default; }
.dl-ab-mult { font-size: 10px; color: var(--text-faint); font-weight: 600; margin-left: 4px; }
.dl-ab-note { font-size: 11px; color: var(--text-faint); margin: 8px 0 0; }
.dl-ab-flatter { font-size: 10.5px; color: var(--text-faint); font-style: italic; }
.dl-ab-pos { color: #047857; font-weight: 700; }
.dl-ab-neg { color: #dc2626; font-weight: 700; }

/* Big verdict badge */
.dl-ab-bigbadge { font-size: 12.5px; padding: 4px 12px; }

/* Plain-English (ELI5) verdict banner */
.dl-ab-eli5 { font-size: 13.5px; line-height: 1.5; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 12px 16px; margin: 10px 0 12px; }
.dl-ab-eli5-list { margin: 6px 0 6px; padding-left: 20px; }
.dl-ab-eli5-list li { margin: 3px 0; }
.dl-ab-verdict-line { margin-top: 8px; font-size: 13.5px; }

/* Stats strip (the rigorous numbers under the table) */
.dl-ab-stats { font-size: 11.5px; line-height: 1.7; color: var(--text-dim);
  background: var(--surface); border: 1px dashed var(--border-light);
  border-radius: var(--radius); padding: 8px 12px; margin: 10px 0 0; }

/* Pass/Fail chips */
.dl-chips { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.dl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border-light); background: var(--surface); color: var(--text-dim);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s; }
.dl-chip:hover { border-color: var(--accent); }
.dl-chip .dl-chip-n { font-variant-numeric: tabular-nums; font-weight: 800; }
.dl-chip.on.dl-chip-all { background: var(--text); color: #fff; border-color: var(--text); }
.dl-chip.on.dl-chip-pass { background: #047857; color: #fff; border-color: #047857; }
.dl-chip.on.dl-chip-fail { background: #dc2626; color: #fff; border-color: #dc2626; }
.dl-chip-pass .dl-chip-n { color: #047857; }
.dl-chip-fail .dl-chip-n { color: #dc2626; }
.dl-chip.on .dl-chip-n { color: #fff; }
.dl-chip-sub { font-size: 12px; color: var(--text-faint); margin-left: 4px; }

/* Filter row */
.dl-filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dl-fg { display: flex; flex-direction: column; gap: 2px; }
.dl-fg label { font-size: 9px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.dl-fg select, .dl-fg input { font-size: 12px; padding: 5px 8px; border: 1px solid var(--border-light);
  border-radius: var(--radius); background: var(--surface); color: var(--text); height: 30px; outline: none; }
.dl-fg input[type="text"] { width: 220px; }
.dl-fg select:focus, .dl-fg input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(45,106,79,.15); }
.dl-refresh-btn { font-size: 14px; color: var(--text-faint); border: none; background: none; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; line-height: 1; align-self: flex-end; height: 30px; }
.dl-refresh-btn:hover { color: var(--accent); }

/* Table */
.dl-table-wrap { position: relative; min-height: 200px; }
.dl-table-wrap.dl-loading { opacity: .5; pointer-events: none; }
.dl-tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; }
.dl-tbl th { background: var(--surface2); font-size: 10px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .06em; padding: 9px 12px; text-align: left; white-space: nowrap; }
.dl-tbl th.dl-sortable { cursor: pointer; user-select: none; }
.dl-tbl th.dl-sortable:hover { color: var(--text-dim); }
.dl-tbl th.sorted { color: var(--text-dim); }
.dl-si { font-size: 9px; }
.dl-tbl td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.dl-tbl tbody tr { cursor: pointer; transition: background .1s; border-left: 3px solid transparent; }
.dl-tbl tbody tr:hover { background: var(--surface2); }
.dl-row-error { border-left-color: #dc2626; }
.dl-row-no_rate { border-left-color: #d97706; }
.dl-row-success { border-left-color: #34d399; }
.dl-time { white-space: nowrap; color: var(--text-dim); font-size: 12px; }
.dl-dest { white-space: nowrap; }
.dl-city { display: block; font-size: 11px; color: var(--text-faint); }
.dl-num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font); font-size: 12px; }
.dl-open { color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }

.dl-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; }
.dl-ok { background: #d1fae5; color: #065f46; }
.dl-err { background: #fee2e2; color: #991b1b; }
.dl-warn { background: #fef3c7; color: #92400e; }
.dl-fallback { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px; font-size: 9px;
  font-weight: 700; text-transform: uppercase; background: rgba(217,119,6,.12); color: #b45309; border: 1px solid rgba(217,119,6,.3); }

.dl-empty { text-align: center; padding: 48px 24px; color: var(--text-faint); }
.dl-empty h3 { font-size: 16px; color: var(--text-dim); margin: 0 0 6px; }

/* Pagination */
.dl-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0; }
.dl-pg { font-size: 13px; font-weight: 600; padding: 6px 14px; border: 1px solid var(--border-light);
  border-radius: var(--radius); background: var(--surface); color: var(--text-dim); cursor: pointer; }
.dl-pg:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.dl-pg:disabled { opacity: .4; cursor: default; }
.dl-pg-info { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* Detail overlay */
.dl-detail-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.dl-detail-panel { background: var(--surface); border-radius: var(--radius-lg); max-width: 820px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); padding: 20px 24px 28px; }
.dl-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dl-detail-time { font-size: 13px; color: var(--text-faint); margin-left: 8px; }
.dl-detail-x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text-faint); line-height: 1; }
.dl-detail-x:hover { color: var(--text); }
.dl-detail-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.dl-detail-error strong { color: #b91c1c; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.dl-detail-error-amber { background: #fffbeb; border-color: #fde68a; }
.dl-detail-error-amber strong { color: #92400e; }
.dl-detail-error pre { margin: 6px 0 0; font-size: 11px; white-space: pre-wrap; word-break: break-word; color: var(--text-dim); }
.dl-kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 16px; }
.dl-kv { display: flex; flex-direction: column; gap: 1px; }
.dl-kv-k { font-size: 9px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.dl-kv-v { font-size: 13px; color: var(--text); word-break: break-word; }
.dl-section-title { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: .06em; margin: 14px 0 8px; }
.dl-items { display: flex; flex-direction: column; gap: 4px; }
.dl-item { font-size: 12px; padding: 6px 8px; background: var(--surface2); border-radius: 6px; }
.dl-item code { font-family: var(--font); color: var(--accent); }
.dl-item-name { color: var(--text-faint); margin-left: 6px; }
.dl-raw { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  font-size: 11px; font-family: var(--font); line-height: 1.5; max-height: 360px; overflow: auto;
  white-space: pre; color: var(--text-dim); }
