/* Nico — Network (nico-network.js). Tokens only; dark / light / sierra. Shared, identical in IOS/ and renderer/. */
html.nn-open, html.nn-open body { overflow: hidden; }
.nn-page { position: fixed; inset: 0; z-index: 900; background: var(--bg, var(--surface-1)); color: var(--text); font-family: var(--sans, -apple-system, system-ui, sans-serif); display: flex; justify-content: center; }
.nn-page[hidden] { display: none; }
.nn-page *, .nn-sheet * { box-sizing: border-box; }
.nn-wrap { width: 100%; max-width: 820px; display: flex; flex-direction: column; min-height: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 0; }
.nn-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.nn-head h2 { margin: 0; font-size: 22px; font-weight: 680; letter-spacing: -0.02em; flex: 1; }
.nn-scope { display: inline-flex; border: 0.5px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface-1); }
.nn-scope button { appearance: none; border: 0; background: none; color: var(--text-2); font: 600 12.5px var(--sans, system-ui); padding: 0 12px; min-height: 32px; border-radius: 999px; cursor: pointer; }
.nn-scope button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.nn-ask { display: flex; gap: 8px; padding-bottom: 10px; }
.nn-q { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 0.5px solid var(--line); background: var(--surface-1); color: var(--text); font: 16px var(--sans, system-ui); }
.nn-q::placeholder { color: var(--text-4); }
.nn-q:focus { outline: 2px solid color-mix(in oklch, var(--accent) 60%, transparent); outline-offset: 0; border-color: transparent; }
.nn-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; flex: none; }
.nn-tabs::-webkit-scrollbar { display: none; }
.nn-tabs button { appearance: none; flex: none; border: 0.5px solid var(--line); background: var(--surface-1); color: var(--text-2); font: 500 13px var(--sans, system-ui); padding: 0 12px; min-height: 36px; border-radius: 999px; cursor: pointer; }
.nn-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg, var(--surface-1)); border-color: transparent; font-weight: 600; }
.nn-tabs.sm button { min-height: 32px; font-size: 12.5px; }
.nn-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 0 calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.nn-body > * { flex: none; }
.nn-sum { margin: 2px 2px 0; font-size: 14px; color: var(--text-2); }
.nn-empty p { margin: 8px 2px; font-size: 14px; color: var(--text-3); line-height: 1.45; }
.nn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nn-chip { appearance: none; border: 0.5px solid var(--line); background: var(--surface-1); color: var(--text); font: 500 13.5px var(--sans, system-ui); padding: 8px 12px; min-height: 40px; border-radius: 12px; cursor: pointer; text-align: left; }
.nn-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; }
.nn-sec h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.nn-h4 { margin: 6px 2px 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-4); }
.nn-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--surface-1); border: 0.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.nn-rows > li + li { border-top: 0.5px solid var(--line); }
.nn-row { appearance: none; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; min-height: 56px; }
.nn-row.static { cursor: default; }
button.nn-row:hover { background: var(--surface-2); }
.nn-r1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.nn-r1 b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nn-r2 { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nn-r3 { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.nn-path { font-size: 12.5px; color: var(--accent-text, var(--accent)); }
.nn-sw { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.nn-str { display: inline-block; width: 44px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.nn-str i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.nn-sw.big .nn-str { width: 120px; height: 7px; }
.nn-strn { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.nn-pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; flex: none; }
.nn-pill.ok { color: var(--ok); background: color-mix(in oklch, var(--ok) 14%, transparent); }
.nn-pill.info { color: var(--info); background: color-mix(in oklch, var(--info) 14%, transparent); }
.nn-pill.accent { color: var(--accent-text, var(--accent)); background: color-mix(in oklch, var(--accent) 16%, transparent); }
.nn-pill.muted { color: var(--text-3); }
.nn-reasons { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.nn-reasons li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.nn-chains { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nn-chain { background: var(--surface-1); border: 0.5px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.nn-hops { display: flex; flex-direction: column; gap: 6px; }
.nn-hop { font-size: 13.5px; display: flex; flex-direction: column; gap: 1px; padding-left: 10px; border-left: 2px solid color-mix(in oklch, var(--accent) 45%, transparent); }
.nn-hop b { font-weight: 600; }
.nn-hop span { color: var(--text-3); font-size: 12.5px; }
.nn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nn-stats div { background: var(--surface-1); border: 0.5px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nn-stats b { font-size: 20px; font-weight: 680; font-variant-numeric: tabular-nums; }
.nn-stats span { font-size: 12px; color: var(--text-3); }
.nn-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nn-card { background: var(--surface-1); border: 0.5px solid var(--line); border-left: 3px solid var(--line-bright, var(--line)); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.nn-card.weak { border-left-color: var(--warn, var(--accent)); }
.nn-card.strong, .nn-card.good { border-left-color: var(--ok); }
.nn-bar { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 3px 0 1px; }
.nn-bar i, .nn-bar em { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.nn-bar i { background: color-mix(in oklch, var(--text) 18%, transparent); }
.nn-bar em { background: var(--accent); }
.nn-counts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-2); }
.nn-counts span { display: inline-flex; gap: 5px; align-items: center; }
.nn-msg { margin: 6px 2px; font-size: 13.5px; color: var(--text-3); line-height: 1.45; }
.nn-msg:empty { display: none; }
.nn-hint { margin: 2px 2px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.nn-dim { color: var(--text-3); font-size: 12.5px; }
.nn-lead { margin: 0; font-size: 14.5px; line-height: 1.5; }
.nn-more { align-self: center; appearance: none; border: 0; background: none; color: var(--accent-text, var(--accent)); font: 600 13px var(--sans, system-ui); min-height: 40px; cursor: pointer; }
.nn-link { appearance: none; border: 0; background: none; padding: 0; color: var(--accent-text, var(--accent)); font: 600 13px var(--sans, system-ui); cursor: pointer; min-height: 32px; text-decoration: none; display: inline-flex; align-items: center; }
.nn-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nn-skel { display: flex; flex-direction: column; gap: 8px; }
.nn-skel i { display: block; height: 56px; border-radius: 12px; background: var(--surface-2); animation: nn-pulse 1.2s ease-in-out infinite; }
@keyframes nn-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .nn-skel i { animation: none; } }
.nn-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0.5px solid var(--line); background: var(--surface-1); color: var(--text); font: 600 14px var(--sans, system-ui); cursor: pointer; text-decoration: none; white-space: nowrap; }
.nn-btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent, #fff); }
.nn-btn.danger { color: var(--err); }
.nn-btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.nn-btn:disabled { opacity: .55; cursor: default; }
.nn-x { appearance: none; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text-2); font: 400 20px/1 var(--sans, system-ui); cursor: pointer; }
.nn-btn:focus-visible, .nn-row:focus-visible, .nn-tabs button:focus-visible, .nn-x:focus-visible, .nn-link:focus-visible, .nn-chip:focus-visible, .nn-scope button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* sheet: bottom sheet on phones, side drawer when wide; above the page */
.nn-scrim { position: fixed; inset: 0; z-index: 1001; background: color-mix(in oklch, black 38%, transparent); display: flex; align-items: flex-end; justify-content: center; }
.nn-scrim[hidden] { display: none; }
.nn-sheet { width: 100%; max-height: 92vh; overflow-y: auto; background: var(--bg, var(--surface-1)); color: var(--text); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 40px color-mix(in oklch, black 25%, transparent); padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); font-family: var(--sans, -apple-system, system-ui, sans-serif); }
@media (min-width: 720px) { .nn-scrim { justify-content: flex-end; align-items: stretch; } .nn-sheet { width: 480px; max-height: none; height: 100%; border-radius: 0; padding: 14px 22px 22px; } }
.nn-sheet-in { display: flex; flex-direction: column; gap: 14px; }
.nn-top { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0 8px; background: var(--bg, var(--surface-1)); border-bottom: 0.5px solid var(--line); }
.nn-top h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.015em; outline: none; }
.nn-top p { margin: 4px 0 0; font-size: 13px; color: var(--text-3); }
.nn-k { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-4); margin-bottom: 3px; }
.nn-kv { display: flex; flex-direction: column; }
.nn-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; font-size: 14px; }
.nn-grid2 > div { min-width: 0; overflow-wrap: anywhere; }
.nn-note p { margin: 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.nn-flags { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.nn-flags li.block { color: var(--err); }
.nn-prose p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
.nn-form { display: flex; flex-direction: column; gap: 14px; }
.nn-form label, .nn-sel { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.nn-form input, .nn-form textarea, .nn-sel select { min-height: 44px; padding: 9px 12px; border-radius: 10px; border: 0.5px solid var(--line); background: var(--surface-1); color: var(--text); font: 15px var(--sans, system-ui); width: 100%; }
.nn-form textarea { resize: vertical; line-height: 1.45; }
.nn-form input:focus, .nn-form textarea:focus, .nn-sel select:focus { outline: 2px solid color-mix(in oklch, var(--accent) 60%, transparent); outline-offset: 0; border-color: transparent; }
@media (max-width: 420px) { .nn-stats { grid-template-columns: 1fr 1fr; } .nn-stats div:last-child { grid-column: 1 / -1; } .nn-head h2 { font-size: 20px; } }
