/* Ruff Tech Engine: resource detail page + member (account) pages.
   Only variables from the active theme are used (--text, --muted, --card, --border, --accent, --serif),
   so it follows whatever look the site has. Loaded by public/resource_detail.html and public/members/*. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.rd-wrap, .mb-wrap { max-width: 1040px; margin: 0 auto; padding: 140px 24px 90px; }
.mb-wrap { max-width: 640px; }
.rd-banner { background: #fff4d6; color: #5f4310; border: 1px solid #ecd28b; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: .9rem; }
.rd-back { margin-bottom: 18px; font-size: .9rem; }
.rd-back a { color: var(--muted); }
.rd-back a:hover { color: var(--accent); }

.rd-hero { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.rd-cover { margin: 0; position: sticky; top: 110px; }
.rd-cover img, .rd-cover-ph { width: 100%; height: auto; border-radius: 6px 14px 14px 6px; box-shadow: 0 24px 60px rgba(20,33,61,.22); aspect-ratio: 2/3; object-fit: cover; }
.rd-head h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin: 6px 0 8px; overflow-wrap: anywhere; }
.rd-sub { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--accent); margin-bottom: 8px; }
.rd-credit { color: var(--muted); font-size: .95rem; margin-bottom: 12px; }
.rd-summary { font-size: 1.12rem; line-height: 1.6; color: var(--text); margin: 10px 0 14px; }
.rd-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; }
.rd-badge { display: inline-block; padding: 4px 12px; border-radius: 100px; border: 1px solid var(--border); background: var(--card); font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.rd-badge-price { background: var(--accent); color: #fff; border-color: var(--accent); }
.rd-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.rd-specs div { min-width: 0; }
.rd-specs dt { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rd-specs dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.rd-get { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 22px; scroll-margin-top: 110px; }
.rd-get:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.rd-h { font-size: 1.35rem; margin: 0 0 10px; }
.rd-signed { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }
.rd-soon { color: var(--muted); margin: 0; }
.rd-get .gate { display: block; }
.rd-get .gate-form { max-width: 440px; margin-top: 16px; }
.rd-get .gate > summary { display: inline-block; }

.how-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.how-steps li { display: flex; gap: 12px; align-items: flex-start; }
.how-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.how-steps strong { display: block; line-height: 1.3; }
.how-steps small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.how-steps-compact { grid-auto-flow: column; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 6px; }
.how-steps-compact li { flex-direction: column; align-items: flex-start; gap: 6px; font-size: .78rem; }
.how-steps-compact .how-n { width: 24px; height: 24px; font-size: .78rem; }
.gate-note { font-size: .8rem; color: var(--muted); line-height: 1.5; margin: 0; }
.gate-note a { text-decoration: underline; }

.rd-sec { margin-top: clamp(34px, 5vw, 56px); max-width: 780px; }
.rd-sec h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 14px; }
.rd-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rd-checks li { position: relative; padding-left: 32px; line-height: 1.5; }
.rd-checks li::before { content: ""; position: absolute; left: 4px; top: .42em; width: 14px; height: 8px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }
.rd-prose p { margin: 0 0 1em; }
.rd-toc { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.rd-previews { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.rd-previews img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(20,33,61,.12); transition: transform .2s; }
.rd-previews a:hover img, .rd-previews a:focus-visible img { transform: translateY(-3px); }
.rd-faq details { border: 1px solid var(--border); border-radius: 10px; background: var(--card); margin-bottom: 8px; }
.rd-faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; min-height: 44px; }
.rd-faq details[open] summary { border-bottom: 1px solid var(--border); }
.rd-faq p { margin: 0; padding: 14px 16px; }
.rd-related { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rd-related a { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--card); }
.rd-related a:hover { border-color: var(--accent); }
.rd-rel-img { flex: none; width: 48px; height: 68px; background: var(--border); border-radius: 4px; overflow: hidden; }
.rd-rel-img img { width: 100%; height: 100%; object-fit: cover; }
.rd-related small { display: block; color: var(--muted); }
.rd-sticky { display: none; }

/* Member pages */
.mb-box { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: clamp(20px, 4vw, 34px); }
.mb-box h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 10px; }
.mb-box h2 { font-size: 1.3rem; margin: 26px 0 10px; }
.mb-box p { margin: 0 0 12px; }
.mb-muted { color: var(--muted); font-size: .92rem; }
.mb-error { background: #fdeaea; color: #8c2424; border: 1px solid #f0bcbc; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.mb-ok { background: #e8f7ef; color: #17704c; border: 1px solid #b9e3cd; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.mb-form .field { margin-bottom: 14px; }
.mb-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: .92rem; cursor: pointer; }
.mb-check input { margin-top: 4px; flex: none; }
.mb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.mb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mb-list li { display: flex; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mb-list.just li { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.mb-thumb { flex: none; width: 56px; height: 80px; border-radius: 5px; overflow: hidden; background: var(--border); }
.mb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mb-grow { flex: 1; min-width: 0; }
.mb-grow strong { display: block; overflow-wrap: anywhere; }
.mb-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: .92rem; }
.mb-bar form { display: inline; }
.mb-link-btn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.mb-danger { border-color: #e1b0b0; }

@media (max-width: 820px) {
  .rd-hero { grid-template-columns: 1fr; }
  .rd-cover { position: static; max-width: 240px; margin: 0 auto; }
  .rd-wrap, .mb-wrap { padding-top: 110px; }
}
@media (max-width: 560px) {
  .how-steps-compact { grid-auto-flow: row; grid-template-columns: 1fr; }
  .how-steps-compact li { flex-direction: row; align-items: center; }
  .rd-sticky { display: inline-flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); min-height: 48px; }
  .rd-wrap { padding-bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) { .rd-previews img { transition: none; } }
