:root {
  --bg: #0b1226;
  --bg-2: #111a38;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text: #f4f6ff;
  --text-dim: #a5adc9;
  --purple: #8b5cf6;
  --blue: #38bdf8;
  --sky: #22d3ee;
  --pink: #f472b6;
  --teal: #2dd4bf;
  --gold: #fbbf24;
  --danger: #f43f5e;
  --success: #34d399;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.5);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Aurora background ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 55%, #21184d 100%);
}

.aurora::before,
.aurora::after,
.aurora .blob {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.6;
  will-change: transform;
}

.aurora::before {
  width: 55vw;
  height: 55vw;
  top: -12vw;
  left: -8vw;
  background: radial-gradient(circle at 30% 30%, #7c3aed, transparent 65%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

.aurora::after {
  width: 48vw;
  height: 48vw;
  bottom: -14vw;
  right: -6vw;
  background: radial-gradient(circle at 60% 60%, #38bdf8, transparent 65%);
  animation: drift-b 26s ease-in-out infinite alternate;
}

.aurora .blob {
  width: 38vw;
  height: 38vw;
  top: 35%;
  left: 32%;
  background: radial-gradient(circle at 50% 50%, var(--gold), transparent 65%);
  animation: drift-c 30s ease-in-out infinite alternate;
}

.aurora .blob.teal {
  width: 30vw;
  height: 30vw;
  top: 5%;
  left: 60%;
  background: radial-gradient(circle at 50% 50%, var(--sky), transparent 65%);
  animation-delay: -10s;
  animation-duration: 34s;
}

@keyframes drift-a {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(10vw, 8vh) scale(1.15);
  }
}

@keyframes drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-8vw, -6vh) scale(1.1);
  }
}

@keyframes drift-c {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(6vw, -4vh) scale(1.2);
  }
}

/* ---------- Glass utilities ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.glass-chip {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 999px;
}

/* ---------- Accent gradient text ---------- */
.grad-text {
  background: linear-gradient(120deg, var(--pink), var(--purple) 35%, var(--blue) 70%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Layout ---------- */
.wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  display: block;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 18px rgba(139, 92, 246, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: var(--text);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-gradient {
  background: linear-gradient(120deg, var(--purple), #6366f1 50%, var(--blue));
  border: none;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
}

.btn-gradient:hover {
  box-shadow: 0 12px 36px rgba(56, 189, 248, 0.55);
}

.btn-ghost {
  background: transparent;
}

.btn-block {
  width: 100%;
}

/* ---------- Bento grid ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 28px 0 60px;
}

.bento-card {
  position: relative;
  padding: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
}

.bento-hero {
  grid-column: span 8;
  min-height: 360px;
  justify-content: flex-start;
  gap: 18px;
}

.bento-hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.bento-hero p {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 52ch;
}

.bento-side {
  grid-column: span 4;
  min-height: 360px;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}

.bento-tile {
  grid-column: span 4;
  min-height: 190px;
  gap: 10px;
}

.bento-tile.wide {
  grid-column: span 8;
}

.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(56, 189, 248, 0.4));
  border: 1px solid var(--glass-border);
}

.tile-icon.blue {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(34, 211, 238, 0.4));
}

.tile-icon.pink {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.45), rgba(139, 92, 246, 0.45));
}

.tile-icon.teal {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.4), rgba(56, 189, 248, 0.4));
}

.bento-card h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.bento-card p {
  color: var(--text-dim);
  font-size: 0.93rem;
}

.card-glow {
  position: absolute;
  width: 60%;
  height: 60%;
  top: -30%;
  right: -25%;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Auth page ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  width: min(960px, 100%);
  align-items: stretch;
}

.auth-info {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.auth-info h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.auth-feature .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--purple), var(--blue));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
  flex-shrink: 0;
}

/* ---------- Glass card (login) ---------- */
.auth-card {
  padding: 34px;
  align-self: center;
  width: 100%;
}

.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 26px;
}

.tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.2s ease, background 0.2s ease;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  border: none;
}

.tab.active {
  color: #fff;
  background: linear-gradient(120deg, var(--purple), var(--blue));
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* ---------- Form ---------- */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
}

.input-wrap .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.95rem;
  pointer-events: none;
}

.input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.input::placeholder {
  color: rgba(154, 160, 176, 0.7);
}

.toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 6px;
}

.toggle-pass:hover {
  color: var(--text);
}

.msg {
  display: none;
  font-size: 0.87rem;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 16px;
}

.msg.show {
  display: block;
}

.msg.error {
  color: #ffb3c1;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.msg.success {
  color: #b9f6ce;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.form-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.form-footer a {
  color: #a78bfa;
  font-weight: 600;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ---------- Dashboard ---------- */
.dash-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 0.9rem;
}

.user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 24px 0 40px;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.6s ease forwards;
}

.reveal.d1 {
  animation-delay: 0.08s;
}
.reveal.d2 {
  animation-delay: 0.16s;
}
.reveal.d3 {
  animation-delay: 0.24s;
}
.reveal.d4 {
  animation-delay: 0.32s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Content module ---------- */
.topnav {
  position: sticky;
  top: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: min(1140px, 94vw);
  margin: 18px auto 0;
  padding: 12px 18px;
}

.topnav-search {
  flex: 1;
  min-width: 200px;
}

.topnav .input {
  padding-top: 11px;
  padding-bottom: 11px;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Alert bell + pop-ups (js/alert-bell.js) */
.alert-bell {
  position: relative;
  padding: 8px 12px;
  font-size: 1.05rem;
}
.alert-bell.has-alerts {
  border-color: rgba(251, 113, 133, 0.6);
}
.alert-bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.alert-pop-stack {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.alert-pop {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  border-left: 4px solid #fbbf24;
  cursor: pointer;
  animation: alert-pop-in 0.25s ease;
}
.alert-pop.sev-critical {
  border-left-color: #f43f5e;
}
.alert-pop.sev-info {
  border-left-color: #38bdf8;
}
.alert-pop-ico {
  font-size: 1.3rem;
}
.alert-pop-body {
  flex: 1;
  min-width: 0;
}
.alert-pop-title {
  font-weight: 700;
}
.alert-pop-detail {
  margin-top: 4px;
  font-size: 0.82rem;
  opacity: 0.8;
}
.alert-pop-close {
  background: none;
  border: 0;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}
@keyframes alert-pop-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.navtabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
  padding: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  min-width: 0;
}

.navtab {
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.navtab:hover {
  color: var(--text);
}

.navtab.active {
  color: #fff;
  background: linear-gradient(120deg, var(--purple), var(--blue));
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.navtab.account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
}

.page[hidden] {
  display: none;
}

.content {
  padding: 28px;
  margin-top: 24px;
}

.content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.content-head h2 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.content-head p {
  color: var(--text-dim);
  font-size: 0.93rem;
  margin-top: 4px;
}

.content-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap; /* phones: wrap instead of pushing the page wider than the screen */
}

.content-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.toolbar-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-short {
  flex: 0 1 230px;
  min-width: 150px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-wrap .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-wrap .input {
  padding-left: 42px;
}

.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- Folder cards & breadcrumb ---------- */
.folder-crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.folder-crumb[hidden] {
  display: none;
}

.crumb-back {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.crumb-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(56, 189, 248, 0.25));
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 7px 16px;
}

.folder-card .file-cover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(56, 189, 248, 0.3));
}

.folder-card .file-cover span {
  font-size: 2.6rem;
}

.upload-folder-label {
  margin-top: 12px;
}

.count-chip {
  padding: 9px 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.select {
  padding: 12px 38px 12px 16px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.select option {
  background: #16161f;
  color: var(--text);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.file-card {
  position: relative;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.file-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.24);
}

.file-cover {
  height: 104px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(59, 130, 246, 0.22));
  border: 1px solid var(--glass-border);
  overflow: hidden;
  margin-bottom: 10px;
}

.file-cover img,
.file-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-meta {
  min-width: 0;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.file-type-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.4);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.file-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  color: var(--text);
  cursor: pointer;
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}

.file-card:hover .file-remove {
  opacity: 1;
}

.file-remove:hover {
  background: rgba(244, 63, 94, 0.35);
  border-color: var(--danger);
}

.file-settings {
  position: absolute;
  top: 8px;
  right: 42px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}

.file-card:hover .file-settings,
.file-settings:focus-visible {
  opacity: 1;
}

.file-settings:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--blue);
}

/* ---------- Folder gear & menu ---------- */
.folder-settings {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  z-index: 3;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.folder-settings:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: var(--purple);
  transform: rotate(45deg);
}

.folder-menu {
  position: fixed;
  z-index: 60;
  min-width: 210px;
  padding: 6px;
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
  animation: fadeUp 0.18s ease;
}

.folder-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.folder-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.folder-menu-item.danger {
  color: #fda4af;
}

.folder-menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.14);
}

.folder-menu-item.active {
  color: #a5b4fc;
}

/* ---------- Playback report system ---------- */
.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.pbr-overlay {
  z-index: 80;
  padding: 18px;
}

.pbr-shell {
  width: min(1180px, 96vw);
  max-height: 94vh;
  margin: 0 auto;
  padding: 18px 20px 24px;
  border-radius: var(--radius);
  overflow: auto;
  position: relative;
}

.pbr-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pbr-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex: 1;
  min-width: 160px;
}

.pbr-crumb-item.last {
  color: var(--text);
  font-weight: 600;
}

.pbr-crumb-sep {
  opacity: 0.5;
}

.pbr-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pbr-header {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 14px;
}

.pbr-thumb {
  width: 96px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.3));
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.pbr-thumb img,
.pbr-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pbr-headinfo h2 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.pbr-live {
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: middle;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.pbr-live.off {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.pbr-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 22px;
}

.pbr-fields > div {
  display: flex;
  gap: 8px;
  font-size: 0.86rem;
}

.pbr-k {
  color: var(--text-dim);
  flex-shrink: 0;
}

.pbr-v {
  color: var(--text);
  font-weight: 600;
}

.pbr-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.pbr-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pbr-tab:hover {
  color: var(--text);
}

.pbr-tab.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.45), rgba(56, 189, 248, 0.4));
  border-color: var(--purple);
  color: #fff;
}

.pbr-body {
  min-height: 220px;
}

.pbr-section-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-tile {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
}

.stat-tile.tile-err {
  border-color: rgba(244, 63, 94, 0.35);
}

.stat-icon {
  font-size: 1.2rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 2px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* charts */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.chart-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.chart-card h4 {
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 150px;
  max-width: 100%;
  overflow: hidden;
  padding-bottom: 20px;
}

.bar-chart.trend {
  height: 170px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 5px;
  gap: 4px;
}

.bar-bar {
  width: 100%;
  max-width: 14px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #a78bfa, #38bdf8);
  min-height: 2px;
}

.bar-x {
  font-size: 0.62rem;
  color: var(--text-dim);
  transform: rotate(-45deg);
  white-space: nowrap;
}

.bar-x.dim {
  opacity: 0;
}

.hourly {
  height: 150px;
}

.hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.hour-col.dim {
  opacity: 0.55;
}

.hour-bar {
  width: 100%;
  max-width: 12px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #22d3ee, #8b5cf6);
}

.hour-x {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.donut-wrap {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.donut-hole {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #161d33;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-hole strong {
  font-size: 1.05rem;
}

.donut-hole span {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}

.donut-legend > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.ok {
  background: #34d399;
}

.dot.warn {
  background: #fbbf24;
}

.dot.err {
  background: #fda4af;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.cal-cell.l1 {
  background: rgba(52, 211, 153, 0.25);
  color: #fff;
}

.cal-cell.l2 {
  background: rgba(52, 211, 153, 0.5);
  color: #fff;
}

.cal-cell.l3 {
  background: rgba(52, 211, 153, 0.75);
  color: #fff;
}

.cal-cell.l4 {
  background: #34d399;
  color: #052e22;
  font-weight: 700;
}

/* status pills */
.pbd {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.pbd.ok {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.16);
}

.pbd.warn {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.16);
}
.pbd.offline {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
}

.pbd.err {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.16);
}

/* tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.pbr-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.pbr-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.pbr-table td {
  padding: 12px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.pbr-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.pbr-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.08);
}

/* campaign detail */
.cmp-detail {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.cmp-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 24px;
  margin: 12px 0;
  font-size: 0.88rem;
}

.cmp-meta > div {
  display: flex;
  gap: 8px;
}

.duo-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.duo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.duo-lbl {
  width: 90px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.duo-val {
  width: 70px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
}

/* logs toolbar */
.meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 8px;
  flex: 1;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}

.logs-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.logs-search {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.filters-panel {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 14px;
}

.filters-panel.hide {
  display: none;
}

.flt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.flt .select {
  padding: 9px 30px 9px 12px;
  font-size: 0.82rem;
}

.logs-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* drawers */
.pbr-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 8, 18, 0.6);
  backdrop-filter: blur(4px);
}

.pbr-drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(460px, 92vw);
  overflow-y: auto;
  border-radius: var(--radius) 0 0 var(--radius);
  border-left: 1px solid var(--glass-border);
  border-radius: 0;
}

.pbr-drawer .modal-close {
  position: sticky;
  top: 12px;
  margin: 12px 12px 0 auto;
  display: block;
}

.drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 20px 2px;
}

.drawer-body {
  padding: 8px 20px 24px;
}

.drawer-body h5 {
  margin: 18px 0 8px;
  font-size: 0.9rem;
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.kv span {
  color: var(--text-dim);
  flex-shrink: 0;
}

.kv b {
  color: var(--text);
  text-align: right;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.loc-screen {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.loc-screen:hover {
  background: rgba(139, 92, 246, 0.1);
}

.loc-screen b {
  margin-right: 8px;
}

.loc-timeline {
  transform: scale(0.9);
  transform-origin: left center;
}

/* proof of play */
.proof {
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  padding: 16px;
}

.proof-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.proof-head strong {
  display: block;
  font-size: 1rem;
}

.proof-head span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* export menu */
.pbr-menu {
  position: fixed;
  z-index: 99;
  min-width: 210px;
  padding: 6px;
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
  animation: fadeUp 0.18s ease;
}

.pbr-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pbr-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* client report */
.cr-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(5, 8, 18, 0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.cr-sheet {
  width: min(860px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #0d1430;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 26px 30px;
  position: relative;
}

.cr-sheet .modal-close {
  position: sticky;
  top: 10px;
  margin-left: auto;
  display: block;
}

.cr-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.cr-top h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.cr-top p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.cr-top .modal-close {
  margin-left: auto;
}

.cr-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 24px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.cr-meta div span {
  display: block;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.cr-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cr-stats > div {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.cr-stats b {
  display: block;
  font-size: 1.35rem;
  color: var(--text);
}

.cr-stats span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.cr-foot {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
}

/* print */
@media print {
  body.print-cr * {
    visibility: hidden;
  }

  body.print-cr .cr-overlay,
  body.print-cr .cr-overlay * {
    visibility: visible;
  }

  body.print-cr .cr-overlay {
    position: absolute;
    inset: 0;
    background: #fff;
    backdrop-filter: none;
    padding: 0;
    overflow: visible;
  }

  body.print-cr .cr-sheet {
    width: 100%;
    max-height: none;
    border: 0;
    background: #fff;
    color: #000;
  }

  body.print-cr .cr-sheet .pbr-table th {
    color: #555;
    border-color: #ccc;
  }

  body.print-cr .cr-sheet .cr-top .modal-close,
  body.print-cr #crPrint {
    display: none;
  }
}

@media (max-width: 720px) {
  .pbr-shell {
    padding: 12px;
  }

  .pbr-top-actions {
    margin-left: 0;
    width: 100%;
  }

  .pbr-header {
    gap: 12px;
  }

  .pbr-thumb {
    width: 72px;
    height: 54px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .pbr-table td,
  .pbr-table th {
    padding: 10px 12px;
  }
}

.empty-state {
  display: none;
  text-align: center;
  padding: 46px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
}

.empty-state.show {
  display: block;
}

.empty-state .empty-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.empty-state .empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.empty-state .empty-sub {
  font-size: 0.88rem;
  margin-top: 4px;
}

/* ---------- Pages ---------- */
.content .bento {
  padding: 0;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  padding: 28px;
  margin-top: 24px;
}

.account-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.big-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple) 55%, var(--sky));
  box-shadow: 0 0 34px rgba(139, 92, 246, 0.55);
}

.account-card h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.account-card h3 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.value-pill {
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text);
  width: fit-content;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
}

.setting-row .label {
  font-weight: 600;
  font-size: 0.95rem;
}

.setting-row .sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.switch::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: left 0.25s ease;
}

.switch.on {
  background: linear-gradient(120deg, var(--purple), var(--blue));
}

.switch.on::after {
  left: 22px;
}

/* ---------- File detail modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 12, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(820px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 3;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.35);
  border-color: var(--danger);
}

.detail-preview {
  position: relative;
  height: 340px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 3rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.detail-preview img,
.detail-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-name {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.detail-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

.detail-chip {
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--text);
}

/* Clickable chips (role toggles, alert tabs, plan features, key pickers) are
   <button>s: without this they fall back to the browser's light default button,
   leaving light text invisible on a light background. Chips that also carry
   .glass-chip already have their own background, so leave those alone. */
button.detail-chip:not(.glass-chip) {
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
button.detail-chip:not(.glass-chip):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--purple);
}

.detail-dims {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 6px;
}

.detail-body h4 {
  margin: 20px 0 2px;
  font-size: 1.02rem;
}

.detail-body .hint {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.screen-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.chip-status {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: capitalize;
  flex-shrink: 0;
}

.chip-status.online {
  color: #86efac;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.chip-status.offline {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

/* Connected, but the TV is in standby (screen off). */
.chip-status.standby {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.screen-count {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 12px;
}

.file-cover {
  position: relative;
}

.filescreens {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  z-index: 2;
}

@media (max-width: 720px) {
  .modal {
    grid-template-columns: 1fr;
  }
  .detail-preview {
    height: 220px;
  }
}

/* ---------- Confirm modal ---------- */
.confirm-modal {
  grid-template-columns: 1fr;
  gap: 14px;
  width: min(440px, 100%);
  align-content: start;
}

.confirm-modal.item-form-wide {
  width: min(560px, 100%);
}

.confirm-icon {
  font-size: 2.4rem;
}

.confirm-modal h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.confirm-modal .confirm-text {
  color: var(--text-dim);
  font-size: 0.93rem;
}

.confirm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn-danger {
  background: linear-gradient(120deg, var(--danger), #e11d48);
  border: none;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.45);
}

.btn-danger:hover {
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.6);
}

/* ---------- Overview summary ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.stat-card {
  min-height: 0;
  padding: 24px;
  gap: 8px;
}

.stat-card .stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-card .stat-label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.stat-wide {
  grid-column: 1 / -1;
}

.storage-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.storage-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  transition: width 0.6s ease;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.recent-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 72%;
}

.recent-size {
  color: var(--text-dim);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.file-expiry {
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 3px;
}

.file-expiry.expiring {
  color: #fcd34d;
}

.file-expiry.expired {
  color: #fda4af;
}

.file-card.expired {
  opacity: 0.55;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.35);
  font-size: 0.88rem;
}

.alert-when {
  color: var(--text-dim);
  flex-shrink: 0;
}

.alert-when.expired {
  color: #fda4af;
}

/* ---------- Storage prompt ---------- */
.storage-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  max-height: 180px;
  overflow: auto;
}

.pv-card {
  width: 76px;
  text-align: center;
}

.pv-thumb {
  width: 76px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(56, 189, 248, 0.25));
  border: 1px solid var(--glass-border);
}

.pv-thumb img,
.pv-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pv-name {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-days {
  margin-top: 10px;
}

.custom-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.req {
  color: #fda4af;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 12px 20px;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .aurora::before,
  .aurora::after,
  .aurora .blob {
    animation: none;
  }
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento-hero,
  .bento-side,
  .bento-tile,
  .bento-tile.wide {
    grid-column: span 12;
  }
  .auth-grid {
    grid-template-columns: 1fr;
  }
  .auth-info {
    padding: 28px;
  }
}

@media (max-width: 520px) {
  .nav-links .btn-text {
    display: none;
  }
  .auth-card {
    padding: 24px;
  }
}

/* ==================================================================
   Screens section — Screen Library, wizard, Screen details, tabs
   ================================================================== */

/* skeleton shimmer */
.skl {
  display: inline-block;
  height: 14px;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.14) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: skl 1.3s ease infinite;
}

@keyframes skl {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.sdt-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* status chips (extra states) */
.chip-status.updating {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.chip-status.connecting {
  color: #a5b4fc;
  background: rgba(129, 140, 248, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.4);
}

.chip-status.pending {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.45);
}

.folder-menu-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu-sep {
  height: 1px;
  background: var(--glass-border);
  margin: 6px 8px;
}

.dot.blue {
  background: #38bdf8;
}

.dot.purple {
  background: #8b5cf6;
}

/* ---------------- Library ---------------- */
.scr-summary .stat-card {
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.scr-summary .stat-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-3px);
}

.scr-table {
  min-width: 1020px;
}

.scr-row {
  cursor: pointer;
}

.sc-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sc-cell b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.sc-id {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.sc-loc,
.sc-ver {
  color: var(--text-dim);
}

.sc-content {
  font-weight: 600;
}

.sc-ori {
  font-size: 0.85rem;
  white-space: nowrap;
}

.sc-seen {
  color: var(--text-dim);
}

.scr-more {
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1;
}

/* ---------------- View selector ---------------- */
.view-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-select > span {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  font-weight: 600;
  text-transform: uppercase;
}

.view-select .select {
  width: auto;
  min-width: 130px;
}

/* ---------------- Screen cards ---------------- */
.scr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.scr-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.scr-card:hover {
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.06);
}

.scr-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scr-card-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.scr-card-ico.portrait,
.scr-card-ico.reverse-landscape {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

.scr-card-top .chip-status {
  margin-left: auto;
}

.scr-card-line {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.scr-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.scr-card-meta .sc-ori {
  font-size: 0.8rem;
}

.scr-more-wide {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

/* ---------------- Live preview frame ---------------- */
.preview-modal {
  grid-template-columns: 1fr;
  width: min(560px, 100%);
  gap: 18px;
}

.preview-stage {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.16), transparent 70%), rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
}

.preview-frame {
  position: relative;
  width: 320px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #1d2547, #2b1d54);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  transition: width 0.35s ease, height 0.35s ease;
}

.preview-frame.portrait {
  width: 122px;
  height: 320px;
}

.preview-frame .pf-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.55), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(139, 92, 246, 0.55), transparent 55%),
    linear-gradient(135deg, #101a3d, #241a52);
}

.pf-clock {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.preview-frame.portrait .pf-clock {
  font-size: 1.1rem;
}

.pf-live {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #86efac;
  background: rgba(52, 211, 153, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
}

.preview-frame .pf-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pf-bottom b {
  font-size: 0.8rem;
}

.pf-bottom span {
  font-size: 0.66rem;
  color: var(--text-dim);
}

.preview-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.live-o.active {
  border-color: var(--sky);
  color: #fff;
  background: rgba(56, 189, 248, 0.16);
}

/* ---------------- Add screen wizard ---------------- */
.wizard-modal {
  grid-template-columns: 1fr;
  gap: 16px;
  width: min(560px, 100%);
  align-content: start;
}

.wizard-steps {
  display: flex;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.wstep {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 110px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 600;
}

.wdot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.wstep.active {
  color: var(--text);
}

.wstep.active .wdot {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  border: none;
  color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.55);
}

.wstep.done .wdot {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}

.wstep.done .wdot::after {
  content: "✓";
}

.wstep.done .wdot {
  font-size: 0;
}

.wizard-body {
  min-height: 240px;
}

.wiz-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiz-step h3 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.wiz-ico {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(56, 189, 248, 0.4));
  border: 1px solid var(--glass-border);
}

.wiz-ico.big {
  width: 84px;
  height: 84px;
  font-size: 2.6rem;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.35), rgba(56, 189, 248, 0.35));
}

.wiz-sub {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.pair-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.pair-input {
  flex: 1;
  text-align: center;
  letter-spacing: 0.6em;
  font-weight: 700;
  font-size: 1.2rem;
  padding-left: 12px;
  padding-right: 12px;
}

.pair-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pair-hint b {
  color: #a78bfa;
}

.found-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.07);
}

.found-ico {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.found-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.found-info span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.found-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.wiz-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.wiz-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin-top: 8px;
}

.wiz-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
}

.wiz-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.wiz-divider span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.mini-map-none .mini-map-bar {
  justify-content: center;
  padding: 14px 12px;
}

.wiz-note {
  grid-column: 1 / -1;
}

.orient-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.orient-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.orient-card b {
  font-size: 0.88rem;
}

.orient-card span {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.orient-card.active {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.14);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.review-list {
  display: flex;
  flex-direction: column;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--glass-border);
  padding-top: 14px;
}

.wiz-step.activated {
  align-items: center;
  text-align: center;
  padding: 12px 0;
}

/* ---------------- Screen details ---------------- */
.sdt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sdt-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(56, 189, 248, 0.08));
  margin-bottom: 14px;
}

.sdt-ico {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: linear-gradient(135deg, var(--purple), var(--sky));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
  flex-shrink: 0;
}

.sdt-ico.portrait {
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.sdt-hero-info h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.sdt-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.sdt-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sdt-tabs {
  margin-bottom: 16px;
}

/* detail tab content */
.ov-current {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ov-thumb {
  width: 54px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.3));
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.ov-current > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ov-current span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.ov-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 10px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.spec-group {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
}

.spec-group h5 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.spec-caps {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-caps {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.cap-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cap-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.sec-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.sec-pin {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  color: var(--text);
}

.sec-pin b {
  letter-spacing: 0.2em;
}

.pin-row {
  margin: 6px 0;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
}

.session-row b {
  min-width: 160px;
}

.session-row .pbd {
  margin-left: auto;
}

.schedule-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.day-row b {
  width: 110px;
  flex-shrink: 0;
}

.time-input {
  width: 120px;
  padding: 8px 12px;
}

.day-row .switch {
  margin-left: auto;
}

.sdt-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--sev);
  border: 1px solid var(--sevbd);
}

.sev-ico {
  font-size: 1.2rem;
}

.sev-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sev-body span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.update-card {
  padding: 18px;
}

.update-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.update-notes {
  margin: 12px 0 0 18px;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deploy {
  margin-top: 14px;
}

.deploy-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.deploy-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.deploy-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  transition: width 0.2s ease;
}

.reorder-row {
  display: flex;
  gap: 6px;
}

/* location map placeholder */
.map-wrap {
  position: relative;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: radial-gradient(circle at 50% 45%, rgba(139, 92, 246, 0.22), transparent 60%), #0c1430;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(56, 189, 248, 0.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 2px, transparent 2px);
  background-size:
    60px 60px,
    60px 60px,
    14px 14px,
    14px 14px;
}

.map-pin {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -100%);
  font-size: 1.9rem;
  filter: drop-shadow(0 6px 14px rgba(244, 63, 94, 0.5));
  animation: pinBounce 2.2s ease-in-out infinite;
}

@keyframes pinBounce {
  0%,
  100% {
    transform: translate(-50%, -100%);
  }
  50% {
    transform: translate(-50%, -108%);
  }
}

.map-coord {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .wiz-cols {
    grid-template-columns: 1fr;
  }
  .orient-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .preview-frame {
    width: 260px;
    height: 150px;
  }
  .preview-frame.portrait {
    width: 96px;
    height: 260px;
  }
  .day-row {
    flex-wrap: wrap;
  }
  .day-row b {
    width: auto;
    flex: 1;
  }
  .sc-cell b {
    max-width: 140px;
  }
}

/* ==================================================================
   Screen detail — minimalist playlist + content library editor
   ================================================================== */

.sdp-hero {
  align-items: center;
}

.sdp-hero .sdt-hero-info {
  flex: 1;
  min-width: 0;
}

.sdp-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.mini-orient {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  margin-left: auto;
  max-width: 100%;
}

.mini-orient button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mini-orient button.active {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.chip-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.chip-dot.playing {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.9);
  animation: sdpPulse 1.8s ease-in-out infinite;
}

@keyframes sdpPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.sdp-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.sdp-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.sdp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
}

.sdp-panel-head h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sdp-panel-head .sub {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 3px;
}

/* ---------------- Playlist ---------------- */

.pl-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  min-height: 160px;
  max-height: 480px;
  overflow-y: auto;
}

.pl-list.drop-target {
  background: rgba(139, 92, 246, 0.07);
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.045);
  cursor: grab;
  transition: border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.pl-item:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.pl-item.dragging {
  opacity: 0.35;
  transform: scale(0.985);
}

.pl-drag {
  color: var(--text-dim);
  font-size: 1.05rem;
  cursor: grab;
  user-select: none;
}

.pl-thumb {
  position: relative;
  width: 48px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.3));
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  overflow: hidden;
}

.pl-thumb img,
.pl-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pl-thumb .lib-play {
  width: 18px;
  height: 18px;
  font-size: 0.55rem;
  padding-left: 2px;
}

.pl-disabled {
  opacity: 0.45;
}

.pl-more {
  flex-shrink: 0;
}

/* ---------- Playlist item options ---------- */

.item-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.item-form .orient-grid {
  margin-top: 6px;
}

.item-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.item-row .field {
  flex: 1;
  min-width: 0;
}

.item-row-sep {
  color: var(--text-dim);
  padding-bottom: 9px;
  font-size: 0.82rem;
}

.item-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.opt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.opt-btn.active {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.4);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.day-grid .opt-btn {
  width: auto;
  min-width: 0;
  border-radius: 9px;
  padding: 9px 0 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-grid .opt-btn.active {
  background: linear-gradient(120deg, #7c3aed, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.day-grid .day-cell {
  position: relative;
  width: auto;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 9px 0 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.day-grid .day-cell:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.day-grid .day-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-grid .day-cell.active {
  background: linear-gradient(120deg, #7c3aed, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

/* Duration picker */

.dur-picker {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dur-show {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 0 6px;
}

.dur-show b {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dur-show span {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.dur-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dur-step {
  flex: 1;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 0;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dur-step:hover {
  background: rgba(255, 255, 255, 0.09);
}

.dur-input {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  width: 86px;
}

.dur-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.dur-preset {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 9px;
  padding: 9px 0 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dur-preset:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.dur-preset.active {
  background: linear-gradient(120deg, #7c3aed, #6366f1);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

/* Item preview — media inside the simulated screen */

.preview-frame .pf-media,
.preview-frame .pf-media-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-frame .pf-media-scrim {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 35%, transparent 65%, rgba(0, 0, 0, 0.45));
}

.preview-frame .pf-screen .pf-clock {
  position: relative;
  z-index: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-frame .pf-live {
  z-index: 2;
}

.preview-frame .pf-ph {
  font-size: 3.2rem;
  opacity: 0.92;
}

.pl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pl-info b {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-info span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.pl-dur {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.pl-rm {
  flex-shrink: 0;
}

.pl-drop {
  height: 3px;
  margin: 1px 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.9);
}

.pl-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 34px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}

.pl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--glass-border);
}

.pl-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.pl-meta b {
  color: var(--text);
}

.pl-unsaved {
  color: #fda4af;
  font-size: 0.75rem;
}

/* ---------------- Content library ---------------- */

.lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
}

.lib-search {
  flex: 1 1 150px;
  min-width: 130px;
}

.lib-toolbar > .select {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
  padding: 14px;
  max-height: 480px;
  overflow-y: auto;
}

.lib-card {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: grab;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.lib-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.lib-card.dragging {
  opacity: 0.35;
}

.lib-thumb {
  position: relative;
  height: 76px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  margin-bottom: 9px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.3));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.lib-thumb img,
.lib-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lib-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: #fff;
  padding-left: 3px;
  pointer-events: none;
}

.lib-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.lib-meta span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-dur {
  flex-shrink: 0;
}

.lib-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.84rem;
  padding: 30px 12px;
}

/* ---------------- Settings & hours modals ---------------- */

.settings-modal,
.hours-modal {
  grid-template-columns: 1fr;
  width: min(880px, 100%);
}

.settings-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.settings-section > h4 {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.settings-section .kv {
  padding: 8px 0;
}

.set-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hours-modal .stats-grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1100px) {
  .sdp-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sdp-hero {
    flex-wrap: wrap;
  }
  .sdp-tools {
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
  }
  .hours-modal .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Upload buttons + Content picker ---------------- */

.lib-upload-btns {
  display: flex;
  gap: 6px;
}

.picker-modal {
  grid-template-columns: 1fr;
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}

.pick-card {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.pick-card:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.pick-card.selected {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.pick-thumb {
  height: 64px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(56, 189, 248, 0.25));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.pick-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pick-info b {
  display: block;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pick-info span {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.pick-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: transparent;
}

.mini-map {
  margin-top: 12px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.06), transparent 60%),
    linear-gradient(160deg, rgba(139, 92, 246, 0.08), rgba(56, 189, 248, 0.04));
}

.mini-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.mini-map .map-bg {
  fill: rgba(255, 255, 255, 0.02);
}

.mini-map .block {
  fill: rgba(255, 255, 255, 0.045);
  stroke: rgba(255, 255, 255, 0.07);
}

.mini-map .road {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.mini-map .road.v {
  stroke-width: 2;
}

.mini-map .pin-pulse {
  fill: none;
  stroke: rgba(244, 63, 94, 0.45);
  stroke-width: 2;
}

.mini-map .pin-dot {
  fill: #f43f5e;
  stroke: #fff;
  stroke-width: 1.6;
}

.mini-map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
}

.mini-map-bar a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.mini-map-bar a:hover {
  text-decoration: underline;
}

.pick-card.selected .pick-check {
  color: #fff;
  background: linear-gradient(120deg, var(--purple), var(--blue));
  border: none;
}

.pick-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pick-skel {
  display: flex;
  gap: 6px;
  padding: 0;
}

.pick-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.pick-folder i {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 1px 7px;
}

.pick-folder:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.pick-folder.active {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  color: #fff;
  border-color: transparent;
}

.pick-folder.active i {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

@media (max-width: 720px) {
  .lib-upload-btns {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ---------- Screen Groups ---------- */
.scr-groups {
  margin-top: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scr-groups-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.scr-groups-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scr-groups-title h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.scr-groups-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scr-groups-tools .select,
.scr-groups-tools .search-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.scr-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.grp-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.grp-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.grp-thumb {
  position: relative;
  height: 96px;
  overflow: hidden;
}

.grp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grp-thumb .grp-more {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.grp-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--danger), #e11d48);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  position: absolute;
  left: 8px;
  top: 8px;
}

.grp-body {
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.grp-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.grp-name-row b {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.grp-count {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.78rem;
  white-space: nowrap;
}

.grp-desc {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.grp-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.grp-meta-line {
  color: var(--text-dim);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grp-meta-line b {
  color: var(--text);
  font-weight: 600;
}

.grp-card > .grp-open {
  margin: 0 10px 10px;
  justify-content: center;
}

/* Group detail modal */
.grp-modal {
  width: min(920px, 100%);
  grid-template-columns: 1fr;
  gap: 16px;
  align-content: start;
}

.grp-modal h3 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.grp-detail-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}

.grp-detail-thumb {
  width: 150px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
}

.grp-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grp-detail-title {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grp-detail-title p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.grp-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.grp-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}

.grp-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.grp-tab:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.grp-tab.active {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  color: #fff;
  border-color: transparent;
}

.grp-tab-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.grp-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.grp-stat-ico {
  font-size: 1.15rem;
}

.grp-stat b {
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grp-stat span {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.grp-section-label {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.grp-bulk {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grp-bulk .btn {
  flex: 0 1 auto;
}

.grp-danger {
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.45);
}

.grp-help {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

.grp-hours-line {
  color: var(--text-dim);
  font-size: 0.9rem;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.grp-members-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grp-members-tools .search-wrap {
  flex: 1 1 200px;
  min-width: 160px;
}

.grp-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grp-member {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  flex-wrap: wrap;
}

.grp-member .sc-loc,
.grp-member .sc-ver,
.grp-member .sc-seen {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.grp-member > .sc-cell {
  flex: 1;
  min-width: 160px;
}

.grp-remove {
  color: var(--danger);
}

.grp-member .chip-status.warn {
  margin-left: auto;
  cursor: default;
}

.grp-member-more {
  color: var(--text-dim);
}

.grp-sched-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grp-sched-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.grp-sched-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.grp-sched-row .input {
  width: auto;
}

.wiz-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.chip-status.warn {
  color: #f8b4ec;
  background: rgba(244, 114, 182, 0.14);
  border: 1px solid rgba(244, 192, 214, 0.35);
}

.pick-one {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.pick-row:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.pick-row.sel {
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(139, 92, 246, 0.12);
}

.pick-row input[type="checkbox"] {
  accent-color: var(--purple);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pick-row .sc-cell {
  flex: 1;
  min-width: 160px;
}

.pu-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
}

/* ============ Screen group detail page (#groups/<id>) ============ */
.grp-back {
  display: inline-block;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 10px;
}
.grp-back:hover {
  color: var(--accent);
}
.grp-head-main {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  padding: 6px 0 16px;
}
.grp-head-thumb {
  width: 150px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
}
.grp-head-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grp-head-info {
  flex: 1;
  min-width: 240px;
}
.grp-head-info h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}
.grp-head-info p {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.grp-head-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 6px;
}
.grp-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.grp-screens-chip {
  cursor: pointer;
  font: inherit;
  color: var(--accent);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.grp-screens-chip:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
}
.grp-tabs-row {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}
.grp-edit {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: 16px;
  padding-top: 14px;
}
.grp-pl-panel,
.grp-lib-panel {
  min-width: 0;
}
.grp-settings-modal {
  width: min(620px, 100%);
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: start;
}
.grp-settings-scroll {
  display: grid;
  gap: 2px;
  grid-column: 1 / -1;
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}
.grp-settings-scroll .wiz-actions {
  margin: 4px 0 14px;
}
@media (max-width: 1080px) {
  .grp-edit {
    grid-template-columns: 1fr;
  }
  .grp-head-thumb {
    width: 120px;
    height: 72px;
  }
}
/* Playlist read-only when a screen is managed by a group */
.pl-group-bar {
  margin: -4px 0 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.45;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: var(--text-bright);
}
.pl-group-bar b {
  color: var(--text-bright);
}
.pl-list.pl-blocked .pl-more,
.pl-list.pl-blocked .pl-rm {
  display: none;
}

/* ================= Admin Management ================= */
.adm-crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.adm-tabs {
  margin-bottom: 16px;
}
.adm-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.adm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.adm-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.adm-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}
.adm-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.adm-card-ico {
  font-size: 1.5rem;
}
.adm-count {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  padding: 3px 10px;
  min-width: 22px;
  text-align: center;
}
.adm-card-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-bright, var(--text));
}
.adm-card-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.45;
}
.adm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-row {
  cursor: default;
}
.user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.user-meta .avatar {
  flex-shrink: 0;
}
.user-meta b {
  color: var(--text-bright, var(--text));
}
.user-sub {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 2px;
}
.user-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.user-tags .value-pill {
  padding: 3px 10px;
  font-size: 0.72rem;
}
.user-role-chip {
  border-color: rgba(56, 189, 248, 0.3);
}
.user-when {
  color: var(--text-dim);
  font-size: 0.78rem;
  white-space: nowrap;
}
.adm-note {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.5;
}
.adm-note code {
  color: var(--text-bright, var(--text));
  font-size: 0.8rem;
}
.adm-roles {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .adm-roles {
    grid-template-columns: 1fr;
  }
}
.role-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.role-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.role-card.active {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.14);
}
.role-card .user-meta {
  align-items: flex-start;
}
.adm-role-edit {
  min-width: 0;
}
.perm-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.perm-group {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 14px;
}
.perm-group-head {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-bright, var(--text));
}
.perm-group-head span {
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-left: 6px;
}
.perm-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.perm-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.85rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 8px 10px;
}
.perm-item:hover {
  background: rgba(255, 255, 255, 0.07);
}
.perm-item input {
  margin-top: 3px;
  accent-color: var(--purple);
}
.perm-item b {
  display: block;
  text-transform: capitalize;
  font-size: 0.82rem;
}
.perm-item i {
  display: block;
  font-style: normal;
  color: var(--text-dim);
  font-size: 0.76rem;
  margin-top: 2px;
}
.role-toggle.active {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  color: #fff;
  border-color: transparent;
}
.detail-chip.active {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  color: #fff;
  border-color: transparent;
}
.adm-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .adm-cols {
    grid-template-columns: 1fr;
  }
}
.adm-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
/* Alerts */
.adm-alert {
  background: rgba(255, 255, 255, 0.04);
}
.adm-alert.sev-critical {
  border-color: rgba(244, 63, 94, 0.45);
}
.adm-alert.sev-error {
  border-color: rgba(244, 63, 94, 0.3);
}
.adm-alert.sev-warn {
  border-color: rgba(250, 204, 21, 0.35);
}
.adm-alert.sev-info {
  border-color: rgba(56, 189, 248, 0.3);
}
.adm-alert-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}
/* Commands */
.adm-cmd-feed {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.06);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.adm-cmd-ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}
.adm-cmd-ico.running,
.adm-cmd-ico.queued,
.adm-cmd-ico.sent {
  background: rgba(250, 204, 21, 0.2);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.adm-trace {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 0;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.adm-trace-step {
  color: var(--text-dim);
}
.adm-trace-step.ok {
  color: #86efac;
}
.adm-trace-step.run {
  color: #fde68a;
}
.adm-trace-step.fail {
  color: #fda4af;
}
/* Health */
.adm-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.adm-health-dot.operational {
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}
.adm-health-dot.degraded {
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
}
.adm-health-dot.offline {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}
/* Files */
.adm-file-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.adm-file-ico + b {
  margin-left: 8px;
}
/* Chip status variants */
.chip-status.ok {
  color: #86efac;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.chip-status.warn {
  color: #fde68a;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.4);
}
.chip-status.info {
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.chip-status.err {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
}
.chip-status.neutral {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
}
/* Platform dashboard: clickable stat cards (filter shortcuts). */
.stat-click { transition: transform .12s ease, border-color .12s ease; }
.stat-click:hover { transform: translateY(-2px); border-color: var(--purple); }
.stat-active { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); }

/* ==================================================================
   Phone layout ("device mode") — admin app shell, download page and
   the Platform (super-admin) page. Appended last so these rules win
   over the base styles above without touching any markup.
   ================================================================== */
@media (max-width: 600px) {
  /* ---- App top bar: full-width, with a swipeable pill strip ---- */
  .topnav {
    top: 0;
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 10px 12px;
    gap: 8px;
  }
  .topnav .brand { font-size: 1rem; gap: 8px; }
  .topnav .brand .logo { width: 30px; height: 30px; font-size: 1rem; }

  /* Pills stay on one line and scroll sideways (swipe) so every tab
     is reachable; the bar drops to its own full-width row. */
  .navtabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .navtabs::-webkit-scrollbar { display: none; }
  .navtab { flex: 0 0 auto; padding: 8px 14px; font-size: 0.86rem; }

  .topnav-user { margin-left: auto; gap: 6px; }
  .topnav-user .account-link #showUser { display: none; } /* keep the avatar, drop the name */
  #logoutBtn { padding: 8px 12px; font-size: 0.85rem; }

  /* ---- Page gutters & cards ---- */
  .wrap { width: 100%; padding: 0 12px; }
  .content { padding: 18px 14px; }
  .content-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .content-head h2 { font-size: 1.35rem; }
  .content-actions { width: 100%; }

  /* ---- Content toolbar: stack and go full width ---- */
  .content-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar-left { width: 100%; }
  .toolbar-left .btn { flex: 1; }
  .toolbar-right { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar-right .select { width: 100%; }
  .toolbar-right .search-wrap,
  .toolbar-right .search-short { grid-column: 1 / -1; flex: 1 1 auto; min-width: 0; width: 100%; }

  /* ---- Overview + Platform dashboard card grids ---- */
  .overview-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0; }
  .stat-wide { grid-column: 1 / -1; }
  .stat-value { font-size: 1.6rem; }

  /* ---- Account page ---- */
  .account-grid { grid-template-columns: 1fr; gap: 14px; padding: 0; margin-top: 16px; }
  .account-card { padding: 22px; }

  /* ---- Admin + Platform: stack and let sub-tabs scroll ---- */
  .adm-grid { grid-template-columns: 1fr; }
  .adm-crumb { flex-wrap: wrap; }
  .grp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .grp-tabs::-webkit-scrollbar { display: none; }
  .grp-tab { flex: 0 0 auto; white-space: nowrap; }

  /* Wide data tables keep their horizontal scroll (.table-wrap); just
     make the swipe feel intentional on a phone. */
  .table-wrap { scrollbar-width: thin; }

  /* ---- Download / login split card ---- */
  .auth-shell { padding: 16px 12px; }
  .auth-card, .auth-info { padding: 22px 18px; }

  /* ---- Footer ---- */
  .footer { padding: 18px 12px; font-size: 0.8rem; text-align: center; }
}

/* Platform: per-user lockout help (reset password / disable 2FA) */
.user-help-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.temp-pass {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 10px 0 2px;
}
.temp-pass code {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid var(--glass-border);
  color: var(--text-bright, var(--text));
  user-select: all;
}

/* Alert/user/command cards: on narrow screens stack the three sections (info /
   pills / actions) so the space-between row can't overflow into overlap. */
@media (max-width: 720px) {
  .adm-alert,
  .user-row,
  .adm-cmd {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .adm-alert .user-tags,
  .user-row .user-tags,
  .adm-cmd .user-tags {
    justify-content: flex-start;
  }
  .user-row .user-when {
    text-align: left;
  }
  .adm-alert .confirm-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .adm-alert .confirm-actions .btn {
    flex: 1 1 auto;
  }
}
