/* UI polish layer (loaded LAST). Welcome screen, "village imported" summary and consistent empty states.
   Uses the theme variables (--bg --tx --mu --bd) so Dark and Light both work. Presentation only. */

/* ---------- shared pieces ---------- */
.pl-sum,.pl-es{display:none}
.pl-ring{position:relative;flex:none;width:60px;height:60px;border-radius:50%;display:grid;place-items:center;color:var(--tx);
  background:rgba(128,128,128,.10);border:1px solid var(--bd);box-shadow:0 0 0 7px rgba(128,128,128,.06)}
.pl-ring svg{width:26px;height:26px}
.pl-ring.pl-lg{width:76px;height:76px;box-shadow:0 0 0 9px rgba(128,128,128,.06),0 0 0 19px rgba(128,128,128,.03)}
.pl-ring.pl-lg svg{width:34px;height:34px}
.pl-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:48px;padding:12px 18px;border-radius:12px;
  font:600 15px/1.2 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:.01em;cursor:pointer}
.pl-btn svg{width:18px;height:18px;flex:none}
.pl-btn.pl-primary{background:var(--tx);color:var(--bg);border:1px solid var(--tx)}
.pl-btn.g{background:transparent;color:var(--tx);border:1px solid var(--bd)}
.pl-act{display:flex;flex-direction:column;gap:10px;width:100%;max-width:340px;margin-top:16px}
.pl-link{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 12px;background:transparent;color:var(--tx);
  border:0;border-radius:10px;font:500 13.5px/1.2 Inter,system-ui,sans-serif;letter-spacing:0;cursor:pointer;opacity:.85}
.pl-link:hover{opacity:1;background:rgba(128,128,128,.12)}
.pl-link svg{width:16px;height:16px;flex:none}

/* beat the older global button rules in both themes */
html body .pl-link{background:transparent!important;color:var(--tx)!important;border:0}
html body .pl-link:hover{background:rgba(128,128,128,.14)!important}
html body .pl-sum .pl-go{border:1px solid var(--bd)}
html body .pl-btn.g{background:transparent!important;color:var(--tx)!important;border:1px solid var(--bd)}
html body .pl-btn.pl-primary{background:var(--tx)!important;color:var(--bg)!important}

/* ---------- label above the paste box ---------- */
.pl-lb{display:flex;align-items:center;gap:12px;margin:0 0 14px}
.pl-ring.pl-sm{width:42px;height:42px;box-shadow:none}
.pl-ring.pl-sm svg{width:20px;height:20px}
.pl-lt{min-width:0;display:flex;flex-direction:column;gap:2px}
.pl-lb b{font-size:15px;font-weight:650;letter-spacing:.005em;color:var(--tx)}
.pl-lb small{font-size:12.5px;line-height:1.4;color:var(--mu)}
html body #sec-import{padding:16px;border-radius:16px}
html[data-accs="0"] #sec-import textarea{border-style:dashed}
.pl-flash{animation:plFlash 1.5s ease-out}

/* paste-from-clipboard sits under the two main buttons, full width, same box */
#sec-import .acts .pl-paste{grid-column:1/-1;width:100%;min-height:40px;border:1px dashed var(--bd)}

/* ---------- "village imported" summary (Import page) ---------- */
html[data-pgnow=import]:not([data-accs="0"]) .pl-sum,html:not([data-pgnow]):not([data-accs="0"]) .pl-sum{display:flex}
.pl-sum{align-items:center;gap:12px;margin:0 0 16px;padding:12px 14px;border:1px solid var(--bd);border-radius:12px;background:rgba(128,128,128,.07);animation:plUp .35s cubic-bezier(.22,1,.36,1) both}
.pl-ok{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:#3ddc84;background:rgba(61,220,132,.12);border:1px solid rgba(61,220,132,.35)}
html[data-theme=light] .pl-ok{color:#128a43;background:rgba(18,138,67,.1);border-color:rgba(18,138,67,.35)}
.pl-ok svg{width:18px;height:18px}
.pl-st{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.pl-st b{font-size:14px;font-weight:600;color:var(--tx);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl-st small{font-size:12.5px;line-height:1.35;color:var(--mu);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.pl-sum .pl-go{flex:none;border:1px solid var(--bd);padding:8px 12px;min-height:40px;opacity:1}

/* ---------- empty states (Upgrades / Suggested / Details / Widget) ---------- */
html[data-pgnow=upgrades][data-vs=none] .pl-es[data-k=up-none],
html[data-pgnow=upgrades][data-vs=idle] .pl-es[data-k=up-idle],
html[data-pgnow=suggest][data-vs=none] .pl-es[data-k=sg-none],
html[data-pgnow=det][data-vs=none] .pl-es[data-k=det-none],
html[data-pgnow=widget][data-vs=none] .pl-es[data-k=wg-none]{display:flex}
.pl-es{flex-direction:column;align-items:center;text-align:center;gap:8px;margin:0 0 16px;padding:34px 20px 26px;
  border:1px dashed var(--bd);border-radius:16px;
  background:linear-gradient(180deg,rgba(128,128,128,.08),rgba(128,128,128,0) 70%);animation:plUp .4s cubic-bezier(.22,1,.36,1) both}
.pl-es h3{margin:8px 0 0;font-size:17px;line-height:1.25;font-weight:650;color:var(--tx)}
.pl-es p{margin:0;max-width:32ch;font-size:13.5px;line-height:1.55;color:var(--mu)}
/* the old placeholders are replaced by the cards above (never both) */
html[data-vs=none] #upDash,html[data-vs=none] #sec-suggest,html[data-vs=none] #det,html[data-vs=none][data-pgnow="det"] #det:empty:not(.pg-off),html[data-vs=idle] #upSecT{display:none!important}
html[data-vs=none] #sec-widget>.wg-sec:first-child{display:none}
/* widget preview with no running upgrade: same dashed look as the other empty states */
#sec-widget .wg-e{padding:18px 12px;border:1px dashed var(--bd);border-radius:12px;color:var(--mu);text-align:center}

/* ---------- small notes (Backup / Sound) ---------- */
.pl-note{display:flex;align-items:flex-start;gap:9px;margin:0 0 14px;padding:10px 12px;border:1px solid var(--bd);border-radius:10px;background:rgba(128,128,128,.07);font-size:12.5px;line-height:1.5;color:var(--mu)}
.pl-note svg{flex:none;width:15px;height:15px;margin-top:2px;color:var(--tx)}
html:not([data-vs=none]) .pl-note[data-k=sn-note],html[data-vs=active] .pl-note[data-k=bk-note]{display:none}

/* ---------- consistency across pages ---------- */
html body .box{border-radius:12px}
html body .pghd{margin-bottom:16px}
html body .pghd h2{font-size:22px;font-weight:650;letter-spacing:.005em}
/* the notification prompt: smaller, so it covers less of the page above the tab bar */
.push-bn>div{padding:8px 12px!important;border-radius:14px!important}
.push-bn>div>div:nth-child(2){font-size:11.5px!important;line-height:1.35!important}

@keyframes plUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes plFlash{0%{box-shadow:0 0 0 0 rgba(128,128,128,.55)}60%{box-shadow:0 0 0 9px rgba(128,128,128,0)}100%{box-shadow:none}}
@media (prefers-reduced-motion:reduce){.pl-sum,.pl-es{animation:none}.pl-flash{animation:none}}
