:root {
  color-scheme: light;
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #171b22;
  --muted: #66717f;
  --line: #dde2e7;
  --line-strong: #cbd2d9;
  --primary: #2563d8;
  --primary-hover: #1f53b5;
  --green: #16735a;
  --green-soft: #eaf6f1;
  --amber: #9a5a0a;
  --amber-soft: #fff5df;
  --red: #b63535;
  --red-soft: #fff0f0;
  --sidebar: #20262d;
  --sidebar-muted: #aeb7c1;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Product-card studio is isolated from catalog publication controls. */
.product-card-studio {
  display: grid;
  gap: 30px;
}

.product-card-intro {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid #e2cad0;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #fff7f8 100%);
}

.product-card-intro-icon,
.product-card-job-icon {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #171b22;
  color: #fff;
}

.product-card-intro-icon {
  width: 52px;
  height: 52px;
}

.product-card-intro-icon svg {
  width: 24px;
  height: 24px;
}

.product-card-intro h2,
.product-card-intro p {
  margin: 0;
}

.product-card-intro h2 {
  margin-top: 5px;
  font-size: 24px;
}

.product-card-intro p:last-child {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.product-card-job {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.product-card-job.is-running {
  border-color: #edd39c;
  background: var(--amber-soft);
}

.product-card-job.is-error {
  border-color: #e6bcbc;
  background: var(--red-soft);
}

.product-card-job.is-complete {
  border-color: #b9ddcf;
  background: var(--green-soft);
}

.product-card-job-icon {
  width: 42px;
  height: 42px;
}

.product-card-job strong,
.product-card-job small {
  display: block;
}

.product-card-job small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.product-template-grid,
.product-card-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-template-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.product-template-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.product-template-card.selected {
  border-color: #d51842;
  box-shadow: 0 0 0 2px rgba(213, 24, 66, 0.1);
}

.product-template-card img {
  width: 72px;
  height: 58px;
  border-radius: 7px;
  background: #eceff2;
  object-fit: contain;
}

.product-template-card span,
.product-template-card strong,
.product-template-card small {
  min-width: 0;
  display: block;
}

.product-template-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-template-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.product-template-card > svg {
  width: 18px;
  height: 18px;
  color: #d51842;
}

.product-template-empty {
  grid-column: 1 / -1;
  min-height: 130px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.product-template-empty svg {
  width: 24px;
  height: 24px;
}

.product-template-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.product-template-empty span {
  max-width: 440px;
  font-size: 12px;
  line-height: 1.5;
}

.product-card-form {
  display: grid;
  gap: 28px;
}

.product-card-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product-source-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.product-source-card.has-image {
  border-color: #d8b3bd;
  box-shadow: 0 0 0 2px rgba(213, 24, 66, 0.06);
}

.product-source-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.product-upload {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 136px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.product-upload:hover,
.product-source-card.has-image .product-upload {
  background: #fffafb;
}

.product-upload-preview {
  width: 118px;
  height: 116px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef0f3;
  color: var(--muted);
}

.product-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-upload-preview svg {
  width: 28px;
  height: 28px;
}

.product-upload > span:last-child,
.product-upload strong,
.product-upload small {
  min-width: 0;
  display: block;
}

.product-upload strong {
  font-size: 14px;
}

.product-upload small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-upload-copy em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.product-upload-copy em svg {
  width: 14px;
  height: 14px;
}

.product-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.product-source-actions .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

.product-source-actions .text-danger {
  margin-left: auto;
  color: var(--red);
}

.product-template-meta {
  margin-top: 16px;
}

.product-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-spec-grid .span-2 {
  grid-column: span 2;
}

.product-placement-fieldset {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.product-placement-fieldset legend {
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.product-placement-fieldset > p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.product-placement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-placement-option {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.product-placement-option:has(input:checked) {
  border-color: #d51842;
  background: #fffafb;
  box-shadow: 0 0 0 2px rgba(213, 24, 66, 0.08);
}

.product-placement-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.product-placement-map {
  position: relative;
  width: 38px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #f2f4f6;
}

.product-placement-map i {
  position: absolute;
  width: 10px;
  height: 17px;
  border-radius: 2px;
  background: #d51842;
}

.product-placement-map .at-top-left { top: 4px; left: 4px; }
.product-placement-map .at-top-right { top: 4px; right: 4px; }
.product-placement-map .at-middle-left { top: 50%; left: 4px; transform: translateY(-50%); }
.product-placement-map .at-middle-right { top: 50%; right: 4px; transform: translateY(-50%); }
.product-placement-map .at-bottom-left { bottom: 4px; left: 4px; }
.product-placement-map .at-bottom-right { right: 4px; bottom: 4px; }

.product-placement-option strong {
  font-size: 12px;
  line-height: 1.35;
}

.product-card-safety {
  margin-top: 18px;
}

.product-card-action-bar {
  justify-content: space-between;
}

.crop-modal {
  width: min(840px, 100%);
}

.product-crop-editor {
  display: grid;
  gap: 14px;
}

.product-crop-editor > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.product-crop-canvas-wrap {
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: #0e1116;
  touch-action: none;
  user-select: none;
}

.product-crop-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  cursor: move;
  touch-action: none;
}

.product-crop-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.product-card-output-profile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid #b9ddcf;
  border-radius: 10px;
  background: var(--green-soft);
}

.product-card-output-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
}

.product-card-output-profile strong,
.product-card-output-profile small {
  display: block;
}

.product-card-output-profile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-card-marketplaces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.product-card-marketplace-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.product-card-marketplace-option:has(input:checked) {
  border-color: #d51842;
  box-shadow: 0 0 0 2px rgba(213, 24, 66, 0.08);
}

.product-card-marketplace-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.product-card-marketplace-check {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: transparent;
}

.product-card-marketplace-option input:checked + .product-card-marketplace-check {
  border-color: #d51842;
  background: #d51842;
  color: #fff;
}

.product-card-marketplace-check svg {
  width: 15px;
  height: 15px;
}

.product-card-marketplace-option strong,
.product-card-marketplace-option small {
  min-width: 0;
  display: block;
}

.product-card-marketplace-option strong {
  font-size: 14px;
}

.product-card-marketplace-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.product-card-marketplace-option > a {
  color: var(--primary);
}

.product-card-marketplace-option > a svg {
  width: 17px;
  height: 17px;
}

.product-card-rules {
  margin-top: 14px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.product-card-rules strong {
  font-size: 13px;
}

.product-card-rules ul {
  margin: 9px 0 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.product-card-marketplace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.product-card-marketplace-badges span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f3e8eb;
  color: #8c1832;
  font-size: 10px;
  font-weight: 700;
}

.product-card-result {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.product-card-result.featured {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
}

.product-card-result-image {
  min-width: 0;
  display: grid;
  place-items: center;
  background: #edf0f3;
}

.product-card-result.featured .product-card-result-image {
  min-height: 410px;
}

.product-card-result-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-card-result-copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.product-card-result-copy strong {
  line-height: 1.45;
}

.product-card-result-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-card-result-copy .button {
  margin-top: auto;
}

.product-card-result.compact .product-card-result-image {
  height: 190px;
}

.product-card-result.compact .product-card-result-copy {
  min-height: 136px;
  padding: 14px;
}

.product-card-result.compact .button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .product-template-grid,
  .product-card-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card-upload-grid,
  .product-card-result.featured {
    grid-template-columns: 1fr;
  }

  .product-card-marketplaces {
    grid-template-columns: 1fr;
  }

  .product-placement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card-result.featured .product-card-result-image {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .product-card-intro {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 16px;
  }

  .product-card-intro-icon {
    width: 42px;
    height: 42px;
  }

  .product-card-intro h2 {
    font-size: 20px;
  }

  .product-card-job {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .product-card-output-profile {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .product-card-output-profile .status {
    grid-column: 2;
    justify-self: start;
  }

  .product-card-job .status {
    grid-column: 2;
    justify-self: start;
  }

  .product-template-grid,
  .product-card-results,
  .product-card-upload-grid,
  .product-spec-grid {
    grid-template-columns: 1fr;
  }

  .product-spec-grid .span-2 {
    grid-column: 1;
  }

  .product-upload {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 112px;
  }

  .product-upload-preview {
    width: 92px;
    height: 92px;
  }

  .product-source-actions .button {
    flex: 1 1 auto;
  }

  .product-source-actions .text-danger {
    margin-left: 0;
  }

  .product-card-action-bar,
  .product-crop-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .product-card-action-bar .button,
  .product-crop-actions .button {
    width: 100%;
  }

  .modal-backdrop:has(.crop-modal) {
    padding: 8px;
  }

  .crop-modal {
    max-height: calc(100vh - 16px);
  }

  .crop-modal [data-modal-body] {
    padding: 14px;
  }

  .product-card-result.featured .product-card-result-image {
    min-height: 240px;
  }
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 28px;
  background: var(--surface);
}

.auth-brand,
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  font-weight: 750;
}

.auth-brand img,
.app-brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.auth-panel {
  width: min(420px, 100%);
  margin: auto;
  padding: 36px 0 72px;
}

.auth-copy {
  margin-bottom: 28px;
}

.auth-copy h1 {
  margin: 6px 0 10px;
  font-size: 32px;
  line-height: 1.15;
}

.auth-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.registration-captcha {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.registration-captcha legend {
  padding: 0 6px;
  color: #404956;
  font-size: 13px;
  font-weight: 700;
}

.registration-captcha-visual {
  display: grid;
  grid-template-columns: minmax(0, 240px) 40px;
  align-items: center;
  gap: 10px;
}

.registration-captcha-visual img {
  width: 100%;
  max-width: 240px;
  height: 72px;
  display: block;
  border: 1px solid #cbd3dc;
  border-radius: 10px;
  background: #eef2f6;
  object-fit: cover;
}

.registration-captcha input[name="captchaAnswer"] {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--sidebar);
  color: #fff;
}

.app-brand {
  padding: 0 10px 24px;
  font-size: 17px;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 620;
}

.side-nav a:hover,
.side-nav a.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.side-nav .nav-attention {
  margin-left: auto;
  color: #f3bd62;
}

.side-nav svg,
.icon-button svg,
.button svg,
.status-icon svg,
.empty-state svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-account {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eff4ff;
  color: #244f9f;
  font-size: 11px;
  font-weight: 800;
}

.account-copy {
  min-width: 0;
}

.account-copy strong,
.account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
}

.account-copy small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.workspace {
  min-width: 0;
  padding: 0 36px 48px;
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.page-title {
  min-width: 0;
}

.page-title p,
.page-title h1 {
  margin: 0;
}

.page-title p {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.page-title h1 {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  line-height: 1.25;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.autosave-status::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.autosave-status.saved {
  color: var(--green);
}

.autosave-status.pending,
.autosave-status.saving {
  color: var(--amber);
}

.autosave-status.saving::before {
  animation: autosave-pulse 900ms ease-in-out infinite alternate;
}

.autosave-status.error {
  color: var(--red);
}

.bottom-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.notification-option {
  transition: opacity 160ms ease;
}

.notification-settings .form-grid {
  grid-template-columns: minmax(0, 720px);
  justify-content: start;
  gap: 10px;
}

.notification-settings .form-grid > .span-2 {
  grid-column: auto;
}

.notification-option.is-disabled {
  opacity: 0.48;
}

@keyframes autosave-pulse {
  to {
    opacity: 0.35;
  }
}

.page {
  width: min(1120px, 100%);
  padding: 30px 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.sidebar .icon-button {
  border-color: transparent;
  background: transparent;
  color: var(--sidebar-muted);
}

.mobile-menu {
  display: none;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.button:hover {
  background: var(--surface-soft);
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button.danger {
  border-color: #e6bcbc;
  color: var(--red);
}

.button.wide {
  width: 100%;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.text-button {
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field > span {
  color: #404956;
  font-size: 13px;
  font-weight: 650;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 216, 0.12);
}

.search-box {
  position: relative;
  width: min(460px, 100%);
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  padding-left: 40px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.client-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.client-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) 110px 36px;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}

.client-row + .client-row {
  border-top: 1px solid var(--line);
}

.client-row:hover {
  background: var(--surface-soft);
}

.client-name,
.client-domain {
  min-width: 0;
}

.client-name strong,
.client-name small,
.client-domain span,
.client-domain small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-name small,
.client-domain small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef1f4;
  color: #4d5865;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.good {
  background: var(--green-soft);
  color: var(--green);
}

.status.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.bad {
  background: var(--red-soft);
  color: var(--red);
}

.section-stack {
  display: grid;
  gap: 34px;
}

.platform-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.platform-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.platform-tabs a:hover {
  color: var(--text);
}

.platform-tabs a.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.platform-tabs svg {
  width: 17px;
  height: 17px;
}

.drom-feed-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.drom-reasons,
.drom-sample-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.drom-reason-row,
.drom-sample-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  padding: 12px 14px;
}

.drom-reason-row + .drom-reason-row,
.drom-sample-row + .drom-sample-row {
  border-top: 1px solid var(--line);
}

.drom-reason-row span {
  color: var(--muted);
  font-size: 13px;
}

.drom-reason-row strong {
  color: var(--text);
  font-size: 14px;
}

.drom-sample-row > span {
  min-width: 0;
}

.drom-sample-row > span:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.drom-sample-row strong,
.drom-sample-row small {
  display: block;
}

.drom-sample-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drom-sample-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.settings-group {
  min-width: 0;
}

.settings-group + .settings-group {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  font-size: 18px;
  line-height: 1.3;
}

.section-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.optional-settings {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.optional-settings summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.optional-settings summary small,
.optional-settings > p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.optional-settings > p {
  margin: 10px 0 16px;
  line-height: 1.5;
}

.optional-settings[open] .form-grid {
  margin-top: 2px;
}

.notice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
  border: 1px solid #b9ddcf;
  border-radius: 8px;
  background: var(--green-soft);
  color: #235d4c;
  font-size: 13px;
  line-height: 1.5;
}

.notice.warn {
  border-color: #ebd29f;
  background: var(--amber-soft);
  color: #70460e;
}

.notice.neutral {
  border-color: var(--line);
  background: var(--surface-soft);
  color: #46515d;
}

.source-access-notice {
  margin-top: 12px;
}

.notice strong,
.notice span {
  display: block;
}

.notice svg {
  width: 20px;
  height: 20px;
}

.connection-line {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #46515d;
}

.connection-line > svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.connection-line.warn > svg {
  color: var(--amber);
}

.connection-line strong,
.connection-line span {
  display: block;
}

.connection-line strong {
  font-size: 13px;
}

.connection-line span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.job-progress-card {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #b9ddcf;
  border-radius: 8px;
  background: var(--surface);
}

.job-progress-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.job-progress-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
}

.job-progress-icon svg {
  width: 20px;
  height: 20px;
}

.job-spinner {
  animation: job-spin 1.2s linear infinite;
}

.job-progress-title,
.job-progress-title strong,
.job-progress-title small {
  min-width: 0;
  display: block;
}

.job-progress-title strong {
  font-size: 15px;
}

.job-progress-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.job-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebef;
}

.job-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 240ms ease;
}

.job-progress-track.indeterminate > span {
  animation: job-slide 1.6s ease-in-out infinite;
}

.job-progress-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.job-progress-summary.album-cleanup {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-progress-summary > span {
  min-width: 0;
  padding: 12px 10px;
}

.job-progress-summary > span + span {
  border-left: 1px solid var(--line);
}

.job-progress-summary strong,
.job-progress-summary small {
  display: block;
}

.job-progress-summary strong {
  font-size: 16px;
}

.job-progress-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.job-current-item {
  min-width: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
}

.job-current-item span,
.job-current-item strong {
  display: block;
}

.job-current-item span {
  color: var(--muted);
  font-size: 11px;
}

.job-current-item strong {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.job-progress-list {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.job-progress-list-title,
.job-progress-row {
  min-width: 0;
  display: grid;
  align-items: center;
}

.job-progress-list-title {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0 8px;
}

.job-progress-list-title strong {
  font-size: 13px;
}

.job-progress-list-title span {
  color: var(--muted);
  font-size: 11px;
}

.job-progress-row {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.job-progress-row > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.job-progress-row.good > svg {
  color: var(--green);
}

.job-progress-row.bad > svg {
  color: var(--red);
}

.job-progress-row.warn > svg {
  color: var(--amber);
}

.job-progress-row span,
.job-progress-row strong,
.job-progress-row small {
  min-width: 0;
  display: block;
}

.job-progress-row strong {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.job-progress-row small {
  margin-top: 3px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.35;
}

.job-progress-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.job-progress-row.good em {
  color: var(--green);
}

.job-progress-row.bad em {
  color: var(--red);
}

.job-progress-row.warn em,
.job-progress-row.warn small {
  color: var(--amber);
}

.job-progress-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.job-progress-foot.stale span:first-child {
  color: var(--amber);
  font-weight: 650;
}

.queue-wait-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #ead69b;
  border-radius: 7px;
  background: #fffaf0;
  color: #715b23;
  font-size: 12px;
  line-height: 1.45;
}

.queue-wait-note strong {
  flex: 0 0 auto;
}

@keyframes job-spin {
  to { transform: rotate(360deg); }
}

@keyframes job-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(300%); }
}

.secret-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.secret-field.is-stored input {
  padding-right: 42px;
}

.secret-field > svg {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--green);
  pointer-events: none;
}

.secret-field input::placeholder {
  color: #7a8592;
}

.integration-list {
  display: grid;
  gap: 12px;
}

.request-more {
  border-top: 1px solid var(--line);
}

.request-more > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.request-more > summary::-webkit-details-marker {
  display: none;
}

.request-more > summary::after {
  content: "↓";
  transition: transform 160ms ease;
}

.request-more[open] > summary::after {
  transform: rotate(180deg);
}

.request-more-list {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.inactive-candidate-list {
  border-top: 1px solid var(--line);
}

.inactive-tracking-toggle {
  margin-bottom: 18px;
}

.inactive-candidate-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.inactive-candidate-row.no-selection {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: default;
}

.inactive-candidate-row > input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.inactive-candidate-copy {
  min-width: 0;
}

.inactive-candidate-copy strong,
.inactive-candidate-copy .inactive-candidate-details,
.inactive-candidate-copy small {
  display: block;
}

.inactive-candidate-copy strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.inactive-candidate-copy small,
.selection-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inactive-candidate-details {
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.inactive-candidate-row .button {
  min-height: 36px;
  padding: 0 11px;
}

.inactive-candidate-links {
  width: 176px;
  display: grid;
  gap: 8px;
}

.inactive-candidate-links .button {
  width: 100%;
  white-space: nowrap;
}

.inactive-candidate-actions {
  margin-top: 16px;
}

.selection-hint {
  margin: 0 auto 0 0;
}

.inline-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.inline-empty svg {
  width: 19px;
  height: 19px;
  color: var(--green);
}

.notice + .integration-list {
  margin-top: 14px;
}

.integration-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3fb;
  color: var(--primary);
}

.integration-copy {
  min-width: 0;
}

.integration-copy strong,
.integration-copy span {
  display: block;
}

.integration-copy strong {
  font-size: 14px;
}

.integration-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.integration-copy .inline-error {
  color: var(--red);
}

.integration-copy .inline-warning {
  color: #8a5a00;
  font-weight: 650;
}

.integration-copy .album-timing {
  color: #5f6b77;
  font-weight: 600;
}

.integration-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.reconciliation-actions {
  flex-wrap: wrap;
  max-width: 410px;
}

.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.subsection-heading strong,
.subsection-heading span {
  display: block;
}

.subsection-heading strong {
  font-size: 14px;
}

.subsection-heading > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.vk-onboarding,
.setup-flow {
  border-top: 1px solid var(--line);
}

.vk-step,
.setup-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.vk-step-number,
.setup-step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd3dc;
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.vk-step-number svg,
.setup-step-number svg {
  width: 17px;
  height: 17px;
}

.vk-step.is-complete .vk-step-number,
.setup-step.is-complete .setup-step-number {
  border-color: #96ccb7;
  background: #eaf7f1;
  color: var(--green);
}

.vk-step.is-current .vk-step-number,
.setup-step.is-current .setup-step-number {
  border-color: var(--primary);
  color: var(--primary);
}

.vk-step.is-locked,
.setup-step.is-locked {
  color: var(--muted);
}

.vk-step-content,
.setup-step-content {
  min-width: 0;
}

.vk-step-content > strong,
.vk-step-content > span,
.setup-step-content > strong,
.setup-step-content > span {
  display: block;
}

.vk-step-content > strong,
.setup-step-content > strong {
  font-size: 14px;
}

.vk-step-content > span,
.setup-step-content > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.vk-step-actions,
.setup-step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.vk-community-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.vk-community-form .field {
  gap: 6px;
}

.source-site-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.source-access-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.source-admin-step {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
}

.source-admin-step .setup-step-number {
  margin-top: 2px;
}

.source-access-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.source-access-title > div {
  min-width: 0;
}

.source-access-title strong,
.source-access-title span {
  display: block;
}

.source-access-title > div > strong {
  font-size: 14px;
}

.source-access-title > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-access-title > .status {
  flex: 0 0 auto;
}

.source-admin-step .source-access-actions {
  grid-column: 2;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.source-access-error {
  margin-top: 14px;
}

.setup-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-technical-settings {
  margin-top: 14px;
}

.vk-step:has(.vk-step-groups) {
  align-items: start;
}

.vk-step-groups {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.vk-step-groups .integration-row {
  padding: 12px;
  background: #fff;
}

.vk-step-groups .integration-copy > span:not(.inline-error) {
  margin-top: 3px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf1f4;
}

.segmented label {
  position: relative;
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.3;
}

.segmented input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 28, 38, 0.12);
}

.toggle-row {
  width: 100%;
  max-width: 720px;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 18px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.toggle-copy {
  min-width: 0;
}

.toggle-copy strong,
.toggle-copy small {
  display: block;
}

.toggle-copy strong {
  font-size: 14px;
}

.toggle-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  justify-self: end;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd2d9;
  transition: background 160ms ease;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
  content: "";
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 22px;
}

.run-status-panel:not(:empty) {
  margin-top: 16px;
}

.run-result-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.run-result-card.warn {
  border-left-color: var(--amber);
}

.run-result-card.bad {
  border-left-color: var(--red);
}

.run-result-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.run-result-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
}

.run-result-card.warn .run-result-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.run-result-card.bad .run-result-icon {
  background: var(--red-soft);
  color: var(--red);
}

.run-result-icon svg {
  width: 18px;
  height: 18px;
}

.run-result-copy,
.run-result-copy strong,
.run-result-copy small {
  min-width: 0;
  display: block;
}

.run-result-copy strong {
  font-size: 14px;
}

.run-result-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.run-result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.run-result-summary.deactivation-result {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.empty-album-preview {
  max-height: 320px;
  overflow: auto;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.empty-album-preview > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
}

.empty-album-preview > div + div {
  border-top: 1px solid var(--line);
}

.empty-album-preview svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.empty-album-preview span,
.empty-album-preview strong,
.empty-album-preview small {
  min-width: 0;
  display: block;
}

.empty-album-preview strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.empty-album-preview small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.run-result-summary > span {
  min-width: 0;
  padding: 10px;
}

.run-result-summary > span + span {
  border-left: 1px solid var(--line);
}

.run-result-summary strong,
.run-result-summary small {
  display: block;
}

.run-result-summary strong {
  font-size: 15px;
}

.run-result-summary small,
.run-result-time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.run-result-summary small {
  margin-top: 3px;
}

.run-attention-list {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.run-attention-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 8px;
}

.run-attention-title strong {
  font-size: 13px;
}

.run-attention-title span {
  color: var(--muted);
  font-size: 11px;
}

.run-attention-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.run-attention-row > svg {
  width: 17px;
  height: 17px;
  color: var(--amber);
}

.run-attention-row.bad > svg {
  color: var(--red);
}

.run-attention-row > span,
.run-attention-row > span strong,
.run-attention-row > span small {
  min-width: 0;
  display: block;
}

.run-attention-row > span strong {
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.run-attention-row > span small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.run-attention-row > em {
  color: var(--amber);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.run-attention-row.bad > em {
  color: var(--red);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-item {
  min-width: 0;
  padding: 18px;
}

.summary-item + .summary-item {
  border-left: 1px solid var(--line);
}

.summary-item span,
.summary-item strong {
  display: block;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.summary-strip.compact .summary-item {
  padding: 14px;
}

.modal-lead,
.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reconciliation-report {
  display: grid;
  gap: 18px;
}

.reconciliation-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
}

.reconciliation-metrics strong {
  margin-left: 4px;
  color: var(--text);
}

.reconciliation-samples {
  display: grid;
  gap: 0;
}

.reconciliation-topic {
  min-width: 0;
  padding: 0 0 4px;
}

.reconciliation-topic + .reconciliation-topic {
  margin-top: 24px;
  padding-top: 28px;
  border-top: 4px solid #8793a1;
}

.reconciliation-topic-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.reconciliation-topic-title {
  min-width: 0;
}

.reconciliation-topic-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.reconciliation-topic-title small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
}

.reconciliation-topic-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 5px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.reconciliation-topic-count strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1;
}

.reconciliation-topic-body {
  min-width: 0;
}

.reconciliation-sample {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.reconciliation-sample strong,
.reconciliation-sample span {
  display: block;
}

.reconciliation-sample strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.reconciliation-sample span {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.reconciliation-review-item {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.reconciliation-review-item.is-processing,
.reconciliation-missing-item.is-processing,
.reconciliation-unmatched-item.is-processing {
  opacity: 0.72;
}

.reconciliation-missing-item,
.reconciliation-unmatched-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.reconciliation-missing-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reconciliation-missing-actions .button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.reconciliation-missing-actions .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reconciliation-missing-actions .status svg {
  width: 14px;
  height: 14px;
}

.queue-message {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.reconciliation-review-copy strong,
.reconciliation-review-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.reconciliation-review-copy strong {
  font-size: 13px;
}

.reconciliation-review-copy small,
.reconciliation-candidate span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.reconciliation-source,
.reconciliation-candidate {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.reconciliation-source > span,
.reconciliation-candidate span {
  margin: 0;
  color: var(--primary);
  font-weight: 750;
}

.reconciliation-candidate strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.comparison-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.comparison-link:hover {
  text-decoration: underline;
}

.comparison-link svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 640px) {
  .reconciliation-topic + .reconciliation-topic {
    margin-top: 20px;
    padding-top: 24px;
  }

  .reconciliation-topic-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .reconciliation-topic-title h3 {
    font-size: 17px;
  }

  .reconciliation-topic-count {
    width: fit-content;
  }

  .reconciliation-source,
  .reconciliation-candidate {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .comparison-link {
    grid-column: 2;
    justify-self: start;
  }

  .reconciliation-missing-item {
    grid-template-columns: 1fr;
  }

  .reconciliation-unmatched-item {
    grid-template-columns: 1fr;
  }

  .reconciliation-missing-item > .comparison-link,
  .reconciliation-unmatched-item > .comparison-link {
    grid-column: 1;
  }
}

.compact-field {
  gap: 5px;
}

.compact-field select {
  min-height: 40px;
}

.reconciliation-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reconciliation-review-actions .button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.event-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.event-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 15px 16px;
}

.event-row + .event-row {
  border-top: 1px solid var(--line);
}

.event-marker {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef3fb;
  color: var(--primary);
}

.event-marker svg {
  width: 16px;
  height: 16px;
}

.event-copy {
  min-width: 0;
}

.event-copy strong,
.event-copy span {
  display: block;
}

.event-copy strong {
  font-size: 13px;
  line-height: 1.45;
}

.event-copy span,
.event-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 26px;
  height: 26px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.integration-list .empty-state {
  min-height: 120px;
  padding: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  width: min(380px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 34px rgba(17, 23, 31, 0.2);
  font-size: 13px;
  line-height: 1.45;
}

.toast.error {
  background: #922f2f;
}

.sidebar-scrim {
  display: none;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 25, 32, 0.5);
}

.modal {
  width: min(500px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(12, 18, 25, 0.25);
}

.modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal h2 {
  margin: 0;
  font-size: 17px;
}

.modal [data-modal-body] {
  padding: 20px;
}

.modal-form {
  display: grid;
  gap: 16px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    width: 248px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    border: 0;
    background: rgba(17, 24, 39, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.menu-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    padding: 0 22px 40px;
  }

  .mobile-menu {
    display: inline-grid;
  }
}

@media (max-width: 680px) {
  .auth-shell {
    padding: 20px;
  }

  .workspace {
    padding: 0 16px 32px;
  }

  .topbar {
    min-height: 76px;
  }

  .page {
    padding-top: 24px;
  }

  .page-title h1 {
    font-size: 19px;
  }

  .top-actions .button span {
    display: none;
  }

  .top-actions .button {
    width: 40px;
    padding: 0;
  }

  .autosave-status {
    font-size: 11px;
  }

  .bottom-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .bottom-save-bar .button {
    width: 100%;
  }

  .list-toolbar,
  .section-heading,
  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .client-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .client-domain,
  .client-row > svg {
    display: none;
  }

  .integration-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .integration-row .button,
  .integration-row .status {
    grid-column: 2;
    width: fit-content;
  }

  .integration-actions {
    grid-column: 2;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
  }

  .integration-actions .button,
  .integration-actions .status {
    max-width: 100%;
    white-space: normal;
  }

  .inactive-candidate-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .inactive-candidate-row.no-selection {
    grid-template-columns: minmax(0, 1fr);
  }

  .inactive-candidate-row .button {
    grid-column: 2;
    width: fit-content;
  }

  .inactive-candidate-links {
    grid-column: 2;
    width: min(100%, 176px);
  }

  .inactive-candidate-row.no-selection .inactive-candidate-links {
    grid-column: 1;
  }

  .inactive-candidate-links .button {
    grid-column: auto;
    width: 100%;
  }

  .subsection-heading,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .vk-step,
  .setup-step {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
  }

  .vk-step-actions,
  .setup-step-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .vk-community-form {
    grid-template-columns: 1fr;
  }

  .vk-community-form .button {
    width: fit-content;
  }

  .source-site-form,
  .source-access-fields {
    grid-template-columns: 1fr;
  }

  .source-access-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .source-access-title > .status {
    width: fit-content;
  }

  .source-site-form .button {
    width: fit-content;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .job-progress-head {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .job-progress-head .status {
    grid-column: 2;
  }

  .job-progress-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-result-head {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .run-result-head .status {
    grid-column: 2;
  }

  .run-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-result-summary > span:nth-child(odd) {
    border-left: 0;
  }

  .run-result-summary > span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .job-progress-summary > span:nth-child(odd) {
    border-left: 0;
  }

  .job-progress-summary > span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .job-progress-list-title,
  .job-progress-foot,
  .run-attention-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .queue-wait-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .job-progress-list-title {
    display: flex;
  }

  .job-progress-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .run-attention-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .run-attention-row > em,
  .run-attention-row > .button {
    grid-column: 2;
    justify-self: start;
  }

  .job-progress-row em {
    grid-column: 2;
  }

  .summary-item + .summary-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .summary-item strong {
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .event-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .event-time {
    grid-column: 2;
    margin-top: 0;
  }

  .segmented {
    grid-template-columns: 1fr;
  }
}
