:root {
  color-scheme: light;
  --canvas: #e9e1cd;
  --paper: #f5efdf;
  --paper-bright: #fffaf0;
  --panel: #d8ceb4;
  --ink: #171914;
  --ink-soft: #30352f;
  --muted: #66685d;
  --navy: #152642;
  --blue: #2850c9;
  --orange: #f24a24;
  --green: #1c765b;
  --red: #a72f3e;
  --line: rgba(23, 25, 20, 0.24);
  --line-soft: rgba(23, 25, 20, 0.12);
  --line-light: rgba(245, 239, 223, 0.28);
  --display: "Futura", "Avenir Next", "DIN Alternate", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Menlo", "Monaco", "Cascadia Mono", monospace;
  --motion: cubic-bezier(0.22, 1, 0.36, 1);
  --press: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  z-index: 110;
  inset: 0;
  pointer-events: none;
  background-image: url("./grain.svg");
  mix-blend-mode: multiply;
  opacity: 0.045;
}

body.drawer-open {
  overflow: hidden;
}

::selection {
  background: var(--orange);
  color: var(--paper-bright);
}

[hidden] {
  display: none !important;
}

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

button,
select,
summary {
  cursor: pointer;
}

button {
  border: 0;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

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

.clipboard-fallback {
  position: fixed;
  inset: 0 auto auto 0;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 14px;
  left: 14px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transition: transform 480ms var(--motion);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 12px;
  display: flex;
  width: calc(100% - 24px);
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 12px 0;
  padding: 0 12px 0 18px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--orange);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--paper-bright);
  background: var(--orange);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-copy small {
  color: rgba(245, 239, 223, 0.62);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.topbar-actions,
.live-state,
.icon-button {
  display: flex;
  align-items: center;
}

.topbar-actions {
  position: relative;
  z-index: 1;
  gap: 12px;
}

.live-state {
  min-height: 36px;
  gap: 9px;
  padding: 0 12px;
  border-left: 1px solid rgba(245, 239, 223, 0.28);
  color: rgba(245, 239, 223, 0.78);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper-bright);
  border-radius: 50%;
  background: var(--orange);
}

.live-state.connected .live-dot {
  background: #50c796;
}

.live-state.error .live-dot {
  background: #ff6b73;
}

.icon-button {
  min-height: 42px;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--paper-bright);
  background: var(--paper-bright);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion);
}

.icon-button:hover {
  transform: translateY(-2px);
  background: var(--orange);
  color: var(--paper-bright);
}

.button-glyph {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}

.icon-button.loading .button-glyph {
  animation: spin 820ms var(--press) infinite;
}

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

.app-shell {
  display: grid;
  min-height: calc(100dvh - 106px);
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.atlas-sidebar {
  position: sticky;
  top: 94px;
  align-self: start;
  height: calc(100dvh - 106px);
  overflow: auto;
  padding: 24px 20px 28px;
  border: 2px solid var(--ink);
  background: var(--navy);
  color: var(--paper-bright);
  scrollbar-color: var(--orange) transparent;
  scrollbar-width: thin;
}

.atlas-sidebar::-webkit-scrollbar,
.drawer-scroll::-webkit-scrollbar {
  width: 7px;
}

.atlas-sidebar::-webkit-scrollbar-thumb,
.drawer-scroll::-webkit-scrollbar-thumb {
  background: var(--orange);
}

.sidebar-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line-light);
}

.sidebar-section:first-child {
  padding-top: 0;
}

.panel-code,
.eyebrow,
.drawer-category {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.panel-code {
  margin: 0 0 8px;
  color: var(--orange);
}

.sidebar-title {
  margin: 0;
  color: rgba(245, 239, 223, 0.72);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.primary-count {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 11px;
}

.primary-count strong {
  color: var(--paper-bright);
  font-family: var(--display);
  font-size: 64px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.primary-count span {
  max-width: 62px;
  padding-bottom: 3px;
  color: rgba(245, 239, 223, 0.58);
  font-size: 10px;
  line-height: 1.35;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
  border-block: 1px solid var(--line-light);
}

.summary-grid div {
  padding: 12px 8px 12px 0;
}

.summary-grid div + div {
  padding-left: 10px;
  border-left: 1px solid var(--line-light);
}

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 15px;
}

.summary-grid span {
  margin-top: 5px;
  color: rgba(245, 239, 223, 0.48);
  font-size: 9px;
}

.scan-time {
  margin: 12px 0 0;
  color: rgba(245, 239, 223, 0.45);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.text-button {
  padding: 4px 0;
  background: transparent;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.category-map {
  display: grid;
  gap: 5px;
  margin-top: 15px;
}

.category-row {
  position: relative;
  display: grid;
  min-height: 39px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(245, 239, 223, 0.76);
  text-align: left;
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion), border-color 420ms var(--motion);
}

.category-row::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  transform: scaleY(0);
  background: var(--orange);
  transition: transform 420ms var(--motion);
}

.category-row:hover {
  transform: translateX(3px);
  border-color: var(--line-light);
  background: rgba(245, 239, 223, 0.06);
  color: var(--paper-bright);
}

.category-row.active {
  border-color: var(--paper-bright);
  background: var(--paper-bright);
  color: var(--ink);
}

.category-row.active::after {
  transform: scaleY(1);
}

.category-initial {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.category-row.active .category-initial {
  border-color: var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
}

.category-name {
  font-size: 11px;
  font-weight: 700;
}

.category-count {
  color: inherit;
  font-family: var(--mono);
  font-size: 9px;
  opacity: 0.66;
}

.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.source-chip {
  padding: 7px 9px;
  border: 1px solid var(--line-light);
  background: transparent;
  color: rgba(245, 239, 223, 0.62);
  font-family: var(--mono);
  font-size: 9px;
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion);
}

.source-chip:hover,
.source-chip.active {
  transform: translateY(-2px);
  border-color: var(--orange);
  background: var(--orange);
  color: var(--paper-bright);
}

.sidebar-note {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid rgba(80, 199, 150, 0.58);
  background: rgba(80, 199, 150, 0.08);
}

.readonly-mark {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid #50c796;
  color: #80e4bb;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.sidebar-note p {
  margin: 0;
  color: rgba(245, 239, 223, 0.58);
  font-size: 10px;
  line-height: 1.65;
}

.sidebar-note strong {
  color: var(--paper-bright);
}

.main-content {
  width: 100%;
  max-width: 1680px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 82px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 435px;
  grid-template-columns: minmax(350px, 1.05fr) minmax(380px, 0.95fr);
  align-items: end;
  gap: clamp(34px, 5vw, 84px);
  padding: clamp(44px, 5vw, 76px);
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: var(--paper-bright);
}

.hero::before {
  content: "";
  position: absolute;
  top: -205px;
  right: 25%;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(245, 239, 223, 0.34);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(245, 239, 223, 0.08), 0 0 0 68px rgba(245, 239, 223, 0.06);
}

.hero::after {
  content: "";
  position: absolute;
  right: 40px;
  bottom: -72px;
  width: 156px;
  height: 156px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
}

.hero-copy,
.search-deck {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 24px;
  padding: 7px 9px;
  border: 1px solid var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(52px, 5vw, 70px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 span {
  display: block;
  white-space: nowrap;
}

.hero-description {
  max-width: 520px;
  margin: 24px 0 0;
  color: rgba(245, 239, 223, 0.78);
  font-size: 14px;
  line-height: 1.8;
}

.hero-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero-telemetry span {
  padding: 7px 12px;
  border-block: 1px solid rgba(245, 239, 223, 0.34);
}

.hero-telemetry span + span {
  border-left: 1px solid rgba(245, 239, 223, 0.34);
}

.search-deck {
  padding: 33px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--ink);
  box-shadow: 9px 9px 0 rgba(23, 25, 20, 0.28);
}

.search-deck::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px;
  border: 1px solid rgba(23, 25, 20, 0.42);
  background: var(--paper-bright);
}

.search-deck > label {
  display: grid;
  gap: 6px;
  margin-bottom: 15px;
}

.search-deck > label small {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.search-deck > label strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  background: var(--canvas);
  transition: transform 480ms var(--motion), box-shadow 480ms var(--motion);
}

.search-box:focus-within {
  transform: translateY(-3px);
  box-shadow: 5px 5px 0 var(--orange);
}

.search-glyph {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.search-box input::placeholder {
  color: #777a6f;
}

.search-box kbd {
  padding: 5px 7px;
  border: 1px solid var(--ink);
  border-bottom-width: 3px;
  background: var(--paper-bright);
  color: var(--ink);
  font-size: 8px;
}

.quick-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.quick-searches button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion);
}

.quick-searches button:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: var(--blue);
  color: var(--paper-bright);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  padding: 17px 18px;
  border: 2px solid var(--ink);
  background: var(--panel);
}

.catalog-toolbar p {
  margin: 0;
}

.result-title {
  font-size: 12px;
  font-weight: 700;
}

.result-title strong {
  color: var(--blue);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 900;
}

#active-filter-label {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-filter {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  font-size: 10px;
  font-weight: 700;
}

.check-filter input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--orange);
}

.select-wrap select {
  min-height: 39px;
  padding: 0 31px 0 11px;
  border: 1px solid var(--ink);
  outline: 0;
  background: var(--paper-bright);
  font-size: 10px;
  font-weight: 700;
}

.view-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
}

.view-switch button {
  display: grid;
  width: 32px;
  height: 31px;
  place-items: center;
  background: transparent;
  color: var(--muted);
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion);
}

.view-switch button:hover {
  transform: scale(0.94);
}

.view-switch button.active {
  background: var(--ink);
  color: var(--paper-bright);
}

.view-switch button span {
  font-family: var(--mono);
  font-size: 15px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  margin-top: 12px;
}

.skill-grid[aria-busy="true"]::before {
  content: "SCANNING LOCAL SKILL INDEX / 正在整理…";
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.skill-card {
  --category-color: var(--orange);
  position: relative;
  display: flex;
  min-height: 278px;
  flex-direction: column;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--ink);
  background: var(--ink);
  text-align: left;
  animation: card-enter 680ms var(--motion) both;
  transition: transform 560ms var(--motion), box-shadow 560ms var(--motion);
}

.skill-card:nth-child(2) { animation-delay: 35ms; }
.skill-card:nth-child(3) { animation-delay: 70ms; }
.skill-card:nth-child(4) { animation-delay: 105ms; }
.skill-card:nth-child(5) { animation-delay: 140ms; }
.skill-card:nth-child(6) { animation-delay: 175ms; }

@keyframes card-enter {
  from {
    transform: translateY(22px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.skill-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 3px;
  right: 3px;
  left: 3px;
  height: 4px;
  transform-origin: left center;
  background: var(--category-color);
  transition: transform 560ms var(--motion);
}

.skill-card:hover {
  z-index: 2;
  transform: translateY(-5px);
  box-shadow: 7px 7px 0 rgba(23, 25, 20, 0.2);
}

.skill-card:hover::before {
  transform: scaleX(0.42);
}

.card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 20px 18px;
  background: var(--paper-bright);
}

.card-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-category {
  overflow: hidden;
  color: var(--blue);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-number {
  color: var(--orange);
}

.card-source {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card h3 {
  margin: 28px 0 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.skill-card .english-name {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card .skill-description {
  display: -webkit-box;
  margin: 16px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 19px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.meta-badge.warning {
  border-color: var(--orange);
  background: #ffe5c7;
  color: #8d3518;
}

.meta-badge.untranslated {
  border-color: var(--red);
  background: #f8d8dd;
  color: var(--red);
}

.invoke-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 51px;
  margin-top: 3px;
  background: var(--navy);
}

.invoke-strip code {
  align-self: center;
  overflow: hidden;
  padding: 0 15px 0 18px;
  color: #8eabff;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoke-strip button {
  position: relative;
  min-width: 102px;
  padding: 0 36px 0 13px;
  border-left: 1px solid rgba(245, 239, 223, 0.24);
  background: transparent;
  color: var(--paper-bright);
  font-size: 9px;
  font-weight: 800;
  transition: background 480ms var(--motion), color 480ms var(--motion);
}

.invoke-strip button::after {
  content: "↗";
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--mono);
  transition: transform 480ms var(--motion);
}

.invoke-strip button:hover {
  background: var(--orange);
  color: var(--paper-bright);
}

.invoke-strip button:hover::after {
  transform: translate(2px, calc(-50% - 2px));
}

.invoke-strip button:active,
.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: scale(0.97);
}

.skill-grid.list-view {
  grid-template-columns: 1fr;
}

.skill-grid.list-view .skill-card {
  display: grid;
  min-height: 118px;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 28%);
}

.skill-grid.list-view .card-main {
  display: grid;
  grid-template-columns: 170px minmax(190px, 0.85fr) minmax(230px, 1.15fr) auto;
  align-items: center;
  gap: 18px;
  padding-block: 16px;
}

.skill-grid.list-view .card-index {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.skill-grid.list-view .card-source {
  text-align: left;
}

.skill-grid.list-view h3 {
  margin-top: 0;
  font-size: 21px;
}

.skill-grid.list-view .skill-description {
  margin: 0;
  -webkit-line-clamp: 2;
}

.skill-grid.list-view .card-meta {
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

.skill-grid.list-view .invoke-strip {
  margin-top: 0;
  border-left: 3px solid var(--ink);
}

.empty-state {
  min-height: 400px;
  margin-top: 12px;
  padding: 76px 20px;
  border: 2px solid var(--ink);
  background: var(--paper);
  text-align: center;
}

.empty-index {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  color: var(--paper-bright);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 900;
}

.empty-state h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 900;
}

.empty-state p {
  margin: 10px 0 23px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion);
}

.primary-button {
  background: var(--ink);
  color: var(--paper-bright);
}

.primary-button:hover {
  background: var(--orange);
}

.secondary-button {
  background: var(--paper-bright);
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--panel);
}

.drawer-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(15, 22, 35, 0.64);
}

.detail-drawer {
  position: fixed;
  z-index: 80;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(620px, calc(100vw - 24px));
  transform: translateX(calc(100% + 20px));
  border: 3px solid var(--ink);
  background: var(--canvas);
  box-shadow: -12px 12px 0 rgba(23, 25, 20, 0.24);
  transition: transform 620ms var(--motion);
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-handle {
  position: absolute;
  top: 46px;
  left: -17px;
  width: 14px;
  height: 110px;
  border: 2px solid var(--ink);
  border-right: 0;
  background: var(--orange);
}

.drawer-header {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 3px solid var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
}

.drawer-category {
  color: rgba(245, 239, 223, 0.78);
}

.drawer-header h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 35px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.drawer-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--paper-bright);
  border-radius: 50%;
  background: transparent;
  color: var(--paper-bright);
  transition: transform 480ms var(--motion), background 480ms var(--motion), color 480ms var(--motion);
}

.drawer-close:hover {
  transform: rotate(90deg);
  background: var(--paper-bright);
  color: var(--ink);
}

.drawer-close span {
  font-size: 23px;
  line-height: 1;
}

.drawer-scroll {
  height: calc(100% - 112px);
  overflow: auto;
  padding: 0 28px 64px;
  scrollbar-color: var(--orange) transparent;
  scrollbar-width: thin;
}

.drawer-intro {
  padding: 28px 0;
}

.drawer-intro > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.drawer-badges span {
  padding: 5px 8px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.call-panel,
.detail-section,
.raw-details,
.edit-alias-section,
.install-management-section {
  margin-top: 16px;
  border: 2px solid var(--ink);
  background: var(--paper-bright);
}

.call-panel {
  padding: 4px;
  background: var(--navy);
}

.call-panel .panel-heading,
.call-panel .call-row,
.call-panel .call-tip {
  border-color: rgba(245, 239, 223, 0.25);
}

.call-panel .panel-heading {
  background: var(--navy);
  color: var(--paper-bright);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 900;
}

.call-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--paper-bright);
}

.call-row code,
.call-row p {
  margin: 0;
  padding: 15px 17px;
}

.primary-call code {
  overflow: auto;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.natural-call p {
  font-size: 11px;
  line-height: 1.65;
}

.call-row button {
  min-width: 96px;
  padding: 0 13px;
  border-left: 1px solid var(--line);
  background: var(--canvas);
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  transition: background 420ms var(--motion), color 420ms var(--motion);
}

.call-row button:hover {
  background: var(--orange);
  color: var(--paper-bright);
}

.call-tip {
  margin: 0;
  padding: 12px 17px;
  background: var(--navy);
  color: rgba(245, 239, 223, 0.62);
  font-size: 9px;
  line-height: 1.65;
}

.call-tip code {
  color: #9eb5ff;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.detail-list code {
  color: var(--blue);
  font-size: 9px;
}

.path-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.path-value code {
  overflow-wrap: anywhere;
}

.path-value button {
  padding: 4px 6px;
  border: 1px solid var(--ink);
  background: var(--canvas);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
}

.variant-list {
  display: grid;
}

.variant-item {
  padding: 13px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.variant-item:last-child {
  border-bottom: 0;
}

.variant-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.variant-item strong {
  font-size: 11px;
}

.variant-state {
  color: var(--green);
  font-family: var(--mono);
  font-size: 8px;
}

.variant-state.different {
  color: var(--red);
}

.variant-item code {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.raw-details {
  padding: 0;
}

.raw-details summary {
  padding: 16px 17px;
  font-size: 10px;
  font-weight: 800;
}

.original-description {
  margin: 0;
  padding: 14px 17px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.raw-details pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  border-top: 2px solid var(--ink);
  background: #101b2e;
  color: #dfe6d5;
  font-size: 9px;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
}

.edit-toggle {
  display: grid;
  width: 100%;
  min-height: 74px;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  background: var(--paper-bright);
  text-align: left;
}

.edit-toggle strong,
.edit-toggle small {
  display: block;
}

.edit-toggle strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 900;
}

.edit-toggle small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.edit-toggle .chevron {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 17px;
  transition: transform 520ms var(--motion), background 520ms var(--motion), color 520ms var(--motion);
}

.edit-toggle.open .chevron {
  transform: rotate(90deg);
  background: var(--orange);
  color: var(--paper-bright);
}

#alias-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-top: 2px solid var(--ink);
  background: var(--canvas);
}

#alias-form[hidden] {
  display: none;
}

#alias-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

#alias-form input,
#alias-form textarea,
#alias-form select {
  width: 100%;
  border: 1px solid var(--ink);
  outline: 0;
  background: var(--paper-bright);
  font-family: var(--sans);
  font-size: 12px;
}

#alias-form input,
#alias-form select {
  min-height: 42px;
  padding: 0 10px;
}

#alias-form textarea {
  resize: vertical;
  padding: 10px;
  line-height: 1.6;
}

#alias-form input:focus,
#alias-form textarea:focus,
#alias-form select:focus {
  box-shadow: 4px 4px 0 var(--orange);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.install-management-section .panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.install-management-body {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--canvas);
}

.install-management-body label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.install-management-body select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--ink);
  outline: 0;
  background: var(--paper-bright);
  font-size: 11px;
}

.install-management-body select:focus {
  box-shadow: 4px 4px 0 var(--orange);
}

#trash-availability {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.danger-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
  font-size: 10px;
  font-weight: 900;
  transition: transform 420ms var(--motion), background 420ms var(--motion), color 420ms var(--motion);
}

.danger-button:hover:not(:disabled) {
  background: var(--red);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.trash-dialog {
  width: min(520px, calc(100vw - 36px));
  max-height: min(720px, calc(100dvh - 36px));
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 12px 12px 0 rgba(23, 25, 20, 0.28);
}

.trash-dialog::backdrop {
  background: rgba(15, 22, 35, 0.68);
}

.trash-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 3px solid var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
}

.trash-dialog header span {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.trash-dialog h2 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

#trash-dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 19px;
}

.trash-dialog-body {
  max-height: 470px;
  overflow: auto;
  padding: 20px;
}

.trash-dialog-body > p:first-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

#trash-dialog-path {
  display: block;
  margin-top: 13px;
  padding: 11px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  color: var(--blue);
  font-size: 9px;
  line-height: 1.55;
}

.trash-affected {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
}

.trash-affected strong {
  font-family: var(--display);
  font-size: 13px;
}

.trash-affected ul {
  margin: 9px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.trash-dialog-note {
  margin: 14px 0 0;
  padding: 12px 13px;
  background: var(--navy);
  color: rgba(245, 239, 223, 0.76);
  font-size: 9px;
  line-height: 1.7;
}

.trash-dialog-error {
  min-height: 0;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
}

.trash-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 2px solid var(--ink);
  background: var(--paper-bright);
}

.toast {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  transform: translateY(160%);
  padding: 13px 17px;
  border: 2px solid var(--ink);
  background: var(--orange);
  color: var(--paper-bright);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  transition: transform 560ms var(--motion);
}

.toast.show {
  transform: translateY(0);
}

.category-content,
.category-visual,
.category-web,
.category-docs,
.category-data,
.category-research,
.category-dev,
.category-auto,
.category-skills {
  --category-color: var(--orange);
}

.load-error {
  grid-column: 1 / -1;
  padding: 48px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--red);
  font-family: var(--mono);
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .atlas-sidebar {
    padding-inline: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .hero h1 {
    max-width: 760px;
    font-size: clamp(54px, 7.2vw, 76px);
  }

  .search-deck {
    max-width: 720px;
  }

  .skill-grid.list-view .skill-card {
    grid-template-columns: 1fr;
  }

  .skill-grid.list-view .card-main {
    grid-template-columns: 150px minmax(180px, 0.8fr) minmax(220px, 1.2fr);
  }

  .skill-grid.list-view .card-meta {
    display: none;
  }

  .skill-grid.list-view .invoke-strip {
    min-height: 49px;
    border-top: 3px solid var(--ink);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .atlas-sidebar {
    position: static;
    display: grid;
    width: 100%;
    height: auto;
    grid-template-columns: minmax(230px, 0.78fr) minmax(320px, 1.22fr);
    gap: 28px;
    margin-bottom: 12px;
    padding: 22px;
  }

  .atlas-sidebar .sidebar-section {
    padding: 0;
    border: 0;
  }

  .atlas-sidebar .sidebar-section:nth-of-type(3),
  .atlas-sidebar .sidebar-note {
    display: none;
  }

  .category-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-content {
    padding-bottom: 70px;
  }
}

@media (max-width: 700px) {
  .topbar {
    top: 8px;
    width: calc(100% - 16px);
    min-height: 62px;
    margin: 8px 8px 0;
    padding-left: 11px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .live-state {
    padding-inline: 8px;
  }

  .live-state #live-label,
  .icon-button > span:last-child {
    display: none;
  }

  .icon-button {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .app-shell {
    min-height: calc(100dvh - 86px);
    padding: 8px;
  }

  .atlas-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 19px 16px;
  }

  .atlas-sidebar .sidebar-section:nth-of-type(2) {
    padding-top: 19px;
    border-top: 1px solid var(--line-light);
  }

  .summary-panel {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    column-gap: 16px;
  }

  .summary-panel .panel-code,
  .summary-panel .sidebar-title,
  .summary-panel .primary-count {
    grid-column: 1;
  }

  .summary-grid {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }

  .scan-time {
    grid-column: 1 / -1;
  }

  .primary-count strong {
    font-size: 50px;
  }

  .category-map {
    display: flex;
    margin-inline: -16px;
    padding: 0 16px 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-map::-webkit-scrollbar {
    display: none;
  }

  .category-row {
    min-width: 118px;
  }

  .hero {
    min-height: auto;
    gap: 35px;
    padding: 40px 22px 46px;
  }

  .hero::before {
    top: -220px;
    right: -90px;
  }

  .hero::after {
    right: -55px;
    bottom: -80px;
  }

  .hero h1 {
    font-size: clamp(43px, 12vw, 58px);
  }

  .hero-description {
    font-size: 12px;
  }

  .hero-telemetry {
    margin-top: 27px;
  }

  .search-deck {
    padding: 27px 24px;
    box-shadow: 6px 6px 0 rgba(23, 25, 20, 0.3);
  }

  .search-deck > label strong {
    font-size: 17px;
  }

  .search-box kbd {
    display: none;
  }

  .catalog-toolbar {
    align-items: flex-start;
    padding: 15px;
  }

  .toolbar-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .check-filter span {
    display: none;
  }

  .check-filter {
    width: 39px;
    justify-content: center;
    padding: 0;
  }

  .select-wrap select {
    max-width: 128px;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .skill-card {
    min-height: 254px;
  }

  .skill-grid.list-view .skill-card {
    display: flex;
  }

  .skill-grid.list-view .card-main {
    display: flex;
  }

  .skill-grid.list-view .card-index {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .skill-grid.list-view .card-source {
    text-align: right;
  }

  .skill-grid.list-view h3 {
    margin-top: 28px;
    font-size: 26px;
  }

  .skill-grid.list-view .skill-description {
    margin-top: 16px;
  }

  .detail-drawer {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    height: min(88dvh, 820px);
    transform: translateY(calc(100% + 16px));
    box-shadow: 0 -8px 0 rgba(23, 25, 20, 0.22);
  }

  .detail-drawer.open {
    transform: translateY(0);
  }

  .drawer-handle {
    top: -14px;
    left: 50%;
    width: 74px;
    height: 11px;
    transform: translateX(-50%);
    border: 2px solid var(--ink);
    border-bottom: 0;
  }

  .drawer-header {
    min-height: 96px;
    padding: 20px;
  }

  .drawer-scroll {
    height: calc(100% - 96px);
    padding-inline: 18px;
  }

  .drawer-header h2 {
    font-size: 29px;
  }

  .detail-list > div {
    grid-template-columns: 74px minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .brand-copy small {
    display: none;
  }

  .live-state {
    border-left: 0;
  }

  .hero-telemetry span {
    padding-inline: 8px;
  }

  .catalog-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-controls {
    justify-content: flex-start;
  }

  .check-filter span {
    display: inline;
  }

  .check-filter {
    width: auto;
    padding-inline: 9px;
  }

  .path-value {
    grid-template-columns: 1fr;
  }

  .path-value button {
    justify-self: start;
  }
}

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