/* ----------------------------------------------------------------------
   Server Recruitment — design tokens & base
   Aesthetic: white + blue, modern and clean
---------------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-elev: #f5f8ff;
  --bg-elev-2: #eaf0fd;
  --line: #e2e8f4;
  --line-strong: #c8d5ed;

  --text: #0d1b3e;
  --text-dim: #4a5d82;
  --text-faint: #8fa3c4;

  --accent: #116ade;
  --accent-deep: #001a76;
  --accent-glow: rgba(17, 106, 222, 0.14);
  --accent-light: #e8f0fd;
  --warn: #f59e0b;
  --danger: #ef4444;
  --discord: #5865f2;

  --display: "Proxima Nova", "Poppins", system-ui, sans-serif;
  --sans: "Poppins", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 4px rgba(17, 106, 222, 0.08);
  --shadow-md: 0 4px 20px rgba(17, 106, 222, 0.12);
  --shadow-lg: 0 16px 48px rgba(17, 106, 222, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 100% -5%, rgba(17, 106, 222, 0.06), transparent 60%),
    radial-gradient(700px 400px at -5% 100%, rgba(0, 26, 118, 0.04), transparent 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ----------------------------------------------------------------------
   Header
---------------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-line {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.brand-line.accent { color: var(--accent); margin-top: 2px; }

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.site-nav a {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  color: var(--text-dim);
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--accent); background: var(--accent-light); }
.site-nav a.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }

.auth-area { margin-left: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.auth-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}
.auth-pill img {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-strong);
}
.auth-pill .logout {
  background: none; border: 0; color: var(--text-faint);
  font-family: var(--sans); font-size: 0.75rem; padding: 0 0.25rem;
}
.auth-pill .logout:hover { color: var(--danger); }

/* ----------------------------------------------------------------------
   Buttons
---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--bg-elev-2); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #0d5cc7; border-color: #0d5cc7; color: #fff; box-shadow: 0 4px 14px rgba(17,106,222,0.35); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

.btn-discord {
  background: var(--discord);
  border-color: var(--discord);
  color: #fff;
}
.btn-discord:hover { background: #6b75f5; border-color: #6b75f5; color: #fff; }

.btn-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,0.06); border-color: var(--danger); }

/* ----------------------------------------------------------------------
   Layout
---------------------------------------------------------------------- */
main {
  flex: 1;
  width: min(1200px, 100% - 3rem);
  margin: 2.5rem auto 4rem;
}

.hero {
  padding: 3rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
  position: relative;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  color: var(--accent-deep);
}
.hero h1 .accent { color: var(--accent); }
.hero p {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0;
  font-weight: 400;
}
.hero .eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: inline-block;
  background: var(--accent-light);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* ----------------------------------------------------------------------
   Job search & filter
---------------------------------------------------------------------- */
.jobs-search-bar {
  margin-bottom: 1rem;
}
.jobs-search-bar input[type="search"] {
  width: 100%;
  max-width: 480px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.jobs-search-bar input[type="search"]:focus { border-color: var(--accent); }
.jobs-tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.tag-filter-btn {
  cursor: pointer;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}
.tag-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ----------------------------------------------------------------------
   Job cards grid
---------------------------------------------------------------------- */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.job-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: left;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.job-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(17,106,222,0.04), transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.job-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.job-card:hover::before { opacity: 1; }

.job-card .tags {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-bottom: 1rem;
}
.tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-faint);
  background: var(--bg-elev);
}
.tag.accent { color: var(--accent); border-color: rgba(17,106,222,0.25); background: var(--accent-light); }

.job-card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
}
.job-card p {
  color: var(--text-dim);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}
.job-card .meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-faint);
}
.job-card .meta .arrow {
  color: var(--accent);
  font-weight: 700;
}

/* ----------------------------------------------------------------------
   Job detail page
---------------------------------------------------------------------- */
.job-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 900px) {
  .job-detail { grid-template-columns: 1fr; }
}

.job-detail .back {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1rem; display: inline-flex; align-items: center; gap: 0.3rem;
}
.job-detail .back:hover { color: var(--accent); }

.job-detail h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 1rem;
  color: var(--accent-deep);
}
.job-detail .lead {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}
.job-detail h2 {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 2.5rem 0 1rem;
}
.job-detail .prose {
  font-size: 1.02rem;
  line-height: 1.75;
}
.job-detail .prose ul, .job-detail .prose ol { padding-left: 1.5rem; }
.job-detail .prose li { margin-bottom: 0.4rem; }

.aside {
  position: sticky;
  top: 90px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.aside .label {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; color: var(--text-faint); text-transform: uppercase;
  display: block; margin-bottom: 0.4rem;
}
.aside .row { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.aside .row:last-of-type { border-bottom: 0; }
.aside .row .value { font-family: var(--sans); font-size: 0.9rem; font-weight: 500; color: var(--text); }
.aside .btn { width: 100%; justify-content: center; margin-top: 1rem; }

/* ----------------------------------------------------------------------
   Form (application) styles
---------------------------------------------------------------------- */
.form-shell {
  max-width: 760px;
  margin: 0 auto;
}
.form-shell h1 {
  font-family: var(--display); font-weight: 800;
  font-size: 2.4rem; letter-spacing: -0.03em; margin: 0 0 0.5rem;
  color: var(--accent-deep);
}
.form-shell .lead { color: var(--text-dim); margin-bottom: 2rem; }

.steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.steps .step {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.steps .step.active { background: var(--accent); }
.steps .step.done { background: var(--accent-deep); }
.step-meta {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 1rem;
}

.page-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.page-card h2 {
  font-family: var(--display); font-weight: 700;
  font-size: 1.5rem; margin: 0 0 0.5rem; letter-spacing: -0.02em;
  color: var(--accent-deep);
}
.page-card .page-desc { color: var(--text-dim); margin: 0 0 1.5rem; }

.field { margin-bottom: 1.5rem; }
.field label.field-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}
.field label.field-label .req { color: var(--accent); margin-left: 4px; }
.field .help { font-size: 0.85rem; color: var(--text-faint); margin-top: 0.4rem; }
.field .err { font-size: 0.85rem; color: var(--danger); margin-top: 0.4rem; font-family: var(--sans); font-weight: 500; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }

.choice-list { display: grid; gap: 0.5rem; }
.choice {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--accent); background: var(--accent-light); }
.choice input { accent-color: var(--accent); }
.choice.selected { border-color: var(--accent); background: var(--accent-light); }

.dropzone {
  display: block;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--sans); font-size: 0.88rem; font-weight: 500;
  color: var(--text-dim);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.file-list { margin-top: 0.75rem; display: grid; gap: 0.4rem; }
.file-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.82rem;
}
.file-row .progress {
  flex: 0 0 80px;
  height: 4px; background: var(--line); border-radius: 2px; overflow: hidden;
  margin: 0 0.75rem;
}
.file-row .progress > i { display: block; height: 100%; background: var(--accent); width: 0%; transition: width 0.15s; }

.toolbar {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.draft-banner {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.draft-discard-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.draft-discard-btn:hover { color: var(--danger); }

/* ----------------------------------------------------------------------
   Banner / state messages
---------------------------------------------------------------------- */
.banner {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.banner.warn { border-left-color: var(--warn); }
.banner.danger { border-left-color: var(--danger); }
.banner h3 {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
  margin: 0 0 0.35rem; color: var(--text);
}
.banner p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-faint);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 50%, var(--bg-elev) 75%);
  background-size: 200% 100%;
  animation: skel 1.4s linear infinite;
  border-radius: var(--radius);
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----------------------------------------------------------------------
   Modal
---------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 26, 118, 0.35);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  max-width: 460px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: 0; color: var(--text-faint);
  font-size: 1.5rem; line-height: 1; padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: var(--text); }

/* ----------------------------------------------------------------------
   Toasts
---------------------------------------------------------------------- */
#toast-host {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease-out;
  min-width: 240px;
  color: var(--text);
}
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ----------------------------------------------------------------------
   Footer
---------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  margin-top: auto;
  background: var(--bg-elev);
}
.footer-grid {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
  color: var(--text-faint);
  max-width: 1200px; margin: 0 auto;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; }

/* ----------------------------------------------------------------------
   Admin layout (in admin/index.html)
---------------------------------------------------------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 130px);
}
@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
}
.admin-side {
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  background: var(--bg-elev);
}
.admin-side h4 {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--text-faint); text-transform: uppercase;
  margin: 0 0.5rem 0.75rem;
}
.admin-side a {
  display: block;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.admin-side a:hover { background: var(--bg-elev-2); color: var(--accent); }
.admin-side a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.admin-content {
  padding: 2rem 2.5rem;
}
.admin-content h1 {
  font-family: var(--display); font-weight: 800;
  font-size: 2rem; margin: 0 0 0.5rem; letter-spacing: -0.03em;
  color: var(--accent-deep);
}
.admin-content .sub {
  color: var(--text-dim); margin-bottom: 2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint);
}
.table tr:hover { background: var(--bg-elev); }

.status-pill {
  display: inline-block;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.status-submitted { color: var(--accent); border-color: rgba(17,106,222,0.3); background: var(--accent-light); }
.status-reviewing { color: #b45309; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.status-accepted { color: #15803d; border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); }
.status-rejected { color: var(--danger); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.06); }

/* Question editor in admin */
.qb-page {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--bg-elev);
}
.qb-page-head {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
  cursor: default;
}
.qb-page-head input { flex: 1; }

.qb-field {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
}
.qb-field-head {
  display: grid;
  grid-template-columns: auto 1.4fr 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
}
.drag-handle {
  cursor: grab;
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
  user-select: none;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }
.qb-page.dragging, .qb-field.dragging { opacity: 0.4; }
.qb-page.drag-over { border-top: 2px solid var(--accent); }
.qb-field.drag-over { border-top: 2px solid var(--accent); }
.qb-field-body {
  margin-top: 0.6rem;
  display: none;
}
.qb-field.open .qb-field-body { display: block; }
.qb-field-body input, .qb-field-body select, .qb-field-body textarea { font-size: 0.9rem; }

.row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}

.hidden { display: none !important; }

/* Multi-select chip picker (for Discord roles) */
.chip-picker {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  min-height: 50px;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  cursor: pointer;
}
.chip.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Code blocks in admin / docs */
code, pre {
  font-family: var(--mono);
}
code {
  background: var(--bg-elev-2);
  color: var(--accent-deep);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}
pre {
  background: var(--bg-elev);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 0.85rem;
}

/* ----------------------------------------------------------------------
   Mobile nav toggle button
---------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Admin mobile sidebar toggle — hidden by default, shown on mobile */
.admin-menu-btn { display: none; }

/* ----------------------------------------------------------------------
   Responsive — tablet (≤ 900px)
---------------------------------------------------------------------- */
@media (max-width: 900px) {
  main {
    width: calc(100% - 2.5rem);
  }
  .jobs-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ----------------------------------------------------------------------
   Responsive — admin sidebar horizontal strip (641–800px)
---------------------------------------------------------------------- */
@media (max-width: 800px) {
  .admin-side {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
  }
  .admin-side h4 {
    width: 100%;
    margin: 0.5rem 0 0.25rem;
    font-size: 0.62rem;
  }
  .admin-side h4:first-child { margin-top: 0; }
  .admin-side a {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
  }
}

/* ----------------------------------------------------------------------
   Responsive — mobile (≤ 640px)
---------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Header */
  .site-header {
    padding: 0.75rem 1rem;
    gap: 0;
    flex-wrap: wrap;
  }
  .brand { flex: 1 1 auto; }
  .nav-toggle { display: inline-flex; }
  .auth-area { margin-left: 0.5rem; order: 0; }

  /* Shrink Discord login button to icon-only on mobile */
  #auth-area .btn-discord span { display: none; }
  #auth-area .btn-discord { padding: 0.55rem 0.75rem; }

  /* Truncate long Discord usernames */
  .auth-pill span:not(.logout) {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Nav — collapsed by default, toggled open */
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
    order: 10;
    gap: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.65rem 0.5rem; }

  /* Main */
  main {
    width: calc(100% - 1.5rem);
    margin: 1.25rem auto 2.5rem;
  }

  /* Hero */
  .hero {
    padding: 1.5rem 0 2rem;
    margin-bottom: 1.5rem;
  }

  /* Job search */
  .jobs-search-bar input[type="search"] { max-width: 100%; }

  /* Job cards — single column */
  .jobs-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* Form card */
  .page-card { padding: 1.25rem 1rem; }
  .form-shell h1 { font-size: 1.75rem; }

  /* Form toolbar — wrap and stretch */
  .toolbar { flex-wrap: wrap; gap: 0.5rem; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; min-width: 120px; }

  /* Job detail aside — no sticky on mobile */
  .aside { position: static; top: auto; }

  /* Admin shell — switch from grid to block */
  .admin-shell { display: block; }

  /* Admin sidebar toggle button */
  .admin-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-elev);
    border: none;
    border-bottom: 1px solid var(--line);
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    text-align: left;
  }
  .admin-menu-btn:hover { color: var(--accent); background: var(--accent-light); }

  /* Admin sidebar — hidden until toggled */
  .admin-side {
    display: none;
    flex-direction: column;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1rem;
    gap: 0;
  }
  .admin-side h4 { width: auto; margin: 0.5rem 0 0.25rem; }
  .admin-side.mobile-open { display: flex; }

  /* Admin content */
  .admin-content {
    padding: 1.25rem 1rem;
    overflow-x: auto;
  }
  .admin-content h1 { font-size: 1.5rem; }

  /* Tables — let admin-content handle horizontal scroll */
  .table { min-width: 520px; }
  .table th, .table td { padding: 0.65rem 0.6rem; white-space: nowrap; }

  /* Toasts — full width at bottom */
  #toast-host { left: 0.75rem; right: 0.75rem; bottom: 1rem; }
  .toast { min-width: unset; width: 100%; }

  /* Footer — stack vertically */
  .site-footer { padding: 1.25rem 1rem; }
  .footer-grid { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Modal — full-width */
  .modal-card {
    padding: 1.5rem 1.25rem;
    margin: 0 0.5rem;
    max-width: calc(100% - 1rem);
  }

  /* Banner — stack icon and text */
  .banner { padding: 1rem; flex-direction: column; gap: 0.5rem; }

  /* QB field head — compact grid */
  .qb-field-head { grid-template-columns: auto 1fr auto auto; row-gap: 0.4rem; }

  /* 2-column rows — single column */
  .row-2 { grid-template-columns: 1fr; }
}
