/* ninamind — redesign. Brand blue + raspberry from the wordmark, light & dark themes. */
:root {
  --bg: #f3f5f9; --surface: #fff; --surface-2: #eceff6; --surface-3: #e1e6f0;
  --glass: rgba(255,255,255,.82);
  --line: rgba(14,21,37,.09); --line-strong: rgba(14,21,37,.2);
  --text: #0e1525; --text-soft: #3a465f; --text-muted: #667189;
  --accent: #1565c0; --accent-2: #ad1457; --on-accent: #fff;
  --accent-soft: rgba(21,101,192,.1); --accent-2-soft: rgba(173,20,87,.1);
  --ok: #0f8a5f; --warn: #b7791f; --danger: #d0334f;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px;
  --shadow: 0 18px 50px -18px rgba(14,21,37,.28);
  --hh: 112px;
  /* legacy aliases used by inline styles in app.js */
  --violet: var(--accent); --violet-bright: var(--accent); --violet-deep: var(--accent); --magenta: var(--accent-2);
  --emerald: var(--ok); --amber: var(--warn); --rose: var(--danger);
  --bg-surface: var(--surface); --bg-surface-2: var(--surface-2); --bg-surface-3: var(--surface-3);
  --border: var(--line); --border-strong: var(--line-strong);
  color-scheme: light;
}
html.dark {
  --bg: #090d15; --surface: #111826; --surface-2: #182032; --surface-3: #222d44;
  --glass: rgba(9,13,21,.8);
  --line: rgba(160,182,225,.12); --line-strong: rgba(160,182,225,.26);
  --text: #eef2fb; --text-soft: #bac4da; --text-muted: #8793ad;
  --accent: #6fa8ff; --accent-2: #f2699f; --on-accent: #07101f;
  --accent-soft: rgba(111,168,255,.14); --accent-2-soft: rgba(242,105,159,.14);
  --ok: #3ddc97; --warn: #f5c451; --danger: #ff7a90;
  --shadow: 0 22px 60px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hh) + 12px); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font-family: 'IRANSansX', Tahoma, system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.85;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }
.skip-link { position: fixed; top: -60px; right: 12px; z-index: 9999; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.skip-link:focus { top: 10px; }
.i { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.16em; margin-inline-end: .35em; flex: none; }

#reading-progress { position: fixed; top: 0; right: 0; height: 3px; width: 0; z-index: 9999; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 500; background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.header-top { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.brand-logo { display: inline-flex; width: 42px; height: 26px; color: var(--accent); }
.brand-logo.small { width: 34px; height: 21px; }
.brand-logo svg, .brand-wordmark svg { width: 100%; height: 100%; }
.brand-wordmark { display: inline-flex; height: 22px; }
.brand-wordmark svg { width: auto; }
.brand-wordmark svg path:first-child { fill: var(--accent); }
.brand-wordmark svg path:last-child { fill: var(--accent-2); }
.header-search-wrap { flex: 1; max-width: 440px; margin-inline: auto; }
.search-trigger { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; transition: border-color .2s, background .2s; }
.search-trigger:hover { border-color: var(--line-strong); background: var(--surface); }
.search-trigger kbd { margin-inline-start: auto; font: 600 11px/1 monospace; padding: 4px 7px; border-radius: 6px; background: var(--surface); color: var(--text-muted); border: 1px solid var(--line); }
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text-soft); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .sun { display: none; } html.dark .icon-btn .sun { display: block; } html.dark .icon-btn .moon { display: none; }

.header-nav { border-top: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-top: 7px; padding-bottom: 7px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-pill { flex: none; white-space: nowrap; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 999px; color: var(--text-soft); border: 0; background: transparent; cursor: pointer; scroll-snap-align: start; transition: background .15s, color .15s; }
.nav-pill:hover { background: var(--surface-2); color: var(--text); }
.nav-pill.active { background: var(--text); color: var(--bg); font-weight: 700; }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.1); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-success { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.badge-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent-2); color: #fff; }
.chip { display: inline-flex; align-items: center; padding: 2px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.8; background: var(--accent-soft); color: var(--accent); transition: filter .15s; }
a.chip:hover { filter: brightness(1.15); }
.chip.draft { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.pending { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chip.published { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

.main-shell { padding-top: 26px; padding-bottom: 72px; min-height: 75vh; }

/* Covers — the image always paints above the placeholder */
.fallback-cover { position: absolute; inset: 0; z-index: 0; overflow: hidden; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 22px 22px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 22px 22px,
  radial-gradient(circle at 15% 15%, var(--fc-a, rgba(21,101,192,.4)), transparent 62%),
  radial-gradient(circle at 90% 85%, var(--fc-b, rgba(173,20,87,.3)), transparent 60%), var(--surface-2); }
.fallback-cover-mark { position: absolute; top: 12px; left: 12px; width: 52px; height: 52px; color: var(--text); opacity: .16; }
.cover-img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }

/* Hero bento */
.hero-section { margin-bottom: 44px; }
.bento-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; grid-template-rows: 232px 232px; gap: 14px; }
.bento-card { position: relative; isolation: isolate; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.bento-card:first-child { grid-row: 1 / 3; }
.bento-media { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.bento-overlay { position: relative; z-index: 2; padding: 22px; background: linear-gradient(to top, rgba(6,10,18,.92) 8%, rgba(6,10,18,.55) 55%, transparent); }
.bento-card .chip { background: rgba(255,255,255,.18); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bento-title { margin: 8px 0 4px; font-size: 15.5px; font-weight: 700; line-height: 1.6; }
.bento-card:first-child .bento-title { font-size: 25px; font-weight: 800; line-height: 1.5; }
.bento-excerpt { margin: 6px 0 10px; font-size: 13.5px; color: rgba(255,255,255,.8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bento-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: rgba(255,255,255,.7); }

/* Layout */
.content-layout, .article-layout { display: grid; gap: 44px; align-items: start; }
.content-layout { grid-template-columns: minmax(0,1fr) 320px; }
.article-layout { grid-template-columns: minmax(0,1fr) 300px; }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 14px; border-bottom: 2px solid var(--text); }
.section-heading { margin: 0; font-size: 20px; font-weight: 800; }
.tab-group, .admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-tabs { margin-bottom: 20px; }
.tab-btn { padding: 6px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-btn.active { background: var(--accent-soft); color: var(--accent); }

/* Feed: open list, no boxed cards */
.feed-list { display: flex; flex-direction: column; }
.feed-card { display: grid; grid-template-columns: 264px minmax(0,1fr); gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); content-visibility: auto; contain-intrinsic-size: auto 190px; }
.feed-thumb { position: relative; isolation: isolate; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); align-self: start; }
.feed-thumb .cover-img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.feed-body { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; }
.feed-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.feed-title { margin: 10px 0 6px; font-size: 19px; font-weight: 800; line-height: 1.6; transition: color .15s; }
.feed-excerpt { margin: 0; font-size: 14px; line-height: 1.9; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-footer, .feed-meta-items { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--hh) + 16px); }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.widget-title { margin: 0 0 14px; font-size: 14.5px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hot-list { display: flex; flex-direction: column; }
.hot-item { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.hot-item:first-child { padding-top: 0; } .hot-item:last-child { border: 0; padding-bottom: 0; }
.hot-rank { font-size: 22px; font-weight: 900; line-height: 1.2; color: var(--accent-2); opacity: .85; }
.hot-item-title { margin: 0 0 3px; font-size: 13px; font-weight: 600; line-height: 1.7; transition: color .15s; }
.hot-item-sub { font-size: 11.5px; color: var(--text-muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud-btn { padding: 4px 11px; border-radius: 999px; font-size: 12px; background: var(--surface-2); border: 0; color: var(--text-soft); cursor: pointer; transition: background .15s, color .15s; }
.tag-cloud-btn:hover, .tag-cloud-btn.active { background: var(--accent); color: var(--on-accent); }
.tag-cloud-btn:hover .muted, .tag-cloud-btn.active .muted { color: inherit; opacity: .8; }
.year-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }

@media (hover: hover) {
  .bento-card:hover .bento-media, .feed-card:hover .cover-img, .related-card:hover .cover-img { transform: scale(1.05); }
  .feed-card:hover .feed-title, .hot-item:hover .hot-item-title { color: var(--accent); }
}

/* Article */
.article-card { padding: 0; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-size: 12.5px; color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.article-header-title { margin: 0 0 16px; font-size: clamp(25px, 4.2vw, 40px); font-weight: 900; line-height: 1.55; letter-spacing: -.01em; }
.article-lead { margin: 0 0 22px; padding-inline-start: 18px; border-inline-start: 3px solid var(--accent-2); font-size: 16.5px; line-height: 2; color: var(--text-soft); }
.article-meta-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; margin-bottom: 30px; border-block: 1px solid var(--line); font-size: 13px; color: var(--text-muted); }
.article-prose { max-width: 72ch; font-size: var(--prose-size, 17px); line-height: 2.15; color: var(--text); overflow-wrap: anywhere; }
.article-prose h2 { margin: 2.2em 0 .7em; font-size: 1.4em; font-weight: 800; line-height: 1.6; }
.article-prose h3 { margin: 1.8em 0 .6em; font-size: 1.15em; font-weight: 700; color: var(--accent); }
.article-prose p { margin: 0 0 1.15em; }
.article-prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 5px; }
.article-prose a:hover { text-decoration-color: currentColor; }
.article-prose blockquote { margin: 1.6em 0; padding: 4px 22px; border-inline-start: 3px solid var(--accent-2); color: var(--text-soft); font-size: 1.04em; }
.article-prose figure { margin: 1.8em 0; text-align: center; }
.article-prose figure img, .article-prose > img { margin: 0 auto; border-radius: var(--r-md); max-height: 620px; width: auto; cursor: zoom-in; }
.article-prose figcaption { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.article-prose ul, .article-prose ol { padding-inline-start: 24px; margin: 0 0 1.2em; }
.article-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.article-prose iframe, .article-prose video { max-width: 100%; border-radius: var(--r-md); }
.article-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.article-prose td, .article-prose th { padding: 6px 12px; border: 1px solid var(--line); }

/* Editor */
.admin-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 16px; margin-bottom: 24px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.editable-field { width: 100%; padding: 11px 14px; border-radius: 12px; font-size: 14px; background: var(--surface); border: 1px solid var(--line-strong); outline: none; transition: border-color .15s, box-shadow .15s; }
.editable-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 14px 14px 0 0; }
.rich-editor { min-height: 360px; padding: 18px; outline: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0 0 14px 14px; }
.raw-html-area { width: 100%; min-height: 360px; padding: 14px; direction: ltr; font: 13px/1.7 ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 0 0 14px 14px; }

/* Comments */
.comments-section { margin-top: 48px; }
.comment-card { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-card.is-pending { background: color-mix(in srgb, var(--warn) 7%, transparent); padding-inline: 14px; border-radius: var(--r-sm); }
.comment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.comment-author { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.comment-text { font-size: 14.5px; line-height: 2; white-space: pre-wrap; color: var(--text-soft); }
.reply-card { margin: 12px 20px 0 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); }
.author-badge { font-size: 11px; padding: 2px 10px; border-radius: 999px; font-weight: 700; background: var(--accent); color: var(--on-accent); }
.child-comment { margin-top: 10px; margin-right: 22px; padding-right: 14px; border-right: 2px solid var(--line); border-bottom: 0; }

/* Related */
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 16px; }
.related-thumb { position: relative; isolation: isolate; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.related-info { padding: 10px 2px; }
.related-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; line-height: 1.65; }

/* Forms, modals */
.form-grid { display: grid; gap: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.admin-card { padding: 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6,9,16,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .18s; }
.modal-box { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: rise .22s cubic-bezier(.2,.7,.2,1); }
.modal-box.wide { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { margin: 0; font-size: 17px; font-weight: 800; }
.search-results { display: flex; flex-direction: column; margin-top: 10px; max-height: 58vh; overflow-y: auto; }
.search-result-item { padding: 12px 10px; border-radius: 12px; cursor: pointer; }
.search-result-item:hover { background: var(--surface-2); }
.lightbox { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.94); cursor: zoom-out; animation: fade .18s; }
.lightbox img { max-width: 96vw; max-height: 92vh; width: auto; border-radius: 10px; }
.toast-stack { position: fixed; bottom: 20px; left: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--text); color: var(--bg); box-shadow: var(--shadow); animation: rise .22s; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.tag-mgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 10px; }
.tag-mgr-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }

/* Footer */
.site-footer { margin-top: 48px; padding: 32px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; color: var(--accent); }
.footer-brand strong { color: var(--text); }
.footer-brand p { margin: 2px 0 0; font-size: 12.5px; }
.footer-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }

/* Tablet */
@media (max-width: 1060px) {
  .bento-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 280px 200px 200px; }
  .bento-card:first-child { grid-column: 1 / 3; grid-row: 1; }
  .content-layout, .article-layout { grid-template-columns: 1fr; gap: 36px; }
  .sidebar { position: static; }
  .article-prose { max-width: none; }
}
/* Phone */
@media (max-width: 700px) {
  :root { --hh: 100px; }
  .container { padding: 0 16px; }
  .header-top { gap: 8px; padding-top: 10px; padding-bottom: 8px; }
  .brand-logo { width: 34px; height: 21px; } .brand-wordmark { height: 18px; }
  .header-search-wrap { flex: none; max-width: none; margin-inline: auto 0; }
  .search-trigger { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .search-trigger span:nth-child(2), .search-trigger kbd { display: none; }
  .search-icon { font-size: 18px; }
  .header-actions .btn { padding: 7px 12px; }
  .main-shell { padding-top: 16px; }
  .hero-section { margin-bottom: 30px; }
  .bento-grid { grid-template-rows: 250px 180px 180px; gap: 10px; }
  .bento-card { border-radius: var(--r-md); }
  .bento-overlay { padding: 14px; }
  .bento-card:first-child .bento-title { font-size: 19px; }
  .bento-title { font-size: 13px; }
  .feed-card { grid-template-columns: 1fr; gap: 14px; padding: 18px 0; contain-intrinsic-size: auto 340px; }
  .feed-title { font-size: 18px; }
  .related-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .related-card { flex: 0 0 78%; scroll-snap-align: start; }
  .form-row-2 { grid-template-columns: 1fr; }
  .article-prose { font-size: max(var(--prose-size, 17px), 17px); line-height: 2.1; }
  .article-meta-bar { font-size: 12px; }
  .reply-card { margin-right: 10px; } .child-comment { margin-right: 10px; padding-right: 10px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-box, .modal-box.wide { max-width: none; max-height: 90vh; border-radius: 24px 24px 0 0; padding: 20px 18px 28px; animation-name: sheet; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .toast-stack { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); align-items: center; }
  .site-footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
}
@media (pointer: coarse) {
  .btn, .tab-btn, .nav-pill, .tag-cloud-btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
