:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #d9dde3;
  --text: #1a1d21;
  --muted: #5b6470;
  --accent: #1a5fd7;
  --accent-dark: #1449a8;
  --error: #b3261e;
  --radius: 8px;
  --code-font: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .brand {
  margin: 0;
  padding: 12px 0;
  font-weight: 700;
  font-size: 1rem;
}

.hero { padding: 28px 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.lede { font-size: 1.15rem; margin: 0 0 4px; }
.privacy-note { color: var(--muted); font-size: 0.95rem; margin: 0 0 8px; }

.tool { padding: 16px 0 8px; }
.panels {
  display: grid;
  grid-template-columns: 1fr 240px 1fr;
  gap: 16px;
  align-items: start;
}

.panel-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: var(--code-font);
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  overflow: auto;
}
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
#sql-output { background: var(--surface); }

.hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
kbd {
  font-family: var(--code-font);
  font-size: 0.8em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.control-group { margin: 0; padding: 0; border: 0; }
.control-group > label, .control-group > legend {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  padding: 0;
}
.control-group select {
  width: 100%;
  padding: 8px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}
.radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  padding: 3px 0;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--surface); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-dark); }

.status {
  min-height: 1.6em;
  font-size: 0.9rem;
  margin: 8px 0 0;
  color: var(--muted);
}
.status.error { color: var(--error); font-weight: 600; }
.status.ok { color: #1e7b34; }

.content, .faq { padding: 12px 0; max-width: 760px; }
.content h2, .faq h2 { font-size: 1.35rem; margin: 28px 0 8px; }
.content p, .content li { color: #2c3138; }
.content code {
  font-family: var(--code-font);
  font-size: 0.88em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #fff;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq details p { margin: 8px 0 4px; color: #2c3138; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  background: var(--surface);
}
.site-footer p { color: var(--muted); font-size: 0.9rem; padding: 16px 0; margin: 0; }

/* Mobile: single column */
@media (max-width: 860px) {
  .panels { grid-template-columns: 1fr; }
  .controls { order: 2; }
  .hero h1 { font-size: 1.6rem; }
  textarea { min-height: 200px; }
}
