:root {
  --bg:        #f7f8fa;
  --surface:   #ffffff;
  --border:    #dde1e7;
  --accent:    #4f46e5;
  --accent-hov:#4338ca;
  --text:      #1a1a2e;
  --muted:     #6b7280;
  --success:   #166534;
  --success-bg:#dcfce7;
  --warn-bg:   #fef9c3;
  --warn:      #854d0e;
  --code-bg:   #f1f3f6;
  --mono:      'Fira Mono', 'Cascadia Code', 'Consolas', monospace;
  --radius:    8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--accent);
  color: #fff;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
header p  { font-size: 0.9rem; opacity: 0.85; }

/* ── Main layout ── */
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Examples bar ── */
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.examples span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.examples button {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--mono);
}
.examples button:hover { border-color: var(--accent); background: #eef2ff; }

/* ── Editor columns ── */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 720px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
textarea, #output {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 1rem;
  flex: 1;
  min-height: 280px;
  border: none;
  outline: none;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  tab-size: 4;
}
textarea::placeholder { color: var(--muted); }
#output {
  white-space: pre;
  overflow: auto;
  resize: none;
}
#output.success { background: var(--success-bg); color: var(--success); }
#output.unsupported { background: var(--warn-bg); color: var(--warn); }

/* ── Translate button ── */
.actions {
  margin: 1rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
#translate-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#translate-btn:hover { background: var(--accent-hov); }

#copy-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
#copy-btn:hover { border-color: var(--accent); }

/* ── Info section ── */
.info {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.info h2 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.info ul  { padding-left: 1.4rem; }
.info li  { margin-bottom: 0.35rem; font-size: 0.88rem; color: var(--muted); }
.info code {
  font-family: var(--mono);
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
  color: var(--text);
}
