/* ============================================================
   vrylon shared theme components
   Visual tokens only — layout, navigation and interaction stay intact.
   ============================================================ */

:root {
  --theme-blur: 14px;
  --theme-radius-small: 9px;
  --theme-radius: 14px;
  --theme-radius-large: 20px;
  --theme-ease: cubic-bezier(.2,.75,.25,1);
}

html {
  background: var(--theme-background);
  color-scheme: dark;
}
html[data-theme-mode="light"] { color-scheme: light; }
body {
  background: var(--theme-background);
  color: var(--theme-text);
  transition: none;
}
.canvas, .vchat-mount { background: transparent; }
::selection { background: var(--theme-selection); color: var(--theme-text); }
a { color: var(--theme-link); }
h1, h2, h3, h4, h5, h6 { color: var(--theme-heading); }
svg { flex-shrink: 0; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { transition: background-color .16s var(--theme-ease), color .16s var(--theme-ease), border-color .16s var(--theme-ease), box-shadow .16s var(--theme-ease), transform .16s var(--theme-ease), opacity .16s var(--theme-ease); }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible {
  outline: 2px solid var(--theme-focus) !important;
  outline-offset: 3px;
}
input, select, textarea {
  color: var(--theme-text);
  background: var(--theme-input);
  border-color: var(--theme-border);
  caret-color: var(--theme-primary);
}
input::placeholder, textarea::placeholder { color: var(--theme-text-muted); opacity: 1; }
select option { color: var(--theme-text); background: var(--theme-surface-elevated); }
input:focus, select:focus, textarea:focus {
  border-color: var(--theme-focus) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Neutral ambient depth; content surfaces remain readable above it. */
html, .theme-aura { transition: none; }
.theme-aura { background: var(--theme-background); }
.aura-blob { opacity: .72; will-change: transform; }
html[data-theme-mode="light"] .aura-blob { opacity: .58; }
html[data-theme-fx="reduced"] .aura-blob { animation: none; opacity: .42; will-change: auto; }

/* Pastel dark-mode details need stronger neutral ink on light surfaces. */
html[data-theme-mode="light"] .flow-chip {
  color: var(--theme-link);
  background: var(--accent-soft);
  border-color: var(--theme-border-highlight);
}
html[data-theme-mode="light"] .flow-label,
html[data-theme-mode="light"] .site-link,
html[data-theme-mode="light"] .site-link-sep,
html[data-theme-mode="light"] .nav-rail-item,
html[data-theme-mode="light"] .nav-rail-item[data-rail] {
  color: var(--theme-text-secondary);
}
html[data-theme-mode="light"] .site-link:hover {
  color: var(--theme-text);
  background: var(--theme-button-secondary);
}
html[data-theme-mode="light"] .lf-review-stars,
html[data-theme-mode="light"] .lf-review-score > span,
html[data-theme-mode="light"] .prod-reviews-stars,
html[data-theme-mode="light"] .lf-review-empty > div {
  color: #815600;
}
html[data-theme-mode="light"] .pp-badge,
html[data-theme-mode="light"] .shop-card-price {
  color: var(--theme-heading);
}
html[data-theme-mode="light"] .mshop-ic {
  color: var(--theme-link) !important;
  background: var(--accent-soft) !important;
  border-color: var(--theme-border-highlight) !important;
}

/* Navigation, sidebar, footer and the persistent app shell. */
.topbar, .vchat-head, .page-overlay-bar {
  background: var(--theme-navbar);
  border-color: var(--theme-border);
  backdrop-filter: blur(var(--theme-blur)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--theme-blur)) saturate(120%);
}
.sidebar, .rail, .admin-dash-nav {
  background: var(--theme-sidebar);
  border-color: var(--theme-border);
  backdrop-filter: blur(var(--theme-blur)) saturate(115%);
  -webkit-backdrop-filter: blur(var(--theme-blur)) saturate(115%);
}
.site-marquee, .sidebar-foot, .pp-footer {
  background: var(--theme-footer);
  border-color: var(--theme-border);
}
.topbar-brand, .welcome-title, .page-title, .pp-title, .blog-article-title,
.static-page-head h2, .static-page-sec h3, .shop-card-body h3,
.video-drop-title, .admin-section h2 {
  color: var(--theme-heading);
}
.welcome-sub, .welcome-trust, .page-sub, .pp-tagline, .static-page-sub { color: var(--theme-text-secondary); }
.side-label, .product-price, .foot-plan, .composer-hint { color: var(--theme-text-muted); }
.side-link.active, .rail-btn.active, .product-btn.active {
  color: var(--theme-link);
  background: var(--accent-soft);
  border-color: var(--theme-border-highlight);
}
.side-link:hover, .rail-btn:hover, .product-btn:hover, .recent-item:hover,
.account-btn:hover, .chip:hover, .icon-btn:hover, .tool-btn:hover {
  color: var(--theme-text);
  background: var(--chip-hover);
}
.product-btn.active .product-price { color: var(--theme-link); background: var(--accent-soft); }
.country-flag:focus-visible { outline-offset: 2px; }

/* Reusable glass surfaces. */
.composer, .contact-form, .contact-aside-card, .about-card,
.pp-card, .pp-stat, .shop-card, .faq-item, .video-drop,
.lf-review-card, .lf-review-score, .lf-review-empty, .lf-review-form-wrap,
.lf-review-analytics, .lf-business-response, .review-admin-card,
.review-admin-analytics > div, .review-admin-note,
.auth-card, .email-modal, .acct-empty, .acct-card, .acct-track-summary,
.acct-track-any, .chat-escape, .mshop-item, .qmenu-item,
.admin-card, .admin-video-item, .adm-ordertools {
  background: var(--theme-card);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow-soft);
  backdrop-filter: blur(var(--theme-blur)) saturate(118%);
  -webkit-backdrop-filter: blur(var(--theme-blur)) saturate(118%);
}
.pp-card:hover, .shop-card:hover, .acct-card:hover, .lf-review-card:hover,
.mshop-item:hover, .qmenu-item:hover {
  border-color: var(--theme-border-highlight);
  box-shadow: var(--theme-shadow-soft), 0 0 0 1px var(--accent-soft);
}
.page-overlay, .vchat-panel, .mshop-sheet, .qmenu-panel {
  background: var(--theme-glass-strong);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow);
  backdrop-filter: blur(var(--theme-blur)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--theme-blur)) saturate(120%);
}
.email-modal-backdrop, .admin-modal-backdrop, .mshop-backdrop,
.qmenu-backdrop, .vchat-overlay, .sidebar-backdrop {
  background: var(--theme-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.msg-text pre, .msg-text code, .vrylon-chat-thread, .auth-mailbox {
  color: var(--theme-text);
  background: var(--theme-background-alt);
  border-color: var(--theme-border);
}
.pp-card h3, .pp-price-note, .pp-footer, .lf-review-card footer,
.lf-review-score small, .lf-review-result-count { color: var(--theme-text-muted); }
.pp-list li, .pp-steps li, .pp-faq-a, .pp-kw, .shop-card-tag,
.shop-card-inc li, .lf-review-card blockquote, .about-card p,
.about-list li, .contact-aside-card p { color: var(--theme-text-secondary); }
.static-page-sec a { color: var(--theme-link); }

/* Buttons: solid accessible primary, tinted secondary, quiet tertiary. */
.btn-primary, .auth-submit, .lf-review-submit, .chat-escape-btn {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
  border: 1px solid transparent;
  box-shadow: 0 5px 16px var(--accent-soft);
  font-weight: 650;
}
.btn-primary:hover, .auth-submit:hover, .lf-review-submit:hover, .chat-escape-btn:hover {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary-hover);
  opacity: 1;
  box-shadow: var(--theme-glow);
  transform: translateY(-1px);
}
.btn-primary:active, .auth-submit:active, .lf-review-submit:active, .chat-escape-btn:active {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary-active);
  transform: translateY(0) scale(.98);
}
.btn-ghost, .pp-cta-secondary, .prod-reviews-more,
.lf-review-pagination button {
  color: var(--theme-text-secondary);
  background: var(--theme-button-tertiary);
  border: 1px solid var(--theme-border);
}
.btn-ghost:hover, .pp-cta-secondary:hover, .prod-reviews-more:hover,
.lf-review-pagination button:hover {
  color: var(--theme-text);
  background: var(--theme-button-secondary);
  border-color: var(--theme-border-highlight);
}
.auth-tab.active, .acct-tab.active, .admin-nav-item.active {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.auth-tab:hover, .acct-tab:hover, .admin-nav-item:hover {
  color: var(--theme-text);
  background: var(--theme-button-secondary);
}
.send-btn, .email-modal-icon, .acct-avatar, .admin-modal-icon {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
  box-shadow: 0 5px 18px var(--accent-soft);
}
.send-btn:hover { color: var(--theme-on-primary); background: var(--theme-button-primary-hover); }
.pp-cta {
  color: #151b29;
  background: var(--p-accent);
  border: 1px solid transparent;
  box-shadow: 0 5px 16px var(--p-accent-soft);
}
.pp-cta:hover { color: #151b29; background: var(--p-accent-hover); }
.vrylon-bubble-you, .acct-msg.out .acct-msg-body {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
}
.vchat-fab {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
  box-shadow: 0 8px 22px var(--accent-soft), var(--theme-shadow-soft);
}
.vchat-close:hover, .vchat-mount .vchat-x:hover {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
  border-color: transparent;
}

/* Forms and account/dashboard hierarchy. */
.composer:focus-within {
  border-color: var(--theme-focus);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--theme-shadow-soft);
}
.auth-tabs, .acct-nav {
  background: var(--theme-background-alt);
  border-color: var(--theme-border);
}
.auth-info, .acct-status {
  color: var(--theme-link);
  background: var(--accent-soft);
  border-color: var(--theme-border-highlight);
}
.auth-form input, .email-modal-form input, .acct-select,
.acct-track-bar input, .contact-form input, .contact-form select,
.contact-form textarea, .lf-review-fields input, .lf-review-fields select,
.lf-review-fields textarea, .admin-field input, .adm-form input,
.adm-form select, .adm-order-row input, .adm-order-row select,
.adm-reply-form textarea, .review-admin-card input[type="text"],
.review-admin-card textarea {
  color: var(--theme-text);
  background: var(--theme-input);
  border-color: var(--theme-border);
}
.auth-link, .auth-code, .lf-review-service, .lf-business-response strong { color: var(--theme-link); }
.auth-msg.ok, .contact-note.ok, .review-note.ok {
  color: var(--theme-success);
  background: var(--theme-success-bg);
  border: 1px solid var(--theme-success);
}
.auth-msg.err, .contact-note.err, .review-note.err,
.admin-login-msg.error, .video-note.err {
  color: var(--theme-error);
  background: var(--theme-error-bg);
  border: 1px solid var(--theme-error);
}
.admin-login-msg.success, .video-note.ok { color: var(--theme-success); }
.acct-step.now .acct-pip, .acct-badge {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
}
.acct-step.done .acct-pip { color: var(--theme-link); border-color: var(--theme-border-highlight); }

/* Admin is themed too; its password and behavior are unchanged. */
.admin-dashboard { color: var(--theme-text); background: var(--theme-background); }
.admin-dash-header {
  background: var(--theme-navbar);
  border-color: var(--theme-border);
  backdrop-filter: blur(var(--theme-blur));
  -webkit-backdrop-filter: blur(var(--theme-blur));
}
.admin-modal {
  color: var(--theme-text);
  background: var(--theme-glass-strong);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow);
  backdrop-filter: blur(var(--theme-blur));
  -webkit-backdrop-filter: blur(var(--theme-blur));
}
.admin-dash-brand, .admin-modal-head h3, .admin-card-head strong,
.admin-card-body, .admin-table td { color: var(--theme-text); }
.admin-dash-btn, .admin-gear, .admin-login-actions .btn-ghost {
  color: var(--theme-text-secondary);
  background: var(--theme-button-secondary);
  border-color: var(--theme-border);
}
.admin-dash-btn:hover, .admin-gear:hover, .admin-login-actions .btn-ghost:hover {
  color: var(--theme-text);
  background: var(--chip-hover);
  border-color: var(--theme-border-highlight);
}
.admin-login-actions .btn-primary {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
}
.admin-table th { color: var(--theme-text-muted); border-color: var(--theme-border); }
.admin-table td { border-color: var(--theme-border-soft); }
.admin-table tr:hover td { background: var(--accent-soft); }
.admin-badge.sent, .admin-badge.completed, .lf-review-badge.verified {
  color: var(--theme-success);
  background: var(--theme-success-bg);
  border-color: var(--theme-success);
}
.admin-badge.failed, .admin-badge.cancelled {
  color: var(--theme-error);
  background: var(--theme-error-bg);
  border-color: var(--theme-error);
}
.admin-badge.pending, .lf-review-badge.demo {
  color: var(--theme-warning);
  background: var(--theme-warning-bg);
  border-color: var(--theme-warning);
}
.admin-video-del { color: var(--theme-error); background: var(--theme-error-bg); }
.admin-video-del:hover { background: var(--theme-error-bg); border-color: var(--theme-error); }
.admin-video-upload input[type="file"] {
  color: var(--theme-text-secondary);
  background: var(--theme-input);
  border-color: var(--theme-border);
}

/* Review motion and controls retain their existing behavior. */
.prod-reviews-score, .prod-reviews-box, .shop-rating-chip {
  background: var(--theme-card);
  border-color: var(--theme-border);
}
.prod-reviews-score:hover, .shop-rating-chip:hover {
  border-color: var(--theme-border-highlight);
  box-shadow: var(--theme-shadow-soft);
}
.lf-rating-options input:checked + span {
  color: #151b29;
  background: #ffd36d;
  border-color: #ffd36d;
}
.lf-rating-options input:focus-visible + span {
  outline: 2px solid var(--theme-focus);
  outline-offset: 3px;
}

/* Searchable 30-family selector. */
.tool-pop {
  color: var(--theme-text);
  background: var(--theme-glass-strong);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow);
  backdrop-filter: blur(var(--theme-blur)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--theme-blur)) saturate(120%);
}
.tool-pop-title { color: var(--theme-heading); }
.tool-pop-sub { color: var(--theme-text-muted); }
.theme-pop-panel {
  width: min(560px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
}
.theme-panel-head {
  flex: none;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 12px;
}
.theme-panel-head > div { display: flex; flex-direction: column; gap: 3px; }
.theme-count {
  flex: none;
  color: var(--theme-link);
  background: var(--accent-soft);
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.theme-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 12px;
  color: var(--theme-text-muted);
  background: var(--theme-input);
  border: 1px solid var(--theme-border);
  border-radius: 11px;
}
.theme-search:focus-within { border-color: var(--theme-focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-search input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  color: var(--theme-text);
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none !important;
  font-size: 13px;
}
.theme-grid {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 9px;
  padding: 2px 4px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-scrollbar) transparent;
}
.theme-card {
  min-width: 0;
  min-height: 66px;
  gap: 11px;
  padding: 11px;
  color: var(--theme-text);
  background: var(--theme-card);
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.theme-card:hover {
  border-color: var(--theme-border-highlight);
  background: var(--theme-button-secondary);
  box-shadow: var(--theme-shadow-soft);
  transform: translateY(-1px);
}
.theme-card:active { transform: scale(.985); }
.theme-card.active {
  border-color: var(--theme-border-highlight);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--theme-border-highlight), var(--theme-shadow-soft);
}
.theme-sw {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 45px;
  height: 38px;
  flex: 0 0 45px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(127,137,150,.24);
}
.theme-sw i { display: block; height: 100%; }
.theme-meta { gap: 3px; }
.theme-meta b { color: var(--theme-heading); font-size: 12.5px; }
.theme-meta small { color: var(--theme-text-muted); font-size: 10.5px; }
.theme-check {
  color: var(--theme-on-primary);
  background: var(--theme-button-primary);
  top: 5px;
  right: 5px;
}
.theme-empty {
  margin: 0;
  padding: 32px 12px;
  color: var(--theme-text-muted);
  text-align: center;
  font-size: 13px;
}
.lang-search input, .lang-item { color: var(--theme-text); }
.lang-item.active { color: var(--theme-link); background: var(--accent-soft); }
::-webkit-scrollbar-thumb { background: var(--theme-scrollbar); border-color: var(--theme-background); }
::-webkit-scrollbar-thumb:hover { background: var(--theme-text-muted); }

/* Responsive glass and selector. No phone-dock geometry is changed here. */
@media (max-width: 768px) {
  /* A filtered ancestor would become the fixed dock's containing block. */
  .topbar {
    background: var(--theme-navbar);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
@media (max-width: 640px) {
  :root { --theme-blur: 8px; }
  .theme-pop-panel { padding: 13px; }
  .theme-card { min-height: 62px; }
  .aura-blob { opacity: .45; }
}
@media (max-width: 420px) {
  .theme-grid { grid-template-columns: 1fr; }
  .theme-panel-head { gap: 8px; }
  .tool-pop-sub { font-size: 10.5px; }
  .theme-card { min-height: 58px; padding: 9px 11px; }
  .theme-sw { width: 42px; flex-basis: 42px; height: 35px; }
}
html[data-theme-fx="reduced"] { --theme-blur: 0px; }
html[data-theme-fx="reduced"] .topbar,
html[data-theme-fx="reduced"] .sidebar,
html[data-theme-fx="reduced"] .tool-pop,
html[data-theme-fx="reduced"] .composer,
html[data-theme-fx="reduced"] .auth-card,
html[data-theme-fx="reduced"] .admin-modal {
  background: var(--theme-glass-strong);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .aura-blob { animation: none !important; }
  .theme-card:hover, .btn-primary:hover, .shop-card:hover, .lf-review-card:hover { transform: none; }
}
