html,
body {
  margin: 0;
  min-width: 320px;
  background: #f1f1f1;
}

.dashboard-panel {
  display: grid;
  gap: 1rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 1.5rem;
}

.dashboard-support {
  position: sticky;
  top: 1.25rem;
}

.support-card {
  box-sizing: border-box;
  padding: 1.625rem 1.375rem;
  border: 1px solid #e3e6e8;
  border-radius: 16px;
  background: #f9faf9;
}

.support-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.support-eyebrow {
  margin: 0 0 0.625rem;
  color: #61666b;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.5;
}

.support-card h2 {
  margin: 0 0 0.75rem;
  color: #202223;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.support-card > p:not(.support-eyebrow) {
  color: #61666b;
  font-size: 0.8125rem;
  line-height: 1.65;
}

.support-card s-button {
  display: block;
  margin: 1.25rem 0 0.75rem;
}

.support-email {
  color: #303638;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  text-underline-offset: 3px;
}

.support-note {
  margin-top: 1.375rem;
  padding-top: 1rem;
  border-top: 1px solid #e3e6e8;
  color: #61666b;
  font-size: 0.6875rem;
}

#support-status:empty {
  display: none;
}

.dashboard-copy {
  margin: 0;
  color: #4a4a4a;
  font-size: 0.95rem;
  line-height: 1.45;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 6rem;
  padding: 0.875rem;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.metric-label,
.feed-url-label {
  color: #616161;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

.metric-value {
  color: #202223;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
}

.metric-status .metric-value {
  font-size: 1rem;
}

.metric-date {
  color: #202223;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
}

.feed-url-card {
  padding: 0.875rem;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  background: #f7f7f7;
}

.feed-url-content {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.feed-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.feed-url-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wrap-code {
  display: block;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
  background: #ffffff;
  color: #202223;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.quick-action-card {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 10rem;
  padding: 1rem;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  background: #ffffff;
}

.quick-action-card h3 {
  margin: 0;
  color: #202223;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.quick-action-card p {
  margin: 0;
  color: #616161;
  font-size: 0.88rem;
  line-height: 1.45;
}

.sidekick-overview {
  display: grid;
  gap: 1rem;
}

.sidekick-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.sidekick-command-card,
.sidekick-tip {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  background: #ffffff;
}

.sidekick-card-heading {
  display: grid;
  gap: 0.5rem;
}

.sidekick-card-heading h2,
.sidekick-tip h3 {
  margin: 0;
  color: #202223;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.sidekick-command-card p,
.sidekick-tip p {
  margin: 0;
  color: #616161;
  font-size: 0.88rem;
  line-height: 1.45;
}

.sidekick-prompt-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidekick-prompt-list code {
  display: block;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
  background: #f7f7f7;
  color: #202223;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sidekick-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidekick-tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.muted-cell {
  color: #616161;
  display: block;
  margin-top: 0.25rem;
}

.table-field {
  min-width: 12rem;
}

.table-select {
  min-width: 13rem;
}

.visually-hidden {
  display: none;
}

@media (max-width: 900px) {
  .dashboard-layout,
  .dashboard-metrics,
  .quick-actions,
  .sidekick-command-grid,
  .sidekick-tips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-support {
    position: static;
  }

  .dashboard-support .support-photo {
    max-width: 300px;
  }
}

@media (max-width: 600px) {
  .dashboard-metrics,
  .quick-actions,
  .sidekick-command-grid,
  .sidekick-tips {
    grid-template-columns: 1fr;
  }

  .feed-url-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Keep wide Polaris tables within their own scroll region. */
.mapping-preview-scroll,
.mapping-editor-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.mapping-preview-value {
  display: block;
  min-width: 10rem;
  max-width: 24rem;
  overflow-wrap: anywhere;
}

.mapping-source {
  width: 13rem;
}

.mapping-label {
  width: 18rem;
}

.mapping-header {
  width: 12rem;
}

.mapping-editor-width {
  min-width: 72rem;
}

#mapping-preview-width {
  min-width: var(--preview-min-width, 60rem);
}

/* Polaris switches tables to its accessible list layout on small screens. */
@media (max-width: 490px) {
  .mapping-source,
  .mapping-label,
  .mapping-header {
    width: auto;
  }

  .mapping-editor-width,
  #mapping-preview-width {
    min-width: 0;
  }
}
