/* =====================================================================
   Page-level styles that are clearer as real CSS than as utility strings.
   ===================================================================== */

/* ---------------------------------------------------------- stat tiles */

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

@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stat-tile {
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-card);
  padding: 0.875rem 1rem;
}

.stat-tile__label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.stat-tile__value {
  margin-top: 0.375rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-tile__hint {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: var(--ink-muted);
}

/* --------------------------------------------------------- info notes */

.note {
  border-radius: 0.75rem;
  border: 1px solid;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.note--brand  { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-dark); }
.note--info   { border-color: var(--info-border); background: var(--info-soft); color: var(--info); }
.note--ok     { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok); }
.note--warn   { border-color: var(--warn-border); background: var(--warn-soft); color: var(--warn); }
.note--danger { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); }

.note code,
.note .font-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ---------------------------------------------------------------- tabs */

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 150ms, border-color 150ms;
}

.tab:hover { color: var(--ink); }

.tab[aria-selected="true"] {
  border-bottom-color: var(--brand);
  color: var(--brand-dark);
}

.tabpanel[hidden] { display: none; }

/* --------------------------------------------------------- prompt panel */

.prompt-panel {
  max-height: 28rem;
  overflow-y: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--gray-50);
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

/* ------------------------------------------------------ editable tables */

.editor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.editor-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  padding: 0.5rem 0.625rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--ink-soft);
}

.editor-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.375rem 0.5rem;
  vertical-align: top;
}

.editor-table tr[data-archived="1"] {
  background: var(--gray-50);
  opacity: 0.7;
}

.editor-table tr[data-removed="1"] { display: none; }

.editor-table .input {
  border-color: transparent;
  background: transparent;
  padding: 0.25rem 0.375rem;
  font-size: 0.8125rem;
}

.editor-table .input:hover:not(:disabled) { border-color: var(--line); background: var(--white); }
.editor-table .input:focus { border-color: var(--brand); background: var(--white); }

.editor-table .row-index {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--ink-muted);
  padding-top: 0.75rem;
}

/* ------------------------------------------------------- step navigation */

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1rem;
}

/* --------------------------------------------------------- misc helpers */

.divide-line > * + * { border-top: 1px solid var(--line); }

.char-counter { font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.char-counter[data-over="1"] { font-weight: 600; color: var(--warn); }

.search-field { position: relative; }
.search-field .search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
.search-field .input { padding-left: 2.25rem; }

.serp-preview__title { color: #1a0dab; font-size: 1.125rem; line-height: 1.4; }
.serp-preview__url { color: #006621; font-size: 0.8125rem; }
.serp-preview__description { color: #545454; font-size: 0.8125rem; line-height: 1.45; }

.shortcode-output {
  max-height: 32rem;
  overflow: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: #1f2937;
  color: #e5e7eb;
  padding: 0.875rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre;
}

.drag-handle { cursor: grab; color: var(--gray-400); }
.drag-handle:active { cursor: grabbing; }

.section-card--dragging { opacity: 0.5; }
.section-card--drop-target { outline: 2px dashed var(--brand-border); outline-offset: 2px; }
