:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --border: rgba(0,0,0,0.09);
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --teal: #0d9488;
  --purple: #7c3aed;
  --amber: #d97706;
  --green: #16a34a;
  --red: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: rgba(255,255,255,0.09);
    --text: #f1f5f9;
    --muted: #94a3b8;
  }
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* ── Layout ────────────────────────────────── */
.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Site Header ───────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 0.5px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s;
  flex-shrink: 0;
}
.menu-btn:hover { background: var(--surface); }

.menu-icon {
  width: 18px;
  height: 18px;
  color: var(--text);
  opacity: 0.6;
  flex-shrink: 0;
}

.scope-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

/* ── Site Footer ───────────────────────────── */
.site-footer {
  padding: 24px 0 32px;
  border-top: 0.5px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.12s;
}

.lang-toggle button.active {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
}

.lang-toggle .sep {
  color: var(--border);
  font-size: 12px;
  padding: 0 2px;
  user-select: none;
}

/* ── Card ──────────────────────────────────── */
.card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.card + .card { margin-top: 12px; }

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: #e9ecef; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
}

/* ── Tags ──────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}

.tag-blue   { background: #eff6ff; color: #2563eb; }
.tag-green  { background: #f0fdf4; color: #16a34a; }
.tag-amber  { background: #fffbeb; color: #d97706; }
.tag-purple { background: #f5f3ff; color: #7c3aed; }
.tag-gray   { background: var(--surface); color: var(--muted); }
.tag-teal   { background: #f0fdfa; color: #0d9488; }
.tag-red    { background: #fef2f2; color: #dc2626; }

/* ── Action bar ────────────────────────────── */
.action-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}

/* ── Panels (interactive) ──────────────────── */
.panel {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
}

.panel-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 10px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* ── Form fields ───────────────────────────── */
.field { margin-bottom: 10px; }

.field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.field textarea { min-height: 80px; line-height: 1.5; }

/* ── Success state ─────────────────────────── */
.success-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 0.5px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
  color: #16a34a;
}

.success-msg a {
  margin-left: auto;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}

/* ── Utility ───────────────────────────────── */
.hidden   { display: none !important; }
.mt8      { margin-top: 8px; }
.mt12     { margin-top: 12px; }
.mt16     { margin-top: 16px; }
.mt24     { margin-top: 24px; }
.mt32     { margin-top: 32px; }
.text-muted { color: var(--muted); }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.fw600    { font-weight: 600; }
.flex     { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap8 { display: flex; align-items: center; gap: 8px; }
