:root {
  --ink: #1b1612;
  --paper: #f4efe4;
  --paper-2: #fffdf7;
  --cinnabar: #9c2b1d;
  --line: #d8cfc0;
}

html {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, .navbar-brand, .ng-prose {
  font-family: "Noto Serif SC", serif;
}

html[lang="en"] body {
  font-family: "Noto Sans", "Noto Sans SC", sans-serif;
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] .navbar-brand,
html[lang="en"] .ng-prose {
  font-family: "Noto Serif", "Noto Serif SC", serif;
}

.ng-nav {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ng-nav-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.ng-account {
  position: relative;
}

.ng-account-toggle.nav-link {
  background: none;
  border: none;
  cursor: pointer;
}

.ng-account-menu {
  display: none;
  position: absolute;
  top: calc(100% - 0.15rem);
  right: 0;
  min-width: 11rem;
  padding: 0.4rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(27, 22, 18, 0.08);
  z-index: 30;
}

.ng-account:hover .ng-account-menu,
.ng-account:focus-within .ng-account-menu,
.ng-account.is-open .ng-account-menu {
  display: block;
}

.ng-account-item {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
}

.ng-account-item:hover,
.ng-account-item:focus-visible {
  background: #f7f1e6;
  color: var(--cinnabar);
}

.ng-account-page {
  max-width: 52rem;
}

.ng-table-wrap {
  overflow-x: auto;
}

.ng-ledger {
  width: 100%;
  border-collapse: collapse;
}

.ng-ledger th,
.ng-ledger td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.ng-ledger th {
  color: #6b6256;
  font-weight: 500;
  font-size: 0.85rem;
}

.ng-delta-pos {
  color: #2d6a4f;
}

.ng-delta-neg {
  color: var(--cinnabar);
}

@media (max-width: 991.98px) {
  .ng-account-menu {
    position: static;
    margin: 0 0 0.35rem;
    box-shadow: none;
  }
}

.ng-logo-about {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 auto 1.15rem;
}

.ng-hero {
  padding: 2.5rem 0 1rem;
}

.ng-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.2;
}

.ng-kicker {
  color: var(--cinnabar);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

.ng-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.ng-library-head h1 {
  margin: 0;
}

.ng-library-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ng-library-title h1 {
  flex: 0 0 auto;
  width: auto;
}

.ng-write-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--cinnabar);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 500;
  flex-shrink: 0;
}

.ng-write-plus:hover,
.ng-write-plus:focus-visible {
  background: #f7f1e6;
  color: var(--cinnabar);
  border-color: var(--cinnabar);
}

.ng-write-page {
  max-width: 640px;
}

.ng-write-page h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.ng-char-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
}

.ng-char-row > .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.ng-ai-char-btn {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--cinnabar);
  padding: 0;
  line-height: 1;
}

.ng-ai-char-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ng-ai-char-btn:hover,
.ng-ai-char-btn:focus-visible {
  background: #f7f1e6;
  border-color: var(--cinnabar);
}

.ng-ai-char-btn:disabled {
  opacity: 0.55;
}

.ng-country-filter {
  margin-left: auto;
  width: min(220px, 46vw);
}

.ng-country {
  font-size: 0.85rem;
  font-weight: 500;
  color: #6b6256;
}

.ng-generated-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ng-generated-title h2 {
  margin: 0;
}

.ng-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
}

.ng-me-book-title {
  color: inherit;
  text-decoration-color: var(--line);
}

.ng-me-book-title:hover {
  color: var(--cinnabar);
}

.ng-me-tree,
.ng-me-tree ul,
.ng-me-tree li {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

.ng-me-tree .ng-card {
  flex-wrap: wrap;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
}

.ng-me-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
}

.ng-me-tree .ng-card > .ng-me-actions {
  flex: 1 1 16rem;
  justify-content: flex-end;
}

.ng-me-tree .btn {
  white-space: nowrap;
}

.ng-me-tree .ng-me-tree {
  margin: 0.35rem 0 0.15rem 0.35rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--line);
}

.ng-me-fork {
  margin: 0.2rem 0 0.35rem;
  color: #6b6256;
  font-size: 0.82rem;
  overflow-wrap: break-word;
}

@media (max-width: 576px) {
  .ng-me-tree .ng-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0.9rem 0.95rem;
  }

  .ng-me-tree .ng-card > .ng-me-actions,
  .ng-me-actions {
    flex: 0 0 auto;
    justify-content: flex-start;
    width: 100%;
  }

  .ng-me-tree .ng-me-tree {
    margin-left: 0;
    padding-left: 0.55rem;
  }
}

.ng-fold {
  position: relative;
  padding-right: 2.65rem;
}

.ng-fold-toggle {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b6256;
  cursor: pointer;
}

.ng-fold-toggle:hover,
.ng-fold-toggle:focus-visible {
  background: #f7f1e6;
  color: var(--cinnabar);
}

.ng-fold-toggle::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 7px auto 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-135deg);
  transition: transform 0.15s ease;
}

.ng-fold.is-collapsed .ng-fold-toggle::before {
  margin-top: 5px;
  transform: rotate(45deg);
}

.ng-fold.is-collapsed .ng-fold-body {
  display: none;
}

.ng-fold.is-collapsed .ng-fold-title {
  margin-bottom: 0;
}

.ng-fold-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.ng-fold-title-row .ng-fold-title {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.ng-node-edit {
  flex: 0 0 auto;
}

.ng-edit-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.ng-edit-copy-btn {
  display: inline-flex;
  margin-left: auto;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  line-height: 1;
}

.ng-edit-copy-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.ng-edit-copy-btn:hover,
.ng-edit-copy-btn.is-copied {
  color: var(--cinnabar);
}

@media (min-width: 768px) {
  #edit-node-modal .ng-edit-dialog {
    --bs-modal-width: min(96vw, 1600px);
    max-width: min(96vw, 1600px);
    width: min(96vw, 1600px);
  }

  .ng-edit-split .ng-edit-original,
  .ng-edit-split #edit-node-content {
    min-height: 380px;
    height: min(55vh, 480px);
    resize: none;
  }
}

.ng-edit-original {
  background: var(--paper);
  font-family: "Noto Serif SC", serif;
  line-height: 1.7;
}

@media (max-width: 767.98px) {
  .ng-edit-split {
    flex-direction: column;
  }

  .ng-edit-split > [class*="col-"] {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .ng-edit-split .ng-edit-original,
  .ng-edit-split #edit-node-content {
    min-height: 180px;
    height: 180px;
    resize: none;
  }
}

.ng-card .h5 {
  margin-top: 1.15rem;
}

.ng-support a:hover {
  color: var(--cinnabar);
}

.ng-support section[id] {
  scroll-margin-top: 1rem;
}

.ng-support .h6 {
  margin-top: 0.9rem;
  font-weight: 600;
}

.ng-quote {
  border-left: 3px solid var(--cinnabar);
  padding-left: 1rem;
  color: #4b4338;
}

.btn-ng {
  background: var(--cinnabar);
  color: #fff;
  border: none;
}

.btn-ng:hover {
  background: #7d2116;
  color: #fff;
}

.btn-ng-danger {
  background: transparent;
  color: var(--cinnabar);
  border: 1px solid var(--cinnabar);
}

.btn-ng-danger:hover {
  background: var(--cinnabar);
  color: #fff;
}

.ng-prose {
  font-size: 1.08rem;
  line-height: 2;
  white-space: pre-wrap;
}

.ng-badge {
  display: inline-block;
  border: 1px solid var(--cinnabar);
  color: var(--cinnabar);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.82rem;
}

.ng-state {
  background: #f7f1e6;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
}

.ng-history {
  padding-left: 0;
}

.ng-history-item {
  cursor: pointer;
  padding: 0.28rem 0;
}

.ng-path {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  counter-reset: path-node;
}

.ng-path li {
  cursor: pointer;
  counter-increment: path-node;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.28rem 0;
}

.ng-path li::before {
  content: "";
  order: -2;
  flex: 0 0 6px;
  width: 0;
  height: 0;
  margin-top: 0.48em;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid transparent;
}

.ng-path li.is-current {
  font-weight: 700;
  color: var(--ink);
}

.ng-path li.is-current::before {
  border-left-color: var(--cinnabar);
}

.ng-path li a {
  color: inherit;
  text-decoration: none;
  flex: 1 1 auto;
}

.ng-path li::after {
  content: counter(path-node) ".";
  order: -1;
  flex: 0 0 auto;
  min-width: 1.4em;
  font-variant-numeric: tabular-nums;
}

.ng-tree {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#tree.ng-tree .ng-tree-node {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.ng-tree-index {
  flex: 0 0 auto;
  min-width: 1.6em;
  font-variant-numeric: tabular-nums;
  color: #6b6256;
}

.ng-tree-node {
  display: block;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.ng-tree-node.is-current {
  border-color: var(--cinnabar);
}

.ng-tree-node .meta {
  color: #6b6256;
  font-size: 0.82rem;
}

.ng-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 0.4rem 0;
  color: #6b6256;
  font-size: 0.85rem;
}

.ng-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 2rem;
}

.ng-footer-copy {
  grid-column: 1;
  justify-self: start;
  margin: 0;
}

.ng-footer-tagline {
  grid-column: 2;
  text-align: center;
}

.ng-footer-links {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
}

.ng-footer-links a,
.ng-lang-btn {
  color: #6b6256;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.ng-footer-links a:hover,
.ng-lang-btn:hover {
  color: var(--cinnabar);
}

.ng-lang {
  position: relative;
}

.ng-lang-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.55rem);
  min-width: 10rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  box-shadow: 0 8px 24px rgba(27, 22, 18, 0.08);
  z-index: 20;
}

.ng-lang-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
}

.ng-lang-option:hover,
.ng-lang-option.is-active {
  background: #f7f1e6;
  color: var(--cinnabar);
}

@media (max-width: 575.98px) {
  .ng-footer-inner {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.15rem 0;
  }

  .ng-footer-copy,
  .ng-footer-tagline,
  .ng-footer-links {
    grid-column: 1;
    justify-self: center;
  }
}

.ng-work-link {
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--line);
  padding: 0.35rem 0;
}

.ng-work-link:hover {
  color: var(--cinnabar);
}

.btn.choice-btn {
  --bs-btn-color: var(--ink);
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: var(--cinnabar);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-bg: #fff;
  --bs-btn-active-border-color: var(--ink);
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  text-align: left;
  color: var(--ink);
  background-color: #fff;
  border-color: var(--ink);
}
.btn.choice-btn:hover,
.btn.choice-btn:focus,
.btn.choice-btn:focus-visible,
.btn.choice-btn:active {
  color: var(--ink);
  background-color: #fff;
  border-color: var(--cinnabar);
  box-shadow: none;
}
.choice-btn::before {
  content: "";
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2em;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}
.choice-btn.is-active::before {
  background: var(--ink);
}
.choice-copy {
  flex: 1;
  min-width: 0;
  color: inherit;
}
.btn.choice-btn.is-active,
.btn.choice-btn.is-active:hover,
.btn.choice-btn.is-active:focus,
.btn.choice-btn.is-active:focus-visible,
.btn.choice-btn.is-active:active {
  --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-border-color: var(--ink);
  color: var(--ink);
  background-color: #fff;
  border-color: var(--ink);
  box-shadow: none;
}

.ng-play-block {
  margin-bottom: 1.2rem;
}

.ng-play-block .h6 {
  margin-bottom: 0.4rem;
}

.ng-write-block {
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.ng-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ng-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.3;
  text-decoration: none;
}

.ng-chip:hover:not(:disabled) {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.ng-chip.is-active {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: #f7f1e6;
}

.ng-chip:disabled {
  opacity: 0.55;
}

.ng-chip-mark {
  margin-right: 0.2rem;
}

.ng-chip-stack {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  text-align: center;
  line-height: 1.15;
  padding: 0.42rem 0.85rem;
  border-radius: 1rem;
  min-width: 4.8rem;
}

.ng-chip-label {
  display: block;
}

.ng-chip-sub {
  display: block;
  font-size: 0.72rem;
  color: #6b6256;
  line-height: 1.2;
}

.ng-chip:hover:not(:disabled) .ng-chip-sub,
.ng-chip.is-active .ng-chip-sub {
  color: var(--cinnabar);
}

.ng-work .ng-prose {
  text-indent: 2em;
}

.ng-work-book {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.ng-work-book-icon {
  width: 1.7em;
  height: 1.7em;
  flex: 0 0 auto;
  object-fit: contain;
}

.ng-work-beat {
  font-weight: 700;
}

.ng-work-page-input {
  width: 2.8em;
  margin: 0 0.15rem;
  padding: 0.05rem 0.2rem;
  text-align: center;
  font-size: inherit;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  vertical-align: middle;
}

.ng-work-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 1rem;
}

.ng-work-pager .disabled {
  pointer-events: none;
  opacity: 0.45;
}

.ng-work-pager-symbol {
  display: none;
}

@media (max-width: 576px) {
  .ng-work-pager {
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  .ng-work-pager .btn {
    padding: 0.15rem 0.45rem;
    font-size: 0.95rem;
    min-width: 2.1rem;
  }

  .ng-work-pager-label {
    display: none;
  }

  .ng-work-pager-symbol {
    display: inline;
  }

  .ng-work-pager #work-page-status {
    flex: 1 1 auto;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
  }
}

.ng-hero-tagline {
  color: var(--cinnabar);
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  margin: 0.65rem 0 1rem;
}

.ng-interval {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0.35rem auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}

.ng-interval button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.4rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
}

.ng-interval button.is-on {
  background: var(--cinnabar);
  color: #fffdf7;
}

.ng-plan-year-note {
  color: var(--cinnabar);
  font-size: 0.85rem;
  margin: -0.35rem 0 0.75rem;
}

.ng-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ng-plan {
  position: relative;
  overflow: hidden;
}

.ng-plan.is-featured {
  border: 2px solid var(--cinnabar);
}

.ng-plan-hot {
  position: absolute;
  top: 16px;
  right: -38px;
  width: 132px;
  padding: 0.32rem 0;
  background: var(--cinnabar);
  color: #fffdf7;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-align: center;
  transform: rotate(45deg);
  pointer-events: none;
}

.ng-plan-price {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.ng-plan-list {
  padding-left: 1.1rem;
  margin: 0 0 1rem;
}

.ng-hero-home {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.8rem 0 1.4rem;
}

.ng-hero-home .lead {
  margin: 0.9rem auto 0;
}

.ng-home-section {
  margin-top: 3.2rem;
}

.ng-home-section h2 {
  font-size: clamp(1.55rem, 3.6vw, 2.2rem);
  line-height: 1.25;
}

.ng-home-narrow {
  max-width: 36rem;
}

.ng-home-demo {
  max-width: 42rem;
  margin: 0 auto;
}

.ng-home-hook {
  font-weight: 600;
  margin-bottom: 1.1rem;
}

.ng-home-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ng-home-choice {
  flex: 1 1 9.5rem;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.ng-home-choice:hover,
.ng-home-choice:focus-visible {
  border-color: var(--cinnabar);
}

.ng-home-choice.is-selected {
  border-color: var(--ink);
  background: #f7f1e6;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.ng-home-result {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.ng-home-result-line {
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cinnabar);
}

html[lang="en"] .ng-home-result-line {
  font-family: "Noto Serif", "Noto Serif SC", serif;
}

.ng-home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ng-home-stat {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.ng-home-stat span {
  display: block;
  color: #6b6256;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.ng-home-stat strong {
  display: block;
  font-size: 1.05rem;
}

.ng-home-tree {
  max-width: 34rem;
  margin: 1.4rem auto 0;
}

.ng-tree-node {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-weight: 600;
}

.ng-tree-node.is-branch {
  border-color: var(--ink);
}

.ng-tree-node.is-yours {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.ng-tree-stem {
  width: 1px;
  height: 1.1rem;
  margin: 0 auto;
  background: var(--ink);
}

.ng-tree-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  position: relative;
}

.ng-tree-split::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1px;
  background: var(--ink);
}

.ng-tree-branch {
  text-align: center;
}

.ng-tree-branch .ng-tree-stem:first-child,
.ng-tree-branch .ng-tree-node:first-child {
  margin-top: 0;
}

.ng-tree-note {
  margin: 0.45rem 0 0;
  color: #6b6256;
  font-size: 0.9rem;
}

.ng-home-grid,
.ng-home-worlds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.ng-home-grid .h5 {
  margin-top: 0;
}

.ng-home-chain {
  list-style: none;
  max-width: 22rem;
  margin: 1.3rem auto 0;
  padding: 0;
}

.ng-home-chain li {
  position: relative;
  padding: 0.45rem 0 1.15rem;
  font-weight: 600;
}

.ng-home-chain li:not(:last-child)::after {
  content: "↓";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  transform: translateX(-50%);
  color: var(--cinnabar);
  font-weight: 400;
}

.ng-home-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1rem;
}

.ng-home-pills span {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-weight: 600;
}

.ng-home-world .ng-kicker {
  margin-bottom: 0.35rem;
}

.ng-home-close {
  padding: 1.2rem 0 0.4rem;
}

.ng-home-brand {
  font-family: "Noto Serif SC", serif;
  font-size: 1.2rem;
  color: var(--cinnabar);
  letter-spacing: 0.04em;
}

html[lang="en"] .ng-home-brand {
  font-family: "Noto Serif", "Noto Serif SC", serif;
}

@media (max-width: 575.98px) {
  .ng-home-stats,
  .ng-tree-split {
    grid-template-columns: 1fr;
  }

  .ng-tree-split::before {
    display: none;
  }
}
