:root {
	--bg: #f5f6f4;
	--card: #ffffff;
	--fg: #121614;
	--muted: #5d6963;
	--line: #e3e7e4;
	--green: #0a7a45;
	--green-soft: #e3f2ea;
	--img: #e8ece9;
	--radius: 12px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e1110;
		--card: #161b19;
		--fg: #eef2ef;
		--muted: #9aa7a0;
		--line: #26302b;
		--green: #3ecf85;
		--green-soft: #173327;
		--img: #1f2622;
	}
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
a, button { -webkit-touch-callout: none; }
/* No flash or outline when tapping or clicking. A ring shows only for keyboard navigation. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
button { -webkit-appearance: none; appearance: none; }
html { -webkit-text-size-adjust: 100%; }
body.nb {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
.nb-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header */
.nb-top { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
.nb-bar { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nb-brand { display: flex; align-items: center; gap: 1px; text-decoration: none; font-size: 20px; letter-spacing: -0.02em; font-weight: 600; }
.nb-brand b { color: var(--green); font-weight: 800; }
.nb-mark { width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; background: linear-gradient(90deg, var(--green) 0 33%, var(--card) 33% 67%, var(--green) 67%); border: 1.5px solid var(--green); }
.nb-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.nb-tabs { border-top: 1px solid var(--line); }
.nb-tabrow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 8px; }
.nb-tabrow::-webkit-scrollbar { display: none; }
.nb-tabrow a {
	flex: none; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted);
	padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
}
.nb-tabrow a[aria-current="page"] { background: var(--green); border-color: var(--green); color: var(--card); }

/* Feed */
.nb-h1 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 20px 0 4px; font-weight: 700; }
.nb-intro { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.nb-grid { display: grid; gap: 12px; }
.nb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.nb-link { display: flex; gap: 14px; padding: 14px; text-decoration: none; align-items: flex-start; }
.nb-link:hover .nb-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.nb-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.nb-img { order: 2; flex: none; width: 118px; height: 118px; border-radius: 10px; overflow: hidden; background: var(--img); }
.nb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.nb-pub { color: var(--green); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-meta time, .nb-dot { flex: none; white-space: nowrap; }
.nb-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.nb-title { font-size: 17px; line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nb-excerpt { display: none; color: var(--muted); font-size: 15px; }
.nb-also { margin: 0; padding: 10px 14px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.nb-also a { color: var(--fg); font-weight: 600; text-decoration: none; }
.nb-also a:hover { text-decoration: underline; }

/* Lead story */
.nb-lead .nb-link { flex-direction: column; padding: 0; gap: 0; }
.nb-lead .nb-img { order: 0; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }
.nb-lead .nb-body { padding: 14px 16px 16px; }
.nb-lead .nb-title { font-size: 22px; -webkit-line-clamp: 4; }
.nb-lead .nb-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.nb-more { text-align: center; margin: 20px 0 8px; }
.nb-more button {
	font: inherit; font-weight: 700; font-size: 15px; color: var(--green); background: var(--card);
	border: 1px solid var(--line); border-radius: 999px; padding: 12px 28px; cursor: pointer;
}
.nb-more button[disabled] { opacity: 0.6; cursor: default; }
.nb-empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; color: var(--muted); }

.nb-foot { margin-top: 32px; padding: 28px 0 44px; border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 14px; }
.nb-foot p { margin: 0 0 14px; max-width: 640px; }
.nb-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 16px; }
.nb-foot nav a { color: var(--fg); text-decoration: none; font-weight: 600; }
.nb-foot nav a:hover { text-decoration: underline; }
.nb-foot small { display: block; }

/* Brand pages */
.nb-crumbs { margin: 18px 0 10px; font-size: 13px; color: var(--muted); }
.nb-crumbs a { text-decoration: none; color: var(--green); font-weight: 600; }
.nb-doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; max-width: 780px; }
.nb-doc h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
.nb-doc .nb-lede { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.nb-doc h2 { font-size: 20px; margin: 30px 0 8px; letter-spacing: -0.01em; }
.nb-doc p, .nb-doc li { font-size: 16px; line-height: 1.65; }
.nb-doc ul, .nb-doc ol { padding-left: 22px; }
.nb-doc li { margin: 6px 0; }
.nb-doc a { color: var(--green); font-weight: 600; }
.nb-doc code { font-size: 14px; background: var(--img); padding: 2px 6px; border-radius: 6px; word-break: break-word; }
.nb-doc .nb-updated { font-size: 13px; color: var(--muted); margin-top: 28px; }
.nb-steps { counter-reset: s; list-style: none; padding: 0 !important; }
.nb-steps li { counter-increment: s; position: relative; padding-left: 42px; margin: 14px 0; }
.nb-steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* Forms */
.nb-form { display: grid; gap: 14px; margin-top: 18px; }
.nb-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.nb-form input, .nb-form textarea, .nb-form select {
	font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
}
.nb-form input:focus, .nb-form textarea:focus, .nb-form select:focus { border-color: var(--green); }
.nb-form textarea { min-height: 130px; resize: vertical; }
.nb-form .nb-hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.nb-form button { font: inherit; font-weight: 700; color: #fff; background: var(--green); border: 0; border-radius: 999px; padding: 13px 28px; cursor: pointer; justify-self: start; }
.nb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.nb-note { border-radius: 10px; padding: 14px 16px; margin: 0 0 18px; font-weight: 600; }
.nb-note.ok { background: var(--green-soft); color: var(--green); }
.nb-note.err { background: #fbeaea; color: #9b1c1c; }
@media (prefers-color-scheme: dark) { .nb-note.err { background: #3a1d1d; color: #f3b4b4; } .nb-form button { color: #0e1110; } }

@media (max-width: 479px) {
	.nb-wrap { padding: 0 8px; }
	.nb-bar, .nb-tabrow { padding-left: 12px; padding-right: 12px; }
	.nb-h1, .nb-intro, .nb-crumbs { padding-left: 4px; padding-right: 4px; }
	.nb-link { padding: 14px 12px; gap: 12px; }
	.nb-also { padding: 10px 12px 12px; }
	.nb-foot .nb-wrap { padding: 0 16px; }
	.nb-doc { padding: 22px 18px; }
}
@media (min-width: 720px) {
	.nb-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.nb-img { width: 176px; height: 132px; }
}
@media (min-width: 960px) {
	.nb-grid { grid-template-columns: 1fr 1fr; }
	.nb-lead { grid-column: 1 / -1; }
	.nb-lead .nb-link { flex-direction: row; }
	.nb-lead .nb-img { width: 58%; aspect-ratio: 16 / 10; }
	.nb-lead .nb-body { padding: 24px; justify-content: center; }
	.nb-lead .nb-title { font-size: 28px; }
}
#form { scroll-margin-top: 130px; }

/* Add to Home Screen prompt */
.nb-a2hs {
	position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 2147483000;
	display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); color: var(--fg);
	border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
	transform: translateY(calc(100% + 40px)); opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease;
}
.nb-a2hs.nb-a2hs-top { top: 12px; bottom: auto; transform: translateY(calc(-100% - 40px)); }
.nb-a2hs.nb-a2hs-show { transform: translateY(0); opacity: 1; }
.nb-a2hs-icon { width: 50px; height: 50px; flex: none; border-radius: 12px; }
.nb-a2hs-body { min-width: 0; flex: 1; }
.nb-a2hs-title { font-size: 15px; font-weight: 800; line-height: 1.3; margin-bottom: 3px; }
.nb-a2hs-text { font-size: 13px; line-height: 1.45; color: var(--muted); margin-bottom: 10px; }
.nb-a2hs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nb-a2hs-actions button { font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.nb-a2hs-add { background: var(--green); color: #fff; }
.nb-a2hs-later { background: var(--img); color: var(--fg); }
@media (prefers-color-scheme: dark) { .nb-a2hs { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6); } .nb-a2hs-add { color: #0e1110; } }
@media (min-width: 720px) { .nb-a2hs { left: auto; right: 20px; width: 400px; } }
