/* ai studio — design tokens + minimal utility set
 * Hand-rolled. Add Tailwind only if surface area grows beyond what's here.
 */

:root {
  --bg:     #ffffff;
  --fg:     #111111;
  --muted:  #6b7280;
  --border: rgba(0, 0, 0, 0.08);
  --hover:  rgba(0, 0, 0, 0.04);
  --ok:     #16a34a;
  --err:    #b91c1c;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--font-sans); font-size: 15px; line-height: 22px; }

a { color: inherit; text-decoration: none; }
a.underline, a:hover.hover\:underline { text-decoration: underline; }

button { font-family: inherit; font-size: inherit; cursor: pointer; }

input, textarea {
  font-family: inherit; font-size: 15px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 2px; padding: 6px 8px;
}
input:focus, textarea:focus {
  outline: none; box-shadow: 0 0 0 2px var(--border);
}
::placeholder { color: var(--muted); }

/* --- Layout primitives --- */
.min-h-screen { min-height: 100vh; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.self-start { align-self: flex-start; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: 48px; }
.mt-8 { margin-top: 32px; }

.px-6 { padding-left: 24px; padding-right: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

.h-12 { height: 48px; }

/* --- Typography --- */
.text-xs   { font-size: 12px; line-height: 16px; }
.text-sm   { font-size: 13px; line-height: 18px; }
.text-base { font-size: 15px; line-height: 22px; }
.text-lg   { font-size: 18px; line-height: 26px; }
.text-xl   { font-size: 24px; line-height: 32px; }

.text-fg    { color: var(--fg); }
.text-muted { color: var(--muted); }
.text-err   { color: var(--err); }

.font-mono { font-family: var(--font-mono); }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.04em; }

/* --- Borders --- */
.border-b { border-bottom: 1px solid var(--border); }
.border-border { border-color: var(--border); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg);
  border-radius: 2px; font-size: 13px; cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { opacity: 0.9; background: var(--fg); }

.btn-link {
  background: transparent; border: none; padding: 0;
  color: var(--fg); text-decoration: underline; cursor: pointer;
}
.btn-danger {
  background: transparent; border: none; padding: 0;
  color: var(--err); text-decoration: underline; cursor: pointer;
}

/* --- Form fields --- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 13px; color: var(--muted); }

/* --- List rows --- */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.row:hover { background: var(--hover); }

/* --- Toast --- */
.toast {
  position: fixed; right: 16px; bottom: 16px;
  background: var(--fg); color: var(--bg);
  padding: 8px 12px; font-size: 13px; border-radius: 2px;
  animation: ai-toast-fade 2s 1.5s forwards;
}
@keyframes ai-toast-fade { to { opacity: 0; } }

/* --- Status dot --- */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; vertical-align: middle; }
.dot-ok    { background: var(--ok); }
.dot-muted { background: var(--muted); }

/* --- Hover utilities --- */
.hover\:underline:hover { text-decoration: underline; }
.hover\:text-fg:hover { color: var(--fg); }
