@charset "UTF-8";
:root {
  --paper: #faf3df;
  --page: #f1ebdd;
  --ink: #244c67;
  --muted: #586e78;
  --line: #7896a4;
  --red: #a34531;
  --pale: #e5ece8;
  --gold: #925026;
  --bg: var(--page);
  --panel: var(--paper);
  --text: var(--ink);
  --teal: var(--red);
  --blue: #386588;
  --purple: #665974;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Songti SC", serif;
  --level-0: #3d7465;
  --level-1: #32797a;
  --level-2: #386b91;
  --level-3: #506c95;
  --level-4: #716383;
  --level-5: #a34531;
  --level-6: #5b6e77;
  --scene: #eee8d9;
  --scene-surface: #758e96;
  --scene-route: #a34531;
  --scene-grid: #8ea39d;
  --scene-star: #526f80;
  --scene-active: #a34531;
}
:root[data-theme="dark"] {
  --paper: #1e2932;
  --page: #151d24;
  --ink: #cfdfeb;
  --muted: #a0b3bc;
  --line: #465965;
  --red: #f0a18a;
  --pale: #202f35;
  --gold: #d4bd87;
  --blue: #85b6d4;
  --purple: #baa6ce;
  --level-0: #9bcdb0;
  --level-1: #87c6c9;
  --level-2: #85b6d4;
  --level-3: #9eb8e0;
  --level-4: #baa6ce;
  --level-5: #f0a18a;
  --level-6: #a0b3bc;
  --scene: #18232b;
  --scene-surface: #344c5a;
  --scene-route: #f0a18a;
  --scene-grid: #456575;
  --scene-star: #9bb6c7;
  --scene-active: #ffd9ae;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  background-image: radial-gradient(
    ellipse at 50% 5%,
    color-mix(in srgb, var(--pale) 65%, transparent),
    transparent 52%
  );
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
}
button:hover {
  filter: brightness(1.15);
}
[hidden] {
  display: none !important;
}
.masthead {
  max-width: 1600px;
  margin: auto;
  padding: 25px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand svg {
  width: 44px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.6;
}
.brand > span {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 4px;
  line-height: 1;
}
.brand-caption {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 9px;
}
.masthead nav {
  display: flex;
  gap: 36px;
  color: var(--muted);
  font-size: 13px;
}
.nav-active {
  color: var(--text);
}
.nav-active:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: middle;
}
.source-link {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 15px;
  border-radius: 6px;
}
.source-link span {
  color: var(--teal);
  margin-left: 9px;
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 0 40px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 47px 0 34px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.3px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-dot {
  width: 5px;
  height: 5px;
  background: var(--teal);
  box-shadow: 0 0 9px var(--red);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
h1 {
  font-weight: 500;
  font-size: clamp(24px, 2.2vw, 34px);
  letter-spacing: -1px;
  line-height: 1.4;
  margin: 13px 0 10px;
}
h1 span {
  color: var(--muted);
}
.intro p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.intro-counts {
  display: flex;
  gap: 30px;
  flex-shrink: 0;
}
.intro-counts div {
  display: flex;
  flex-direction: column;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}
.intro-counts strong {
  font-size: 29px;
  font-weight: 450;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.intro-counts span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
}
.workspace {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr) 290px;
  min-height: 615px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.level-panel {
  padding: 23px 15px;
  border-right: 1px solid var(--line);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--pale) 65%, transparent),
    transparent
  );
}
.panel-kicker {
  font-size: 9px;
  letter-spacing: 1.7px;
  color: var(--muted);
}
h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 7px 0 4px;
}
.level-panel h2 {
  font-size: 17px;
  margin-top: 13px;
}
.small-muted {
  color: var(--muted);
  font-size: 11px;
}
.level-panel > p {
  margin: 2px 0 22px;
  font-size: 10px;
}
.level-button {
  width: 100%;
  display: flex;
  text-align: left;
  align-items: center;
  padding: 11px 10px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  gap: 11px;
  background: transparent;
}
.level-button.selected {
  background: color-mix(in srgb, var(--level-color) 10%, transparent);
  border-color: color-mix(in srgb, var(--level-color) 27%, transparent);
}
.level-code {
  border: 1px solid color-mix(in srgb, var(--level-color) 35%, transparent);
  color: var(--level-color);
  min-width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
}
.level-text {
  flex: 1;
}
.level-text strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
}
.level-text small {
  font-size: 9px;
  color: var(--muted);
}
.level-number {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.level-button.extension {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.all-levels {
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  display: flex;
  width: 100%;
  justify-content: space-between;
  font-size: 10px;
  margin-top: 14px;
}
.all-levels span {
  color: var(--teal);
}
.level-footnote {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 19px;
  padding-left: 6px;
}
.scene-panel {
  position: relative;
  background:
    radial-gradient(
      ellipse at 50% 42%,
      color-mix(in srgb, var(--pale) 65%, transparent) 0,
      transparent 68%
    ),
    var(--scene);
  min-width: 0;
  isolation: isolate;
}
.scene-toolbar {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 4;
}
.view-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--pale) 65%, transparent);
  padding: 3px;
}
.view-switch button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 10px;
}
.view-switch button[aria-pressed="true"] {
  color: var(--text);
  background: var(--paper);
}
.scene-state {
  font-size: 9px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
  letter-spacing: 1px;
}
.scene-stage {
  position: absolute;
  inset: 0;
}
.scene-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.scene-loading,
.scene-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 12px;
  pointer-events: none;
}
.scene-fallback {
  padding: 60px;
  color: var(--muted);
  background: var(--scene);
}
.scene-overlay-title {
  position: absolute;
  top: 85px;
  left: 24px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  opacity: 0.75;
}
.jp-title {
  font-family: "Hiragino Mincho ProN", "Songti SC", serif;
  font-size: 25px;
  letter-spacing: 8px;
  color: var(--ink);
}
.coordinate {
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 8px;
}
.scene-footer {
  position: absolute;
  bottom: 19px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
  gap: 10px;
}
.interaction-hint {
  font-size: 9px;
  color: var(--muted);
}
.scene-actions {
  display: flex;
  gap: 7px;
}
.scene-actions button {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--pale) 65%, transparent);
  padding: 6px 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
}
.scene-actions span {
  font-size: 9px;
  margin-left: 4px;
}
.scene-legend {
  position: absolute;
  bottom: 59px;
  left: 20px;
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 8px;
  pointer-events: none;
}
.scene-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.scene-legend i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.cyan {
  background: var(--teal);
}
.blue {
  background: var(--blue);
}
.purple {
  background: var(--purple);
}
.gold {
  background: var(--gold);
}
.level-labels,
.node-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.level-labels button {
  position: absolute;
  font-size: 9px;
  background: color-mix(in srgb, var(--pale) 65%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 2px 14px color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 4px;
  padding: 4px 7px;
  pointer-events: auto;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  color: var(--text);
}
.level-labels button:before {
  content: "";
  width: 3px;
  height: 3px;
  display: inline-block;
  border-radius: 50%;
  background: var(--level-color);
  margin-right: 6px;
}
.node-labels button {
  position: absolute;
  padding: 4px 8px;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, var(--pale) 65%, transparent);
  border: 1px solid color-mix(in srgb, var(--pale) 65%, transparent);
  color: var(--red);
  border-radius: 4px;
  font-size: 9px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.level-labels button.selected {
  border-color: var(--level-color);
  color: var(--level-color);
}
.detail-panel {
  padding: 23px 23px 18px;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--paper);
  max-height: 680px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.detail-meta {
  display: flex;
  gap: 6px;
  margin: 20px 0 12px;
  align-items: center;
  flex-wrap: wrap;
}
.badge {
  font-size: 9px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}
.badge.level {
  color: var(--level-color);
  border-color: color-mix(in srgb, var(--level-color) 30%, transparent);
  background: color-mix(in srgb, var(--level-color) 8%, transparent);
}
.detail-title {
  font-size: 23px;
  font-weight: 500;
  margin: 10px 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.detail-meaning {
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 20px;
}
.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 15px;
}
.detail-section h3 {
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 1px;
  margin: 0 0 8px;
}
.syntax {
  background: var(--paper);
  border-left: 2px solid var(--teal);
  border-radius: 0 4px 4px 0;
  padding: 10px 11px;
  font-size: 11px;
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.example-ja {
  font-size: 13px;
  color: var(--text);
  line-height: 1.85;
  margin: 0 0 5px;
}
.example-zh {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}
.usage-note {
  font-size: 10px;
  color: var(--muted);
  margin: 8px 0;
  line-height: 1.85;
}
.related-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.related-chips button {
  padding: 5px 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 4px;
  font-size: 9px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}
.detail-id {
  font-size: 8px;
  color: var(--muted);
  margin-top: 21px;
  letter-spacing: 1px;
}
.detail-route {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--teal);
  font-size: 10px;
  text-align: left;
}
.detail-edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.detail-edit button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  font-size: 9px;
  padding: 6px 8px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.section-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
}
.section-heading h2 {
  font-size: 23px;
  margin-top: 8px;
}
.routes-section {
  padding-top: 46px;
}
.route-browser {
  display: grid;
  grid-template-columns: 260px 1fr;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  overflow: hidden;
}
.route-picker {
  padding: 21px;
  border-right: 1px solid var(--line);
}
.route-picker label {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 9px;
}
.route-picker select {
  width: 100%;
  font-size: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 8px;
  color: var(--text);
}
.route-picker p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.9;
  margin: 13px 0;
}
.route-type {
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 1px;
}
.route-track {
  padding: 23px;
  display: flex;
  align-items: center;
  align-content: center;
  gap: 9px;
  flex-wrap: wrap;
}
.route-node {
  display: flex;
  align-items: center;
  gap: 9px;
}
.route-node:after {
  content: "→";
  font-size: 12px;
  color: var(--muted);
}
.route-node:last-child:after {
  display: none;
}
.route-node button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  padding: 10px 13px;
  text-align: left;
  min-height: 62px;
}
.route-node button.selected {
  border-color: var(--red);
  background: var(--paper);
}
.route-node .route-label {
  font-size: 11px;
  line-height: 1.5;
  max-width: 185px;
  overflow-wrap: anywhere;
}
.route-node small {
  color: var(--level-color);
  font-size: 8px;
}
.library-section {
  padding: 44px 0 38px;
}
.result-count {
  font-size: 11px;
  color: var(--muted);
}
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-field {
  display: flex;
  flex: 1;
  min-width: 230px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 9px 13px;
  border-radius: 6px;
}
.search-field > span {
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}
.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  color: var(--text);
  outline: none;
  background: transparent;
  font-size: 11px;
}
.search-field input::placeholder {
  color: var(--muted);
}
.search-field:focus-within {
  border-color: var(--teal);
}
kbd {
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
  padding: 0 5px;
}
.filters select {
  padding: 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  color: var(--muted);
  max-width: 180px;
  font-size: 10px;
}
.filters > button {
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.entry-card {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 17px;
  min-width: 0;
  transition:
    border-color 0.18s,
    transform 0.18s;
}
.entry-card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.entry-card.selected {
  border-color: var(--red);
  background: var(--paper);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  color: var(--muted);
}
.card-level {
  color: var(--level-color);
}
.entry-card h3 {
  font-size: 14px;
  font-weight: 450;
  margin: 12px 0 7px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.entry-card p {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.85;
  min-height: 37px;
}
.entry-card .card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--muted);
  margin-top: 14px;
}
.card-footer span:last-child {
  color: var(--teal);
}
.load-area {
  text-align: center;
  padding-top: 24px;
}
.load-area button {
  padding: 10px 23px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 6px;
  font-size: 11px;
}
.load-area span {
  color: var(--teal);
  margin-left: 16px;
}
.empty-state {
  color: var(--muted);
  padding: 35px 0;
  text-align: center;
}
footer {
  max-width: 1600px;
  margin: auto;
  padding: 25px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 9px;
}
.footer-brand {
  font-size: 17px;
  color: var(--muted);
  letter-spacing: 3px;
}
.footer-brand span {
  font-size: 9px;
  letter-spacing: 1px;
  margin-left: 14px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  background: var(--pale);
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 20;
}
.workspace.expanded {
  grid-template-columns: 170px minmax(0, 1fr);
}
.workspace.expanded .detail-panel {
  grid-column: 1/-1;
  max-height: none;
  border-left: 0;
  border-top: 1px solid var(--line);
}
.workspace.expanded .scene-panel {
  min-height: 730px;
}
.workspace.expanded #detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.workspace.expanded .detail-meta,
.workspace.expanded .detail-title,
.workspace.expanded .detail-meaning {
  grid-column: 1/-1;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr) 320px;
    min-height: 670px;
  }
  .detail-panel {
    max-height: 670px;
  }
  .detail-title {
    font-size: 26px;
  }
}
@media (max-width: 1150px) {
  main {
    padding: 0 24px;
  }
  .masthead {
    padding: 23px 24px;
  }
  .workspace {
    grid-template-columns: 162px minmax(0, 1fr) 260px;
  }
  .level-panel {
    padding: 20px 9px;
  }
  .level-button {
    gap: 7px;
    padding: 10px 6px;
  }
  .detail-panel {
    padding: 22px 17px;
  }
  .intro-counts {
    gap: 17px;
  }
  .intro-counts div {
    padding-left: 15px;
  }
  .scene-toolbar {
    left: 13px;
    right: 13px;
  }
  .scene-state {
    display: none;
  }
  .scene-overlay-title {
    left: 17px;
  }
  .interaction-hint {
    font-size: 8px;
  }
  .scene-actions span {
    display: none;
  }
  .entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 155px minmax(0, 1fr);
    min-height: 550px;
  }
  .scene-panel {
    min-height: 550px;
  }
  .detail-panel {
    grid-column: 1/-1;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 22px;
  }
  .detail-panel #detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
  }
  .detail-meta,
  .detail-title,
  .detail-meaning,
  .detail-id,
  .detail-edit {
    grid-column: 1/-1;
  }
  .detail-section {
    margin-top: 8px;
  }
  .intro {
    padding-top: 32px;
    align-items: flex-start;
  }
  .intro-counts {
    gap: 15px;
  }
  .intro-counts strong {
    font-size: 24px;
  }
  .intro-counts div {
    padding-left: 12px;
  }
  .intro-counts div:last-child {
    display: none;
  }
  .masthead nav {
    gap: 20px;
  }
  .route-browser {
    grid-template-columns: 220px 1fr;
  }
  .route-track {
    padding: 16px;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  footer > span {
    display: none;
  }
}
@media (max-width: 600px) {
  main {
    padding: 0 15px;
  }
  .masthead {
    padding: 17px 15px;
  }
  .brand svg {
    width: 33px;
  }
  .brand > span {
    font-size: 20px;
  }
  .brand-caption {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .masthead nav {
    display: none;
  }
  .source-link {
    font-size: 10px;
    padding: 6px 10px;
  }
  .intro {
    padding: 28px 0 23px;
    display: block;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.7px;
  }
  h1 {
    font-size: 24px;
    letter-spacing: -0.7px;
  }
  h1 span {
    display: block;
  }
  .intro p {
    font-size: 10px;
    max-width: 310px;
  }
  .intro-counts {
    margin-top: 20px;
    gap: 26px;
  }
  .intro-counts div {
    padding-left: 0;
    border-left: 0;
  }
  .intro-counts div:last-child {
    display: flex;
  }
  .intro-counts strong {
    font-size: 24px;
    line-height: 1.3;
  }
  .intro-counts span {
    font-size: 8px;
  }
  .workspace,
  .workspace.expanded {
    display: flex;
    flex-direction: column;
    overflow: visible;
    border-radius: 9px;
  }
  .level-panel {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 15px 12px;
  }
  .level-panel .panel-kicker,
  .level-panel h2,
  .level-panel > p,
  .level-footnote,
  .all-levels {
    display: none;
  }
  #levels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .level-button {
    width: auto;
    flex: 1 1 78px;
    margin: 0;
    padding: 8px 6px;
    gap: 5px;
    min-height: 44px;
    border: 1px solid var(--line);
  }
  .level-code {
    width: auto;
    min-width: 20px;
    height: auto;
    border: 0;
    font-size: 10px;
  }
  .level-text strong {
    font-size: 9px;
  }
  .level-text small,
  .level-number {
    display: none;
  }
  .level-button.extension {
    margin: 0;
    border-radius: 7px;
  }
  .scene-panel {
    order: 1;
    min-height: 450px;
    border-radius: 9px 9px 0 0;
    overflow: hidden;
  }
  .scene-toolbar {
    top: 13px;
  }
  .scene-overlay-title {
    top: 66px;
  }
  .jp-title {
    font-size: 22px;
  }
  .coordinate {
    font-size: 6px;
  }
  .scene-footer {
    left: 12px;
    right: 12px;
    bottom: 15px;
  }
  .scene-legend {
    left: 13px;
    bottom: 49px;
  }
  .interaction-hint {
    font-size: 8px;
  }
  .scene-actions button {
    padding: 6px 8px;
  }
  .detail-panel {
    order: 3;
    padding: 20px 17px;
    overflow: visible;
    border-radius: 0 0 9px 9px;
  }
  .detail-panel #detail,
  .workspace.expanded #detail {
    display: block;
  }
  .detail-title {
    font-size: 25px;
  }
  .detail-meta {
    margin-top: 14px;
  }
  .detail-section {
    margin-top: 18px;
  }
  .detail-meaning {
    margin-bottom: 15px;
  }
  .section-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .section-heading > .small-muted {
    display: none;
  }
  .section-heading h2 {
    font-size: 19px;
  }
  .routes-section {
    padding-top: 30px;
  }
  .route-browser {
    grid-template-columns: 1fr;
  }
  .route-picker {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .route-picker p {
    margin-bottom: 7px;
  }
  .route-track {
    padding: 15px;
    gap: 6px;
  }
  .route-node {
    gap: 6px;
  }
  .route-node button {
    padding: 8px 9px;
    min-height: 54px;
  }
  .route-label {
    font-size: 10px !important;
    max-width: 138px !important;
  }
  .library-section {
    padding-top: 30px;
  }
  .filters {
    gap: 7px;
  }
  .search-field {
    flex-basis: 100%;
    min-width: 0;
    padding: 10px 12px;
  }
  .search-field input {
    font-size: 13px;
  }
  .filters select {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 10px 8px;
  }
  .filters > button {
    font-size: 9px;
    padding: 8px;
  }
  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .entry-card {
    padding: 12px;
  }
  .entry-card h3 {
    font-size: 12px;
  }
  .entry-card p {
    font-size: 9px;
  }
  .card-top {
    font-size: 7px;
  }
  .card-top > span:last-child {
    display: none;
  }
  .entry-card .card-footer {
    font-size: 7px;
  }
  .result-count {
    font-size: 9px;
    white-space: nowrap;
  }
  .workspace.expanded .scene-panel {
    min-height: 580px;
  }
  footer {
    padding: 20px 15px;
    display: block;
  }
  footer p {
    font-size: 8px;
  }
  .footer-brand {
    font-size: 15px;
  }
  .toast {
    width: max-content;
    max-width: 90%;
    text-align: center;
  }
  .level-labels button,
  .node-labels button {
    font-size: 8px;
    padding: 4px 6px;
  }
  .node-labels button {
    max-width: 120px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .entry-card {
    transition: none;
  }
}
.families-section {
  padding-top: 44px;
}
.family-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}
.family-tab {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 13px;
  font-size: 12px;
  color: var(--muted);
}
.family-tab[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--paper);
  color: var(--red);
}
.family-intro {
  padding: 22px 24px;
  background: linear-gradient(100deg, var(--pale), var(--pale));
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}
.family-intro h3 {
  font-size: 27px;
  font-weight: 450;
  margin: 0 0 6px;
}
.family-core {
  color: var(--ink);
  font-size: 13px;
  margin: 0 0 8px;
}
.family-intro .small-muted {
  margin: 5px 0;
}
.family-locate {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 8px 0 0;
  font-size: 11px;
}
.family-comparisons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}
.family-comparison {
  border-left: 2px solid var(--gold);
  background: color-mix(in srgb, var(--pale) 65%, transparent);
  padding: 12px 15px;
}
.family-comparison strong {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
}
.family-comparison p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin: 6px 0 0;
}
.family-member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.family-member {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 19px;
  min-width: 0;
}
.family-member-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.family-member-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 450;
  text-align: left;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.family-member .badge {
  flex-shrink: 0;
  margin-top: 2px;
}
.family-difference {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
  margin: 12px 0;
}
.family-connection {
  border-left: 2px solid var(--pale);
  background: var(--paper);
  border-radius: 0 4px 4px 0;
  padding: 9px 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.family-example-ja {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.85;
  margin: 15px 0 5px;
}
.family-example-zh {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}
.family-caution {
  font-size: 10px;
  color: var(--muted);
  margin: 17px 0 5px;
}
.family-sources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 9px;
  color: var(--muted);
}
.family-sources a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 1000px) {
  .family-member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .families-section {
    padding-top: 30px;
  }
  .family-tab {
    min-height: 44px;
    padding: 8px 11px;
  }
  .family-member-grid {
    grid-template-columns: 1fr;
  }
  .family-intro {
    padding: 18px;
  }
  .family-intro h3 {
    font-size: 24px;
  }
  .family-member {
    padding: 17px;
  }
  .family-member-link {
    font-size: 17px;
  }
  .family-comparisons {
    grid-template-columns: 1fr;
  }
  .family-core {
    font-size: 12px;
  }
  #family-count {
    font-size: 9px;
  }
  .family-example-ja {
    font-size: 14px;
  }
}
.family-cross-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.family-cross-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.family-cross-row p {
  font-size: 11px;
  line-height: 1.9;
  margin: 6px 0;
}
.family-intro > .badge {
  display: inline-block;
  margin-bottom: 8px;
}
.family-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 15px;
}
.family-controls .search-field {
  max-width: 550px;
}
.family-controls select {
  max-width: 170px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
}
.family-controls > button {
  border: 0;
  background: transparent;
  padding: 9px;
  color: var(--muted);
  font-size: 10px;
}
.family-controls > span {
  font-size: 10px;
  color: var(--muted);
}
.family-more {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--red);
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 11px;
  margin-bottom: 18px;
}
.family-picker {
  align-items: flex-start;
}
.family-tab {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.family-caution {
  line-height: 1.9;
}
@media (max-width: 600px) {
  .family-controls .search-field {
    flex-basis: 100%;
    max-width: none;
  }
  .family-controls select {
    flex: 1;
    max-width: none;
    min-width: 0;
    min-height: 44px;
  }
  .family-controls > button {
    min-height: 44px;
  }
  .family-controls > span {
    font-size: 9px;
  }
  .family-tab {
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .masthead {
    flex-wrap: wrap;
    gap: 14px;
  }
  .masthead nav {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
  }
  .masthead nav .nav-active:before {
    margin-right: 5px;
  }
}

h1,
h2,
.family-intro h3,
.detail-title,
.jp-title {
  font-family: var(--serif);
}
body {
  background-image: radial-gradient(
    ellipse at 50% 5%,
    color-mix(in srgb, var(--paper) 75%, transparent),
    transparent 65%
  );
}
.masthead {
  padding-top: 20px;
  padding-bottom: 20px;
}
.brand img {
  width: 43px;
  height: 43px;
  object-fit: contain;
}
.brand > span {
  font-family: var(--serif);
  letter-spacing: 3px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.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;
}
.test-note {
  margin: 0 0 22px;
  padding: 12px 16px;
  border-left: 3px solid var(--red);
  background: var(--paper);
  font-size: 12px;
  color: var(--muted);
}
.test-note a {
  color: var(--red);
  margin-left: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.scene-panel {
  background:
    radial-gradient(
      ellipse at 50% 42%,
      color-mix(in srgb, var(--pale) 60%, transparent),
      transparent 68%
    ),
    var(--scene);
}
.view-switch,
.scene-actions button,
.level-labels button,
.node-labels button {
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}
.view-switch button[aria-pressed="true"] {
  background: var(--pale);
}
.node-labels button {
  border-color: var(--red);
  color: var(--red);
}
.level-panel,
.family-intro {
  background: var(--paper);
}
.family-tab[aria-pressed="true"],
.entry-card.selected,
.route-node button.selected {
  background: var(--pale);
  border-color: var(--red);
  color: var(--ink);
}
.family-comparison {
  background: var(--paper);
}
.family-comparison strong {
  color: var(--red);
}
.family-connection,
.syntax {
  background: var(--pale);
  color: var(--ink);
}
.family-sources a {
  color: var(--red);
}
.live-dot {
  box-shadow: none;
}
.entry-card p,
.usage-note,
.family-difference {
  color: var(--muted);
}
.scene-state {
  letter-spacing: 0;
}
.scene-legend {
  font-size: 10px;
}
.interaction-hint {
  font-size: 10px;
}
.scene-actions button,
.source-link {
  min-height: 38px;
}
.badge {
  font-size: 11px;
}
.detail-meaning,
.family-difference,
.family-comparison p {
  font-size: 13px;
}
.usage-note,
.small-muted {
  font-size: 12px;
}
.detail-section h3 {
  font-size: 10px;
}
.level-text strong {
  font-size: 12px;
}
.level-text small,
.level-number {
  font-size: 10px;
}
.level-footnote {
  font-size: 10px;
}
.detail-panel {
  scrollbar-color: var(--line) transparent;
}
.family-controls input,
.filters input {
  font-size: 13px;
}
button:hover {
  filter: none;
  background-color: var(--pale);
}
.family-member-link:hover,
.family-locate:hover,
.detail-route:hover {
  background: transparent;
  text-decoration: underline;
}
.family-tab {
  min-height: 40px;
}
@media (max-width: 600px) {
  .masthead {
    gap: 13px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand > span {
    font-size: 21px;
  }
  .header-actions {
    gap: 7px;
  }
  .source-link {
    padding: 7px 9px;
    display: flex;
    align-items: center;
    font-size: 11px;
  }
  .intro p {
    font-size: 12px;
  }
  .test-note {
    font-size: 11px;
  }
  .test-note a {
    display: inline-block;
    margin-left: 0;
  }
  .level-text strong {
    font-size: 10px;
  }
  .scene-legend {
    font-size: 9px;
  }
  .interaction-hint {
    font-size: 9px;
  }
  .scene-actions button {
    min-width: 34px;
  }
  .entry-card h3 {
    font-size: 14px;
  }
  .entry-card p {
    font-size: 12px;
  }
  .card-top {
    font-size: 10px;
  }
  .detail-section h3 {
    font-size: 11px;
  }
  .example-zh,
  .usage-note {
    font-size: 12px;
  }
  .family-example-zh {
    font-size: 12px;
  }
  footer p {
    font-size: 10px;
  }
  .family-tab {
    font-size: 12px;
  }
  .search-field input {
    font-size: 14px;
  }
}

.node-labels .auto-grammar-label {
  color: var(--ink);
  border-color: var(--edge, var(--line));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  font-size: 10px;
  max-width: 170px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 7%, transparent);
}
.node-labels .auto-grammar-label.featured {
  border-color: var(--red);
  color: var(--red);
}
@media (max-width: 600px) {
  .node-labels .auto-grammar-label {
    font-size: 9px;
    max-width: 125px;
  }
}
.flat-atlas {
  position: absolute;
  inset: 68px 0 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background: var(--scene);
}
.flat-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  flex-wrap: wrap;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.flat-toolbar select,
.flat-toolbar button {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 10px;
  min-height: 30px;
}
.flat-toolbar select {
  max-width: 170px;
}
.flat-summary {
  color: var(--muted);
  font-size: 10px;
  margin-left: auto;
}
.flat-zoom {
  font-size: 10px;
  min-width: 32px;
  text-align: center;
  color: var(--muted);
}
.flat-viewport {
  position: relative;
  overflow: clip;
  flex: 1;
  touch-action: none;
  cursor: grab;
  background: var(--scene);
}
.flat-viewport:active {
  cursor: grabbing;
}
.flat-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.flat-group {
  position: absolute;
  border: 2px dashed color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 12px;
  pointer-events: none;
}
.flat-group h3 {
  margin: 0;
  padding: 12px 18px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  color: var(--ink);
}
.flat-node {
  position: absolute;
  padding: 3px 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  z-index: 1;
}
.flat-node.related {
  border-color: var(--red);
}
.flat-node.selected {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}
.flat-node.muted {
  opacity: 0.3;
}
.flat-edges {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.flat-edges path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  opacity: 0.18;
}
.flat-edges path.related {
  stroke: var(--red);
  stroke-width: 2;
  opacity: 0.5;
}
.flat-edges path.selected {
  stroke: var(--red);
  stroke-width: 2.5;
  opacity: 0.8;
}
.flat-view .scene-overlay-title,
.flat-view .scene-footer,
.flat-view .scene-legend {
  display: none;
}
.overview .flat-group h3 {
  font-size: 35px;
  font-weight: 600;
}
.overview .flat-node {
  border-width: 2px;
}
@media (max-width: 600px) {
  .flat-atlas {
    inset: 57px 0 0;
  }
  .flat-toolbar {
    padding: 7px 10px;
    gap: 4px;
  }
  .flat-toolbar select {
    max-width: 145px;
    min-height: 34px;
  }
  .flat-toolbar button {
    min-height: 34px;
  }
  .flat-summary {
    width: 100%;
    margin-left: 0;
    font-size: 9px;
  }
  .flat-toolbar select,
  .flat-toolbar button {
    font-size: 9px;
  }
}

.flat-hint {
  padding: 5px 16px;
  background: var(--paper);
  color: var(--muted);
  font-size: 9px;
  border-bottom: 1px solid var(--line);
}
.flat-focus-core {
  position: absolute;
  width: 180px;
  min-height: 110px;
  border: 1px solid var(--red);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 14px;
  text-align: center;
  background: var(--paper);
  color: var(--red);
}
.flat-focus-core strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.5;
}
.flat-focus-core small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.flat-focus-node {
  position: absolute;
  width: 310px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-align: left;
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
}
.flat-focus-node strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.flat-focus-node small {
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.flat-focus-node.selected {
  border-color: var(--red);
  background: var(--pale);
  color: var(--red);
}
.flat-focus-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.flat-focus-edges path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.7;
  opacity: 0.65;
}
.flat-cross {
  padding: 9px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--paper);
  font-size: 10px;
  color: var(--muted);
}
.flat-cross:empty {
  display: none;
}
.flat-cross button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  background: var(--paper);
  color: var(--red);
  font-size: 10px;
}
.flat-focus-empty {
  position: absolute;
  left: 0;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 600px) {
  .level-panel .all-levels {
    display: flex;
    min-height: 38px;
    font-size: 11px;
    margin-top: 10px;
  }
}

/* Rich lessons remain inside the original reading panel. */
:root {
  --edge: color-mix(in srgb, var(--line) 40%, transparent);
}
#detail .grammar-article h1 {
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.5;
}
#detail .grammar-article h2 {
  font-size: 1rem;
}
#detail .grammar-article {
  min-width: 0;
}
#detail .grammar-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.node-labels .route-label {
  white-space: nowrap;
  line-height: 1.4;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  max-width: 170px;
}

.star-curtain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 72%, var(--pale));
  border-radius: 0;
}
.star-curtain[hidden] {
  display: none;
}
.star-curtain canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.star-caption {
  position: absolute;
  top: 96px;
  left: 28px;
  color: var(--ink);
  pointer-events: none;
}
.star-caption span {
  display: block;
  font: 24px var(--serif);
  letter-spacing: 0.2em;
}
.star-caption small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.25em;
  margin-top: 12px;
  opacity: 0.5;
}
.star-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.star-labels button {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.star-labels button.active {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
}
.star-labels button:hover,
.star-labels button:focus-visible {
  color: var(--red);
  border-color: var(--line);
}
.star-hint {
  position: absolute;
  bottom: 65px;
  left: 20px;
  right: 20px;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
}
.stars-view .scene-overlay-title,
.stars-view .scene-legend,
.stars-view .interaction-hint {
  display: none;
}
.stars-view .scene-toolbar {
  color: var(--muted);
}
.stars-view .scene-state {
  color: var(--muted);
}
.stars-view .scene-footer {
  color: var(--muted);
}
@media (max-width: 600px) {
  .star-labels button {
    font-size: 10px;
    max-width: 140px;
  }
  .star-caption {
    top: 100px;
  }
  .view-switch button {
    padding: 8px;
  }
}

/* The star view uses a wide canvas; the original mountain layout is retained. */
.close-star-detail {
  display: none;
}
.workspace.star-workspace,
.workspace.star-workspace.expanded {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  overflow: hidden;
}
.star-workspace .level-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  width: auto;
}
.star-workspace .level-panel > .panel-kicker,
.star-workspace .level-panel > h2,
.star-workspace .level-panel > p,
.star-workspace .level-footnote {
  display: none;
}
.star-workspace #levels {
  display: flex;
  flex: 1;
  gap: 6px;
  flex-wrap: wrap;
}
.star-workspace .level-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 7px 12px;
  min-height: 0;
  border-radius: 6px;
  border: 1px solid transparent;
}
.star-workspace .level-button.selected {
  border-color: var(--line);
}
.star-workspace .level-code {
  width: auto;
  height: auto;
  border: 0;
  padding: 0;
}
.star-workspace .level-text {
  display: none;
}
.star-workspace .level-number {
  font-size: 10px;
  opacity: 0.65;
}
.star-workspace .level-button.extension {
  border-top: 0;
}
.star-workspace .all-levels {
  width: auto;
  margin: 0;
  padding: 8px 12px;
}
.star-workspace .scene-panel {
  grid-column: 1;
  grid-row: 2;
  min-height: 620px;
  border: 0;
}
.star-workspace #scene-stage {
  height: min(76vh, 820px);
  min-height: 620px;
}
.star-workspace .detail-panel,
.workspace.star-workspace.expanded .detail-panel {
  display: none;
}
.star-workspace.star-detail-open .detail-panel {
  display: block;
  position: absolute;
  right: 16px;
  top: 82px;
  bottom: 24px;
  width: min(390px, calc(100% - 32px));
  z-index: 12;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--ink) 12%, transparent);
  padding: 24px;
  overflow: auto;
}
.star-workspace.star-detail-open .detail-panel #detail {
  max-height: none;
  overflow: visible;
}
.star-workspace .close-star-detail {
  display: block;
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}
.star-workspace .star-labels button {
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  padding: 3px 7px;
  font-size: 12px;
  text-shadow: 0 1px 3px var(--paper);
}
.star-workspace .star-labels button.active {
  background: var(--paper);
}
.star-workspace .star-caption {
  top: 88px;
  left: 30px;
}
.star-workspace .star-caption span {
  font-size: 20px;
}
.star-workspace .star-hint {
  bottom: 24px;
}
.star-workspace .scene-footer {
  bottom: 18px;
}
@media (max-width: 600px) {
  .star-workspace .level-panel {
    padding: 10px;
    gap: 6px;
  }
  .star-workspace #levels {
    gap: 2px;
  }
  .star-workspace .level-button {
    padding: 6px 8px;
    gap: 4px;
  }
  .star-workspace .level-number {
    display: none;
  }
  .star-workspace .all-levels {
    font-size: 11px;
    padding: 6px;
  }
  .star-workspace .scene-panel,
  .star-workspace #scene-stage {
    min-height: 540px;
  }
  .star-workspace .star-labels button {
    font-size: 10px;
  }
  .star-workspace .star-hint {
    bottom: 66px;
  }
  .star-workspace.star-detail-open .detail-panel {
    top: 70px;
    bottom: 12px;
  }
}

.star-workspace .scene-footer {
  justify-content: flex-end;
}
.star-workspace .star-hint {
  bottom: 68px;
}

.mountain-browse {
  position: absolute;
  z-index: 8;
  top: 78px;
  right: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 40px);
  color: var(--ink);
  font-size: 11px;
}
.mountain-browse[hidden] {
  display: none;
}
.mountain-browse button,
.mountain-browse select {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 9px;
  min-height: 34px;
  font: inherit;
}
.mountain-browse button:disabled {
  opacity: 0.35;
  cursor: default;
}
@media (max-width: 600px) {
  .mountain-browse {
    top: 100px;
    left: 12px;
    right: 12px;
    max-width: none;
    gap: 5px;
  }
  .mountain-browse button,
  .mountain-browse select {
    padding: 6px;
  }
  .scene-panel:has(.mountain-browse:not([hidden])) .scene-overlay-title {
    display: none;
  }
}
