/* Palette surfaces, compact library previews and release credit. */
:root body { background:var(--locket-ui-bg); color:var(--locket-ui-text); }
:root[data-locket-background="dark"] .locket-background { background:var(--locket-ui-bg); }
:root[data-locket-background="dark"] .locket-background::after { background:color-mix(in srgb,var(--locket-ui-bg) 55%,transparent); }
:root[data-locket-background="dark"][data-bs-theme="light"] .locket-background::after { background:color-mix(in srgb,var(--locket-ui-bg) 88%,transparent); }
:root:not([data-locket-background="dark"])[data-locket-background] .locket-background::after { background:linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.38) 100%); }
:root .locket-phone-card { background:var(--locket-ui-bg); }
:root .phone-screen { background:var(--locket-ui-bg); color:var(--locket-ui-text); }
:root .palette-button { background:var(--locket-ui-card); color:var(--bs-primary); }
:root .palette-button:hover { background:var(--locket-ui-raised); }
:root .locket-top-bar,:root .history-top-bar { background:linear-gradient(var(--locket-ui-bg),transparent); }
:root:not([data-locket-background="dark"])[data-locket-background] :is(.locket-top-bar,.history-top-bar) { background:linear-gradient(rgba(0,0,0,0.42),transparent); }
:root .feed-bottom-chrome { background:linear-gradient(transparent,var(--locket-ui-bg) 48%); }
:root[data-locket-background="dark"] .locket-profile-scroll { background:var(--locket-ui-bg); }
:root:not([data-locket-background="dark"])[data-locket-background] .locket-phone-card :is(.phone-screen,.locket-profile-scroll,.history-view-layer,.chat-thread-panel,.chat-messages-box,.chat-input-bar,.conversations-scroll) { background:transparent !important; }
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile {
  --profile-scene-tint: color-mix(in srgb, var(--locket-surface-tint, var(--bs-primary)) 68%, var(--bs-primary));
  --locket-ui-card: color-mix(in srgb, var(--profile-scene-tint) 22%, rgba(20, 18, 26, 0.72));
  --locket-ui-raised: color-mix(in srgb, var(--profile-scene-tint) 28%, rgba(34, 30, 42, 0.82));
  --locket-ui-border: color-mix(in srgb, var(--profile-scene-tint) 42%, rgba(255, 255, 255, 0.16));
  --locket-ui-text: #f8f6fa;
  --locket-ui-muted: color-mix(in srgb, var(--profile-scene-tint) 32%, #cbd5e1);
  --locket-accent-text: color-mix(in srgb, var(--profile-scene-tint) 78%, #ffffff);
}
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile :is(.lp-card-group,.profile-preferences,.profile-account-links,.profile-overview,.background-profile-button,.lp-theme-card,.lp-gold-banner,.lp-perk-box) {
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile .lp-avatar-ring {
  border-color: var(--profile-scene-tint);
}
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile .lp-toggle:not(.off) {
  background: var(--profile-scene-tint);
}
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile .lp-perk-icon {
  background: color-mix(in srgb, var(--profile-scene-tint) 24%, transparent);
  color: var(--locket-accent-text);
}
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile :is(.lp-user-name,.locket-profile-scroll > .lp-sec-heading) {
  color:#ffffff;
  text-shadow:0 2px 10px rgba(0, 0, 0, 0.65);
}
:root:not([data-locket-background="dark"])[data-locket-background] #screenProfile :is(.detail-lp-sub-email,.profile-release,.lp-close-arrow) {
  color:rgba(244, 244, 245, 0.9);
  text-shadow:0 1px 6px rgba(0, 0, 0, 0.65);
}
:root :is(.lp-avatar-inner,.locket-avatar-btn,.friend-row-avatar,.friend-picker-avatar) { background:var(--locket-ui-raised); color:var(--locket-ui-text); }
.locket-profile-scroll .lp-top-bar { height:auto; min-height:52px; padding:0 2px; gap:12px; align-items:center; }
.lp-top-bar .profile-brand { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; margin-right:auto; }
.lp-top-bar .profile-brand .detail-span-2 { margin:0; gap:7px; white-space:nowrap; font-size:14px; line-height:1.25; font-weight:800; letter-spacing:.2px; }
.profile-version { display:inline-flex; align-items:center; padding:3px 8px; border:1px solid color-mix(in srgb,var(--bs-primary) 22%,var(--locket-ui-border)); border-radius:999px; background:var(--bs-primary-bg-subtle); color:var(--locket-accent-text); font-size:11px; font-weight:700; line-height:1.2; letter-spacing:0; }
.profile-release { display:inline-flex; align-items:center; gap:4px; color:var(--locket-ui-muted); font-size:12px; font-weight:400; letter-spacing:0; line-height:1.25; }
.profile-release span { font-weight:600; white-space:nowrap; }
/* The library lives only inside the appearance dialog. Its scroll gutter keeps
   outlines and content clear of the sheet edge at every width. */
:root .background-picker-content { overflow-y:auto; overflow-x:hidden; min-height:0; min-width:0; padding:6px 6px 16px; overscroll-behavior:contain; container-type:inline-size; }
.background-picker-content .background-picker-grid { overflow:visible; margin-inline:auto; }
.appearance-theme-options { padding:0 0 20px; margin-bottom:20px; border-bottom:1px solid var(--locket-ui-border); }
.appearance-theme-options summary { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; color:var(--locket-ui-text); cursor:pointer; font-size:14px; font-weight:600; list-style:none; }
.appearance-theme-options summary::-webkit-details-marker { display:none; }
.appearance-theme-options summary::after { content:'+'; font-size:22px; font-weight:400; color:var(--locket-ui-muted); }
.appearance-theme-options[open] summary::after { content:'−'; }
.appearance-theme-options summary small { color:var(--locket-ui-muted); font-size:12px; font-weight:400; }
.appearance-theme-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:10px; padding:3px; }
:root .theme-choice { display:block; min-width:0; padding:6px; border:1px solid var(--locket-ui-border); border-radius:20px; background:var(--locket-ui-card); color:var(--locket-ui-text); text-align:left; font:inherit; cursor:pointer; transition:transform .2s,border-color .2s,box-shadow .2s; }
.theme-choice::before { display:none; }
.theme-choice:hover { transform:translateY(-2px); border-color:var(--bs-primary); }
.theme-choice:active { transform:scale(.98); }
:root .theme-choice[aria-pressed="true"] { border-color:var(--bs-primary); outline:1px solid var(--bs-primary); outline-offset:0; box-shadow:0 4px 14px rgba(var(--bs-primary-rgb),.12); }
.theme-mini-app { display:flex; flex-direction:column; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--theme-preview-border); border-radius:15px; background:var(--theme-preview-bg); color:var(--theme-preview-text); overflow:hidden; }
.theme-mini-header { display:flex; align-items:center; justify-content:space-between; gap:6px; width:100%; }
.theme-mini-header b { font-size:10px; font-weight:600; letter-spacing:-.2px; }
.theme-mini-header i { width:13px; height:13px; border:3px solid var(--theme-preview-card); outline:1px solid var(--theme-preview-border); border-radius:50%; background:var(--theme-preview-accent); }
.theme-mini-header i:last-child { width:10px; height:10px; background:var(--theme-preview-card); border:2px solid var(--theme-preview-accent); outline:0; }
.theme-mini-photo { position:relative; width:100%; max-width:152px; aspect-ratio:1.2; border-radius:18px; overflow:hidden; background:var(--theme-preview-card); }
.theme-mini-photo img { display:block; width:100%; height:100%; object-fit:cover; }
.theme-mini-photo > span { position:absolute; bottom:7px; left:50%; transform:translateX(-50%); padding:4px 7px; border-radius:9px; white-space:nowrap; background:var(--theme-preview-card); color:var(--theme-preview-text); font-size:7px; font-weight:500; }
.theme-mini-controls { display:flex; align-items:center; justify-content:center; gap:18px; width:100%; }
.theme-mini-controls svg { width:13px; height:13px; fill:none; color:var(--theme-preview-accent); }
.theme-mini-controls > i { width:25px; height:25px; border:2px solid var(--theme-preview-accent); border-radius:50%; background:var(--theme-preview-card); box-shadow:inset 0 0 0 3px var(--theme-preview-bg); }
.theme-choice-footer { display:flex; align-items:center; justify-content:space-between; gap:5px; padding:10px 5px 5px; }
.theme-choice-footer strong { display:block; font-size:12px; line-height:1.45; font-weight:600; }
.theme-choice-footer small { display:block; margin-top:2px; color:var(--locket-ui-muted); font-size:10px; line-height:1.5; font-weight:400; }
.theme-choice-check { display:grid; place-items:center; flex:0 0 20px; width:20px; height:20px; border:1px solid var(--locket-ui-border); border-radius:50%; }
.theme-choice-check svg { width:13px; height:13px; fill:none; opacity:0; }
.theme-choice[aria-pressed="true"] .theme-choice-check { border-color:var(--bs-primary); background:var(--bs-primary); color:var(--locket-accent-ink); }
.theme-choice[aria-pressed="true"] .theme-choice-check svg { opacity:1; }
.theme-choice:focus-visible { outline:2px solid var(--bs-primary); outline-offset:3px; }
.background-picker-caption { margin:0 3px 15px; font-size:14px; font-weight:600; color:var(--locket-ui-text); }
@container (min-width:560px) { .appearance-theme-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; } .theme-mini-photo { aspect-ratio:1.3; } }
@media (prefers-reduced-motion:reduce) { .theme-choice { transition:none; } .theme-choice:hover { transform:none; } }
:root[data-bs-theme="light"] .entry-primary { box-shadow:0 6px 22px rgba(var(--bs-primary-rgb),.12); }
@media (max-width:1024px),(pointer:coarse) { :root :is(.app-shell,.layout-dashboard,.workspace,.workspace-grid,.preview-panel,.locket-stage) { background:var(--locket-ui-bg); } }

[data-theme-id="buttercream"] { --theme-preview-bg:#fbf5e9; --theme-preview-card:#fffcf5; --theme-preview-accent:#916021; --theme-preview-text:#423524; --theme-preview-border:#dacbb2; }
[data-theme-id="rosemilk"] { --theme-preview-bg:#fbf0f3; --theme-preview-card:#fff9fb; --theme-preview-accent:#b14970; --theme-preview-text:#4a2d3a; --theme-preview-border:#e3c8d3; }
[data-theme-id="lavender"] { --theme-preview-bg:#f3effa; --theme-preview-card:#fcfaff; --theme-preview-accent:#7952b4; --theme-preview-text:#3e3153; --theme-preview-border:#d8cae8; }
[data-theme-id="mint"] { --theme-preview-bg:#eef7f2; --theme-preview-card:#f9fdfb; --theme-preview-accent:#23775f; --theme-preview-text:#2c4438; --theme-preview-border:#c6ddcf; }
[data-theme-id="cloudblue"] { --theme-preview-bg:#edf4fb; --theme-preview-card:#f9fcff; --theme-preview-accent:#3868a5; --theme-preview-text:#2a405a; --theme-preview-border:#c6d7e9; }
[data-theme-id="peach"] { --theme-preview-bg:#fff1e9; --theme-preview-card:#fffaf6; --theme-preview-accent:#a65736; --theme-preview-text:#51372c; --theme-preview-border:#e7cdbd; }
[data-theme-id="duskblue"] { --theme-preview-bg:#293b52; --theme-preview-card:#344b66; --theme-preview-accent:#9bc6f2; --theme-preview-text:#f5f8fc; --theme-preview-border:#61738a; }
[data-theme-id="sageevening"] { --theme-preview-bg:#30433e; --theme-preview-card:#3d554c; --theme-preview-accent:#b9dfbd; --theme-preview-text:#f5faf6; --theme-preview-border:#70897e; }
[data-theme-id="royalblue"] { --theme-preview-bg:#242e43; --theme-preview-card:#303d57; --theme-preview-accent:#9bb6ff; --theme-preview-text:#f3f6ff; --theme-preview-border:#576681; }
[data-theme-id="locketgold"] { --theme-preview-bg:#302d28; --theme-preview-card:#3e3930; --theme-preview-accent:#f0c969; --theme-preview-text:#fbf7ef; --theme-preview-border:#726754; }
[data-theme-id="cyberviolet"] { --theme-preview-bg:#302b40; --theme-preview-card:#3f3753; --theme-preview-accent:#c3a8ff; --theme-preview-text:#f8f3ff; --theme-preview-border:#726486; }
[data-theme-id="rosequartz"] { --theme-preview-bg:#3c2c34; --theme-preview-card:#4d3843; --theme-preview-accent:#ffafc3; --theme-preview-text:#fff4f7; --theme-preview-border:#886573; }
[data-theme-id="emerald"] { --theme-preview-bg:#263b34; --theme-preview-card:#324d43; --theme-preview-accent:#86dec0; --theme-preview-text:#f0fcf6; --theme-preview-border:#608676; }
[data-theme-id="lightstudio"] { --theme-preview-bg:#f3f5fa; --theme-preview-card:#ffffff; --theme-preview-accent:#4267cb; --theme-preview-text:#29344b; --theme-preview-border:#cdd5e5; }
