/* CoLoopDB mockups v2 — scientific database style (references: ChromLoops, UCSC Genome Browser) */
:root {
  --navy: #1c2b4a;
  --navy-2: #2b4472;
  --blue: #2a6bb3;
  --link: #1f5fa8;
  --gold: #f0b429;
  --ink: #1d2733;
  --ink-2: #44505e;
  --ink-3: #6f7a87;
  --line: #d3dbe5;
  --line-2: #e6ebf1;
  --head: #eef3f9;
  --zebra: #f8fafd;
  --supporting: #1f5fa8;
  --context: #d8dce2;
  --independent: #1f5fa8;
  --rescued: #e8721c;
  --sans: Arial, "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Courier New", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--ink); font: 14px/1.55 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: 13px; color: #1d2733; font-weight: 600; }
a .mono, a.mono { color: var(--link); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
b, strong { font-weight: 700; }

/* ---------- top strip + navbar (ChromLoops-like) ---------- */
.strip { background: #fff; border-bottom: 1px solid var(--line-2); }
.strip .in { max-width: 1280px; margin: 0 auto; padding: 4px 20px; display: flex; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.strip .tagline { margin-left: auto; color: var(--navy); font-weight: 700; font-size: 13.5px; letter-spacing: .1px; }
.navbar { background: var(--navy); box-shadow: 0 2px 4px rgba(0,0,0,.18); }
.navbar .in { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: stretch; flex-wrap: wrap; min-height: 50px; }
.navbar .items { display: flex; flex-wrap: wrap; min-width: 0; }
.navbar .burger { display: none; margin-left: auto; align-self: center; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 3px; padding: 4px 10px; font: inherit; cursor: pointer; }
.navbar .brand { display: flex; align-items: center; margin-right: 18px; }
.navbar a.item { color: #e8edf6; display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 50px; font-size: 13.5px; white-space: nowrap; border-bottom: 3px solid transparent; }
.navbar a.item svg { opacity: .9; }
.navbar a.item:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.navbar a.item.on { color: var(--gold); border-bottom-color: var(--gold); }
.navbar .caret { font-size: 9px; opacity: .7; }
.navbar form { margin-left: auto; display: flex; align-items: center; padding: 6px 0; }
.navbar form input { border: 0; border-radius: 3px 0 0 3px; padding: 6px 9px; width: 170px; font: inherit; font-size: 13px; }
.navbar form button { border: 0; background: var(--gold); color: var(--navy); font-weight: 700; padding: 6px 10px; border-radius: 0 3px 3px 0; cursor: pointer; }
.crumbs { max-width: 1280px; margin: 0 auto; padding: 8px 20px 0; font-size: 12.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumbs .back { font: inherit; background: #fff; border: 1px solid #b9c4d2; border-radius: 3px; padding: 2px 10px; color: var(--navy); cursor: pointer; }
.crumbs .back:hover { background: #eef3f9; }
.crumbs .trail { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.crumbs .trail a, .crumbs .trail span { display: inline-block; background: #eef1f6; border: 1px solid var(--line); padding: 1px 8px; color: var(--ink-2); text-decoration: none; }
.crumbs .trail a:hover { background: #dfe7f2; color: var(--navy); }
.crumbs .trail span.cur { background: #5f6f8f; color: #fff; border-color: #5f6f8f; }
.crumbs .trail i { font-style: normal; color: var(--ink-3); padding: 0 3px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 14px 20px 10px; }

/* ---------- headings, section banner ---------- */
h1.pt { font-size: 24px; margin: 8px 0 4px; color: var(--ink); }
h1.pt small { font-size: 14px; font-weight: 400; color: var(--ink-3); margin-left: 8px; }
.lead { color: var(--ink-2); margin: 0 0 12px; }
.banner { background: var(--navy); color: var(--gold); text-align: center; font-weight: 700; font-size: 16px; padding: 9px; margin: 26px 0 16px; border-radius: 2px; box-shadow: 0 3px 8px rgba(28,43,74,.25); letter-spacing: .2px; }
.intro p { text-align: justify; font-size: 14.5px; color: var(--ink); margin: 0 0 10px; }
.intro .num { color: var(--blue); font-weight: 700; }
.cite { border-top: 2px solid #9cc3e6; margin-top: 14px; padding-top: 10px; font-size: 14px; }
.cite b.lab { color: #2a8bd6; font-size: 17px; }

/* ---------- panels (results) ---------- */
.panel { border: 1px solid var(--line); border-radius: 3px; margin: 0 0 16px; background: #fff; }
.panel > .ph { background: var(--head); border-bottom: 1px solid var(--line); padding: 7px 12px; display: flex; align-items: center; gap: 10px; border-left: 4px solid var(--navy); }
.panel > .ph h3 { margin: 0; font-size: 15px; color: var(--navy); }
.panel > .ph .sub { font-size: 12px; color: var(--ink-3); }
.panel > .ph .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel > .pb { padding: 12px; overflow-x: auto; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #b9c4d2; background: linear-gradient(#fff, #eef2f7); color: var(--ink); padding: 4px 10px; border-radius: 3px; font: inherit; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--navy-2); text-decoration: none; }
.btn.pri { background: linear-gradient(#34558c, var(--navy)); color: #fff; border-color: var(--navy); }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.form { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; align-items: center; }
.form label { color: var(--ink-2); font-weight: 700; font-size: 13px; text-align: right; }
.form input[type=text], .form select { border: 1px solid #b9c4d2; border-radius: 3px; padding: 5px 8px; font: inherit; font-size: 13.5px; }
.form .ex { font-size: 12.5px; color: var(--ink-3); }

/* ---------- tables ---------- */
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt th { background: var(--head); color: var(--navy); font-weight: 700; text-align: left; padding: 6px 8px; border: 1px solid var(--line); white-space: nowrap; }
table.dt td { padding: 5px 8px; border: 1px solid var(--line-2); vertical-align: top; }
table.dt tbody tr:nth-child(even) td { background: var(--zebra); }
table.dt tbody tr:hover td { background: #fff7e0; }
table.dt tr.sel td { background: #fff1c7 !important; }
table.kv { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.kv th { width: 190px; text-align: left; background: #f3f6fa; color: var(--ink-2); padding: 6px 10px; border: 1px solid var(--line-2); font-weight: 700; }
table.kv td { padding: 6px 10px; border: 1px solid var(--line-2); }
.pager { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); padding: 8px 0 0; }
.pager .pg { margin-left: auto; display: flex; gap: 3px; }
.pager .pg button { border: 1px solid var(--line); background: #fff; min-width: 26px; padding: 2px 6px; cursor: pointer; font-size: 12px; }
.pager .pg button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- figures ---------- */
figure.fig { margin: 0; }
figure.fig figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; text-align: justify; }
figure.fig figcaption b { color: var(--ink); }
.figbox { border: 1px solid var(--line-2); padding: 8px; background: #fff; }

/* ---------- evidence + class badges ---------- */
.sw { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-right: 4px; border: 1px solid rgba(0,0,0,.15); }
.sw.supporting { background: var(--supporting); } .sw.none { background: #fff; }
.sw.na { background: repeating-linear-gradient(45deg, #fff 0 2px, #c3cbd6 2px 3px); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); align-items: center; }
.ev { display: inline-block; padding: 0 6px; border-radius: 2px; font-size: 11.5px; font-weight: 700; }
.ev.o { background: var(--supporting); color: #fff; } .ev.context { background: var(--context); color: #556; border: 1px solid #bbc; }
/* strict class of a supporting association (Independent / Rescued) */
.sw.ind { background: var(--independent); } .sw.res { background: var(--rescued); }
.ev.ind { background: var(--independent); color: #fff; } .ev.res { background: var(--rescued); color: #fff; }
.map.ind { border-top: 3px solid var(--independent); } .map.res { border-top: 3px solid var(--rescued); }
.cc { display: inline-block; padding: 0 5px; border-radius: 2px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 1px rgba(0,0,0,.4); }

/* ---------- function cards (ChromLoops dashed boxes) ---------- */
.funcs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.func { border: 2px dashed #5a6577; border-radius: 6px; padding: 12px 14px 12px; color: var(--ink); background: linear-gradient(180deg, #fff 0%, #f6f9fd 100%); display: flex; flex-direction: column; }
.func h4 { margin: 0 0 8px; font-size: 16px; color: var(--navy); text-align: center; }
.func:hover { border-color: var(--blue); text-decoration: none; background: #f2f8ff; box-shadow: 0 4px 14px rgba(28,43,74,.10); }
.func svg { display: block; width: 100%; height: auto; margin: 0 auto; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; }
.func p { margin: 8px 0 4px; font-size: 13px; color: var(--ink-2); text-align: center; }
.func .ex { margin-top: auto; text-align: center; font-size: 12.5px; color: var(--link); font-weight: 700; }

/* ---------- maps ---------- */
.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.map { border: 1px solid var(--line); padding: 6px; }
.map .h { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 4px; }
.map canvas { width: 100%; display: block; image-rendering: pixelated; }
.map .f { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.cbar { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.cbar i { display: inline-block; width: 120px; height: 10px; border: 1px solid #999; background: linear-gradient(90deg, #fff, #fcbba1, #fb6a4a, #cb181d, #67000d); }

/* ---------- footer ---------- */
.foot { background: var(--navy); color: #c9d3e3; margin-top: 30px; }
.foot .in { max-width: 1280px; margin: 0 auto; padding: 18px 20px; display: grid; grid-template-columns: 1.4fr 1.2fr 0.8fr; gap: 24px; font-size: 12.5px; }
.foot .visits div { display: flex; justify-content: space-between; gap: 8px; }
.foot .visits b { color: #fff; font-weight: 600; }
.foot .visits svg { margin-top: 6px; display: block; }
.foot .visits .since { display: block; font-size: 11px; color: #8e9bb3; }
.foot h5 { color: var(--gold); margin: 0 0 6px; font-size: 13px; }
.foot a { color: #fff; }
.foot .bot { text-align: center; font-size: 11.5px; color: #8e9bb3; padding: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.tooltip { position: fixed; pointer-events: none; background: rgba(20,30,48,.95); color: #fff; font-size: 12px; padding: 5px 8px; border-radius: 3px; z-index: 70; display: none; max-width: 300px; }
.spinner { color: var(--ink-3); padding: 20px; text-align: center; }

@media (max-width: 1320px) {
  .navbar a.item svg { display: none; }
  .navbar a.item { padding: 0 8px; }
}
@media (max-width: 1120px) {
  .navbar form { margin-left: 0; width: 100%; padding: 0 0 8px; }
  .navbar form input { flex: 1; width: auto; }
  .funcs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1000px) {
  .cols2, .cols3, .foot .in { grid-template-columns: 1fr; }
  .maps { grid-template-columns: repeat(2, 1fr); }
  .form { grid-template-columns: 1fr; } .form label { text-align: left; }
}
@media (max-width: 860px) {
  .navbar .burger { display: block; }
  .navbar .items { display: none; width: 100%; flex-direction: column; padding-bottom: 6px; }
  .navbar .items.open { display: flex; }
  .navbar a.item { height: 38px; border-bottom: 0; border-left: 3px solid transparent; }
  .navbar a.item.on { border-left-color: var(--gold); }
  .navbar .dd { flex-direction: column; } .navbar .dd .menu { position: static; box-shadow: none; }
  .strip .tagline { display: none; }
}
@media (max-width: 600px) { .funcs, .maps { grid-template-columns: 1fr; } }

/* ---------- dropdown menus ---------- */
.navbar .dd { position: relative; display: flex; }
.navbar .dd .menu { display: none; position: absolute; top: 50px; left: 0; background: #fff; min-width: 210px; box-shadow: 0 6px 18px rgba(0,0,0,.18); border: 1px solid var(--line); z-index: 40; }
.navbar .dd:hover .menu { display: block; }
.navbar .dd .menu a { display: block; color: var(--ink); padding: 8px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.navbar .dd .menu a:hover { background: #f3f6fa; text-decoration: none; color: var(--navy); }
.navbar .dd .menu a span { display: block; font-size: 11.5px; color: var(--ink-3); }
.soon { font-size: 10.5px; background: #fff3cd; color: #7a5a00; border: 1px solid #e8c766; padding: 0 5px; border-radius: 2px; margin-left: 4px; }
.ac { position: absolute; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.12); z-index: 50; min-width: 260px; }
.ac div { padding: 5px 10px; cursor: pointer; font-size: 13px; }
.ac div:hover, .ac div.on { background: #eef3f9; }
.ac div span { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.note { background: #f6f9fc; border: 1px solid var(--line); border-left: 4px solid var(--blue); padding: 8px 12px; font-size: 13px; color: var(--ink-2); margin: 10px 0; }
.err { background: #fdecea; border: 1px solid #f5c2c0; color: #8a1f1b; padding: 10px 14px; margin: 10px 0; }

/* grid children may shrink below their content width (prevents page-wide horizontal overflow) */
.cols2 > *, .cols3 > *, .funcs > *, .maps > *, .figs > *, .figs2 > *, .example > *, .panel { min-width: 0; }
.donutwrap { flex-wrap: wrap; }
svg { max-width: 100%; }
.panel > .ph { flex-wrap: wrap; }
.panel > .ph .right { flex-wrap: wrap; }
.offline { max-width: 1240px; margin: 8px auto 0; padding: 8px 14px; background: #fff7e0; border: 1px solid #f0b429; border-left: 4px solid #e8a400; font-size: 13px; color: #5a4300; }
.offline a { margin-left: 8px; }
