/* ================================================================
   SEO TOOLS — shared tool-family styles
   Keyword Density, Backlink Analyzer, Sitemap Generator,
   Robots.txt Generator. Uses main.css design tokens so both
   light and dark themes work.
   ================================================================ */

.st-section {
  padding: 3.5rem 0;
  background: linear-gradient(180deg, var(--bg-secondary, #f8fafc) 0%, var(--bg, #ffffff) 100%);
}
.st-shell {
  max-width: 1060px;
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────── */
.st-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 1.75rem;
}
.st-header__icon-wrap {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(79, 70, 229, 0.16));
  border: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-header__icon {
  width: 22px;
  height: 22px;
  color: var(--accent, #6366f1);
  stroke-width: 1.7;
}
.st-header__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.st-header__desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #475569);
  margin: 0;
  line-height: 1.55;
  max-width: 600px;
}

/* ── Layout ─────────────────────────────────────────────────── */
.st-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.5rem;
  align-items: start;
}
.st-grid--single {
  grid-template-columns: 1fr;
}
.st-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  box-shadow: var(--shadow-md, 0 4px 16px rgba(2, 6, 23, 0.06));
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.st-card--output {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Fields ─────────────────────────────────────────────────── */
.st-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.st-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.st-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.st-label__opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-tertiary, #94a3b8);
}
.st-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  background: var(--bg, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
.st-input::placeholder { color: var(--text-tertiary, #94a3b8); }
.st-input:hover { border-color: var(--accent, #6366f1); }
.st-input:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #6366f1) 18%, transparent);
}
.st-input--area {
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
}
.st-input--area-short { min-height: 110px; }
.st-input--mono {
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.84rem;
}
.st-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'><path d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.st-row {
  display: flex;
  gap: 1rem;
}
.st-divider {
  height: 1px;
  background: var(--border, #e2e8f0);
}

/* ── Buttons ────────────────────────────────────────────────── */
.st-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.st-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--bg, #ffffff);
  color: var(--text-secondary, #475569);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.st-btn svg { width: 15px; height: 15px; }
.st-btn:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.st-btn:active { transform: scale(0.97); }
.st-btn--primary {
  background: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent, #6366f1) 35%, transparent);
}
.st-btn--primary:hover { color: #ffffff; filter: brightness(1.06); }
.st-btn--ghost { background: transparent; }

/* ── Output / code ──────────────────────────────────────────── */
.st-output {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-output__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.st-output__label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary, #94a3b8);
}
.st-output__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.st-btn--sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.st-btn--sm svg { width: 14px; height: 14px; }
.st-code {
  width: 100%;
  box-sizing: border-box;
  min-height: 220px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  tab-size: 2;
}
.st-code--text {
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-primary, #0f172a);
}
.st-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary, #94a3b8);
  line-height: 1.5;
}
.st-hint code {
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.75rem;
}

/* ── Toast ──────────────────────────────────────────────────── */
.st-toast {
  padding: 10px 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #166534;
  animation: st-toast-in 0.25s ease;
}
.st-toast[hidden] { display: none; }
@keyframes st-toast-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Stats grid (keyword density / backlinks) ──────────────── */
.st-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.st-stat {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}
.st-stat__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent, #6366f1);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.st-stat__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary, #94a3b8);
  margin-top: 3px;
}

/* ── Tables ─────────────────────────────────────────────────── */
.st-table-wrap {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
}
.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.st-table th {
  text-align: left;
  padding: 9px 12px;
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.st-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  color: var(--text-primary, #0f172a);
}
.st-table tr:last-child td { border-bottom: none; }
.st-table td:first-child {
  color: var(--text-tertiary, #94a3b8);
  font-variant-numeric: tabular-nums;
  width: 44px;
}
.st-table__bar {
  height: 5px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--accent, #6366f1) 20%, transparent);
  max-width: 140px;
}
.st-table__bar span {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: var(--accent, #6366f1);
}
.st-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.st-chip--ok { background: #dcfce7; color: #15803d; }
.st-chip--warn { background: #fef3c7; color: #b45309; }
.st-chip--muted { background: var(--bg-secondary, #f1f5f9); color: var(--text-tertiary, #94a3b8); }

/* ── Custom keyword result (density checker) ────────────────── */
.st-kw-result {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-secondary, #f8fafc);
  font-size: 0.88rem;
  color: var(--text-primary, #0f172a);
}
.st-kw-result__big {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent, #6366f1);
  font-variant-numeric: tabular-nums;
}

/* ── Toggle chips (robots.txt) ──────────────────────────────── */
.st-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.st-chip-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #ffffff);
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  transition: border-color 0.15s, color 0.15s;
}
.st-chip-toggle:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.st-chip-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.st-chip-toggle__track {
  position: relative;
  width: 30px;
  height: 17px;
  background: var(--border, #cbd5e1);
  border-radius: 100px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.st-chip-toggle__track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.st-chip-toggle input:checked ~ .st-chip-toggle__track { background: var(--accent, #6366f1); }
.st-chip-toggle input:checked ~ .st-chip-toggle__track::after { transform: translateX(13px); }
.st-chip-toggle:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
  background: color-mix(in srgb, var(--accent, #6366f1) 6%, transparent);
}
.st-chip-toggle:focus-within { outline: 2px solid var(--accent, #6366f1); outline-offset: 2px; }

/* ── Empty states ───────────────────────────────────────────── */
.st-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.88rem;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 12px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .st-grid { grid-template-columns: 1fr; }
  .st-section { padding: 2.5rem 0; }
}
@media (max-width: 560px) {
  .st-row { flex-direction: column; gap: 1.1rem; }
  .st-card { padding: 1.1rem; }
  .st-header__icon-wrap { display: none; }
}

/* ================================================================
   DESIGN LANGUAGE V2 — gradient icon chip + premium cards
   ================================================================ */
.st-header__icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, .32), rgba(79, 70, 229, .14));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 26px rgba(139, 92, 246, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.st-header__icon { width: 26px; height: 26px; }
.st-card {
  border-radius: 18px;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
}
.st-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
  border-color: var(--primary-100, #a5b4fc);
}
