:root {
  color-scheme: light;
  --ink: #132521;
  --muted: #58706a;
  --line: #d8e4df;
  --soft: #f2f7f4;
  --paper: #fbfdfc;
  --white: #ffffff;
  --teal: #006b5b;
  --teal-dark: #064b41;
  --lime: #b8d84a;
  --amber: #9b5a00;
  --amber-bg: #fff5df;
  --blue: #245a9c;
  --shadow: 0 14px 40px rgba(22, 56, 47, 0.08);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: var(--teal); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(216, 228, 223, 0.9);
  background: rgba(251, 253, 252, 0.93);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  background: var(--teal);
  color: white;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 6px 6px 0 var(--lime);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.primary-nav { display: flex; align-items: center; gap: 24px; }
.primary-nav a {
  color: #29453e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--teal); }

#app { min-height: calc(100vh - 180px); }
.page, .hero-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}
.page { padding: 54px 0 80px; }

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 78% 18%, rgba(184, 216, 74, 0.28), transparent 24%),
    radial-gradient(circle at 88% 70%, rgba(0, 107, 91, 0.13), transparent 27%),
    linear-gradient(145deg, #f7fbf8, #edf6f1);
}
.hero::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -110px;
  bottom: -220px;
  border: 56px solid rgba(0, 107, 91, 0.06);
  border-radius: 50%;
}
.hero-inner { position: relative; z-index: 1; padding: 76px 0 72px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.16; letter-spacing: -0.035em; }
h1 { max-width: 800px; margin: 0; font-size: clamp(42px, 6vw, 72px); font-weight: 760; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
h3 { margin: 0; font-size: 19px; }
.hero-copy { max-width: 710px; margin: 20px 0 30px; color: #38534c; font-size: 18px; }

.search-box {
  max-width: 860px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid #cadbd4;
  border-radius: 15px;
  background: white;
  box-shadow: var(--shadow);
}
.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}
.search-box input::placeholder { color: #779089; }
.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--teal);
  color: white;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
}
.button:hover { background: var(--teal-dark); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button:disabled:hover { background: var(--teal); }
.button.secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.button.secondary:hover { border-color: var(--teal); color: var(--teal); }
.button.small { padding: 8px 12px; font-size: 13px; }
.search-hints { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.search-hints code { color: var(--teal-dark); background: rgba(255,255,255,.7); padding: 2px 5px; border-radius: 4px; }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  transform: translateY(-28px);
}
.stat-tile { padding: 23px 25px; border-right: 1px solid var(--line); }
.stat-tile:last-child { border-right: 0; }
.stat-tile strong { display: block; font-size: clamp(22px, 3vw, 31px); letter-spacing: -0.04em; }
.stat-tile span { color: var(--muted); font-size: 13px; }

.section { padding: 44px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading p { max-width: 600px; margin: 0; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 22px rgba(22, 56, 47, 0.04);
}
.card p { color: var(--muted); }
.card-link { color: var(--teal); font-weight: 750; text-decoration: none; }
.notice {
  padding: 18px 20px;
  border: 1px solid #f0d29f;
  border-left: 5px solid #d48818;
  border-radius: 10px;
  background: var(--amber-bg);
  color: #68420e;
}
.notice strong { color: #4b2d06; }

.page-header { margin-bottom: 28px; }
.page-header p { max-width: 720px; color: var(--muted); }
.crumbs { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.crumbs a { text-decoration: none; }
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(22, 56, 47, 0.04);
}
.filter-panel { margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: minmax(240px, 2fr) 1fr 120px auto; gap: 12px; align-items: end; }
.field label { display: block; margin-bottom: 6px; color: #3c564f; font-size: 12px; font-weight: 750; }
.field input, .field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cddbd6;
  border-radius: 9px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  outline: 0;
}
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,107,91,.11); }

.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 24px 0 12px; }
.result-summary p { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 15px; border-bottom: 1px solid #e5ede9; text-align: left; vertical-align: top; }
th { background: var(--soft); color: #405c54; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.protein-link { font-weight: 800; text-decoration: none; letter-spacing: .01em; }
.row-check { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ec-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 160px; }
.ec-chip { display: inline-flex; padding: 3px 7px; border-radius: 6px; background: #e8f4ef; color: var(--teal-dark); font-size: 12px; font-weight: 750; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.confident { background: #e4f4eb; color: #17613f; }
.badge.candidate { background: var(--amber-bg); color: var(--amber); }
.badge.pending { background: #edf1f5; color: #526274; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.pagination span { color: var(--muted); font-size: 13px; }

.protein-title { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; }
.protein-title h1 { font-size: clamp(36px, 5vw, 58px); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
.definition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 28px; margin: 20px 0 0; }
.definition-grid dt { color: var(--muted); font-size: 12px; }
.definition-grid dd { margin: 3px 0 0; font-weight: 700; word-break: break-word; }
.subsection { margin-top: 34px; }
.subsection-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.score { font-variant-numeric: tabular-nums; font-weight: 720; }
.score-track { width: 88px; height: 5px; margin-top: 5px; border-radius: 9px; background: #dce8e3; overflow: hidden; }
.score-fill { height: 100%; background: var(--teal); }
.sequence-pending { display: flex; align-items: center; gap: 13px; color: var(--muted); }
.sequence-pending .badge { flex: 0 0 auto; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 25px 0 36px; }
.metric { min-height: 132px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 10px; font-size: 30px; letter-spacing: -0.04em; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bar-list { display: grid; gap: 13px; margin-top: 20px; }
.bar-row { display: grid; grid-template-columns: minmax(60px, auto) 1fr auto; gap: 11px; align-items: center; font-size: 13px; }
.bar-track { height: 9px; border-radius: 9px; background: #e4ece8; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #48a08e); }
.bar-value { color: var(--muted); font-variant-numeric: tabular-nums; }
.top-list { margin: 18px 0 0; padding: 0; list-style: none; }
.top-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #e5ede9; }
.top-list li:last-child { border: 0; }

.model-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.prose { max-width: 800px; }
.prose p, .prose li { color: #435c56; }
.prose h2 { margin-top: 38px; font-size: 28px; }
.citation-box { padding: 22px; border-left: 5px solid var(--teal); background: var(--soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.error-state { max-width: 720px; margin: 70px auto; padding: 28px; border: 1px solid #efc7c2; border-radius: 14px; background: #fff4f2; color: #7d2820; }

.loading-state { width: min(1180px, calc(100% - 40px)); margin: 70px auto; }
.loading-line, .loading-grid div { background: linear-gradient(90deg, #edf3f0, #f7faf8, #edf3f0); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.loading-line { width: 45%; height: 20px; margin-bottom: 14px; border-radius: 7px; }
.loading-line.wide { width: 70%; height: 52px; }
.loading-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 34px; }
.loading-grid div { height: 150px; border-radius: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 38px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--ink); }
.site-footer div:last-child { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 900px) {
  .primary-nav { gap: 14px; }
  .primary-nav a:nth-child(4) { display: none; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-tile:nth-child(2) { border-right: 0; }
  .stat-tile:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .card-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid, .model-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { width: min(100% - 24px, 1180px); min-height: 66px; }
  .brand small { display: none; }
  .primary-nav a { display: none; }
  .primary-nav a:first-child, .primary-nav a:nth-child(2) { display: inline; }
  .page, .hero-inner, .site-footer { width: min(100% - 24px, 1180px); }
  .hero-inner { padding: 54px 0 62px; }
  h1 { font-size: 41px; }
  .search-box { grid-template-columns: 1fr; }
  .stats-strip { margin-inline: 0; }
  .stat-tile { padding: 18px; }
  .card-grid, .metric-grid, .detail-grid, .definition-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .result-summary { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-direction: column; }
}
