/* SQL Query Formatter & Beautifier — content styles.
   Prefix: --sq-  /  .sq-

   Reference point: a code editor's own dark gutter-and-pane look, since
   the audience is developers reading their own query back — the only
   tool this loop to intentionally keep its output panel dark regardless
   of site theme, the way every code editor and terminal does. First
   `developer`-cluster tool built this loop.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --sq-surface: #ffffff;
  --sq-panel:   #f4f5f7;
  --sq-line:    #dde1e6;
  --sq-text:    #14171c;
  --sq-muted:   #5b626d;
  --sq-code-bg: #1c2128;
  --sq-code-text: #e6e8eb;
  --sq-code-keyword: #ffab70;
  --sq-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.sq-wrap {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.sq-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--sq-line);
  border-radius: 2px;
  background: var(--sq-surface);
}

.sq-input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sq-muted);
}

.sq-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.875rem 1rem;
  font-family: var(--sq-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--sq-code-text);
  background: var(--sq-code-bg);
  border: 1px solid var(--sq-line);
  border-radius: 2px;
  resize: vertical;
}

.sq-textarea:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.sq-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0;
}

.sq-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--sq-text);
  cursor: pointer;
}

.sq-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--tf-accent);
}

.sq-field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--sq-text);
}

.sq-field-inline select {
  padding: 0.375rem 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--sq-text);
  background: var(--sq-surface);
  border: 1px solid var(--sq-line);
  border-radius: 2px;
}

/* ── Primary action button ──────────────────────────────────────────────── */

.sq-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
}

.sq-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.sq-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.sq-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Output ──────────────────────────────────────────────────────────────── */

.sq-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sq-output-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sq-muted);
}

.sq-copy-btn {
  padding: 0.25rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sq-text);
  background: var(--sq-surface);
  border: 1px solid var(--sq-line);
  border-radius: 2px;
  cursor: pointer;
}

.sq-copy-btn:hover { background: var(--sq-panel); }

.sq-copy-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

.sq-output {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  font-family: var(--sq-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--sq-code-text);
  background: var(--sq-code-bg);
  border: 1px solid var(--sq-line);
  border-radius: 2px;
  overflow-x: auto;
  white-space: pre;
}

.sq-output:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.sq-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--sq-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.sq-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 42rem;
  padding-inline: 1.5rem;
  overflow: hidden;
}

@media (max-width: 26rem) {
  .sq-wrap,
  .sq-ad { padding-inline: 1rem; }
  .sq-panel { padding: 1.25rem; }
  .sq-options { flex-direction: column; align-items: flex-start; }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --sq-surface: var(--tf-surface);
  --sq-panel: var(--tf-surface);
  --sq-line: var(--tf-surface);
  --sq-text: var(--tf-ink);
  --sq-muted: var(--tf-ink-soft);
  --sq-code-bg: var(--tf-ink);
  --sq-code-text: var(--tf-surface);
  --sq-code-keyword: #daa681;
}
