/* ============================================================
   LUMEN — design system
   Eye-first principles: warm paper instead of pure white,
   true dark mode, no flashing motion, generous rhythm.
   ============================================================ */

:root {
  /* palette — light (warm paper) */
  --bg: #f7f4ef;
  --bg-elev: #fffdf9;
  --bg-soft: #efeae2;
  --ink: #26221c;
  --ink-soft: #5c554a;
  --ink-faint: #8a8175;
  --line: #e3dcd0;
  --accent: #b4541e;
  --accent-ink: #8f3e0f;
  --accent-soft: #f4e3d7;
  --good: #3d7a4e;
  --good-soft: #e2efe5;
  --bad: #a84632;
  --bad-soft: #f5e3de;
  --shadow: 0 1px 2px rgba(38, 34, 28, .05), 0 12px 40px -12px rgba(38, 34, 28, .12);
  --shadow-lift: 0 2px 4px rgba(38, 34, 28, .06), 0 24px 60px -16px rgba(38, 34, 28, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 64px;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #16130f;
  --bg-elev: #1e1a15;
  --bg-soft: #262119;
  --ink: #ece5da;
  --ink-soft: #b3a998;
  --ink-faint: #7d7466;
  --line: #322c23;
  --accent: #d97a3d;
  --accent-ink: #e8945c;
  --accent-soft: #33241a;
  --good: #6fae7f;
  --good-soft: #1e2b21;
  --bad: #cd7258;
  --bad-soft: #33201a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 40px -12px rgba(0, 0, 0, .5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 24px 60px -16px rgba(0, 0, 0, .6);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 28px;
}
.brand { font-weight: 700; font-size: 19px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--ink-soft);
  transition: background .18s ease, color .18s ease;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-links a.active { background: var(--ink); color: var(--bg); }
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg-elev); font-size: 16px;
  transition: transform .18s ease;
}
.theme-btn:hover { transform: scale(1.08); }
.theme-btn svg { display: block; }
.cart-btn svg { display: block; }
.df-ico svg { display: block; width: 16px; height: 16px; }

.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px;
}
.nav-burger { display: none; }

/* ---------- hero ---------- */
.hero { padding: 110px 0 90px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 22px;
}
.display {
  font-size: clamp(42px, 7vw, 76px); line-height: 1.04; font-weight: 700;
  letter-spacing: -.035em; margin-bottom: 26px;
}
.display .soft { color: var(--ink-faint); }
.lede {
  font-size: clamp(18px, 2.2vw, 22px); color: var(--ink-soft);
  max-width: 640px; margin: 0 auto 40px; line-height: 1.55;
}
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-size: 16px; font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-ghost { border: 1px solid var(--line); background: var(--bg-elev); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-small { padding: 9px 18px; font-size: 14px; }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section-tight { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 14px; }
.h3 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
.sub { color: var(--ink-soft); font-size: 18px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card .icon {
  width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft);
  color: var(--accent-ink); display: grid; place-items: center; font-size: 21px; margin-bottom: 18px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 15.5px; }

/* ---------- blog ---------- */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card .thumb {
  height: 190px; display: grid; place-items: center; font-size: 44px;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
  border-bottom: 1px solid var(--line);
}
.post-card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-meta { font-size: 13px; color: var(--ink-faint); display: flex; gap: 10px; align-items: center; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.post-card h3 { font-size: 20px; line-height: 1.3; }
.post-card p { color: var(--ink-soft); font-size: 15px; flex: 1; }
.read-more { color: var(--accent-ink); font-weight: 600; font-size: 15px; }

/* article page */
.article { padding: 72px 0 40px; }
.article h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.03em; line-height: 1.08; margin: 18px 0 22px; }
.article-body { font-size: 18px; }
.article-body p { margin: 0 0 26px; }
.article-body h2 { font-size: 27px; letter-spacing: -.02em; margin: 44px 0 16px; }
.article-body ul { margin: 0 0 26px 22px; }
.article-body li { margin-bottom: 10px; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 6px 0 6px 22px; margin: 0 0 26px;
  color: var(--ink-soft); font-size: 19px;
}
.article-body code { font-family: var(--mono); font-size: 15px; background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; }

/* ---------- devices ---------- */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.chip {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-elev); font-size: 14px; font-weight: 600; color: var(--ink-soft);
  transition: all .16s ease;
}
.chip:hover { border-color: var(--ink-faint); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.device-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.device-head { padding: 24px 26px 0; display: flex; align-items: flex-start; gap: 14px; }
.device-emoji {
  width: 52px; height: 52px; border-radius: 15px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 26px; flex-shrink: 0;
}
.device-title h3 { font-size: 19px; line-height: 1.25; }
.device-title .cat { font-size: 13px; color: var(--ink-faint); }
.verdict {
  margin-left: auto; font-size: 12.5px; font-weight: 700; padding: 5px 13px;
  border-radius: 999px; letter-spacing: .03em; flex-shrink: 0;
}
.verdict.good { background: var(--good-soft); color: var(--good); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.device-body { padding: 16px 26px 22px; flex: 1; }
.device-body p { font-size: 15px; color: var(--ink-soft); margin-bottom: 14px; }
.trait-row { display: flex; flex-wrap: wrap; gap: 7px; }
.trait { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-soft); }
.trait.ok { background: var(--good-soft); color: var(--good); }
.trait.warn { background: var(--bad-soft); color: var(--bad); }

.device-comments { border-top: 1px solid var(--line); padding: 18px 26px 24px; background: color-mix(in srgb, var(--bg-soft) 44%, transparent); }
.device-comments summary {
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-soft);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.device-comments summary::-webkit-details-marker { display: none; }
.device-comments summary::after { content: "›"; transition: transform .18s ease; font-size: 17px; }
.device-comments[open] summary::after { transform: rotate(90deg); }
.comment-list { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.comment {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; font-size: 14.5px;
}
.comment .who { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.comment .when { color: var(--ink-faint); font-weight: 400; margin-left: 8px; font-size: 12px; }
.comment-form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.comment-form input, .comment-form textarea {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14.5px; resize: vertical; outline: none;
  transition: border-color .15s ease;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form .row { display: flex; gap: 10px; }
.comment-form .row input { flex: 1; }

/* ---------- shop ---------- */
.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-media {
  height: 210px; display: grid; place-items: center; font-size: 56px;
  background: linear-gradient(160deg, var(--bg-soft), var(--accent-soft));
  border-bottom: 1px solid var(--line);
}
.product-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.product-body h3 { font-size: 18.5px; }
.product-body .desc { font-size: 14.5px; color: var(--ink-soft); flex: 1; }
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

/* cart drawer */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(20, 16, 10, .45); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); z-index: 100;
  background: var(--bg-elev); border-left: 1px solid var(--line);
  transform: translateX(105%); transition: transform .3s cubic-bezier(.32,.72,.28,1);
  display: flex; flex-direction: column;
}
body.cart-open .drawer { transform: none; }
body.cart-open .drawer-scrim { opacity: 1; pointer-events: auto; }
.drawer-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.drawer-head h3 { font-size: 20px; }
.drawer-close { margin-left: auto; font-size: 22px; color: var(--ink-faint); }
.drawer-items { flex: 1; overflow-y: auto; padding: 18px 26px; display: flex; flex-direction: column; gap: 14px; }
.cart-item { display: flex; gap: 14px; align-items: center; }
.cart-item .thumb {
  width: 54px; height: 54px; border-radius: 12px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 24px; flex-shrink: 0;
}
.cart-item .info { flex: 1; }
.cart-item .info .name { font-weight: 600; font-size: 15px; }
.cart-item .info .unit { font-size: 13px; color: var(--ink-faint); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 14px;
}
.drawer-foot { padding: 20px 26px 26px; border-top: 1px solid var(--line); }
.total-row { display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.drawer-foot .btn { width: 100%; justify-content: center; }
.cart-empty { text-align: center; color: var(--ink-faint); padding: 40px 0; }

/* ---------- misc ---------- */
.banner {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px; display: flex; align-items: center; gap: 32px; box-shadow: var(--shadow);
}
.banner h3 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; }
.banner p { color: var(--ink-soft); }
.banner .btn { margin-left: auto; flex-shrink: 0; }

.footer { border-top: 1px solid var(--line); padding: 52px 0 64px; margin-top: 40px; }
.footer-inner { display: flex; gap: 48px; flex-wrap: wrap; }
.footer .col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: 14px; }
.footer .col a { display: block; font-size: 15px; color: var(--ink-soft); padding: 4px 0; }
.footer .col a:hover { color: var(--ink); }
.footer-note { margin-top: 40px; font-size: 13.5px; color: var(--ink-faint); }

.ea-perm { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.ea-perm input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- profile card ---------- */
.profile-card { position: relative; width: min(400px, 100%); background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lift); text-align: center; padding-bottom: 24px; }
.profile-cover { height: 84px; background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--bg-soft))); }
.profile-x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.25); color: #fff; font-size: 22px; line-height: 1; }
.profile-av { margin: -46px auto 12px; width: 92px; height: 92px; position: relative; }
.profile-av .f-avatar { border: 4px solid var(--bg-elev); }
.profile-status { position: absolute; right: 4px; bottom: 4px; }
.profile-name { font-size: 21px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; justify-content: center; }
.profile-meta { font-size: 13.5px; color: var(--ink-faint); margin-top: 2px; }
.profile-bio { color: var(--ink-soft); font-size: 15px; max-width: 320px; margin: 14px auto 0; line-height: 1.5; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; padding: 0 20px; }


/* account slot in nav — keep inbox + profile side by side (was stacking on mobile) */
[data-acct-slot] { display: inline-flex; align-items: center; gap: 6px; }
.acct-menu-wrap { display: inline-flex; }
@media (max-width: 720px) {
  .acct-menu { position: fixed; top: var(--nav-h); right: 8px; left: auto; width: 210px; }
}

/* account dropdown menu */
.acct-menu { position: absolute; right: 0; top: 46px; width: 210px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 8px;
  opacity: 0; pointer-events: none; transform: translateY(-6px); transition: all .16s ease; z-index: 60; }
.acct-menu-wrap.open .acct-menu { opacity: 1; pointer-events: auto; transform: none; }
.acct-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-menu-head b { display: block; font-size: 14px; } .acct-menu-head span { font-size: 12px; color: var(--ink-faint); }
.acct-menu a { display: block; padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.acct-menu a:hover { background: var(--bg-soft); color: var(--ink); }

/* ---------- flat / e-ink mode: no shadows, gradients, blur ---------- */
[data-flat="on"] * { box-shadow: none !important; text-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
[data-flat="on"] body { background-image: none !important; }
[data-flat="on"] .card, [data-flat="on"] .panel, [data-flat="on"] .repo-card,
[data-flat="on"] .thread-post, [data-flat="on"] .thread-row, [data-flat="on"] .device-card,
[data-flat="on"] .product-card, [data-flat="on"] .stat, [data-flat="on"] .banner,
[data-flat="on"] .btn-primary, [data-flat="on"] .btn-ghost, [data-flat="on"] .chip,
[data-flat="on"] .nav, [data-flat="on"] .theme-btn, [data-flat="on"] input,
[data-flat="on"] textarea, [data-flat="on"] select {
  border: 1.5px solid var(--line) !important; border-radius: 4px;
}
[data-flat="on"] .brand-dot, [data-flat="on"] .verdict, [data-flat="on"] .tag,
[data-flat="on"] .role-badge, [data-flat="on"] .repo-verdict { border-radius: 3px; }
[data-flat="on"] .post-card .thumb, [data-flat="on"] .product-media,
[data-flat="on"] .repo-shot, [data-flat="on"] .card .icon,
[data-flat="on"] .maint-body { background: var(--bg-soft) !important; }
[data-flat="on"] .btn-primary { background: var(--ink) !important; color: var(--bg) !important; }
[data-flat="on"] .display, [data-flat="on"] .h2 { letter-spacing: -.02em; }

/* ---------- maintenance page ---------- */
.maint-body { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 700px at 50% -10%, var(--accent-soft), var(--bg) 60%); }
.maint-wrap { width: min(560px, 100%); }
.maint-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 26px;
  padding: 54px 44px; text-align: center; box-shadow: var(--shadow-lift); }
.maint-orb { position: relative; width: 92px; height: 92px; margin: 0 auto 26px; }
.maint-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent);
  opacity: .35; animation: maint-pulse 2.8s ease-out infinite; }
.maint-orb span:nth-child(2) { animation-delay: .9s; }
.maint-orb span:nth-child(3) { animation-delay: 1.8s; }
.maint-orb::after { content: ''; position: absolute; inset: 34px; border-radius: 50%; background: var(--accent); }
@keyframes maint-pulse { 0% { transform: scale(.5); opacity: .5; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .maint-orb span { animation: none; opacity: .3; } }
.maint-brand { font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink-soft); margin-bottom: 18px; }
.maint-card h1 { font-size: clamp(26px, 5vw, 36px); letter-spacing: -.025em; margin-bottom: 14px; }
.maint-card p { color: var(--ink-soft); font-size: 17px; line-height: 1.6; max-width: 420px; margin: 0 auto; }
.maint-eta { margin-top: 20px; display: inline-block; background: var(--bg-soft); border-radius: 999px;
  padding: 8px 18px; font-size: 14px; color: var(--ink-soft); }
.maint-access { margin-top: 22px; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.maint-login { margin-top: 18px; text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.maint-login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ml-col { display: flex; flex-direction: column; gap: 8px; }
.ml-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.ml-col input { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.ml-col .btn { justify-content: center; }
@media (max-width: 460px) { .maint-login-tabs { grid-template-columns: 1fr; } .maint-card { padding: 40px 24px; } }
.maint-foot { margin-top: 30px; font-size: 13px; color: var(--ink-faint); }

/* ---------- liquid glass mode (Apple-style translucency) ---------- */
[data-glass="on"] .nav {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(26px); backdrop-filter: saturate(1.8) blur(26px);
}
[data-glass="on"] .card, [data-glass="on"] .panel, [data-glass="on"] .repo-card,
[data-glass="on"] .thread-post, [data-glass="on"] .thread-row, [data-glass="on"] .banner,
[data-glass="on"] .stat, [data-glass="on"] .device-card, [data-glass="on"] .product-card {
  background: color-mix(in srgb, var(--bg-elev) 62%, transparent);
  -webkit-backdrop-filter: saturate(1.7) blur(20px); backdrop-filter: saturate(1.7) blur(20px);
  border-color: color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, var(--shadow);
}
[data-glass="on"] .drawer, [data-glass="on"] .comfort-panel, [data-glass="on"] .admin-modal,
[data-glass="on"] .mobile-sheet-inner, [data-glass="on"] .search-box input, [data-glass="on"] .search-results {
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(30px); backdrop-filter: saturate(1.8) blur(30px);
}
[data-glass="on"] .btn-ghost { background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

.footer-social { display: flex; gap: 10px; margin-bottom: 20px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-elev); display: grid; place-items: center; color: var(--ink-soft); transition: all .16s ease; }
.footer-social a:hover { color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); }
.footer-social svg { width: 19px; height: 19px; }
.footer-donate { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-weight: 600; }
.footer-donate svg { width: 15px; height: 15px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(12, 9, 6, .92);
  display: none; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
body.lightbox-open { overflow: hidden; }
body.lightbox-open .lightbox { display: flex; }
.lb-stage { max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0; }
.lb-stage img { max-width: 92vw; max-height: 80vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); object-fit: contain; }
.lb-stage figcaption { color: #f0e9e0; font-size: 14px; max-width: 640px; text-align: center; }
.lb-close, .lb-nav {
  position: fixed; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: background .15s ease;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 18px; right: 18px; width: 46px; height: 46px; font-size: 28px; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 34px; line-height: 1; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-count { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); color: #f0e9e0; font-size: 14px; font-weight: 600; }
@media (max-width: 640px) { .lb-nav { width: 44px; height: 44px; font-size: 26px; } .lb-prev { left: 8px; } .lb-next { right: 8px; } }

/* ---------- layout presets ---------- */
[data-layout="centered"] .nav { height: auto; }
[data-layout="centered"] .nav-inner { flex-direction: column; gap: 8px; padding: 14px 24px 12px; height: auto; }
[data-layout="centered"] .nav-links { margin-left: 0; justify-content: center; flex-wrap: wrap; }
[data-layout="centered"] .brand { font-size: 22px; }

[data-layout="floating"] .nav {
  background: none; border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  padding: 14px 0 0; height: auto; pointer-events: none;
}
[data-layout="floating"] .nav-inner {
  pointer-events: auto; max-width: 1040px; height: 58px;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  padding: 0 10px 0 22px; margin: 0 20px;
}
@media (min-width: 1100px) { [data-layout="floating"] .nav-inner { margin: 0 auto; } }

/* ---------- motion presets ---------- */
[data-motionstyle="expressive"] .card:hover { transform: translateY(-6px) scale(1.012); }
[data-motionstyle="expressive"] .btn { transition: transform .3s cubic-bezier(.2,1.6,.35,1), box-shadow .25s ease, background .18s ease; }
[data-motionstyle="expressive"] .btn:hover { transform: translateY(-2px) scale(1.04); }
[data-motionstyle="expressive"] .btn:active { transform: scale(.94); }
[data-motionstyle="expressive"] .reveal { transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
[data-motionstyle="expressive"] .reveal.below-fold { transform: translateY(34px) scale(.985); }
[data-motionstyle="expressive"] .theme-btn:hover { transform: scale(1.16) rotate(6deg); }
[data-motionstyle="expressive"] .thread-row:hover,
[data-motionstyle="expressive"] .repo-card:hover { transform: translateY(-4px) scale(1.005); }

[data-motionstyle="minimal"] .card:hover, [data-motionstyle="minimal"] .repo-card:hover { transform: none; }
[data-motionstyle="minimal"] .reveal.below-fold { transform: none; }
[data-motionstyle="minimal"] .btn:hover { transform: none; }
[data-motionstyle="minimal"] .donate-fab:hover, [data-motionstyle="minimal"] .theme-btn:hover { transform: none; }

[data-motionstyle="off"] *, [data-motionstyle="off"] *::before, [data-motionstyle="off"] *::after {
  animation: none !important; transition: none !important;
}
[data-motionstyle="off"] .reveal.below-fold { opacity: 1; transform: none; }
[data-motionstyle="off"] .card:hover, [data-motionstyle="off"] .btn:hover { transform: none; }

/* ---------- site search ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 16, 10, .45);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 20px 0;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
body.search-open .search-overlay { display: flex; }
.search-box { width: min(620px, 100%); }
.search-box input {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 16px; padding: 17px 22px; font-size: 17px; outline: none;
  box-shadow: var(--shadow-lift);
}
.search-results { margin-top: 10px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lift); max-height: 55vh; overflow-y: auto; }
.sr-hint { padding: 18px 22px; color: var(--ink-faint); font-size: 14.5px; }
.sr-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--ink-soft); transition: background .12s ease; }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: var(--bg-soft); color: var(--ink); }
.sr-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-soft); display: grid; place-items: center; flex-shrink: 0; }
.sr-main { flex: 1; display: flex; flex-direction: column; }
.sr-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.sr-type { font-size: 12px; color: var(--ink-faint); }

/* ---------- newsletter ---------- */
.newsletter-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.newsletter-form input {
  min-width: 260px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 20px; font-size: 15px; outline: none;
}
.newsletter-form input:focus { border-color: var(--accent); }

.donate-block {
  background: linear-gradient(160deg, var(--accent-soft), var(--bg-elev));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 48px 40px; text-align: center; box-shadow: var(--shadow);
}
.donate-block .donate-ico { font-size: 40px; margin-bottom: 10px; }
.donate-block h3 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 10px; }
.donate-block p { color: var(--ink-soft); max-width: 520px; margin: 0 auto 22px; }
.donate-block .donate-sub { font-size: 13px; color: var(--ink-faint); margin-top: 14px; }

.donate-fab {
  position: fixed; left: 22px; bottom: 22px; z-index: 80;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-lift);
  transition: transform .18s ease;
}
.donate-fab:hover { transform: translateY(-2px) scale(1.02); }
.donate-fab .df-ico { font-size: 17px; }
@media (max-width: 640px) { .donate-fab span:not(.df-ico) { display: none; } .donate-fab { padding: 14px; } }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 24px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- comfort panel (accessibility) ---------- */
.comfort-scrim {
  position: fixed; inset: 0; background: rgba(20, 16, 10, .35); z-index: 140;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.comfort-panel {
  position: fixed; right: 18px; bottom: 18px; width: min(400px, calc(100vw - 36px));
  max-height: calc(100vh - 36px); overflow-y: auto;
  z-index: 150; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  transform: translateY(14px); opacity: 0; pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.comfort-head { position: sticky; top: 0; background: var(--bg-elev); z-index: 1; }
body.comfort-open .comfort-panel { transform: none; opacity: 1; pointer-events: auto; }
body.comfort-open .comfort-scrim { opacity: 1; pointer-events: auto; }
.comfort-head { display: flex; align-items: center; padding: 18px 22px 0; }
.comfort-head h3 { font-size: 18px; }
.comfort-body { padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.comfort-group > label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.comfort-group .hint { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; margin-top: 2px; }
.comfort-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tint-swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 14px; color: var(--ink-soft);
  background: var(--bg-soft); cursor: pointer; transition: transform .14s ease, border-color .14s ease;
  position: relative; overflow: hidden;
}
.tint-swatch:hover { transform: scale(1.1); }
.tint-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tint-swatch.custom input[type=color] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; border: 0; padding: 0;
}
[data-tint="on"] .thumb,
[data-tint="on"] .product-media,
[data-tint="on"] .card .icon { background: var(--bg-soft); }
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation: none !important; transition: none !important;
}
[data-motion="off"] .reveal.below-fold { opacity: 1; transform: none; }

/* reading font + spacing apply to body copy, not chrome */
[data-reading-font="on"] body { font-family: var(--font-reading); }
.lede, .sub, .article-body, .card p, .device-body p, .product-body .desc,
.post-card p, .comment, .thread-post {
  letter-spacing: var(--reading-letter, normal);
}
.article-body { line-height: var(--reading-line, 1.65); }

/* ---------- images in content ---------- */
.thumb img, .product-media img { width: 100%; height: 100%; object-fit: cover; }
.device-emoji img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.article-body figure { margin: 0 0 28px; }
.article-body figure img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.article-body figcaption { font-size: 14px; color: var(--ink-faint); margin-top: 10px; text-align: center; }

/* reveal on scroll — progressive enhancement: content is visible by default;
   JS hides only elements below the fold, then reveals them as they enter. */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal.below-fold { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--bg-elev); border-right: 1px solid var(--line);
  padding: 26px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { margin: 0 10px 26px; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav button {
  text-align: left; padding: 11px 14px; border-radius: 12px; font-size: 15px;
  color: var(--ink-soft); display: flex; align-items: center; gap: 11px; transition: all .15s ease;
}
.admin-nav button:hover { background: var(--bg-soft); color: var(--ink); }
.admin-nav button.active { background: var(--ink); color: var(--bg); }
.admin-nav .ico { font-size: 16px; width: 20px; text-align: center; }
.admin-side .side-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.admin-main { padding: 40px 46px 80px; max-width: 940px; }
.admin-head { display: flex; align-items: flex-end; margin-bottom: 30px; gap: 16px; }
.admin-head h1 { font-size: 30px; letter-spacing: -.025em; }
.admin-head p { color: var(--ink-soft); font-size: 15px; }
.admin-head .btn { margin-left: auto; }

.panel {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.panel h2 { font-size: 19px; margin-bottom: 4px; letter-spacing: -.015em; }
.panel .desc { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .01em; }
.field input[type=text], .field input[type=number], .field input[type=password],
.field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 14px; font-size: 15px; outline: none; transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.toggle-line { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-line:last-child { border-bottom: 0; }
.toggle-line .tl-text { flex: 1; }
.toggle-line .tl-text .t { font-weight: 600; font-size: 15px; }
.toggle-line .tl-text .d { font-size: 13px; color: var(--ink-faint); }

.a-switch { width: 46px; height: 27px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); position: relative; flex-shrink: 0; transition: background .18s ease; cursor: pointer; }
.a-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease; }
.a-switch.on { background: var(--accent); }
.a-switch.on::after { transform: translateX(19px); }

.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.item-row .em { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-soft); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; overflow: hidden; }
.item-row .em img { width: 100%; height: 100%; object-fit: cover; }
.item-row .meta { flex: 1; min-width: 0; }
.item-row .meta .n { font-weight: 600; font-size: 15px; }
.item-row .meta .s { font-size: 13px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .acts { display: flex; gap: 6px; flex-shrink: 0; }
.mini-btn { padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--bg-elev); transition: all .14s ease; }
.mini-btn:hover { border-color: var(--ink-faint); }
.mini-btn svg { width: 14px; height: 14px; vertical-align: middle; }
.mini-btn.danger { color: var(--bad); }
.mini-btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.preset-card { border: 2px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; transition: border-color .15s ease; }
.preset-card.active { border-color: var(--accent); }
.preset-card .sw { display: flex; gap: 5px; margin-bottom: 10px; }
.preset-card .sw span { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); }
.preset-card .pn { font-size: 14px; font-weight: 600; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0; background: none; cursor: pointer; }
.color-field .cl { font-size: 13px; }
.color-field .cl b { display: block; font-size: 14px; font-weight: 600; }

.admin-modal-scrim { position: fixed; inset: 0; background: rgba(20,16,10,.5); z-index: 300; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.admin-modal-scrim.open { display: flex; }
.admin-modal { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); width: min(640px, 100%); box-shadow: var(--shadow-lift); }
.admin-modal .m-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.admin-modal .m-head h3 { font-size: 19px; }
.admin-modal .m-body { padding: 24px 26px; }
.admin-modal .m-foot { padding: 18px 26px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.stat .num { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.stat .lbl { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 40px; width: min(400px, 100%); text-align: center; }
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card p { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 24px; }
.login-card input { width: 100%; text-align: center; margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 16px; }

.role-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; }
.role-badge.admin { background: var(--accent-soft); color: var(--accent-ink); }
.role-badge.moderator { background: var(--good-soft); color: var(--good); }
.role-badge.member { background: var(--bg-soft); color: var(--ink-soft); }

/* ---------- PWM repository ---------- */
.repo-toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.repo-search {
  flex: 1; min-width: 240px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 999px; padding: 13px 20px; font-size: 15px; outline: none; transition: border-color .15s ease;
}
.repo-search:focus { border-color: var(--accent); }
.repo-sortsel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; padding: 0 18px; font-size: 14px; outline: none; cursor: pointer; }
.repo-filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.repo-count { margin-left: auto; font-size: 13.5px; color: var(--ink-faint); }
.repo-pending { font-size: 13px; color: var(--accent-ink); margin-bottom: 18px; min-height: 6px; }

.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.repo-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.repo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.repo-shot { position: relative; height: 150px; flex: 0 0 150px; overflow: hidden; background: linear-gradient(135deg, var(--bg-soft), var(--accent-soft)); display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.repo-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.repo-shot.empty span { color: var(--ink-faint); font-size: 14px; }
.repo-shotcount { position: absolute; bottom: 10px; right: 10px; font-size: 11px; font-weight: 600; background: rgba(12,9,6,.6); color: #fff; padding: 3px 9px; border-radius: 999px; }
.repo-verdict { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; letter-spacing: .04em; }
.repo-verdict.good { background: var(--good); color: #fff; }
.repo-verdict.bad { background: var(--bad); color: #fff; }
.repo-verdict.mixed { background: #c9922d; color: #fff; }
.repo-body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.repo-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.repo-title h3 { font-size: 18px; letter-spacing: -.01em; }
.repo-year { font-size: 13px; color: var(--ink-faint); margin-left: auto; }
.repo-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 14px; }
.repo-spec-grid .spec { display: flex; flex-direction: column; }
.repo-spec-grid .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.repo-spec-grid .v { font-size: 14.5px; }
.repo-spec-grid .v.strong { font-weight: 700; }
.repo-notes { font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }
.repo-mit { font-size: 13.5px; color: var(--ink-soft); background: var(--good-soft); padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; }
.repo-foot { display: flex; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.repo-by { font-size: 12.5px; color: var(--ink-faint); }
.repo-admin-acts { margin-left: auto; display: flex; gap: 6px; }

/* ---------- forum ---------- */
.forum-top { display: flex; align-items: center; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.forum-top .btn { margin-left: auto; }
.forum-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; flex-wrap: wrap; }
.forum-toolbar .repo-search { max-width: 380px; }
.forum-id { margin-left: auto; font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; }
.cat-stats { margin-left: auto; font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.f-avatar {
  display: inline-grid; place-items: center; border-radius: 50%;
  font-weight: 700; letter-spacing: .02em; flex-shrink: 0; user-select: none;
}
[data-theme="dark"] .f-avatar { --av-l: 24%; filter: brightness(1.4); }
.thread-row .t-last { text-align: right; flex-shrink: 0; min-width: 90px; }
.thread-row .tl-who { font-size: 13px; font-weight: 600; }
.thread-row .tl-when { font-size: 12px; color: var(--ink-faint); }
.crumbs { font-size: 14px; color: var(--ink-faint); margin-bottom: 16px; }
.crumbs a { cursor: pointer; color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs span { margin: 0 6px; }
.thread-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.mod-bar { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.op-badge { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--ink); color: var(--bg); letter-spacing: .05em; }
.post-acts { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.post-num { font-size: 12.5px; font-weight: 700; color: var(--ink-faint); padding: 4px 8px; border-radius: 8px; }
.post-num:hover { background: var(--bg-soft); color: var(--accent-ink); }
.post-act {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-soft); transition: all .14s ease;
}
.post-act:hover { border-color: var(--ink-faint); color: var(--ink); }
.post-act.on { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.post-act.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.post-body { font-size: 15.5px; }
.post-body p { margin: 0 0 12px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 0 0 12px; color: var(--ink-soft); font-size: 14.5px; }
.post-body ul { margin: 0 0 12px 20px; }
.post-body code { font-family: var(--mono); font-size: 13px; background: var(--bg-soft); padding: 1px 6px; border-radius: 5px; }

/* forum (legacy shared bits) */
.forum-cat { margin-bottom: 30px; }
.forum-cat .ch { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.forum-cat .ch h2 { font-size: 22px; letter-spacing: -.02em; }
.forum-cat .ch p { font-size: 14px; color: var(--ink-faint); }
.thread-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; transition: border-color .15s ease; cursor: pointer; }
.thread-row:hover { border-color: var(--ink-faint); }
.thread-row .ti { flex: 1; }
.thread-row .ti .tt { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.thread-row .ti .tm { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.thread-row .rc { font-size: 13px; color: var(--ink-soft); text-align: center; flex-shrink: 0; }
.pin-badge, .lock-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.lock-badge { background: var(--bg-soft); color: var(--ink-faint); }
.thread-post { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; }
.thread-post .ph { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.thread-post .ph .who { font-weight: 700; font-size: 14px; }
.thread-post .ph .when { font-size: 12px; color: var(--ink-faint); }
.thread-post .ph .mod { margin-left: auto; }
.thread-post .ph .post-acts { flex-wrap: wrap; }
@media (max-width: 560px) {
  .thread-post .ph .post-acts { margin-left: 0; width: 100%; margin-top: 6px; justify-content: flex-start; }
}
.likers { font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; cursor: pointer; }
.likers:hover { color: var(--accent-ink); }
.likers b { color: var(--ink-soft); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-side .brand, .admin-side .side-foot { width: 100%; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 28px 20px 60px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .banner { flex-direction: column; text-align: center; }
  .banner .btn { margin: 0 auto; }
}
/* ---------- mobile menu ---------- */
.nav-burger { display: none; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--bg-elev); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-burger span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .22s ease, opacity .22s ease; }
body.mobilenav-open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.mobilenav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.mobilenav-open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-sheet {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 45; background: rgba(20,16,10,.4);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
body.mobilenav-open .mobile-sheet { opacity: 1; pointer-events: auto; }
.mobile-sheet-inner {
  background: var(--bg-elev); border-bottom: 1px solid var(--line); padding: 12px;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow);
  transform: translateY(-12px); transition: transform .26s cubic-bezier(.32,.72,.28,1);
}
body.mobilenav-open .mobile-sheet-inner { transform: none; }
.mobile-sheet-inner a { padding: 14px 18px; border-radius: 12px; font-size: 17px; font-weight: 600; color: var(--ink); }
.mobile-sheet-inner a:hover { background: var(--bg-soft); }
.mobile-sheet-actions { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--line); margin-top: 6px; }
.mobile-sheet-actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.mobile-sheet-actions button svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .nav-links a { display: none; }        /* hide inline page links */
  /* declutter: search + comfort move into the menu sheet on mobile */
  .nav-links > button[onclick*="openSearch"],
  .nav-links > button[onclick*="openComfort"] { display: none; }
  .nav-burger { display: flex; }
  .nav-inner { gap: 10px; }
  [data-layout="centered"] .nav-inner { flex-direction: row; }
  [data-layout="floating"] .nav-inner { margin: 0 12px; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 72px 0 60px; }
  .section { padding: 60px 0; }
  .section-tight { padding: 44px 0; }
  .wrap, .wrap-narrow { padding: 0 18px; }
  .repo-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 24px 16px 60px; }
  .thread-row .t-last { display: none; }
  .forum-top, .forum-toolbar { flex-direction: column; align-items: stretch; }
  .forum-top .btn { margin-left: 0; }
  .drawer { width: 100vw; }
}
