body {
  background: #f7f8fa;
  color: #20242a;
}

.auth-page {
  min-height: 100vh;
  background: #f4f7fb;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 460px);
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
  padding: 4rem 1rem;
}

.auth-brand-panel,
.auth-form-panel {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 1.5rem;
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand-panel img {
  width: 144px;
  height: 38px;
  object-fit: contain;
}

.auth-brand-panel h1 {
  margin: 2.5rem 0 0.5rem;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 700;
}

.auth-brand-panel p,
.auth-form-heading p {
  color: #64748b;
}

.auth-brand-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2rem;
}

.auth-brand-meta span {
  border: 1px solid #dce2ea;
  border-radius: 999px;
  color: #334155;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
}

.auth-form-panel {
  align-self: center;
}

.auth-form-heading {
  margin-bottom: 1.25rem;
}

.auth-form-heading h2 {
  margin-bottom: 0.25rem;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 700;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #dce2ea;
  background: #fff;
  padding: 1rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 40px;
  margin-bottom: 1rem;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.app-brand img {
  width: 120px;
  height: 32px;
  object-fit: contain;
}

.app-nav {
  display: grid;
  gap: 0.25rem;
}

.app-nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-radius: 6px;
  color: #334155;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
  background: #f1f5f9;
  color: #174ea6;
}

.app-nav-link.is-active {
  color: #174ea6;
  background: #eaf1ff;
  font-weight: 700;
}

.app-sidebar-meta {
  margin-top: auto;
  border-top: 1px solid #e5ebf3;
  color: #64748b;
  font-size: 0.78rem;
  padding-top: 0.85rem;
}

.app-sidebar-meta a {
  color: #174ea6;
  text-decoration: none;
}

.app-workspace {
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  border-bottom: 1px solid #dce2ea;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.75rem 1rem;
}

.app-topbar-title {
  color: #0f172a;
  font-weight: 700;
}

.app-topbar-subtitle {
  color: #64748b;
  font-size: 0.82rem;
}

.app-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

main {
  max-width: 1680px;
}

.app-main {
  min-width: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-title {
  margin-bottom: 0.25rem;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-subtitle {
  max-width: 78ch;
  color: #64748b;
  font-size: 0.92rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.surface-panel {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
}

.surface-pad {
  padding: 1rem;
}

.filter-panel {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.product-filter-panel {
  display: grid;
  gap: 0.75rem;
}

.product-filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-filter-title {
  color: #0f172a;
  font-weight: 700;
}

.product-filter-subtitle {
  color: #64748b;
  font-size: 0.82rem;
}

.product-filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.product-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 0.5rem;
}

.product-filter-grid .form-control,
.product-filter-grid .form-select {
  min-height: 38px;
  font-size: 0.88rem;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid #e5ebf3;
  padding: 0.75rem;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.bulk-action-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem;
}

.bulk-action-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 0.25rem;
}

.action-group-bordered {
  border-left: 1px solid #e5ebf3;
  padding-left: 0.5rem;
}

.action-group-danger {
  border-left: 1px solid #fee2e2;
  padding-left: 0.5rem;
}

.table-toolbar-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.table-workbench {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.table-workbench-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
}

.table-workbench-title {
  color: #0f172a;
  font-weight: 700;
}

.table-workbench-subtitle {
  color: #64748b;
  font-size: 0.82rem;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.users-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.user-create-panel {
  position: sticky;
  top: 5rem;
}

.user-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5ebf3;
  padding: 1rem;
}

.user-runtime-dir {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.table td,
.table th {
  vertical-align: middle;
}

.data-table-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  border-top: 1px solid #e5ebf3;
}

.data-table {
  min-width: 2600px;
  table-layout: fixed;
}

.data-table col {
  min-width: 76px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8f9fb;
  border-bottom: 1px solid #d7dce2;
  white-space: nowrap;
}

.data-table th.resizable-col {
  padding-right: 1rem;
}

.column-resize-handle {
  position: absolute;
  top: 0.35rem;
  right: 0;
  bottom: 0.35rem;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
  margin-left: 4px;
  border-radius: 999px;
  background: transparent;
}

.data-table th.resizable-col:hover .column-resize-handle::after,
.is-resizing-column .column-resize-handle::after {
  background: #2563eb;
}

.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.data-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.data-table tbody tr:hover td {
  background: #eef5ff;
}

.data-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-table tbody tr {
  height: 58px;
}

.products-table tbody td {
  height: 58px;
  max-height: 58px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.products-table .product-about-cell {
  max-height: 44px;
  overflow: hidden;
  line-height: 1.25;
}

.products-table .product-about-cell .small {
  overflow: hidden;
  text-overflow: ellipsis;
}


.data-table .sticky-col {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.data-table thead .sticky-col {
  z-index: 4;
  background: #f8f9fb;
}

.data-table .select-col {
  left: 0;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}

.data-table .asin-col {
  left: 44px;
  width: 132px;
  min-width: 132px;
  box-shadow: 1px 0 0 #e3e7ec;
}

.data-table .sticky-action-col {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -1px 0 0 #d7dce2, -10px 0 18px rgba(15, 23, 42, 0.06);
}

.data-table thead .sticky-action-col {
  z-index: 5;
  background: #f8f9fb;
}

.data-table .action-col {
  width: 140px;
  min-width: 140px;
}

.data-table-wrap::-webkit-scrollbar {
  height: 14px;
  width: 14px;
}

.data-table-wrap::-webkit-scrollbar-thumb {
  background: #aab3c0;
  border-radius: 8px;
  border: 3px solid #fff;
}

.data-table-wrap::-webkit-scrollbar-track {
  background: #eef1f5;
}

.task-filter .form-select {
  width: auto;
  min-width: 128px;
}

.api-example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.api-example-grid > * {
  min-width: 0;
}

.api-code {
  max-width: 100%;
  overflow-x: auto;
  padding: 0.75rem;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #f8fafc;
  color: #111827;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.api-code code {
  white-space: inherit;
  overflow-wrap: anywhere;
}

.api-token-box input {
  min-width: 0;
}

.api-key-table {
  min-width: 760px;
}

.api-doc-table {
  min-width: 760px;
}

.api-doc-table td,
.api-doc-table th {
  white-space: normal;
}

.api-doc-panel {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
}

.api-doc-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  padding: 1rem;
}

.api-doc-panel > summary::-webkit-details-marker {
  display: none;
}

.api-doc-body {
  border-top: 1px solid #e5ebf3;
  padding: 1rem;
}

.task-layout,
.task-layout > .task-sidebar,
.task-layout > .task-main {
  min-width: 0;
}

.task-main {
  overflow: hidden;
}

.task-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1rem;
}

.task-create-panel {
  min-width: 0;
  scroll-margin-top: 5rem;
}

@media (max-width: 991.98px) {
  .task-create-grid {
    grid-template-columns: 1fr;
  }
}

.task-create-console {
  display: grid;
  gap: 1rem;
}

.task-create-intent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0.85rem;
}

.task-create-intent-title {
  color: #0f172a;
  font-weight: 700;
}

.task-create-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.task-create-nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 0.35rem 0.55rem;
}

.task-create-nav-button:hover,
.task-create-nav-button:focus-visible,
.task-create-nav-button.is-active {
  border-color: #bfdbfe;
  background: #eaf1ff;
  color: #174ea6;
}

.task-create-nav-button.is-active {
  font-weight: 700;
}

.task-create-panel.is-hidden {
  display: none;
}

.marketplace-picker {
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.75rem;
}

.marketplace-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.marketplace-picker-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.5rem;
}

.marketplace-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.45rem;
}

.marketplace-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.45rem;
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  padding: 0.5rem;
}

.marketplace-chip:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.marketplace-chip strong,
.marketplace-chip small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketplace-chip strong {
  font-size: 0.85rem;
  line-height: 1.15;
}

.marketplace-chip small {
  color: #64748b;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.task-list {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.task-site-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.task-site-card {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0.72rem 0.8rem;
  text-decoration: none;
}

.task-site-card:hover,
.task-site-card:focus-visible {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.task-site-card.is-active {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.task-site-card-label,
.task-site-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-site-card-label {
  font-size: 0.82rem;
  font-weight: 650;
}

.task-site-card strong {
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.2;
}

.task-site-card small {
  color: #64748b;
  font-size: 0.75rem;
}

.task-site-groups {
  display: grid;
  gap: 1rem;
}

.task-site-group {
  min-width: 0;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.75rem;
}

.task-site-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.1rem 0.15rem 0.7rem;
}

.task-site-group-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
}

.task-site-group-header span,
.task-site-group-summary {
  color: #64748b;
  font-size: 0.8rem;
}

.task-settings-panel {
  margin-top: 0.75rem;
}

.task-settings-panel > summary {
  color: #475569;
  cursor: pointer;
}

.task-empty-state {
  display: grid;
  gap: 0.25rem;
  place-items: center;
  min-height: 160px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}

.task-empty-state strong {
  color: #334155;
}

.task-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.82rem;
}

.task-pagination > :last-child {
  justify-self: end;
}

.task-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.task-heading {
  font-size: 1rem;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.task-target {
  color: #334155;
  font-size: 0.9rem;
  margin-top: 0.12rem;
}

.task-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.task-card.status-pending { border-color: #cbd5e1; }
.task-card.status-queued { border-color: #bfdbfe; }
.task-card.status-running { border-color: #bbf7d0; }
.task-card.status-completed { border-color: #d1d5db; background: #fbfcfe; }
.task-card.status-failed { border-color: #fecaca; }
.task-card.status-paused { border-color: #fde68a; }

.task-param-summary {
  color: #334155;
  margin-top: 0.15rem;
  line-height: 1.4;
  font-size: 0.86rem;
}

.task-last-error {
  margin-top: 0.45rem;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 0.86rem;
  padding: 0.45rem 0.55rem;
  overflow-wrap: anywhere;
}

.task-quick-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
  border-top: 1px solid #e5ebf3;
  padding-top: 0.75rem;
}

@media (max-width: 575.98px) {
  .task-site-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-site-group-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-pagination {
    grid-template-columns: 1fr 1fr;
  }

  .task-pagination > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
}

.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.task-detail-panel summary {
  cursor: pointer;
  color: #334155;
}

.task-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
}

.task-stat-group {
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdff;
}

.task-stat-group-title {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  background: #eef4fb;
  border-bottom: 1px solid #dbe3ee;
}

.task-stat-cells {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
}

.task-stat-cell {
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-right: 1px solid #e5ebf3;
  border-bottom: 1px solid #e5ebf3;
}

.task-stat-cell:last-child {
  border-right: 0;
}

.task-stat-label {
  display: block;
  margin-bottom: 0.12rem;
  font-size: 0.72rem;
  line-height: 1.15;
  color: #64748b;
  white-space: nowrap;
}

.task-stat-cell strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.15;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.task-stat-wide {
  grid-column: span 2;
}

.task-stat-error-text {
  color: #b45309;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
  .task-stats-grid {
    grid-template-columns: 1fr;
  }
}


.status-pill {
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-pill.status-pending { background: #e2e8f0; color: #334155; }
.status-pill.status-queued { background: #dbeafe; color: #1d4ed8; }
.status-pill.status-running { background: #dcfce7; color: #15803d; }
.status-pill.status-completed { background: #e5e7eb; color: #374151; }
.status-pill.status-failed { background: #fee2e2; color: #b91c1c; }
.status-pill.status-paused { background: #fef3c7; color: #b45309; }

.task-log-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.task-log-panel summary {
  cursor: pointer;
  color: #334155;
}

.task-log-scroll {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 240px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.task-logs {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

.app-footer {
  background: #fff;
}

.app-footer a {
  color: #475569;
  text-decoration: none;
}

.app-footer a:hover {
  color: #174ea6;
  text-decoration: underline;
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: minmax(0, 460px);
    padding: 1rem;
  }

  .auth-brand-panel {
    min-height: 220px;
  }

  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dce2ea;
    padding: 0.65rem 0.75rem;
  }

  .app-brand {
    margin-bottom: 0.5rem;
  }

  .app-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .app-nav-link {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
  }

  .app-sidebar-meta {
    display: none;
  }

  .app-topbar {
    position: static;
  }
}

@media (max-width: 575.98px) {
  .app-topbar,
  .page-header,
  .action-strip {
    align-items: stretch;
  }

  .app-topbar-actions,
  .page-actions,
  .action-group {
    width: 100%;
    justify-content: flex-start;
  }
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.35rem 0.75rem;
}

.region-grid .form-check {
  margin-right: 0;
}

.seller-lookup-box {
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 0.85rem;
}

.seller-lookup-box .input-group .btn {
  min-width: 76px;
}

.reviews-table {
  min-width: 1320px;
}

.reviews-table .review-title-cell {
  width: 240px;
  max-width: 240px;
}

.reviews-table .review-body-cell {
  width: 420px;
  max-width: 420px;
  white-space: normal;
}

.review-title-preview,
.review-body-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.review-title-preview {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.review-body-preview {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  color: #334155;
}

.reviews-table .asin-col {
  left: 44px;
  width: 150px;
  min-width: 150px;
  box-shadow: 1px 0 0 #e3e7ec;
}

.reviews-table .action-col {
  width: 92px;
  min-width: 92px;
}

.reviews-table .review-variant-cell,
.reviews-table .review-title-cell,
.reviews-table .review-body-cell {
  white-space: normal;
  vertical-align: top;
}

.reviews-table .review-variant-cell {
  width: 260px;
  max-width: 260px;
}

.reviews-table .review-title-cell {
  width: 300px;
  max-width: 300px;
}

.reviews-table .review-body-cell {
  width: 520px;
  max-width: 520px;
}

.review-meta-preview,
.review-title-preview,
.review-body-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.review-meta-preview,
.review-title-preview {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.review-body-preview {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  color: #334155;
}

.reviews-table .review-images-cell {
  white-space: nowrap;
  overflow: visible;
}

.review-image-strip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.review-image-strip a {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.review-image-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-image-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-review-quick-control {
  width: 150px;
}

.product-review-quick-control .form-control {
  min-width: 56px;
}

.settings-shell {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

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

.settings-runtime-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
}

.settings-runtime-item {
  min-width: 0;
}

.settings-runtime-label {
  display: block;
  margin-bottom: 0.15rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.settings-runtime-value {
  display: block;
  color: #0f172a;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.settings-runtime-note {
  grid-column: 1 / -1;
  border-top: 1px solid #e5ebf3;
  color: #334155;
  font-size: 0.86rem;
  padding-top: 0.65rem;
}

.settings-runtime-note-warning {
  color: #92400e;
}

.settings-nav {
  position: sticky;
  top: 1rem;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
}

.settings-nav-title {
  margin-bottom: 0.5rem;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.settings-nav-list {
  display: grid;
  gap: 0.25rem;
}

.settings-nav-list a {
  display: flex;
  align-items: center;
  min-height: 36px;
  border-radius: 6px;
  color: #334155;
  padding: 0.45rem 0.55rem;
  text-decoration: none;
}

.settings-nav-list a:hover,
.settings-nav-list a:focus-visible {
  background: #eaf1ff;
  color: #174ea6;
}

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

.settings-cookie-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.settings-cookie-batch-panel {
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.85rem;
  margin-bottom: 0.9rem;
}

.settings-cookie-batch-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-cookie-batch-title {
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 700;
}

.settings-cookie-batch-subtitle,
.settings-cookie-batch-time {
  color: #64748b;
  font-size: 0.82rem;
}

.settings-cookie-batch-error {
  margin-top: 0.6rem;
  color: #b91c1c;
  font-size: 0.82rem;
}

.settings-cookie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.65rem;
}

.settings-cookie-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
}

.settings-cookie-card-heading {
  margin: 0;
}

.settings-cookie-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 64px;
  border: 0;
  background: #fff;
  color: inherit;
  padding: 0.65rem 0.8rem;
  text-align: left;
}

.settings-cookie-card-toggle:hover {
  background: #f8fafc;
}

.settings-cookie-card-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

.settings-cookie-card-toggle:not(.collapsed) {
  background: #f8fbff;
}

.settings-cookie-card-main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.settings-cookie-card-title {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.settings-cookie-card-host,
.settings-cookie-card-address {
  color: #64748b;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-cookie-card-side {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.55rem;
}

.settings-cookie-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
}

.settings-cookie-badge.is-saved {
  background: #e8f5ee;
  color: #047857;
}

.settings-cookie-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid #334155;
  border-bottom: 2px solid #334155;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.settings-cookie-card-toggle:not(.collapsed) .settings-cookie-chevron {
  transform: rotate(225deg);
}

.settings-cookie-card-body {
  border-top: 1px solid #e5ebf3;
  background: #fff;
  padding: 0.85rem;
}

.settings-cookie-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.settings-cookie-result-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem;
}

.settings-cookie-result-card.status-failed {
  border-color: #fecdd3;
  background: #fff7f7;
}

.settings-cookie-result-card.status-fallback {
  border-color: #fde68a;
  background: #fffbeb;
}

.settings-cookie-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.settings-cookie-result-title {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.settings-cookie-result-host,
.settings-cookie-result-location,
.settings-cookie-result-message {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.settings-cookie-result-message,
.settings-cookie-result-location {
  overflow-wrap: anywhere;
}

.settings-cookie-result-location {
  margin-top: 0.25rem;
}

.settings-cookie-result-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
}

.settings-cookie-result-badge.is-ok {
  background: #e8f5ee;
  color: #047857;
}

.settings-cookie-result-badge.is-fallback {
  background: #fef3c7;
  color: #92400e;
}

.settings-cookie-result-badge.is-failed {
  background: #ffe4e6;
  color: #be123c;
}

.settings-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}

.settings-action-bar > .small {
  max-width: 68ch;
}

.settings-form.has-unsaved-changes .settings-action-bar {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.settings-form.has-unsaved-changes .settings-save-state {
  color: #174ea6 !important;
  font-weight: 600;
}

.settings-page section[id] {
  scroll-margin-top: 1rem;
}

.table-sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.table-sort-link:hover {
  color: #174ea6;
  text-decoration: underline;
}

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

  .users-shell {
    grid-template-columns: 1fr;
  }

  .user-create-panel {
    position: static;
  }

  .settings-nav {
    position: static;
  }

  .settings-nav-list {
    display: flex;
    flex-wrap: wrap;
  }

  .settings-nav-list a {
    min-height: 40px;
  }
}

@media (max-width: 575.98px) {
  .settings-action-bar {
    align-items: stretch;
  }

  .settings-action-bar > .small,
  .settings-action-bar > .d-flex {
    width: 100%;
  }
}
