/* Dense specimen grid. Panels are cells of a hairline table: the 1px gaps on
   a border-coloured background ARE the rules, so nothing needs margins. */

:root {
  --bg: #101112;
  --panel: #161819;
  --ink: #e8e6e3;
  --dim: #8b8f93;
  --line: #2a2d2f;
  --accent: #d8b25e;
  --ui: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #d9d7d2;
  --panel: #f4f3f0;
  --ink: #16181a;
  --dim: #6d7175;
  --line: #c3c1bb;
  --accent: #8a6a12;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--line);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 12px;
}

/* ---------------------------------------------------------------- toolbar */

#bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

#bar select,
#bar input[type="text"],
#bar button,
#bar .file {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 3px 6px;
  height: 24px;
  line-height: 1;
}

#bar select { min-width: 190px; }
#bar input[type="text"] { flex: 1 1 220px; min-width: 140px; }
#bar button, #bar .file { cursor: pointer; user-select: none; }
#bar button:hover, #bar .file:hover { border-color: var(--accent); }

#bar .rng {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--dim);
  white-space: nowrap;
}

#bar input[type="range"] { width: 96px; accent-color: var(--accent); }
#bar output { width: 3ch; text-align: right; color: var(--ink); }

/* The four views, sectioned off from the controls by a rule on each side so
   it reads as navigation rather than as one more knob. */
#bar .pages {
  display: flex;
  gap: 1px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

#bar .pages a {
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 9px;
  height: 24px;
  line-height: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

#bar .pages a:hover { color: var(--ink); }

#bar .pages a[aria-current] {
  color: #14140f;
  background: var(--accent);
  border-color: var(--accent);
}

#status { color: var(--dim); margin-left: auto; white-space: nowrap; }
#status.err { color: #e0665a; }

/* ------------------------------------------------------------------ grid */

#panels {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
}

.p {
  position: relative;
  grid-column: span 12;
  background: var(--panel);
  padding: 16px 12px 12px;
  overflow: hidden;
}

.p > .l {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9px;
  letter-spacing: .09em;
  color: var(--dim);
  text-transform: uppercase;
  pointer-events: none;
}

.c6 { grid-column: span 6; }
.c4 { grid-column: span 4; }
.c3 { grid-column: span 3; }
.c8 { grid-column: span 8; }

@media (max-width: 900px) {
  .c6, .c4, .c3, .c8 { grid-column: span 12; }
}

/* --------------------------------------------------------------- content */

.s { font-family: Specimen, serif; line-height: 1.05; word-break: break-word; }

.sample { font-size: 96px; }

.rows > div { overflow-wrap: anywhere; }

.wf { display: grid; gap: 2px; }
.wf > div { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.wf i { font-family: var(--ui); font-style: normal; font-size: 9px; color: var(--dim); width: 3ch; text-align: right; flex: none; }

.para { line-height: 1.34; }

.gl { display: flex; flex-wrap: wrap; gap: 1px; }
.gl span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  background: var(--bg);
}
.gl span:hover { background: var(--accent); color: #14140f; }

table.kv { border-collapse: collapse; width: 100%; }
table.kv td { padding: 1px 6px 1px 0; vertical-align: top; }
table.kv td:first-child { color: var(--dim); width: 12ch; white-space: nowrap; }
table.kv td:last-child { text-align: right; }

.pairs { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------------ drop */

#drop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 28px;
  letter-spacing: .12em;
  z-index: 50;
}

#drop.on { display: flex; }
