/* =============================================================================
   Shared stylesheet for the public page, the admin dashboard, and the
   terms/privacy/disclaimer pages. One file, loaded everywhere, so the look
   stays consistent -- the dark glass-card aesthetic mirrors the look of
   b1rolodex.com (same owner), just distilled to a single page.
   ============================================================================= */

:root {
  --bg: #0b0b0f;
  /* --surface-alpha is the public page's "card background transparency"
     (Background card in the admin panel) -- just the default here, 6%,
     overridden live via --surface-alpha the moment app.js reads the saved
     setting, same mechanism as --accent/--accent-2 below. It controls the
     glass card behind the profile name/bio and every link button
     (.profile-card and .link-btn both use .glass, which reads --surface). */
  --surface-alpha: 0.06;
  --surface: rgba(255, 255, 255, var(--surface-alpha));
  --surface-border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --muted: #a7a7b3;
  /* Cyber red + cyber blue -- both admin-adjustable (Background card in
     the admin panel); these are just the defaults, overridden live via
     --accent/--accent-2 the moment app.js reads the saved settings. Red
     carries the primary/interactive accents (buttons, active states);
     blue carries icons and secondary highlights -- see how each is used
     further down this file. */
  --accent: #ff2a4d;
  --accent-2: #00b8d9;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
.hidden { display: none !important; }
img, video { max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Glass card, used on both the public page and as a base utility ---- */
.glass {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
}
@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(20, 20, 26, 0.94); }
}

/* =============================================================================
   Public page
   ============================================================================= */
/* Same 100lvh reasoning as .bg-layer below -- min-height here doesn't
   directly cause a visible resize the way .bg-layer's old inset:0 did
   (the actual page content almost always exceeds one screen's height
   anyway), but a plain 100vh here still quietly shifts the page's total
   scrollable height by a few dozen pixels every time the mobile toolbar
   shows/hides. The scroll-scrubbed video background (app.js) computes
   which frame to show as a fraction of total scroll distance, so even
   this small a change in that total could nudge the target frame right
   as the toolbar finishes animating -- pinning this to the stable "large
   viewport" value removes that as a contributing factor too. */
body.public-body { min-height: 100vh; min-height: 100lvh; position: relative; overflow-x: hidden; }

/* Explicit width/height instead of inset:0 -- on purpose. A fixed element
   sized with inset:0 (or top/right/bottom/left:0) has its box recalculated
   against whatever the CURRENT viewport is, and on mobile Safari/Chrome
   that viewport's height itself changes live as the browser's own address
   bar/toolbar slides away while scrolling and slides back when you stop --
   so this layer's box was visibly resizing mid-scroll, which forced the
   object-fit:cover image/video inside it to keep re-cropping/rescaling to
   match. That's what read as the background "zooming"/"jumping" right
   after a scroll ends -- the toolbar settling into place, not anything in
   app.js (that's the SEPARATE parallax-transform fix above app.js's
   initParallax(), which is still needed too -- this was a second, earlier-
   undiagnosed cause of a similar-looking symptom).
   100lvh ("large viewport height") is the one CSS viewport unit that's
   pinned to the LARGEST size the viewport can be -- i.e. as if the toolbar
   were already hidden -- and does NOT live-track the toolbar's animation
   the way 100vh/100dvh do on these browsers. So this layer's actual box
   size now never changes while scrolling; when the toolbar is showing and
   the visible area is shorter than that, the layer (and the cover-fit
   image/video inside it) simply extends a little past the bottom of what
   you can currently see -- harmless for a background -- instead of being
   live-resized and visibly re-rendered. 100vh first as a plain fallback
   for any browser old enough not to understand lvh at all. */
.bg-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -2; overflow: hidden; background: #000; }
.bg-layer canvas,
.bg-layer img,
.bg-layer video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.7));
}

.profile-wrap {
  max-width: 560px; margin: 0 auto; padding: 56px 20px 48px;
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
}

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.profile-card {
  width: 100%; text-align: center; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: fade-up 0.5s ease both;
}
.avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.18);
}
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 2.2rem; font-weight: 700;
}
.profile-card h1 { margin: 6px 0 0; font-size: 1.5rem; }
.profile-card .bio { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 440px; }

/* Up to SOCIAL_ICON_MAX (3) small icon-only buttons under the bio -- the
   same row-of-platform-icons idea as the old Linktree page, kept separate
   from the main .link-list below (display_mode = 'social', see
   migration_5.sql). Round instead of the main buttons' pill shape, and
   deliberately smaller/icon-only, so this row reads as a secondary row of
   badges rather than competing with the real link buttons underneath it. */
.social-row { display: flex; justify-content: center; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.social-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--surface-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  text-decoration: none; color: var(--accent-2);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
@supports not (backdrop-filter: blur(1px)) {
  .social-icon-btn { background: rgba(20, 20, 26, 0.94); }
}
.social-icon-btn:hover, .social-icon-btn:focus-visible {
  transform: translateY(-2px); border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 14px -4px var(--accent);
}
.social-icon-btn .icon { width: 20px; height: 20px; }
.social-icon-btn .icon-custom { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.link-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 12px; }

/* Icon pinned to the left edge, label centered across the FULL button
   width (not just the space left over after the icon) -- the Linktree
   convention. The icon and chevron are taken out of normal flow with
   position:absolute so they never compete with the label for space or
   nudge it off-center; .link-btn itself just centers its one remaining
   flex child (the label <span>). Generous left/right padding keeps long
   labels from running under the icon/chevron on narrow screens. */
.link-btn {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%;
  padding: 14px 48px; text-decoration: none; font-weight: 600; font-size: 0.98rem;
  cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease;
  animation: fade-up 0.5s ease both;
}
.link-btn:hover, .link-btn:focus-visible {
  transform: translateY(-2px); border-color: var(--accent);
  /* A soft two-color neon glow on hover/focus -- red from the border,
     blue bleeding in from the icon side -- rather than a single flat
     accent glow. */
  box-shadow: 0 0 0 1px var(--accent), 0 4px 18px -4px var(--accent), 0 0 24px -8px var(--accent-2);
}
.link-btn .icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-2);
}
.link-btn span { text-align: center; }
.link-btn .chevron {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: 0.7; transition: transform 0.2s ease;
}
.link-btn[aria-expanded="true"] .chevron { transform: translateY(-50%) rotate(180deg); }
/* Uploaded custom icons (icon_for_link() in icons.php) are arbitrary
   images rather than single-color line art, so they get a soft rounded
   crop instead of relying on the SVG set's `color`/stroke styling, which
   doesn't apply to an <img>. */
.icon-custom { object-fit: cover; border-radius: 5px; background: rgba(255,255,255,0.06); }

.embed-item { display: flex; flex-direction: column; gap: 10px; }
/* position:relative so the skeleton below can sit ON TOP of the iframe
   (absolutely positioned, filling the panel) instead of hiding the iframe
   itself -- an iframe that's actually display:none never fires its own
   `load` event in real browsers, which is what made the embed toggle
   deadlock forever on the shimmer skeleton (see index.php's comment on
   .embed-panel and initEmbedToggles() in app.js). The iframe is always
   rendered once its src is set; the skeleton is just a visual cover that
   lifts once `load` fires. */
.embed-panel { position: relative; border-radius: var(--radius); overflow: hidden; }
.embed-skeleton {
  position: absolute; inset: 0;
  height: 280px; border-radius: var(--radius); filter: blur(6px);
  background: linear-gradient(120deg, rgba(255,255,255,0.05), rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.embed-iframe { position: relative; width: 100%; height: 280px; border: 0; border-radius: var(--radius); display: block; }

.site-footer { margin-top: 10px; font-size: 0.8rem; color: var(--muted); text-align: center; }
.site-footer a { text-decoration: underline; color: var(--muted); }

/* =============================================================================
   Admin dashboard + login/setup + legal pages
   ============================================================================= */
body.admin-body { min-height: 100vh; padding: 28px 16px 60px; }

.admin-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.admin-wrap-narrow { max-width: 420px; }

.admin-topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-topbar-actions a { margin-left: 16px; text-decoration: none; border-bottom: 1px solid var(--surface-border); }

.card {
  background: var(--surface); border: 1px solid var(--surface-border);
  border-radius: var(--radius); padding: 24px;
}
.card h1 { margin-top: 0; }
.card h2 { margin-top: 0; font-size: 1.1rem; }
.card.maintenance-active {
  border-color: #c9a227; background: rgba(201, 162, 39, 0.08);
}

form label, .form-grid label { display: block; margin-bottom: 14px; font-size: 0.85rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="url"], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  font-size: 0.95rem; font-family: inherit;
}
textarea { resize: vertical; }
input[type="file"] { margin-top: 6px; color: var(--muted); }
input[type="checkbox"] { width: auto; margin-right: 6px; }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; width: 100%; margin-top: 6px; }

button {
  background: var(--accent); color: #fff; border: 0; padding: 10px 18px;
  border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
button:hover { opacity: 0.92; }
button.small { padding: 6px 12px; font-size: 0.8rem; background: rgba(255, 255, 255, 0.08); color: var(--text); }
button.danger { background: rgba(230, 57, 70, 0.18); color: #ff8f96; }
button:disabled { opacity: 0.35; cursor: not-allowed; }

/* Movable Markdown sections in the blog editor (add_blog.php/edit_blog.php
   via blog_section_editor.php) -- one card per section, with move-up/
   move-down/remove controls above its textarea. */
.blog-section-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.blog-section-row {
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.blog-section-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.blog-section-controls span { margin-right: auto; }
.blog-section-row textarea { width: 100%; }

/* Present in the page (so Pinterest's own Save button/extension can find
   it) but not part of the visible layout -- the standard "visually
   hidden" pattern, not display:none, since some save-to-Pinterest tooling
   only picks up images that are actually laid out on the page. */
.blog-pin-image {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* Same visual language as <button>, for a plain navigation link that
   should look like a button (an <a> wrapping a <button> is invalid HTML
   -- interactive content can't nest -- so this is the correct way). */
.btn-link {
  display: inline-block; padding: 6px 12px; font-size: 0.8rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.08); color: var(--text); border-radius: 10px;
  text-decoration: none; cursor: pointer;
}
.btn-link:hover { opacity: 0.92; }
.btn-link-primary { background: var(--accent); color: #fff; padding: 10px 18px; font-size: 0.9rem; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mt-1 { margin-top: 1rem; }
.good { color: #4ade80; }
.bad {
  background: rgba(230, 57, 70, 0.12); border: 1px solid rgba(230, 57, 70, 0.3);
  padding: 10px 14px; border-radius: 10px; color: #ff9aa0; margin-bottom: 14px;
}

.avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; display: block; }

/* 120px rectangular preview for the blog editor's featured/Pinterest image
   fields (edit_blog.php) -- a separate class from .avatar-preview above,
   which is deliberately circular and 64px for profile-style avatars. These
   two used to share .avatar-preview with an inline style="" overriding the
   size/radius, but this site's CSP (style-src 'self', no 'unsafe-inline')
   silently blocks every inline style attribute, so that override never
   actually applied -- the real site has been rendering these as small
   64px circles, not 120px rectangles, this whole time. */
.blog-image-preview { width: 120px; height: auto; border-radius: 10px; margin-bottom: 10px; display: block; }

/* Same CSP reason as .blog-image-preview above -- admin_2fa_setup.php's
   TOTP secret used an inline style="word-break:break-all" that silently
   never applied, so the long secret string could overflow its container
   on a narrow screen instead of wrapping. */
.break-all { word-break: break-all; }

/* about.php's title only -- scoped to its own class rather than
   .legal-wrap h1 directly, since .legal-wrap is shared with
   terms.php/privacy.php/disclaimer.php and centering those wasn't asked
   for. (This replaces an inline style="text-align:center" that silently
   never applied -- same CSP reason as the two rules above.) */
.about-title { text-align: center; }

/* The clickable avatar control in the admin Profile card (admin.php /
   initAvatarPicker() in admin.js) -- a plain <button> so it's keyboard
   and screen-reader accessible on its own, with no role/tabindex
   workarounds needed. */
.avatar-picker {
  position: relative; display: inline-block; width: 64px; height: 64px;
  border: 0; padding: 0; margin-bottom: 10px; border-radius: 50%; cursor: pointer;
  background: transparent;
}
.avatar-picker .avatar-preview { margin-bottom: 0; }
.avatar-picker .avatar-fallback {
  width: 64px; height: 64px; border-radius: 50%; font-size: 1.5rem;
}
.avatar-picker:hover .avatar-preview,
.avatar-picker:hover .avatar-fallback,
.avatar-picker:focus-visible .avatar-preview,
.avatar-picker:focus-visible .avatar-fallback { opacity: 0.8; }
.avatar-picker-badge {
  position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent-2); color: #04121a;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* Visually hidden but still in the DOM, still tabbable/announced where
   relevant -- the standard accessible-hiding pattern (not display:none),
   used for the real <input type="file"> behind the avatar/background
   picker buttons. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* The Edit Link modal's "current custom icon" preview (admin.php /
   initLinkModal() in admin.js) -- a plain static thumbnail, not
   interactive like the avatar picker above. */
.custom-icon-preview {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  display: block; background: rgba(255,255,255,0.06);
}

/* about.php's profile image -- centered above the heading, same circular
   treatment as the public homepage's .avatar, just without that page's
   own layout context to center it automatically. */
.about-avatar { margin: 0 auto 16px; display: block; }

.link-admin-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-admin-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border); cursor: grab;
}
.link-admin-row.dragging { opacity: 0.4; }
.link-admin-row.is-inactive { opacity: 0.45; }
.drag-handle { color: var(--muted); line-height: 0.5; cursor: grab; }
.icon-sm { width: 18px; height: 18px; color: var(--accent-2); flex-shrink: 0; }
.link-admin-label { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.link-admin-label strong { font-size: 0.9rem; }
.link-admin-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.link-admin-clicks { white-space: nowrap; }
.badge { background: rgba(255, 255, 255, 0.1); padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; margin-left: 6px; }
.inline-form { display: inline; flex-shrink: 0; }
.inline-form button { white-space: nowrap; }
/* Non-draggable lists (suspicious_activity.php) reuse .link-admin-row for
   layout but shouldn't show the drag cursor the link-reorder list uses. */
.link-admin-row:not([draggable]) { cursor: default; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.15); border-radius: 999px; transition: background 0.2s; }
.switch-track::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-box {
  background: #15151c; border: 1px solid var(--surface-border); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.modal-actions button[type="button"] { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.inline-flex-gap { display: flex; align-items: center; gap: 8px; }

.bg-type-choices { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.bg-type-choices label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--text); margin-bottom: 0; }
.bg-type-choices input { width: auto; }

.bg-preview {
  position: relative; width: 100%; height: 200px; border-radius: var(--radius);
  overflow: hidden; background: #000; margin: 16px 0; border: 1px solid var(--surface-border);
}
.bg-preview canvas, .bg-preview img, .bg-preview video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.bg-preview-mock-card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  /* --preview-card-alpha is set live by the #cardOpacity slider's 'input'
     handler in admin.js (document.documentElement.style.setProperty), so
     dragging it previews the actual transparency the public page's glass
     card/buttons will get, without touching --surface-alpha itself -- that
     one only gets set from the saved setting (by app.js, public page only),
     so admin-only UI elsewhere that also reads --surface doesn't flicker
     while you're just experimenting with the slider before saving. */
  background: rgba(255, 255, 255, var(--preview-card-alpha, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px); padding: 10px 22px; border-radius: 12px; font-size: 0.8rem; color: #fff;
}

/* Video-background mode of the same preview box: instead of the mock
   card + a free-looping video, the box itself becomes scrollable and the
   admin can scroll INSIDE it to drive the real scrub engine
   (scrub-engine.js) -- the same mechanism the public page uses, scoped to
   this box's own scrollTop instead of the page's scrollY. The #bgScrubTest
   slider above drives the exact same engine and fraction; it exists
   because a 200px box with an invisible/auto-hiding native scrollbar
   (the default on macOS/trackpads) gives no visual hint that scrolling
   does anything, so the slider is the primary, always-visible way to test
   scrubbing, and the box scroll is a secondary option for anyone who
   prefers it. The inner spacer is taller than the box so there's scroll
   distance to work with; the video is pinned to the top of the box with
   position: sticky while that inner scrolling happens, mirroring how the
   real background video stays fixed behind the page content. */
.bg-preview.bg-preview-video-mode { overflow-y: auto; }
.bg-preview.bg-preview-video-mode .bg-preview-mock-card { display: none; }
.bg-scrub-spacer { position: relative; height: 640px; }
.bg-scrub-spacer video {
  position: sticky; top: 0; left: 0; width: 100%; height: 200px; object-fit: cover; display: block;
}

#videoSpeedRow label[for="bgScrubTest"] { display: block; font-size: 0.85rem; color: var(--text); margin-bottom: 6px; }
#bgScrubTest {
  width: 100%; height: 22px; margin-bottom: 10px; cursor: pointer;
  accent-color: var(--accent, #e63946);
}

/* Background media library -- already-uploaded images/videos the admin can
   reuse without re-uploading, or delete. Rows reuse the same visual
   language as .link-admin-row (the Links list) so the admin panel doesn't
   grow a second, inconsistent list style. */
.bg-library { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 280px; overflow-y: auto; }
.bg-library-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
}
.bg-library-item.is-active { border-color: var(--accent, #e63946); }
.bg-library-thumb {
  width: 48px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: #000; display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.bg-library-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bg-library-info strong { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-library-meta { font-size: 0.72rem; color: var(--muted); }
.bg-library-actions { display: flex; gap: 6px; flex-shrink: 0; }
.bg-library-actions button { white-space: nowrap; padding: 4px 10px; font-size: 0.78rem; }

/* Reminder shown above the video uploader: this hosting plan has no server-
   side encoder (confirmed -- see the README's "Scroll-scrub" section), so
   this is the one nudge standing between "upload a video" and the choppy-
   scrubbing bug that whole saga was about. Styled as a distinct callout
   (not just another <p class="muted small">) specifically so it doesn't
   blend into the rest of the card's quiet body text and actually gets read
   before the file picker is used. */
.bg-encode-hint {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 0.8rem; line-height: 1.5;
  background: rgba(230, 57, 70, 0.08); border: 1px solid rgba(230, 57, 70, 0.35); color: var(--text);
}
.bg-encode-hint code {
  display: block; margin: 6px 0; padding: 6px 8px; border-radius: 6px; font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08); overflow-x: auto; white-space: pre;
}

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 10px; font-size: 0.85rem; z-index: 100;
}
.toast-good { background: #1f7a4d; color: #fff; }
.toast-error { background: #9b2c35; color: #fff; }

/* --- Blog ---------------------------------------------------------------- */
.blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.blog-card-link { text-decoration: none; color: inherit; display: block; }
.blog-card {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--surface-border);
  border-radius: var(--radius); padding: 16px; height: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.blog-card-link:hover .blog-card { border-color: var(--accent); transform: translateY(-2px); }
.blog-card h2 { font-size: 1.05rem; margin: 0 0 6px; }
.blog-card-thumb { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.blog-post-hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }

.blog-body { line-height: 1.7; margin-top: 1.2em; }
.blog-body h1, .blog-body h2, .blog-body h3 { margin-top: 1.6em; }
.blog-body p { margin: 1em 0; color: #e4e4e9; }
.blog-body a { text-decoration: underline; color: var(--accent); }
.blog-body img { max-width: 100%; border-radius: 10px; }
.blog-body blockquote {
  border-left: 3px solid var(--accent); margin: 1.2em 0; padding: 0.2em 1em;
  color: var(--muted); font-style: italic;
}
.blog-body code { background: rgba(255, 255, 255, 0.08); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
.blog-body pre { background: rgba(255, 255, 255, 0.06); padding: 1em; border-radius: 10px; overflow-x: auto; }
.blog-body pre code { background: none; padding: 0; }
.blog-body ul, .blog-body ol { padding-left: 1.4em; }
.blog-body u { text-decoration: underline; }

/* --- Legal pages (terms/privacy/disclaimer) --------------------------- */
.legal-wrap { max-width: 680px; margin: 0 auto; line-height: 1.65; }
.legal-wrap h1 { margin-top: 0; }
.legal-wrap h2 { font-size: 1.1rem; margin-top: 1.8em; }
.legal-wrap p, .legal-wrap li { color: #d8d8de; }
.legal-wrap a { text-decoration: underline; }

.text-center { text-align: center; }

@media (max-width: 480px) {
  .card { padding: 18px; }
  .link-admin-url { max-width: 160px; }
}
