:root {
  --bg: #0a0c10;
  --bg-2: #11141a;
  --bg-3: #1a1e26;
  --fg: #e8eaef;
  --fg-2: #a4adbe;
  --fg-3: #6b7488;
  --accent: #d6c69a;
  --accent-2: #b89a5e;
  --accent-glow: rgba(214, 198, 154, 0.18);
  --danger: #e07b75;
  --ok: #7fc69a;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.92em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); }

/* Decorative background */
.field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 70% -10%, var(--accent-glow), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, rgba(99, 132, 255, 0.08), transparent 60%);
}
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 35%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, black 30%, transparent 75%);
  opacity: 0.35;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: var(--fg);
}
.brand-mark {
  width: 26px; height: 26px;
  background: var(--accent); border-radius: 6px;
  display: grid; place-items: center;
  color: var(--bg); font-weight: 800; font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.nav-links { display: flex; align-items: center; gap: 22px; flex: 1; margin-left: 12px; }
.nav-links a {
  color: var(--fg-2); font-size: 13px; font-weight: 500;
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); border-bottom-color: var(--accent); }
.nav-meta { display: flex; align-items: center; gap: 12px; }
.who { font-size: 12px; color: var(--fg-3); font-family: 'JetBrains Mono', monospace; }
.who .dot { color: var(--accent); }
.signout {
  font-size: 12px; color: var(--fg-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px;
}
.signout:hover { color: var(--fg); border-color: var(--accent); }

/* Main */
main {
  position: relative; z-index: 5;
  max-width: 1280px; margin: 0 auto; padding: 36px 28px 80px;
}
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 32px 0 14px; color: var(--fg); }
h3 { font-size: 14px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--fg-3); margin: 24px 0 10px; }
.subtitle { color: var(--fg-2); font-size: 14px; margin-bottom: 24px; }

/* Cards / panels */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
}
.panel-tight { padding: 14px 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.spacer { flex: 1; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.list-item {
  background: var(--bg-2);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  border: none;
  transition: background .12s;
}
.list-item:hover { background: var(--bg-3); }
.list-item .li-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-item .li-title { font-weight: 500; color: var(--fg); }
.list-item .li-meta { font-size: 12px; color: var(--fg-3); font-family: 'JetBrains Mono', monospace; }
.list-item .li-sub { font-size: 13px; color: var(--fg-2); }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--line-2);
}
.badge-admin { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.badge-pinned { background: rgba(214, 198, 154, 0.15); color: var(--accent); border-color: rgba(214, 198, 154, 0.3); }
.badge-new { background: rgba(127, 198, 154, 0.15); color: var(--ok); border-color: rgba(127, 198, 154, 0.3); }
.badge-banned { background: rgba(224, 123, 117, 0.15); color: var(--danger); border-color: rgba(224, 123, 117, 0.3); }

/* Forms */
label { display: block; font-size: 12px; font-weight: 500; color: var(--fg-2); margin-bottom: 6px; letter-spacing: 0.02em; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
textarea { font-family: 'JetBrains Mono', monospace; font-size: 13px; min-height: 160px; resize: vertical; }
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: var(--accent); color: var(--bg);
  border: none; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; color: var(--fg-2);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { color: var(--fg); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: var(--bg); }

/* Tables */
table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
th { text-align: left; font-weight: 500; color: var(--fg-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--fg-2); }
td.fg { color: var(--fg); }
tr:hover td { background: var(--bg-3); }

/* Markdown rendering */
.md { font-size: 14px; line-height: 1.6; color: var(--fg); }
.md h2 { font-size: 20px; margin-top: 1.6em; }
.md h3 { font-size: 15px; text-transform: none; color: var(--fg); margin-top: 1.4em; letter-spacing: -0.01em; }
.md p { margin: 0.8em 0; }
.md code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.md pre { background: var(--bg-3); padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 1em 0; border: 1px solid var(--line); }
.md pre code { background: none; padding: 0; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md a:hover { color: var(--fg); }
.md mark { background: var(--accent-glow); color: var(--accent); padding: 0 4px; border-radius: 3px; }

/* Status + toasts */
.empty { padding: 40px 20px; text-align: center; color: var(--fg-3); font-size: 13px; }
.loading { padding: 20px; text-align: center; color: var(--fg-3); font-size: 13px; }
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 18px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 10px; font-size: 13px; z-index: 100; max-width: 360px; }
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.fade { opacity: 0; transition: opacity 0.4s; }

/* Tile grid (ranch-apps pattern, reused for /tools) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color .15s, transform .12s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile .tile-cat { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.tile .tile-title { font-size: 15px; font-weight: 600; color: var(--fg); }
.tile .tile-blurb { font-size: 13px; color: var(--fg-2); }

@media (max-width: 720px) {
  .nav { padding: 14px 16px; }
  .nav-links { gap: 14px; overflow-x: auto; }
  .nav-links a { white-space: nowrap; }
  main { padding: 24px 16px 60px; }
  .form-grid { grid-template-columns: 1fr; }
}
