
:root {
  color-scheme: light;
  --background: #f1f1f1;
  --surface: #ffffff;
  --surface-muted: #f7f7f7;
  --border: #d4d4d4;
  --ink: #202223;
  --muted: #616161;
  --accent: #303030;
  --accent-strong: #1a1a1a;
  --danger: #b3261e;
  --warning: #8a5a00;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  min-height: 100vh;
}

.shop-pill {
  color: var(--muted);
  font-size: 13px;
}

.shop-pill {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
}

.home-layout {
  display: grid;
  gap: 16px;
}

.home-section {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: grid;
  gap: 2px;
}

.section-heading h2 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  margin: 0;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.metric strong {
  font-size: 22px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.help-video {
  aspect-ratio: 16 / 9;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.help-video iframe {
  border: 0;
  height: 100%;
  width: 100%;
}

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

.recommendation {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 14px;
  text-decoration: none;
}

.recommendation:hover {
  border-color: var(--accent);
}

.recommendation-icon {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  overflow: hidden;
  width: 40px;
}

.recommendation-icon img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

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

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

.connect-form,
.toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  display: grid;
  flex: 1 1 220px;
  gap: 6px;
}

label,
.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.workspace {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.stack {
  display: grid;
  gap: 14px;
}

.source-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 260px;
  overflow: auto;
}

.source-row {
  align-items: start;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 10px 12px;
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row input {
  min-height: auto;
  margin-top: 4px;
  padding: 0;
  width: 16px;
}

.source-name {
  font-weight: 700;
}

.source-value {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status {
  border-radius: 8px;
  color: var(--muted);
  min-height: 24px;
}

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

.status.success {
  color: var(--accent);
}

.metafield-controls {
  display: none;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.metafield-controls.visible {
  display: grid;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty {
  color: var(--muted);
  padding: 14px;
}

.internal-dashboard {
  margin: 0 auto;
  max-width: 1440px;
  padding: 24px;
}

.internal-header {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}

.internal-header h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0;
}

.internal-header p {
  color: var(--muted);
  margin: 0;
}

.dashboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
}

.dashboard-section h2 {
  font-size: 16px;
  margin: 0;
}

.dashboard-table {
  border-collapse: collapse;
  width: 100%;
}

.dashboard-table th,
.dashboard-table td {
  border-bottom: 1px solid var(--border);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.dashboard-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-table tr:last-child td {
  border-bottom: 0;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

.severity {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.severity.warning {
  background: #fff4d6;
  color: #6f4e00;
}

.severity.critical {
  background: #fed3d1;
  color: #8e1f0b;
}

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

  .metric-grid,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }
}
