/* =========================================================
   WP DASHBOARD LAUNCHER: sticky button + loading overlay
   ========================================================= */
@property --wpd-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --wpd-accent: #C8F031;              /* set to your exact lime from .t-lime */
  --wpd-ink: #0A0A0A;
  --wpd-paper: #F3F0E8;
  --wpd-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wpd-ease: cubic-bezier(.2, .8, .2, 1);
  --wpd-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Sticky button ---------- */
.wpd-fab {
  position: fixed;
  right: clamp(14px, 2.2vw, 32px);
  bottom: calc(clamp(14px, 2.2vw, 32px) + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 9px 20px 9px 9px;
  border-radius: 999px;
  color: var(--wpd-paper);
  text-decoration: none;
  isolation: isolate;
  translate: var(--mx, 0px) var(--my, 0px);
  box-shadow: 0 20px 50px -14px rgba(0,0,0,.6);
  transition: translate .5s var(--wpd-ease), transform .7s var(--wpd-spring),
              opacity .4s var(--wpd-ease), box-shadow .4s,
              padding .5s var(--wpd-ease), gap .5s var(--wpd-ease);
  -webkit-tap-highlight-color: transparent;
}
.js .wpd-fab:not(.is-ready),
.wpd-fab.is-tucked,
html.is-loading .wpd-fab,
html.wpd-lock .wpd-fab,
html:has([data-menu-toggle][aria-expanded="true"]) .wpd-fab {
  opacity: 0;
  transform: translateY(160%) scale(.85);
  pointer-events: none;
}

/* rotating light border */
.wpd-fab::before {
  content: "";
  position: absolute; inset: -1.5px; z-index: -2;
  border-radius: inherit;
  background: conic-gradient(from var(--wpd-angle),
    rgba(255,255,255,.08) 0 60%, var(--wpd-accent) 78%, #fff 82%,
    var(--wpd-accent) 86%, rgba(255,255,255,.08) 100%);
  animation: wpd-spin 3.6s linear infinite;
}
/* ink fill + periodic sheen */
.wpd-fab::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(105deg, transparent 38%, rgba(255,255,255,.14) 50%, transparent 62%) no-repeat,
    var(--wpd-ink);
  background-size: 260% 100%, auto;
  background-position: 160% 0, 0 0;
  animation: wpd-sheen 5s var(--wpd-ease) 2.5s infinite;
}
.wpd-fab__glow {
  position: absolute; inset: -8px; z-index: -3;
  border-radius: inherit;
  background: var(--wpd-accent);
  filter: blur(22px);
  opacity: .18;
  pointer-events: none;
  animation: wpd-breathe 3.2s ease-in-out infinite;
}

.wpd-fab__icon {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--wpd-accent);
  color: var(--wpd-ink);
  transition: transform .6s var(--wpd-spring);
}
.wpd-fab__icon svg { width: 25px; height: 25px; }
.wpd-needle {
  transform-box: view-box;
  transform-origin: 12px 16px;
  animation: wpd-needle 4s var(--wpd-ease) infinite;
}
.wpd-fab__badge {
  position: absolute; top: -3px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: #d63638; color: #fff;
  font: 600 10px/18px var(--wpd-mono);
  text-align: center;
  box-shadow: 0 0 0 2px var(--wpd-ink);
}

.wpd-fab__text {
  display: grid; gap: 3px;
  max-width: 24em;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width .6s var(--wpd-ease), opacity .3s;
}
.wpd-fab__kicker {
  display: flex; align-items: center; gap: 7px;
  font: 500 10px/1 var(--wpd-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wpd-accent);
}
.wpd-fab__kicker::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: wpd-ping 2s infinite;
}
.wpd-fab__label { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.wpd-fab__label--short { display: none; }

.wpd-fab__arrow {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  font-size: 14px;
  overflow: hidden;
  transition: transform .5s var(--wpd-spring), background .3s, color .3s,
              border-color .3s, width .5s var(--wpd-ease), opacity .3s;
}

@media (hover: hover) {
  .wpd-fab:hover {
    box-shadow: 0 26px 60px -12px rgba(0,0,0,.7),
                0 0 0 6px color-mix(in srgb, var(--wpd-accent) 14%, transparent);
  }
  .wpd-fab:hover .wpd-fab__icon { transform: rotate(-12deg) scale(1.06); }
  .wpd-fab:hover .wpd-needle { animation: wpd-needle-hover .8s var(--wpd-ease) infinite alternate; }
  .wpd-fab:hover .wpd-fab__arrow {
    transform: rotate(-45deg);
    background: var(--wpd-accent); color: var(--wpd-ink); border-color: transparent;
  }
}
.wpd-fab:active { transform: scale(.96); transition-duration: .15s; }
.wpd-fab:focus-visible { outline: 2px solid var(--wpd-accent); outline-offset: 5px; }

/* collapses to icon-only while scrolling down */
.wpd-fab.is-compact { padding-right: 9px; gap: 0; }
.wpd-fab.is-compact .wpd-fab__text { max-width: 0; opacity: 0; }
.wpd-fab.is-compact .wpd-fab__arrow { width: 0; opacity: 0; border-width: 0; }

@media (max-width: 640px) {
  .wpd-fab { gap: 10px; padding: 7px 16px 7px 7px; }
  .wpd-fab__icon { width: 40px; height: 40px; }
  .wpd-fab__label { font-size: 14px; }
  .wpd-fab__label--long, .wpd-fab__arrow { display: none; }
  .wpd-fab__label--short { display: block; }
}
@media print { .wpd-fab, .wpd { display: none !important; } }

/* ---------- Overlay ---------- */
html.wpd-lock, html.wpd-lock body { overflow: hidden; }
html.wpd-lock .cursor { opacity: 0 !important; }

.wpd {
  position: fixed; inset: 0; z-index: 9990;
  overflow: hidden;
  background: #f0f0f1;
  color: #1d2327;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  cursor: progress;
  clip-path: circle(0px at var(--wpd-x, 90%) var(--wpd-y, 90%));
  transition: clip-path .85s cubic-bezier(.76, 0, .24, 1);
}
.wpd[hidden] { display: none; }
.wpd.is-open { clip-path: circle(150vmax at var(--wpd-x, 90%) var(--wpd-y, 90%)); }

.wpd__bar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; height: 3px; }
.wpd__bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #2271b1, var(--wpd-accent));
  box-shadow: 0 0 12px var(--wpd-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--wpd-ease);
}

/* Stage 1 — login */
.wpd-login {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center;
  gap: 22px; padding: 24px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--wpd-ease), transform .6s var(--wpd-ease), filter .5s;
}
.wpd-login.is-in { opacity: 1; transform: none; }
.wpd-login.is-out { opacity: 0; transform: scale(.94); filter: blur(6px); }

.wpd-login__logo {
  display: grid; place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--wpd-ink);
  color: var(--wpd-accent);
  font: 700 28px/1 var(--wpd-mono);
  letter-spacing: -.04em;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
}
.wpd-login__card {
  display: grid; gap: 16px;
  width: min(320px, 86vw);
  padding: 26px 24px 30px;
  background: #fff;
  border: 1px solid #c3c4c7;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.wpd-field { display: grid; gap: 6px; font-size: 14px; }
.wpd-input {
  display: block;
  height: 40px; padding: 0 10px;
  border: 1px solid #8c8f94; border-radius: 4px;
  font-size: 22px; line-height: 38px;
  color: #2c3338;
  white-space: nowrap; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.wpd-input--pass { letter-spacing: .1em; }
.wpd-input.is-focus { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }
.wpd-input.is-focus::after {
  content: "";
  display: inline-block;
  width: 1.5px; height: 22px;
  margin-left: 1px;
  vertical-align: -3px;
  background: #2c3338;
  animation: wpd-caret 1s steps(1) infinite;
}
.wpd-login__row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.wpd-check {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
  border: 1px solid #8c8f94; border-radius: 4px;
  transition: background .2s, border-color .2s;
}
.wpd-check::after {
  content: "";
  width: 8px; height: 4px;
  margin-top: -2px;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0);
  transition: transform .25s var(--wpd-spring);
}
.wpd-check.is-on { background: #2271b1; border-color: #2271b1; }
.wpd-check.is-on::after { transform: rotate(-45deg) scale(1); }
.wpd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 3px;
  background: #2271b1; color: #fff;
  transition: transform .12s, background .2s;
}
.wpd-btn.is-pressed { transform: scale(.93); background: #135e96; }
.wpd-btn.is-busy::before {
  content: "";
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%;
  animation: wpd-rot .7s linear infinite;
}
.wpd-login__links { margin: 0; text-align: center; line-height: 1.9; color: #50575e; }

/* Stage 2 — admin */
.wpd-admin {
  position: absolute; inset: 0;
  display: grid;
  grid-template: 32px 1fr / 160px 1fr;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, transform .6s var(--wpd-ease), filter .5s;
}
.wpd-admin.is-in { opacity: 1; visibility: visible; }
.wpd.is-leaving .wpd-admin { opacity: 0; transform: scale(1.04); filter: blur(8px); }

.wpd-adminbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 18px;
  padding: 0 10px;
  background: #1d2327; color: #f0f0f1;
  transform: translateY(-100%);
  transition: transform .5s var(--wpd-ease) .05s;
}
.wpd-admin.is-in .wpd-adminbar { transform: none; }
.wpd-adminbar__mark {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--wpd-accent); color: var(--wpd-ink);
  font: 700 8px/1 var(--wpd-mono);
}
.wpd-adminbar__new::before { content: "+ "; }
.wpd-adminbar__howdy { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wpd-adminbar__howdy img { width: 18px; height: 18px; object-fit: cover; object-position: top; border-radius: 2px; }

.wpd-menu {
  padding-top: 10px;
  overflow: hidden;
  background: #1d2327; color: #f0f0f1;
  transform: translateX(-100%);
  transition: transform .55s var(--wpd-ease) .1s;
}
.wpd-admin.is-in .wpd-menu { transform: none; }
.wpd-menu ul { list-style: none; margin: 0; padding: 0; }
.wpd-menu li {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .35s, transform .45s var(--wpd-ease);
  transition-delay: calc(.25s + var(--i) * 40ms);
}
.wpd-admin.is-in .wpd-menu li { opacity: 1; transform: none; }
.wpd-menu li::before {
  content: "";
  flex: none;
  width: 16px; height: 16px;
  border-radius: 4px;
  background: currentColor;
  opacity: .35;
}
.wpd-menu li.is-current { background: var(--wpd-accent); color: var(--wpd-ink); font-weight: 600; }
.wpd-menu li.is-current::after {
  content: "";
  position: absolute; right: 0; top: 50%;
  margin-top: -8px;
  border: 8px solid transparent;
  border-right-color: #f0f0f1;
}
.wpd-menu b {
  margin-left: auto;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px;
  background: #d63638; color: #fff;
  font: 600 9px/17px var(--wpd-mono);
  text-align: center;
}

.wpd-main { display: grid; align-content: start; gap: 16px; padding: 18px 22px; overflow: hidden; }
.wpd-main h1 { margin: 4px 0 0; font-size: 23px; font-weight: 400; }

.wpd-welcome {
  position: relative;
  padding: 28px 30px;
  overflow: hidden;
  background: var(--wpd-ink); color: var(--wpd-paper);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s .35s, transform .6s var(--wpd-ease) .35s;
}
.wpd-admin.is-in .wpd-welcome { opacity: 1; transform: none; }
.wpd-welcome::after {
  content: "";
  position: absolute; right: -60px; top: -90px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--wpd-accent) 50%, transparent), transparent 65%);
}
.wpd-welcome h2 {
  min-height: 1.2em;
  margin: 0 0 8px;
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 600;
  letter-spacing: -.02em;
}
.wpd-welcome h2::after {
  content: "";
  display: inline-block;
  width: 3px; height: .9em;
  margin-left: 4px;
  vertical-align: -.08em;
  background: var(--wpd-accent);
  animation: wpd-caret 1s steps(1) infinite;
}
.wpd-welcome p {
  position: relative; z-index: 1;
  margin: 0;
  font: 12px/1.5 var(--wpd-mono);
  color: color-mix(in srgb, var(--wpd-paper) 65%, transparent);
}

.wpd-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s .5s, transform .6s var(--wpd-ease) .5s;
}
.wpd-admin.is-in .wpd-widgets { opacity: 1; transform: none; }
.wpd-widget { display: flex; flex-direction: column; min-height: 190px; background: #fff; border: 1px solid #c3c4c7; }
.wpd-widget h3 { margin: 0; padding: 10px 12px; border-bottom: 1px solid #f0f0f1; font-size: 14px; font-weight: 600; }
.wpd-widget__body { position: relative; flex: 1; padding: 12px; }

/* skeleton shimmer until a widget is ready */
[data-wpd-widget] .wpd-widget__body > * { opacity: 0; transition: opacity .4s .1s; }
[data-wpd-widget].is-ready .wpd-widget__body > * { opacity: 1; }
[data-wpd-widget] .wpd-widget__body::before {
  content: "";
  position: absolute; inset: 14px;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent) -150% 0 / 50% 100% no-repeat,
    repeating-linear-gradient(#f0f0f1 0 12px, transparent 12px 26px);
  animation: wpd-shimmer 1.1s linear infinite;
  transition: opacity .3s;
}
[data-wpd-widget].is-ready .wpd-widget__body::before { opacity: 0; }

.wpd-glance { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; list-style: none; margin: 0; padding: 0; }
.wpd-glance li { display: grid; gap: 3px; color: #50575e; }
.wpd-glance strong { font: 600 26px/1 var(--wpd-mono); color: #1d2327; letter-spacing: -.03em; }

.wpd-health { display: flex; align-items: center; gap: 14px; }
.wpd-health svg { flex: none; width: 76px; height: 76px; transform: rotate(-90deg); }
.wpd-health circle { fill: none; stroke-width: 8; }
.wpd-health .track { stroke: #f0f0f1; }
.wpd-health .meter {
  stroke: #00a32a;
  stroke-linecap: round;
  stroke-dasharray: 189;
  stroke-dashoffset: 189;
  transition: stroke-dashoffset 1.2s var(--wpd-ease);
}
.wpd-health.is-good .meter { stroke-dashoffset: 0; }
.wpd-health strong { color: #00a32a; font-size: 15px; }
.wpd-health p { margin: 4px 0 0; color: #50575e; }

.wpd-log { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; font: 11.5px/1.45 var(--wpd-mono); color: #2c3338; }
.wpd-log li { display: flex; gap: 8px; animation: wpd-line .35s var(--wpd-ease) both; }
.wpd-log time { flex: none; color: #8c8f94; }
.wpd-log .ok { color: #00a32a; }
.wpd-log .ok::before { content: "✓ "; }

/* bottom control pill */
.wpd__ui {
  position: absolute; left: 50%; z-index: 6;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(10,10,10,.88);
  backdrop-filter: blur(8px);
  color: var(--wpd-paper);
  font: 11px/1 var(--wpd-mono);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  cursor: default;
}
.wpd__status { margin: 0; padding: 0 10px; min-width: 20ch; white-space: nowrap; }
.wpd__ui button {
  all: unset;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  transition: background .2s, color .2s;
}
.wpd__ui button:hover, .wpd__ui button:focus-visible { background: var(--wpd-accent); color: var(--wpd-ink); }
.wpd__ui button:focus-visible { outline: 2px solid var(--wpd-accent); outline-offset: 2px; }
.wpd__ui kbd { margin-left: 6px; font: inherit; opacity: .6; }

/* WordPress's own mobile breakpoint */
@media (max-width: 782px) {
  .wpd-admin { grid-template: 46px 1fr / 44px 1fr; }
  .wpd-menu li { padding: 10px 14px; font-size: 0; }
  .wpd-menu li b { display: none; }
  .wpd-menu li.is-current::after { margin-top: -6px; border-width: 6px; }
  .wpd-adminbar__site, .wpd-adminbar__new { display: none; }
  .wpd-main { padding: 14px; }
  .wpd-widgets { grid-template-columns: 1fr; }
  .wpd-widget { min-height: 0; }
  .wpd-widget--log { order: -1; }
  .wpd__status { min-width: 0; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
}

@keyframes wpd-spin { to { --wpd-angle: 360deg; } }
@keyframes wpd-sheen { 0%, 60% { background-position: 160% 0, 0 0; } 100% { background-position: -60% 0, 0 0; } }
@keyframes wpd-breathe { 50% { opacity: .32; transform: scale(1.04); } }
@keyframes wpd-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}
@keyframes wpd-needle { 0%, 100% { transform: rotate(-75deg); } 40%, 70% { transform: rotate(8deg); } }
@keyframes wpd-needle-hover { from { transform: rotate(-80deg); } to { transform: rotate(35deg); } }
@keyframes wpd-caret { 50% { opacity: 0; } }
@keyframes wpd-rot { to { transform: rotate(360deg); } }
@keyframes wpd-shimmer { to { background-position: 250% 0, 0 0; } }
@keyframes wpd-line { from { opacity: 0; transform: translateY(4px); } }

@media (prefers-reduced-motion: reduce) {
  .wpd-fab, .wpd-fab *, .wpd-fab::before, .wpd-fab::after,
  .wpd, .wpd *, .wpd *::before, .wpd *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .wpd { clip-path: none; }
}