:root {
  --tool-color: #94a3b8;
  --tool-color-dim: rgba(148, 163, 184, 0.12);
  --tool-color-border: rgba(148, 163, 184, 0.25);
  --content-width: 900px;
}

/* ─── Intro ─────────────────────────────────────────────── */
.tool-intro {
  max-width: var(--content-width);
  margin: 40px auto;
  padding: 0 16px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

/* ─── Wrap ───────────────────────────────────────────────── */
.tool-wrap {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  padding: 0 16px;
}

/* ─── Controls bar ───────────────────────────────────────── */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ctrl-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.ctrl-group input[type="text"],
.ctrl-group select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 7px 10px;
  min-width: 140px;
  outline: none;
  transition: border-color 0.15s;
}

.ctrl-group input[type="text"]:focus,
.ctrl-group select:focus {
  border-color: var(--tool-color);
}

.ctrl-check {
  justify-content: flex-end;
  padding-bottom: 2px;
}

.ctrl-check label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
}

.ctrl-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--tool-color);
}

/* ─── Editor grid ────────────────────────────────────────── */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.pane-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pane-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pane textarea {
  flex: 1;
  resize: none;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 14px;
  outline: none;
  min-height: 360px;
}

.pane textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.pane-output textarea {
  color: var(--tool-color);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-sm {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-sm:hover:not(:disabled) {
  border-color: var(--tool-color);
  color: var(--tool-color);
}

.btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sm.btn-danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-sm.btn-accent {
  background: var(--tool-color-dim);
  border-color: var(--tool-color-border);
  color: var(--tool-color);
}

.btn-sm.btn-accent:hover:not(:disabled) {
  background: var(--tool-color);
  color: #0f172a;
}

.btn-sm.copied {
  border-color: #22c55e;
  color: #22c55e;
}

/* ─── Stats badge ────────────────────────────────────────── */
.stats-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--tool-color-dim);
  border-radius: 4px;
  padding: 2px 8px;
  display: none;
}

.stats-badge.visible {
  display: inline-block;
}

/* ─── Action row ─────────────────────────────────────────── */
.action-row {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.btn-convert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 13px 36px;
  border-radius: 8px;
  border: none;
  background: var(--tool-color);
  color: #0f172a;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-convert:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-convert:active {
  transform: translateY(0);
}

.btn-convert.loading {
  opacity: 0.6;
  cursor: wait;
}

.btn-icon {
  font-size: 18px;
  line-height: 1;
}

/* ─── Error box ──────────────────────────────────────────── */
.error-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #f87171;
  font-size: 13px;
  padding: 12px 16px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ─── Preview table ──────────────────────────────────────── */
.preview-wrap {
  border: 1px solid var(--tool-color-border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
  margin-bottom: 8px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--tool-color-dim);
  border-bottom: 1px solid var(--tool-color-border);
}

.table-scroll {
  overflow-x: auto;
  max-height: 240px;
  overflow-y: auto;
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: 'Courier New', Consolas, monospace;
}

.table-scroll th {
  background: var(--surface);
  color: var(--tool-color);
  font-weight: 700;
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-scroll td {
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-scroll tr:last-child td { border-bottom: none; }

.table-scroll tr:hover td {
  background: var(--tool-color-dim);
}

/* ─── Shared section wrapper ─────────────────────────────── */
/* All content sections below the tool use this same width   */
.how-to-use,
.features-section,
.what-is-section,
.faq,
.seo-text,
.related-tools {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;
  padding: 0 16px;
}

.related-tools { margin-bottom: 64px; }

/* ─── Shared section heading style ──────────────────────── */
.how-to-use h2,
.features-block h2,
.features-block h3,
.what-is-section h2,
.faq h2,
.related-tools h2 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tool-color);
  margin-bottom: 20px;
}

/* ─── How to use ─────────────────────────────────────────── */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.steps-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--tool-color);
  background: var(--tool-color-dim);
  border: 1px solid var(--tool-color-border);
  border-radius: 5px;
  padding: 4px 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.steps-list li > div { flex: 1; }

.steps-list li strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.steps-list li p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.steps-list code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--tool-color);
}

/* ─── Features section ───────────────────────────────────── */
.features-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 600px) {
  .features-cols { grid-template-columns: 1fr; }
}

.feature-list,
.usecase-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-list li {
  font-size: 13px;
  color: var(--text);
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.feature-list li::before {
  content: '✓ ';
  color: var(--tool-color);
  font-weight: 700;
}

.usecase-list li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  padding: 4px 0;
}

/* ─── What is this ───────────────────────────────────────── */
.what-is-section p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* ─── FAQ ────────────────────────────────────────────────── */
.faq details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.faq details[open] {
  border-color: var(--tool-color-border);
}

.faq summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  background: var(--surface);
  user-select: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '+';
  font-size: 18px;
  color: var(--tool-color);
  line-height: 1;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq details[open] summary::after { content: '−'; }

.faq details p {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  background: var(--bg);
}

.faq details code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--tool-color);
}

/* ─── SEO text ───────────────────────────────────────────── */
.seo-text h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.seo-text h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 28px 0 8px;
}

.seo-text p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.seo-text code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--tool-color);
}

/* ─── Related tools ──────────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.related-card:hover {
  border-color: var(--tool-color);
  transform: translateY(-2px);
}

.related-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.related-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.related-desc {
  font-size: 11px;
  color: var(--muted);
}