@font-face { font-family: "Satoshi"; src: url("/static/satoshi-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/static/satoshi-medium.woff2") format("woff2"); font-weight: 500 650; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/static/satoshi-bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #fff;
  --canvas: #f4f6f9;
  --ink: #171b24;
  --muted: #697487;
  --line: #dce2ea;
  --faint: #edf0f4;
  --accent: #2d4a8a;
  --accent-dark: #20376a;
  --soft: #eef2f8;
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); font-size: 14px; line-height: 1.48; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(29px, 3.2vw, 46px); line-height: 1.05; letter-spacing: -.038em; }
h2 { margin-bottom: 7px; font-size: 22px; line-height: 1.18; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 15px; }
.eyebrow { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-weight: 600; text-decoration: none; }
.button.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.button.small { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 18px; }
.icon-button:hover, .button:hover { border-color: #b3becc; background: var(--soft); }
.button.primary:hover { background: #29303c; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid rgba(45,74,138,.72); outline-offset: 2px; }

.admin-loading, .admin-denied { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; }
.loading-mark, .brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--accent-dark); font-weight: 800; }
.admin-loading p { margin: 14px 0 0; color: var(--muted); }
.admin-denied { max-width: 560px; margin: auto; }
.admin-denied .wordmark { color: var(--accent-dark); font-weight: 700; }
.admin-denied > p:not(.wordmark) { max-width: 480px; color: var(--muted); font-size: 16px; }

.admin-app { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0,1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 15px 17px; border-right: 1px solid var(--line); background: #f8f9fb; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 7px 24px; text-decoration: none; }
.admin-brand > span:last-child { display: grid; }
.admin-brand strong { font-size: 14px; line-height: 1.2; }
.admin-brand small { color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 3px; }
.admin-nav a { min-height: 39px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #4f5a6c; text-decoration: none; }
.admin-nav a:hover { background: #f0f3f7; color: var(--ink); }
.admin-nav a[aria-current="page"] { background: #e9eef6; color: var(--accent-dark); font-weight: 650; }
.nav-index { color: #96a0af; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.nav-count { min-width: 20px; padding: 1px 5px; border-radius: 999px; background: rgba(45,74,138,.08); font-size: 9px; text-align: center; }
.admin-sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.admin-sidebar-foot p { margin-bottom: 7px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.admin-sidebar-foot a { color: var(--accent-dark); font-size: 11px; text-decoration: none; }

.admin-main { min-width: 0; padding: clamp(28px,4vw,62px) clamp(22px,5vw,76px) 80px; }
.admin-topbar { max-width: 1420px; display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.admin-intro { max-width: 760px; margin: 0; color: var(--muted); font-size: 15px; }
.admin-topbar-actions { display: flex; align-items: center; gap: 9px; }
.readonly-badge { padding: 5px 8px; border: 1px solid #d7deea; border-radius: 999px; color: #526077; font-size: 10px; white-space: nowrap; }
.admin-status { min-height: 18px; max-width: 1420px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.admin-status.error { color: #9c3b30; }
.admin-content { max-width: 1420px; padding-top: 26px; }

.metric-strip { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-width: 0; padding: 18px 18px 17px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 4px; font-size: 24px; font-weight: 600; line-height: 1; }
.section-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 36px 0 14px; }
.section-row p { margin: 0; color: var(--muted); font-size: 12px; }
.section-link { color: var(--accent-dark); font-size: 12px; font-weight: 650; text-decoration: none; }
.empty-panel { padding: 38px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; }

.project-list { display: grid; gap: 32px; }
.scientist-group { min-width: 0; }
.scientist-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.scientist-heading h2 { margin: 0; font-size: 17px; }
.scientist-heading p { margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.project-card { position: relative; min-width: 0; min-height: 228px; display: grid; grid-template-rows: 72px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); transition: border-color .16s ease, transform .18s ease, box-shadow .18s ease; }
.project-card:hover { border-color: #b4bfce; box-shadow: 0 11px 28px rgba(33,44,61,.08); transform: translateY(-2px); }
.project-card-cover { position: relative; overflow: hidden; background: #364a67; }
.project-card-cover::before { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.12) 1px,transparent 1px); background-size: 24px 24px; opacity: .2; content: ""; }
.project-card-cover::after { position: absolute; right: 22px; bottom: -26px; width: 112px; height: 112px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; content: ""; }
.motif-sequence .project-card-cover { background: #3d5478; }
.motif-field .project-card-cover { background: #506951; }
.motif-molecule .project-card-cover { background: #42666b; }
.motif-cellular .project-card-cover { background: #6b5d72; }
.motif-network .project-card-cover { background: #465b77; }
.motif-materials .project-card-cover { background: #656577; }
.motif-cosmos .project-card-cover { background: #303c61; }
.project-card-cover span { position: absolute; z-index: 2; bottom: 9px; left: 12px; color: rgba(255,255,255,.76); font-size: 8px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.project-card-body { min-width: 0; display: grid; align-content: start; gap: 8px; padding: 14px 15px 16px; }
.project-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-card time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.project-card h3 { display: -webkit-box; overflow: hidden; margin: 0; font-size: 16px; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-card a { position: absolute; inset: 0; z-index: 4; }
.project-card a:focus-visible { outline-offset: -3px; }
.status-pill { width: max-content; padding: 3px 7px; border-radius: 999px; background: #edf0f4; color: #526074; font-size: 8px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.status-pill.working { background: #e8f4ed; color: #286343; }
.status-pill.submitted { background: #e8eefb; color: #294c91; }
.status-pill.archived { background: #f3ecea; color: #765148; }
.project-card-foot { margin-top: auto; color: #7b8595; font-size: 9px; text-transform: uppercase; }

.pending-list, .account-list, .system-list { display: grid; gap: 9px; }
.pending-row, .account-row { display: grid; grid-template-columns: minmax(220px,1fr) minmax(340px,1.5fr) auto; align-items: center; gap: 16px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.person { min-width: 0; display: grid; gap: 2px; }
.person span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.usage-inline { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.usage-inline div { min-width: 0; }
.usage-inline span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.usage-inline strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-state { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.system-summary { margin-bottom: 24px; }
.system-row { width: 100%; display: grid; grid-template-columns: 72px 92px minmax(150px,.75fr) minmax(160px,1fr); gap: 7px 12px; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--faint); background: var(--paper); text-align: left; }
.system-row:hover { background: var(--soft); }
.system-row time, .system-row span { color: var(--muted); font-size: 10px; }
.system-row p { grid-column: 3 / -1; margin: 0; color: var(--muted); font-size: 10px; }
.system-list { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }

.detail-back { display: inline-block; margin-bottom: 18px; color: var(--accent-dark); font-size: 12px; font-weight: 650; text-decoration: none; }
.detail-hero { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.6fr); gap: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.detail-hero h2 { max-width: 920px; font-size: clamp(27px,3.2vw,44px); }
.detail-problem { max-width: 900px; margin: 14px 0 0; color: #566276; font-size: 15px; line-height: 1.65; }
.detail-owner { padding: 15px 0 0 20px; border-left: 1px solid var(--line); }
.detail-owner span { display: block; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.detail-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-top: 18px; border-bottom: 1px solid var(--line); }
.detail-metrics .metric { border-top: 0; }
.detail-sections { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 28px; margin-top: 30px; }
.detail-primary, .detail-aside { min-width: 0; display: grid; align-content: start; gap: 22px; }
.detail-section { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.detail-section > header { margin-bottom: 15px; padding-bottom: 11px; border-bottom: 1px solid var(--faint); }
.detail-section > header p { margin: 0; color: var(--muted); font-size: 11px; }
.markdown { color: #303845; font-size: 13px; line-height: 1.64; }
.markdown h1, .markdown h2, .markdown h3 { margin-top: 22px; }
.markdown h1 { font-size: 22px; }.markdown h2 { font-size: 18px; }.markdown h3 { font-size: 15px; }
.markdown a { color: var(--accent-dark); overflow-wrap: anywhere; }
.markdown table { width: 100%; border-collapse: collapse; font-size: 11px; }
.markdown th, .markdown td { padding: 7px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.decision-readonly { padding: 13px 0; border-bottom: 1px solid var(--faint); }
.decision-readonly:last-child { border-bottom: 0; }
.decision-readonly > p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.decision-answer { color: var(--accent-dark) !important; font-weight: 650; }
.artifact-list, .context-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.artifact-list a, .artifact-list > li, .context-list li { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 9px; border: 1px solid var(--faint); border-radius: 7px; text-decoration: none; }
.artifact-list a:hover { background: var(--soft); }
.artifact-list span, .context-list span { color: var(--muted); font-size: 10px; }
.context-link { min-width: 0; overflow: hidden; color: var(--accent-dark); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.message-list { max-height: 420px; overflow: auto; display: grid; gap: 9px; }
.message { padding: 10px 11px; border-left: 2px solid #dce2eb; background: #f8f9fb; }
.message.agent { border-color: #9db0d7; }
.message header { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.message p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.agent-dialog { width: min(1040px,calc(100vw - 28px)); max-height: 88vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 12px; }
.agent-dialog::backdrop { background: rgba(21,27,38,.28); }
.agent-dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.agent-call-meta { color: var(--muted); font-size: 11px; }
.agent-dialog details { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.agent-dialog summary { padding: 10px 12px; cursor: pointer; font-weight: 650; }
.agent-dialog pre { max-height: 440px; overflow: auto; margin: 0; padding: 12px; border-top: 1px solid var(--line); background: #f7f8fa; font: 11px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: 380px; padding: 10px 12px; border-radius: 8px; background: #1d2430; color: #fff; box-shadow: 0 12px 32px rgba(20,27,39,.2); font-size: 12px; }

@media (max-width: 1120px) {
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metric:nth-child(3) { border-right: 0; }.metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .pending-row, .account-row { grid-template-columns: minmax(190px,.75fr) minmax(320px,1.25fr); }
  .pending-row > :last-child, .account-row > :last-child { grid-column: 2; justify-self: end; }
}

@media (max-width: 820px) {
  .admin-app { display: block; }
  .admin-sidebar { position: sticky; z-index: 20; top: 0; width: 100%; height: auto; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; padding: 9px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-brand { padding: 0; }.admin-brand small { display: none; }
  .admin-nav { display: flex; gap: 2px; overflow-x: auto; justify-self: end; }
  .admin-nav a { min-width: max-content; min-height: 34px; grid-template-columns: auto auto; padding: 6px 8px; font-size: 11px; }
  .nav-index, .nav-count, .admin-sidebar-foot { display: none; }
  .admin-main { padding-top: 28px; }
  .detail-sections, .detail-hero { grid-template-columns: 1fr; }
  .detail-owner { padding: 0; border-left: 0; }
  .detail-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-metrics .metric { border-bottom: 1px solid var(--line); }
}

@media (max-width: 580px) {
  .admin-brand > span:last-child { display: none; }
  .admin-sidebar { grid-template-columns: auto minmax(0,1fr); }
  .admin-nav { max-width: calc(100vw - 58px); }
  .admin-topbar { align-items: start; }
  .admin-topbar-actions { flex-direction: column-reverse; align-items: end; }
  .readonly-badge { display: none; }
  .project-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric:nth-child(2n) { border-right: 0; }.metric { border-bottom: 1px solid var(--line); }
  .pending-row, .account-row { grid-template-columns: 1fr; }
  .pending-row > :last-child, .account-row > :last-child { grid-column: auto; justify-self: stretch; }
  .usage-inline { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scientist-heading { align-items: start; flex-direction: column; gap: 3px; }
  .scientist-heading p { text-align: left; }
  .system-row { grid-template-columns: 58px minmax(70px,.4fr) minmax(110px,1fr); }
  .system-row > span:nth-of-type(2) { display: none; }
  .system-row p { grid-column: 2 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
