/* Workflow navigation */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 21px;
}
.feature-grid button {
  min-height: 54px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.feature-grid button:hover {
  border-color: rgba(0,169,196,.45);
  color: var(--accent-strong);
  transform: translateY(-1px);
}
.feature-grid button.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #effbfd, #e7f7fa);
  color: #006f86;
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm);
}
body.dark .feature-grid button.active {
  background: #112f42;
  color: #74d8e5;
}

.scope-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  margin-bottom: 2px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.scope-tabs button {
  min-width: 132px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.scope-tabs button:hover:not(.active) { background: var(--surface-2); color: var(--ink); box-shadow: none; transform: none; }
.scope-tabs button.active { background: var(--accent-strong); color: #fff; box-shadow: 0 3px 8px rgba(0,126,150,.15); }

.tool-workspace {
  min-height: 330px;
  margin-top: 13px;
  padding: 22px;
}
.tool-workspace h3 { margin: 0 0 6px; font-size: 17px; }
.tool-workspace textarea { min-height: 126px; }
.tool-workspace .hint { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}
.inline-actions label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-right: 5px;
}
.inline-actions label input { width: auto; }

.empty-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.file-drop {
  padding: 34px 28px;
  border: 1px dashed #b8c9d5;
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input { background: transparent; }
.file-drop p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }

.command-card button + button { margin-left: 6px; }

dialog {
  width: min(820px, 92vw);
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0,0,0,.28);
}
dialog::backdrop { background: rgba(4, 16, 29, .72); backdrop-filter: blur(3px); }
dialog pre {
  max-height: 55vh;
  overflow: auto;
  padding: 15px;
  border: 1px solid #1e405b;
  border-radius: 10px;
  background: #0b1e32;
  color: #d2eaf1;
  white-space: pre-wrap;
}

.field-with-action { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.column-picker {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}
.column-picker > div { grid-column: 1 / -1; display: flex; gap: 7px; padding-bottom: 5px; }
.column-picker label { flex-direction: row; align-items: center; gap: 6px; font-size: 10px; font-weight: 650; }
.column-picker input { width: auto; accent-color: var(--accent-strong); }

/* Progressive lookup panel */
.lookup-progress-card {
  position: relative;
  margin-top: 16px;
  padding: 15px 16px;
  overflow: hidden;
  border: 1px solid #d3e1e8;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdfe, #f5f9fb);
  box-shadow: var(--shadow-sm);
}
.lookup-progress-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}
.lookup-progress-card.complete {
  border-color: #bfe4d6;
  background: linear-gradient(180deg, #f8fdfb, #effaf6);
}
.lookup-progress-card.complete::before { background: var(--success); }
body.dark .lookup-progress-card { border-color: var(--line); background: #0e2033; }
body.dark .lookup-progress-card.complete { background: #102c2a; border-color: #28564c; }

.lookup-progress-top,
.lookup-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lookup-progress-top { margin-bottom: 9px; }
.lookup-progress-top strong { color: var(--ink-strong); font-size: 12px; }
.lookup-progress-count { color: var(--accent-strong); font-size: 11px; font-weight: 800; }
.lookup-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce6ec;
  box-shadow: inset 0 1px 2px rgba(17,49,73,.08);
}
body.dark .lookup-progress-track { background: #254057; }
.lookup-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00a9c4, #07889f);
  box-shadow: 0 0 12px rgba(0,169,196,.22);
  transition: width .24s ease;
}
.lookup-progress-card.complete .lookup-progress-fill { background: linear-gradient(90deg, #24b682, #1d956c); }
.lookup-progress-meta { margin-top: 8px; color: var(--muted); font-size: 10px; }
.lookup-progress-current {
  max-width: 58%;
  overflow: hidden;
  color: #60748a;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lookup-progress-meta b { color: var(--ink); }

.stream-table-scroll {
  max-height: 460px;
  margin-top: 13px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stream-result-table { margin: 0; box-shadow: none; }
.stream-result-table thead { position: sticky; top: 0; z-index: 3; }
.stream-result-table thead td { background: #f2f7f9; }
body.dark .stream-result-table thead td { background: #15293d; }
.stream-row-new { animation: stream-row-arrive .7s ease; }
@keyframes stream-row-arrive {
  0% { background: rgba(0,169,196,.15); }
  100% { background: transparent; }
}
.stream-missing {
  max-height: 140px;
  margin-top: 10px;
  overflow: auto;
  border-radius: 9px;
}
.stream-missing-line {
  margin-top: 4px;
  padding: 6px 9px;
  border-left: 3px solid #c0ced8;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font: 10px/1.4 Consolas, monospace;
}
.stream-error-line { border-left-color: var(--danger); background: var(--danger-soft); color: #944348; }
body.dark .stream-error-line { background: #351f28; color: #e89ca0; }
.streaming-export-actions { margin-top: 11px; }

@media (max-width: 950px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .column-picker { grid-template-columns: repeat(2, minmax(140px,1fr)); }
}
@media (max-width: 650px) {
  .feature-grid { grid-template-columns: 1fr; }
  .scope-tabs { width: 100%; }
  .scope-tabs button { flex: 1; min-width: 0; }
  .lookup-progress-meta { align-items: flex-start; flex-direction: column; }
  .lookup-progress-current { max-width: 100%; text-align: left; }
  .column-picker { grid-template-columns: 1fr; }
}


/* Keep streamed lookup rows fixed in the exact order of the input box. */
.stream-order-placeholder td,
.stream-order-status td {
  padding: 10px 12px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
.stream-order-placeholder td {
  background: color-mix(in srgb, var(--surface) 94%, var(--soft));
  color: var(--muted);
}
.stream-order-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent2);
  font-size: 11px;
  font-weight: 700;
}
.stream-order-source {
  font-weight: 600;
  color: var(--ink);
}
.stream-order-state {
  margin-left: 10px;
  font-size: 12px;
  color: var(--muted);
}
.stream-order-missing td {
  background: #fff8e8;
  color: #8a6500;
}
.stream-order-error td {
  background: #fff0f0;
  color: #a03a3a;
}
body.dark .stream-order-missing td {
  background: #2d2818;
  color: #f1cf69;
}
body.dark .stream-order-error td {
  background: #321f25;
  color: #ff9ca8;
}

/* ==========================================================================\n   UI polish: larger selection controls and clearer workflow forms\n   ========================================================================== */

/* Larger, easier-to-hit checkboxes everywhere in workflow content. */
.tool-workspace input[type="checkbox"],
.column-picker input[type="checkbox"],
.inline-actions input[type="checkbox"] {
  width: 19px;
  height: 19px;
  min-width: 19px;
  margin: 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

/* Sensor option toggles are displayed as compact selectable cards. */
.tool-workspace .inline-actions label:has(input[type="checkbox"]) {
  min-height: 40px;
  padding: 8px 11px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.tool-workspace .inline-actions label:has(input[type="checkbox"]):hover {
  border-color: rgba(0,169,196,.48);
  background: var(--accent-soft);
}

/* Systems selector panel. */
.column-picker {
  margin-top: 17px;
  padding: 16px;
  gap: 9px 11px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.column-picker > div:first-child {
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 1px;
  border-bottom: 1px solid var(--line);
}
.column-picker label {
  min-height: 39px;
  padding: 8px 10px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.column-picker label:hover {
  border-color: var(--line);
  background: var(--surface);
  transform: translateY(-1px);
}
.column-picker label:has(input:checked) {
  border-color: rgba(0,169,196,.24);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
body.dark .column-picker label:has(input:checked) {
  background: #123447;
  color: #92e1ea;
}

/* Give form text areas a softer, more deliberate appearance. */
.tool-workspace textarea {
  min-height: 138px;
  padding: 13px 14px;
  border-radius: 11px;
  line-height: 1.55;
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(15,37,61,.025);
}
.tool-workspace textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,169,196,.10);
}

/* Redesigned CSV import surface. */
.file-drop {
  min-height: 300px;
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px dashed #b7cbd7;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0,169,196,.07), transparent 17rem),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.file-drop:hover {
  border-color: var(--accent);
  background:
    radial-gradient(circle at 50% 0%, rgba(0,169,196,.11), transparent 17rem),
    linear-gradient(180deg, var(--surface), var(--accent-soft));
}
.file-drop-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 29px;
  font-weight: 700;
  box-shadow: 0 7px 18px rgba(0,127,152,.10);
}
.file-drop-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.file-drop-copy strong {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 740;
}
.file-drop-copy span {
  color: var(--muted);
  font-size: 11px;
}
.file-picker-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  min-height: 40px;
  margin: 4px 0 0 !important;
  padding: 9px 17px;
  border-radius: 10px;
  background: var(--accent-strong);
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(0,127,152,.17);
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.file-picker-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0,127,152,.22);
}
.file-picker-button input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.file-selected-name {
  min-height: 29px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.file-selected-name.has-file {
  border-color: #b6dfd1;
  background: var(--success-soft);
  color: #187b59;
}
.file-format-hint {
  margin-top: 3px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}
.file-format-hint b { color: var(--ink); }
.file-format-hint span { margin: 0 5px; color: var(--muted-2); }

/* More breathing room and hierarchy in workflow cards. */
.tool-workspace {
  padding: 24px;
  border-radius: 15px;
}
.tool-workspace h3 {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 760;
}
.tool-workspace .hint {
  margin-bottom: 15px;
  font-size: 11.5px;
}

@media (max-width: 950px) {
  .column-picker label { min-height: 42px; }
}

/* Column selection dialog used by Copy, CSV and Excel exports. */
.column-selection-dialog {
  width: min(1040px, 94vw);
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(7, 23, 40, .28);
}
.column-selection-dialog::backdrop {
  background: rgba(4, 18, 32, .58);
  backdrop-filter: blur(3px);
}
.column-dialog-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 36px;
  gap: 14px;
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.column-dialog-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 27px;
  font-weight: 800;
}
.column-dialog-header h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: 760;
}
.column-dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.column-dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}
.column-dialog-close:hover { background: var(--surface-high); color: var(--ink); }
.column-dialog-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
}
.column-dialog-selected {
  display: flex;
  align-items: center;
  gap: 10px;
}
.column-dialog-check {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.column-selected-count { font-size: 13px; color: var(--ink); }
.column-selected-percent { font-size: 12px; color: var(--muted); font-weight: 700; }
.column-order-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px 18px;
  align-items: center;
  margin: 16px 24px 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}
.column-order-copy { display: grid; gap: 3px; }
.column-order-copy strong { font-size: 12px; color: var(--ink-strong); }
.column-order-copy span, .column-order-hint { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.column-order-modes {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.column-order-mode {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
}
.column-order-mode.active {
  background: var(--accent-strong);
  color: #fff;
}
.column-order-hint { grid-column: 1 / -1; }
.column-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 48vh;
  overflow: auto;
  padding: 8px 24px 18px;
}
.column-choice {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.column-choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.column-choice.selected {
  border-color: color-mix(in srgb, var(--accent) 75%, var(--line));
  border-left-color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}
.column-choice-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  font-size: 17px;
  font-weight: 800;
}
.column-choice.selected .column-choice-mark {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}
.column-choice-copy { display: grid; gap: 3px; min-width: 0; }
.column-choice-copy strong { color: var(--ink-strong); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column-choice-copy small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column-choice-order {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.column-dialog-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr 1fr;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.column-dialog-footer button { min-height: 42px; }
.column-dialog-footer .column-confirm { background: var(--accent-strong); }
.column-dialog-footer .column-confirm:disabled { opacity: .45; cursor: not-allowed; }
body.dark .column-selection-dialog { box-shadow: 0 28px 90px rgba(0, 0, 0, .5); }
@media(max-width:760px){
  .column-selection-grid { grid-template-columns: 1fr; }
  .column-order-panel { grid-template-columns: 1fr; }
  .column-order-modes { width: 100%; }
  .column-order-mode { flex: 1; }
  .column-dialog-footer { grid-template-columns: 1fr 1fr; }
}

/* Shared Stop Processing control for every streamed lookup workspace. */
.lookup-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.lookup-progress-title,
.lookup-progress-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lookup-progress-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.lookup-stop-button {
  padding: 7px 13px;
  border: 1px solid #e4a1a1;
  background: #fff4f4;
  color: #a53c3c;
  box-shadow: none;
  font-size: 12px;
}
.lookup-stop-button:hover:not(:disabled) {
  border-color: #cf6767;
  background: #ffe8e8;
  color: #8d2525;
}
.lookup-stop-button:disabled {
  cursor: default;
  opacity: .72;
}
.lookup-progress-card.stopped {
  border-color: #e9b3b3;
  background: linear-gradient(180deg, #fffafa, #fff5f5);
}
.lookup-progress-card.stopped .lookup-progress-state {
  background: #fde4e4;
  color: #a53c3c;
}
.lookup-progress-card.stopped .lookup-progress-fill {
  background: #d87979;
}
.dark .lookup-stop-button {
  background: #3b2328;
  border-color: #71414a;
  color: #ffb9bf;
}
.dark .lookup-progress-card.stopped {
  background: #2c2025;
  border-color: #68414a;
}
@media(max-width:700px){
  .lookup-progress-top { align-items: flex-start; }
  .lookup-progress-actions { flex-wrap: wrap; justify-content: flex-end; }
  .lookup-stop-button { width: 100%; }
}


/* ========================================================================== */
/* 2026-09 Billing visibility + shared workflow progress refinement            */
/* ========================================================================== */

/* Author-level label styles can override the browser's default [hidden]
   rule. Keep hidden workflow fields truly absent from the grid. */
[hidden],
#billing-customer-field[hidden],
#load-billing-customers[hidden] {
  display: none !important;
}

/* Shared status surface used by every streamed Gateway/Sensor/System lookup. */
.lookup-progress-card {
  position: relative;
  overflow: hidden;
  margin: 4px 0 14px;
  padding: 15px 17px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent-soft) 72%, transparent) 0, transparent 38%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: 0 10px 30px rgba(20, 46, 69, .07);
}
.lookup-progress-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}
.lookup-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.lookup-progress-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.lookup-progress-title strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.1px;
}
.lookup-progress-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .55px;
  text-transform: uppercase;
}
.lookup-progress-state::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
}
.lookup-progress-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lookup-progress-count {
  min-width: 104px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.lookup-stop-button {
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface));
  color: var(--danger);
  box-shadow: none;
  font-size: 10px;
  font-weight: 750;
}
.lookup-stop-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--danger) 60%, var(--line));
  background: var(--danger-soft);
}
.lookup-stop-button:disabled { opacity: .62; cursor: default; transform: none; }
.lookup-progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-high) 72%, var(--bg));
  box-shadow: inset 0 1px 2px rgba(21, 43, 62, .08);
}
.lookup-progress-fill {
  position: relative;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), #29b6c8);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 34%, transparent);
  transition: width .28s ease;
}
.lookup-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 15%, rgba(255,255,255,.42) 50%, transparent 85%);
  animation: lookup-progress-shimmer 1.7s linear infinite;
}
@keyframes lookup-progress-shimmer { to { transform: translateX(100%); } }
.lookup-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}
.lookup-progress-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.lookup-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
.lookup-stat b { font-size: 11px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.lookup-stat-found { border-color: color-mix(in srgb, var(--success) 24%, var(--line)); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.lookup-stat-missing { border-color: color-mix(in srgb, var(--warning) 25%, var(--line)); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.lookup-progress-current {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.lookup-progress-card.complete {
  border-color: color-mix(in srgb, var(--success) 32%, var(--line));
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--success) 10%, transparent) 0, transparent 38%),
    linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--success) 4%, var(--surface-2)));
}
.lookup-progress-card.complete::before { background: var(--success); }
.lookup-progress-card.complete .lookup-progress-state {
  border-color: color-mix(in srgb, var(--success) 30%, var(--line));
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  color: var(--success);
}
.lookup-progress-card.complete .lookup-progress-fill {
  background: linear-gradient(90deg, #1d956c, #25b681, #45c99a);
}
.lookup-progress-card.complete .lookup-progress-fill::after { animation: none; }
.lookup-progress-card.stopped {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--warning) 6%, var(--surface-2)));
}
.lookup-progress-card.stopped::before { background: var(--warning); }
.lookup-progress-card.stopped .lookup-progress-state {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--line));
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  color: #9a6710;
}
.lookup-progress-card.stopped .lookup-progress-fill {
  background: linear-gradient(90deg, #d39a2f, #e0ad49);
}
.lookup-progress-card.stopped .lookup-progress-fill::after { animation: none; }
body.dark .lookup-progress-card {
  background: linear-gradient(180deg, #11263a, #0f2134);
  box-shadow: none;
}
body.dark .lookup-stat { background: #12283b; }
body.dark .lookup-progress-track { background: #203a50; border-color: #29445a; }

@media (max-width: 760px) {
  .lookup-progress-top,
  .lookup-progress-meta { align-items: flex-start; flex-direction: column; }
  .lookup-progress-actions { width: 100%; justify-content: space-between; }
  .lookup-progress-current { max-width: 100%; width: 100%; text-align: left; }
}

/* ========================================================================== */
/* 2026-10 Stop visibility + transient retry status                           */
/* ========================================================================== */
.lookup-stop-button {
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid #b82e3a;
  background: linear-gradient(180deg, #e34b58 0%, #c83240 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 50, 64, .24), inset 0 1px 0 rgba(255,255,255,.16);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .15px;
}
.lookup-stop-button:hover:not(:disabled) {
  border-color: #a82330;
  background: linear-gradient(180deg, #ed5965 0%, #bd2937 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(200, 50, 64, .32), inset 0 1px 0 rgba(255,255,255,.18);
  transform: translateY(-1px);
}
.lookup-stop-button:focus-visible {
  outline: 3px solid rgba(227, 75, 88, .24);
  outline-offset: 2px;
}
.lookup-stop-button:disabled {
  opacity: .72;
  background: color-mix(in srgb, var(--danger-soft) 75%, var(--surface));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  box-shadow: none;
}
.lookup-stop-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 9px;
  line-height: 1;
  transform: translateY(-.5px);
}
.lookup-stat-error {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface));
  color: var(--danger);
}
.lookup-stat-retry {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 68%, var(--surface));
  color: var(--accent-strong);
}
body.dark .lookup-stop-button:not(:disabled) {
  border-color: #f06a74;
  background: linear-gradient(180deg, #d94a57 0%, #b92d3a 100%);
  color: #fff;
}

/* ========================================================================== */
/* Result table pagination                                                     */
/* ========================================================================== */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.table-pagination-group,
.table-pagination-nav,
.table-pagination-label {
  display: flex;
  align-items: center;
}

.table-pagination-group {
  gap: 18px;
  flex-wrap: wrap;
}

.table-pagination-label {
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.table-pagination select {
  width: auto;
  min-width: 72px;
  height: 36px;
  padding: 6px 30px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.table-page-size {
  min-width: 104px !important;
}

.table-page-range {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-pagination-nav {
  gap: 6px;
}

.table-pagination-nav button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
}

.table-pagination-nav button:disabled {
  opacity: .38;
  cursor: default;
  transform: none;
}

body.dark .table-pagination {
  background: #102337;
}

body.dark .table-pagination select {
  background: #142a3e;
}

@media (max-width: 760px) {
  .table-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-pagination-group {
    width: 100%;
    gap: 10px 14px;
  }

  .table-pagination-nav {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Independent CSV import workspace. */
.import-csv-ready {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.import-csv-ready[hidden] { display: none !important; }
.import-csv-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.import-csv-summary strong {
  color: var(--ink-strong);
  font-size: 12px;
}
.import-csv-content[hidden] { display: none !important; }
@media (max-width: 700px) {
  .import-csv-summary { align-items: flex-start; flex-direction: column; }
}

/* ========================================================================== */
/* 2026-10 Refined result-table pagination                                    */
/* ========================================================================== */
.table-pagination {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, var(--accent) 14%);
  border-radius: 14px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 97%, var(--accent-soft)),
      var(--surface));
  box-shadow: 0 5px 16px rgba(19, 46, 68, .055);
}

.table-pagination-group {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.table-pagination-label {
  display: grid;
  align-items: start;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .025em;
  line-height: 1.2;
  white-space: nowrap;
}

.table-pagination select {
  width: auto;
  min-width: 78px;
  height: 38px;
  margin: 0;
  padding: 7px 31px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--surface);
  color: var(--ink-strong);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 43, 61, .035);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.table-pagination select:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.table-pagination select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.table-page-size {
  min-width: 118px !important;
}

.table-page-range {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-pagination-nav button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.table-pagination-nav button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 126, 150, .09);
}

.table-pagination-nav button:active:not(:disabled) {
  transform: translateY(0);
}

.table-pagination-nav button:disabled {
  opacity: .30;
  cursor: default;
  transform: none;
  box-shadow: none;
}

body.dark .table-pagination {
  border-color: #274359;
  background: linear-gradient(180deg, #11263a, #0f2134);
  box-shadow: none;
}

body.dark .table-pagination select,
body.dark .table-page-range,
body.dark .table-pagination-nav button {
  border-color: #2b465c;
  background: #142b3f;
}

body.dark .table-pagination-nav button:hover:not(:disabled) {
  border-color: #318ca0;
  background: #14394a;
  color: #8bdce6;
}

@media (max-width: 760px) {
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .table-pagination-group {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(80px, .75fr) minmax(120px, 1fr) auto;
    align-items: end;
    gap: 9px;
  }

  .table-pagination select {
    width: 100%;
  }

  .table-pagination-nav {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .table-pagination-group {
    grid-template-columns: 1fr 1fr;
  }

  .table-page-range {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .table-pagination-nav {
    justify-content: space-between;
  }

  .table-pagination-nav button {
    flex: 1;
  }
}

/* Final Stop Processing typography override. */
.lookup-stop-button { font-weight: 500 !important; letter-spacing: 0 !important; }

/* ========================================================================== */
/* 2026-10 Workflow-wide refinement                                            */
/* ========================================================================== */
.tool-workspace {
  background:
    radial-gradient(circle at 100% 0%, rgba(0,169,196,.025), transparent 24rem),
    var(--surface);
}
.tool-workspace h3 { letter-spacing: -.18px; }
.tool-workspace .hint { max-width: 880px; }
.column-picker {
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.column-picker label {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.column-picker label:has(input:checked) {
  box-shadow: inset 0 0 0 1px rgba(0,169,196,.08);
}
.file-drop {
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 7px 22px rgba(15,37,61,.04);
}
.lookup-progress-card {
  box-shadow: 0 9px 25px rgba(15,37,61,.065);
}
.lookup-progress-title strong { letter-spacing: -.08px; }
.lookup-progress-track { height: 9px; }
.lookup-stat { min-height: 25px; }
.lookup-stop-button { font-weight: 500 !important; }
.stream-missing-line { border-radius: 7px; }
.streaming-export-actions {
  padding-top: 3px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

/* Pagination belongs visually to the result table rather than floating below it. */
.table-pagination {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-color: var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: 0 5px 16px rgba(15,37,61,.045);
}

body.dark .tool-workspace {
  background:
    radial-gradient(circle at 100% 0%, rgba(0,169,196,.035), transparent 24rem),
    #0f2235;
}
body.dark .column-picker label { background:#11283c; }

/* ========================================================================== */
/* 2026-10 Compact premium pagination footer                                  */
/* ========================================================================== */
.table-pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 13px 13px;
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-2));
  box-shadow: 0 5px 14px rgba(15, 37, 61, .035);
}

.table-pagination-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.table-pagination-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.table-pagination-label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.table-pagination select {
  height: 34px;
  min-width: 68px;
  margin: 0;
  padding: 5px 28px 5px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 92%, var(--ink) 8%);
  border-radius: 9px;
  background-color: var(--surface);
  color: var(--ink-strong);
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(15, 37, 61, .025);
}

.table-page-size {
  min-width: 92px !important;
}

.table-page-range {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.table-pagination-nav button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.table-pagination-nav button:hover:not(:disabled) {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 2px 6px rgba(15, 37, 61, .08);
  transform: none;
}

.table-pagination-nav button:disabled {
  opacity: .25;
  background: transparent;
}

body.dark .table-pagination {
  background: #102438;
  border-color: #29445a;
}
body.dark .table-pagination-nav {
  background: #12293d;
  border-color: #2b465c;
}
body.dark .table-pagination select {
  background: #12293d;
  border-color: #2b465c;
}
body.dark .table-page-range {
  background: #123447;
  color: #8bdae5;
}
body.dark .table-pagination-nav button:hover:not(:disabled) {
  background: #18374c;
}

@media (max-width: 760px) {
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .table-pagination-group {
    width: 100%;
  }
  .table-pagination-nav {
    align-self: flex-end;
  }
}

/* ========================================================================== */
/* Targeted typography refinement: Stop Processing only                       */
/* Match the lighter Clear / Lookup action typography without changing layout.*/
/* ========================================================================== */
.lookup-stop-button {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
