:root {
  --ksp-bg: #f7f7f3;
  --ksp-dark: #1E1E1E;
  --ksp-muted: #666666;
  --ksp-line: #e6e6dc;
  --ksp-card: #ffffff;
  --ksp-green: #CBEE2F;
  --ksp-deep: #163320;
  --ksp-error: #b42318;
  --ksp-warning: #b54708;
}
body .ksp-wrap,
body .ksp-login-wrap {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ksp-dark);
}
.ksp-wrap {
  max-width: none;
  width: calc(100vw - 32px);
  margin-left: calc(50% - 50vw + 16px);
  margin-right: calc(50% - 50vw + 16px);
  padding: 28px clamp(12px, 2vw, 28px) 56px;
  min-height: 100vh;
  position: relative;
  z-index: 0;
  isolation: isolate;
  box-sizing: border-box;
}
.ksp-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 0; isolation: isolate; }
.ksp-wrap::before,
.ksp-login-wrap::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--ksp-deep);
  background-image: linear-gradient(rgba(22,51,32,.18), rgba(22,51,32,.18)), url('ksp-background.webp');
  background-repeat: repeat;
  background-size: 680px 680px;
}
.ksp-wrap > *,
.ksp-login-wrap > * { position: relative; z-index: 1; }
.ksp-card, .ksp-tile, .ksp-hero {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--ksp-line);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,.06);
}
.ksp-card { padding: 24px; margin-bottom: 22px; }
.ksp-login-card { max-width: 460px; width: 100%; }
.ksp-brand-mark, .ksp-hero-badge { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--ksp-green); color: #001A09; font-size: 30px; font-weight: 900; }
.ksp-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 30px; margin-bottom: 22px; background: linear-gradient(135deg, #ffffff, #f5f8e8); }
.ksp-hero h1, .ksp-page-head h1, .ksp-login-card h1 { margin: 6px 0 8px; line-height: 1.05; }
.ksp-hero p, .ksp-page-head p, .ksp-muted { color: var(--ksp-muted); }
.ksp-eyebrow { color: var(--ksp-deep); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.ksp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.ksp-grid-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.ksp-tile { display: block; padding: 22px; color: inherit; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease; }
.ksp-tile:hover { transform: translateY(-2px); box-shadow: 0 20px 60px rgba(0,0,0,.09); }
.ksp-disabled-tile { opacity: .65; }
.ksp-tile-icon { font-size: 28px; }
.ksp-tile h3 { margin: 12px 0 8px; }
.ksp-pill, .ksp-status, .ksp-source, .ksp-screen-passed, .ksp-screen-warning, .ksp-screen-blocked {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; line-height: 1.1; white-space: nowrap;
}
.ksp-pill, .ksp-status { background: #f0f0f0; }
.ksp-source { background: #1E1E1E; color: #fff; }
.ksp-screen-passed { background: #e8f7ca; color: #163320; }
.ksp-screen-warning { background: #fff1d6; color: #8a4b00; }
.ksp-screen-blocked { background: #ffe4e0; color: #9a1b12; }
.ksp-store-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ksp-form-stack { display: grid; gap: 14px; }
.ksp-form-stack label, .ksp-search-controls label { display: grid; gap: 6px; font-weight: 700; }
.ksp-form-stack input, .ksp-form-stack select, .ksp-form-stack textarea,
.ksp-search-controls input, .ksp-search-controls select,
.ksp-login-card input {
  width: 100%; border: 1px solid #d9d9cf; border-radius: 14px; padding: 12px 14px; font: inherit; background: #fff;
}
.ksp-search-controls { display: grid; grid-template-columns: minmax(160px, 240px) 1fr auto; gap: 14px; align-items: end; }
.ksp-button, .ksp-button-secondary {
  border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.ksp-button { background: var(--ksp-green); color: #001A09; }
.ksp-button:hover { filter: brightness(.97); }
.ksp-button:disabled { opacity: .55; cursor: not-allowed; }
.ksp-button-secondary { background: #f0f0f0; color: #1E1E1E; }
.ksp-small { padding: 8px 12px; font-size: 13px; margin: 2px; }
.ksp-notice { padding: 12px 14px; border-radius: 16px; margin: 10px 0 16px; }
.ksp-success { background: #eef9d0; color: #163320; }
.ksp-warning { background: #fff5df; color: var(--ksp-warning); }
.ksp-error { background: #ffe9e5; color: var(--ksp-error); }
.ksp-results { display: grid; gap: 14px; margin-top: 20px; }
.ksp-product-card { display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; padding: 16px; border: 1px solid var(--ksp-line); border-radius: 20px; background: #fff; }
.ksp-product-card.ksp-requested { border-color: var(--ksp-green); box-shadow: inset 0 0 0 1px var(--ksp-green); }
.ksp-product-img img, .ksp-product-noimg { width: 88px; height: 88px; object-fit: cover; border-radius: 18px; background: #f0f0f0; display: grid; place-items: center; font-size: 30px; }
.ksp-product-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ksp-product-main h3 { margin: 0 0 8px; font-size: 18px; }
.ksp-product-main p { margin: 4px 0; }
.ksp-screening-note { font-size: 13px; color: var(--ksp-muted); }
.ksp-empty, .ksp-loading { padding: 18px; border-radius: 16px; background: #f7f7f3; color: var(--ksp-muted); }
.ksp-table-card { overflow-x: auto; }
.ksp-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.ksp-table th { text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ksp-muted); border-bottom: 1px solid var(--ksp-line); padding: 12px 10px; }
.ksp-table td { border-bottom: 1px solid var(--ksp-line); padding: 12px 10px; vertical-align: top; }
@media (max-width: 760px) {
  .ksp-search-controls { grid-template-columns: 1fr; }
  .ksp-product-card { grid-template-columns: 64px 1fr; }
  .ksp-product-action { grid-column: 1 / -1; }
  .ksp-product-img img, .ksp-product-noimg { width: 64px; height: 64px; border-radius: 14px; }
}

.ksp-search-controls-main { grid-template-columns: minmax(180px, 280px) 1fr auto auto; }
.ksp-filter-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.ksp-filter-controls label { display: grid; gap: 6px; font-weight: 700; }
.ksp-filter-controls select {
  width: 100%;
  border: 1px solid #d9d9cf;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}
.ksp-search-hint { color: var(--ksp-muted); font-size: 13px; margin-top: 12px; }
.ksp-delisted-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  background: #b42318;
  color: #fff;
}
.ksp-product-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.ksp-detail {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--ksp-line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fafaf7;
  color: var(--ksp-dark);
  font-size: 12px;
  line-height: 1.25;
  max-width: 100%;
}
.ksp-detail strong { color: var(--ksp-muted); font-weight: 800; }
.ksp-description { color: #3f3f3f; font-size: 13px; line-height: 1.45; max-width: 860px; }
.ksp-search-reason { color: var(--ksp-deep); font-size: 13px; }
@media (max-width: 980px) {
  .ksp-filter-controls { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .ksp-search-controls-main { grid-template-columns: 1fr; }
  .ksp-filter-controls { grid-template-columns: 1fr; }
}
.ksp-form-stack select[multiple] { min-height: 150px; padding: 10px; }
.ksp-inline-form { display: inline; margin: 0; }
.ksp-warning { background: #fff7dd; color: #6b4b00; }

.ksp-top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 18px;
  padding: 10px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(22,51,32,0.12);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.ksp-top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f7f4;
  color: #163320;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(22,51,32,0.1);
}
.ksp-top-nav a:hover,
.ksp-top-nav a:focus {
  background: #e4efe6;
  text-decoration: none;
}
.ksp-thc-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ksp-thc-filter select {
  min-width: 150px;
}
.ksp-thc-filter input {
  max-width: 90px;
}
.ksp-variant-notice {
  display: inline-block;
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: #fff3cd;
  color: #533f03;
  border: 1px solid #ffe08a;
  font-size: 13px;
  font-weight: 700;
}
.ksp-stock-notify {
  white-space: normal;
  line-height: 1.25;
}
@media (max-width: 720px) {
  .ksp-thc-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .ksp-thc-filter select,
  .ksp-thc-filter input {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  .ksp-store-count-filter { flex-direction: column; align-items: stretch; }
  .ksp-store-count-filter select,
  .ksp-store-count-filter input { min-width: 0; max-width: none; width: 100%; }
}

/* v0.1.12 browser/filter refinements */
.ksp-filter-controls {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  overflow: visible;
}
.ksp-filter-controls select,
.ksp-filter-controls input,
.ksp-search-controls input,
.ksp-search-controls select {
  min-height: 46px;
  line-height: 1.35;
  padding-top: 10px;
  padding-bottom: 10px;
  box-sizing: border-box;
}
.ksp-thc-filter input {
  min-width: 92px;
  max-width: 120px;
}
.ksp-log-sev {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.ksp-log-info { background: #eef3ff; color: #174ea6; }
.ksp-log-warning { background: #fff3cd; color: #6b4b00; }
.ksp-log-error { background: #ffe4e0; color: #9a1b12; }
.ksp-log-filters { grid-template-columns: minmax(150px, 220px) 1fr auto; }
.ksp-table code { white-space: pre-wrap; word-break: break-word; font-size: 11px; }
@media (max-width: 1100px) {
  .ksp-filter-controls { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .ksp-filter-controls { grid-template-columns: 1fr; }
  .ksp-log-filters { grid-template-columns: 1fr; }
}

/* v0.1.13 filter/sort refinements */
.ksp-filter-controls {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}
.ksp-filter-with-sort {
  min-width: 0;
}
.ksp-filter-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  line-height: 1.25;
  font-weight: 800;
}
.ksp-sort-toggle {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: 1px solid rgba(22,51,32,0.18);
  border-radius: 999px;
  background: #f4f7f4;
  color: #163320;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ksp-sort-toggle.is-active {
  background: var(--ksp-green);
  border-color: var(--ksp-green);
  color: #001A09;
  font-weight: 900;
}
.ksp-sort-toggle:hover,
.ksp-sort-toggle:focus {
  filter: brightness(.97);
  outline: none;
  box-shadow: 0 0 0 3px rgba(203,238,47,.25);
}
.ksp-thc-filter {
  display: grid;
  grid-template-columns: minmax(92px, .95fr) minmax(56px, 72px);
  gap: 7px;
  align-items: center;
}
.ksp-thc-filter select {
  min-width: 0;
  width: 100%;
}
.ksp-thc-filter input {
  min-width: 0;
  max-width: none;
  width: 100%;
  text-align: center;
}
.ksp-form-stack select,
.ksp-form-stack input,
.ksp-form-stack textarea,
.ksp-search-controls input,
.ksp-search-controls select,
.ksp-filter-controls select,
.ksp-filter-controls input {
  min-height: 48px;
  line-height: 1.45;
  padding-top: 11px;
  padding-bottom: 11px;
  vertical-align: middle;
}
@media (max-width: 1100px) {
  .ksp-filter-controls { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .ksp-filter-controls { grid-template-columns: 1fr; }
  .ksp-thc-filter { grid-template-columns: 1fr; }
}

/* v0.1.18 background readability and bulk import refinements */
.ksp-page-head {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(2px);
}
.ksp-page-head h1,
.ksp-page-head p {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
body:has(.ksp-wrap) .entry-title,
body:has(.ksp-wrap) .page-title,
body:has(.ksp-wrap) main > h1:first-child,
body:has(.ksp-login-wrap) .entry-title,
body:has(.ksp-login-wrap) .page-title {
  display: inline-block;
  color: #fff !important;
  background: rgba(0, 0, 0, 0.30);
  padding: 8px 14px;
  border-radius: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.ksp-wrap > p:not(.ksp-muted):not(.ksp-search-hint),
.ksp-wrap > h1,
.ksp-wrap > h2,
.ksp-wrap > h3 {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.ksp-grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}
.ksp-bulk-import-card {
  border-color: rgba(203,238,47,.45);
  box-shadow: 0 18px 50px rgba(0,0,0,.08), inset 0 0 0 1px rgba(203,238,47,.16);
}
@media (max-width: 900px) {
  .ksp-grid-three { grid-template-columns: 1fr; }
}

/* v0.1.19 Cova API control panel */
.ksp-api-inline-action { display: block; margin: 12px 0 18px; }
.ksp-api-log-table details { max-width: 520px; }
.ksp-api-log-table summary { cursor: pointer; font-weight: 800; color: var(--ksp-deep); }
.ksp-api-log-table code { display: block; max-width: 520px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: #f7f7f3; border: 1px solid var(--ksp-line); border-radius: 10px; padding: 8px; font-size: 11px; }

.ksp-small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 999px;
  margin-top: 8px;
}

.ksp-code-textarea {
  width: 100%;
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
}
.ksp-help-list {
  margin: 0;
  padding-left: 1.2rem;
}
.ksp-help-list li {
  margin: .45rem 0;
}

/* v0.1.22 managed assortment scope controls */
.ksp-scope-box {
  border: 1px solid var(--ksp-line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.72);
}
.ksp-small-note {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ksp-muted);
}
.ksp-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 46px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--ksp-line);
  border-radius: 14px;
  background: #fff;
}
.ksp-check {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}
.ksp-check input { margin: 0; }
.ksp-form-grid-2 {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}
.ksp-form-grid-3 {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}
@media (max-width: 900px) {
  .ksp-form-grid-2,
  .ksp-form-grid-3 { grid-template-columns: 1fr; }
}


/* v0.1.23 scope/replenishment refinements */
.ksp-field-title {
  display: block;
  font-weight: 800;
  margin: 0 0 6px;
}
.ksp-checkbox-list .ksp-check input[type="checkbox"],
.ksp-check input[type="checkbox"],
.ksp-form-stack .ksp-check input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 auto;
}
.ksp-checkbox-list .ksp-check {
  font-size: 14px;
  padding: 3px 0;
}
.ksp-store-scope-list {
  align-items: flex-start;
  max-height: 190px;
  overflow: auto;
}
.ksp-store-check.is-covered-by-province {
  opacity: .72;
}
.ksp-store-check.is-covered-by-province span::after {
  content: "  · covered by province";
  font-weight: 600;
  color: var(--ksp-muted);
}


/* v0.1.24 replenishment refinements */
.ksp-replenishment-store-card { margin-bottom: 18px; }
.ksp-replenishment-store-card select { max-width: 520px; }


/* v0.1.25 UX refinements */
.ksp-compact-wrap { padding-top: 12px; }
.ksp-top-nav { margin-bottom: 10px; padding: 8px; border-radius: 18px; }
.ksp-page-head { margin-bottom: 12px; padding: 12px 18px; border-radius: 18px; background: rgba(0,0,0,.30); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ksp-page-head h1 { margin-top: 0; }
.ksp-page-head p { color: rgba(255,255,255,.92); margin-bottom: 0; }
.ksp-sticky-controls {
  position: sticky;
  top: 10px;
  z-index: 20;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
}
.ksp-product-browser-sticky { padding: 10px; margin: -4px -4px 10px; border: 1px solid rgba(22,51,32,.08); border-radius: 18px; }
.ksp-live-controls { padding: 10px; margin: -4px -4px 10px; border: 1px solid rgba(22,51,32,.08); border-radius: 18px; }
.ksp-live-search-controls { grid-template-columns: minmax(180px, 260px) 1fr minmax(180px, 240px); }
.ksp-live-sort-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ksp-live-sort-toggle { border: 1px solid rgba(22,51,32,.12); background: #f4f7f4; color: #163320; border-radius: 999px; padding: 7px 10px; font-weight: 800; cursor: pointer; }
.ksp-live-sort-toggle.is-active { background: var(--ksp-green); color: #001A09; }
.ksp-live-summary { color: var(--ksp-muted); font-size: 13px; margin-bottom: 10px; }
.ksp-live-assortment-card { padding: 16px; border: 1px solid var(--ksp-line); border-radius: 20px; background: #fff; }
.ksp-live-assortment-main h3 { margin: 0 0 8px; font-size: 18px; }
.ksp-live-assortment-main p { margin: 4px 0; }
@media (max-width: 860px) {
  .ksp-live-search-controls { grid-template-columns: 1fr; }
  .ksp-sticky-controls { position: static; }
}


/* v0.1.26 navigation, copy, and live assortment refinements */
.ksp-top-nav .ksp-nav-logout { margin-left: auto; background: #163320; color: #fff; border-color: #163320; }
.ksp-top-nav .ksp-nav-logout:hover, .ksp-top-nav .ksp-nav-logout:focus { background: #0f2417; color: #fff; }
.ksp-copy-sku { cursor: pointer; font: inherit; }
.ksp-copy-sku:hover, .ksp-copy-sku:focus { border-color: var(--ksp-green); box-shadow: 0 0 0 2px rgba(203,238,47,.22); }
.ksp-copy-sku.is-copied { background: var(--ksp-green); color: #001A09; border-color: var(--ksp-green); }
.ksp-live-thc-label .ksp-thc-filter { display: flex; gap: 8px; }
.ksp-live-thc-label input { max-width: 88px; }
@media (min-width: 861px) { .ksp-live-search-controls { grid-template-columns: minmax(170px, 230px) 1fr minmax(150px, 210px) minmax(190px, 250px); } }

/* v0.1.28 Cova location mapping */
.ksp-location-inline-form,
.ksp-location-map-form {
  gap: 8px;
}
.ksp-location-inline-form input[type="text"],
.ksp-location-map-form input[type="text"] {
  min-width: 180px;
}
.ksp-location-inline-form select,
.ksp-location-map-form select {
  min-width: 76px;
}
.ksp-link-button {
  background: transparent;
  border: 0;
  color: #163320;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}
.ksp-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ksp-sr-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* v0.1.30 Cova location mapper layout fix */
.ksp-location-mapper-intro { margin-bottom: 16px; }
.ksp-location-card { overflow-x: auto; }
.ksp-location-table { min-width: 720px; }
.ksp-location-inline-form,
.ksp-location-map-form,
.ksp-ignore-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.ksp-location-inline-form input[type="text"],
.ksp-location-map-form input[type="text"] {
  min-width: 220px;
  max-width: 320px;
}
.ksp-location-inline-form select,
.ksp-location-map-form select {
  min-width: 76px;
  max-width: 90px;
}
@media (max-width: 760px) {
  .ksp-location-inline-form,
  .ksp-location-map-form,
  .ksp-ignore-inline-form { display: grid; grid-template-columns: 1fr; }
  .ksp-location-inline-form input[type="text"],
  .ksp-location-map-form input[type="text"],
  .ksp-location-inline-form select,
  .ksp-location-map-form select { max-width: none; width: 100%; }
}

/* Cova sync progress */
.ksp-sync-progress {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.24);
}
.ksp-sync-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.ksp-progress-bar {
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.25);
}
.ksp-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(203,238,47,0.75), rgba(255,255,255,0.9));
  transition: width 220ms ease;
}
.ksp-sync-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ksp-sync-progress-grid span {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
}
@media (max-width: 720px) {
  .ksp-sync-progress-top,
  .ksp-sync-progress-grid { grid-template-columns: 1fr; display: grid; }
}

/* User Management */
.ksp-user-management-wrap .ksp-store-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ksp-checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(16, 31, 42, 0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.68);
  font-weight: 700;
  line-height: 1.25;
}
.ksp-checkbox-pill input { margin: 0; flex: 0 0 auto; }
.ksp-store-assignment-box {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(16,31,42,0.12);
  background: rgba(255,255,255,0.45);
}
.ksp-user-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.ksp-mini-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(16,31,42,0.12);
}
.ksp-mini-card h3 { margin-top: 0; margin-bottom: 8px; }
.ksp-compact-list { margin: 8px 0 0; padding-left: 18px; }
.ksp-compact-list li { margin: 4px 0; }
.ksp-muted { color: rgba(31,43,59,0.66); font-size: 0.92em; }
.ksp-user-directory { display: grid; gap: 12px; }
.ksp-user-detail {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.74);
  border: 1px solid rgba(16,31,42,0.13);
}
.ksp-user-detail summary { cursor: pointer; list-style-position: outside; }
.ksp-user-edit-form { margin-top: 14px; }
.ksp-inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ksp-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #ffdddd;
  color: #9b1c1c;
  font-weight: 800;
  cursor: pointer;
}
.ksp-delete-user-form { margin-top: 10px; }
@media (max-width: 720px) {
  .ksp-user-management-wrap .ksp-store-checkbox-grid,
  .ksp-user-store-grid { grid-template-columns: 1fr; }
}

/* v0.1.38 user management + delist refinements */
.ksp-user-management-wrap .ksp-checkbox-pill {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 14px;
  font-size: 13px;
  gap: 6px;
}
.ksp-user-management-wrap .ksp-checkbox-pill input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  min-height: 15px !important;
  max-height: 15px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  accent-color: var(--ksp-green);
}
.ksp-user-management-wrap .ksp-store-checkbox-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}
.ksp-compact-select-label select { margin-top: 8px; }
.ksp-users-by-store-panels { margin-top: 14px; }
.ksp-compact-user-table th,
.ksp-compact-user-table td { padding: 10px 12px; }
.ksp-inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ksp-button-muted { background: rgba(16,31,42,0.08) !important; color: var(--ksp-ink) !important; }
.ksp-live-delist-action { white-space: nowrap; }
.ksp-inline-delete-user-form { display: inline-flex; margin: 0; }
.ksp-danger-button-small { padding: 7px 10px !important; font-size: 12px !important; border-radius: 999px !important; }

/* v0.1.39 pricing manager + store activity polish */
.ksp-pill-muted{background:rgba(255,255,255,.18)!important;color:#6b7280!important;border-color:rgba(107,114,128,.25)!important}
.ksp-pricing-manager-wrap .ksp-price-alert-add-form input[name="suggested_price"]{width:92px;min-width:92px;padding:.45rem .6rem}
.ksp-pricing-manager-wrap .ksp-pricing-line-form input[name="suggested_price"]{width:92px;min-width:92px;padding:.45rem .6rem}
.ksp-pricing-manager-wrap .ksp-pricing-line-form select{min-width:145px;padding:.45rem .6rem;line-height:1.2}
.ksp-copy-token{border:1px solid rgba(22,51,32,.18);background:#f7faf7;border-radius:999px;padding:.25rem .55rem;font-weight:700;cursor:pointer;color:#163320}
.ksp-copy-token.is-copied,.ksp-copy-sku.is-copied{outline:2px solid #bdf22e;background:#eaff9e!important}
.ksp-location-inline-form select[name="store_active"]{min-width:105px}
.ksp-table-scroll{overflow:auto;max-width:100%}

/* v0.1.42 Live Assortment multi-store and exports */
.ksp-live-store-count-label input { max-width: 95px; }
.ksp-store-count-filter { display: flex; gap: 8px; align-items: center; }
.ksp-store-count-filter select { min-width: 135px; }
.ksp-store-count-filter input { min-width: 80px; }
.ksp-store-availability-legend {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(22,51,32,.06);
  color: #163320;
  font-size: 12px;
}
.ksp-store-availability-legend strong {
  flex: 0 0 auto;
}
.ksp-store-availability-legend span {
  display: inline;
  flex: 1 1 420px;
  min-width: 180px;
  overflow: visible;
  white-space: normal;
  color: var(--ksp-muted);
  padding-bottom: 0;
}
@media (min-width: 861px) {
  .ksp-live-search-controls { grid-template-columns: minmax(170px, 230px) minmax(240px, 1fr) minmax(150px, 210px) minmax(190px, 250px) minmax(140px, 190px); }
}

.ksp-export-current { white-space: nowrap; }
.ksp-live-sort-row .ksp-export-current { margin-left: auto; }
@media (max-width: 760px) {
  .ksp-live-sort-row .ksp-export-current { margin-left: 0; width: 100%; }
}

/* v0.1.41 Pricing Manager scope controls */
.ksp-price-scope-note { margin-top: -6px; }
.ksp-pricing-scope-section select[multiple] {
  min-height: 150px;
}
.ksp-pricing-global-summary {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22,51,32,.06);
  color: #163320;
}

/* v0.1.47 Pricing search and linked-item controls */
.ksp-pricing-search-controls { align-items: end; }
.ksp-pricing-result-card .ksp-product-action { align-self: stretch; }
.ksp-linked-price-checkbox,
.ksp-checkbox-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ksp-muted);
  line-height: 1.25;
}
.ksp-linked-price-checkbox input,
.ksp-checkbox-line input { width: auto; min-width: 0; }
.ksp-linked-group {
  border: 1px solid rgba(22,51,32,.12);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0 0 12px;
  background: rgba(255,255,255,.72);
}
.ksp-linked-group summary { cursor: pointer; }

/* v0.1.49 Visual linked-item builder */
.ksp-linked-builder-card { overflow: visible; }
.ksp-linked-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .85fr);
  gap: 18px;
  align-items: start;
}
.ksp-linked-search-controls { align-items: end; }
.ksp-linked-items-results {
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}
.ksp-linked-result-card {
  cursor: pointer;
  grid-template-columns: auto 72px minmax(0, 1fr);
  align-items: start;
}
.ksp-linked-result-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
}
.ksp-linked-result-check {
  padding-top: 10px;
}
.ksp-linked-selected-panel {
  position: sticky;
  top: 18px;
  border: 1px solid rgba(22,51,32,.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.88);
}
.ksp-linked-selected-items {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.ksp-linked-selected-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(22,51,32,.10);
  border-radius: 14px;
  background: rgba(22,51,32,.035);
}
.ksp-linked-selected-row.is-parent {
  border-color: rgba(22,51,32,.34);
  background: rgba(22,51,32,.08);
}
.ksp-linked-selected-thumb,
.ksp-linked-selected-noimg {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(22,51,32,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ksp-green);
  font-weight: 800;
}
.ksp-linked-selected-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ksp-linked-selected-main { min-width: 0; }
.ksp-linked-selected-main strong {
  display: inline;
  word-break: break-word;
}
.ksp-linked-selected-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ksp-linked-selected-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ksp-edit-linked-group { margin: 8px 0 12px; }
@media (max-width: 920px) {
  .ksp-linked-builder-grid { grid-template-columns: 1fr; }
  .ksp-linked-selected-panel { position: static; }
  .ksp-linked-result-card { grid-template-columns: auto 56px minmax(0, 1fr); }
  .ksp-linked-selected-row { grid-template-columns: 40px minmax(0, 1fr); }
  .ksp-linked-selected-buttons { grid-column: 1 / -1; justify-content: flex-start; }
}

/* v0.1.50 Assortment manager accordions and exclusion details */
.ksp-card-accordion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ksp-card-accordion-heading .ksp-card-accordion-toggle {
  flex: 0 0 auto;
}
.ksp-card.is-collapsed {
  padding-bottom: 14px;
}
.ksp-exclusion-detail-row td {
  background: rgba(22, 51, 32, .035);
}
.ksp-detail-panel {
  border: 1px solid rgba(22, 51, 32, .10);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .82);
}
.ksp-store-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.ksp-store-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(22, 51, 32, .08);
  color: var(--ksp-green);
  font-size: 12px;
  font-weight: 700;
}


/* v0.1.51 Active exclusion search/export and product metadata */
.ksp-exclusion-tools {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.ksp-exclusion-search-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  min-width: min(100%, 320px);
}
.ksp-exclusion-search-label input {
  width: 100%;
  border: 1px solid rgba(22, 51, 32, .16);
  border-radius: 12px;
  padding: .68rem .8rem;
}
.ksp-exclusion-product-meta {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 500;
}
.ksp-exclusion-product-meta .ksp-muted {
  color: rgba(16,31,42,.62);
}
.ksp-exclusions-table .ksp-copy-token {
  margin-bottom: 2px;
}
@media (max-width: 720px) {
  .ksp-exclusion-tools { align-items: stretch; }
  .ksp-exclusion-tools .ksp-button-secondary { text-align: center; }
}

/* v0.1.52 safety actions and email/login refinements */
.ksp-danger-button {
  border-color: rgba(150, 39, 39, 0.35) !important;
  color: #8f1f1f !important;
}
.ksp-danger-button:hover,
.ksp-danger-button:focus {
  background: rgba(150, 39, 39, 0.08) !important;
}


/* v0.1.53 email logo asset and bulk exclusion cleanup tools */
.ksp-exclusion-select-col {
  width: 38px;
  text-align: center;
  vertical-align: middle;
}
.ksp-exclusion-select {
  width: 18px;
  height: 18px;
  accent-color: #163320;
}
.ksp-exclusion-tools .ksp-inline-form {
  margin: 0;
}
.ksp-exclusion-tools .ksp-danger-button {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .ksp-exclusion-tools .ksp-button-secondary,
  .ksp-exclusion-tools .ksp-inline-form,
  .ksp-exclusion-tools .ksp-inline-form button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .ksp-store-count-filter { flex-direction: column; align-items: stretch; }
  .ksp-store-count-filter select,
  .ksp-store-count-filter input { min-width: 0; max-width: none; width: 100%; }
}

/* v0.1.61: make delisting request tables visually distinct from listing request tables. */
.ksp-delist-request-table-wrap,
.ksp-delist-request-table {
  background: #F0EAD6;
}
.ksp-delist-request-table thead th,
.ksp-delist-request-table tbody td {
  background: #F0EAD6;
}
.ksp-delist-request-table tbody tr:hover td {
  background: #ebe2c6;
}

.ksp-latest-catalogs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.ksp-latest-catalog {
  border: 1px solid var(--ksp-line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.ksp-latest-catalog h3 { margin: 0; }
.ksp-latest-catalog p { margin: 0; color: var(--ksp-muted); }

.ksp-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 18px 0 8px;
}
.ksp-load-more-wrap .ksp-button-secondary {
    min-width: 180px;
}

/* v0.1.71 product request reason capture */
.ksp-product-action {
  min-width: 240px;
}
.ksp-request-reason-label {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ksp-text);
}
.ksp-request-reason {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 1px solid #d9d9cf;
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.ksp-request-reason-help {
  display: block;
  margin: -2px 0 10px;
}
.ksp-request-reason-cell {
  min-width: 220px;
  max-width: 360px;
  white-space: pre-wrap;
  line-height: 1.35;
}
@media (max-width: 760px) {
  .ksp-product-action { min-width: 0; }
}
