:root {
  --bg: #f6f7f5; --panel: #ffffff; --ink: #1d2320; --muted: #66706a; --line: #dfe3df;
  --accent: #23614f; --accent-ink: #ffffff; --accent-soft: #e3efe9;
  --occ: #355c7d; --occ-ink: #fff; --res: #e3a72f; --res-ink: #2b2005; --free: #ffffff;
  --sel: #1f9d55; --danger: #b3261e; --draft: #8a5a00; --draft-bg: #fff3d6;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .6rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

header.top { background: #17312a; color: #e8f0ec; }
header.top .bar { max-width: 1400px; margin: auto; padding: .55rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
header.top .brand { font-weight: 700; color: #fff; font-size: 1.05rem; letter-spacing: .01em; }
header.top .brand span { color: #8fd3b6; }
header.top nav { display: flex; gap: .2rem; flex-wrap: wrap; }
header.top nav a { color: #cfe0d8; padding: .3rem .6rem; border-radius: 6px; }
header.top nav a:hover, header.top nav a.on { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
header.top form.qs { flex: 1; min-width: 200px; display: flex; }
header.top form.qs input { width: 100%; border: 0; border-radius: 6px; padding: .4rem .7rem; font: inherit; background: #f2f6f4; }
header.top .user { display: flex; gap: .5rem; align-items: center; color: #a9c2b7; font-size: .85rem; }
header.top .user button { background: none; border: 0; color: #cfe0d8; cursor: pointer; font: inherit; padding: 0; }

main { max-width: 1400px; margin: auto; padding: 1.2rem 1rem 3rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.flash { padding: .55rem .8rem; border-radius: 8px; margin-bottom: .8rem; border: 1px solid; }
.flash.ok { background: var(--accent-soft); border-color: #b7d7c8; }
.flash.error { background: #fdecea; border-color: #f2b8b5; color: #6e1611; }

.btn, button.btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); background: #fff;
  color: var(--ink); padding: .38rem .8rem; border-radius: 7px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9c2bd; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #1b4e40; }
.btn.danger { color: var(--danger); border-color: #efc4c1; }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: default; }

input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  font: inherit; border: 1px solid #cdd3cf; border-radius: 7px; padding: .38rem .55rem; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 4.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd0bd; border-color: var(--accent); }
label { font-weight: 600; font-size: .85rem; display: block; margin-bottom: .2rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input[type=text], .form-grid input[type=date] { width: 100%; }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: .42rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfa; position: sticky; top: 0; }
table.list tr:hover td { background: #f8fbf9; }
table.list td.clip { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tablewrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; }

.badge { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 99px; font-weight: 600; letter-spacing: .02em; }
.badge.draft { background: var(--draft-bg); color: var(--draft); }
.badge.final { background: var(--accent-soft); color: var(--accent); }
.badge.res { background: #fbecc8; color: #6d4a00; }
.badge.exp { background: #fde2e0; color: var(--danger); }
.entryno { font-family: var(--mono); font-weight: 600; }

dl.fields { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0; }
dl.fields dt { color: var(--muted); font-size: .85rem; }
dl.fields dd { margin: 0; word-break: break-word; }
dl.fields dd.pre { white-space: pre-wrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.stat .n { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .85rem; }

/* --- storage grids --- */
.boxgrid { display: inline-grid; gap: 3px; padding: 6px; background: #eef1ee; border-radius: 8px; user-select: none; }
.boxgrid .hd { font-size: .7rem; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.cell { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid #c9d0cb; background: var(--free);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .62rem; line-height: 1.05;
  cursor: pointer; position: relative; overflow: hidden; text-align: center; padding: 2px; }
.cell .lbl { color: #9aa49e; font-size: .6rem; }
.cell.occupied { background: var(--occ); border-color: var(--occ); color: var(--occ-ink); }
.cell.occupied .lbl { color: #b9cbe0; }
.cell.reserved { background: var(--res); border-color: #c98f1c; color: var(--res-ink); }
.cell.reserved .lbl { color: #6d4a00; }
.cell.expired { background: repeating-linear-gradient(45deg, #f6d48d, #f6d48d 4px, #fbe9c4 4px, #fbe9c4 8px); }
.cell.mine { background: #2f7d5e; border-color: #2f7d5e; color: #fff; }
.cell.sel { outline: 3px solid var(--sel); outline-offset: 1px; }
.cell.mine.unsel { opacity: .35; text-decoration: line-through; }
.cell.locked { cursor: not-allowed; }
.cell:hover { filter: brightness(.95); }
.boxgrid.compact .cell { width: 22px; height: 22px; font-size: 0; padding: 0; }
.boxgrid.compact .hd { font-size: .55rem; }
.boxgrid.canes .cell { border-radius: 6px; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #c9d0cb; vertical-align: -2px; margin-right: .3rem; }
.legend i.o { background: var(--occ); border-color: var(--occ); }
.legend i.r { background: var(--res); border-color: #c98f1c; }
.legend i.x { background: repeating-linear-gradient(45deg, #f6d48d, #f6d48d 3px, #fbe9c4 3px, #fbe9c4 6px); }
.legend i.m { background: #2f7d5e; border-color: #2f7d5e; }
.legend i.s { outline: 2px solid var(--sel); }
.tip { position: fixed; z-index: 50; background: #17312a; color: #fff; padding: .45rem .6rem; border-radius: 7px; font-size: .8rem;
  pointer-events: none; max-width: 280px; box-shadow: 0 4px 16px rgba(0,0,0,.2); display: none; }
.boxcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.boxcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; }
.boxcard h3 { margin: 0 0 .4rem; font-size: .9rem; display: flex; justify-content: space-between; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { background: var(--accent-soft); border: 1px solid #b7d7c8; border-radius: 99px; padding: .1rem .55rem; font-size: .82rem; display: inline-flex; gap: .35rem; align-items: center; }
.chip.rm { background: #fdecea; border-color: #f2b8b5; text-decoration: line-through; }
.chip button { border: 0; background: none; cursor: pointer; padding: 0; color: inherit; font-size: 1rem; line-height: 1; }
.picker { border: 1px dashed #b9c4be; border-radius: 10px; padding: .8rem; background: #fbfcfb; }
pre.seq { background: #0f1f1a; color: #d6eadf; padding: .9rem; border-radius: 8px; overflow: auto; max-height: 70vh; font-size: .8rem; line-height: 1.35; }
.pager { display: flex; gap: .3rem; align-items: center; margin: .7rem 0; }
.drop { border: 2px dashed #b9c4be; border-radius: 10px; padding: 1rem; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
details summary { cursor: pointer; }
@media (max-width: 700px) { .cell { width: 32px; height: 32px; font-size: 0; } .cell .lbl { font-size: .55rem; } dl.fields { grid-template-columns: 1fr; } }

/* --- artwork --- */
.watermark { position: fixed; right: -4vw; bottom: -6vh; width: 58vmin; height: 58vmin; background: center/contain no-repeat;
  pointer-events: none; z-index: 0; }
header.top, main, footer { position: relative; z-index: 1; }
.brandlogo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: -8px; margin-right: .5rem;
  border: 1.5px solid rgba(255,255,255,.35); }
.navicon { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; vertical-align: -4px; margin-right: .35rem; }
.banner { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 1rem; height: 200px;
  background: #17312a center/cover no-repeat; }
.banner .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,25,20,.78) 0%, rgba(10,25,20,.35) 55%, rgba(10,25,20,0) 100%); }
.banner .text { position: absolute; left: 1.4rem; bottom: 1.1rem; color: #fff; }
.banner h1 { color: #fff; margin: 0; font-size: 1.7rem; }
.banner .credit, .credit { font-size: .72rem; opacity: .8; }
.banner .credit { position: absolute; right: .8rem; bottom: .5rem; color: #fff; }
.stat .tileicon { float: right; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; margin-left: .5rem;
  border: 1px solid var(--line); }
.loginwrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 78vh; max-width: 1000px; margin: 5vh auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.loginwrap .art { background: #17312a center/cover no-repeat; position: relative; min-height: 320px; }
.loginwrap .art .credit { position: absolute; left: .8rem; bottom: .6rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.loginwrap .form { padding: 2.2rem 2rem; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 760px) { .loginwrap { grid-template-columns: 1fr; } .loginwrap .art { min-height: 180px; } }
.slotcard { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; }
.slotcard .preview { width: 220px; height: 140px; border-radius: 8px; border: 1px solid var(--line); background: #f0f2f0 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.cell.planned { border: 2px dashed var(--sel); background: #e6f6ec; color: #145c34; font-weight: 600; }
.cell.dropok { outline: 3px solid var(--accent); outline-offset: 1px; }
[data-rearrange] .cell.occupied { cursor: grab; }
[data-rearrange] .cell.occupied:active { cursor: grabbing; }
.banner .slide { position: absolute; inset: 0; background: #0d1d18 center/cover no-repeat; opacity: 0; transition: opacity 1.2s ease; }
.banner .slide.on { opacity: 1; }
.banner .dots { position: absolute; right: .8rem; top: .7rem; display: flex; gap: .35rem; }
.banner .dots button { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.8); background: transparent; padding: 0; cursor: pointer; }
.banner .dots button.on { background: #fff; }
@media (prefers-reduced-motion: reduce) { .banner .slide { transition: none; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .8rem; }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem; }
.gcard .pick { position: relative; cursor: crosshair; background: #0d1d18; border-radius: 6px; overflow: hidden; }
.gcard .pick img { display: block; width: 100%; height: 190px; object-fit: contain; }
.gcard .pick .dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,.5); pointer-events: none; }
.gcard .pv { height: 40px; border-radius: 5px; background: #0d1d18 center/cover no-repeat; margin-top: .4rem; }
.gcard .pvl { width: 40px; height: 52px; border-radius: 5px; background: #0d1d18 center/cover no-repeat; flex: none; }

/* selection markers: bacterial vs eukaryotic */
.mk { display: inline-block; font-size: .72rem; padding: .02rem .4rem; border-radius: 4px; font-weight: 600; white-space: nowrap; margin: .05rem 0; }
.mk.bac { background: #e3eefb; color: #1d4f8c; border: 1px solid #b9d2f0; }
.mk.euk { background: #fdeede; color: #8a4a0c; border: 1px solid #f2cfa6; }
.mk.host { font-weight: 500; text-decoration: none; border: 1px solid transparent; }
.mk.host.h0 { background: #e6f4ea; color: #1e6b37; border-color: #bfe0c9; }
.mk.host.h1 { background: #efe7fb; color: #5a2d91; border-color: #d6c4f2; }
.mk.host.h2 { background: #e2f3f6; color: #145f6e; border-color: #b6dde5; }
.mk.host.h3 { background: #fbe6ee; color: #8f1f4c; border-color: #f0c0d3; }
.mk.host.h4 { background: #f1f0e2; color: #5d5a16; border-color: #dcd9b0; }
.mk.host.h5 { background: #eceff3; color: #3a4757; border-color: #ccd3dc; }
