/* Love My V theme layer. Loaded last. Only active when <body class="th"> (a user picked a theme) or inside a .th preview box.
   All values come from --th-* variables set per user in the page <head> (routes/theme.js). With no theme, nothing here applies. */
.th {
  --blue: var(--th-accent); --blue-bright: var(--th-link); --blue-deep: var(--th-shadow); --heading-shadow: var(--th-shadow);
  --blue-glow: var(--th-glow); --blue-glow-soft: var(--th-accent-soft); --on-accent: var(--th-on-accent); --star: var(--th-accent);
  --bg: var(--th-bg); --bg-raised: var(--th-card-solid); --surface: var(--th-card-solid); --surface-2: var(--th-card-solid); --pro-panel: var(--th-card-solid); --pro-bg: var(--th-bg);
  --border: var(--th-border); --border-strong: var(--th-border-strong); --pro-line: var(--th-border);
  --silver-bright: var(--th-text); --silver: var(--th-text-2); --silver-dim: var(--th-muted); --nav-bg: var(--th-nav);
  color: var(--th-text);
}
body.th { background: var(--th-bg-css); background-color: var(--th-bg); }
.th.th-preview { background: var(--th-bg-css); background-color: var(--th-bg); }
/* frosted translucent cards (solid fallback first) */
.th .card, .th .post, .th .lx-card, .th .lx-hero, .th .lx-res, .th .lx-svc-card, .th .lx-mode-in, .th .summary, .th .backoffice, .th .bo-section, .th .review, .th .tile, .th .th-card, .th .lx-day-chip, .th .lx-seg, .th .brow {
  background: var(--th-card-solid); border-color: var(--th-border);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .th .card, .th .post:not([data-ptype="lover"]), .th .lx-card, .th .lx-hero, .th .lx-res, .th .lx-svc-card, .th .lx-mode-in, .th .summary, .th .backoffice, .th .review, .th .th-card, .th .lx-day-chip, .th .lx-seg, .th .brow {
    background: var(--th-card); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  }
}
.th .post[data-ptype="lover"] { background: transparent; }
/* buttons + stars follow the accent; labels use the contrast-checked colour */
.th .btn-blue, .th .btn-t { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-on-accent); box-shadow: 0 0 18px var(--th-accent-soft); }
.th .btn-blue .ic, .th .btn-blue svg { color: var(--th-on-accent); }
.th .btn-ghost { background: var(--th-card); color: var(--th-text); border-color: var(--th-border-strong); }
.th .link, .th a.link, .th .lx-more summary, .th .lx-more-slots summary { color: var(--th-link); }
.th .stars, .th .rate input:checked ~ label svg { color: var(--th-accent); }
.th .rate:has(#r1:checked) label[for=r1] svg, .th .rate:has(#r2:checked) label:is([for=r1],[for=r2]) svg, .th .rate:has(#r3:checked) label:is([for=r1],[for=r2],[for=r3]) svg,
.th .rate:has(#r4:checked) label:not([for=r5]) svg, .th .rate:has(#r5:checked) label svg, .th .rate:hover label svg { fill: var(--th-accent); stroke: var(--th-accent); }
.th .rate label:hover ~ label svg { fill: var(--th-border-strong); stroke: var(--th-border-strong); }
.th .lx .slots input:checked + label, .th .lx-day-chip.on, .th .lx-seg a.on { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-on-accent); }
.th .lx-day-chip.on small, .th .lx-day-chip.on b { color: var(--th-on-accent); }
.th .lx-svc-card.on, .th .lx-mode input:checked + .lx-mode-in { border-color: var(--th-accent); box-shadow: inset 0 0 0 1px var(--th-accent); }
.th .lx-svc-card .nm, .th .lx-svc-card .pr, .th .lx-h3, .th .lx-res .info b, .th .lx-mode-in b, .th .lx-hero-when b, .th .lx-bar-txt b { color: var(--th-text); }
.th .lx input[type=text], .th .lx input[type=time], .th .lx select, .th .lx textarea, .th input[type=text], .th input[type=email], .th input[type=password], .th textarea, .th select {
  background: var(--th-card-solid); color: var(--th-text); border-color: var(--th-border-strong);
}
.th .lx-bar { background: var(--th-card-solid); border-color: var(--th-border); }
.th .tabbar { background: var(--th-nav); border-color: var(--th-border); }
.th .tabbar a { color: var(--th-muted); } .th .tabbar a.on { color: var(--th-link); }
/* headings keep Dancing Script + bold offset in the accent's shadow */
.th .script, .th .lx-h1, .th .lx-h2 { color: var(--th-text); text-shadow: 3px 3px 0 var(--th-shadow); }
.th-light .script, .th-light .lx-h1, .th-light .lx-h2 { text-shadow: 3px 3px 0 var(--th-accent-line); }
.th .footer { background: transparent; border-color: var(--th-border); }
.th .footer .free { color: var(--th-text); text-shadow: 2px 2px 0 var(--th-shadow); }
.th-light .test-banner { color: #6b4e00; }
.th-light .logo { filter: none; }
/* the theme page */
.th-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.th-preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--border, #232a36); background: var(--surface, #0e1117); color: var(--silver-bright, #eef1f5); cursor: pointer; font: 600 .78rem/1.2 "Inter", system-ui, sans-serif; text-align: center; }
.th-preset i { width: 40px; height: 40px; border-radius: 50%; display: block; border: 2px solid rgba(255,255,255,.25); }
.th-preset.on { border-color: var(--blue, #1e7bff); box-shadow: inset 0 0 0 1px var(--blue, #1e7bff); }
.th-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.th-row input[type=color] { width: 56px; height: 44px; padding: 2px; border-radius: 12px; border: 1px solid var(--border-strong, #34405a); background: transparent; cursor: pointer; }
.th-row input[type=text].hexin { width: 110px; font-family: ui-monospace, monospace; }
.th-preview { border-radius: 20px; padding: 16px; border: 1px solid var(--th-border); min-height: 260px; overflow: hidden; }
.th-preview .pv-h { font-family: "Dancing Script", cursive; font-weight: 700; font-size: 32px; line-height: 1.1; margin: 0 0 12px; }
.th-preview .th-card { border: 1px solid var(--th-border); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.th-preview .pv-muted { color: var(--th-muted); font-size: .85rem; }
.th-preview .pv-stars { color: var(--th-accent); font-size: 1.2rem; letter-spacing: 2px; }
.th-ratio { font-size: .8rem; color: var(--silver-dim, #8a93a3); }
.th-ratio b.ok { color: #2fd67b; } .th-ratio b.bad { color: #ff3b3b; }
.lx-seg .th-seg { flex: 1; text-align: center; padding: 10px 8px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .9rem; margin: 0; color: var(--silver, #c9ced6); }
.lx-seg .th-seg.on { background: var(--blue, #1e7bff); color: var(--on-accent, #fff); }
.lx-seg .th-seg:focus-within { box-shadow: 0 0 0 3px var(--blue-glow-soft, color-mix(in srgb, var(--lmv-accent) 40%, transparent)); }
.wr-ai { display: inline-block; vertical-align: middle; font: 700 .68rem/1 "Inter", system-ui, sans-serif; letter-spacing: .04em; color: var(--silver, #c9ced6); border: 1px solid var(--border-strong, #34405a); border-radius: 999px; padding: 4px 8px; margin-left: 4px; white-space: nowrap; }
.wr-ai-form { margin-top: 10px; } .wr-ai-form p { margin: 4px 0 0; }
