/* GreenHaven's web pages: one look for every page (web.rs serves it at /site.css by its hash).
   Blocks with light and shade, square corners, pixel and display type. A page adds only its own parts in its <style>. */
:root {
  --bg: #0D1220; --bg2: #111829; --bg3: #0A0E18; --card: #171E2E; --card2: #1C2438; --line: #1E2740; --edge: #2A3550; --edge2: #34405E;
  --ink: #E8ECF4; --white: #FFFFFF; --sub: #A9B3C9; --dim: #8C97AE; --soft: #C3CBDC;
  --green: #5DBB3F; --green-d: #3E8A28; --green-l: #8AD86A; --green-bg: #16301A;
  --gold: #F2B33D; --gold-d: #B98419; --gold-l: #FFD27A; --gold-bg: #2A2410;
  --blue: #6FB7FF; --blue-d: #3E7FD6; --purple: #C792EA; --purple-d: #7C4DBF; --purple-bg: #1E0D2E;
  --teal: #5FD3C7; --coral: #FF9F7A; --red: #FF8A8A; --bad: #E2604A;
  --pixel: 'Silkscreen', monospace; --display: 'Black Han Sans', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --sans: 'IBM Plex Sans KR', system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
/* Japanese and Chinese in their own Noto Sans (site.js loads it), a kanji drawn as each language draws it; their headings
   in it too (Black Han Sans has the Korean letters alone) */
:root:lang(ja) { --sans: 'Noto Sans JP', system-ui, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; --display: 'Noto Sans JP', sans-serif; }
:root:lang(zh) { --sans: 'Noto Sans SC', system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; --display: 'Noto Sans SC', sans-serif; }
:root:lang(ja) :is(h1, h2), :root:lang(zh) :is(h1, h2) { font-weight: 900; }
* { box-sizing: border-box; }
/* scrollbars: one look everywhere (the page's and every box's), dark like the page; a box's thin */
:root { color-scheme: dark; }
html { scroll-behavior: smooth; scrollbar-color: var(--edge2) var(--bg3); }
body * { scrollbar-width: thin; scrollbar-color: var(--edge2) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
a { color: var(--green-l); } a:hover { color: #B6EE9C; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; width: 100%; }
.wrap.narrow { max-width: 1040px; } .wrap.thin { max-width: 760px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }
.pixel { font-family: var(--pixel); letter-spacing: 2px; }
.mono { font-family: var(--mono); }
.eyebrow { margin: 0; font-family: var(--pixel); font-size: 13px; letter-spacing: 2px; color: var(--green-l); text-transform: uppercase; }
h1, h2 { font-family: var(--display); font-weight: 400; color: var(--white); margin: 0; }
h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.12; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.15; }
h3 { margin: 0; font-size: 18px; color: var(--white); }
.lead { margin: 0; font-size: 17px; line-height: 1.7; color: var(--sub); }
.muted { color: var(--dim); } .soft { color: var(--soft); } .sub { color: var(--sub); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* layout */
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.between { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.pad { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 40px; }
@media (max-width: 720px) { .pad { padding-top: 64px; padding-bottom: 64px; gap: 28px; } }
.page { padding-top: 40px; padding-bottom: 80px; }
@media (max-width: 720px) { .page { padding-top: 24px; padding-bottom: 56px; } }
.side-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.side-layout.left { grid-template-columns: 220px minmax(0, 1fr); }
.side-layout.three { grid-template-columns: 200px minmax(0, 1fr) 280px; }
@media (max-width: 1100px) { .side-layout.three { grid-template-columns: minmax(0, 1fr) 280px; } .side-layout.three > .boards { grid-column: 1 / -1; } }
@media (max-width: 900px) { .side-layout, .side-layout.left, .side-layout.three { grid-template-columns: minmax(0, 1fr); } }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
section.band { background: var(--bg2); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.hero-band { background: var(--bg2); border-bottom: 2px solid var(--line); }
.hero-band .wrap { padding-top: 48px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }

/* buttons: a block with light and shade */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; background: var(--green); color: #0D1A08; white-space: nowrap;
  box-shadow: inset -4px -4px 0 var(--green-d), inset 4px 4px 0 var(--green-l); transition: transform .08s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.08); color: #0D1A08; }
.btn:active { transform: translateY(2px); }
.btn.dark { background: #232C42; color: var(--white); box-shadow: inset -4px -4px 0 var(--card), inset 4px 4px 0 var(--edge2); }
.btn.gold { background: var(--gold); color: #241A04; box-shadow: inset -4px -4px 0 var(--gold-d), inset 4px 4px 0 var(--gold-l); }
.btn.purple { background: var(--purple); color: #1E0D2E; box-shadow: inset -4px -4px 0 #9A64C8, inset 4px 4px 0 #E2C2F7; }
.btn.teal { background: var(--teal); color: #0A2420; box-shadow: inset -4px -4px 0 #34A398, inset 4px 4px 0 #9BEDE4; }
.btn.blue { background: var(--blue); color: #0A1A2E; box-shadow: inset -4px -4px 0 var(--blue-d), inset 4px 4px 0 #A9D4FF; }
.btn.danger { background: #3A1A1E; color: var(--red); box-shadow: none; border: 2px solid #6B2A30; }
.btn.line { background: transparent; color: var(--ink); box-shadow: none; border: 2px solid var(--edge); }
.btn.line:hover { border-color: var(--edge2); color: var(--white); }
.btn.ghost { background: transparent; color: var(--sub); box-shadow: none; padding: 0 12px; }
.btn.ghost:hover { color: var(--white); }
.btn.done { background: var(--green-bg); color: var(--green-l); box-shadow: none; border: 2px solid #2E5A26; }
.btn.big { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; box-shadow: inset -3px -3px 0 var(--green-d), inset 3px 3px 0 var(--green-l); }
.btn.sm.dark { box-shadow: inset -3px -3px 0 var(--card), inset 3px 3px 0 var(--edge2); }
.btn.sm.line, .btn.sm.done, .btn.sm.danger, .btn.sm.ghost { box-shadow: none; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--green-l); cursor: pointer; text-decoration: underline; }
.link.quiet { color: var(--dim); font-size: 13px; }
.arrow { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* cards and boxes */
.card { background: var(--card); border: 2px solid var(--edge); padding: 24px; }
.card.tight { padding: 16px; }
.card.dashed { background: transparent; border-style: dashed; }
.card.sunk { background: var(--bg3); }
.card.hover { transition: transform .15s ease, border-color .15s ease; }
.card.hover:hover { transform: translateY(-3px); border-color: var(--edge2); }
.card h3 + p { margin-top: 6px; }
.shadow { box-shadow: 8px 8px 0 var(--bg3); }
.box-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--white); }
.list { margin: 0; padding: 0; list-style: none; }
.list > li { border-top: 2px solid var(--line); }
.list > li:first-child { border-top: 0; }
.empty { padding: 48px 24px; text-align: center; color: var(--dim); border: 2px dashed var(--edge); }
.empty b { display: block; color: var(--soft); font-size: 17px; margin-bottom: 6px; }

/* chips, badges, tags */
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--card); border: 2px solid var(--edge);
  font-family: var(--pixel); font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.chip i { width: 8px; height: 8px; background: currentColor; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 2px solid currentColor; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.badge.fill { border-color: transparent; background: var(--gold); color: #241A04; }
.badge.px { font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; font-weight: 400; }
.badge.green { color: var(--green-l); } .badge.gold { color: var(--gold); } .badge.blue { color: var(--blue); } .badge.purple { color: var(--purple); }
.badge.teal { color: var(--teal); } .badge.coral { color: var(--coral); } .badge.red { color: var(--red); } .badge.dim { color: var(--dim); }
.tag { color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 500; }
.tag:hover { color: #A9D4FF; text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags .t { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 2px solid var(--edge); background: var(--bg3); color: var(--blue); font-size: 13px; text-decoration: none; }
.tags .t:hover { border-color: var(--blue); }
.dot { display: inline-block; width: 10px; height: 10px; flex: none; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; background: var(--green-bg); color: var(--green-l); }
.status i { width: 8px; height: 8px; background: currentColor; }
.status.off { background: var(--card2); color: var(--dim); } .status.warn { background: var(--gold-bg); color: var(--gold); } .status.info { background: #0F2340; color: var(--blue); }

/* avatars: a block with the name's first letter (the account's own color) */
.ava { --c: var(--blue-d); display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; background: var(--c); color: #0A0E18;
  font-family: var(--pixel); font-weight: 700; font-size: 16px; text-decoration: none; text-transform: uppercase;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.28), inset 4px 4px 0 rgba(255,255,255,.22); }
.ava.sm { width: 28px; height: 28px; font-size: 12px; box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 3px 3px 0 rgba(255,255,255,.22); }
.ava.lg { width: 64px; height: 64px; font-size: 26px; }
.ava.xl { width: 120px; height: 120px; font-size: 48px; box-shadow: inset -8px -8px 0 rgba(0,0,0,.28), inset 8px 8px 0 rgba(255,255,255,.22); }
.who-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-line .nm { font-weight: 700; color: var(--white); text-decoration: none; }
.who-line .nm:hover { text-decoration: underline; }

/* forms */
label.lb, .lb { display: block; font-size: 14px; font-weight: 500; color: var(--soft); margin-bottom: 8px; }
.lb .opt { color: var(--dim); font-weight: 400; }
.in, select.in, textarea.in { width: 100%; min-height: 48px; padding: 0 14px; background: var(--bg3); border: 2px solid var(--edge); color: var(--white);
  font: inherit; font-size: 15px; border-radius: 0; }
textarea.in { padding: 12px 14px; min-height: 140px; resize: vertical; line-height: 1.6; }
select.in { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.in:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(93,187,63,.35); }
.in::placeholder { color: #5D6880; }
.in.bad { border-color: var(--bad); }
.field { display: flex; flex-direction: column; }
.field + .field { margin-top: 18px; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--dim); }
.hint.bad { color: var(--red); }
.fields2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--soft); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; flex: none; }
.search { position: relative; }
.search .in { padding-left: 42px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.drop { display: grid; place-items: center; gap: 8px; padding: 36px 20px; text-align: center; border: 2px dashed var(--edge2); background: var(--bg3); color: var(--sub); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--green); color: var(--white); }
.drop b { color: var(--white); }

/* segmented buttons, tabs, filters */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg3); border: 2px solid var(--edge); padding: 4px; }
.seg button, .seg a { min-height: 40px; padding: 0 16px; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; background: transparent; color: var(--sub);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.seg button:hover, .seg a:hover { color: var(--white); }
.seg [aria-pressed="true"], .seg [aria-selected="true"], .seg .on { background: var(--green); color: #0D1A08 !important; }
.seg small { font-family: var(--pixel); font-size: 10px; padding: 2px 6px; background: var(--gold); color: #241A04; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; border-bottom: 2px solid var(--line); }
.tabs button, .tabs a { min-height: 48px; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; color: var(--sub); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover, .tabs a:hover { color: var(--white); }
.tabs [aria-selected="true"], .tabs .on { color: var(--white); border-bottom-color: var(--accent, var(--green)); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button, .filters a { min-height: 38px; padding: 0 14px; border: 2px solid var(--edge); background: var(--bg3); color: var(--soft); font: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.filters button:hover, .filters a:hover { border-color: var(--edge2); color: var(--white); }
.filters [aria-pressed="true"], .filters .on { background: var(--accent, var(--green)); border-color: var(--accent, var(--green)); color: #0A0E18; }
.navlist { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.navlist a, .navlist button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-left: 3px solid transparent; background: none;
  color: var(--soft); font: inherit; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.navlist a:hover, .navlist button:hover { background: var(--card); color: var(--white); }
.navlist .on, .navlist [aria-current="page"], .navlist [aria-selected="true"] { background: var(--card); color: var(--white); border-left-color: var(--accent, var(--green)); }
.navlist .n { margin-left: auto; font-size: 12px; color: var(--dim); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 2px solid var(--edge); font-size: 14px; }
.tbl th, .tbl td { padding: 14px 16px; text-align: left; border-top: 2px solid var(--line); vertical-align: top; }
.tbl th { color: var(--dim); font-weight: 500; font-size: 13px; background: var(--bg2); border-top: 0; }
.tbl td { color: var(--soft); }
.tbl-wrap { overflow-x: auto; }

/* stats */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 16px 18px; background: var(--card); border: 2px solid var(--edge); }
.stat span { display: block; font-size: 13px; color: var(--dim); }
.stat b { display: block; margin-top: 4px; font-family: var(--pixel); font-size: 22px; color: var(--white); letter-spacing: 1px; }
.meter { height: 8px; background: var(--bg3); margin-top: 10px; } .meter i { display: block; height: 100%; background: var(--green-l); }

/* rich text: posts, descriptions (site.js md()) */
.rich { font-size: 15px; line-height: 1.8; color: var(--soft); overflow-wrap: anywhere; }
.rich h2, .rich h3 { font-family: var(--sans); font-weight: 700; color: var(--white); margin: 28px 0 12px; }
.rich h2 { font-size: 22px; } .rich h3 { font-size: 18px; }
.rich p { margin: 0 0 14px; } .rich ul, .rich ol { margin: 0 0 14px; padding-left: 22px; } .rich li { margin: 4px 0; }
.rich a { color: var(--green-l); }
.rich code { font-family: var(--mono); font-size: 13px; background: var(--bg3); padding: 1px 6px; color: var(--green-l); }
.rich pre { margin: 0 0 16px; padding: 16px 18px; background: var(--bg3); border: 2px solid var(--edge); overflow-x: auto; }
.rich pre code { padding: 0; background: none; color: var(--ink); font-size: 13px; line-height: 1.7; }
/* code colours (site.js HL): one palette for every page's code */
.hl-com { color: #6F7C95; font-style: italic; } .hl-str { color: #A5DD7E; } .hl-num { color: var(--coral); } .hl-kw { color: var(--purple); }
.hl-ty { color: var(--teal); } .hl-fn { color: var(--blue); } .hl-mac { color: #82AAFF; } .hl-attr { color: var(--gold); } .hl-life { color: var(--gold-l); }
.hl-key { color: var(--blue); } .hl-var { color: var(--gold-l); }
.rich blockquote { margin: 0 0 14px; padding: 12px 16px; border-left: 3px solid var(--purple); background: var(--purple-bg); color: var(--soft); }
.rich img { display: block; margin: 8px 0 16px; border: 2px solid var(--edge); }
.rich strong { color: var(--white); }
.rich hr { border: 0; border-top: 2px solid var(--line); margin: 24px 0; }
.code { background: var(--bg3); border: 2px solid var(--edge); }
.code .bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 2px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--dim); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 13px/1.8 var(--mono); color: var(--ink); }

/* the pixel cover: an item's picture when it has none (a seeded block pattern in its color: site.js cover()) */
.cover { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--bg3); image-rendering: pixelated; object-fit: cover; }
.icon-px { display: block; flex: none; width: 56px; height: 56px; image-rendering: pixelated; background: var(--bg3); }
.icon-px.lg { width: 96px; height: 96px; } .icon-px.sm { width: 40px; height: 40px; }

/* header */
header.top { position: sticky; top: 0; z-index: 20; border-bottom: 2px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); }
header.top .wrap { display: flex; align-items: center; gap: 12px 28px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); flex: none; }
.logo b { font-family: var(--pixel); font-size: 20px; letter-spacing: 2px; }
.logo:hover { color: var(--white); }
.logo .mark { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.logo .sec { font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; padding: 3px 8px; background: var(--card2); color: var(--sub); }
nav.main { display: flex; align-items: center; gap: 4px 24px; flex: 1 1 auto; font-size: 15px; font-weight: 500; }
nav.main > a { position: relative; color: var(--sub); text-decoration: none; padding: 6px 0; white-space: nowrap; }
nav.main > a:hover { color: var(--white); }
nav.main > a[aria-current="page"] { color: var(--white); }
nav.main > a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--green); }
.hdr-right { display: flex; gap: 12px; align-items: center; margin-left: auto; flex: none; }
.hdr-right .lang { margin-right: 4px; }
.lang { min-height: 38px; padding: 0 32px 0 12px; background: var(--bg3); border: 2px solid var(--edge); color: var(--white); font: inherit; font-size: 14px;
  border-radius: 0; cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.lang:focus-visible { outline: none; border-color: var(--green); }
.lang option { background: var(--bg3); color: var(--white); }
.me-btn { position: relative; }
.me-btn > button { display: flex; align-items: center; gap: 10px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--white); font: inherit; font-weight: 700; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: var(--card); border: 2px solid var(--edge); box-shadow: 6px 6px 0 var(--bg3); padding: 6px; z-index: 30; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; background: none; border: 0; color: var(--soft); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--card2); color: var(--white); }
.menu .who { padding: 10px 12px 12px; border-bottom: 2px solid var(--line); margin-bottom: 6px; font-size: 13px; color: var(--dim); }
.menu .who b { display: block; color: var(--white); font-size: 15px; }
.burger { display: none; width: 44px; height: 44px; place-items: center; padding: 0; background: var(--card); border: 2px solid var(--edge); color: var(--white); cursor: pointer; }
@media (max-width: 1080px) {
  .burger { display: grid; }
  /* (the menu opens as a row under the bar: the bar's own row keeps its height, never moving up as the header grows) */
  header.top .wrap { flex-wrap: wrap; min-height: 0; gap: 0 12px; } /* (the logo, the right side and the menu button on one row) */
  header.top .logo, header.top .hdr-right { min-height: 68px; }
  nav.main { display: none; order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 8px; }
  nav.main.open { display: flex; }
  nav.main > a { display: flex; align-items: center; min-height: 48px; border-top: 2px solid var(--line); }
  nav.main > a[aria-current="page"]::after { left: auto; right: 0; top: 50%; bottom: auto; width: 8px; height: 8px; transform: translateY(-50%); }
}
nav.main .lang-m { display: none; padding: 12px 0 4px; border-top: 2px solid var(--line); }
@media (max-width: 560px) { .logo b { font-size: 16px; letter-spacing: 1px; } .hdr-right .lang { display: none; } nav.main .lang-m { display: flex; } .hdr-right .btn.sm { display: none; } }

/* footer */
footer.site { border-top: 2px solid var(--line); background: var(--bg3); font-size: 13px; color: var(--dim); margin-top: auto; }
footer.site .wrap { padding-top: 40px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 24px; }
footer.site .top-row { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 2px solid var(--line); }
footer.site .top-row strong { font-family: var(--pixel); font-size: 16px; color: var(--white); letter-spacing: 2px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
footer.site nav a { color: var(--sub); text-decoration: none; font-size: 14px; } footer.site nav a:hover { color: var(--white); }
footer.site nav a.strong { color: var(--white); font-weight: 700; }
footer.site dl { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
footer.site dt { display: inline; } footer.site dd { display: inline; margin: 0 0 0 6px; color: var(--soft); }
footer.site dd a { color: var(--soft); }

/* messages */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 14px 18px; z-index: 50; display: none;
  background: var(--card); color: var(--white); border: 2px solid var(--green); box-shadow: 6px 6px 0 var(--bg3); font-weight: 500; }
#toast.bad { border-color: var(--bad); }
.note { padding: 14px 16px; background: var(--card); border: 2px solid var(--edge); border-left-width: 4px; font-size: 14px; color: var(--soft); }
.note.ok { border-color: var(--green); background: var(--green-bg); } .note.warn { border-color: var(--gold); background: var(--gold-bg); }
.note.bad { border-color: var(--bad); background: #2A1416; } .note.info { border-color: var(--blue); background: #0F1D33; }
.note b { color: var(--white); }
.preview-bar { background: repeating-linear-gradient(135deg, var(--gold-bg) 0 14px, #241F0E 14px 28px); border-bottom: 2px solid var(--gold-d); color: var(--gold-l);
  font-size: 13px; font-weight: 700; text-align: center; padding: 8px 16px; }
.loading { display: grid; place-items: center; min-height: 240px; color: var(--dim); font-family: var(--pixel); font-size: 12px; letter-spacing: 1px; }
.loading::before { content: ""; width: 14px; height: 14px; background: var(--green); margin-bottom: 14px; animation: hop 1s ease-in-out infinite; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pager button { min-width: 40px; min-height: 40px; border: 2px solid var(--edge); background: var(--bg3); color: var(--soft); font: inherit; font-weight: 700; cursor: pointer; }
.pager button[aria-current="page"] { background: var(--green); color: #0D1A08; border-color: var(--green); }
.pager button:disabled { opacity: .4; cursor: default; }
dialog.modal { border: 2px solid var(--edge); background: var(--card); color: var(--ink); padding: 24px; max-width: min(520px, calc(100% - 32px)); box-shadow: 10px 10px 0 var(--bg3); }
dialog.modal::backdrop { background: rgba(5, 8, 15, .7); }
dialog.modal.out h3 { margin-bottom: 12px; }
dialog.modal.out .out-addr { font-family: var(--mono, monospace); font-size: 13px; color: var(--soft); background: var(--bg3); border: 2px solid var(--edge);
  padding: 10px 12px; margin: 0 0 12px; overflow-wrap: anywhere; }
dialog.modal.out .out-addr strong { color: var(--white); }
dialog.modal.out .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .card.hover { transition: none; } .loading::before { animation: none; } }
