:root {
  --pleiades-bg: #0b1118;
  --pleiades-card: rgba(10, 12, 16, 0.82);
  --pleiades-card-soft: rgba(10, 12, 16, 0.55);
  --pleiades-border: rgba(255,255,255,0.22);
  --pleiades-text: #f5f5f5;
  --pleiades-muted: #d7e0e4;
  --pleiades-accent: #a3c5c6;
  --pleiades-danger: #ff9b9b;
  --pleiades-good: #9bffbf;
}

[data-access], [data-auth-gate] { transition: opacity .18s ease, transform .18s ease; }
.pleiades-hidden { display: none !important; }

.pleiades-auth-backdrop {
  position: fixed; inset: 0; z-index: 9990;
  background: radial-gradient(circle at top left, rgba(163,197,198,0.22), transparent 32%), rgba(5, 8, 12, 0.82);
  backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 22px; text-shadow: none;
}

.pleiades-auth-card,
.pleiades-user-card,
.pleiades-admin-panel {
  background: var(--pleiades-card); border: 1px solid var(--pleiades-border); color: var(--pleiades-text);
  border-radius: 18px; box-shadow: 0 18px 44px rgba(0,0,0,.38); backdrop-filter: blur(12px);
  font-family: Avenir, Arial, sans-serif; text-shadow: none;
}

.pleiades-auth-card { width: min(460px, 96vw); padding: 22px; }
.pleiades-auth-card h2, .pleiades-admin-panel h2 { margin: 0 0 10px; color: var(--pleiades-text); }
.pleiades-auth-card p, .pleiades-admin-panel p { color: var(--pleiades-muted); font-size: 15px; line-height: 1.45; }
.pleiades-auth-card label, .pleiades-admin-panel label { display: block; color: var(--pleiades-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 5px; }
.pleiades-auth-card input, .pleiades-admin-panel input, .pleiades-admin-panel select, .pleiades-admin-panel textarea {
  width: 100%; padding: 10px; border: 1px solid var(--pleiades-border); border-radius: 10px; background: rgba(255,255,255,.94); color: #111; font-size: 15px; font-family: Avenir, Arial, sans-serif;
}
.pleiades-auth-card button, .pleiades-user-card button, .pleiades-admin-panel button {
  border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer; background: var(--pleiades-accent); color: #0c1214; font-weight: 800; margin: 8px 6px 0 0; font-family: Avenir, Arial, sans-serif;
}
.pleiades-auth-card button.secondary, .pleiades-user-card button.secondary, .pleiades-admin-panel button.secondary { background: #d6dde0; }
.pleiades-auth-card button.danger, .pleiades-user-card button.danger, .pleiades-admin-panel button.danger { background: #ffb1b1; }
.pleiades-status { min-height: 20px; margin-top: 8px; font-size: 14px; }
.pleiades-good, .pleiades-status.good { color: var(--pleiades-good); }
.pleiades-bad, .pleiades-status.bad { color: var(--pleiades-danger); }

.pleiades-floating-button {
  position: fixed; top: 16px; right: 16px; z-index: 9980; border: 1px solid rgba(255,255,255,.20); border-radius: 999px; padding: 10px 16px; background: rgba(8,12,18,.78); color: var(--pleiades-accent); font: 800 14px Avenir, Arial, sans-serif; cursor: pointer; backdrop-filter: blur(12px); box-shadow: 0 14px 34px rgba(0,0,0,.32);
}

.pleiades-access-denied {
  position: fixed; z-index: 9997; left: 50%; top: 24px; transform: translateX(-50%); width: min(560px, calc(100vw - 28px)); padding: 14px 18px; border-radius: 16px; border: 1px solid rgba(255,180,180,.35); background: rgba(40,0,0,.72); color: #ffd7d7; backdrop-filter: blur(10px); box-shadow: 0 12px 32px rgba(0,0,0,.35); font-family: Avenir, Arial, sans-serif;
}

.pleiades-user-card {
  position: fixed;
  left: 14px;
  bottom: 14px;
  top: auto;
  right: auto;
  width: 218px;
  max-height: 54px;
  z-index: 9975;
  padding: 10px 12px;
  border-radius: 18px;
  overflow: hidden;
  opacity: .82;
  background: linear-gradient(155deg, rgba(16,24,33,.90), rgba(5,9,14,.82));
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 12px 30px rgba(0,0,0,.34);
  transition: max-height .22s ease, width .22s ease, opacity .18s ease, transform .18s ease, background .18s ease;
}
.pleiades-user-card:hover,
.pleiades-user-card:focus-within {
  width: 300px;
  max-height: min(82vh, 560px);
  opacity: .98;
  transform: translateY(-2px);
  overflow: auto;
  background: linear-gradient(155deg, rgba(16,24,33,.97), rgba(5,9,14,.93));
}
.pleiades-user-card::before { content: ''; display: block; width: 32px; height: 3px; border-radius: 999px; background: var(--pleiades-accent); opacity: .95; margin-bottom: 7px; }
.pleiades-user-card h3 { margin: 0; color: #fff; font-size: 14px; font-weight: 850; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pleiades-user-card:hover h3,
.pleiades-user-card:focus-within h3 { font-size: 20px; line-height: 1.2; white-space: normal; overflow: visible; }
.pleiades-user-card .role-line, .pleiades-user-role {
  display: inline-block; margin: 7px 0 12px; padding: 5px 9px; border-radius: 999px; color: #dff6f7; background: rgba(163,197,198,.14); border: 1px solid rgba(163,197,198,.30); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase;
}
.pleiades-user-card .detail, .pleiades-user-detail {
  margin: 0; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.09); color: #f4f8f9; font-size: 14px; line-height: 1.35;
}
.pleiades-user-card:not(:hover):not(:focus-within) .role-line,
.pleiades-user-card:not(:hover):not(:focus-within) .pleiades-user-role,
.pleiades-user-card:not(:hover):not(:focus-within) .detail,
.pleiades-user-card:not(:hover):not(:focus-within) .pleiades-user-detail,
.pleiades-user-card:not(:hover):not(:focus-within) .suffer-counter,
.pleiades-user-card:not(:hover):not(:focus-within) .pleiades-counter,
.pleiades-user-card:not(:hover):not(:focus-within) .pleiades-button-row { display: none !important; }
.pleiades-user-card .detail span, .pleiades-user-detail span {
  display: block; margin-bottom: 3px; color: rgba(215,224,228,.82); text-transform: uppercase; letter-spacing: .07em; font-size: 10px; font-weight: 850; line-height: 1.2;
}
.pleiades-user-card .detail strong, .pleiades-user-detail strong { display: block; color: #fff; font-size: 14px; font-weight: 750; line-height: 1.35; word-break: break-word; }
.suffer-counter, .pleiades-counter {
  margin-top: 12px; padding: 11px 12px; border-radius: 16px; background: linear-gradient(135deg, rgba(163,197,198,.16), rgba(255,255,255,.055)); border: 1px solid rgba(163,197,198,.32);
}
.suffer-counter strong, .pleiades-counter-number { display: block; color: #fff; font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.suffer-counter span, .pleiades-counter-label { display: block; margin-top: 5px; color: #dff6f7; font-size: 12px; line-height: 1.3; }
.pleiades-user-card .pleiades-button-row { display: flex; gap: 7px; margin-top: 12px; }
.pleiades-user-card .pleiades-button-row button { flex: 1; margin: 0; padding: 8px 8px; font-size: 12px; }

.pleiades-admin-toggle { position: fixed; bottom: 14px; right: 14px; z-index: 9981; background: rgba(0,0,0,.52); color: var(--pleiades-accent); border: 1px solid var(--pleiades-border); border-radius: 999px; padding: 10px 14px; cursor: pointer; backdrop-filter: blur(8px); }
.pleiades-admin-panel { position: fixed; inset: 20px; z-index: 9995; overflow: auto; padding: 20px; }
.pleiades-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.pleiades-permission-grid, .pleiades-permission-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
.pleiades-check, .permission-check { display: flex !important; gap: 8px; align-items: center; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; color: var(--pleiades-text) !important; margin: 0 !important; background: rgba(255,255,255,.08); border: 1px solid var(--pleiades-border); border-radius: 10px; padding: 8px; }
.pleiades-check input, .permission-check input { width: auto !important; margin: 0 !important; }
.pleiades-account-list, .pleiades-user-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.pleiades-account-card, .admin-user-row { border: 1px solid var(--pleiades-border); border-radius: 14px; background: rgba(255,255,255,.08); padding: 12px; font-size: 14px; }
.pleiades-brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 18px 0; }
.pleiades-brand-tile { display: block; text-decoration: none; color: #d8fcff; background: rgba(0,0,0,.30); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 16px; }
.pleiades-brand-tile:hover { background: rgba(163,197,198,.22); border-color: rgba(163,197,198,.55); }

@media (max-width: 900px) {
  .pleiades-user-card { position: fixed; left: 10px; bottom: 10px; width: min(210px, calc(100vw - 20px)); max-height: 50px; margin: 0; }
  .pleiades-user-card:hover, .pleiades-user-card:focus-within { width: min(300px, calc(100vw - 20px)); max-height: 70vh; }
  .pleiades-admin-grid { grid-template-columns: 1fr; }
}

/* Keep login controls above animated theme layers, including on phones. */
#pleiadesAuthShell { position: relative; z-index: 2147483000; isolation: isolate; }
#pleiadesLoginButton { z-index: 3; background: #101c29; color: #f5f5f5; }
#pleiadesAccessDenied { top: 76px; box-sizing: border-box; z-index: 1; }
#pleiadesLoginPanel {
  position: fixed; z-index: 4; top: 50%; left: 50%;
  transform: translate(-50%, -50%); box-sizing: border-box;
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  overflow-y: auto; padding: 22px; background: #101923; color: #f5f5f5;
}
#pleiadesLoginPanel input { box-sizing: border-box; }
#pleiadesLoginPanel button:disabled { opacity: .6; cursor: wait; }
#pleiadesLoginPanel :is(input, button):focus-visible,
#pleiadesLoginButton:focus-visible { outline: 3px solid #a3c5c6; outline-offset: 3px; }
