:root {
  color-scheme: light;
  --paper: oklch(0.99 0.004 70);
  --surface: oklch(0.967 0.005 70);
  --hover: oklch(0.945 0.006 70);
  --ink: oklch(0.285 0.009 65);
  --muted: oklch(0.52 0.009 65);
  --line: oklch(0.875 0.009 65);
  --accent: oklch(0.52 0.14 32);
  --accent-hover: oklch(0.47 0.135 32);
  --accent-soft: oklch(0.94 0.025 32);
  --success: oklch(0.45 0.08 150);
  --warning: oklch(0.47 0.08 75);
  --warning-soft: oklch(0.967 0.021 75);
  --danger: oklch(0.5 0.16 25);
  --radius: 6px;
  --control-height: 40px;
  --control-height-compact: 34px;
  --control-height-large: 48px;
  --control-padding-inline: 12px;
  --control-padding-block: 8px;
  --button-padding-inline: 16px;
  --field-font-size: 14px;
  --control-font-size: 14px;
  --control-font-size-compact: 12px;
  --control-icon-size: 16px;
  --control-icon-gap: 8px;
  --control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23766f6a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  --menu-padding: 4px;
  --menu-shadow: 0 8px 20px oklch(0.28 0.01 65 / 0.09);
  --header-surface: oklch(0.976 0.005 70);
  --page-gutter: 32px;
  --workspace-top: 24px;
  --section-gap: 20px;
  --table-cell-padding: 12px;
  font:
    14px/1.45 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow-wrap: anywhere;
}
body[data-startup="pending"],
body[data-startup="loading"],
body[data-startup="failed"] {
  overflow: hidden;
}
#catalog-app[inert] {
  visibility: hidden;
}
.startup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}
.startup-content {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 38ch;
  text-align: center;
}
.startup-content p {
  color: var(--muted);
}
.startup-progress {
  width: 160px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.startup-progress::after {
  content: "";
  display: block;
  width: 48px;
  height: 100%;
  background: var(--accent);
  animation: startup-progress 1.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
#startup-retry {
  min-height: 44px;
  min-width: 112px;
}
.startup-fallback {
  position: absolute;
  inset-inline-end: 24px;
  bottom: 24px;
  min-height: 44px;
}
body:not([data-startup="pending"]) .startup-fallback {
  display: none;
}
@keyframes startup-progress {
  from {
    transform: translateX(-48px);
  }
  to {
    transform: translateX(160px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .startup-progress::after {
    animation: none;
    transform: translateX(56px);
  }
}
button,
input,
select,
summary {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
summary,
select {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  background: none;
  border: 0;
}
.button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px var(--control-padding-inline);
  font-size: var(--control-font-size-compact);
  min-height: var(--control-height-compact);
}
.login-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(100%, 320px);
}
.login-panel h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
}
.login-panel form {
  display: grid;
  gap: 10px;
}
.login-panel .button {
  margin-top: 6px;
}
.login-error {
  color: var(--danger);
  font-size: 12px;
}
.login-error:empty {
  display: none;
}
#history {
  width: 400px;
  max-width: 100%;
  height: var(--control-height-compact);
  border-color: transparent;
  background-color: transparent;
  color: var(--muted);
}
#history:hover {
  border-color: var(--line);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-icon-gap);
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-height);
  padding: var(--control-padding-block) var(--button-padding-inline);
  border-radius: var(--radius);
  font-weight: 550;
  font-size: var(--control-font-size);
  white-space: normal;
  transition: background-color 160ms ease-out;
}
.primary {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
}
.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.secondary {
  background: var(--paper);
  border: 1px solid var(--line);
}
.secondary:hover:not(:disabled) {
  background: var(--surface);
}
.disabled {
  opacity: 0.45;
  pointer-events: none;
}
button:disabled,
input:disabled,
select:disabled {
  cursor: default;
  opacity: 0.45;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input:where(:not([type="checkbox"]):not([type="radio"])),
select {
  min-width: 0;
  height: var(--control-height);
  font-size: var(--field-font-size);
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 0 var(--control-padding-inline);
}
select {
  text-overflow: ellipsis;
}
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: right var(--control-padding-inline) center;
  background-size: var(--control-icon-size);
  padding-inline-end: calc(
    var(--control-padding-inline) + var(--control-icon-size) +
      var(--control-icon-gap)
  );
}
@media (forced-colors: active) {
  select:not([multiple]) {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
  }
}
@media (max-width: 620px) {
  :root {
    --control-height: 44px;
    --control-height-compact: 44px;
    --field-font-size: 16px;
    --control-font-size-compact: 13px;
    --page-gutter: 16px;
    --workspace-top: 20px;
  }
}
input::placeholder {
  color: var(--muted);
  opacity: 1;
}
input:not([type="checkbox"]):not([type="radio"]):hover:not(:disabled),
select:hover:not(:disabled) {
  border-color: var(--muted);
}
input:focus,
select:focus {
  border-color: var(--muted);
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2,
h3 {
  font-size: 16px;
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.topbar {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px var(--page-gutter);
  border-bottom: 1px solid var(--line);
  background: var(--header-surface);
}
.surface-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.surface-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  min-height: 40px;
  font-size: 14px;
  border-radius: var(--radius);
}
.surface-nav button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--paper);
  font-weight: 550;
}
.surface-nav button:hover:not([aria-pressed="true"]) {
  color: var(--ink);
  background: var(--surface);
}
.history-surface {
  display: flex;
  flex: 1;
  min-width: 0;
}
.product-open {
  padding: 0;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
}
.product-open:hover {
  color: var(--accent);
}
@media (max-width: 820px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 4px;
  }
  .surface-nav {
    grid-column: 1 / -1;
  }
  .surface-nav button {
    min-height: 44px;
  }
  .product-open {
    min-height: 44px;
  }
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  justify-content: space-between;
}
.logout {
  flex: none;
}
.process-trigger {
  flex: none;
  gap: var(--control-icon-gap);
  font-size: var(--control-font-size-compact);
  min-height: var(--control-height-compact);
  padding: 6px var(--control-padding-inline);
}
#process-count,
#process-shared-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.process-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}
.process-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 12px 40px oklch(0.28 0.01 65 / 0.14);
}
.process-dialog[open] {
  display: flex;
  flex-direction: column;
}
.process-dialog::backdrop {
  background: oklch(0.28 0.01 65 / 0.3);
}
.process-dialog-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px 20px;
}
.process-dialog-header h2 {
  font-size: 18px;
}
.process-scopes {
  display: flex;
  flex: none;
  gap: 4px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--line);
}
.process-scopes button {
  min-height: var(--control-height);
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.process-scopes button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
}
.process-scopes button:hover {
  color: var(--ink);
}
.process-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0 20px 12px;
  margin: 0;
  list-style: none;
}
.process-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.process-description {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.process-name {
  font-size: 15px;
  margin: 0 0 4px;
}
.process-meta,
.process-counts,
.process-phase,
.process-timing {
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.process-counts,
.process-timing {
  font-variant-numeric: tabular-nums;
}
.process-actions {
  display: flex;
  flex-wrap: wrap;
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.process-action {
  min-height: var(--control-height);
  font-size: var(--control-font-size-compact);
  padding: var(--control-padding-block) var(--control-padding-inline);
}
.process-stop {
  color: var(--danger);
}
.process-confirmation {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.process-error {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0 0;
  color: var(--danger);
  overflow-wrap: anywhere;
}
.process-empty,
.process-connection {
  flex: none;
  margin: 0;
  padding: 16px 20px 24px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.process-connection {
  padding-bottom: 12px;
}
.process-refresh {
  flex: none;
  align-self: flex-start;
  margin: 0 20px 16px;
  min-height: 44px;
}
.logout #excel {
  font-size: 13px;
}
.catalog-export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  margin-bottom: 12px;
  min-width: 0;
}
.catalog-filters:not([hidden]) + .catalog-export {
  padding-top: 0;
}
.catalog-selection {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  max-width: 100%;
}
.table-summary,
.export-scope {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.catalog-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}
.catalog-export-error {
  flex-basis: 100%;
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.workspace {
  max-width: 1520px;
  margin: 0 auto;
  padding: var(--workspace-top) var(--page-gutter) 36px;
}
.setup {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px auto auto;
  align-items: end;
  gap: 12px;
  padding-bottom: 12px;
}
.setup label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.setup input,
.setup select {
  width: 100%;
}
.seller-control {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.city-control {
  grid-column: 2;
  grid-row: 1;
}
#start {
  grid-column: 3;
  grid-row: 1;
}
.settings-menu {
  grid-column: 4;
  grid-row: 1;
}
#merchant-presence-picker {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}
.schedule-panel {
  min-width: 0;
  margin: 0 0 var(--section-gap);
  border-bottom: 1px solid var(--line);
}
.schedule-panel > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height);
  list-style: none;
  font-size: 13px;
}
.schedule-panel > summary::-webkit-details-marker {
  display: none;
}
.schedule-panel > summary svg {
  margin-left: auto;
}
.schedule-panel[open] > summary svg {
  transform: rotate(180deg);
}
.schedule-total,
.schedule-scope,
.schedule-timing,
.schedule-next,
.schedule-empty {
  color: var(--muted);
  font-size: 12px;
}
.schedule-body {
  padding: 8px 0 18px;
}
.schedule-store {
  margin-bottom: 12px;
  font-weight: 550;
}
.schedule-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-width: 0;
}
.schedule-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}
.schedule-toggle input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}
.schedule-time-control label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
#schedule-time {
  width: 150px;
  max-width: 100%;
}
.schedule-scope {
  align-self: center;
  padding-top: 16px;
}
.schedule-error,
.schedule-notice {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.schedule-error {
  color: var(--danger);
}
.schedule-notice {
  color: var(--muted);
}
.schedule-hold {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 16px;
  color: var(--warning);
  font-size: 13px;
}
.schedule-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}
.schedule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.schedule-description {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  max-width: 100%;
}
.schedule-name {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 0;
  text-align: left;
  font-weight: 550;
}
.schedule-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 12px;
  min-width: 0;
}
.schedule-action {
  min-height: 44px;
  padding: 6px 0;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
}
.schedule-action:hover:not(:disabled),
.schedule-name:hover:not(:disabled) {
  color: var(--accent);
}
.schedule-empty {
  margin-top: 16px;
}
@media (max-width: 620px) {
  .schedule-form {
    gap: 12px;
  }
  .schedule-toggle {
    flex: 1 0 110px;
  }
  .schedule-scope {
    padding-top: 0;
  }
  .schedule-item {
    align-items: start;
    flex-direction: column;
  }
  .schedule-name {
    width: 100%;
  }
}
.merchant-field {
  position: relative;
}
.merchant-field[aria-busy="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 35%;
  height: 2px;
  background: var(--accent);
  animation: merchant-search 1.25s ease-in-out infinite;
  pointer-events: none;
}
@keyframes merchant-search {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(185%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .merchant-field[aria-busy="true"]::after {
    animation: none;
    width: 100%;
  }
}
#merchant {
  padding-inline-end: calc(
    var(--control-height) + var(--control-padding-inline)
  );
}
.clear-merchant {
  position: absolute;
  right: 0;
  top: 0;
  width: var(--control-height);
  height: var(--control-height);
  border-radius: var(--radius);
  font-size: 22px;
  color: var(--muted);
}
.merchant-empty {
  margin: 0;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
}
.setup-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}
.setup-status > span {
  min-width: 0;
  flex: 1 1 160px;
}
.setup-status .button {
  flex: none;
}
.collection-controls,
.run-controls,
.run-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.collection-controls {
  margin-left: auto;
}
.run-controls:not(:has(> button:not([hidden]))) {
  display: none;
}
#stop-active,
#stop-selected {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
}
#stop-active:hover:not(:disabled),
#stop-selected:hover:not(:disabled) {
  background: var(--surface);
}
.merchant-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: var(--menu-padding);
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--menu-shadow);
  z-index: 10;
}
.merchant-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: var(--control-padding-block) var(--control-padding-inline);
  border-radius: 4px;
}
.merchant-option-name {
  min-width: 0;
}
.merchant-option small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}
.merchant-option:hover,
.merchant-option[aria-selected="true"] {
  background: var(--hover);
}
.settings-menu {
  position: relative;
}
.settings-menu > summary {
  display: flex;
  gap: var(--control-icon-gap);
  padding: 0 var(--control-padding-inline);
  font-size: var(--control-font-size-compact);
  align-items: center;
  justify-content: center;
  min-width: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
}
.settings-menu > summary::-webkit-details-marker {
  display: none;
}
.settings-menu > summary:hover,
.settings-menu[open] > summary {
  background: var(--surface);
}
.settings-panel {
  position: absolute;
  right: 0;
  top: 48px;
  width: 270px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--menu-shadow);
  z-index: 9;
}
.settings-panel label:not(:first-child),
.settings-panel > div label {
  margin-top: 14px;
}
#custom-city {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 190px minmax(180px, 300px);
  gap: 12px;
}
.results {
  min-width: 0;
}
.run-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 16px;
}
.run-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
h1 {
  min-width: 0;
  max-width: 100%;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
}
h1 span {
  margin-left: 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.run-date {
  color: var(--muted);
  font-size: 12px;
}
.run-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.status-label {
  font-size: 12px;
  color: var(--muted);
}
.status-label.running {
  color: var(--accent);
}
.status-label.blocked,
.status-label.failed {
  color: var(--danger);
}
.coverage-note {
  color: var(--warning);
  font-size: 12px;
  border-radius: 4px;
  padding: 4px 7px;
  background: var(--warning-soft);
}
.coverage-note:hover {
  text-decoration: underline;
}
.coverage-note[data-tone="neutral"] {
  color: var(--muted);
  background: var(--surface);
}
.coverage-explanation,
.collection-notice {
  max-width: 82ch;
  font-size: 13px;
  line-height: 1.55;
  margin: -4px 0 12px;
  color: var(--muted);
}
.collection-notice {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
}
.collection-notice.warning {
  background: var(--warning-soft);
  color: var(--ink);
}
.run-actions .button {
  min-height: 32px;
  font-size: 12px;
  padding: 6px 10px;
}
.notice {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  max-width: 75ch;
}
.notice.error {
  color: var(--danger);
  border-color: oklch(0.84 0.055 25);
  background: oklch(0.975 0.009 25);
}
.live-progress {
  margin-bottom: 20px;
}
.progress-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.phase {
  margin: 0;
  min-width: 0;
}
#progress-count {
  min-width: 0;
  color: var(--muted);
}
.progress-log {
  margin: 0 0 9px;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#progress-log-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.collection-timing {
  margin: 9px 0 0;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.progress-track {
  position: relative;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
}
.progress-activity {
  display: none;
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  border-radius: 2px;
  background: var(--accent);
  animation: progress-scan 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
[data-mode="indeterminate"] .progress-activity {
  display: block;
}
[data-mode="determinate"] #progress-fill {
  animation: progress-breathe 2s ease-in-out infinite;
}
@keyframes progress-scan {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(334%);
  }
}
@keyframes progress-breathe {
  50% {
    opacity: 0.75;
  }
}
.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  position: relative;
  min-height: 44px;
  padding: 0 0 2px;
  color: var(--muted);
  font-weight: 500;
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
}
.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}
.tabs button:hover {
  color: var(--ink);
}
#tab-count {
  display: inline-block;
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.catalog-filters {
  padding: 18px 0;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search svg {
  position: absolute;
  left: var(--control-padding-inline);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.search input {
  width: 100%;
  padding-left: calc(
    var(--control-padding-inline) + 18px + var(--control-icon-gap)
  );
  background: var(--surface);
  border-color: transparent;
}
.search input:hover {
  border-color: var(--line);
}
.search input:focus {
  background: var(--paper);
}
#sort {
  width: 214px;
  border-color: transparent;
  color: var(--muted);
}
#sort:hover {
  border-color: var(--line);
}
.filter-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.filter-toolbar select {
  width: auto;
  max-width: 320px;
  height: var(--control-height-compact);
  background-color: transparent;
}
.filter-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--control-icon-gap);
  min-height: var(--control-height-compact);
  padding: 6px var(--control-padding-inline);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--field-font-size);
  min-width: 0;
  max-width: 430px;
  text-align: left;
  background: var(--paper);
}
.filter-select > span {
  min-width: 0;
}
.filter-select > svg {
  width: var(--control-icon-size);
  height: var(--control-icon-size);
}
.filter-select:hover {
  background: var(--surface);
}
.filter-select.has-value {
  border-color: var(--muted);
}
#brand-picker {
  width: 180px;
}
.history-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  width: 360px;
  max-width: 100%;
  min-height: var(--control-height-large);
  padding: 6px var(--control-padding-inline);
  color: var(--ink);
  border-color: var(--line);
  background: var(--paper);
}
.history-picker.has-value {
  border-color: var(--line);
}
.history-picker-label {
  grid-column: 1;
  grid-row: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.history-picker-value {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.3;
}
.history-picker > svg {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--muted);
}
.picker-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}
.filter-dialog {
  width: min(540px, calc(100% - 32px));
  height: min(680px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 12px 40px oklch(0.28 0.01 65 / 0.14);
}
.filter-dialog[open] {
  display: flex;
  flex-direction: column;
}
.filter-dialog::backdrop {
  background: oklch(0.28 0.01 65 / 0.3);
}
.filter-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px 20px;
  flex: none;
}
.filter-dialog-header h2 {
  font-size: 18px;
}
.filter-dialog-close {
  width: 44px;
  height: 44px;
  font-size: 26px;
  color: var(--muted);
  border-radius: var(--radius);
}
.filter-dialog-close:hover {
  background: var(--surface);
}
.filter-dialog-search {
  padding: 0 20px 14px;
  flex: none;
  border-bottom: 1px solid var(--line);
}
.filter-dialog-search input {
  width: 100%;
  height: 44px;
  font-size: 16px;
}
.filter-dialog-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: 0;
  padding: 4px 8px 12px;
  list-style: none;
}
.filter-dialog-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border-radius: var(--radius);
  text-align: left;
}
.filter-dialog-option:hover {
  background: var(--surface);
}
.filter-dialog-option[aria-pressed="true"] {
  background: var(--accent-soft);
}
.filter-option-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.filter-option-name small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.filter-option-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.filter-dialog-empty {
  padding: 12px 20px;
  color: var(--muted);
  font-size: 13px;
  flex: none;
}
#category-filter {
  max-width: 430px;
}
#brand-filter {
  width: 180px;
}
#status-filter {
  width: 224px;
}
.clear-filters {
  padding: 5px 8px;
  font-size: 12px;
  color: var(--muted);
}
.clear-filters:hover:not(:disabled) {
  color: var(--ink);
  text-decoration: underline;
}
.clear-filters:disabled {
  display: none;
}
.filter-chip {
  font-size: 12px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  text-align: left;
}
.id-col {
  width: 124px;
}
.title-col {
  width: auto;
}
#product-table th:nth-child(3) {
  width: 140px;
}
.price-col {
  width: 120px;
}
#product-table th:nth-child(5) {
  width: 116px;
}
.link-col {
  width: 36px;
}
th {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  background: var(--surface);
  height: 36px;
  padding: 8px 12px;
}
th:first-child {
  border-radius: 0;
}
th:last-child {
  border-radius: 0;
}
td {
  padding: 13px var(--table-cell-padding);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
tr:hover td {
  background: oklch(0.979 0.004 70);
}
.card-id {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 15px;
}
.product-title {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}
.product-category {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}
.product-brand {
  font-size: 12px;
}
.price {
  text-align: right;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.price-col {
  text-align: right;
}
.unavailable {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.row-status {
  display: block;
  font-size: 11px;
  color: var(--warning);
  margin-bottom: 3px;
}
.row-status.error {
  color: var(--danger);
}
.check-time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  margin: -3px -7px 0;
  color: var(--muted);
  border-radius: 4px;
  font-size: 18px;
}
.card-link:hover {
  background: var(--hover);
  color: var(--ink);
}
.mobile-meta {
  display: none;
}
#product-table td {
  padding-top: 11px;
  padding-bottom: 11px;
}
#product-table .product-title {
  font-weight: 500;
}
#product-table .product-open {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  overflow-wrap: anywhere;
}
#product-table .product-category {
  margin-top: 3px;
  font-size: 12px;
}
#product-table .card-id {
  padding-top: 16px;
  font-size: 12px;
}
#product-table .product-brand,
#product-table td:nth-child(5) {
  padding-top: 16px;
  color: var(--muted);
}
#product-table .price {
  padding-top: 16px;
  font-weight: 600;
}
#product-table .unavailable {
  font-weight: 400;
}
#product-table .check-time {
  font-size: 12px;
}
#product-table .card-link {
  margin-top: 2px;
}
#product-table tr:focus-within td {
  background: var(--surface);
}
@media (max-width: 820px) {
  #product-table .product-open {
    min-height: 44px;
  }
  #product-table .link-col {
    width: 44px;
  }
  #product-table th:last-child,
  #product-table td:last-child {
    padding-left: 0;
    padding-right: 0;
  }
  #product-table .card-link {
    width: 44px;
    height: 44px;
    margin: 0;
  }
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 15px;
}
.pagination button {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid var(--line);
}
.pagination button:hover:not(:disabled) {
  background: var(--surface);
}
.empty {
  padding: 72px 16px;
  text-align: center;
}
.empty h2 {
  font-size: 16px;
  font-weight: 500;
}
.empty p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.stats-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 30px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.stats-summary > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.stats-summary dt {
  font-size: 12px;
  color: var(--muted);
}
.stats-summary dd {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.price-section h2 {
  margin-bottom: 24px;
}
.price-histogram {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 10px;
}
.histogram-bin {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 0;
  text-align: center;
  border-radius: 4px;
}
.histogram-plot {
  width: 100%;
  height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.histogram-count {
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.histogram-bar {
  width: 64%;
  max-width: 110px;
  background: oklch(0.76 0.053 39);
  border-radius: 3px 3px 0 0;
}
.histogram-bin:hover:not(:disabled) .histogram-bar {
  background: var(--accent);
}
.histogram-label {
  padding-top: 9px;
  font-size: 12px;
  color: var(--muted);
}
.price-extremes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.extreme {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 18px;
  align-items: baseline;
}
.extreme-label {
  font-size: 12px;
  color: var(--muted);
}
.extreme-price {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.extreme-product {
  grid-column: 1 / -1;
  display: block;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}
.extreme-product:hover {
  color: var(--ink);
  text-decoration: underline;
}
.stats-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px;
  margin-top: 28px;
}
.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.section-heading > span {
  color: var(--muted);
  font-size: 12px;
}
.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 16px;
  text-align: left;
  width: 100%;
  padding: 7px 0;
}
.rank-name {
  min-width: 0;
  font-size: 13px;
}
.rank-value {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.rank-track {
  height: 3px;
  width: 100%;
  background: var(--surface);
  grid-column: 1 / -1;
}
.rank-fill {
  height: 100%;
  display: block;
  background: oklch(0.68 0.009 65);
}
.rank-row:hover .rank-name {
  color: var(--accent);
}
.rank-row:hover .rank-fill {
  background: var(--accent);
}
.rank-more summary {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 0;
}
.stats-empty {
  padding: 30px 0;
  color: var(--muted);
}
.report-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  justify-content: flex-end;
  margin: 24px 0 20px;
}
.text-link {
  font-size: 12px;
  color: var(--muted);
}
.text-link:hover {
  color: var(--ink);
  text-decoration: underline;
}
.report-details {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  margin: 0;
  max-width: 1000px;
  font-size: 13px;
}
.report-details dt,
.report-details dd {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}
.report-details dt {
  color: var(--muted);
}
.report-details dd {
  margin: 0;
  max-width: 75ch;
}
#report-issues h3 {
  margin: 24px 0 10px;
  font-size: 14px;
}
.issue-detail {
  font-size: 12px;
  color: var(--muted);
  max-width: 75ch;
  margin: 6px 0 12px 16px;
  overflow-wrap: anywhere;
}
.history-issue {
  font-size: 13px;
  line-height: 1.55;
  margin: 10px 0;
  max-width: 85ch;
}
.history-issue summary {
  cursor: pointer;
}
.journal {
  margin-top: 26px;
  font-size: 13px;
}
.journal summary {
  color: var(--muted);
}
.journal ol {
  padding: 16px 0 0;
  margin: 0;
  list-style: none;
}
.journal li {
  display: flex;
  gap: 20px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 12px;
}
.journal time {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.journal li > span {
  min-width: 0;
}
@media (min-width: 1600px) {
  .topbar {
    padding-left: max(
      var(--page-gutter),
      calc((100vw - 1520px) / 2 + var(--page-gutter))
    );
    padding-right: max(
      var(--page-gutter),
      calc((100vw - 1520px) / 2 + var(--page-gutter))
    );
  }
}
@media (max-width: 1000px) {
  .topbar {
    padding: 8px 24px;
  }
  .workspace {
    padding: 24px;
  }
  .setup {
    grid-template-columns: minmax(180px, 1fr) 130px auto auto;
  }
  .id-col {
    width: 105px;
  }
  #product-table th:first-child,
  #product-table td:first-child,
  #product-table th:nth-child(3),
  #product-table td:nth-child(3),
  #product-table th:nth-child(5),
  #product-table td:nth-child(5) {
    display: none;
  }
  .price-col {
    width: 108px;
  }
  .mobile-meta {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
  }
  #product-table .mobile-meta {
    font-size: 11px;
    line-height: 1.45;
    margin-top: 3px;
  }
  .run-date {
    display: none;
  }
  .stats-lists {
    gap: 30px;
  }
}
@media (max-width: 620px) {
  .topbar {
    padding: 8px var(--page-gutter);
    gap: 12px;
  }
  .top-actions {
    gap: 5px;
  }
  #history {
    width: 100%;
    max-width: none;
  }
  .workspace {
    padding: var(--workspace-top) var(--page-gutter) 28px;
  }
  .setup {
    grid-template-columns: minmax(0, 1fr) auto 40px;
    gap: 10px;
    padding-bottom: 12px;
  }
  .seller-control {
    grid-column: 1 / -1;
  }
  #merchant-presence-picker {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .city-control {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }
  #start {
    grid-column: 2;
    grid-row: 3;
  }
  .settings-menu {
    grid-column: 3;
    grid-row: 3;
  }
  .settings-panel {
    width: 260px;
  }
  #custom-city {
    grid-template-columns: 1fr;
  }
  .run-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
  }
  h1 {
    font-size: 20px;
  }
  h1 span {
    font-size: 13px;
    margin-left: 10px;
  }
  .run-actions {
    gap: 8px;
    align-items: flex-start;
  }
  .progress-caption {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .tabs {
    gap: 24px;
  }
  .tabs button {
    min-height: 42px;
    padding-bottom: 10px;
    font-size: 13px;
  }
  .table-toolbar {
    gap: 6px;
  }
  #sort {
    width: 142px;
  }
  .filter-toolbar {
    gap: 6px;
  }
  .filter-toolbar select {
    max-width: 100%;
  }
  #category-filter {
    flex: 1 1 100%;
    max-width: 100%;
  }
  #brand-filter {
    max-width: 46%;
  }
  #status-filter {
    max-width: 40%;
  }
  .clear-filters {
    font-size: 11px;
    padding: 5px 2px;
  }
  th,
  td {
    padding-left: 7px;
    padding-right: 7px;
  }
  th {
    font-size: 11px;
  }
  .price-col {
    width: 85px;
  }
  .link-col {
    width: 24px;
  }
  .product-title {
    font-size: 13px;
  }
  .product-category {
    font-size: 10px;
  }
  .price {
    font-size: 12px;
  }
  .card-link {
    width: 24px;
    font-size: 16px;
  }
  .table-footer {
    font-size: 11px;
  }
  .stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
  }
  .stats-summary dd {
    font-size: 20px;
  }
  .price-histogram {
    gap: 5px;
  }
  .histogram-plot {
    height: 132px;
  }
  .histogram-label {
    font-size: 10px;
    line-height: 1.35;
  }
  .histogram-count {
    font-size: 11px;
  }
  .histogram-bar {
    width: 75%;
  }
  .price-extremes {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 22px;
  }
  .stats-lists {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .stats-caption {
    align-items: baseline;
    font-size: 11px;
  }
  .report-details {
    grid-template-columns: 1fr;
  }
  .report-details dt {
    border: 0;
    padding-bottom: 0;
    font-size: 11px;
  }
  .report-details dd {
    padding-top: 5px;
  }
  .journal li {
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .progress-activity {
    transform: translateX(117%);
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 60px;
    gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right)) 8px
      max(12px, env(safe-area-inset-left));
  }
  .filter-select.history-picker {
    flex: 1;
    width: auto;
    max-width: none;
  }
  .process-trigger {
    padding: 8px;
  }
  .top-actions {
    gap: 8px;
  }
  .process-dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .process-row {
    flex-direction: column;
    gap: 12px;
  }
  .process-actions {
    width: 100%;
    justify-content: flex-start;
  }
  #excel,
  #prepare-excel,
  .logout .button {
    padding: 8px 10px;
    font-size: var(--control-font-size-compact);
  }
  .catalog-export-actions {
    flex: 1 1 100%;
    margin-left: 0;
  }
  .catalog-selection {
    width: 100%;
    justify-content: space-between;
  }
  .catalog-export-actions .button {
    width: 100%;
  }
  .export-scope {
    flex-basis: 100%;
  }
  .workspace {
    padding: 20px max(16px, env(safe-area-inset-right))
      max(28px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .setup {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding-bottom: 12px;
  }
  .seller-control {
    grid-column: 1 / -1;
  }
  .city-control {
    grid-column: 1;
    grid-row: 3;
  }
  .settings-menu {
    grid-column: 2;
    grid-row: 3;
  }
  #start {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  #custom-city {
    grid-row: 5;
  }
  .setup-status {
    flex-wrap: wrap;
  }
  .merchant-menu {
    max-height: min(320px, 45dvh);
  }
  .merchant-option {
    min-height: 48px;
    font-size: 15px;
  }
  .merchant-option small {
    font-size: 12px;
  }
  .settings-panel {
    max-height: calc(100dvh - 180px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    width: min(300px, calc(100vw - 32px));
    top: calc(100% + 66px);
  }
  .coverage-note {
    min-height: 44px;
  }
  .table-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search {
    flex: 1 1 100%;
  }
  #sort {
    width: 100%;
    border-color: var(--line);
  }
  .filter-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  #category-picker {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }
  #brand-picker,
  #status-filter {
    width: 100%;
    max-width: none;
  }
  .clear-filters,
  .filter-chip {
    min-height: 44px;
    font-size: 13px;
  }
  .filter-dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    height: min(720px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .filter-dialog-option {
    min-height: 52px;
    font-size: 15px;
  }
  td {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .product-title {
    font-size: 15px;
    line-height: 1.4;
  }
  .product-category,
  .mobile-meta {
    font-size: 12px;
    line-height: 1.4;
  }
  .price-col {
    width: 94px;
  }
  .link-col {
    width: 44px;
  }
  .price {
    font-size: 15px;
  }
  .card-link {
    width: 44px;
    min-height: 44px;
    font-size: 20px;
  }
  .table-footer {
    font-size: 12px;
    gap: 12px;
  }
  .pagination button {
    width: 44px;
    height: 44px;
  }
  .table-wrap {
    overflow-anchor: none;
  }
  #product-table td {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #product-table th:nth-child(2),
  #product-table td:nth-child(2) {
    padding-left: 0;
  }
  #product-table .product-open {
    display: flex;
    align-items: flex-start;
    min-height: 44px;
  }
  #product-table .product-category,
  #product-table .mobile-meta {
    font-size: 11px;
    line-height: 1.45;
  }
  #product-table .price-col {
    width: 90px;
  }
  #product-table .price {
    padding-top: 12px;
    padding-left: 8px;
    padding-right: 4px;
  }
  #product-table th:last-child,
  #product-table td:last-child {
    padding-left: 0;
    padding-right: 0;
  }
  #product-table .card-link {
    align-items: flex-start;
    width: 44px;
    height: 44px;
    margin: -3px 0 0;
  }
}

.sort-heading {
  color: inherit;
  font: inherit;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.sort-heading:hover {
  color: var(--ink);
}
.sort-heading[data-direction="ascending"]::after {
  content: "↑";
}
.sort-heading[data-direction="descending"]::after {
  content: "↓";
}
.comparison-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}
.comparison-baseline-control {
  min-width: 0;
  width: min(430px, 100%);
}
.comparison-baseline-control label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
#comparison-baseline-picker {
  width: 100%;
  max-width: none;
}
.comparison-scope {
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 20px;
}
.comparison-caution {
  margin: 0 0 20px;
  padding: 10px 0 10px 12px;
  border-left: 2px solid var(--warning);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 880px;
}
.comparison-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 20px;
  gap: 20px;
}
.comparison-summary:empty {
  display: none;
}
.comparison-metric {
  text-align: left;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
}
.comparison-metric:hover {
  color: var(--accent);
}
.comparison-metric[aria-pressed="true"] {
  border-color: var(--accent);
}
.comparison-metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.comparison-metric-value {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.comparison-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.comparison-export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  margin-bottom: 16px;
}
#comparison-download {
  font-size: 13px;
  margin-left: auto;
}
.comparison-download-error {
  flex-basis: 100%;
  min-width: 0;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#comparison-search {
  flex: 1;
  min-width: 120px;
}
#comparison-type,
#comparison-sort {
  width: 210px;
}
.comparison-price-col {
  width: 120px;
  text-align: right;
}
.comparison-delta-col {
  width: 148px;
  text-align: right;
}
.comparison-value {
  text-align: right;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.comparison-value small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 5px;
  font-size: 12px;
}
.comparison-delta.increased {
  color: var(--warning);
}
.comparison-delta.decreased {
  color: var(--success);
}
.comparison-id {
  display: none;
}
#comparison-table .product-category {
  font-size: 12px;
}
#comparison-empty p {
  max-width: 500px;
  color: var(--muted);
  line-height: 1.6;
}
.coverage-details {
  border-top: 1px solid var(--line);
  margin: 24px 0;
  padding-top: 16px;
}
.coverage-details summary {
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
  display: list-item;
}
#coverage-summary {
  max-width: 850px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
#coverage-table {
  font-size: 12px;
  min-width: 540px;
}
#coverage-table th:first-child {
  width: 40%;
}
@media (max-width: 1000px) {
  #comparison-table .id-col {
    display: none;
  }
  #comparison-table .card-id {
    display: none;
  }
  .comparison-id {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
  }
  .comparison-price-col {
    width: 110px;
  }
}
@media (max-width: 620px) {
  .tabs {
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs button {
    flex: 0 0 auto;
    min-height: 44px;
    min-width: 44px;
    white-space: nowrap;
  }
  .comparison-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }
  .comparison-baseline-control {
    width: 100%;
  }
  .comparison-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  #comparison-search {
    grid-column: 1 / -1;
    width: 100%;
  }
  #comparison-search,
  #comparison-type,
  #comparison-sort {
    width: 100%;
    min-width: 0;
  }
  .comparison-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
    padding-bottom: 16px;
  }
  .comparison-metric {
    min-height: 66px;
  }
  .comparison-metric-value {
    font-size: 24px;
  }
  #comparison-table,
  #comparison-table tbody {
    display: block;
  }
  #comparison-table thead {
    display: none;
  }
  #comparison-table tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 10px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  #comparison-table td {
    display: block;
    padding: 0;
    border: 0;
  }
  #comparison-table td:first-child {
    display: none;
  }
  #comparison-table td:nth-child(2) {
    grid-column: 1 / -1;
    padding-right: 44px;
  }
  #comparison-table .comparison-value {
    text-align: left;
    font-size: 14px;
  }
  #comparison-table .comparison-value::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    margin-bottom: 6px;
  }
  #comparison-table .comparison-link {
    position: absolute;
    right: 0;
    top: 12px;
  }
  #comparison-table .card-link {
    margin: 0;
    width: 44px;
    height: 44px;
  }
  #comparison-table tr:hover td {
    background: none;
  }
}
@media (max-width: 380px) {
  #comparison-type,
  #comparison-sort,
  #status-filter {
    grid-column: 1 / -1;
  }
  .tabs {
    gap: 8px;
  }
  .tabs button {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .topbar {
    column-gap: 8px;
  }
  .surface-nav {
    grid-column: 1;
    grid-row: 1;
  }
  .logout {
    grid-column: 2;
    grid-row: 1;
  }
  .top-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }
  .history-surface {
    grid-column: 1 / -1;
  }
  .process-trigger {
    width: 100%;
    white-space: normal;
  }
  .process-scopes {
    padding-inline: 16px;
  }
}
