﻿.nx {
  font-family: var(--nx-font);
  font-size: var(--nx-text-size);
  line-height: 1.5;
  color: var(--nx-text);
  background: var(--nx-bg);
}
.nx * {
  box-sizing: border-box;
}
.nx [hidden] {
  display: none !important;
}
.nx button,
.nx input,
.nx select,
.nx textarea {
  font: inherit;
}
.nx a {
  color: var(--nx-primary);
  text-underline-offset: 3px;
}
.nx svg {
  flex: none;
  vertical-align: middle;
}
.nx h1,
.nx h2 {
  font-size: var(--nx-title-size);
  line-height: 1.25;
  font-weight: 600;
  margin: 0;
}
.nx h3 {
  font-size: var(--nx-section-size);
  line-height: 1.35;
  font-weight: 600;
  color: var(--nx-text);
  margin: 0 0 var(--nx-space-3);
}
.nx p {
  margin: var(--nx-space-2) 0;
}
.nx small,
.nx .nx-meta {
  font-size: var(--nx-meta-size);
  color: var(--nx-text-muted);
}
.nx :focus-visible {
  outline: var(--nx-focus-width) solid var(--nx-focus);
  outline-offset: 3px;
}
.nx :where(button, a, input, select, textarea, summary) {
  scroll-margin-block: 100px;
}
.nx :where(h1, h2, h3)[tabindex="-1"]:focus {
  outline: none;
}
.nx-button,
.nx-health button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  min-height: var(--nx-touch);
  max-width: 100%;
  padding: 10px 14px;
  margin: 0;
  border: 1px solid var(--nx-control-border);
  border-radius: var(--nx-radius-control);
  color: var(--nx-text);
  background: var(--nx-surface);
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.nx-button:hover,
.nx-health button:hover {
  background: var(--nx-surface-muted);
}
.nx .nx-button[data-variant="primary"],
.nx-health .nh-primary,
.nx-health .nh-doctor {
  color: var(--nx-on-primary);
  background: var(--nx-primary);
  border-color: var(--nx-primary);
}
.nx .nx-button[data-variant="primary"]:hover,
.nx-health .nh-primary:hover,
.nx-health .nh-doctor:hover {
  background: var(--nx-primary-hover);
}
.nx-button[data-variant="quiet"] {
  border-color: transparent;
  background: transparent;
  color: var(--nx-primary);
}
.nx-button[data-variant="danger"] {
  color: var(--nx-danger);
  border-color: var(--nx-danger);
}
.nx-button[aria-busy="true"] {
  cursor: progress;
}
.nx-button:disabled,
.nx-health button:disabled {
  opacity: 1;
  color: var(--nx-text-muted);
  background: var(--nx-surface-muted);
  border-color: var(--nx-border);
  cursor: not-allowed;
}
.nx-card,
.nx-health .nh-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-card);
  padding: var(--nx-space-4);
  margin-bottom: var(--nx-space-4);
  min-width: 0;
}
.nx-card .nx-card,
.nx-health .nh-card .nh-card {
  padding: var(--nx-space-3) 0;
  border: 0;
  border-bottom: 1px solid var(--nx-border);
  border-radius: 0;
  background: transparent;
  margin: 0;
}
.nx-row,
.nx-health .nh-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nx-space-3);
  width: 100%;
  min-height: 72px;
  text-align: left;
  border: 0;
  border-radius: 0;
  padding: var(--nx-space-3) var(--nx-space-4);
  background: transparent;
  color: var(--nx-text);
  cursor: pointer;
  font-weight: 400;
}
.nx-row:hover,
.nx-health .nh-row:hover {
  background: var(--nx-surface-muted);
}
.nx-row-body {
  min-width: 0;
  flex: 1;
}
.nx-row-body > strong {
  display: block;
  font-weight: 600;
}
.nx-row-body p {
  font-size: var(--nx-meta-size);
  color: var(--nx-text-muted);
  margin: var(--nx-space-1) 0;
}
.nx-row > svg {
  color: var(--nx-primary);
}
.nx-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.nx-list > li + li {
  border-top: 1px solid var(--nx-border);
}
.nx-badge,
.nx-health .nh-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.5;
  background: var(--nx-surface-muted);
  color: var(--nx-text-muted);
  margin: 3px 4px 3px 0;
  font-weight: 500;
}
.nx-badge[data-tone="success"],
.nx-health .nh-badge.current {
  color: var(--nx-success-text);
  background: var(--nx-success-soft);
}
.nx-badge[data-tone="warning"],
.nx-health .nh-badge.to_verify {
  color: var(--nx-warning);
  background: var(--nx-warning-soft);
}
.nx-badge[data-tone="danger"] {
  color: var(--nx-danger);
  background: var(--nx-danger-soft);
}
.nx-badge[data-tone="info"],
.nx-health .nh-badge.archived {
  color: var(--nx-primary);
  background: var(--nx-primary-soft);
}
.nx-field,
.nx-health label {
  display: block;
  margin: 0 0 var(--nx-space-4);
  font-weight: 500;
}
.nx-control,
.nx-health input:not([type="checkbox"]):not([type="radio"]),
.nx-health textarea,
.nx-health select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: var(--nx-touch);
  padding: 10px 12px;
  margin-top: var(--nx-space-1);
  border: 1px solid var(--nx-control-border);
  border-radius: var(--nx-radius-control);
  background: var(--nx-surface);
  color: var(--nx-text);
  font-weight: 400;
}
.nx textarea,
.nx-health textarea {
  min-height: 112px;
  resize: vertical;
}
.nx-control[aria-invalid="true"] {
  border-color: var(--nx-danger);
}
.nx-field-help {
  display: block;
  font-size: var(--nx-meta-size);
  color: var(--nx-text-muted);
  font-weight: 400;
  margin-top: var(--nx-space-1);
}
.nx-field-error {
  display: block;
  color: var(--nx-danger);
  font-size: var(--nx-meta-size);
  margin-top: var(--nx-space-1);
}
.nx input[type="checkbox"],
.nx input[type="radio"] {
  accent-color: var(--nx-primary);
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-inline: 0 var(--nx-space-2);
}
.nx label:has(> input[type="checkbox"]),
.nx label:has(> input[type="radio"]) {
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nx-space-1);
  font-weight: 400;
}
.nx input[type="file"] {
  max-width: 100%;
  font-size: var(--nx-meta-size);
}
.nx input[type="file"]::file-selector-button {
  min-height: 44px;
  background: var(--nx-surface);
  color: var(--nx-text);
  border: 1px solid var(--nx-control-border);
  border-radius: var(--nx-radius-control);
  margin-right: 8px;
  padding: 8px;
}
.nx-alert,
.nx-health .nh-alert {
  display: block;
  padding: var(--nx-space-3) var(--nx-space-4);
  border: 1px solid var(--nx-primary);
  border-inline-start: 4px solid var(--nx-primary);
  border-radius: var(--nx-radius-control);
  color: var(--nx-text);
  background: var(--nx-primary-soft);
  margin: var(--nx-space-3) 0;
}
.nx-alert[data-tone="error"] {
  border-color: var(--nx-danger);
  background: var(--nx-danger-soft);
  color: var(--nx-danger);
}
.nx-alert[data-tone="warning"],
.nx-alert[data-tone="conflict"] {
  border-color: var(--nx-warning);
  background: var(--nx-warning-soft);
  color: var(--nx-warning);
}
.nx-alert[data-tone="success"] {
  border-color: var(--nx-success-text);
  background: var(--nx-success-soft);
  color: var(--nx-success-text);
}
.nx-filters,
.nx-health .nh-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nx-space-2);
  margin: var(--nx-space-3) 0;
}
.nx-filters button {
  min-height: 44px;
  border-radius: var(--nx-radius-control);
  padding: 8px 12px;
}
.nx-filters button[aria-pressed="true"],
.nx-health .nh-tabs button[aria-pressed="true"] {
  background: var(--nx-primary-soft);
  border-color: var(--nx-primary);
  color: var(--nx-primary);
  font-weight: 600;
}
.nx-module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-1);
  border-bottom: 1px solid var(--nx-border);
  margin-bottom: var(--nx-space-6);
  padding-bottom: var(--nx-space-2);
}
.nx-module-nav button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--nx-radius-control);
  color: var(--nx-text-muted);
  cursor: pointer;
}
.nx-module-nav button[aria-current="page"] {
  background: var(--nx-primary-soft);
  color: var(--nx-primary);
  font-weight: 600;
  box-shadow: inset 0 -3px var(--nx-primary);
}
.nx-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-2);
  align-items: center;
}
.nx-skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 50;
  background: var(--nx-surface);
  color: var(--nx-primary);
  padding: 12px;
}
.nx-skip:focus {
  top: 12px;
}
.nx-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: nx-spin 0.8s linear infinite;
}
@keyframes nx-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nx * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .nx button,
  .nx-card,
  .nx-control,
  .nx-alert {
    border: 1px solid ButtonText;
  }
  .nx-module-nav [aria-current="page"] {
    outline: 2px solid Highlight;
  }
}
.nx-health {
  max-width: 1160px;
  margin: auto;
  min-width: 0;
}
.nx-health .nh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.nx-health .nh-header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.nx-health .nh-note {
  font-size: var(--nx-meta-size);
  color: var(--nx-text-muted);
}
.nx-health .nh-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.nx-health .nh-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 112px;
  padding: 16px;
  background: var(--nx-surface);
  border-color: var(--nx-border);
  border-radius: var(--nx-radius-card);
  text-align: left;
}
.nx-health .nh-doctor {
  min-height: 100px;
  background: var(--nx-primary);
  color: var(--nx-on-primary);
  border-color: var(--nx-primary);
}
.nx-health .nh-doctor small,
.nx-health .nh-doctor span {
  color: inherit;
}
.nx-health .nh-count {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--nx-primary);
}
.nx-health .nh-card {
  margin: 12px 0;
}
.nx-health .nh-card .nh-card {
  margin: 0;
  padding: 0;
}
.nx-health .nh-row {
  display: block;
  text-align: left;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.nx-health .nh-row strong {
  display: block;
  font-size: 1rem;
}
.nx-health .nh-row p {
  margin: 4px 0;
}
.nx-health .nh-empty {
  padding: 16px;
  background: var(--nx-surface-muted);
  border-radius: var(--nx-radius-control);
  color: var(--nx-text-muted);
}
.nx-health .nh-facts {
  margin: 0;
}
.nx-health .nh-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--nx-border);
}
.nx-health dt {
  color: var(--nx-text-muted);
}
.nx-health dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.nx-health .nh-copy,
.nx-health .nh-detail {
  white-space: pre-wrap;
}
.nx-health .nh-source {
  display: block;
  padding: 12px 0;
  overflow-wrap: anywhere;
}
.nx-health .nh-timeline {
  border-left: 2px solid var(--nx-primary);
  padding-left: 20px;
  margin-left: 8px;
}
.nx-health .nh-timeline > article {
  position: relative;
}
.nx-health .nh-timeline > article:before {
  content: "";
  width: 10px;
  height: 10px;
  position: absolute;
  left: -26px;
  top: 24px;
  border-radius: 50%;
  background: var(--nx-primary);
}
.nx-health .nh-form {
  padding: 16px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-panel);
}
.nx-health .nh-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.nx-health details {
  padding: 12px 0;
  border-bottom: 1px solid var(--nx-border);
}
.nx-health summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.nx-health button {
  margin: 4px 4px 4px 0;
}
.nx-health .nx-module-nav {
  margin: 16px 0 24px;
}
.nx-health .nh-tabs {
  margin: 12px 0;
}
.nx-health fieldset {
  min-width: 0;
  border: 1px solid var(--nx-border);
  border-radius: 10px;
  padding: 12px;
}
.nx-health .nh-loading {
  padding: 24px;
}
.nx-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
.nx-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--nx-border);
  background: var(--nx-surface);
}
.nx-brand {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
}
.nx-shell-main {
  padding: 24px 16px;
  min-width: 0;
}
.nx-global-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: var(--nx-surface);
  border-top: 1px solid var(--nx-border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nx-global-nav button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  padding: 8px;
  font-size: 0.875rem;
  min-width: 44px;
  background: transparent;
}
.nx-global-nav button[aria-current="page"] {
  color: var(--nx-primary);
  background: var(--nx-primary-soft);
}
.nx-preview-note {
  font-size: 0.875rem;
  color: var(--nx-text-muted);
  margin: 0;
}
.nx-gallery {
  display: grid;
  gap: 24px;
  max-width: 1000px;
  margin: auto;
}
.nx-gallery section {
  min-width: 0;
}
.nx-health > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.nx-theme-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nx-theme-label select {
  max-width: 130px;
  min-height: 44px;
  background: var(--nx-surface);
  color: var(--nx-text);
  border: 1px solid var(--nx-control-border);
  border-radius: 10px;
  padding: 8px;
}
.nx-health input,
.nx-health select {
  font-size: 1rem;
}
@media (min-width: 600px) {
  .nx-shell-main {
    padding: 32px;
  }
  .nx-health .nh-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .nx-health .nh-doctor {
    padding: 24px;
  }
  .nx-health .nh-facts > div {
    grid-template-columns: minmax(180px, 1fr) 2fr;
  }
}
@media (min-width: 960px) {
  .nx-shell {
    grid-template-columns: 200px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    padding-bottom: 0;
  }
  .nx-shell-header {
    grid-column: 1/-1;
    padding: 16px 24px;
  }
  .nx-global-nav {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    grid-row: 2;
    grid-column: 1;
    align-self: start;
    flex-direction: column;
    border-top: 0;
    border-right: 1px solid var(--nx-border);
    min-height: calc(100dvh - 78px);
    justify-content: flex-start;
    padding: 24px 12px;
    gap: 8px;
  }
  .nx-global-nav button {
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    font-size: 1rem;
  }
  .nx-shell-main {
    grid-column: 2;
    grid-row: 2;
    padding: 32px;
  }
  .nx-health .nh-timeline {
    max-width: 900px;
  }
}
@media (max-width: 359px) {
  .nx-global-nav button {
    font-size: 0.75rem;
    padding: 8px 4px;
  }
  .nx-shell-main {
    padding: 16px 12px;
  }
  .nx-health .nx-module-nav button {
    flex: 1;
    padding: 8px;
  }
  .nx-health .nh-facts > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.nx-health .nx-module-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 4px 12px;
  scroll-padding: 8px;
}
.nx-health .nx-module-nav button {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
}
.nx-health .nh-grid {
  gap: 12px;
}
.nx-health .nh-grid button {
  margin: 0;
}
.nx-health .nh-tile strong {
  font-weight: 600;
}
.nx-detail-layout {
  min-width: 0;
}
.nx-detail-list {
  display: none;
}
.nx-detail-content {
  min-width: 0;
}
.nx-health .nx-detail-list button {
  display: block;
  width: 100%;
  text-align: left;
  white-space: normal;
  border: 0;
  border-bottom: 1px solid var(--nx-border);
  border-radius: 0;
  background: transparent;
  padding: 12px;
  min-height: 60px;
  margin: 0;
}
.nx-health .nx-detail-list button[aria-pressed="true"] {
  background: var(--nx-primary-soft);
  color: var(--nx-primary);
  box-shadow: inset 3px 0 var(--nx-primary);
}
@media (min-width: 600px) {
  .nx-detail-layout {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr);
    gap: 24px;
  }
  .nx-detail-list {
    display: block;
    align-self: start;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 14px;
    padding: 16px 8px;
  }
  .nx-detail-list h3 {
    padding: 0 8px;
  }
  .nx-detail-content > .nh-card {
    margin-top: 0;
  }
}
.nx-shell-header {
  flex-wrap: wrap;
}
.nx-shell {
  padding-bottom: calc(var(--nx-dock-height, 88px) + 16px);
}
.nx :where(button, a, input, select, textarea, summary) {
  scroll-margin-block: calc(var(--nx-dock-height, 88px) + 24px);
}
.nx-global-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}
.nx-global-nav button {
  min-width: 0;
  overflow-wrap: anywhere;
}
.nx-health .nh-tabs button {
  max-width: 100%;
  white-space: normal;
}
@media (min-width: 960px) {
  .nx-shell {
    padding-bottom: 0;
  }
  .nx-global-nav {
    display: flex;
  }
  .nx :where(button, a, input, select, textarea, summary) {
    scroll-margin-block: 24px;
  }
}
.nx-shell-header > div {
  flex: 1;
  min-width: 110px;
}
.nx-theme-label {
  flex-wrap: wrap;
}
.nx-theme-label select {
  max-width: 100%;
}
