/* Eikon · 1.0-style infinite wrapping canvas + top-left folding control bar
   Semantic MEK design system tokens only; never raw hex. */

/* Dosage 1.2 Preview builds (adds Greek & Cyrillic for icon inscriptions; preview only, never full commercial font) */
@font-face {
  font-family: "Dosage Humanist";
  src: url("fonts/Dosage-Humanist.woff2") format("woff2");
  font-display: block;
}

@font-face {
  font-family: "Dosage Mono";
  src: url("fonts/Dosage-Mono.woff2") format("woff2");
  font-display: block;
}

:root {
  --eikon-mat: var(--surface);
}

html,
body.eikon-stage-body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
}

/* ---------- 1.0-style infinite wrapping board ---------- */
.board {
  position: fixed;
  inset: 0;
  overflow: hidden;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: var(--bg);
}

.board.panning,
.board.panning .pane {
  cursor: grabbing;
}

.board-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.pane {
  --edge: var(--line);
  --edge-to: var(--line-hover);
  --fill: var(--bg);
  position: absolute;
  top: 0;
  left: 0;
  width: var(--pane-w, 340px);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: var(--space-2);
  color: inherit;
  text-decoration: none;
  outline: none;
  cursor: inherit;
  will-change: transform;
  -webkit-touch-callout: none;
}

.pane.on {
  --edge: var(--text-strong);
  --edge-to: var(--text-strong);
}

.pane.on .pane-title,
.board:not(.panning) .pane:hover .pane-title {
  color: var(--text-strong);
}

.board:focus .pane.on .pane-cat {
  background: var(--accent);
  color: var(--bg);
  padding-inline: 4px;
}

.pane-mat {
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  overflow: hidden;
}

.eikon-fig {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  gap: 0;
}

.eikon-fig > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: none;
  pointer-events: none;
}

/* The pictures are other people's photographs, shown as they are: plain figures, never the design system's photo
   part, which dithers a figure.photo in a faithful theme (the Art Librarian, 2026-11-24). */
.eikon-fig, .eikon-plate-fig, .eikon-mini-fig { margin: 0; min-width: 0; }

.pane-body {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: var(--space-2) var(--space-1) 0;
}

.board.no-captions .pane-body {
  display: none;
}

.pane-meta {
  display: block;
  font: var(--text-xs)/1.3 var(--font-ui);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-title {
  font-size: var(--text-md);
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eikon-canvas-empty {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}

.eikon-canvas-empty[hidden] {
  display: none;
}

.eikon-canvas-empty > .state {
  --fill: var(--bg);
  --edge: var(--line);
  pointer-events: auto;
  padding: var(--space-6);
}

/* ---------- Top-center floating icon control bar ---------- */
.eikon-hud {
  position: fixed;
  top: max(var(--space-4), env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;
  z-index: var(--z-sticky);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  max-width: calc(100vw - var(--space-8));
  pointer-events: none;
}

.eikon-bar,
.eikon-filters {
  --fill: var(--bg);
  --edge: var(--line);
  pointer-events: auto;
}

.eikon-bar {
  box-sizing: border-box;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: var(--space-2) var(--space-3);
  max-width: calc(100vw - var(--space-8));
}

.eikon-hud.folded .eikon-fold-body {
  display: none;
}

.eikon-brand {
  display: flex;
  align-items: center;
  flex: none;
  padding-inline: var(--space-1) var(--space-3);
}

.eikon-wordmark {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text-strong);
}

.eikon-fold-body {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}

.eikon-dock-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-3);
  border-left: var(--stroke) solid var(--line);
}

.eikon-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 30px;
  height: 30px;
  padding-inline: 4px;
}

.eikon-icon-btn:active,
.eikon-fold-btn:active {
  translate: 0 1px;
}

/* Pixel-true stepped icon animations on top-bar controls */
@keyframes eikon-nudge-down {
  0% { translate: 0 2px; }
  34% { translate: 0 1px; }
  67%, 100% { translate: 0 0; }
}

@keyframes eikon-nudge-up {
  0% { translate: 0 -2px; }
  34% { translate: 0 -1px; }
  67%, 100% { translate: 0 0; }
}

@keyframes eikon-dice-roll {
  0% { rotate: 0deg; translate: 0 -2px; }
  25% { rotate: 90deg; translate: 0 -1px; }
  50% { rotate: 180deg; translate: 0 0; }
  75% { rotate: 270deg; translate: 0 0; }
  100% { rotate: 360deg; translate: 0 0; }
}

@keyframes eikon-sun-spin {
  0% { rotate: 0deg; }
  100% { rotate: 90deg; }
}

@keyframes eikon-moon-rock {
  0% { rotate: 0deg; }
  35% { rotate: -22deg; }
  70% { rotate: 10deg; }
  100% { rotate: 0deg; }
}

#filters-toggle:hover > .icon {
  animation: eikon-nudge-down calc(3 * var(--frame, 42ms)) step-end;
}

#open-index:hover > .icon,
#open-guide:hover > .icon,
#captions-btn:hover > .icon {
  animation: eikon-nudge-up calc(3 * var(--frame, 42ms)) step-end;
}

#random-btn:hover > .icon,
#random-btn.is-rolling > .icon {
  animation: eikon-dice-roll calc(5 * var(--frame, 42ms)) steps(4, end);
}

#theme-toggle:hover > .icon {
  animation: eikon-sun-spin 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] #theme-toggle:hover > .icon {
  animation: eikon-moon-rock 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

#hud-fold:hover > .icon {
  animation: eikon-nudge-down calc(3 * var(--frame, 42ms)) step-end;
}

@media (prefers-reduced-motion: reduce) {
  .eikon-icon-btn > .icon,
  .eikon-fold-btn > .icon {
    animation: none !important;
  }
}

.eikon-icon-btn[aria-pressed="false"] {
  color: var(--text-muted);
}

.eikon-filter-badge {
  font-size: 11px;
  padding: 0 4px;
  line-height: 1.3;
}

.eikon-fold-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: var(--space-1);
  padding-left: var(--space-2);
  border-left: var(--stroke) solid var(--line);
}

.eikon-search {
  position: relative;
  width: 176px;
  min-width: 0;
}

.eikon-search-ico {
  position: absolute;
  left: 7px;
  top: 50%;
  translate: 0 -50%;
  color: var(--text-muted);
  pointer-events: none;
}

.eikon-search input {
  box-sizing: border-box;
  width: 100%;
  height: 30px;
  padding: 0 26px 0 28px;
  border: 0;
  background: var(--surface);
  color: var(--text-strong);
  font: inherit;
  outline: none;
}

.eikon-search input::placeholder {
  color: var(--text-muted);
}

.eikon-search input:focus {
  box-shadow: inset 0 0 0 var(--stroke) var(--line-hover);
}

.eikon-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
}

.eikon-sort-btn {
  height: 30px;
  padding-block: 0;
}

.eikon-reset-inline {
  flex: none;
  font-size: var(--text-xs);
}

/* ---------- Collapsible filters panel beneath the top bar ---------- */
.eikon-filters {
  position: relative;
  width: min(676px, calc(100vw - var(--space-8)));
  max-height: calc(100dvh - 104px);
  overflow: visible;
  padding: var(--space-4) var(--space-6);
  transform-origin: var(--arrow-x, 50%) top;
  will-change: transform, opacity;
}

/* Pixel-true stepped pointer arrow aimed at the Filter icon button */
.eikon-filters-arrow {
  position: absolute;
  top: -6px;
  left: var(--arrow-x, 50%);
  width: 12px;
  height: 7px;
  translate: -50% 0;
  pointer-events: none;
}

.eikon-filters-arrow::before,
.eikon-filters-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 7px;
}

.eikon-filters-arrow::before {
  background: var(--line);
  clip-path: polygon(
    5px 0, 7px 0, 7px 1px, 8px 1px, 8px 2px, 9px 2px, 9px 3px, 10px 3px, 10px 4px, 11px 4px, 11px 5px, 12px 5px,
    12px 7px, 0 7px, 0 5px, 1px 5px, 1px 4px, 2px 4px, 2px 3px, 3px 3px, 3px 2px, 4px 2px, 4px 1px, 5px 1px
  );
}

.eikon-filters-arrow::after {
  top: 1px;
  background: var(--bg);
  clip-path: polygon(
    5px 0, 7px 0, 7px 1px, 8px 1px, 8px 2px, 9px 2px, 9px 3px, 10px 3px, 10px 4px, 11px 4px, 11px 6px,
    1px 6px, 1px 4px, 2px 4px, 2px 3px, 3px 3px, 3px 2px, 4px 2px, 4px 1px, 5px 1px
  );
}

.eikon-filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: var(--stroke) solid var(--line);
}

.eikon-facets {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 0.95fr;
  gap: 0;
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
}

.eikon-facet-group {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding-inline: var(--space-4);
  border-left: var(--stroke) solid var(--line);
}

.eikon-facet-group:first-child {
  padding-left: 0;
  border-left: 0;
}

.eikon-facet-group:last-child {
  padding-right: 0;
}

.eikon-facet-group > .t-label {
  margin: 0 0 var(--space-1);
}

.eikon-facet-list {
  display: grid;
  gap: 3px;
}

label.check.eikon-facet {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: var(--space-2);
  padding-block: 3px;
}

.eikon-facet.is-zero {
  color: var(--line);
  mask: var(--dim-mask);
}

.eikon-facet-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eikon-facet-count {
  font: var(--text-xs)/1 var(--font-mono);
  color: var(--text-muted);
  text-align: right;
  min-width: 2ch;
}

/* ---------- Modal sheets (Index table & Reference Guide) ---------- */
.eikon-sheet {
  width: min(1440px, calc(100vw - 32px));
  height: min(920px, calc(100dvh - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  transform-origin: center top;
}

.eikon-sheet.dialog[open] {
  animation: none;
}

.eikon-sheet[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

#guide-dialog[open] {
  grid-template-rows: auto minmax(0, 1fr);
}

.eikon-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: var(--stroke) solid var(--line);
}

.eikon-sheet-title-wrap {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
}

.eikon-index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  border-bottom: var(--stroke) solid var(--line);
  background: var(--surface);
}

.eikon-index-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
}

.eikon-index-search input {
  box-sizing: border-box;
  width: 100%;
  padding-right: 32px;
}

.eikon-index-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.eikon-pill {
  padding: 4px var(--space-3);
  font-size: var(--text-xs);
}

.eikon-pill[aria-pressed="true"] {
  --edge: var(--text-strong);
  --edge-to: var(--text-strong);
  --fill: var(--text-strong);
  --fill-to: var(--text-strong);
  color: var(--bg);
}

.eikon-sheet-body {
  overflow-y: auto;
  padding: var(--space-6);
}

.eikon-index-body {
  padding: 0 var(--space-6) var(--space-6);
}

/* ---------- Index table ---------- */
.eikon-table-wrap {
  overflow-x: visible;
}

.eikon-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.eikon-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  text-align: left;
  padding: var(--space-3) var(--space-3);
  font: var(--text-xs)/1.2 var(--font-mono);
  color: var(--text-muted);
  border-bottom: var(--stroke) solid var(--line);
  white-space: nowrap;
}

.eikon-table td {
  padding: var(--space-3) var(--space-3);
  vertical-align: middle;
  border-bottom: var(--stroke) solid var(--line);
  text-align: left;
}

.eikon-table th:first-child,
.eikon-table td:first-child {
  padding-left: 0;
}

.eikon-table th:last-child,
.eikon-table td:last-child {
  padding-right: 0;
}

.eikon-row {
  cursor: pointer;
}

.eikon-row:hover td {
  background: var(--surface);
}

.eikon-col-cat {
  width: 84px;
  white-space: nowrap;
  font: var(--text-xs)/1.3 var(--font-mono);
  color: var(--text-muted);
}

.eikon-col-plate {
  width: 72px;
}

.eikon-col-title {
  min-width: 340px;
}

.eikon-col-school {
  width: 220px;
  white-space: nowrap;
}

.eikon-col-collection {
  min-width: 260px;
  max-width: 380px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.eikon-mini-mat {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 48px;
  height: 58px;
  padding: var(--space-1);
  background: var(--eikon-mat);
  overflow: hidden;
}

.eikon-mini-fig {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: 0;
  overflow: hidden;
}

.eikon-mini-fig > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 40px;
  max-height: 50px;
  object-fit: contain;
}

.eikon-row-btn {
  display: inline-block;
  text-align: left;
  color: var(--text-strong);
  font-size: var(--text-md);
  line-height: 1.3;
}

.eikon-row-greek {
  display: block;
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.eikon-row-meta {
  display: block;
  margin-top: 3px;
  font: var(--text-xs)/1.3 var(--font-mono);
  color: var(--text-muted);
}

.eikon-row-school {
  display: block;
  color: var(--text);
}

.eikon-row-date {
  display: block;
  margin-top: 2px;
  font: var(--text-xs)/1.3 var(--font-mono);
  color: var(--text-muted);
}

/* ---------- Plate detail dialog (Loupe widened to 1440px + pinned plate stage + mektxt.com flyout glide) ---------- */
.eikon-plate.loupe {
  width: min(1440px, calc(100vw - 32px));
  height: min(920px, calc(100dvh - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: var(--space-6);
  overflow: hidden;
}

/* Override motion.css's 2-frame stepped mek-pop-in so the shared-element flight is silky smooth */
.eikon-plate.dialog[open] {
  animation: none;
}

.eikon-fly-ghost {
  position: fixed;
  inset: auto;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  overflow: hidden;
  transform-origin: top left;
  will-change: transform;
}

.eikon-fly-ghost > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.eikon-fly-ghost::backdrop {
  display: none;
}

.eikon-plate.loupe[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: stretch;
}

.eikon-plate .loupe-subject {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}

.eikon-plate .loupe-info {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--space-2);
  gap: var(--space-4);
}

.eikon-plate-mat {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  padding: var(--space-6);
  background: var(--eikon-mat);
  overflow: hidden;
}

.eikon-plate-fig {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: var(--space-3);
}

.eikon-plate-fig > img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  background: none;
  clip-path: none;
}

.eikon-plate-fig > figcaption {
  margin-top: 0;
  text-align: center;
}

.eikon-plate-greek {
  margin: calc(var(--space-2) * -1) 0 0;
  color: var(--text-muted);
}

.eikon-plate-note,
.eikon-plate-craft {
  margin: 0;
  line-height: 1.55;
  color: var(--text);
}

.eikon-plate-section {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: var(--stroke) solid var(--line);
}

.eikon-plate-section > .t-label {
  margin: 0;
}

.eikon-study-list {
  margin: 0;
  padding-left: var(--space-4);
  display: grid;
  gap: var(--space-2);
  line-height: 1.5;
  color: var(--text);
}

.eikon-plate .loupe-foot {
  padding-top: var(--space-4);
  border-top: var(--stroke) solid var(--line);
}

.eikon-plate .kv,
.eikon-monograms {
  display: grid;
  gap: 0;
}

.eikon-plate .kv > div,
.eikon-monograms > div {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-4);
  padding-block: var(--space-2);
  border-bottom: var(--stroke) solid var(--line);
}

.eikon-plate .kv > div:last-child,
.eikon-monograms > div:last-child {
  border-bottom: 0;
}

.eikon-plate .kv dt,
.eikon-monograms dt {
  color: var(--text-muted);
  white-space: normal;
  line-height: 1.4;
}

.eikon-plate .kv .dots,
.eikon-monograms .dots {
  display: none;
}

.eikon-plate .kv dd,
.eikon-monograms dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  text-align: left;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.eikon-monograms > div {
  grid-template-columns: 220px minmax(0, 1fr);
}

.eikon-related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.eikon-rel-btn {
  --edge: var(--line);
  --edge-to: var(--line-hover);
  --fill: var(--bg);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.eikon-rel-mat {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 40px;
  height: 48px;
  padding: var(--space-1);
  background: var(--eikon-mat);
  overflow: hidden;
}

.eikon-rel-mat .eikon-mini-fig > img {
  max-width: 32px;
  max-height: 40px;
}

.eikon-rel-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.eikon-rel-title {
  color: var(--text-strong);
  font-size: var(--text-xs);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Reference Guide ---------- */
.eikon-guide {
  display: grid;
  gap: var(--space-6);
}

.eikon-guide-intro {
  margin: 0;
  max-width: 68ch;
  line-height: 1.5;
  color: var(--text-muted);
}

.eikon-guide-section {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-5, 20px);
  border-top: var(--stroke) solid var(--line);
}

.eikon-guide-section > .t-label {
  margin: 0;
}

.eikon-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: var(--space-3);
}

.eikon-guide-grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}

.eikon-guide-card {
  --edge: var(--line);
  --fill: var(--bg);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.eikon-guide-diagram {
  display: grid;
  place-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  color: var(--text-strong);
  border-bottom: var(--stroke) solid var(--line);
}

.eikon-guide-diagram > svg {
  width: 100%;
  max-width: 164px;
  height: 76px;
  display: block;
}

.eikon-type-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.eikon-type-glyph {
  width: 44px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text-strong);
}

.eikon-type-glyph > svg {
  width: 44px;
  height: 52px;
  display: block;
}

.eikon-type-head {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.eikon-guide-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.eikon-guide-name {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-strong);
}

.eikon-guide-greek {
  margin: 0;
  font-size: var(--text-xs);
}

.eikon-guide-body {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text);
}

.eikon-guide-link {
  margin-top: auto;
  padding-top: var(--space-1);
  align-self: flex-start;
  font-size: var(--text-xs);
}

/* Monogram badge grid */
.eikon-mono-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-3);
}

.eikon-mono-card {
  --edge: var(--line);
  --fill: var(--bg);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
}

.eikon-mono-badge {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-strong);
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  border: var(--stroke) solid var(--line);
  white-space: nowrap;
}

.eikon-mono-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.eikon-mono-reading {
  font-size: var(--text-xs);
}

/* Colour pigment swatch cards */
.eikon-colour-card {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-3);
}

.eikon-swatch {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border: var(--stroke) solid var(--line-hover);
  box-shadow: inset 0 0 0 2px var(--bg);
}

.eikon-colour-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

/* Materials cross-section stack */
.eikon-layers-diagram {
  --edge: var(--line);
  --fill: var(--surface);
  display: grid;
  gap: 2px;
  padding: var(--space-3);
}

.eikon-layer-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: var(--bg);
  border-left: 3px solid var(--line-hover);
  font-size: var(--text-xs);
  color: var(--text-strong);
}

.eikon-layer-0 { border-left-color: var(--text-muted); }
.eikon-layer-1 { border-left-color: var(--accent, var(--text-strong)); }
.eikon-layer-2 { border-left-color: var(--text-strong); }
.eikon-layer-3 { border-left-color: var(--line-hover); }
.eikon-layer-4 { border-left-color: var(--line); padding-block: var(--space-2); }

.eikon-layer-num,
.eikon-layer-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- Responsive: tablet & 390px phone ---------- */
@media (max-width: 860px) {
  .eikon-hud {
    top: max(var(--space-3), env(safe-area-inset-top));
    max-width: calc(100vw - var(--space-6));
  }

  .eikon-bar,
  .eikon-fold-body {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
  }

  .eikon-bar {
    max-width: calc(100vw - var(--space-6));
  }

  .eikon-brand {
    padding-inline: var(--space-1);
  }

  .eikon-dock-group {
    flex-wrap: wrap;
    justify-content: center;
    padding-inline: var(--space-2);
    border-left: 0;
  }

  .eikon-fold-btn {
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
  }

  .eikon-search {
    width: 180px;
  }

  .eikon-filters {
    width: min(420px, calc(100vw - var(--space-6)));
    max-height: 55dvh;
  }

  .eikon-facets {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .eikon-facet-group {
    padding-inline: 0;
    border-left: 0;
    padding-top: var(--space-3);
    border-top: var(--stroke) solid var(--line);
  }

  .eikon-facet-group:first-child {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 860px) {
  .eikon-plate.loupe {
    height: auto;
    overflow-y: auto;
    padding: var(--space-4);
  }

  .eikon-plate.loupe[open] {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-4);
  }

  .eikon-plate .loupe-subject,
  .eikon-plate .loupe-info {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .eikon-plate-mat {
    height: auto;
    padding: var(--space-4);
  }

  .eikon-plate-fig {
    height: auto;
    grid-template-rows: auto auto;
  }

  .eikon-plate-fig > img {
    max-height: 56dvh;
  }
}

@media (max-width: 640px) {
  .eikon-wordmark {
    font-size: 18px;
  }

  .eikon-col-collection,
  .eikon-col-subject {
    display: none;
  }

  .eikon-sheet {
    height: calc(100dvh - 32px);
  }

  .eikon-sheet-head,
  .eikon-sheet-body,
  .eikon-index-toolbar {
    padding: var(--space-4);
  }

  .eikon-index-body {
    padding: 0 var(--space-4) var(--space-4);
  }

  .eikon-related {
    grid-template-columns: 1fr;
  }

  .eikon-plate .kv > div,
  .eikon-monograms > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
