
/* ── Nanoconda Design Tokens ── */
:root {
  --bg:           #070d18;
  --bg-2:         #0b1525;
  --surface:      #0f1e30;
  --surface-2:    #142233;
  --border:       rgba(255,255,255,0.07);
  --border-a:     rgba(29,197,125,0.25);
  --accent:       #1DC57D;
  --accent-dim:   rgba(29,197,125,0.08);
  --accent-hover: #26DC8E;
  --accent-red:   #f85149;
  --text:         #e8eef6;
  --muted:        #7a8fa6;
  --muted-2:      #a0b0c0;
  --comp-bg:      rgba(59,130,246,0.07);
  --comp-border:  rgba(59,130,246,0.22);
  --group-bg:     rgba(29,197,125,0.06);
  --group-border: rgba(29,197,125,0.22);
  --nav-h:        66px;
  --radius:       6px;
  --radius-lg:    10px;
  --t:            0.18s ease;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-hover); }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* ── Top Nav ── */
.nc-nav {
  position: sticky; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(7,13,24,0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--t), box-shadow var(--t);
}
.nc-nav--scrolled {
  background: rgba(7,13,24,0.97);
  box-shadow: 0 1px 0 var(--border);
}
.nc-nav__inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nc-nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.nc-nav__logo-img { height: 28px; width: auto; display: block; }
.nc-nav__links { display: flex; align-items: center; gap: 24px; }
.nc-nav__links a {
  font-size: 13.5px; font-weight: 500; color: var(--muted-2);
  transition: color var(--t);
}
.nc-nav__links a:hover { color: var(--text); }
.nc-nav__active { color: var(--accent) !important; font-weight: 600 !important; }
.nc-nav__cta {
  padding: 7px 18px !important; background: var(--accent) !important;
  color: #041a10 !important; border-radius: 4px; font-weight: 600 !important;
}
.nc-nav__cta:hover { background: var(--accent-hover) !important; color: #041a10 !important; }
.nc-nav__hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nc-nav__hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── Footer ── */
.nc-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 52px 0 28px;
}
.nc-footer__container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.nc-footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 40px;
}
.nc-footer__logo-img { height: 24px; width: auto; display: block; margin-bottom: 14px; }
.nc-footer__tagline  { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; }
.nc-footer__contact  { font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.nc-footer__contact a { color: var(--muted); }
.nc-footer__contact a:hover { color: var(--accent); }
.nc-footer__col-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); margin-bottom: 16px;
}
.nc-footer__links { display: flex; flex-direction: column; gap: 9px; }
.nc-footer__links a { font-size: 13px; color: var(--muted); transition: color var(--t); }
.nc-footer__links a:hover { color: var(--text); }
.nc-footer__bottom {
  padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted); flex-wrap: wrap; gap: 10px;
}
.nc-footer__legal a { color: var(--muted); margin-left: 16px; }
.nc-footer__legal a:hover { color: var(--accent); }
.nc-footer__license { margin-top: 16px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.nc-footer__license a { color: var(--muted); text-decoration: underline; }
.nc-footer__license a:hover { color: var(--accent); }

/* ── Docs Layout ── */
.layout { display: flex; min-height: calc(100vh - var(--nav-h)); }

.sidebar {
  width: 256px; min-width: 256px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.sidebar-logo {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.sidebar-logo p { font-size: 11px; color: var(--muted); margin-top: 3px; }

.sidebar-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sidebar-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--muted); }

.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.nav-section {
  padding: 10px 16px 4px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 16px;
  color: var(--muted-2);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: background var(--t), color var(--t);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .badge {
  margin-left: auto;
  font-size: 10px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 10px;
}

.nav-sub { padding-left: 12px; }
.nav-sub .nav-item { font-size: 12px; padding: 3px 16px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
}
.topbar h2 { font-size: 17px; font-weight: 700; color: var(--text); }
.topbar .breadcrumb {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.topbar .breadcrumb a { color: var(--muted); }
.topbar .breadcrumb a:hover { color: var(--text); }

.content { padding: 28px; max-width: 1200px; flex: 1; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-header h3 { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; }
.card-body { padding: 16px; }

/* ── Badges ── */
.tag-badge {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid var(--border-a);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  transition: background var(--t), border-color var(--t);
}
.tag-badge.link-badge:hover { background: rgba(29,197,125,0.14); border-color: var(--accent); }

.type-badge {
  display: inline-block;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 11px;
  color: var(--muted-2);
}

.category-badge {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
}

.count-badge {
  display: inline-block;
  background: var(--accent);
  color: #041a10;
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
}

/* ── Required indicators ── */
.reqd-yes  { display:inline-block; width:7px; height:7px; background:var(--accent); border-radius:50%; margin-right:5px; }
.reqd-no   { display:inline-block; width:7px; height:7px; background:var(--border); border-radius:50%; margin-right:5px; box-shadow:inset 0 0 0 1px var(--muted); }
.reqd-label-yes { color:var(--accent);  font-size:11px; font-weight:600; }
.reqd-label-no  { color:var(--muted);   font-size:11px; }

/* ── Fields Table ── */
.fields-table { width:100%; border-collapse:collapse; font-size:13px; }
.fields-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 9px 12px;
  text-align: left; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.fields-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.fields-table tr:nth-child(even) td { background: var(--bg); }
.fields-table tr:nth-child(odd)  td { background: var(--bg-2); }
.fields-table tr:hover td { background: var(--surface); }

/* Component / group rows */
.comp-row td {
  background: var(--comp-bg) !important;
  border-top: 1px solid var(--comp-border);
  font-weight: 600; color: #93c5fd;
}
.group-row td {
  background: var(--group-bg) !important;
  border-top: 1px solid var(--group-border);
  font-weight: 600; color: var(--accent);
}
.group-end-row td {
  background: var(--group-bg) !important;
  border-bottom: 1px solid var(--group-border);
  color: var(--muted); font-style: italic; font-size: 11px;
}

.depth-indent { display:inline-block; }

/* ── Enum table ── */
.enum-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:8px; }
.enum-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 10px; text-align: left; border-bottom: 1px solid var(--border);
}
.enum-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.enum-table tr:nth-child(even) td { background: var(--bg); }
.enum-table tr:nth-child(odd)  td { background: var(--bg-2); }
.enum-value { font-family:'SFMono-Regular',Consolas,monospace; font-size:12px; color:#f59e0b; font-weight:700; }
.enum-name  { color: var(--text); font-weight: 500; }
.enum-desc  { color: var(--muted); font-size: 12px; }

/* ── Wire-format code ── */
pre.wire {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px; overflow-x: auto; color: var(--text); line-height: 1.7;
}
pre.wire .hl  { color: #f59e0b; font-weight: 700; }
pre.wire .sep { color: var(--muted); opacity: 0.5; }
pre.wire .k   { color: var(--muted); }
pre.wire .v   { color: var(--accent); }

.example-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px;
}
.example-block .ex-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 8px;
}
.example-block code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 13px; }

/* ── Field detail hero ── */
.field-hero {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px; margin-bottom: 24px;
}
.field-hero .tag-number {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-a);
  border-radius: 5px;
  padding: 4px 12px;
  display: inline-block; margin-bottom: 10px;
}
.field-hero h1 { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 5px; letter-spacing: -0.025em; }
.field-hero .field-abbr { font-size: 13px; color: var(--muted); font-family: monospace; }
.field-meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.meta-pill {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 12px; font-size: 12px;
}
.meta-pill .label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; display: block; }
.meta-pill .value { color: var(--text); font-weight: 700; }

/* ── Message usage pills ── */
.msg-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 9px;
  font-size: 12px; color: var(--text);
  transition: border-color var(--t), background var(--t);
}
.msg-pill:hover { border-color: var(--border-a); background: var(--accent-dim); color: var(--accent); }
.msg-pill .mt { font-family: monospace; font-size: 10px; color: #f59e0b; margin-right: 2px; }

/* ── Message grid ── */
.msg-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; margin-top:4px; }
.msg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.msg-card:hover {
  border-color: var(--border-a); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(29,197,125,0.08);
}
.msg-card .msg-name    { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.msg-card .msg-type-tag {
  display: inline-block; background: var(--accent-dim); border: 1px solid var(--border-a);
  color: var(--accent); font-family: monospace; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px; margin-bottom: 5px;
}
.msg-card .msg-cat     { font-size: 11px; color: var(--muted); }
.msg-card .msg-preview { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Version cards ── */
.version-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; margin-top:16px; }
.version-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.version-card:hover {
  border-color: var(--border-a); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(29,197,125,0.08);
}
.version-card h3 { font-size: 17px; font-weight: 800; color: var(--accent); margin-bottom: 8px; font-family: monospace; letter-spacing: -0.01em; }
.version-card .stats { display:flex; flex-direction:column; gap:5px; margin-top:10px; }
.version-card .stat  { font-size: 12px; color: var(--muted); display:flex; justify-content:space-between; }
.version-card .stat span { color: var(--text); font-weight: 700; }

/* ── Message meta ── */
.msg-meta { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:20px; }
.meta-item { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:6px 12px; font-size:12px; }
.meta-item .label { color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; display:block; }
.meta-item .value { color:var(--text); font-weight:700; }
.msg-desc {
  color: var(--muted); font-size: 13.5px; line-height: 1.7; margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Filter bar ── */
.filter-bar { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; align-items:center; }
.filter-bar input, .filter-bar select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px; padding: 7px 12px; outline: none;
}
.filter-bar input { flex:1; min-width:200px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }
.filter-bar select option { background: var(--surface-2); }

/* ── Component cards ── */
.comp-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); margin-bottom:10px; overflow:hidden; }
.comp-card-header {
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: background var(--t);
}
.comp-card-header:hover { background: rgba(29,197,125,0.06); }
.comp-card-header h4 { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }

/* ── Section headers ── */
.section-title    { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -0.02em; }
.section-subtitle { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }

/* ── Details / accordion ── */
details summary { cursor:pointer; list-style:none; }
details summary::-webkit-details-marker { display:none; }
details[open] summary .chevron { transform:rotate(90deg); }
.chevron { transition:transform 0.18s; display:inline-block; margin-right:5px; }

/* ── Version pills (all-fields page) ── */
.ver-pills { display:flex; flex-wrap:wrap; gap:3px; }
.ver-pill {
  display: inline-block;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px;
  font-size: 10px; font-family: monospace;
  color: var(--muted); white-space: nowrap;
  transition: border-color var(--t), color var(--t);
}
.ver-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { width: 220px; min-width: 220px; }
}
@media (max-width: 768px) {
  .nc-nav__links { display: none; }
  .nc-nav__links.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(7,13,24,0.98); backdrop-filter: blur(16px);
    padding: 18px 24px; gap: 16px; border-bottom: 1px solid var(--border);
  }
  .nc-nav__hamburger { display: flex; }
  .nc-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .sidebar { display: none; }
  .content { padding: 16px; }
}
@media (max-width: 480px) {
  .nc-footer__grid { grid-template-columns: 1fr; }
  .version-grid { grid-template-columns: 1fr 1fr; }
}
