:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cdd2db;
  --text: #14171f;
  --text-muted: #6b7280;
  --text-faint: #9aa1ad;
  --accent: #2f6feb;
  --accent-hover: #1d54c7;
  --accent-soft: #eaf1ff;
  --accent-text: #ffffff;
  --success: #16794f;
  --success-soft: #e3f6ec;
  --warning: #a35a06;
  --warning-soft: #fdf1de;
  --danger: #b3261e;
  --danger-soft: #fbeae9;
  --focus-ring: rgba(47, 111, 235, .35);
  --shadow-sm: 0 1px 2px rgba(20, 23, 31, .05);
  --shadow-md: 0 8px 24px rgba(20, 23, 31, .10), 0 2px 6px rgba(20, 23, 31, .06);
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 15px;
  font-family: inherit;
  transition: .12s background, .12s border-color, .12s color;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- inputs ---------- */
.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }

.field { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.panel-title { font-size: 14.5px; font-weight: 800; letter-spacing: -.005em; }
.panel-body { padding: 18px 20px; }

/* ---------- settings row (label/hint on the left, an input or action on the right) ---------- */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-weight: 700; font-size: 13.5px; }
.settings-row-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: .15s;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .settings-row { flex-direction: column; align-items: flex-start; }
}
