/* =====================================================
   BISCUIT AI HUB — Shared styles
   ===================================================== */

:root {
  --bg: #0B0B0D;
  --bg-elev: #131316;
  --bg-elev-2: #1A1A1F;
  --surface: #1F1F25;
  --line: #2A2A33;
  --line-soft: #1F1F27;
  --ink: #F2EDE4;
  --ink-dim: #A9A39A;
  --ink-mute: #6F6A62;
  --amber: #E8A547;
  --amber-soft: #F2C77A;
  --amber-deep: #B8801F;
  --rust: #C4593A;
  --teal: #5FB8B2;
  --cream: #F2EDE4;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --shadow: 0 30px 80px -20px rgba(0,0,0,0.6), 0 8px 30px -12px rgba(0,0,0,0.4);
  --grain: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.08 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0;
  background-image: var(--grain);
  opacity: 0.45; pointer-events: none; z-index: 1; mix-blend-mode: overlay;
}
::selection { background: var(--amber); color: #000; }

.serif { font-family: 'Fraunces', serif; font-optical-sizing: auto; letter-spacing: -0.02em; }
.mono { font-family: 'JetBrains Mono', monospace; }
h1, h2, h3 { margin: 0; font-family: 'Fraunces', serif; font-weight: 400; letter-spacing: -0.025em; }
p { margin: 0 0 1em; color: var(--ink-dim); }
a { color: var(--amber); text-decoration: none; transition: color .2s; }
a:hover { color: var(--amber-soft); }
code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: 4px; color: var(--amber); }

/* Brand mark */
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--rust) 100%);
  display: grid; place-items: center;
  font-family: 'Fraunces', serif;
  font-weight: 800;
  color: #1A0F00;
  font-size: 20px;
  box-shadow: 0 6px 24px -8px rgba(232,165,71,.5);
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }

/* Buttons */
.btn-primary.btn-secondary.btn-ghost {
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter Tight', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: #1A0F00; }
.btn-primary:hover { background: var(--amber-soft); transform: translateY(-1px); color: #1A0F00; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--amber); color: var(--amber); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-dim); padding: 9px 16px; font-size: 13px; }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-danger { background: var(--rust); color: white; }
.btn-danger:hover { background: #d96d4f; color: white; transform: translateY(-1px); }

/* Form fields */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field label .hint { text-transform: none; letter-spacing: 0; color: var(--ink-mute); font-size: 10px; margin-left: 6px; font-family: 'Inter Tight', sans-serif; }
.field input.field select.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus.field select:focus.field textarea:focus { border-color: var(--amber); }
.field textarea { resize: vertical; min-height: 80px; font-family: inherit; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.checkbox-label { display: flex; gap: 8px; align-items: center; color: var(--ink-dim); font-size: 13px; cursor: pointer; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .2s;
}
.modal-close:hover { color: var(--amber); border-color: var(--amber); }
.modal h2 { font-size: 32px; margin-bottom: 8px; }
.modal-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.modal h3 { font-size: 20px; margin: 28px 0 12px; color: var(--amber); }
.modal p.modal li { color: var(--ink-dim); font-size: 14.5px; line-height: 1.7; }
.modal ul { padding-left: 18px; margin: 0 0 16px; }
.modal li { margin-bottom: 6px; }
.modal hr { border: none; border-top: 1px solid var(--line-soft); margin: 24px 0; }
.modal strong { color: var(--ink); font-weight: 500; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--teal); color: #001A1A;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(95,184,178,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--rust); color: white; box-shadow: 0 12px 32px rgba(196,89,58,0.3); }

/* Scrollbars — cinematic dark */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }
* { scrollbar-width: thin; scrollbar-color: var(--line) var(--bg); }

/* Shared entrance animation */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   TOOL MODAL — status + department badges, access box
   ============================================================ */
.tool-modal-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.tm-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 30px;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent;
}
.tm-badge.approved { color: var(--teal); background: rgba(95,184,178,0.1); border-color: rgba(95,184,178,0.3); }
.tm-badge.trial { color: var(--amber); background: rgba(232,165,71,0.1); border-color: rgba(232,165,71,0.3); }
.tm-badge.restricted { color: var(--rust); background: rgba(196,89,58,0.12); border-color: rgba(196,89,58,0.35); }
.tm-badge.dept { color: var(--ink-dim); background: var(--bg); border-color: var(--line); }

.tool-access-box {
  margin-top: 20px; padding: 16px 18px; border-radius: 12px;
  background: rgba(95,184,178,0.07); border: 1px solid rgba(95,184,178,0.25);
}
.tool-access-box.pending { background: rgba(232,165,71,0.07); border-color: rgba(232,165,71,0.28); }
.tool-access-box.denied { background: rgba(196,89,58,0.08); border-color: rgba(196,89,58,0.3); }
.tool-access-box .tab { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 8px; }
.tool-access-box .code {
  font-family: 'JetBrains Mono', monospace; font-size: 15px; letter-spacing: 0.12em; color: var(--amber);
  background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; display: inline-block; margin: 4px 0;
}
.tool-access-box .note { font-size: 13px; color: var(--ink-dim); margin: 6px 0 0; }

/* Tool card: department line + status pill already styled; make dept clearer on the card */
.tool-card .tool-depts {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-dim); background: var(--bg); border: 1px solid var(--line-soft);
  padding: 3px 8px; border-radius: 20px; display: inline-block; margin-top: 2px;
}
.tool-card .tool-access-flag {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--teal); display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
}

/* ============================================================
   PROMPTING GUIDE — TOC + body
   ============================================================ */
.prompting-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.prompting-toc { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; }
.prompting-toc a {
  font-size: 13px; color: var(--ink-dim); padding: 8px 12px; border-radius: 8px;
  border-left: 2px solid transparent; transition: all .15s; cursor: pointer; line-height: 1.35;
}
.prompting-toc a:hover { background: var(--bg-elev); color: var(--ink); }
.prompting-toc a.active { color: var(--amber); border-left-color: var(--amber); background: linear-gradient(90deg, rgba(232,165,71,0.08), transparent); }
.prompting-body { max-width: 720px; }
.prompting-section { margin-bottom: 40px; scroll-margin-top: 92px; }
.prompting-section h3 { font-family: 'Fraunces', serif; font-size: 24px; color: var(--ink); margin-bottom: 14px; letter-spacing: -0.02em; }
.prompting-section p { font-size: 15px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 12px; }
.prompting-section ul { padding-left: 20px; margin: 0 0 14px; }
.prompting-section li { font-size: 14.5px; line-height: 1.65; color: var(--ink-dim); margin-bottom: 8px; }
.prompting-section strong { color: var(--ink); font-weight: 600; }
.prompting-section em { color: var(--amber-soft); font-style: italic; }
@media (max-width: 860px) {
  .prompting-layout { grid-template-columns: 1fr; }
  .prompting-toc { position: static; flex-direction: row; flex-wrap: wrap; margin-bottom: 20px; }
  .prompting-toc a { border-left: none; border-bottom: 2px solid transparent; }
}

/* ============================================================
   NEWS — auto-pull status
   ============================================================ */
.news-status { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); display: flex; align-items: center; gap: 8px; }
.news-item .news-src { color: var(--ink-mute); }

/* ============================================================
   POST PARTNERS
   ============================================================ */
#partners-list { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.partner-card { background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px 22px; transition: border-color .18s; }
.partner-card:hover { border-color: rgba(232,165,71,0.35); }
.partner-card h3 { font-family: 'Fraunces', serif; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.partner-card .blurb { font-size: 13.5px; color: var(--ink-dim); margin-bottom: 14px; line-height: 1.55; }
.partner-card .row { display: flex; flex-wrap: wrap; gap: 20px; }
.partner-card .col-label { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }
.partner-card .contact { font-size: 13px; color: var(--ink-dim); margin-bottom: 4px; }
.partner-card .contact strong { color: var(--ink); }
.partner-card .links { display: flex; flex-wrap: wrap; gap: 8px; }
.partner-card .links a {
  font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--amber);
  transition: all .15s; display: inline-flex; align-items: center; gap: 5px;
}
.partner-card .links a:hover { border-color: var(--amber); background: rgba(232,165,71,0.08); }
.partner-empty { color: var(--ink-mute); font-size: 13px; font-style: italic; }

/* Admin: small buttons + partner/access editors */
.btn-sm { padding: 6px 12px !important; font-size: 12px !important; }
.pt-rowline { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.pt-rowline input { flex: 1; }
.pt-rowline .btn-icon { flex: none; }
.ta-status-pill {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; display: inline-block;
}
.ta-status-pill.requested { color: var(--amber); background: rgba(232,165,71,0.12); }
.ta-status-pill.granted { color: var(--teal); background: rgba(95,184,178,0.12); }
.ta-status-pill.denied { color: var(--rust); background: rgba(196,89,58,0.12); }
.ta-status-pill.revoked { color: var(--ink-mute); background: var(--bg); }
.ta-code-inline { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--amber); }


/* Department clearance: summary chip on cards, clean list in modal */
.dept-sum { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); font-style: normal; }
.dept-sum.all { color: var(--teal); }
.dept-sum.limited { color: var(--amber-soft); }
.dept-list { width: 100%; margin-top: 14px; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.dept-list .dl-head { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); padding: 9px 16px; border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.dept-list .dl-row { display: flex; align-items: center; padding: 9px 16px; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.dept-list .dl-row:last-child { border-bottom: none; }
.dept-list .dl-row .name { color: var(--ink-dim); }
.dept-list .dl-row.on .name { color: var(--ink); }
.dept-list .dl-row .mark { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .08em; color: var(--ink-mute); }
.dept-list .dl-row.on .mark { color: var(--teal); }
