/* ============================================================
   Token Dossier
   monochrome case-file console, light + dark
   ============================================================ */

:root {
  --ink: #1c1c1c;
  --ink-2: #4a4a4a;
  --ink-3: #7d7d7d;
  --paper: #f7f6f3;
  --surface: #fff;
  --rule: #e2e0da;
  --wash: #efeeea;
  --accent: #1c1c1c;
  --accent-ink: #fff;
  --ok: #2f6b4f;
  --warn: #8a6414;
  --bad: #b8372c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --r-sm: 6px;
  --r-md: 10px;
  color-scheme: light;

  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Hiragino Mincho ProN", "Yu Mincho", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Noto Sans Mono CJK JP", monospace;
}

:root[data-theme="dark"] {
  --ink: #f4f4f5;
  --ink-2: #b9b9c0;
  --ink-3: #7c7c86;
  --paper: #0a0a0c;
  --surface: #131316;
  --rule: #242429;
  --wash: #17171b;
  --accent: #f4f4f5;
  --accent-ink: #0a0a0c;
  --ok: #7dd3a8;
  --warn: #e0b45f;
  --bad: #f08a7e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.18s ease, color 0.18s ease;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.shell {
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 24px;
}

/* 結果表示中はページ全体をスクロールさせ、ペインは伸ばす。
   入れ子スクロールでホイールを奪わないようにする。 */
.shell.has-results .console {
  padding-bottom: 14px;
}

.shell.has-results .editor,
.shell.has-results .console__row {
  display: none;
}

.shell.has-results .console__head {
  margin-bottom: 0;
}

.console__toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: none;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.console__toggle:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.shell.has-results .console__toggle {
  display: inline-flex;
}

.shell.has-results.is-editing .editor,
.shell.has-results.is-editing .console__row {
  display: revert;
}

.shell.has-results.is-editing .console {
  padding-bottom: 20px;
}

.shell.has-results.is-editing .console__head {
  margin-bottom: 14px;
}

/* ---------------- nav ---------------- */

.gnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding: 12px 0;
  border-bottom: 2px solid var(--ink);
}

.gnav .brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.gnav .links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.gnav .links a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-decoration: none;
}

.gnav .links a:hover {
  color: var(--ink);
  background: var(--wash);
}

.gnav .links a[aria-current="page"] {
  color: var(--ink);
  background: var(--wash);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.gnav .spacer {
  flex: 1;
}

.stats {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat i {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.stat b.is-ok {
  color: var(--ok);
}
.stat b.is-warn {
  color: var(--warn);
}
.stat b.is-bad {
  color: var(--bad);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.icon:hover {
  background: var(--wash);
}

.themebtn {
  position: relative;
  overflow: hidden;
}

.themebtn svg {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  transition: transform 0.38s cubic-bezier(0.2, 0.7, 0.3, 1.25), opacity 0.22s ease;
}

:root[data-theme="light"] .themebtn .moon,
:root[data-theme="dark"] .themebtn .sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

:root[data-theme="light"] .themebtn .sun {
  opacity: 1;
  transform: none;
}

:root[data-theme="dark"] .themebtn .moon {
  opacity: 1;
  transform: none;
}

/* ---------------- console ---------------- */

.console {
  flex-shrink: 0;
  padding: 26px 0 20px;
  border-bottom: 1px solid var(--rule);
}

.console__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  margin-bottom: 14px;
}

.console h1 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.console__head p {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.console__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-3);
}

.console__tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
}

.editor {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.editor:focus-within {
  border-color: var(--ink-3);
}

.editor__gutter {
  flex: none;
  width: 36px;
  padding: 12px 0;
  border-right: 1px solid var(--rule);
  background: var(--wash);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 24px;
  text-align: right;
  user-select: none;
}

.editor__gutter span {
  display: block;
  padding-right: 8px;
}

.editor__input {
  flex: 1;
  min-width: 0;
  min-height: 120px;
  max-height: 40vh;
  padding: 12px 14px;
  border: 0;
  background: none;
  outline: none;
  resize: vertical;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
  letter-spacing: 0.01em;
  caret-color: var(--ink);
}

.editor__input::placeholder {
  color: var(--ink-3);
  opacity: 0.75;
}

.console__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex: none;
  width: 34px;
  height: 19px;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--wash);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch__thumb {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch__track {
  background: var(--ink);
  border-color: var(--ink);
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(15px);
  background: var(--paper);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch__text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.35;
}

.switch__text em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.6;
}

.btn.primary {
  min-width: 132px;
  background: var(--ink);
  color: var(--paper);
}

.btn.primary:hover:not(:disabled) {
  opacity: 0.85;
}

.btn.ghost {
  background: none;
  border-color: var(--rule);
  color: var(--ink-2);
}

.btn.ghost:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn.tiny {
  padding: 5px 11px;
  border-color: var(--rule);
  background: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.btn.tiny:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn__spin {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-busy .btn__spin {
  display: inline-block;
}

.status {
  min-height: 18px;
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.status.is-error {
  color: var(--bad);
}

/* progress */

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.progress__track {
  position: relative;
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--wash);
  box-shadow: inset 0 0 0 1px var(--rule);
}

.progress__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--ink);
  transition: width 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.progress[data-state="done"] .progress__fill {
  background: var(--ok);
}

.progress[data-state="warn"] .progress__fill {
  background: var(--warn);
}

.progress__value {
  flex: none;
  min-width: 74px;
  font-size: 10.5px;
  text-align: right;
  color: var(--ink-3);
}

/* ---------------- results: master / detail ---------------- */

.results {
  display: grid;
  grid-template-columns: minmax(264px, 340px) minmax(0, 1fr);
  flex: 1;
  align-items: start;
  animation: rise 0.24s cubic-bezier(0.2, 0.7, 0.3, 1.05);
}

/* デスクトップでは一覧を画面に固定し、リスト側だけをスクロールさせる。
   右の詳細はページスクロール。 */
.list {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  max-height: 100dvh;
  padding: 14px 0 10px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  z-index: 2;
}

/* 結果表示中はアプリ型レイアウト: 画面高に固定して両ペインを内部スクロール */
@media (min-width: 901px) {
  .shell.has-results {
    height: 100dvh;
    overflow: hidden;
  }

  .shell.has-results .results {
    flex: 1;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
  }

  .shell.has-results .list {
    position: static;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  .shell.has-results .detail {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-width: thin;
  }

  .shell.has-results .foot {
    display: none;
  }
}

.list__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 16px;
  padding-bottom: 10px;
}

.list__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 4px 0;
  border-top: 1px solid var(--rule);
}

.list__hint {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-3);
}

.search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--wash);
}

.search:focus-within {
  border-color: var(--ink-3);
}

.search svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search kbd {
  flex: none;
  font-size: 10px;
  padding: 0 4px;
}

.count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.rows {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 0 8px;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  scrollbar-width: thin;
}

.rows:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.rows li {
  border-bottom: 1px solid var(--rule);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 16px 10px 13px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.row:hover {
  background: var(--wash);
}

.row[aria-current="true"] {
  border-left-color: var(--accent);
  background: var(--surface);
}

.row__avatar {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--wash);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
}

.row__avatar > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  user-select: none;
}

.row__avatar > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row__body {
  flex: 1;
  min-width: 0;
}

.row__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.row__name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row__flag {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.row__flag[data-kind="warn"] {
  background: var(--warn);
}
.row__flag[data-kind="bad"] {
  background: var(--bad);
}
.row__flag[data-kind="mute"] {
  background: var(--ink-3);
}

.row__sub {
  overflow: hidden;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rows .none {
  padding: 28px 16px;
  font-size: 13px;
  color: var(--ink-3);
  list-style: none;
}

/* detail */

.detail {
  min-height: 0;
  padding: 18px 0 56px 28px;
}

.detail__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.detail__bar .spacer {
  flex: 1;
}

.detail__time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.dossier {
  animation: rise 0.26s cubic-bezier(0.2, 0.7, 0.3, 1.05);
}

.ident {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.ident__avatar {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--wash);
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink-3);
}

.ident__avatar > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  user-select: none;
}

.ident__avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ident__who {
  min-width: 0;
  flex: 1;
}

.ident h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ident__handle {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  vertical-align: 3px;
}

.tag.soft {
  border-color: var(--rule);
  color: var(--ink-3);
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ok);
}

.verdict[data-kind="warn"] {
  color: var(--warn);
}
.verdict[data-kind="bad"] {
  color: var(--bad);
}
.verdict[data-kind="mute"] {
  color: var(--ink-3);
}

/* facts table */

.facts {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px minmax(0, 1fr);
  gap: 0 14px;
  margin: 20px 0 0;
  padding: 4px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.facts dt,
.facts dd {
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  min-width: 0;
}

.facts dt:nth-of-type(-n + 2),
.facts dt:nth-of-type(-n + 2) + dd {
  border-top: 0;
}

.facts dt {
  color: var(--ink-3);
  font-size: 11.5px;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.copyish {
  cursor: copy;
  border-radius: 2px;
}

.copyish:hover {
  color: var(--ink-3);
}

/* スポイラー: 触れると中身が出て、クリックでコピー */
.spoiler {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 1px 7px;
  border: 1px dashed var(--rule);
  border-radius: 4px;
  background: var(--wash);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.spoiler:hover,
.spoiler:focus-visible,
.spoiler.is-open {
  border-color: var(--ink-3);
  border-style: solid;
}

.spoiler__text {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.spoiler[data-open="false"] .spoiler__text {
  filter: blur(4px);
  opacity: 0.55;
  user-select: none;
}

.spoiler:hover .spoiler__text,
.spoiler:focus-visible .spoiler__text,
.spoiler[data-open="true"] .spoiler__text {
  filter: none;
  opacity: 1;
  user-select: text;
}

.spoiler__text[data-meta="true"] {
  color: var(--ink-3);
  font-style: italic;
}

.spoiler__icon {
  flex: none;
  width: 12px;
  height: 12px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.spoiler:hover .spoiler__icon,
.spoiler:focus-visible .spoiler__icon {
  opacity: 1;
}

.spoiler:hover .spoiler__icon[data-done="true"],
.spoiler.is-copied .spoiler__icon {
  opacity: 1;
  color: var(--ok);
}

/* sections */

.block {
  margin-top: 26px;
}

.block > h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.block > h3 span {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-3);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badges img {
  display: block;
  flex: none;
  width: 30px;
  height: 30px;
  object-fit: contain;
  transition: transform 0.14s ease;
}

.badges img:hover {
  transform: translateY(-2px);
}

.badges .none {
  font-size: 12.5px;
  color: var(--ink-3);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  color: var(--ink-3);
}

.legend span::before {
  content: "•";
  margin-right: 5px;
  color: var(--ink-2);
}

/* restriction panel */

.panel {
  margin-top: 26px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel[data-kind="ok"] {
  border-left-color: var(--ok);
}

.panel[data-kind="warn"] {
  border-left-color: var(--warn);
}

.panel[data-kind="bad"] {
  border-left-color: var(--bad);
}

.panel__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
}

.panel__head span:last-child {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
}

.signals {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.signal {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.45;
}

.signal__sev {
  height: fit-content;
  margin-top: 1px;
  padding: 1px 0;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--ink-3);
}

.signal__sev[data-sev="critical"],
.signal__sev[data-sev="high"] {
  color: var(--bad);
}

.signal__sev[data-sev="medium"] {
  color: var(--warn);
}

.signal__sev[data-sev="low"],
.signal__sev[data-sev="ok"] {
  color: var(--ok);
}

.signal b {
  display: block;
  font-weight: 650;
}

.signal span {
  color: var(--ink-2);
}

/* raw */

details.raw {
  margin-top: 22px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

details.raw summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
}

details.raw summary::-webkit-details-marker {
  display: none;
}

details.raw summary::before {
  content: "+";
  font-size: 13px;
  line-height: 1;
}

details.raw[open] summary::before {
  content: "−";
}

details.raw summary:hover {
  color: var(--ink);
}

pre.code {
  max-height: 280px;
  margin: 10px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: #0a0a0c;
  color: #e8e8e8;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.flag {
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}

/* empty + footer */

.empty {
  display: grid;
  flex: 1;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 40px 0 60px;
  text-align: center;
  color: var(--ink-3);
}

.empty__art {
  width: 104px;
  height: 104px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.empty__lead {
  max-width: 44ch;
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.empty__sub {
  max-width: 48ch;
  margin: 0;
  font-size: 12px;
}

.foot {
  flex-shrink: 0;
  padding: 16px 0 40px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.foot p {
  max-width: 82ch;
  margin: 0;
}

.foot__meta {
  margin-top: 3px !important;
  font-family: var(--mono);
  font-size: 10.5px;
}

/* toast */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 50;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------- catalogue ---------------- */

.catwrap {
  flex: 1;
  padding: 26px 0 64px;
}

.catwrap > h1 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.catwrap > p {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.catsec {
  margin-top: 30px;
}

.catsec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 9px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.catsec__head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.catsec__head p {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.catgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.catitem {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.catitem img {
  flex: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.catitem figcaption {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.catitem b {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.catitem span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .results {
    grid-template-columns: 1fr;
    flex: none;
    gap: 0;
  }

  .list {
    padding-top: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .rows {
    max-height: 46vh;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  .detail {
    padding: 20px 0 48px;
    height: auto;
    overflow-y: visible;
  }

  .list {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .shell {
    min-height: 100dvh;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 0 16px;
  }

  .gnav {
    row-gap: 8px;
  }

  .gnav .spacer {
    display: none;
  }

  .gnav .links {
    order: 2;
  }

  .themebtn {
    order: 3;
    margin-left: auto;
  }

  .stats {
    order: 4;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--rule);
  }

  .facts {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .facts dt:nth-of-type(-n + 2),
  .facts dt:nth-of-type(-n + 2) + dd {
    border-top: 1px solid var(--rule);
  }

  .facts dt:first-of-type,
  .facts dt:first-of-type + dd {
    border-top: 0;
  }

  .ident {
    flex-wrap: wrap;
  }

  .console__hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
