/* DNM Links — main stylesheet. Hand-written, no framework.
   Design: clean directory / catalog — paper background, hairline borders,
   one accent color, weight carried by typography rather than chrome. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Tokens ---------- */
:root {
  --paper: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --ink: #17181c;
  --ink-soft: #5b5d63;
  --ink-faint: #8b8d93;
  --border: #e3e0d8;
  --border-strong: #cfcbbf;
  --accent: #2f5d54;
  --accent-strong: #1f4038;
  --accent-soft: #e7efec;
  --ok: #2f7a4f;
  --ok-soft: #e7f2ea;
  --warn: #93650f;
  --warn-soft: #f6eddc;
  --bad: #a13a3a;
  --bad-soft: #f6e6e3;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;
  --shadow-s: 0 1px 2px rgba(23,24,28,.06);
  --shadow-m: 0 8px 24px rgba(23,24,28,.08);
  --container: 1200px;
}

body {
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.4rem; line-height: 1.3; }
h3 { font-size: 1.1rem; line-height: 1.35; }
strong { color: var(--ink); font-weight: 700; }
code { font-family: var(--mono); }

a.text-link { color: var(--accent); font-weight: 600; }
a.text-link:hover { text-decoration: underline; }

/* ---------- Icons ---------- */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: -0.14em; flex-shrink: 0;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: .75rem; top: -3rem; z-index: 300;
  padding: .5rem .75rem; background: var(--accent); color: #fff;
  font-size: .875rem; font-weight: 600; border-radius: var(--radius-s);
}
.skip-link:focus { top: .75rem; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, label:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
html { scroll-behavior: smooth; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .875rem; line-height: 1;
  padding: .65rem 1.1rem; border-radius: var(--radius-s);
  border: 1px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-outline { border-color: var(--border-strong); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-block { width: 100%; padding: .8rem 1.1rem; }
.btn-sm { padding: .5rem .7rem; font-size: .8rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 76px;
  background: rgba(250,249,246,.92); backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav-container-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 100%; }
.nav-logo-wrapper { display: flex; align-items: center; }
.nav-banner-logo {
  font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  color: var(--ink); white-space: nowrap;
}
.nav-banner-logo__accent { color: var(--accent-strong); }
.nav-link-group { display: flex; align-items: center; gap: .25rem; }
.nav-item {
  font-size: .8rem; font-weight: 600; color: var(--ink-soft); padding: .5rem .8rem;
  border-radius: var(--radius-s); cursor: pointer; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; transition: background-color .15s, color .15s;
}
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.tool-link { color: var(--accent-strong); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search .icon { position: absolute; left: .7rem; color: var(--ink-faint); pointer-events: none; }
.nav-search input {
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  font-size: .85rem; border-radius: 99px; padding: .5rem .9rem .5rem 2rem; width: 9.5rem;
  transition: width .2s, border-color .2s;
}
.nav-search input:focus { width: 13rem; border-color: var(--ink-faint); outline: none; }
.nav-mobile-toggle {
  width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s); cursor: pointer;
}
.nav-mobile-toggle:hover { background: var(--surface-2); }

.mobile-menu-overlay {
  display: none; position: fixed; inset: 0; z-index: 190; background: var(--paper);
  flex-direction: column; padding-top: 76px;
}
#mobile-menu-toggle:checked ~ .mobile-menu-overlay { display: flex; }
.mobile-menu-head {
  position: absolute; top: 0; left: 0; right: 0; height: 76px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border);
}
.mobile-menu-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.mobile-menu-body form { position: relative; margin-bottom: .5rem; }
.mobile-menu-body form input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  border-radius: var(--radius-m); padding: .75rem .9rem .75rem 2.4rem;
}
.mobile-menu-body form .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.mobile-link {
  display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-weight: 700; cursor: pointer;
}
.mobile-link:hover { background: var(--surface-2); }

/* ---------- Modal shells ---------- */
.modal-checkbox { display: none; }
.modal-container {
  display: none; position: fixed; inset: 0; z-index: 250; background: rgba(23,24,28,.55);
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-checkbox:checked + .modal-container { display: flex; }
body:has(.modal-checkbox:checked) { overflow: hidden; }

.modal-shell {
  background: var(--surface); width: 100%; max-width: 720px; max-height: 85vh;
  border-radius: var(--radius-l); border: 1px solid var(--border); box-shadow: var(--shadow-m);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-shell__head {
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-shell__title { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.modal-shell__close, .modal-close {
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s); color: var(--ink-faint); cursor: pointer;
}
.modal-shell__close:hover, .modal-close:hover { color: var(--ink); background: var(--surface-2); }
.modal-shell__body { padding: 1.1rem 1.4rem; overflow-y: auto; }
.list-grid { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 640px) { .list-grid { grid-template-columns: 1fr 1fr; } }

.list-row {
  display: flex; align-items: center; gap: .8rem; padding: .7rem; border-radius: var(--radius-m);
  border: 1px solid var(--border); transition: border-color .15s, background-color .15s;
}
.list-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.list-row__icon {
  width: 2.4rem; height: 2.4rem; border-radius: var(--radius-s); background: var(--surface-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.list-row__icon img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.list-row__meta { flex: 1; min-width: 0; }
.list-row__title { display: block; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__sub { font-size: .75rem; color: var(--ink-faint); }
.list-row__chevron { color: var(--ink-faint); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.list-row:hover .list-row__chevron { opacity: 1; transform: translateX(0); }

/* Leaving-site interstitial */
.modal-box { background: var(--surface); width: 100%; max-width: 420px; border-radius: var(--radius-l);
  border: 1px solid var(--border); box-shadow: var(--shadow-m); position: relative; padding: 2rem; text-align: center; }
.modal-box__icon {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 1.1rem; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--accent-strong);
}
.modal-box h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.modal-box p { font-size: .875rem; color: var(--ink-faint); margin-bottom: 1.3rem; }
.address-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m); padding: .8rem; margin-bottom: 1.3rem; text-align: left; }
.address-box__label { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; margin-bottom: .25rem; }
.address-box__value { font-family: var(--mono); font-size: .75rem; color: var(--accent-strong); word-break: break-all; user-select: all; }
.modal-box__actions { display: flex; flex-direction: column; gap: .6rem; }
.modal-box__close { position: absolute; top: .9rem; right: .9rem; }
.modal-box__resources {
  display: flex; flex-direction: column; gap: .4rem; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: .8rem; margin-bottom: 1.3rem;
}
.modal-box__resources .address-box__label { margin-bottom: .15rem; }
.modal-box__resources a { font-size: .78rem; }

/* ---------- Hero ---------- */
.hero { padding: 6.5rem 0 2.5rem; }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.2fr 1fr; } }
.hero__title { margin-bottom: 1rem; }
.hero__title em { color: var(--accent-strong); font-style: normal; }
.hero__lede { max-width: 34rem; margin-bottom: 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.callout { margin-top: 1.5rem; max-width: 34rem; padding: .8rem 1rem; border-radius: var(--radius-m); display: flex; gap: .7rem; }
.callout--warning { background: var(--warn-soft); border: 1px solid #e6d3a9; color: var(--ink); }
.callout .icon { color: var(--warn); margin-top: .15rem; }
.callout p { font-size: .8rem; }
/* .callout defaults to a horizontal icon+text flex row, sized for the small
   homepage alert banner. When it's reused as a full content section
   (combined with .panel--padded, e.g. long-form tutorial highlight boxes
   with a heading, paragraphs, a nested panel and an image), it needs to
   stack those children vertically at full width instead of cramming them
   into one flex row. */
.panel--padded.callout { max-width: none; display: block; }
.panel--padded.callout > * + * { margin-top: 1rem; }

.status-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 1.3rem; box-shadow: var(--shadow-s); }
.status-panel__head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: .75rem; margin-bottom: .75rem; }
.status-panel__head h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.status-panel__date { font-family: var(--mono); font-size: .7rem; color: var(--ink-faint); }
.status-panel__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; text-align: center; }
.status-panel__grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat__value { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.stat__value.ok { color: var(--ok); }
.stat__value.warn { color: var(--warn); }
.stat__value.bad { color: var(--bad); }
.stat__label { font-size: .65rem; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.status-panel__note { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--border); font-size: .68rem; color: var(--ink-faint); }

/* ---------- Section heading ---------- */
.section-head { margin-bottom: 1.25rem; }
.section-head h2 { font-size: 1.3rem; }
.section-head p { margin-top: .25rem; font-size: .85rem; color: var(--ink-faint); }

/* ---------- Info / FAQ ---------- */
.info-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 2rem; margin-bottom: 2.5rem; }
.info-block > div + div { margin-top: 1.75rem; }
.info-block h2, .info-block h3 { margin-bottom: .6rem; }
.info-block p { font-size: .9rem; }
.list-row__ph { color: var(--ink-faint); font-weight: 700; }
.faq-list { display: flex; flex-direction: column; gap: .6rem; margin-top: .9rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--paper); }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { transition: transform .15s; color: var(--ink-faint); }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item__answer { padding: 0 1rem 1rem; font-size: .875rem; color: var(--ink-faint); border-top: 1px solid var(--border); margin-top: .1rem; padding-top: .75rem; }

/* ---------- Tabs ---------- */
.tabs__nav { display: flex; gap: 1.5rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-label {
  display: flex; align-items: center; gap: .4rem; cursor: pointer; white-space: nowrap;
  font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-faint); padding-bottom: .9rem; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.tab-label:hover { color: var(--ink); }
.tab-content { display: none; }
#tab-all:checked ~ .content-all, #tab-exchange:checked ~ .content-exchange,
#tab-forum:checked ~ .content-forum, #tab-market:checked ~ .content-market,
#tab-offline:checked ~ .content-offline, #tab-vendor:checked ~ .content-vendor { display: block; }
#tab-all:checked ~ .tabs__nav label[for="tab-all"], #tab-market:checked ~ .tabs__nav label[for="tab-market"],
#tab-vendor:checked ~ .tabs__nav label[for="tab-vendor"], #tab-forum:checked ~ .tabs__nav label[for="tab-forum"],
#tab-exchange:checked ~ .tabs__nav label[for="tab-exchange"], #tab-offline:checked ~ .tabs__nav label[for="tab-offline"] {
  color: var(--ink); border-color: var(--ink);
}
.empty-state { text-align: center; padding: 3rem 0; color: var(--ink-faint); }

/* ---------- Market card ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 700px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .card-grid { grid-template-columns: 1fr 1fr 1fr; } }

.market-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.market-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-m); }
.market-card__head { padding: 1.1rem; border-bottom: 1px solid var(--border); }
.market-card__top { display: flex; align-items: center; gap: .9rem; margin-bottom: .7rem; }
.market-card__logo { width: 2.75rem; height: 2.75rem; object-fit: contain; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--border); padding: 3px; flex-shrink: 0; }
.market-card__meta { flex: 1; min-width: 0; }
.market-card__name { display: block; font-size: 1.05rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-card__name:hover { color: var(--accent-strong); }
.status-line { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.status-line.ok { color: var(--ok); }
.status-line.warn { color: var(--warn); }
.status-line.bad { color: var(--bad); }
.status-line.muted { color: var(--ink-faint); }
.market-card__desc { font-size: .85rem; color: var(--ink-faint); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.market-card__body { padding: 1.1rem; flex-grow: 1; display: flex; flex-direction: column; gap: 1rem; }
.meter__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.meter__label { font-size: .7rem; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.meter__value { font-family: var(--mono); font-size: .85rem; font-weight: 700; color: var(--ink); }
.meter__track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.meter__fill { height: 100%; border-radius: 3px; background: var(--accent); }
.meter__fill.ok { background: var(--ok); }
.meter__fill.warn { background: var(--warn); }
.meter__fill.bad { background: var(--bad); }
.market-card__payments { padding-top: .9rem; border-top: 1px solid var(--border); }
.payment-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.payment-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); font-size: .72rem; font-weight: 600; color: var(--ink-soft); }
.payment-badge img { width: 16px; height: 16px; }
.payment-badge--muted { color: var(--ink-faint); }
.market-card__foot { padding: 1rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.card-actions .btn { padding: .55rem .6rem; font-size: .78rem; }
.card-actions img.btn-glyph { width: 14px; height: 14px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 2.5rem; background: var(--surface-2); }
.footer-row { display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: space-between; text-align: center; }
@media (min-width: 700px) { .footer-row { flex-direction: row; text-align: left; } }
.footer-copy { font-size: .8rem; color: var(--ink-faint); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .8rem; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 2rem;
  padding-bottom: 2rem; text-align: center;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; text-align: left; }
}
.footer-brand { display: flex; flex-direction: column; gap: .6rem; align-items: center; }
@media (min-width: 700px) { .footer-brand { align-items: flex-start; } }
.footer-brand__desc { font-size: .82rem; color: var(--ink-faint); max-width: 26rem; line-height: 1.55; }
.footer-col { display: flex; flex-direction: column; gap: .65rem; align-items: center; }
@media (min-width: 700px) { .footer-col { align-items: flex-start; } }
.footer-heading {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  color: var(--ink-faint); margin-bottom: .1rem;
}
.footer-col a { font-size: .85rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-bottom {
  display: flex; flex-direction: column; gap: .5rem; align-items: center; justify-content: space-between;
  text-align: center; padding: 1.25rem 0; border-top: 1px solid var(--border);
}
@media (min-width: 700px) {
  .footer-bottom { flex-direction: row; text-align: left; }
}
.footer-disclaimer { font-size: .72rem; color: var(--ink-faint); }

/* ---------- Responsive nav helpers ---------- */
.hide-until-desktop { display: none; }
@media (min-width: 1024px) { .hide-until-desktop { display: flex; } .hide-on-desktop { display: none; } }
.hide-until-tablet { display: none; }
@media (min-width: 768px) { .hide-until-tablet { display: flex; } }

/* ---------- Page layout ---------- */
.page-main { padding-top: 5.5rem; min-height: 60vh; }
.page-main--narrow { max-width: 42rem; margin: 0 auto; padding: 5.5rem 20px 3rem; }
.page-section { padding: 2.5rem 0 3rem; }
.page-title { margin-bottom: 1.5rem; }
.section-title { margin-bottom: .75rem; }
.content-section { margin-bottom: 2.5rem; }

.breadcrumb { font-size: .8rem; color: var(--ink-faint); margin-bottom: 1.5rem; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb--hero { text-transform: uppercase; letter-spacing: .05em; font-weight: 600; font-size: .7rem; }
.breadcrumb--hero .current { color: var(--ink); }
.meta-text { color: var(--ink-faint); font-size: .875rem; }
.meta-text--sm { font-size: .75rem; }
.panel__title { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.section-title--icon { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: 1.1rem; }

/* ---------- Profile / market pages ---------- */
.profile-hero { position: relative; background: var(--surface); border-bottom: 1px solid var(--border); padding: 2rem 0; }
.profile-hero .container { position: relative; }
.profile-hero__row { display: flex; flex-direction: column; gap: 1.5rem; }
.profile-hero__content { display: flex; align-items: flex-start; gap: 1.25rem; flex: 1; }
@media (min-width: 768px) { .profile-hero__row { flex-direction: row; } }
.market-hero-logo { width: 5.5rem; height: 5.5rem; object-fit: contain; background: var(--surface-2); border-radius: var(--radius-l); padding: .5rem; border: 1px solid var(--border); flex-shrink: 0; }

.profile-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .profile-grid { grid-template-columns: 2fr 1fr; } }
.profile-grid__main { display: flex; flex-direction: column; gap: 2rem; }
.profile-grid__side { display: flex; flex-direction: column; gap: 1.5rem; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-s); }
.panel--padded { padding: 1.5rem; }
.panel__head { background: var(--surface-2); padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.panel__head h2 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }

.prose-content { font-size: .9rem; color: var(--ink-soft); line-height: 1.65; }
/* Pages use both shapes: a wrapper with nested <p>, and sibling
   <p class="prose-content"> elements. Both need the spacing. */
.prose-content p + p,
p.prose-content + p.prose-content,
p.prose-content + ul.prose-content,
p.prose-content + ol.prose-content { margin-top: .9rem; }
.prose-content--lede { margin-bottom: 2rem; }
.prose-content a { color: var(--accent); font-weight: 600; }
/* The base reset strips list markers, so prose has to put them back -- and the
   selectors have to match a list that IS the prose element as well as one
   nested inside it. */
.prose-content ul, .prose-content ol,
ul.prose-content, ol.prose-content { margin: .75rem 0; padding-left: 1.4rem; }
.prose-content ul, ul.prose-content { list-style: disc; }
.prose-content ol, ol.prose-content { list-style: decimal; }
.prose-content li { margin: .35rem 0; }
.prose-content li::marker { color: var(--ink-faint); }
.prose-content code { background: var(--surface-2); padding: .1rem .35rem; border-radius: var(--radius-s); font-size: .85em; }
.prose-content h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.prose-content h4 { font-size: .9rem; margin: 1rem 0 .4rem; }

.onion-box { display: block; flex: 1; background: var(--surface-2); border: 1px solid var(--border-strong); padding: .75rem; border-radius: var(--radius-m); font-family: var(--mono); font-size: .8rem; color: var(--accent-strong); word-break: break-all; user-select: all; }

.badge { display: inline-flex; align-items: center; padding: .15rem .5rem; border-radius: var(--radius-s); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border: 1px solid var(--border); }
.badge--muted { color: var(--ink-faint); background: var(--surface-2); }
.badge--warn { color: var(--warn); background: var(--warn-soft); border-color: #e6d3a9; }
.badge--ok { color: var(--ok); background: var(--ok-soft); border-color: #b8d9c4; }
.badge--bad { color: var(--bad); background: var(--bad-soft); border-color: #e0b8b8; }

.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tag { padding: .25rem .75rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: .72rem; color: var(--ink-soft); }

.share-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn { display: inline-flex; align-items: center; padding: .35rem .75rem; border-radius: var(--radius-s); font-size: .75rem; font-weight: 600; border: 1px solid var(--border); color: var(--ink-soft); background: var(--surface-2); transition: background-color .15s, border-color .15s; }
.share-btn:hover { border-color: var(--border-strong); background: var(--paper); }
.share-btn--copy { cursor: pointer; font-family: inherit; }
.share-btn--copy.is-copied { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }

/* Snapshot tabs on profile pages */
.preview-tabs { display: flex; gap: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.preview-tabs label { cursor: pointer; padding: .5rem .75rem; font-size: .8rem; font-weight: 600; color: var(--ink-faint); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: .35rem; }
.preview-tabs label:hover { color: var(--ink); }
#tab-live:checked ~ .preview-tabs label[for="tab-live"],
#tab-static:checked ~ .preview-tabs label[for="tab-static"] { color: var(--ink); border-color: var(--ink); }
.preview-container { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; min-height: 220px; }
.preview-container .tab-content { display: none; }
#tab-live:checked ~ .preview-container .content-live,
#tab-static:checked ~ .preview-container .content-static { display: block; }
.zoom-checkbox { display: none; }
.zoom-overlay { display: none; position: fixed; inset: 0; background: rgba(23,24,28,.92); z-index: 300; align-items: center; justify-content: center; }
.zoom-checkbox:checked ~ .zoom-overlay { display: flex; }

.meter-ring { width: 5.5rem; height: 5.5rem; position: relative; }
.meter-ring__outer { width: 100%; height: 100%; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--percent) * 1%), var(--surface-2) 0); mask: radial-gradient(transparent 55%, black 56%); -webkit-mask: radial-gradient(transparent 55%, black 56%); }
.meter-ring__inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }

.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 1.25rem; }
.sidebar-card h3 { font-size: .9rem; margin-bottom: .75rem; }
.related-list { display: flex; flex-direction: column; gap: .35rem; }
.related-row { display: flex; align-items: center; gap: .75rem; padding: .5rem; border-radius: var(--radius-m); transition: background-color .15s; }
.related-row:hover { background: var(--surface-2); }
.related-row img { width: 2.5rem; height: 2.5rem; object-fit: contain; background: var(--surface-2); border-radius: var(--radius-s); border: 1px solid var(--border); padding: 2px; }

.back-to-top { position: fixed; bottom: 2rem; right: 2rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--ink); color: #fff; border: none; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-m); cursor: pointer; z-index: 100; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.back-to-top.is-visible { opacity: 1; visibility: visible; }

/* PGP tool */
.pgp-hero { padding: 4rem 0 2.5rem; text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); }
.pgp-hero h1 em { color: var(--accent-strong); font-style: normal; }
.pgp-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 2rem; box-shadow: var(--shadow-s); }
.pgp-form label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; margin-bottom: .5rem; }
.pgp-form textarea, .pgp-form input[type="password"] { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m); padding: .9rem; font-family: var(--mono); font-size: .8rem; color: var(--ink); resize: vertical; }
.pgp-form textarea:focus, .pgp-form input:focus { border-color: var(--ink-faint); outline: none; }
.pgp-form-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .pgp-form-grid { grid-template-columns: 1fr 1fr; } }
.pgp-tabs { display: flex; justify-content: center; gap: 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.pgp-tabs .tab-label { padding-bottom: .9rem; }
#tab-encrypt:checked ~ .tabs-container .content-encrypt,
#tab-decrypt:checked ~ .tabs-container .content-decrypt { display: block; }
#tab-encrypt:checked ~ .nav-tabs label[for="tab-encrypt"],
#tab-decrypt:checked ~ .nav-tabs label[for="tab-decrypt"] { color: var(--ink); border-color: var(--ink); }

/* Tutorial hub cards */
.guide-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .guide-grid { grid-template-columns: 1fr 1fr 1fr; } }
.guide-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; transition: border-color .15s, box-shadow .15s; height: 100%; }
.guide-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-m); }
.guide-card__body { padding: 1.25rem; flex-grow: 1; }
.guide-card__title { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: .4rem; }
.guide-card__desc { font-size: .85rem; color: var(--ink-faint); }
.guide-card__foot {
  padding: .9rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: .75rem; font-weight: 700; color: var(--accent-strong);
  display: flex; align-items: center; gap: .35rem;
}

.guide-card__icon {
  width: 3rem; height: 3rem; border-radius: var(--radius-s); background: var(--surface-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  margin-bottom: .75rem; overflow: hidden;
}
.guide-card__icon img { width: 2rem; height: 2rem; object-fit: contain; }
.guide-card--featured { border-color: var(--accent); background: linear-gradient(180deg, var(--surface) 0%, var(--accent-soft) 100%); }

.section-title__img { width: 2rem; height: 2rem; object-fit: contain; flex-shrink: 0; }

.tutorial-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) {
  .tutorial-layout { grid-template-columns: 1fr 280px; }
  /* Sidebar markup comes before the main content in the DOM (for a sane
     reading/tab order), but it must render in the narrow right-hand track,
     not the wide 1fr track grid auto-placement would give it by default. */
  .tutorial-sidebar { order: 2; }
}
.tutorial-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.tutorial-sidebar h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: .5rem; }

.stack { display: flex; flex-direction: column; gap: 2rem; }
.stack-sm { display: flex; flex-direction: column; gap: 1rem; }
.link-back { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--ink-faint); margin-bottom: 1.25rem; }
.link-back:hover { color: var(--ink); }
.link-back .icon { transform: rotate(180deg); }

.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; color: var(--ink-soft); }
.data-table th, .data-table td { padding: .5rem .75rem .5rem 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table th { color: var(--ink); font-weight: 700; }
.data-table td:first-child { color: var(--ink); font-weight: 600; }

.panel__body { padding: 1.25rem 1.5rem; }
.form-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; margin-bottom: .5rem; }
.form-row { display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 640px) { .form-row { flex-direction: row; align-items: stretch; } }

.related-row__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.related-row__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.related-row__title { font-size: .875rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-row__sub { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .68rem; color: var(--ink-faint); }
.related-row__stat { font-family: var(--mono); }
.sidebar-card h3 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
.sidebar-card--panel .panel__title { margin-bottom: .75rem; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.stat-grid__cell { text-align: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); padding: .5rem; }
.stat-grid__label { display: block; font-size: .65rem; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .15rem; }
.stat-grid__value { font-size: .875rem; font-weight: 700; color: var(--ink); font-family: var(--mono); }

.step-list { display: flex; flex-direction: column; gap: 1rem; }
.step-row { display: flex; align-items: flex-start; gap: .85rem; }
.step-row__num {
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent-strong); flex-shrink: 0; font-size: .85rem;
}
.step-row h4 { font-size: .9rem; font-weight: 700; color: var(--ink); margin-bottom: .2rem; }
.mono-inline { font-family: var(--mono); color: var(--ink); }
.tutorial-img { width: 100%; border-radius: var(--radius-m); border: 1px solid var(--border); box-shadow: var(--shadow-s); margin-top: 1rem; }

.opacity-0 { opacity: 0; }
.invisible { visibility: hidden; }

.nav-item.is-active { color: var(--ink); background: var(--surface-2); }

/* Status dot in related rows */
.status-dot { width: .45rem; height: .45rem; border-radius: 50%; flex-shrink: 0; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--bad); }

/* ---------- Tutorial page helpers (owned-pages migration) ---------- */
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-bad { color: var(--bad); }
.text-accent { color: var(--accent-strong); }
.section-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.section-bar .section-title { margin-bottom: 0; }
.inset-box { background: var(--surface-2); }
.step-indent { margin-left: 2.75rem; }
.step-timeline { position: relative; }
.callout--tip {
  background: var(--warn-soft); border: 1px solid #e6d3a9; border-left: 4px solid var(--warn);
  padding: .8rem 1rem; border-radius: var(--radius-m); font-size: .875rem;
}
.callout--bad {
  background: var(--bad-soft); border: 1px solid #e0b8b8; border-left: 4px solid var(--bad);
  padding: .8rem 1rem; border-radius: var(--radius-m); font-size: .875rem;
}
.table-wrap { overflow-x: auto; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.text-center { text-align: center; }
