:root {
  --nc-ink: #0f172a;
  --nc-muted: #526277;
  --nc-line: #d5e0ec;
  --nc-bg: #e7eef6;
  --nc-card: #ffffff;
  --nc-rail: #f4f6f8;
  --nc-blue: #1d5fa7;
  --nc-deep: #163a5f;
  --nc-accent: #00a8e8;
  --nc-ok: #0f7a45;
  --nc-wait: #9a6700;
  --nc-off: #9a3412;
  --nc-font: "Manrope", "Segoe UI", sans-serif;
  --nc-display: "Sora", "Segoe UI", sans-serif;
  --nc-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.nc-host-app {
  min-height: 100vh;
  background: var(--nc-bg);
  color: var(--nc-ink);
  font-family: var(--nc-font);
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.nc-host-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding: 0 1rem;
  background: #163a5f;
  color: #fff;
  border-bottom: 3px solid #1d5fa7;
  position: sticky;
  top: 0;
  z-index: 5;
}
.nc-host-brand { display: flex; align-items: center; gap: 0.55rem; color: #fff; font-family: var(--nc-display); font-weight: 700; }
.nc-host-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.8rem; height: 1.8rem; border-radius: 6px; background: var(--nc-blue); color: #fff; font-size: 0.72rem;
}
.nc-host-brand small { display: block; font-family: var(--nc-font); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: #c5d4e6; }
.nc-host-domain-chip { margin-left: auto; padding: 0.28rem 0.7rem; border-radius: 2px; background: rgba(255,255,255,0.12); color: #fff; font-family: var(--nc-mono); font-size: 0.82rem; }
.nc-host-sign { margin: 0; font-size: 0.88rem; font-weight: 700; color: #d6e6f8; }

.nc-host-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.nc-host-rail { background: var(--nc-rail); color: #243140; padding: 0.8rem 0.55rem; border-right: 1px solid #d5dde6; }
.nc-host-rail p { margin: 0.85rem 0.7rem 0.3rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7c90; }
.nc-host-rail a { display: block; margin: 0; padding: 0.42rem 0.7rem; border-left: 3px solid transparent; border-radius: 0; color: #1d3348; font-weight: 600; font-size: 0.92rem; }
.nc-host-rail a.is-on, .nc-host-rail a:hover, .nc-host-rail button.is-on, .nc-host-rail button:hover { background: #e7f1fb; border-left-color: #1d5fa7; color: #1d5fa7; }
.nc-host-rail button { display: block; width: 100%; margin: 0; padding: 0.42rem 0.7rem; border: 0; border-left: 3px solid transparent; background: transparent; color: #1d3348; font-weight: 600; font-size: 0.92rem; text-align: left; cursor: pointer; }
.nc-host-main { padding: 1.25rem 1.4rem 2.5rem; max-width: 1080px; }
.nc-host-note { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--nc-line); border-left: 3px solid var(--nc-accent); border-radius: 10px; background: #fff; color: var(--nc-muted); }
.nc-host-domain { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 0.8rem; }
.nc-host-domain h1, .nc-host-card h2 { margin: 0; font-family: var(--nc-display); letter-spacing: -0.03em; }
.nc-host-kicker { margin: 0 0 0.15rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nc-muted); }
.nc-host-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.nc-host-badge { padding: 0.15rem 0.5rem; border-radius: 999px; background: #e8f1ff; color: var(--nc-deep); font-size: 0.75rem; font-weight: 700; }
.nc-host-block { margin: 0 0 0.85rem; padding: 0.9rem 1rem; border: 1px solid #d7dee6; border-radius: 3px; background: var(--nc-card); scroll-margin-top: 68px; }
.nc-tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; margin: 0 0 1rem; }
.nc-tool { display: block; padding: 0.7rem 0.75rem; border: 1px solid #d7dee6; border-radius: 3px; background: #fff; color: #1d3348; font-weight: 700; }
.nc-tool span { display: block; margin-top: 0.15rem; font-weight: 500; color: var(--nc-muted); font-size: 0.78rem; }
.nc-tool:hover { border-color: #1d5fa7; color: #1d5fa7; }
.nc-host-block h2, .nc-host-block h3 { margin: 0 0 0.7rem; font-family: var(--nc-display); font-size: 1.05rem; }
.nc-host-block-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.nc-host-block-head h2 { margin: 0; }
.nc-host-lead, .nc-host-hint { color: var(--nc-muted); }
.nc-host-lead { margin: 0.35rem 0 0.8rem; }
.nc-host-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.nc-host-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nc-host-stat, .nc-host-slot { padding: 0.85rem 0.9rem; border-radius: 12px; background: #f5f8fc; border: 1px solid #e1e9f2; }
.nc-host-stat span, .nc-host-slot h3 { display: block; margin: 0 0 0.3rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--nc-muted); }
.nc-host-stat b { display: block; font-family: var(--nc-display); font-size: 1rem; }
.nc-host-stat em { display: block; margin-top: 0.2rem; font-style: normal; font-size: 0.8rem; color: var(--nc-muted); }
.nc-host-stat--wait b { color: var(--nc-wait); }
.nc-host-stat--ready b { color: var(--nc-ok); }
.nc-host-stat--off b { color: var(--nc-off); }
.nc-host-dns { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e1e9f2; border-radius: 12px; overflow: hidden; }
.nc-host-dns th, .nc-host-dns td { padding: 0.62rem 0.7rem; border-bottom: 1px solid #e8eef5; text-align: left; vertical-align: middle; }
.nc-host-dns tr:last-child td { border-bottom: 0; }
.nc-host-dns th { background: #f5f8fc; color: var(--nc-muted); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; }
.nc-host-mono { font-family: var(--nc-mono); font-size: 0.82rem; }
.nc-host-type { display: inline-block; min-width: 3.3rem; padding: 0.12rem 0.4rem; border-radius: 6px; background: #e8f1ff; color: var(--nc-deep); font-size: 0.75rem; font-weight: 800; text-align: center; }
.nc-host-copy, .nc-host-action { display: inline-block; border-radius: 8px; font-weight: 700; cursor: pointer; }
.nc-host-copy { padding: 0.28rem 0.55rem; background: #fff; color: var(--nc-deep); border: 1px solid #c9d7e8; }
.nc-host-copy.is-copied { background: #e8f8ef; border-color: #b7e4c7; color: var(--nc-ok); }
.nc-host-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.nc-host-action { padding: 0.5rem 0.85rem; background: var(--nc-blue); color: #fff; border: 0; }
.nc-host-action--ghost { background: #fff; color: var(--nc-deep); border: 1px solid #c9d7e8; }
.nc-host-plan { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0; padding: 0; list-style: none; }
.nc-host-plan li { padding: 0.22rem 0.5rem; border-radius: 999px; background: #fff; border: 1px solid var(--nc-line); font-size: 0.8rem; font-weight: 700; }
.nc-host-client { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.35rem 0.6rem; margin: 0; }
.nc-host-client dt { color: var(--nc-muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.nc-host-client dd { margin: 0; font-family: var(--nc-mono); font-size: 0.84rem; }
.nc-host-empty { padding: 1.1rem; border: 1px dashed #b7c6d8; border-radius: 12px; background: #f8fbfe; color: var(--nc-muted); }
.nc-host-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.nc-host-form input { min-width: 16rem; padding: 0.5rem 0.7rem; border: 1px solid #c9d7e8; border-radius: 8px; background: #fff; }
.nc-host-tree { margin: 0.8rem 0 0; padding: 0.45rem; list-style: none; background: #f5f8fc; border: 1px solid #e1e9f2; border-radius: 12px; max-height: 28rem; overflow: auto; }
.nc-host-tree ul { margin: 0.1rem 0 0.15rem; padding-left: 0.95rem; list-style: none; border-left: 1px solid #d5e0ec; }
.nc-host-tree li { margin: 0.08rem 0; }
.nc-tree-item { display: flex; justify-content: space-between; gap: 0.6rem; width: 100%; padding: 0.28rem 0.4rem; border: 0; border-radius: 7px; background: transparent; color: var(--nc-ink); text-align: left; cursor: pointer; font-family: var(--nc-mono); font-size: 0.8rem; }
.nc-tree-item:hover, .nc-tree-item.is-on { background: #e8f1ff; color: var(--nc-deep); }
.nc-tree-item b { font-weight: 700; }
.nc-tree-item span { color: var(--nc-muted); font-size: 0.72rem; }
.nc-fm { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; margin-top: 0.7rem; }
.nc-fm-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 0.55rem; padding: 0.45rem; border: 1px solid #d5e0ec; border-radius: 10px; background: #f7fafc; }
.nc-fm-tool { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #d5e0ec; background: #fff; color: #142033; border-radius: 8px; padding: 0.32rem 0.5rem; cursor: pointer; font: inherit; font-size: 0.76rem; }
.nc-fm-tool svg { width: 15px; height: 15px; stroke: #1877F2; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nc-fm-tool:hover { background: #e8f3fe; }
.nc-fm-find { border: 1px solid #d5e0ec; border-radius: 8px; padding: 0.5rem 0.7rem; min-width: 220px; }
.nc-fm-tree, .nc-fm-list { background: #fff; border: 1px solid #d5e0ec; border-radius: 12px; min-height: 22rem; max-height: 34rem; overflow: auto; }
.nc-fm-table { width: 100%; border-collapse: collapse; }
.nc-fm-table th, .nc-fm-table td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid #e1e9f2; font-size: 0.82rem; }
.nc-fm-table th { color: var(--nc-muted); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.nc-fm-table tr.is-on { background: #e8f1ff; }
.nc-fm-name { border: 0; background: transparent; color: var(--nc-deep); cursor: pointer; font: inherit; padding: 0; }
@media (max-width: 800px) { .nc-fm { grid-template-columns: 1fr; } }
.nc-host-card + .nc-host-card { margin-top: 1rem; padding-top: 0.4rem; border-top: 1px solid var(--nc-line); }
@media (max-width: 900px) {
  .nc-host-shell { grid-template-columns: 1fr; }
  .nc-host-rail { display: flex; gap: 0.35rem; align-items: center; overflow: auto; padding: 0.55rem; }
  .nc-host-rail p { margin: 0 0.4rem 0 0; }
  .nc-host-rail a { white-space: nowrap; }
  .nc-host-stats, .nc-host-grid, .nc-tool-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nc-host-bar { height: auto; flex-wrap: wrap; padding: 0.7rem 0.8rem; }
  .nc-host-domain-chip { margin-left: 0; }
  .nc-host-stats, .nc-host-grid, .nc-host-client { grid-template-columns: 1fr; }
  .nc-host-domain { flex-direction: column; align-items: flex-start; }
}
