/* ============================================================================
   HMP / Nebula – Global Styles
   Clean rebuild (keeps your existing design language, removes conflicting overrides)
============================================================================ */

:root {
  --bg: #070a12;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --stroke: rgba(255,255,255,0.12);
  --glow: rgba(120, 170, 255, 0.25);
  --max: 1100px;
  --radius: 14px;

  --shadow-1: 0 0 0 1px rgba(255,255,255,0.02) inset;
  --shadow-2: 0 14px 30px rgba(0,0,0,0.35);

  --gap-1: 8px;
  --gap-2: 10px;
  --gap-3: 12px;
  --gap-4: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Fixed glow layer so it never repeats / bands */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 20% 0%, rgba(120,170,255,0.18), transparent 60%),
    radial-gradient(900px 650px at 80% 20%, rgba(200,120,255,0.12), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(120,255,200,0.06), transparent 60%);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 60px;
}

/* ============================================================================
   Topbar / Nav
============================================================================ */

.topbar {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(7,10,18,0.65);
  border-bottom: 1px solid var(--stroke);
  z-index: 50;
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(120,170,255,0.9);
  box-shadow: 0 0 18px var(--glow);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  padding: 9px 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: rgba(255,255,255,0.75);
  border-radius: 999px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.nav-left { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.nav-right { margin-left:auto; display:flex; align-items:center; gap:10px; }

.nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
}

.nav a.active {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255,255,255,0.08);
}

.nav-user {
  color: var(--muted);
  padding: 8px 6px;
  font-size: 13px;
}

.logout-form { display: inline; }

/* Mobile nav dropdown */
@media (max-width: 760px) {
  .topbar-inner { gap: 10px; position: relative; }
  .nav-toggle { display: inline-flex; align-items:center; justify-content:center; }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 58px;
    margin: 0;
    padding: 12px 14px;
    background: rgba(7,10,18,0.95);
    border-bottom: 1px solid var(--stroke);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    z-index: 60;
  }

  .nav.open { display: flex; }

  .nav-left, .nav-right {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .nav a { width: 100%; text-align: left; border-radius: 12px; padding: 10px 12px; }
  .logout-form { width: 100%; }
  .logout-form button { width: 100%; }
}

/* ============================================================================
   Typography / Layout
============================================================================ */

.hero { padding: 28px 0 10px; }
.h1 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  margin: 0 0 10px;
}
.p { margin: 0; color: var(--muted); max-width: 70ch; }

.grid {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

@media (max-width: 860px) {
  .span-3, .span-4, .span-5, .span-6, .span-7 { grid-column: span 12; }
}

/* ============================================================================
   Cards / Buttons / Forms
============================================================================ */

.card {
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}

.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.btn:hover { background: rgba(255,255,255,0.14); }

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
}

.btn.secondary:hover { background: rgba(255,255,255,0.08); }

.btn-nav {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
}
.btn-nav:hover { background: rgba(255,255,255,0.14); }

.form { display: grid; gap: 10px; max-width: 420px; }

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
}

.small { color: var(--muted); font-size: 13px; }

hr.sep {
  border: none;
  border-top: 1px solid var(--stroke);
  margin: 12px 0;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0;
  border: 1px solid var(--stroke);
}
.notice.ok { background: rgba(80, 200, 120, 0.12); }
.notice.err { background: rgba(220, 80, 80, 0.12); }

.mono {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

/* Spacing helpers (use gaps, not margins on buttons) */
.row-between { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.pill { padding:6px 10px; border-radius:999px; border:1px solid var(--stroke); background:rgba(255,255,255,0.06); font-size:12px; }
.clickable { cursor: pointer; }

/* Progress bar used on dashboard */
.bar-wrap {
  width:100%;
  height:10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,0.04);
  overflow:hidden;
}
.bar {
  height:100%;
  border-radius:999px;
  background:rgba(120,170,255,0.35);
}

/* ============================================================================
   Admin / Server cards (kept)
============================================================================ */

.admin-topbar { display:flex; gap:10px; margin: 12px 0 20px 0; flex-wrap: wrap; }

.admin-card {
  text-decoration: none;
  color: inherit;
  padding: 22px;
  border-radius: 18px;
}

.admin-metric {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  margin: 6px 0 14px 0;
}

.admin-cta { margin-top: 18px; font-weight: 800; opacity: 0.9; }

.server-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.server-card {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(0,0,0,0.25);
}

.status-dot { width:10px; height:10px; border-radius:999px; border:1px solid var(--stroke); }
.status-dot.on { background:rgba(90, 220, 140, 0.7); }
.status-dot.off { background:rgba(220, 90, 90, 0.65); }

/* ============================================================================
   Nebula Cloud – New UI (menus + modals + list layout)
   Works with your cloud.ejs classes:
   .cloudTop, .cloudTitle, .cloudPlusWrap, .cloudMiniMenu, .cloudRow, etc.
============================================================================ */

.cloudTop { display:flex; flex-direction:column; gap:12px; }

.cloudTitle {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

/* Plus button wrapper */
.cloudPlusWrap { position:relative; }

/* Icon buttons */
.cloudIconBtn{
  width:42px; height:42px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 900;
  font-size: 22px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.cloudIconBtn:hover{ background: rgba(255,255,255,0.12); }

/* Smaller icon-only button (pause/play/cancel, etc.) */
.cloudIconBtnSm{
  width:36px; height:34px;
  border-radius:10px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0;
}
.cloudIconBtnSm:hover{ background: rgba(255,255,255,0.10); }

/* Breadcrumbs */
.cloudCrumbs { display:flex; flex-direction:column; gap:6px; }
.cloudCrumbLabel { color: var(--muted); font-size: 13px; }
.cloudCrumbRow { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.cloudCrumb{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-weight: 800;
}
.cloudCrumb:hover{ background: rgba(255,255,255,0.10); text-decoration:none; }
.cloudCrumbSep{ color: var(--muted); }

/* Quota pills */
.cloudQuotaRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 8px;
}
.cloudPill{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 170px;
}
.cloudPillTop{ font-size:12px; color: var(--muted); margin-bottom:4px; }
.cloudPillBig{ font-size:18px; font-weight: 900; letter-spacing:0.2px; }
.cloudPillSmall{ min-width: 120px; }

/* Files header row */
.cloudHeadRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

/* ============================================================================
   Dropdown menus (Plus menu + 3-dot menu)
   IMPORTANT: hidden by default — JS toggles .open on parent or .show on menu
============================================================================ */

.cloudMiniMenu{
  display: none;
  position:absolute;
  right:0;
  top:48px;

  min-width: 190px;
  padding: 10px;

  border:1px solid var(--stroke);
  background: rgba(7,10,18,0.92);
  backdrop-filter: blur(10px);
  border-radius: 12px;

  box-shadow: var(--shadow-2);
  z-index: 200;

  flex-direction:column;
  gap: 8px;
}

/* show conditions */
.cloudPlusWrap.open .cloudMiniMenu,
.cloudDots.open .cloudMiniMenu,
.cloudMiniMenu.show{
  display:flex;
}

.cloudMenuItem,
.cloudMenuLink{
  width: 100%;
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 10px;

  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.06);
  color: var(--text);

  font-weight: 800;
  font-size: 13px;
  cursor:pointer;
  text-decoration:none;
}

.cloudMenuItem:hover,
.cloudMenuLink:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.10);
}

.cloudMenuItem.danger{
  background: rgba(220,80,80,0.14);
  border-color: rgba(220,80,80,0.45);
}
.cloudMenuItem.danger:hover{
  background: rgba(220,80,80,0.22);
}

/* ============================================================================
   Multi-select action bar (hidden unless .show)
============================================================================ */

.cloudSelectBar{
  display: none;
  margin-top: 10px;

  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 10px 12px;

  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cloudSelectBar.show{ display:flex; }

.cloudSelectLeft{ color: var(--muted); font-size: 13px; }

.cloudSelectActions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.cloudSelectActions button{
  width: 42px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  font-size: 16px;
}
.cloudSelectActions button:hover{ background: rgba(255,255,255,0.10); }

.cloudSelectActions button.danger{
  background: rgba(220,80,80,0.14);
  border-color: rgba(220,80,80,0.45);
}
.cloudSelectActions button.danger:hover{
  background: rgba(220,80,80,0.22);
}

/* ============================================================================
   File list + rows (FIXED LAYOUT)
   checkbox | icon+name | size | dots
============================================================================ */

.cloudList{ margin-top: 12px; display:flex; flex-direction:column; gap:8px; }

.cloudRow{
  display:grid;
  grid-template-columns: 34px 1fr 140px 44px;
  gap: 12px;
  align-items:center;

  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.03);
}
.cloudRow:hover{ background: rgba(255,255,255,0.06); }

.cloudRow.isSelected{
  background: rgba(120,170,255,0.10);
  border-color: rgba(120,170,255,0.35);
}

/* Bigger themed checkbox */
.cloudCheck{
  appearance: none;
  -webkit-appearance: none;

  width: 22px;
  height: 22px;
  border-radius: 7px;

  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  cursor: pointer;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
}
.cloudCheck:hover{ background: rgba(255,255,255,0.08); }

.cloudCheck:checked{
  background: rgba(120,170,255,0.35);
  border-color: rgba(120,170,255,0.75);
  box-shadow: 0 0 0 3px rgba(120,170,255,0.12);
}
.cloudCheck:checked::after{
  content: "✓";
  font-size: 14px;
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  line-height: 1;
}

.cloudLeft{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  justify-content:flex-start;
}

.cloudIcon{
  width:32px; height:32px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  user-select:none;
}

.cloudNameLink{
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.cloudNameLink:hover{ text-decoration: none; }

.cloudSize{
  justify-self: end;
  text-align:right;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.cloudDots{
  justify-self: end;
  position:relative;
  display:flex;
  justify-content:flex-end;
}

.cloudDotsBtn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  font-size: 18px;

  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.cloudDotsBtn:hover{ background: rgba(255,255,255,0.10); }

/* Mobile: hide size column, keep dots on far right */
@media (max-width: 560px){
  .cloudRow{ grid-template-columns: 34px 1fr 44px; }
  .cloudSize{ display:none; }
}

/* ============================================================================
   Modals (rename/new folder/move/preview)
============================================================================ */

.cloudModal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
}

.cloudModalCard{
  width: 100%;
  max-width: 520px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(7,10,18,0.92);
  box-shadow: 0 22px 50px rgba(0,0,0,0.55);
  padding: 16px;
  position:relative;
}

.cloudModalCardWide{ max-width: 860px; }

.cloudModalCardFullscreen{
  max-width: 1100px;
  height: min(86vh, 900px);
  display:flex;
  flex-direction:column;
}

.cloudModalClose{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  font-weight: 900;

  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.cloudModalClose:hover{ background: rgba(255,255,255,0.10); }

.cloudModalForm{ display:flex; flex-direction:column; gap:10px; margin-top: 8px; }
.cloudModalBtns{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

/* Move browser */
.cloudMoveWrap{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}
@media (max-width: 860px){
  .cloudMoveWrap{ grid-template-columns: 1fr; }
}

.cloudMoveBrowser{
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  padding: 12px;
}
.cloudMoveTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cloudMoveList{
  display:flex;
  flex-direction:column;
  gap: 8px;
  max-height: 340px;
  overflow:auto;
}

.cloudMoveItem{
  width:100%;
  text-align:left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor:pointer;
  font-weight: 900;
}
.cloudMoveItem:hover{ background: rgba(255,255,255,0.10); }

.cloudMoveDest{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* Preview fullscreen */
.cloudPreviewHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.cloudPreviewFrame{
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow:hidden;
  background: rgba(0,0,0,0.25);

  display:flex;
  align-items:center;
  justify-content:center;
}

/* iframe fills */
.cloudPreviewFrame iframe{
  width:100%;
  height:100%;
  border:none;
}

/* image fits (no zoomed-in crop) */
.cloudPreviewFrame img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display:block;
}

/* Video should fit like images */
.cloudPreviewFrame video{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display:block;
  background: rgba(0,0,0,0.15);
}

/* Preview header layout: title left, nav arrows center/right */
.cloudPreviewHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.cloudPreviewNav{
  display:flex;
  align-items:center;
  gap: 10px;
}

.cloudPreviewNav .cloudIconBtnSm[disabled]{
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================================
   Floating Upload Progress (bottom-right)
============================================================================ */

.cloudFloatUpload{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  z-index: 9999;

  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  padding: 12px;

  display:flex;
  flex-direction:column;
  gap: 10px;
}

.cloudFloatTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.cloudFloatTitle{ font-weight: 900; letter-spacing: 0.2px; }

.cloudFloatControls{
  display:flex;
  align-items:center;
  gap: 10px;
}

.cloudFloatBarWrap{
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  overflow:hidden;
}

.cloudFloatBar{
  height: 100%;
  border-radius: 999px;
  background: rgba(120,170,255,0.40);
  width: 0%;
}

.cloudFloatMeta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================================
   IMPORTANT: No global "button margin" hacks.
   Use flex gaps on containers instead.
============================================================================ */

/* Common button groups */
.cloudModalBtns,
.cloudSelectActions,
.cloudFloatControls,
.admin-topbar {
  gap: 10px;
}

/* =========================
   Preview header layout fix
========================= */

/* Preview header container */
.cloudPreviewHead {
  position: relative;
  padding-right: 88px; /* reserve space for close button */
}

/* Close (X) button — smaller + higher priority */
.cloudModalClose {
  width: 34px;
  height: 34px;
  font-size: 16px;
  top: 10px;
  right: 10px;
  z-index: 5;
}

/* Arrow buttons */
#previewPrev,
#previewNext {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

#previewPrev:hover,
#previewNext:hover {
  background: rgba(255,255,255,0.14);
}

#previewPrev:disabled,
#previewNext:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Nudge preview arrows upward */
#previewNav {
  top: -7px;   /* was 10px — adjust to taste (4–8px works well) */
}

/* Drag & drop overlay */
.cloudDropOverlay{
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
}
.cloudDropCard{
  width: 100%;
  max-width: 520px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.28);
  background: rgba(7,10,18,0.92);
  box-shadow: 0 22px 50px rgba(0,0,0,0.55);
  padding: 22px;
  text-align:center;
}
.cloudDropTitle{
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.cloudDropSub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* ============================
   CLOUD MENU FIX PACK
   Put at VERY bottom of styles.css
============================ */

/* 1) Ensure wrappers establish positioning */
.cloudPlusWrap,
.cloudDots {
  position: relative;
}

/* 2) Force menus to start hidden (JS toggles display) */
.cloudMiniMenu,
.cloudFileMenu {
  display: none;
}

/* 3) Make sure menus can appear ABOVE everything */
.cloudMiniMenu,
.cloudFileMenu {
  position: absolute;
  z-index: 99999;          /* beats most site layers */
  pointer-events: auto;    /* clickable */
}

/* 4) Common clipping culprit: overflow hidden somewhere above */
.card,
.cloudRow,
.cloudList,
.cloudDots,
.cloudPlusWrap {
  overflow: visible !important;
}

/* 5) Put file menu anchored to dots button */
.cloudDots .cloudFileMenu {
  right: 0;
  top: 48px; /* below the dots button */
  min-width: 180px;
}

/* Put plus menu anchored to plus button */
.cloudPlusWrap .cloudMiniMenu {
  right: 0;
  top: 48px;
  min-width: 180px;
}

/* 6) If you have any overlay/backdrop effect accidentally covering clicks */
.cloudModal {
  z-index: 100000; /* modal should still beat menus */
}

/* 7) Make menu items never touch (spacing) */
.cloudMiniMenu {
  display: none; /* stays hidden until JS opens it */
  padding: 8px;
  gap: 8px;
}

.cloudMiniMenu .cloudMenuItem,
.cloudMiniMenu .cloudMenuLink,
.cloudFileMenu .cloudMenuItem,
.cloudFileMenu .cloudMenuLink {
  display: block;
  width: 100%;
  margin: 0 0 8px 0;  /* spacing between items */
}

.cloudMiniMenu .cloudMenuItem:last-child,
.cloudMiniMenu .cloudMenuLink:last-child,
.cloudFileMenu .cloudMenuItem:last-child,
.cloudFileMenu .cloudMenuLink:last-child {
  margin-bottom: 0;
}


/* Preview top-right controls: arrows + close X */
.cloudPreviewTopControls{
  display:flex;
  align-items:center;
  gap:8px;
}

/* For preview only: don't absolutely position this X */
.cloudPreviewTopControls .cloudModalClose{
  position: static;
  top: auto;
  right: auto;
  width: 32px;
  height: 32px;
}

/* Make the fullscreen preview card a bit smaller */
.cloudModalCardFullscreen{
  max-width: 950px;          /* was 1100px */
  height: min(80vh, 720px);  /* was min(86vh, 900px) */
  display:flex;
  flex-direction:column;
}

/* Cloud capacity bar – make it visible and sit under the pills */
.cloudTop .bar-wrap{
  display:block;
  margin-top:8px;
  width:100%;
  height:12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.06);
  overflow:hidden;
  position:relative;
  z-index:1;
}

.cloudTop .bar{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(120,170,255,0.9), rgba(125,243,255,0.9));
}

/* ===========================
   Cloud – storage summary bar
=========================== */

.cloudSummary{
  margin-top: 10px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.cloudSummaryLeft{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.cloudSummaryNums{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:13px;
}

.cloudSummaryNums span:first-child{
  font-size:18px;
  font-weight:900;
}

.cloudSummaryBarWrap{
  flex:1;
  max-width:260px;
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:flex-end;
}

.cloudSummaryBar{
  width:100%;
  height:10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.06);
  overflow:hidden;
  position:relative;
}

.cloudSummaryFill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(120,170,255,0.9), rgba(125,243,255,0.9));
}

.cloudSummaryPct{
  color:var(--muted);
  font-size:12px;
}

/* ===========================
   Cloud – storage summary bar
=========================== */

.cloudSummary{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:stretch;      /* <- force full width / left alignment */
}

/* full-width bar */
.cloudSummaryBar{
  width:100%;
  height:10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.06);
  overflow:hidden;
  position:relative;
}

.cloudSummaryFill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(120,170,255,0.9), rgba(125,243,255,0.9));
}

/* labels row under the bar */
.cloudSummaryLabels{
  width:100%;                          /* <- span full width under bar */
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  color:var(--muted);
}

.cloudSummaryLabel{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.cloudSummaryLabelLeft{
  text-align:left;
}

.cloudSummaryLabelCenter{
  text-align:center;
  flex:0 0 auto;
  margin:0 auto;
}

.cloudSummaryLabelRight{
  text-align:right;
}

.cloudSummaryLabelTitle{
  opacity:0.75;
}

.cloudSummaryLabelValue{
  font-weight:700;
  color:var(--text);
}

/* ============================================================================
   Cloud preview modal layout (arrows left of X, centered frame)
============================================================================ */

.cloudModalCardFullscreen{
  max-width: 950px;
  height: min(80vh, 720px);
  display:flex;
  flex-direction:column;
}

.cloudPreviewHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.cloudPreviewTopControls{
  display:flex;
  align-items:center;
  gap:8px;
}

/* arrows next to X */
.cloudPreviewNav{
  display:flex;
  align-items:center;
  gap:8px;
}

.cloudPreviewNav .cloudIconBtnSm[disabled]{
  opacity:0.4;
  cursor:not-allowed;
}

/* X button: inline, not absolutely positioned */
.cloudPreviewTopControls .cloudModalClose{
  position:static;
  top:auto;
  right:auto;
  width:32px;
  height:32px;
}

/* frame area */
.cloudPreviewFrame{
  flex:1;
  min-height:0;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:rgba(0,0,0,0.25);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* anything inside the frame (img/video/iframe) */
.cloudPreviewFrame img,
.cloudPreviewFrame video,
.cloudPreviewFrame iframe{
  max-width:100%;
  max-height:100%;
  width:100%;
  height:100%;
  object-fit:contain;
  background:#000;
}

/* =========================
   Login centering
========================= */

.login-center{
  min-height: 25vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.login-card{
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
} 
