/* =========================================================
   XERIA - style.css
   Design language: a dark editing-suite workbench.
   Amber = "tally light" (primary actions, record/active state)
   Teal  = "scope trace" (secondary accents, code/tech)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  /* --- Color tokens --- */
  --void:      #0E1116;
  --panel:     #161B22;
  --panel-2:   #1D2430;
  --panel-3:   #232B38;
  --line:      #2A3240;
  --line-soft: #1E2530;
  --ink:       #ECEEF1;
  --mist:      #8B93A1;
  --mist-dim:  #626B79;
  --amber:     #FFB454;
  --amber-dim: #B8843E;
  --teal:      #4FD1C5;
  --teal-dim:  #2F8A81;
  --danger:    #FF6B6B;
  --success:   #6EE7A8;
  --border-light: #565d68;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grad-btn: linear-gradient(120deg, #7C5CFF, #3AD6E0);
  --violet: #7C5CFF;
  --cyan: #3AD6E0;
  --pink: #FF5FA2;

  /* --- Type --- */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* --- Layout --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --sidebar-w: 220px;
  --topbar-h: 60px;
  --shadow-panel: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-float: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 60px rgba(124,92,255,0.25);
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 .5em 0;
  letter-spacing: -0.01em;
}
p{ margin: 0 0 1em 0; color: var(--mist); }
a{ color: var(--teal); text-decoration: none; transition: color .12s ease; }
a:hover{ color: #6fe9dd; }
button{ font-family: var(--font-body); }
ul{ list-style: none; margin: 0; padding: 0; }
img,svg{ display:block; max-width:100%; }
img[src="assets/logo.svg"] {
  display: block;
  max-width: 100%;
  border: 2px solid var(--border-light);
  border-radius: 8px;
}
input, textarea, select{
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus{
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(79,209,197,0.15);
}
:focus-visible{ outline: 2px solid var(--teal); outline-offset: 2px; }
.hidden{ display: none !important; }
.mono{ font-family: var(--font-mono); }
.ml-auto{ margin-left: auto; }

/* scrollbars */
::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-track{ background: var(--panel); }
::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover{ background: var(--mist-dim); }

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover{ border-color: var(--mist-dim); transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn-primary{
  background: var(--amber);
  border-color: var(--amber);
  color: #1A1204;
  font-weight: 600;
}
.btn-primary:hover{ background: #ffc471; border-color: #ffc471; }
.btn-ghost{ background: transparent; border-color: transparent; color: var(--mist); }
.btn-ghost:hover{ color: var(--ink); border-color: var(--line); }
.btn-danger{ color: var(--danger); border-color: rgba(255,107,107,0.35); background: rgba(255,107,107,0.08); }
.btn-danger:hover{ border-color: var(--danger); background: rgba(255,107,107,0.15); }
.btn-block{ width: 100%; }
.btn[disabled]{ opacity: .5; cursor: not-allowed; transform: none; }
.btn.active{ background: var(--teal); border-color: var(--teal); color: var(--void); }
.btn.active:hover{ background: var(--teal); border-color: var(--teal); }
.icon-btn{
  width: 34px; height: 34px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--mist); cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.icon-btn:hover{ color: var(--ink); border-color: var(--mist-dim); }
.icon-btn:disabled{ opacity:.4; cursor:not-allowed; }
.icon-btn.active{ color: var(--void); background: var(--teal); border-color: var(--teal); }

/* =========================================================
   Top navigation (landing)
   ========================================================= */
.landing-nav{
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(14,17,22,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.brand{ display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand img{ width: 34px; height: 34px; }
.brand-word{ font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); }
.brand-word .xyz{ color: var(--mist-dim); font-weight: 500; }
.landing-nav .nav-actions{ display: flex; gap: 10px; }

/* =========================================================
   Hero — NLE window mock
   ========================================================= */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-eyebrow{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--teal);
  border: 1px solid var(--teal-dim); background: rgba(79,209,197,0.07);
  padding: 5px 10px; border-radius: 999px; width: fit-content;
}
.hero-eyebrow .dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--amber); animation: blink 1.6s infinite; }
@keyframes blink{ 0%,100%{opacity:1;} 50%{opacity:.25;} }

.hero h1{
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.04;
  max-width: 820px;
}
.hero h1 .accent{ color: var(--amber); }
.hero-sub {
  font-size: clamp(16px, 2vw, 18px); /* Adjust values as needed */
  max-width: 560px;
  line-height: 1.5; /* Optional: Improve readability */
}
.hero-actions{ display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.hero-note{ font-size: 0.85rem; color: var(--mist-dim); margin-top: 10px;}

.nle-window{
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.nle-titlebar{
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.nle-titlebar .dots{ display: flex; gap: 6px; margin-right: 8px; }
.nle-titlebar .dots span{ width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.nle-tabs{ display: flex; gap: 4px; }
.nle-tab{
  font-family: var(--font-mono); font-size: 12.5px; color: var(--mist);
  padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent;
}
.nle-tab:hover{ color: var(--ink); }
.nle-tab.active{ background: var(--panel-3); color: var(--amber); border-color: var(--line); }
.nle-body{ padding: 22px; min-height: 220px; }
.nle-pane{ display: none; }
.nle-pane.active{ display: block; }

.mock-canvas{
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 30% 20%, rgba(79,209,197,0.12), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(255,180,84,0.10), transparent 55%),
    var(--void);
  height: 170px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.mock-canvas .play-glyph{
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,180,84,0.12); border: 1px solid var(--amber-dim);
  display: flex; align-items: center; justify-content: center;
}
.mock-canvas .play-glyph::after{
  content:''; width: 0; height: 0;
  border-top: 10px solid transparent; border-bottom: 10px solid transparent;
  border-left: 16px solid var(--amber); margin-left: 4px;
}

.swatch-row{ display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.swatch{ width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--line); }

.code-mock{
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  background: var(--void); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px; color: var(--mist);
}
.code-mock .k{ color: var(--teal); }
.code-mock .s{ color: var(--amber); }
.code-mock .c{ color: var(--mist-dim); }

.track-strip{ margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.track-row{
  display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px;
}
.track-label{
  font-family: var(--font-mono); font-size: 11px; color: var(--mist-dim);
  text-transform: uppercase; letter-spacing: .04em; text-align: right;
}
.track-lane{
  position: relative; height: 26px; border-radius: 5px;
  background: var(--void); border: 1px solid var(--line-soft); overflow: hidden;
}
.track-lane .fill{ position: absolute; top:0; bottom:0; left:0; border-radius: 5px; }
.track-lane.video .fill{ background: repeating-linear-gradient(90deg, var(--teal) 0 3px, transparent 3px 7px); opacity:.55; width: 78%; }
.track-lane.image .fill{ background: linear-gradient(90deg, var(--amber), var(--teal)); opacity: .45; width: 55%; }
.track-lane.code .fill{ background: var(--teal); opacity: .35; width: 92%; }
.track-lane.cloud .fill{ background: var(--amber); opacity: .5; width: 18%; }
.playhead{
  position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--amber);
  left: 22%; box-shadow: 0 0 8px rgba(255,180,84,0.7);
  animation: scrub 5s ease-in-out infinite;
}
@keyframes scrub{ 0%,100%{ left: 4%; } 50%{ left: 90%; } }

/* ---- hero visual: stacked editor windows ---- */
.hero-content {
  flex: 1;
  max-width: 50%;
}

.hero-visual {
  flex: 1;
  height: 460px;
  position: relative;
}
.stack{
  position: absolute;
  inset: 0;
}
.win{
  position: absolute;
  width: 340px;
  border-radius: 16px;
  background: #14172A;
  border: 1px solid rgba(244,242,255,0.16);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  overflow: hidden;
}
.win-bar{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #191c33;
  border-bottom: 1px solid rgba(244,242,255,0.09);
}
.win-bar span{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(244,242,255,0.16);
}
.win-bar span:nth-child(1){ background: #FF5F56; }
.win-bar span:nth-child(2){ background: #FFBD2E; }
.win-bar span:nth-child(3){ background: #27C93F; }
.win-bar p{
  margin: 0 0 0 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: rgba(244,242,255,0.44);
}

.win-code{
  top: 10px; left: 0;
  z-index: 3;
  animation: drift-a 9s ease-in-out infinite;
}
.win-code-body{
  margin: 0;
  padding: 16px 18px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(244,242,255,0.68);
  white-space: pre;
}
.tok-kw{ color: #FF5FA2; }
.tok-fn{ color: #3AD6E0; }
.tok-str{ color: #FFB347; }

.win-image{
  top: 150px; left: 120px;
  z-index: 2;
  width: 260px;
  animation: drift-b 10s ease-in-out infinite;
}
.win-image-body{
  position: relative;
  height: 150px;
  background:
    linear-gradient(135deg, rgba(255,95,162,0.35), rgba(255,179,71,0.25)),
    repeating-conic-gradient(rgba(244,242,255,0.05) 0% 25%, transparent 0% 50%) 0 0/16px 16px;
}
.crop-frame{
  position: absolute;
  inset: 20px 34px;
  border: 1.5px dashed rgba(244,242,255,0.5);
  border-radius: 6px;
}
.layer-chip{
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(11,12,20,0.75);
  border: 1px solid rgba(244,242,255,0.16);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(244,242,255,0.68);
}

.win-video{
  top: 300px; left: 10px;
  z-index: 1;
  width: 300px;
  animation: drift-c 11s ease-in-out infinite;
}
.win-video-body{
  position: relative;
  padding: 16px 16px 18px;
  background: #101220;
}
.track{
  height: 14px;
  border-radius: 5px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(124,92,255,0.55), rgba(58,214,224,0.35));
}
.track-2{ width: 78%; background: linear-gradient(90deg, rgba(255,95,162,0.55), rgba(255,179,71,0.3)); }
.track-3{ width: 55%; background: linear-gradient(90deg, rgba(58,214,224,0.5), rgba(124,92,255,0.3)); }
.playhead{
  position: absolute;
  top: 8px; bottom: 8px; left: 96px;
  width: 2px;
  background: #3AD6E0;
  box-shadow: 0 0 8px #3AD6E0;
}

.cursor{
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  animation: cursor-blink 3.4s ease-in-out infinite;
}
.cursor-dot{
  width: 9px; height: 9px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  display: inline-block;
}
.cursor-tag{
  background: #14172A;
  border: 1px solid rgba(244,242,255,0.16);
  padding: 2px 8px;
  border-radius: 6px;
  color: rgba(244,242,255,0.68);
}
.cursor-a{ top: 46px; right: 18px; }
.cursor-a .cursor-dot{ background: #3AD6E0; }
.cursor-b{ bottom: 14px; right: 20px; animation-delay: 0.6s; }
.cursor-b .cursor-dot{ background: #FF5FA2; }
.cursor-c{ top: 18px; right: 16px; animation-delay: 1.2s; }
.cursor-c .cursor-dot{ background: #FFB347; }

.glow{
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  opacity: 0.55;
}
.glow-a{
  width: 260px; height: 260px;
  background: #7C5CFF;
  top: -20px; right: -40px;
}
.glow-b{
  width: 220px; height: 220px;
  background: #FF5FA2;
  bottom: -20px; left: -20px;
}


/* =========================================================
   Feature "tracks" section
   ========================================================= */
.section{ max-width: 1180px; margin: 0 auto; padding: 64px 32px; }
.section-head{ margin-bottom: 32px; max-width: 620px; }
.section-head .eyebrow{ font-family: var(--font-mono); font-size: 12px; color: var(--amber); text-transform: uppercase; letter-spacing: .08em; }

.track-cards{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.track-card{
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px; position: relative; transition: border-color .15s ease, transform .12s ease;
}
.track-card:hover{ border-color: var(--mist-dim); transform: translateY(-2px); }
.track-card .tnum{ font-family: var(--font-mono); font-size: 12px; color: var(--mist-dim); }
.track-card h3{ font-size: 17px; margin: 10px 0 6px; }
.track-card p{ font-size: 13.5px; margin: 0; }
.track-card .glyph{
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 16px;
}
.track-card.c1 .glyph{ background: rgba(79,209,197,0.12); color: var(--teal); }
.track-card.c2 .glyph{ background: rgba(255,180,84,0.12); color: var(--amber); }
.track-card.c3 .glyph{ background: rgba(110,231,168,0.12); color: var(--success); }
.track-card.c4 .glyph{ background: rgba(255, 84, 84, 0.12); color: var(--danger); }

.storage-cta{
  margin-top: 48px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
  padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.storage-cta .meter-demo{ width: 260px; }

.landing-footer{
  border-top: 1px solid var(--line-soft); padding: 28px 32px; text-align: center;
  color: var(--mist-dim); font-size: 13px;
}

/* =========================================================
   Price Cards
   ========================================================= */
.price-cards {
  display: grid;
  grid-template-columns: repeat(2, 50%);
  gap: 30px;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
}
.price-card{
  border-radius: 30px;
  padding: 22px;
  position: relative;
  transition: border-color .15s ease, transform .12s ease;
}
.price-card:hover{
transform: translateY(-2px);
}
.price-card h3{ font-size: 17px; margin: 10px 0 6px; }
.price-card p{ font-size: 13.5px; margin: 0; }
.price-card.c1{ 
background: var(--panel);
border: 1px solid var(--line);
background: var(--panel-3);
border: var(--mist-dim) solid 1px; 
}
.price-card.c2{
background: linear-gradient(160deg, rgba(124,92,255,0.14), rgba(58,214,224,0.06) 60%), var(--line-soft);
border: 1px solid rgba(124,92,255,0.5);
box-shadow: 0 0 0 1px rgba(124,92,255,0.15), var(--shadow-glow);
}
.price-card.c2:hover{
box-shadow: 0px 0px 5px 5px rgba(124,92,255,0.15), var(--shadow-glow);
}
.price-card .plan{ 
font-family: var(--font-mono);
font-size: 20px;
color: var(--ink);
}
.price-card .price-tag{ 
font-family: var(--font-display);
}

.price-tag .price-amount{ 
font-size: 2.6rem;
font-weight: 700;
letter-spacing: 0.02rem;
color: var(--ink);
}

.price-tag .price-period{ 
font-size: 1.1rem;
color: var(--mist-dim);
}

.price-features{ display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; flex-grow: 1; margin-top: 28px;}
.price-features li{
  font-size: 0.92rem;
  color: var(--mist);
  padding-left: 24px;
  position: relative;
}
.price-features {
  list-style: none;
  padding-left: 0;
  position: relative;
}

.price-features li {
  padding-left: 25px;
  position: relative;
  margin-bottom: 8px;
}

.price-features li.available::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(58, 214, 224, 0.16);
  box-shadow: inset 0 0 0 1px rgba(58, 214, 224, 0.4);
}

.price-features li.available::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: 4px;
  color: rgba(58, 214, 224, 1);
  font-size: 10px;
  font-weight: bold;
}

.price-features li.unavailable::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 80, 80, 0.16);
  box-shadow: inset 0 0 0 1px rgba(241, 116, 116, 0.4);
}

.price-features li.unavailable::after {
  content: "✗";
  position: absolute;
  left: 3px;
  top: 4px;
  color: rgb(250, 91, 91);
  font-size: 10px;
  font-weight: bold;
}


.btn1{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn1:active{ transform: scale(0.97); }

.btn1-solid{
  background: var(--grad-btn);
  color: #0B0C14;
  box-shadow: 0 8px 24px -8px rgba(124,92,255,0.55);
}
.btn1-solid:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(124,92,255,0.65);
}

.btn1-outline{
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--mist);
}
.btn1-outline:hover{
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
}
.btn1-outline svg{ transition: transform 0.25s var(--ease); }
.btn1-outline:hover svg{ transform: translateX(3px); }

.btn1-ghost{
  background: transparent;
  color: var(--mist-dim);
  padding: 10px 16px;
}
.btn1-ghost:hover{ color: var(--ink); }

.btn1-lg{ padding: 15px 28px; font-size: 1rem; }
.btn1-block{ width: 100%; }

/* =========================================================
   Auth modal
   ========================================================= */
.modal-backdrop{
  position: fixed; inset: 0; background: rgba(6,8,11,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 20px;
}
/* `hidden` attribute / .hidden class must win over display:flex */
.modal-backdrop[hidden],
.modal-backdrop.hidden{ display: none; }
.modal{
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel); padding: 28px;
}
.modal-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2{ margin: 0; font-size: 20px; }
.auth-tabs{ display: flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 18px; }
.auth-tab{ flex: 1; text-align: center; padding: 8px; border-radius: 5px; font-size: 13.5px; font-weight: 500; color: var(--mist); cursor: pointer; }
.auth-tab.active{ background: var(--panel-3); color: var(--ink); }
.field{ margin-bottom: 14px; }
.field label{ display: block; font-size: 12.5px; color: var(--mist); margin-bottom: 6px; }
.field input{ width: 100%; }
.field-hint{ font-size: 12px; color: var(--mist-dim); margin-top: 5px; }
.form-error{
  font-size: 13px; color: var(--danger); background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.25); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 14px; display: none;
}
.form-error.show{ display: block; }
.modal-foot{ text-align: center; font-size: 13px; color: var(--mist-dim); margin-top: 14px; }
.modal-foot a{ cursor: pointer; }

/* =========================================================
   App shell (post-login)
   ========================================================= */
.app-shell{ display: flex; min-height: 100vh; }
.sidebar{
  width: var(--sidebar-w); flex: none; background: var(--panel);
  border-right: 1px solid var(--line-soft); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand{ padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.sidebar-nav{ flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link{
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--mist); font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
}
.sidebar-link .glyph{ width: 18px; text-align: center; font-family: var(--font-mono); font-size: 13px; color: var(--mist-dim); }
.sidebar-link:hover{ background: var(--panel-2); color: var(--ink); }
.sidebar-link.active{ background: var(--panel-2); color: var(--ink); border-color: var(--line); }
.sidebar-link.active .glyph{ color: var(--amber); }
.sidebar-link[href="admin.php"].active .glyph {
    color: var(--danger);
}

.sidebar-storage{ padding: 14px 16px 18px; border-top: 1px solid var(--line-soft); }
.storage-label{ display: flex; justify-content: space-between; font-size: 11.5px; color: var(--mist-dim); margin-bottom: 6px; font-family: var(--font-mono); }
.meter{ height: 7px; border-radius: 4px; background: var(--panel-3); border: 1px solid var(--line-soft); overflow: hidden; }
.meter .meter-fill{ height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: 4px; transition: width .3s ease; }
.meter.warn .meter-fill{ background: var(--amber); }
.meter.full .meter-fill{ background: var(--danger); }

.main-area{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar{
  height: var(--topbar-h); flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: var(--void);
  position: sticky; top: 0; z-index: 20;
}
.topbar h2{ font-size: 16px; margin: 0; }
.topbar .crumb{ font-family: var(--font-mono); font-size: 12px; color: var(--mist-dim); }
.user-chip{ display: flex; align-items: center; gap: 10px; }
.user-avatar{
  width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--teal);
}
.view{ padding: 26px 28px; flex: 1; }
.view-pane{ display: none; }
.view-pane.active{ display: block; }

/* =========================================================
   Topbar notification bell + dropdown
   ========================================================= */
.notif-wrap{ position: relative; }
.notif-btn{ position: relative; color: var(--mist); }
.notif-btn:hover{ color: var(--ink); }
.notif-dot{
  position: absolute; top: 3px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); border: 1.5px solid var(--void);
  box-shadow: 0 0 6px rgba(255,180,84,0.8);
  animation: notif-pulse 1.8s ease-in-out infinite;
}
.notif-count{
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--amber); color: #1A1204;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--void);
}
@keyframes notif-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.5; } }

.notif-panel{
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  z-index: 60; overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh;
}
.notif-panel[hidden]{ display: none; }
.notif-panel-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.notif-panel-head strong{ font-size: 13px; }
.notif-list{ overflow-y: auto; }
.notif-empty{ padding: 28px 16px; text-align: center; color: var(--mist-dim); font-size: 13px; }
.notif-item{
  display: flex; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft); position: relative;
}
.notif-item:hover{ background: var(--panel-2); }
.notif-item:last-child{ border-bottom: none; }
.notif-avatar{
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--panel-3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--teal);
}
.notif-avatar.invite{ color: var(--amber); }
.notif-avatar.info{ color: var(--mist); }
.notif-body{ flex: 1; min-width: 0; }
.notif-text{ font-size: 13px; color: var(--ink); }
.notif-from{ font-size: 11.5px; color: var(--mist-dim); margin-top: 1px; }
.notif-time{ font-size: 11px; color: var(--mist-dim); font-family: var(--font-mono); margin-top: 3px; }
.notif-actions{ display: flex; gap: 6px; margin-top: 8px; }
.notif-dismiss{
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border: none; background: transparent;
  color: var(--mist-dim); cursor: pointer; font-size: 16px; line-height: 1;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
}
.notif-dismiss:hover{ color: var(--danger); background: var(--panel-3); }
.notif-footer{
  display: block; padding: 10px 14px; text-align: center;
  border-top: 1px solid var(--line); background: var(--panel-2);
  font-size: 12.5px; color: var(--teal); text-decoration: none;
}
.notif-footer:hover{ color: #6fe9dd; text-decoration: none; }

@media (max-width: 760px){
  .notif-panel{ right: -40px; width: 300px; }
}

/* =========================================================
   Account — friends section
   ========================================================= */
.friend-add-form{ border-bottom: 1px solid var(--line-soft); }
.friend-add-form label{ display:block; }
.friend-msg{ font-size:13px; margin:10px 0 0; padding:8px 12px; border-radius:var(--radius-sm); }
.friend-msg.ok{ color:var(--success); background:rgba(110,231,168,0.08); border:1px solid rgba(110,231,168,0.25); }
.friend-msg.err{ color:var(--danger); background:rgba(255,107,107,0.08); border:1px solid rgba(255,107,107,0.25); }

.friend-section-head{
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--mist-dim);
  padding: 14px 20px 8px; background: var(--panel-2);
  border-bottom: 1px solid var(--line-soft);
}
.friend-list{ }
.friend-row{
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--line-soft);
  transition: background .12s ease;
}
.friend-row:hover{ background: var(--panel-2); }
.friend-row:last-child{ border-bottom: none; }
.friend-avatar{
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--panel-3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; color: var(--teal);
}
.friend-info{ flex: 1; min-width: 0; }
.friend-name{ font-size: 14px; font-weight: 500; color: var(--ink); }
.friend-sub{ font-size: 11.5px; color: var(--mist-dim); margin-top: 2px; }
.friend-actions{ display: flex; gap: 8px; flex: none; }
.friend-row.outgoing .friend-name::after{
  content: 'pending'; display:inline-block; margin-left:8px;
  font-family: var(--font-mono); font-size:10px; text-transform:uppercase;
  color: var(--amber); background: rgba(255,180,84,0.12);
  padding: 1px 6px; border-radius: 4px; vertical-align: middle;
}
.friend-empty{ padding: 28px 20px; text-align: center; color: var(--mist-dim); font-size: 13px; }

/* Live search-as-you-type dropdown for "Add a friend" -- not covered
   by the sections above, added to match the same visual language. */
.friend-search-results{
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  max-height: 220px; overflow-y: auto; z-index: 20; box-shadow: var(--shadow-panel);
}
.friend-search-row{
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.friend-search-row:last-child{ border-bottom: none; }
.friend-search-row:hover{ background: var(--panel-3); }
.friend-search-empty{ padding: 16px; text-align: center; color: var(--mist-dim); font-size: 13px; }

/* dashboard */
.stat-grid{ display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }
.stat-card{ background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; transition: border-color .15s ease, transform .12s ease; }
.stat-card .label{ font-size: 12px; color: var(--mist-dim); font-family: var(--font-mono); }
.stat-card .value{ font-family: var(--font-display); font-size: 26px; margin-top: 6px; }
.stat-card .value .unit{ font-size: 13px; color: var(--mist); font-family: var(--font-body); }
.stat-card:hover{ border-color: var(--mist-dim); transform: translateY(-2px); }
/* NEW: stat foot line under the value */
.stat-card .stat-foot{ margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--mist-dim); }
.quick-tools{ display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 28px; }

.qtool, .qtool1, .qtool2{
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px; cursor: pointer; transition: border-color .15s ease, transform .12s ease;
}
.qtool:hover{ border-color: var(--danger); transform: translateY(-2px); }
.qtool1:hover{ border-color: var(--amber); transform: translateY(-2px); }
.qtool2:hover{ border-color: var(--teal-dim); transform: translateY(-2px); }
.qtool h3, .qtool1 h3, .qtool2 h3{ font-size: 15px; margin: 10px 0 4px; }
.qtool p, .qtool1 p, .qtool2 p{ font-size: 13px; margin: 0; }

.recent-list{ background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.recent-empty{ padding: 34px; text-align: center; color: var(--mist-dim); font-size: 13.5px; }

/* =========================================================
   Cloudbox (file manager)
   ========================================================= */
.cloudbox-toolbar{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cloudbox-breadcrumb{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; margin-bottom: 16px; font-family: var(--font-mono);
}
.cloudbox-breadcrumb a{ color: var(--mist); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.cloudbox-breadcrumb a:hover{ color: var(--teal); }
.cloudbox-breadcrumb .current{ color: var(--ink); font-weight: 500; }
.cloudbox-breadcrumb .crumb-sep{ color: var(--mist-dim); }
.filter-tabs{ display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; }
.filter-tab{ padding: 7px 14px; font-size: 13px; color: var(--mist); border-radius: 5px; cursor: pointer; transition: background .12s ease, color .12s ease; text-decoration: none; }
.filter-tab:hover{ color: var(--ink); text-decoration: none; }
.filter-tab.active{ background: var(--panel-3); color: var(--ink); }
.view-toggle{ display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; }
.view-toggle .icon-btn{ width: 30px; height: 30px; font-size: 13px; background: transparent; border-color: transparent; }
.view-toggle .icon-btn:hover{ border-color: transparent; }
.view-toggle .icon-btn.active{ color: var(--void); background: var(--teal); border-color: var(--teal); }
.dropzone{
  border: 1.5px dashed var(--line); border-radius: var(--radius-md);
  padding: 30px; text-align: center; color: var(--mist-dim); margin-bottom: 18px;
  font-size: 13.5px; transition: border-color .15s ease, background .15s ease;
}
.dropzone.drag{ border-color: var(--teal); background: rgba(79,209,197,0.05); color: var(--ink); }
.file-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(168px,1fr)); gap: 14px; }
.file-card{
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer; transition: border-color .15s ease;
}
.file-card:hover{ border-color: var(--mist-dim); }
.file-card:not([data-open-href]){ cursor: default; }
.file-thumb{
  height: 96px; background: var(--void); display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--mist-dim); position: relative; overflow: hidden;
}
.file-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.folder-card .folder-thumb{ font-size: 34px; color: var(--amber); background: rgba(255,180,84,0.06); }
.folder-card:hover{ border-color: var(--amber); }
.file-type-tag{
  position: absolute; top: 6px; left: 6px; font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em;
}
.file-type-tag.image{ background: rgba(79,209,197,0.18); color: var(--teal); }
.file-type-tag.video{ background: rgba(255,180,84,0.18); color: var(--amber); }
.file-type-tag.code{ background: rgba(110,231,168,0.18); color: var(--success); }
.file-type-tag.other{ background: var(--panel-3); color: var(--mist); }
/* NEW: static (non-absolute) type tag for table cells */
.file-type-tag.static{ position: static; display: inline-block; font-size: 10px; }
.file-meta{ padding: 10px 12px 12px; }
.file-name{ font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub{ font-size: 11px; color: var(--mist-dim); margin-top: 3px; font-family: var(--font-mono); }
.file-actions{ display: flex; gap: 6px; padding: 0 12px 12px; }
.file-actions .icon-btn{ width: 28px; height: 28px; font-size: 12px; }
.empty-state{ padding: 50px 20px; text-align: center; color: var(--mist-dim); }
.empty-state .glyph{ font-size: 30px; margin-bottom: 10px; }

/* List view -- same cards/markup as grid view, just laid out as rows */
.file-grid.list-view{ display: flex; flex-direction: column; gap: 6px; }
.file-grid.list-view .file-card{
  display: flex; align-items: center; gap: 12px; padding: 6px 12px;
}
.file-grid.list-view .file-thumb{
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: var(--radius-sm);
  font-size: 15px;
}
.file-grid.list-view .folder-card .folder-thumb{ font-size: 15px; }
.file-grid.list-view .file-type-tag{ position: static; margin-right: 0; flex: 0 0 auto; }
.file-grid.list-view .file-thumb img{ display: none; } /* thumbnail image is redundant next to the tag+name in list rows */
.file-grid.list-view .file-meta{
  flex: 1; min-width: 0; padding: 0; display: flex; align-items: center; gap: 16px;
}
.file-grid.list-view .file-name{ flex: 1; min-width: 0; }
.file-grid.list-view .file-sub{ margin-top: 0; flex: 0 0 auto; width: 130px; }
.file-grid.list-view .file-actions{ padding: 0; flex: 0 0 auto; }

/* =========================================================
   Editors — shared workbench chrome
   ========================================================= */
.workbench{ border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; }
.workbench-toolbar{
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.workbench-toolbar .sep{ width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar-group{ display: flex; align-items: center; gap: 6px; }
.toolbar-group label{ font-size: 11.5px; color: var(--mist-dim); font-family: var(--font-mono); }
.workbench-body{ display: grid; grid-template-columns: 1fr 260px; min-height: 480px; }
.workbench-stage{
  background: var(--void); display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: auto;
}
.workbench-inspector{ border-left: 1px solid var(--line); padding: 16px; background: var(--panel); overflow-y: auto; max-height: 640px; }
.inspector-group{ margin-bottom: 20px; }
.inspector-group h4{ font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mist-dim); margin-bottom: 10px; font-family: var(--font-mono); }
.range-row{ display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; color: var(--mist); }
.range-row output{ font-family: var(--font-mono); color: var(--teal); }
input[type="range"]{ width: 100%; accent-color: var(--amber); background: transparent; border: none; padding: 0; margin-bottom: 12px; }
input[type="color"]{ width: 42px; height: 32px; padding: 2px; cursor: pointer; }

/* image editor */
#imgCanvasWrap{ position: relative; }
#imgCanvas{ background: #fff; box-shadow: 0 4px 30px rgba(0,0,0,0.5); max-width: 100%; max-height: 60vh; cursor: crosshair; }
.tool-grid{ display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.tool-grid .icon-btn{ width: 100%; height: 40px; font-size: 15px; }
.swatch-strip{ display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.swatch-strip .sw{ width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); cursor: pointer; }

/* video editor */
#videoStage{ width: 100%; max-width: 720px; position: relative; }
#videoPreview{ position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; top: 0; left: 0; }
#videoCanvas{ width: 100%; border-radius: var(--radius-md); background:#000; display:block; }
.timeline{ margin-top: 16px; padding: 14px 16px; background: var(--panel-2); border-radius: var(--radius-md); border: 1px solid var(--line); }
.timeline-track{ position: relative; height: 46px; background: var(--void); border-radius: 6px; border: 1px solid var(--line-soft); margin-top: 8px; }
.timeline-fill{ position: absolute; top:0; bottom:0; background: repeating-linear-gradient(90deg, var(--teal) 0 3px, rgba(79,209,197,0.15) 3px 7px); opacity:.6; border-radius: 6px; }
.trim-handle{
  position: absolute; top:-3px; bottom:-3px; width: 12px; background: var(--amber);
  border-radius: 4px; cursor: ew-resize; z-index: 5;
}
.trim-handle.start{ left: 0; } .trim-handle.end{ right: 0; }
.playhead-line{ position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); z-index: 4; pointer-events: none; }
.timeline-labels{ display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--mist-dim); margin-top: 6px; }
.transport{ display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.export-progress{ height: 6px; border-radius: 4px; background: var(--panel-3); overflow: hidden; margin-top: 10px; display:none; }
.export-progress .fill{ height: 100%; width: 0%; background: var(--amber); transition: width .15s ease; }

/* code editor */
.code-shell{ display: flex; min-height: 560px; }

/* left sidebar — Cloudbox folder/file browser (not open editor tabs).
   Deliberately a fixed width rather than a flex item's default
   content-based sizing — the latter meant one long filename in a
   folder could stretch the whole sidebar. Resizable by dragging the
   invisible strip pinned to the right edge (.cb-resize-handle, wired
   up by makeHorizontalResizer in code-editor.js) — no visible grip on
   purpose, just a col-resize cursor on hover. */
.code-filelist{
  flex: 0 0 auto; width: 220px; min-width: 160px; max-width: 480px;
  position: relative;
  border-right: 1px solid var(--line); background: var(--panel-2); padding: 10px;
  overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 8px;
}
.cb-resize-handle{
  position: absolute; top: 0; right: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 3;
}

/* create-in-place toolbar (New file / New folder), above the breadcrumb */
.cb-toolbar{ display: flex; gap: 6px; flex: 0 0 auto; }
.cb-toolbar button{
  flex: 1; font-family: var(--font-mono); font-size: 11px; padding: 5px 6px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--panel-3);
  color: var(--mist); cursor: pointer;
}
.cb-toolbar button:hover{ color: var(--ink); border-color: var(--teal); }

.cb-breadcrumb{
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  font-size: 11.5px; font-family: var(--font-mono); color: var(--mist-dim);
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.cb-breadcrumb a{ color: var(--mist-dim); cursor: pointer; }
.cb-breadcrumb a:hover{ color: var(--teal); }
.cb-breadcrumb .sep{ opacity: .5; }
.cb-breadcrumb .current{ color: var(--mist); }
.cb-list{ display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.cb-item{
  display: flex; align-items: center; gap: 8px; padding: 7px 34px 7px 8px; border-radius: 6px;
  font-size: 12.5px; color: var(--mist); cursor: pointer; position: relative;
}
.cb-item:hover{ background: var(--panel-3); color: var(--ink); }
/* tree mode only — the folder new files/folders will be created inside */
.cb-item.selected{ background: var(--panel-3); }
/* the file currently open in the editor — cleared while a folder is
   selected (see .cb-item.selected above), restored once its tab is
   clicked again */
.cb-item.file-open{ background: var(--panel-3); color: var(--ink); }
.cb-item.file-open .cb-name{ color: var(--teal); }
.cb-item .cb-caret{
  width: 12px; flex: 0 0 auto; text-align: center; font-size: 9px; color: var(--mist-dim);
  transition: transform .12s ease;
}
.cb-item .cb-caret.open{ transform: rotate(90deg); }
.cb-item .cb-dot{ width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.cb-item .cb-dot.folder{ background: var(--mist-dim); border-radius: 1px 4px 1px 1px; }
.cb-item .cb-dot.image{ background: var(--danger); }
.cb-item .cb-dot.video{ background: var(--amber); }
.cb-item .cb-dot.code{ background: var(--teal); }
.cb-item .cb-dot.other{ background: var(--mist-dim); }
.cb-item .cb-name{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* rename / delete — hidden until the row is hovered */
.cb-item-actions{
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: none; gap: 2px;
}
.cb-item:hover .cb-item-actions{ display: flex; }
.cb-item-actions button{
  border: none; background: transparent; color: var(--mist-dim); cursor: pointer;
  font-size: 11px; padding: 3px 5px; border-radius: 4px; line-height: 1;
}
.cb-item-actions button:hover{ background: var(--panel); color: var(--ink); }
.cb-item-actions button.danger:hover{ color: var(--danger); }

/* drag-to-move — dragstart adds .dragging to the row being carried;
   dragover adds .drop-target to whichever folder row (or breadcrumb
   crumb) is under the pointer, or .drop-target-root to the list itself
   when hovering its empty background */
.cb-item.dragging{ opacity: .45; }
.cb-item.drop-target{ background: var(--panel-3); outline: 1px dashed var(--teal); outline-offset: -1px; }
.cb-list.drop-target-root{ outline: 1px dashed var(--teal); outline-offset: -2px; border-radius: 6px; }
.cb-breadcrumb a.drop-target{ color: var(--teal); text-decoration: underline; }

/* inline rename — replaces .cb-name in place, no modal */
.cb-item.renaming{ cursor: default; }
.cb-rename-input{
  flex: 1; min-width: 0; background: var(--panel); color: var(--ink);
  border: 1px solid var(--teal); border-radius: 4px; padding: 2px 5px;
  font-size: 12.5px; font-family: inherit;
}
.cb-rename-input:focus{ outline: none; }

.cb-empty, .cb-loading, .cb-error{ font-size: 12px; color: var(--mist-dim); padding: 10px 4px; }
.cb-error{ color: var(--danger); }

.code-main{ display: flex; flex-direction: column; min-width: 0; }

/* open-file tabs (in-memory editor tabs, distinct from the Cloudbox browser) */
.code-tabs{ display: flex; gap: 2px; padding: 8px 8px 0; background: var(--panel-2); border-bottom: 1px solid var(--line); overflow-x: auto; }
.code-tab{
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 6px 6px 0 0;
  font-size: 12.5px; font-family: var(--font-mono); color: var(--mist-dim); cursor: pointer;
  white-space: nowrap; user-select: none; transition: color .12s ease, background .12s ease;
}
.code-tab:hover{ color: var(--mist); }
.code-tab.active{ background: #1E1E1E; color: var(--ink); }
.code-tab .x{ opacity: 0; font-size: 10px; }
.code-tab:hover .x{ opacity: .6; }
.code-tab .x:hover{ opacity: 1; color: var(--danger); }

.code-editor-area{ flex: 0 0 auto; height: 620px; }

/* drag handle shared by the editor and the live-preview iframe */
.resize-handle{
  flex: 0 0 auto; height: 8px; cursor: row-resize; background: var(--panel-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative;
}
.resize-handle::after{
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 32px; height: 3px; border-radius: 2px; background: var(--mist-dim);
}
.resize-handle:hover::after, .resize-handle.dragging::after{ background: var(--teal); }

/* VS Code Dark+ token colors */
.CodeMirror{ height: 100%; font-family: var(--font-mono) !important; font-size: 13.5px; background: #1E1E1E !important; color: #D4D4D4 !important; }
.CodeMirror-gutters{ background: #1E1E1E !important; border-right: 1px solid #2A2A2A !important; }
.CodeMirror-linenumber{ color: #858585 !important; }
.CodeMirror-cursor{ border-left: 2px solid #AEAFAD !important; }
.CodeMirror-selected{ background: #264F78 !important; }
.CodeMirror-activeline-background{ background: rgba(255,255,255,0.04) !important; }
.CodeMirror-matchingbracket{ color: #FFD700 !important; background: rgba(255,215,0,0.12) !important; }
.cm-keyword{ color: #569CD6 !important; }
.cm-string, .cm-string-2{ color: #CE9178 !important; }
.cm-comment{ color: #6A9955 !important; font-style: italic; }
.cm-number{ color: #B5CEA8 !important; }
.cm-def{ color: #DCDCAA !important; }
.cm-variable-2, .cm-property{ color: #9CDCFE !important; }
.cm-atom{ color: #569CD6 !important; }
.cm-tag{ color: #569CD6 !important; }
.cm-attribute{ color: #9CDCFE !important; }
.cm-variable{ color: #9CDCFE !important; }
.cm-operator, .cm-meta{ color: #D4D4D4 !important; }

/* terminal — runs JS/Python and doubles as a small interactive shell.
   HTML/CSS/PHP runs go to the Live preview workbench below instead. */
.code-terminal{ display: flex; flex-direction: column; background: #1E1E1E; }
/* No max-height here — the terminal's overall height is set by the
   drag handle above it (see coding.php / makeVerticalResizer in
   code-editor.js). This panel just fills whatever that leaves once
   .terminal-input-row below claims its own fixed height, so dragging
   only ever extends/contracts the output area and the input box stays
   stuck to the bottom. (A stale max-height: 180px used to sit here and
   cap the output regardless of how tall the terminal was resized to.) */
.terminal-output{
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px;
  font-family: var(--font-mono); font-size: 12.5px; color: #D4D4D4;
}
.terminal-output .line{ padding: 1px 0; white-space: pre-wrap; word-break: break-word; }
.terminal-output .line-cmd{ color: var(--teal); }
.terminal-output .line-dim{ color: var(--mist-dim); }
.terminal-output .line-error{ color: var(--danger); }
.terminal-output .line-success{ color: var(--success); }
.terminal-input-row{
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-top: 1px solid var(--line); background: var(--panel-2);
}
.terminal-prompt{ color: var(--teal); font-family: var(--font-mono); font-size: 12.5px; }
.terminal-input{
  flex: 1; background: transparent; border: none; outline: none; padding: 0;
  color: var(--ink); font-family: var(--font-mono); font-size: 12.5px;
}
.preview-frame{ display: block; width: 100%; height: 360px; border: none; background: #fff; }
.preview-frame.source-view{ background: #1E1E1E; }

/* =========================================================
   Toasts
   ========================================================= */
.toast-stack{ position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast{
  min-width: 240px; max-width: 340px; background: var(--panel-3); border: 1px solid var(--line);
  border-left: 3px solid var(--teal); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13.5px; box-shadow: var(--shadow-panel); animation: toast-in .18s ease;
}
.toast.success{ border-left-color: var(--success); }
.toast.error{ border-left-color: var(--danger); }
.toast .t-title{ font-weight: 600; margin-bottom: 2px; }
.toast .t-msg{ color: var(--mist); font-size: 12.5px; }
@keyframes toast-in{ from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform: translateY(0);} }

/* =========================================================
   Confirm dialog
   ========================================================= */
.confirm-box{ text-align: left; }
.confirm-box p{ margin-bottom: 20px; }
.confirm-actions{ display: flex; gap: 10px; justify-content: flex-end; }

/* =========================================================
   Admin tables — shared (used by admin.php)
   ========================================================= */
.table-scroll{ overflow-x: auto; }
.admin-table{ width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td{ padding: 12px 14px; text-align: left; vertical-align: top; }
.admin-table thead th{
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--mist-dim); border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--panel-2); position: sticky; top: 0;
}
.admin-table tbody tr{ border-bottom: 1px solid var(--line-soft); transition: background .12s ease; }
.admin-table tbody tr:hover{ background: var(--panel-2); }
.admin-table tbody tr:last-child{ border-bottom: none; }
/* row removed animation helper */
.admin-table tr[style*="opacity:0"] + tr, .admin-table tr.removing{ }

/* checkbox column */
.admin-table .check-col{ width: 36px; text-align: center; }
.admin-table .check-col input[type="checkbox"]{ width: 16px; height: 16px; cursor: pointer; accent-color: var(--amber); }

/* sort links */
.sort-link{ color: var(--mist-dim); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.sort-link:hover{ color: var(--ink); text-decoration: none; }
.sort-link.active{ color: var(--amber); }

/* user cell with avatar */
.user-cell{ display: inline-flex; align-items: center; gap: 10px; }
.user-cell .user-avatar{ flex: none; }

/* role badges */
.role-badge{
  display: inline-block; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
.role-badge.admin{ background: rgba(255,180,84,0.18); color: var(--amber); }
.role-badge.mod{ background: rgba(79,209,197,0.18); color: var(--teal); }
.role-badge.self{ background: var(--panel-3); color: var(--mist); }

/* role flag: badge rendered purely via ::after so it does NOT pollute
   td.textContent (keeps js/admin.js confirm dialogs reading clean names) */
.role-flag{
  display: inline-block; width: 0; overflow: hidden; vertical-align: middle;
  margin: 0 0 0 6px; position: relative; top: -1px;
}
.role-flag::after{
  content: attr(data-flag);
  display: inline-block; overflow: visible; width: auto;
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .03em; padding: 1px 6px; border-radius: 4px;
}
.role-flag.admin::after{ background: rgba(255,180,84,0.18); color: var(--amber); }
.role-flag.mod::after{ background: rgba(79,209,197,0.18); color: var(--teal); }
.role-flag.self::after{ background: var(--panel-3); color: var(--mist); }

/* per-row checkbox inside the first cell (files table) */
.row-check{ display: inline-flex; vertical-align: middle; margin-right: 10px; cursor: pointer; }
.row-check input[type="checkbox"]{ width: 14px; height: 14px; cursor: pointer; accent-color: var(--amber); }
.file-name-text{ vertical-align: middle; }

/* row states */
.admin-table tr.row-expired{ opacity: .6; }
.admin-table tr.row-expired td:first-child{ text-decoration: line-through; }

/* action tags (activity log) */
.action-tag{ font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; background: var(--panel-3); color: var(--mist); }
.action-tag.delete{ background: rgba(255,107,107,0.15); color: var(--danger); }
.action-tag.setrole{ background: rgba(255,180,84,0.15); color: var(--amber); }
.action-tag.resend{ background: rgba(79,209,197,0.15); color: var(--teal); }
.action-tag.create{ background: rgba(110,231,168,0.15); color: var(--success); }

/* =========================================================
   Admin layout: head, toolbar, pagination, bulk bar
   ========================================================= */
.admin-view{ }
.admin-head{ display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head-actions{ margin-left: auto; display: flex; gap: 8px; }

.admin-toolbar{
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.admin-toolbar .search-input{ max-width: 320px; flex: 1 1 280px; }
.admin-toolbar .role-filter{ width: auto; }
.admin-toolbar .toolbar-meta{ display: flex; align-items: center; gap: 10px; }

/* pills under stats */
.pill{
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--mist); border: 1px solid var(--line-soft);
}
.pill.teal, .pill.pill-teal{ color: var(--teal); border-color: var(--teal-dim); background: rgba(79,209,197,0.07); }
.pill.danger, .pill.pill-danger{ color: var(--danger); border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.08); }
.pill.success, .pill.pill-success{ color: var(--success); border-color: rgba(110,231,168,0.3); background: rgba(110,231,168,0.08); }

/* toggle (pending expired) */
.toggle{ display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--mist); }
.toggle input{ width: auto; }
.toggle:hover{ color: var(--ink); }

/* bulk action bar */
.bulk-bar{
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* pagination */
.pagination{ display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination .pg-btn, .pagination .pg-num{
  min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--mist); cursor: pointer; font-size: 13px; text-decoration: none; transition: all .12s ease;
}
.pagination .pg-btn:hover, .pagination .pg-num:hover{ color: var(--ink); border-color: var(--mist-dim); text-decoration: none; }
.pagination .pg-num.active{ background: var(--amber); color: #1A1204; border-color: var(--amber); font-weight: 600; }
.pagination .pg-btn.disabled, .pagination .pg-num.disabled{ opacity: .4; pointer-events: none; }
.pagination .pg-ellipsis{ color: var(--mist-dim); padding: 0 4px; }
.pagination .pg-info{ margin-left: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--mist-dim); }

/* =========================================================
   Graph tab
   ========================================================= */
.graph-toolbar{ margin-bottom: 16px; }
.graph-range-form{ display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.graph-field{ display: flex; flex-direction: column; gap: 5px; }
.graph-field-label{ font-family: var(--font-mono); font-size: 11px; color: var(--mist-dim); text-transform: uppercase; letter-spacing: .04em; }
.graph-field select, .graph-field input[type="date"]{ min-width: 120px; }
.graph-field input[type="date"]{ padding: 8px 10px; }
.graph-field.hidden{ display: none; }

.graph-layout{ display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.graph-stage{ min-height: 460px; display: flex; flex-direction: column; }
.graph-canvas-wrap{ position: relative; flex: 1; min-height: 420px; padding: 16px; }
.graph-canvas-wrap canvas{ width: 100% !important; }

.graph-inspector{ max-height: 540px; overflow-y: auto; }
.graph-series-list{ padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.series-card{
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.series-head{ display: flex; align-items: center; gap: 8px; }
.series-dot{ width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid rgba(255,255,255,0.15); }
.series-title{ font-size: 12.5px; font-weight: 600; flex: 1; }
.series-card .graph-field{ gap: 4px; }
.series-card .graph-field-label{ font-size: 10px; }
.series-card select, .series-card input[type="color"]{ font-size: 12.5px; padding: 6px 8px; }
.color-row{ display: flex; align-items: center; gap: 8px; }
.s-color{ width: 38px; height: 30px; padding: 2px; cursor: pointer; }
.palette-mini{ display: flex; gap: 4px; flex-wrap: wrap; }
.graph-toggle{ display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mist); cursor: pointer; }
.graph-toggle input{ width: auto; accent-color: var(--amber); }

.graph-section-title{ font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mist-dim); margin: 16px 16px 8px; }
.palette-row{ display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.swatch-btn{ width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); cursor: pointer; padding: 0; transition: transform .1s ease; }
.swatch-btn:hover{ transform: scale(1.12); border-color: var(--ink); }
.swatch-btn.mini{ width: 18px; height: 18px; }

#paletteWrap .graph-field{ padding: 0 16px 16px; }

@media (max-width: 980px){
  .graph-layout{ grid-template-columns: 1fr; }
  .graph-inspector{ max-height: none; }
}

/* =========================================================
   Admin overview charts
   ========================================================= */
.ov-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ov-card .ov-bars{ padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ov-bar-row{ display: grid; grid-template-columns: 64px 1fr 150px; align-items: center; gap: 10px; }
.ov-bar-label{ display: flex; align-items: center; }
.ov-bar-track{ height: 18px; border-radius: 5px; background: var(--void); border: 1px solid var(--line-soft); overflow: hidden; }
.ov-bar-fill{ height: 100%; border-radius: 5px; transition: width .3s ease; min-width: 2px; }
.ov-bar-fill.image{ background: var(--teal); }
.ov-bar-fill.video{ background: var(--amber); }
.ov-bar-fill.code{ background: var(--success); }
.ov-bar-fill.other{ background: var(--mist); }
.ov-bar-val{ font-size: 11.5px; color: var(--mist-dim); text-align: right; }

/* sparkline */
.spark-wrap{ padding: 16px; }
.spark{ width: 100%; height: 80px; display: block; }
.spark-axis{ font-size: 11px; color: var(--mist-dim); text-align: center; margin-top: 4px; }

/* role bars */
.role-bars{ padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.role-row{ display: grid; grid-template-columns: 80px 1fr 90px; align-items: center; gap: 10px; }
.role-name{ font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; color: var(--mist); }
.role-track{ height: 14px; border-radius: 5px; background: var(--void); border: 1px solid var(--line-soft); overflow: hidden; }
.role-fill{ height: 100%; border-radius: 5px; transition: width .3s ease; min-width: 2px; }
.role-val{ font-size: 11.5px; color: var(--mist-dim); text-align: right; }

/* mini meter (top storage list) */
.mini-meter{ height: 6px; border-radius: 4px; background: var(--void); border: 1px solid var(--line-soft); overflow: hidden; }
.mini-meter-fill{ height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: 4px; transition: width .3s ease; }

/* =========================================================
   User detail drawer
   ========================================================= */
.drawer{
  position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 90vw;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-float);
  z-index: 150; transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer[aria-hidden="false"]{ transform: translateX(0); }
.drawer-head{ display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.drawer-body{ flex: 1; overflow-y: auto; padding: 18px; }
.drawer-empty, .drawer-loading{ color: var(--mist-dim); padding: 30px; text-align: center; font-size: 13px; }
.drawer-id{ font-family: var(--font-mono); font-size: 11px; color: var(--mist-dim); }
.drawer-name{ font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-top: 4px; }
.drawer-email{ font-size: 12px; color: var(--mist-dim); margin-top: 2px; }
.drawer-dl{ display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 18px 0; }
.drawer-dl dt{ font-family: var(--font-mono); font-size: 11px; color: var(--mist-dim); text-transform: uppercase; }
.drawer-dl dd{ margin: 0; font-size: 13px; }
.drawer-section{ font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; color: var(--mist-dim); margin: 18px 0 8px; }
.drawer-scrim{ position: fixed; inset: 0; background: rgba(6,8,11,0.5); z-index: 140; }

/* =========================================================
   Keyboard help modal + kbd
   ========================================================= */
.kb-list{ display: flex; flex-direction: column; gap: 12px; }
.kb-list > div{ display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--mist); }
.kb-list span{ color: var(--ink); }
kbd{
  font-family: var(--font-mono); font-size: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 3px 8px; color: var(--ink); min-width: 22px; text-align: center; display: inline-block;
}

/* Passwword safety bar */
.pw-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.pw-meter span {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border-light);
  transition: background 0.2s;
}

.pw-meter-label {
  font-size: 11.5px;
  color: var(--mist-dim);
  margin-top: 5px;
  font-family: monospace;
}

/* =========================================================
   Index.php: How it works — scroll-driven journey
   (progress is calculated from scroll position in script.js;
   nothing here plays on its own)
   ========================================================= */
.journey{ padding: 40px 0 120px; }

.journey-steps{
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.journey-track{
  position: absolute;
  left: 12px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(244,242,255,0.16);
  border-radius: 2px;
  overflow: hidden;
}
.journey-line-fill{
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--violet), var(--cyan));
  transform: scaleY(0);
  transform-origin: top;
  border-radius: 2px;
  /* smooths the per-frame scroll updates without ever animating on its own */
  transition: transform 0.08s linear;
}

.journey-step{
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 24px;
  position: relative;
}
.journey-node{
  width: 12px; height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--void);
  border: 2px solid rgba(244,242,255,0.16);
  justify-self: center;
  z-index: 2;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.journey-content{
  opacity: 0.4;
  transform: translateX(0);
  transition: opacity 0.5s var(--ease);
}
.journey-index{
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  transition: color 0.4s var(--ease);
}
.journey-content h3{ font-size: 1.2rem; margin-bottom: 8px; }
.journey-content p{ color: rgba(244,242,255,0.68); font-size: 0.96rem; max-width: 46ch; }

.journey-step.is-active .journey-node{
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(58,214,224,0.16);
}
.journey-step.is-active .journey-content{ opacity: 1; }
.journey-step.is-active .journey-index{ color: var(--cyan); }

/* =========================================================
   index.php: Final CTA
   ========================================================= */
.final-cta{
  padding: 90px 0 110px;
  text-align: center;
  position: relative;
}
.final-cta::before{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,95,162,0.14), transparent 60%);
  z-index: -1;
}
.final-cta h2{ font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: 12px; }
.final-cta p{ color: var(--mist); margin-bottom: 30px; }

/* =========================================================
 topbar.php: Clickable account
 =========================================================== */
.user-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
  cloudbox.php
  ========================================================== */
.cloudbox-view-tabs{ display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.cloudbox-view-tabs a{
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 4px; margin-right: 22px;
  font-size: 13.5px; font-weight: 500; color: var(--mist); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.cloudbox-view-tabs a:hover{ color: var(--ink); }
.cloudbox-view-tabs a.active{ color: var(--ink); border-bottom-color: var(--amber); }

/* Share modal */
.share-modal{ max-width: 440px; }
.share-add-row{ display: flex; gap: 8px; margin-bottom: 18px; }
.share-add-row select{ flex: 1; }
.share-list{ max-height: 260px; overflow-y: auto; }
.share-row{
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.share-row:last-child{ border-bottom: none; }
.share-username{ flex: 1; font-size: 13.5px; font-weight: 500; }
.share-perm-select{ width: auto; padding: 6px 10px; font-size: 13px; }
.file-type-tag.static{ position: static; display: inline-block; font-size: 10px; }
.file-meta{ padding: 10px 12px 12px; }
.file-name{ font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub{ font-size: 11px; color: var(--mist-dim); margin-top: 3px; font-family: var(--font-mono); }
.file-actions{ display: flex; gap: 6px; padding: 0 12px 12px; }
.file-actions .icon-btn{ width: 28px; height: 28px; font-size: 12px; }
.empty-state{ padding: 50px 20px; text-align: center; color: var(--mist-dim); }
.empty-state .glyph{ font-size: 30px; margin-bottom: 10px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .track-cards{ grid-template-columns: repeat(2,1fr); }
  .stat-grid{ grid-template-columns: repeat(2,1fr); }
  .quick-tools{ grid-template-columns: 1fr; }
  .workbench-body{ grid-template-columns: 1fr; }
  .workbench-inspector{ border-left:none; border-top: 1px solid var(--line); max-height: none; }
  .code-shell{ grid-template-columns: 1fr; }
  .ov-grid{ grid-template-columns: 1fr; }
  .ov-bar-row{ grid-template-columns: 56px 1fr 120px; }
  .role-row{ grid-template-columns: 64px 1fr 72px; }
}
@media (max-width: 760px){
  .app-shell{ flex-direction: column; }
  .sidebar{ width: 100%; height: auto; position: relative; flex-direction: row; overflow-x: auto; }
  .sidebar .brand{ display:none; }
  .sidebar-nav{ flex-direction: row; padding: 10px; }
  .sidebar-storage{ display: none; }
  .track-cards, .stat-grid{ grid-template-columns: 1fr; }
  .hero{ padding: 48px 18px 24px; }
  .section{ padding: 40px 18px; }
  .admin-head{ flex-direction: column; align-items: stretch; }
  .admin-head-actions{ margin-left: 0; }
  .admin-toolbar .search-input{ max-width: none; }
  .drawer{ width: 100%; }
  .journey-steps{ gap: 48px; }
  .journey-content h3{ font-size: 1.05rem; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* high contrast hardening */
@media (prefers-contrast: more){
  :root{ --line: #3a4458; --mist: #c4ccd9; }
  .admin-table tbody tr:hover{ background: var(--panel-3); }
  .btn, .icon-btn{ border-width: 2px; }
}

/* =========================================================
   Keyframes
   ========================================================= */
@keyframes float{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-4px); }
}
@keyframes pulse-dot{
  0%{ box-shadow: 0 0 0 0 rgba(58,214,224,0.5); }
  70%{ box-shadow: 0 0 0 6px rgba(58,214,224,0); }
  100%{ box-shadow: 0 0 0 0 rgba(58,214,224,0); }
}
@keyframes drift-a{
  0%, 100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-10px) rotate(-0.6deg); }
}
@keyframes drift-b{
  0%, 100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(8px) rotate(0.6deg); }
}
@keyframes drift-c{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}