/* Arkive showcase — Infinum design system tokens (system-font fallbacks, no bundled fonts). */
:root {
  --inf-red: #D82828;
  --inf-red-700: #A11414;
  --inf-red-soft: #FDECEC;
  --inf-ice-soft: #E5EAF2;
  --inf-ice-deep: #4A5A76;
  --inf-ink-900: #0A0A0A;
  --inf-ink-700: #2A2A2A;
  --inf-ink-500: #6B6B6B;
  --inf-ink-400: #9A9A9A;
  --inf-ink-300: #CFCFCF;
  --inf-ink-200: #E8E8E8;
  --inf-ink-100: #F4F4F4;
  --inf-ink-50: #FAFAFA;

  --font-display: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  color: var(--inf-ink-900);
  background: #fff;
}
input, button, select, kbd { font-family: inherit; }
button { padding: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D4D4D4; border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #B4B4B4; background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #fff; overflow: hidden; }

/* ---------------------------------------------------------------- header */
.topbar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; border-bottom: 1px solid var(--inf-ink-200); background: #fff;
}
.menubtn {
  display: none; align-items: center; justify-content: center; width: 34px; height: 34px;
  flex: none; background: transparent; border: none; border-radius: 6px;
  cursor: pointer; color: var(--inf-ink-700);
}
.menubtn:hover { background: var(--inf-ink-100); }
.brand { display: flex; align-items: center; gap: 10px; width: 256px; flex: none; }
.brand svg { flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-name { font: 700 13px/1 var(--font-display); letter-spacing: -0.015em; }
.brand-project {
  font: 400 10px/1 var(--font-mono); color: var(--inf-ink-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.searchbtn {
  flex: 1; max-width: 440px; height: 32px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; background: var(--inf-ink-50); border: 1px solid var(--inf-ink-200);
  border-radius: 6px; cursor: pointer; color: var(--inf-ink-400); text-align: left;
}
.searchbtn:hover { border-color: var(--inf-ink-300); background: #fff; }
.searchbtn span { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd {
  font: 500 10px/1 var(--font-mono); padding: 4px 5px; border: 1px solid var(--inf-ink-200);
  border-radius: 4px; background: #fff; color: var(--inf-ink-500);
}
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-modules {
  font: 700 10px/1 var(--font-display); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--inf-ink-400);
}
.topbar-divider { width: 1px; height: 18px; background: var(--inf-ink-200); }
.topbar-link { font-size: 12px; color: var(--inf-ink-500); text-decoration: none; }
.topbar-link:hover { color: var(--inf-red); }

.body { flex: 1; display: flex; min-height: 0; }
.sidebar-backdrop { display: none; }

/* --------------------------------------------------------------- sidebar */
.sidebar {
  width: 272px; flex: none; border-right: 1px solid var(--inf-ink-200);
  background: var(--inf-ink-50); display: flex; flex-direction: column; min-height: 0;
}
.sidebar-filter { padding: 10px; flex: none; }
.sidebar-filter input {
  width: 100%; height: 30px; padding: 0 10px; font-size: 12.5px;
  border: 1px solid var(--inf-ink-200); border-radius: 6px; background: #fff;
  color: var(--inf-ink-900); outline: none;
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 0 8px 24px; }

.tree-all {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  margin-bottom: 10px; background: transparent; border: none;
  border-left: 2px solid transparent; border-radius: 0 5px 5px 0; cursor: pointer; text-align: left;
}
.tree-all:hover { background: var(--inf-ink-200); }
.tree-all svg { flex: none; }
.tree-all .label { flex: 1; font-size: 12.5px; font-weight: 400; color: var(--inf-ink-700); }
.tree-all .count { font: 400 10px/1 var(--font-mono); color: var(--inf-ink-400); }
.tree-all.is-active { background: var(--inf-red-soft); border-left-color: var(--inf-red); }
.tree-all.is-active .label { font-weight: 600; color: var(--inf-ink-900); }

.tree-module { margin-bottom: 14px; }
.tree-module-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: transparent; border: none; border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0; cursor: pointer; text-align: left;
}
.tree-module-head:hover { background: var(--inf-ink-200); }
.tree-module-head .label {
  font: 700 10px/1 var(--font-display); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--inf-ink-900);
}
.tree-module-head .count { font: 400 10px/1 var(--font-mono); color: var(--inf-ink-500); }
.tree-module-head.is-active { background: var(--inf-red-soft); border-left-color: var(--inf-red); }
.tree-module-head.is-active .label { color: var(--inf-red-700); }

.tree-group { margin-top: 6px; }
.tree-group-head {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 10px;
  background: transparent; border: none; border-radius: 4px; cursor: pointer; text-align: left;
}
.tree-group-head:hover { background: var(--inf-ink-200); }
.tree-group-head .label { font: 500 10.5px/1 var(--font-mono); color: var(--inf-ink-500); letter-spacing: 0.02em; }
.tree-group-head .count { font: 400 10px/1 var(--font-mono); color: var(--inf-ink-500); }
.tree-group-head.is-active { background: var(--inf-red-soft); }
.tree-group-head.is-active .label { color: var(--inf-red-700); }

.tree-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 10px;
  background: transparent; border: none; border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0; cursor: pointer; text-align: left;
}
.tree-item:hover { background: var(--inf-ink-200); }
.tree-item .thumb {
  width: 26px; height: 19px; flex: none; background: #fff; border: 1px solid var(--inf-ink-200);
  border-radius: 3px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tree-item .thumb img { max-width: 22px; max-height: 15px; object-fit: contain; display: block; }
.tree-item .label {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 400; color: var(--inf-ink-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-item .badge { font: 500 9.5px/1 var(--font-mono); color: var(--inf-ink-400); }
.tree-item.is-active { background: var(--inf-red-soft); border-left-color: var(--inf-red); }
.tree-item.is-active .label { font-weight: 600; color: var(--inf-ink-900); }

.tree-empty { padding: 24px 10px; font-size: 12px; color: var(--inf-ink-400); line-height: 1.5; }

/* ------------------------------------------------------------------ main */
.main { flex: 1; display: flex; min-width: 0; min-height: 0; }

/* -------------------------------------------------------------- overview */
.overview { flex: 1; overflow-y: auto; min-width: 0; }
.ov-head {
  padding: 28px 32px 12px; border-bottom: 1px solid var(--inf-ink-200);
  display: flex; align-items: flex-end; gap: 20px;
  position: sticky; top: 0; background: #fff; z-index: 5;
}
.ov-head-text { flex: 1; min-width: 0; }
.ov-kind-row { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.ov-kind {
  font: 700 10px/1 var(--font-display); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--inf-red);
}
.ov-in { font: 400 10px/1 var(--font-mono); color: var(--inf-ink-300); }
.ov-module-link {
  background: transparent; border: none; cursor: pointer;
  font: 400 10.5px/1 var(--font-mono); color: var(--inf-ink-500);
  text-decoration: underline; text-underline-offset: 3px;
}
.ov-module-link:hover { color: var(--inf-red); }
.ov-title { margin: 0 0 6px; font: 700 30px/1.05 var(--font-display); letter-spacing: -0.02em; }
.ov-meta { margin: 0 0 14px; font-size: 12.5px; color: var(--inf-ink-500); }

.viewtoggle { display: flex; gap: 2px; padding: 2px; background: var(--inf-ink-100); border-radius: 6px; margin-bottom: 14px; }
.viewtoggle button {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px;
  border: none; border-radius: 4px; cursor: pointer; font-size: 11.5px; font-weight: 500;
  background: transparent; color: var(--inf-ink-500);
}
.viewtoggle button.is-active { background: #fff; color: var(--inf-ink-900); }

.cards { padding: 24px 32px 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; padding: 0; background: #fff;
  border: 1px solid var(--inf-ink-200); border-radius: 8px; overflow: hidden;
  cursor: pointer; text-align: left;
}
.card:hover { border-color: var(--inf-ink-900); }
.card-shot {
  height: 132px; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: var(--inf-ink-50); border-bottom: 1px solid var(--inf-ink-200);
}
.card-shot img { max-width: 100%; max-height: 100px; object-fit: contain; display: block; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.card-name { font: 600 13px/1.2 var(--font-body); color: var(--inf-ink-900); }
.card-file {
  font: 400 10.5px/1.3 var(--font-mono); color: var(--inf-ink-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chiprow { display: flex; flex-wrap: wrap; gap: 4px; }

.chip { font: 500 9.5px/1 var(--font-mono); padding: 4px 6px; border-radius: 3px; background: var(--inf-ink-100); color: var(--inf-ink-500); }
.chip--group { background: var(--inf-ink-900); color: #fff; }
.chip--composable { background: var(--inf-red-soft); color: var(--inf-red-700); }
.chip--view { background: var(--inf-ice-soft); color: var(--inf-ice-deep); }
.chip--module { background: var(--inf-ice-soft); color: var(--inf-ice-deep); }

.rows { padding: 16px 32px 48px; --group-col: 0.7fr; }
.rows.is-all { --group-col: 1.4fr; }
.rows-head {
  display: grid; grid-template-columns: 56px 1.4fr var(--group-col) 2fr 1.1fr 70px; gap: 16px;
  padding: 0 12px 8px; font: 700 9.5px/1 var(--font-display); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--inf-ink-400); border-bottom: 1px solid var(--inf-ink-200);
}
.rows-head .right { text-align: right; }
.rows-head .clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row {
  width: 100%; display: grid; grid-template-columns: 56px 1.4fr var(--group-col) 2fr 1.1fr 70px;
  gap: 16px; align-items: center; padding: 8px 12px; background: transparent;
  border: none; border-bottom: 1px solid var(--inf-ink-100); cursor: pointer; text-align: left;
}
.row:hover { background: var(--inf-ink-50); }
.row .shot {
  width: 52px; height: 34px; background: var(--inf-ink-50); border: 1px solid var(--inf-ink-200);
  border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.row .shot img { max-width: 44px; max-height: 26px; object-fit: contain; display: block; }
.row .name { font-size: 13px; font-weight: 600; color: var(--inf-ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .group { font-size: 12px; color: var(--inf-ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .pkg { font: 400 11px/1 var(--font-mono); color: var(--inf-ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tags { font: 400 11px/1 var(--font-mono); color: var(--inf-ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .vars { font: 500 11px/1 var(--font-mono); color: var(--inf-ink-900); text-align: right; }
.row .vars.none { color: var(--inf-ink-300); }

/* ---------------------------------------------------------------- detail */
.detail { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.detail-head { flex: none; padding: 16px 24px 14px; border-bottom: 1px solid var(--inf-ink-200); }
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font: 400 10.5px/1 var(--font-mono); color: var(--inf-ink-400); margin-bottom: 8px;
}
.crumbs button { background: transparent; border: none; cursor: pointer; font: inherit; color: var(--inf-ink-400); }
.crumbs button:hover { color: var(--inf-red); }
.crumbs .here { color: var(--inf-ink-700); }
.detail-head-row { display: flex; align-items: flex-end; gap: 16px; }
.detail-head-text { flex: 1; min-width: 0; }
.detail-title { margin: 0 0 7px; font: 700 26px/1.05 var(--font-display); letter-spacing: -0.02em; }
.detail-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-file { font: 400 11px/1 var(--font-mono); color: var(--inf-ink-400); margin-left: 4px; }
.detail-actions { display: flex; gap: 8px; flex: none; }
.btn-copy {
  height: 32px; display: flex; align-items: center; gap: 7px; padding: 0 12px;
  background: #fff; border: 1.5px solid var(--inf-ink-900); border-radius: 5px;
  font-size: 12px; font-weight: 600; color: var(--inf-ink-900); cursor: pointer;
}
.btn-copy:hover { background: var(--inf-ink-900); color: #fff; }
.btn-figma {
  height: 32px; display: flex; align-items: center; gap: 7px; padding: 0 12px;
  background: var(--inf-red); border: 1.5px solid var(--inf-red); border-radius: 5px;
  font-size: 12px; font-weight: 600; color: #fff; text-decoration: none;
}
.btn-figma:hover { background: var(--inf-red-700); border-color: var(--inf-red-700); }

.detail-body { flex: 1; display: flex; min-height: 0; }

/* canvas */
.canvas {
  flex: 1; position: relative; min-width: 0; overflow: hidden; background: #FCFCFC;
  background-image: radial-gradient(#E4E4E4 1px, transparent 1px); background-size: 16px 16px;
}
.canvas-solo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage { transform-origin: center center; }
.sheet { position: relative; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10), 0 10px 30px rgba(0, 0, 0, 0.07); }
.sheet img { display: block; max-width: none; }
.phone { padding: 11px; background: #111; border-radius: 34px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18); }
.phone-screen { background: #fff; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.phone-status {
  height: 26px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font: 600 9px/1 var(--font-body); color: #111;
}
.phone-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.phone-body img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.canvas-compare {
  position: absolute; inset: 0; overflow: auto; padding: 40px;
  display: flex; gap: 28px; align-items: center; justify-content: safe center;
}
.compare-item { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.compare-shot { background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.06); max-width: 340px; }
.compare-shot img { display: block; max-width: 340px; height: auto; }
.compare-caption { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.compare-caption .label { font: 600 11.5px/1 var(--font-mono); color: var(--inf-ink-900); }
.compare-caption .sub { font: 400 10px/1 var(--font-mono); color: var(--inf-ink-400); }

.zoombar {
  position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px;
  padding: 3px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--inf-ink-200);
  border-radius: 7px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.zoombar button {
  height: 26px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 4px; cursor: pointer; color: var(--inf-ink-700);
}
.zoombar button:hover { background: var(--inf-ink-100); }
.zoombar .icon { width: 26px; }
.zoombar .text { padding: 0 8px; font: 500 11px/1 var(--font-mono); }
.zoombar .pct { min-width: 46px; text-align: center; font: 500 11px/1 var(--font-mono); color: var(--inf-ink-700); }
.zoombar .divider { width: 1px; height: 16px; background: var(--inf-ink-200); margin: 0 3px; }

.dimbadge {
  position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px;
  padding: 5px 9px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--inf-ink-200);
  border-radius: 7px; font: 500 10.5px/1 var(--font-mono); color: var(--inf-ink-500);
}
.canvas-hint {
  position: absolute; left: 16px; top: 16px;
  font: 400 10px/1.4 var(--font-mono); color: var(--inf-ink-400); pointer-events: none;
}

/* right panel */
.panel { width: 296px; flex: none; border-left: 1px solid var(--inf-ink-200); background: #fff; overflow-y: auto; min-height: 0; }
.panel-section { padding: 16px; border-bottom: 1px solid var(--inf-ink-200); }
.panel-section:last-child { border-bottom: none; padding-bottom: 32px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-title {
  font: 700 9.5px/1 var(--font-display); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--inf-ink-900);
}
.panel-count { font: 400 10px/1 var(--font-mono); color: var(--inf-ink-400); }

.stategroup { margin-bottom: 12px; }
.stategroup-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stategroup-label { font: 500 10.5px/1 var(--font-mono); color: var(--inf-ink-500); }
.btn-compare {
  display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px;
  background: #fff; border: 1px solid var(--inf-ink-200); border-radius: 4px;
  cursor: pointer; font: 500 9.5px/1 var(--font-mono); color: var(--inf-ink-500);
}
.btn-compare.is-active { background: var(--inf-ink-900); border-color: var(--inf-ink-900); color: #fff; }
.statechips { display: flex; flex-wrap: wrap; gap: 4px; }
.statechip {
  padding: 6px 9px; background: #fff; border: 1px solid var(--inf-ink-200); border-radius: 5px;
  cursor: pointer; font: 500 11px/1 var(--font-mono); color: var(--inf-ink-700);
}
.statechip.is-active { background: var(--inf-ink-900); border-color: var(--inf-ink-900); color: #fff; }

.hintbox {
  padding: 10px; background: var(--inf-ink-50); border: 1px solid var(--inf-ink-200);
  border-radius: 6px; font-size: 11px; line-height: 1.5; color: var(--inf-ink-500);
}
.hintbox code {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--inf-ink-900);
  background: transparent; padding: 0;
}

.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.switchrow .label { font-size: 12px; color: var(--inf-ink-700); }
.switch {
  width: 34px; height: 20px; flex: none; padding: 2px; background: var(--inf-ink-300);
  border: none; border-radius: 999px; cursor: pointer; display: flex; justify-content: flex-start;
}
.switch.is-on { background: var(--inf-red); justify-content: flex-end; }
.switch .knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); display: block; }

.framerow { display: flex; gap: 4px; }
.framerow.is-off { opacity: 0.4; }
.framebtn {
  flex: 1; padding: 6px 4px; background: #fff; border: 1px solid var(--inf-ink-200);
  border-radius: 5px; cursor: pointer; font: 500 10px/1.2 var(--font-mono); color: var(--inf-ink-500);
}
.framerow.is-off .framebtn { cursor: default; }
.framebtn.is-active { background: var(--inf-ink-900); border-color: var(--inf-ink-900); color: #fff; }
.panel-note { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--inf-ink-400); }

.metarow { display: flex; flex-direction: column; gap: 3px; padding: 7px 0; border-bottom: 1px solid var(--inf-ink-100); }
.metarow .label {
  font: 700 9px/1 var(--font-display); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--inf-ink-400);
}
.metarow .value { font: 400 11px/1.45 var(--font-mono); color: var(--inf-ink-900); word-break: break-all; }

.figma-card { padding: 12px; border: 1px solid var(--inf-ink-200); border-radius: 7px; }
.figma-card .blurb { font-size: 11.5px; color: var(--inf-ink-500); line-height: 1.5; margin-bottom: 9px; }
.figma-card .node { font: 400 10px/1.4 var(--font-mono); color: var(--inf-ink-400); word-break: break-all; margin-bottom: 10px; }
.figma-card a {
  display: flex; align-items: center; justify-content: center; height: 30px;
  background: var(--inf-red); border-radius: 5px; font-size: 12px; font-weight: 600;
  color: #fff; text-decoration: none;
}
.figma-card a:hover { background: var(--inf-red-700); }
.figma-none {
  padding: 12px; background: var(--inf-ink-50); border: 1px dashed var(--inf-ink-300);
  border-radius: 7px; font-size: 11.5px; line-height: 1.5; color: var(--inf-ink-400);
}
.figma-none code {
  font-family: var(--font-mono); font-size: 10.5px; color: inherit;
  background: transparent; padding: 0;
}

/* --------------------------------------------------------------- palette */
.palette-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 10, 0.34);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 1000;
}
.palette {
  width: min(620px, 92vw); background: #fff; border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); overflow: hidden;
  display: flex; flex-direction: column; max-height: 64vh;
}
.palette-head {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px;
  flex: none; border-bottom: 1px solid var(--inf-ink-200);
}
.palette-head input {
  flex: 1; height: 100%; border: none; outline: none; font-size: 14.5px;
  color: var(--inf-ink-900); background: transparent;
}
.palette-list { flex: 1; overflow-y: auto; padding: 6px; }
.pal-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  background: transparent; border: none; border-radius: 6px; cursor: pointer; text-align: left;
}
.pal-item.is-active { background: var(--inf-ink-100); }
.pal-item .thumb {
  width: 38px; height: 26px; flex: none; background: var(--inf-ink-50);
  border: 1px solid var(--inf-ink-200); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pal-item .thumb img { max-width: 32px; max-height: 20px; object-fit: contain; display: block; }
.pal-item .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pal-item .name { font-size: 13px; font-weight: 600; color: var(--inf-ink-900); }
.pal-item .sub {
  font: 400 10.5px/1 var(--font-mono); color: var(--inf-ink-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pal-item .module { font: 500 9.5px/1 var(--font-mono); padding: 4px 6px; border-radius: 3px; background: var(--inf-ink-100); color: var(--inf-ink-500); flex: none; }
.palette-empty { padding: 28px 14px; text-align: center; font-size: 12.5px; color: var(--inf-ink-400); }
.palette-foot {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  border-top: 1px solid var(--inf-ink-200); background: var(--inf-ink-50);
  font: 400 10.5px/1 var(--font-mono); color: var(--inf-ink-400);
}

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  background: var(--inf-ink-900); border-radius: 7px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); z-index: 1200;
}
.toast span { font: 500 12px/1 var(--font-mono); color: #fff; }

/* ----------------------------------------------------------------- error */
.load-error { padding: 48px; font-size: 13px; line-height: 1.6; color: var(--inf-ink-500); max-width: 560px; }
.load-error code { font-family: var(--font-mono); font-size: 12px; background: var(--inf-ink-100); padding: 2px 5px; border-radius: 4px; }

/* ------------------------------------------------------------ responsive */
/* Tablets: shrink the fixed columns before the drawer kicks in. */
@media (max-width: 1080px) {
  .brand { width: auto; }
  .panel { width: 256px; }
}

/* Phones and small tablets: the sidebar becomes an off-canvas drawer behind the
   topbar menu button, the detail view stacks vertically, and the row view keeps
   only thumb / name / variants. */
@media (max-width: 840px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .menubtn { display: flex; }
  .brand-project { display: none; }
  .topbar-right { display: none; }
  .searchbtn { max-width: none; }
  #search-kbd { display: none; }

  .sidebar {
    position: fixed; top: 52px; bottom: 0; left: 0; z-index: 900;
    width: min(320px, 85vw);
    transform: translateX(-102%); transition: transform 0.18s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop {
    display: block; position: fixed; top: 52px; right: 0; bottom: 0; left: 0;
    z-index: 850; background: rgba(10, 10, 10, 0.34);
  }

  .ov-head { padding: 16px 16px 10px; }
  .ov-title { font-size: 22px; }
  .cards { padding: 16px 16px 40px; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }

  .rows { padding: 8px 8px 40px; }
  .rows-head, .row { grid-template-columns: 56px 1fr 60px; gap: 10px; }
  .rows-head span:nth-child(3), .rows-head span:nth-child(4), .rows-head span:nth-child(5),
  .row .group, .row .pkg, .row .tags { display: none; }

  .detail-head { padding: 12px 16px; }
  .detail-title { font-size: 20px; }
  .detail-head-row { flex-wrap: wrap; align-items: flex-start; }
  .detail-actions { width: 100%; flex-wrap: wrap; }

  .detail-body { display: block; overflow-y: auto; }
  .canvas { height: 52vh; height: 52dvh; min-height: 300px; }
  .panel { width: auto; border-left: none; border-top: 1px solid var(--inf-ink-200); overflow-y: visible; }

  .canvas-compare { padding: 20px; gap: 18px; }
  .compare-shot, .compare-shot img { max-width: min(340px, 78vw); }

  .palette-overlay { padding-top: 5vh; }
  .palette { width: 94vw; max-height: 80vh; max-height: 80dvh; }
  .palette-foot { display: none; }
}
