/* ──────────────────────────────────────────────────────────
   DropLock — Subtle Neumorphic (Dark Default)
   ────────────────────────────────────────────────────────── */

/* ── Tokens (Dark by Default) ── */
:root {
  --bg:          #161b22;
  --surface:     #161b22;
  --text:        #f0f6fc;
  --text-muted:  #8b949e;
  --blue:        #58a6ff;
  --teal:        #3fb950;
  --cyan:        #58d5ff;
  --border:      rgba(255,255,255,0.1);
  --radius:      16px;
  --radius-sm:   10px;
  --font:        'Inter', system-ui, sans-serif;

  /* Subtle Neumorphic Shadows (Dark) */
  --neu-raised:   5px 5px 12px #0d1117, -5px -5px 12px #1f242c;
  --neu-flat:     3px 3px 8px #0d1117, -3px -3px 8px #1f242c;
  --neu-inset:    inset 3px 3px 8px #0d1117, inset -3px -3px 8px #1f242c;
  --neu-pressed:  inset 4px 4px 10px #0d1117, inset -4px -4px 10px #1f242c;
  --neu-deep:     8px 8px 20px #0d1117, -8px -8px 20px #1f242c;
}

/* ── Light Mode Override ── */
body.light-mode {
  --bg:          #f0f3f6;
  --surface:     #f0f3f6;
  --text:        #24292f;
  --text-muted:  #57606a;
  --blue:        #0969da;
  --teal:        #1a7f37;
  --cyan:        #0969da;
  --border:      rgba(0,0,0,0.1);
  --neu-raised:   5px 5px 12px #d1d5da, -5px -5px 12px #ffffff;
  --neu-flat:     3px 3px 8px #d1d5da, -3px -3px 8px #ffffff;
  --neu-inset:    inset 3px 3px 8px #d1d5da, inset -3px -3px 8px #ffffff;
  --neu-pressed:  inset 4px 4px 10px #d1d5da, inset -4px -4px 10px #ffffff;
  --neu-deep:     8px 8px 20px #d1d5da, -8px -8px 20px #ffffff;
}

/* ── Reset & Core ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; transition: all 0.2s; }

.page-shell { width: 100%; padding: 0 40px; box-sizing: border-box; }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
header {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

body.light-mode header {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.nav-inner {
  width: 100%;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.wide-nav {
  padding: 12px 60px;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 40px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-item {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  transition: color 0.2s;
  text-transform: uppercase;
}
.nav-item:hover { color: var(--text); }

.logo-link { display:flex; align-items:center; }
.logo-img   { height:42px; width:auto; display:block; }

/* Nav icons */
.nav-icons { display:flex; align-items:center; gap:12px; }

.icon-btn {
  background: var(--bg);
  border: none;
  color: var(--blue);
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--neu-flat);
}
.icon-btn:hover  { box-shadow: var(--neu-raised); }
.icon-btn:active { box-shadow: var(--neu-pressed); }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 32px;
  padding: 48px 0 64px;
  align-items: center;
  width: 100%;
}

.hero-headline {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 440px;
  margin-bottom: 32px;
}

/* Base Card Style (Unified Outlines) */
.locker-card, .radar-card, .feat-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  border: 1px solid rgba(255,255,255,0.15); /* Universal White Outline */
}

body.light-mode .locker-card, 
body.light-mode .radar-card, 
body.light-mode .feat-card {
  border: 1px solid rgba(0,0,0,0.3); /* Unified dark outline for light mode */
}

/* Specific Card Layouts */
.locker-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 540px;
}

.radar-card {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feat-card {
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--neu-raised);
}

/* Input row — inset (pressed in) */
.locker-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--neu-inset);
}
.locker-input-row svg { flex-shrink:0; color: var(--text-muted); }
.locker-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  font-family: var(--font);
}
.locker-input-row input::placeholder { color: #57606a; }

.locker-btn-row { display:flex; gap:12px; }

.hero-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue);
  box-shadow: var(--neu-flat);
}
.hero-btn:hover  { box-shadow: var(--neu-raised); }
.hero-btn:active { box-shadow: var(--neu-inset); }

/* Radar Section */
.radar-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.radar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg);
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal);
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-flat);
  width: fit-content;
}
.radar-btn:hover  { box-shadow: var(--neu-raised); transform: translateY(-1px); }
.radar-btn:active { box-shadow: var(--neu-inset); transform: translateY(0); }

/* ══════════════════════════════════════════
   FEATURES
══════════════════════════════════════════ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 80px;
}

.feat-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--neu-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--text-muted);
}

.feat-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; }
.feat-desc  { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer {
  background: var(--surface);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.footer-inner {
  width: 100%;
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.footer-logo { font-size: 1.1rem; font-weight: 800; }
.footer-nav  { display:flex; gap:24px; }
.footer-nav a { font-size: 0.88rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.active { display:flex; }

.modal-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 36px;
  width: 90%; max-width: 440px;
  position: relative;
  box-shadow: var(--neu-deep);
}

body.light-mode .modal-box {
  border: 1px solid rgba(0,0,0,0.9);
}

.close-btn { position:absolute; top:20px; right:20px; background:none; border:none; font-size:1.5rem; color:var(--text-muted); }

/* New-locker icon in access modal */
.access-modal-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 4px;
  background: rgba(63,185,80,0.12); color: var(--teal);
}
.modal-input {
  width: 100%; padding: 12px 16px; background: var(--bg); border:none;
  border-radius: var(--radius-sm); font-size: 0.95rem; color: var(--text);
  margin-bottom: 14px; box-shadow: var(--neu-inset); outline:none;
}
.modal-btn {
  width: 100%; padding: 12px; background: var(--bg); color: var(--blue);
  border:none; border-radius: var(--radius-sm); font-weight: 700;
  margin-bottom: 8px; box-shadow: var(--neu-flat);
}
.modal-btn:hover { box-shadow: var(--neu-raised); }
.modal-btn:active { box-shadow: var(--neu-pressed); }
.modal-btn:disabled { opacity:0.5; box-shadow:none; }
.modal-btn-ghost {
  width: 100%; padding: 10px; background: transparent; color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
}
.modal-btn-ghost:hover { border-color: rgba(255,255,255,0.22); color: var(--text); }

.modal-error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #ff8b84;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}
.modal-error:not(:empty) { display: block; }
body.light-mode .modal-error { color: #b42318; background: rgba(248, 81, 73, 0.08); }

#status-display {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .features { grid-template-columns: 1fr; }
  .page-shell { padding: 0 20px; }
  
  /* Mobile Header (Requested: Logo & Icons on same level, Nav-Center stack below) */
  .nav-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 12px 20px;
  }
  
  .nav-left, .nav-right { flex: 0 0 auto; }

  .nav-center {
    width: 100%;
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    gap: 20px;
    order: 3;
  }
  body.light-mode .nav-center { border-top: 1px solid rgba(0,0,0,0.05); }

  .nav-item { font-size: 0.75rem; }
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .footer-nav { flex-wrap: wrap; justify-content: center; }
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   TRANSFER PAGE SPECIFIC
══════════════════════════════════════════ */
.transfer-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "radar side";
  gap: 24px;
  padding: 32px 0 24px;
  align-items: start;
  width: 100%;
}

.transfer-side-stack {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.radar-card-main {
  grid-area: radar;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.device-name-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

body.light-mode .radar-card-main,
body.light-mode .vault-card,
body.light-mode .device-name-card {
  border: 1px solid rgba(0,0,0,0.3) !important;
}

.device-name-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  margin-bottom: 4px;
}

.device-name-display {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1.2;
}

/* Header Search */
.search-header { margin-bottom: 8px; }
.radar-card-main .card-footer-row { margin-top: 12px; }
.radar-search-wrap { position: relative; width: 100%; }
.radar-card-search {
  width: 100%; background: var(--bg); border: none;
  border-radius: var(--radius-sm); padding: 10px 16px 10px 40px;
  color: var(--text); font-size: 0.9rem; box-shadow: var(--neu-inset); outline: none;
}
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Central Radar Scale */
.radar-visual-wrapper.large-radar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; margin: 0;
}
.large-radar .radar-svg {
  width: 100%; max-width: 180px; /* Reduced for shorter card */ filter: drop-shadow(0 0 12px rgba(63, 185, 80, 0.12));
}

.radar-devices-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--neu-inset);
}

.radar-devices-title {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.radar-devices-list {
  display: grid;
  gap: 6px;
  max-height: 120px; /* Reduced from 170px */
  overflow-y: auto;
  padding-right: 4px;
}

.radar-list-item {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 9px 11px;
  background: var(--bg);
  color: var(--text);
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--neu-flat);
}

.radar-list-item:hover {
  color: var(--teal);
  box-shadow: var(--neu-raised);
  transform: translateY(-1px);
}

.radar-list-empty {
  padding: 10px 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.radar-user-group {
  opacity: 1;
}

.radar-user-group.appearing {
  animation: radar-user-appear 0.35s ease-out both;
}

.radar-user-ring {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.5;
  opacity: 0.35;
  animation: radar-user-pulse 1.8s ease-out infinite;
}

.radar-user-circle {
  fill: var(--teal);
  filter: drop-shadow(0 0 5px rgba(63, 185, 80, 0.75));
}

.radar-user-name {
  fill: var(--text);
  font-size: 8px;
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}

@keyframes radar-user-appear {
  from { opacity: 0; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes radar-user-pulse {
  from { r: 8; opacity: 0.55; }
  to { r: 18; opacity: 0; }
}

.is-hidden {
  display: none !important;
}

/* ══════════════════════════════════════════
   FILE VAULT
══════════════════════════════════════════ */
.vault-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 20px 18px;
  display: flex;
  flex-direction: column;
}

.vault-card .card-header-row {
  margin-bottom: 18px;
}

.vault-dropzone {
  background: var(--bg);
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  text-align: center;
  box-shadow: var(--neu-inset);
  margin-bottom: 16px;
  transition: border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Removed flex: 1 so it doesn't arbitrarily stretch */
}
.vault-dropzone:hover { border-color: var(--blue); }
.vault-dropzone.drag-over { background: rgba(88, 166, 255, 0.1); border-color: var(--blue); transform: scale(1.02); }

.drop-icon-box { margin-bottom: 8px; color: var(--text-muted); opacity: 0.9; }
.drop-text { font-size: 0.95rem; font-weight: 700; color: var(--text); }

.drop-divider {
  display: flex;
  align-items: center;
  width: 100px;
  margin: 8px auto;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.drop-divider::before, .drop-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.05); margin: 0 8px;
}

.import-btn-premium {
  background: var(--bg); border: none; border-radius: var(--radius-sm);
  padding: 8px 18px; display: flex; align-items: center; gap: 8px;
  color: var(--blue); font-size: 0.85rem; font-weight: 700; box-shadow: var(--neu-flat);
  transition: all 0.2s;
}
.import-btn-premium:hover { box-shadow: var(--neu-raised); transform: translateY(-1px); }
.import-btn-premium:active { box-shadow: var(--neu-pressed); transform: translateY(0); }

/* Staging Progress Styles */
.staging-progress-wrap {
  margin: 12px 0;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-inset);
}

.staging-progress-info {
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.staging-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
  overflow: hidden;
}

body.dark-mode .staging-progress-bar-bg {
  background: rgba(255,255,255,0.05);
}

.staging-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.4);
  transition: width 0.1s linear;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vault-card .file-list {
  max-height: 228px;
  overflow-y: auto;
  padding-right: 4px;
}

.file-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--neu-flat);
  border: 1px solid rgba(255,255,255,0.05);
}

.file-icon-box {
  width: 40px; height: 40px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--neu-inset);
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-action-btn {
  background: var(--bg);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  box-shadow: var(--neu-flat);
  transition: all 0.2s;
}
.file-action-btn:hover { box-shadow: var(--neu-raised); transform: translateY(-1px); }
.file-action-btn.delete { color: #f85149; }

.large-radar .radar-ring {
  stroke-width: 0.8;
  opacity: 0.25;
}

/* Premium Refresh Button */
.refresh-btn-premium {
  background: var(--bg);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  box-shadow: var(--neu-raised);
  transition: all 0.2s;
}

.refresh-btn-premium:hover {
  box-shadow: var(--neu-flat);
  transform: scale(1.05);
}

.refresh-btn-premium:active {
  box-shadow: var(--neu-pressed);
  transform: scale(0.95);
}

.radar-center-dot { fill: var(--teal); }

.radar-sweep-line {
  stroke: var(--teal);
  stroke-width: 1.5;
  opacity: 0.6;
  transform-origin: 100px 100px;
  animation: radar-sweep 4s linear infinite;
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pulse-dot {
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--teal);
  animation: pulse 2s infinite;
}

/* Transfer Console */
.transfer-console {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.code-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  padding: 24px; /* Reduced from 32px */
}

body.light-mode .code-card {
  border: 1px solid rgba(0,0,0,0.9);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.console-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(63, 185, 80, 0.1);
  color: var(--teal);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.code-inset-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-inset);
  padding: 24px 16px; /* Reduced from 40px */
  text-align: center;
  margin-bottom: 24px;
}

.transfer-code-text {
  font-size: 2.2rem; /* Reduced from 3rem */
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.timer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.timer-icon-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f85149;
  font-weight: 600;
}

.timer-value { font-family: monospace; font-weight: 700; color: var(--text); }

.progress-track {
  height: 6px; /* Reduced */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

/* Console Actions */
.console-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.console-btn {
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 16px; /* Reduced from 24px */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--neu-flat);
  transition: all 0.2s;
}

.console-btn svg { width: 18px; height: 18px; }

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.active-dot {
  width: 6px; height: 6px;
  background: var(--teal);
  border-radius: 50%;
}

.progress-fill {
  height: 100%;
  background: #f85149;
  box-shadow: 0 0 10px rgba(248, 81, 73, 0.4);
  transition: width 1s linear;
}

.console-btn:hover {
  box-shadow: var(--neu-raised);
  transform: translateY(-2px);
  color: var(--blue);
}

.console-btn:active {
  box-shadow: var(--neu-pressed);
  transform: translateY(0);
}

.util-btn:hover { box-shadow: var(--neu-raised); }
.util-btn:active { box-shadow: var(--neu-inset); }
.util-btn:hover { box-shadow: var(--neu-raised); }
.util-btn:active { box-shadow: var(--neu-inset); }

@media (max-width: 950px) {
  .transfer-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "radar";
  }
  .transfer-side-stack { gap: 10px; }
  .radar-card-main { min-height: 0; }
}

/* Incoming Transfers Panel */
.incoming-transfers-panel {
  width: 100%;
  margin-top: -8px;
  margin-bottom: 28px;
  padding: 18px 20px 20px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  box-sizing: border-box;
}

body.light-mode .incoming-transfers-panel {
  border-color: rgba(0, 0, 0, 0.12);
}

.incoming-transfers-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.incoming-transfers-heading {
  flex: 1;
  min-width: 0;
}

.incoming-transfers-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.incoming-transfers-status {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
}

.incoming-transfers-status.is-hidden {
  display: none;
}

.incoming-cancel-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.incoming-cancel-btn:hover {
  border-color: var(--text-muted);
  color: var(--cyan);
}

body.light-mode .incoming-cancel-btn {
  border-color: rgba(0, 0, 0, 0.2);
}

.incoming-transfers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incoming-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--neu-inset);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.incoming-meta {
  margin-bottom: 10px;
}

.incoming-from {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 4px;
}

.incoming-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

.incoming-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incoming-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.incoming-file:first-child {
  border-top: none;
  padding-top: 0;
}

.incoming-file-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.incoming-file-download,
.incoming-file-delete {
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: var(--neu-flat);
  cursor: pointer;
  transition: all 0.2s;
}

.incoming-file-download {
  color: var(--blue);
}

.incoming-file-delete {
  color: #f85149;
}

.incoming-file-download:hover,
.incoming-file-delete:hover {
  box-shadow: var(--neu-raised);
  transform: translateY(-1px);
}

/* Transfer Action Bar */
.transfer-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-inset);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 16px;
  margin-top: 0;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.transfer-side-stack > .transfer-action-bar {
  margin-top: 0;
  margin-bottom: 0;
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
  border: 1px solid rgba(255,255,255,0.15);
}
body.light-mode .transfer-action-bar { border: 1px solid rgba(0,0,0,0.9); }

.transfer-target-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.target-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.target-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cyan);
}

.icon-btn-small {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
}
.icon-btn-small:hover { color: #f85149; }

.transfer-btn-premium {
  background: var(--teal);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
  transition: all 0.2s;
  text-transform: uppercase;
}
.transfer-btn-premium:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(63, 185, 80, 0.6);
}
.transfer-btn-premium:active:not(:disabled) {
  transform: translateY(0);
}
.transfer-btn-premium:disabled {
  background: var(--surface);
  color: var(--border);
  box-shadow: var(--neu-inset);
  cursor: not-allowed;
}

.transfer-progress-wrap {
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--neu-flat);
  margin-bottom: 24px;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  align-items: center;
}
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.6);
  transition: width 0.3s;
}

/* ══════════════════════════════════════════
   LOCKER PAGE
══════════════════════════════════════════ */
@keyframes lk-spin { to { transform: rotate(360deg); } }

.lk-body { display: flex; flex-direction: column; min-height: 100vh; }
/* note-page: lock viewport — only the editor body scrolls, not the page */
body.note-page {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
.lk-header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 40px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 100;
}
body.light-mode .lk-header { border-bottom-color: rgba(0,0,0,0.08); }

.lk-logo {
  font-size: 1.1rem; font-weight: 800; color: var(--blue);
  margin-right: 40px; text-decoration: none; white-space: nowrap;
}

.lk-nav { display: flex; gap: 4px; flex: 1; }
.lk-nav-item {
  padding: 6px 14px; border-radius: 6px; font-size: 0.85rem;
  font-weight: 600; color: var(--text-muted); transition: all 0.15s;
  text-decoration: none;
}
.lk-nav-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.lk-nav-active { color: var(--blue) !important; background: rgba(88,166,255,0.1) !important; }
body.light-mode .lk-nav-item:hover { background: rgba(0,0,0,0.05); }
body.light-mode .lk-nav-active { background: rgba(9,105,218,0.1) !important; }

.lk-header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.lk-icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.lk-icon-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
body.light-mode .lk-icon-btn:hover { background: rgba(0,0,0,0.06); }

/* Settings dropdown */
.lk-settings-wrap { position: relative; }
.lk-settings-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px; background: var(--bg); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
  padding: 6px; z-index: 200; flex-direction: column; gap: 2px;
}
body.light-mode .lk-settings-dropdown {
  box-shadow: 0 8px 24px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.08);
}
.lk-settings-open { display: flex !important; }

.lk-settings-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px; font-size: 0.82rem;
  font-weight: 500; color: var(--text); background: transparent;
  border: none; cursor: pointer; text-decoration: none; transition: background 0.12s;
  text-align: left;
}
.lk-settings-item:hover { background: rgba(255,255,255,0.06); }
body.light-mode .lk-settings-item:hover { background: rgba(0,0,0,0.05); }
.lk-settings-danger { color: #f85149; }
.lk-settings-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 4px 0; }
body.light-mode .lk-settings-divider { background: rgba(0,0,0,0.08); }

/* ── Main ── */
.lk-main { flex: 1; padding: 40px 0 60px; }
/* main area fills the rest of the viewport below the 56px header */
.note-page .lk-main {
  padding: 0;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lk-shell { width: 100%; padding: 0 40px; box-sizing: border-box; }

/* Title row */
.lk-title-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 32px; gap: 16px;
}
.lk-vault-title {
  font-size: 2rem; font-weight: 800; display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.lk-shield-icon { color: var(--teal); display: flex; align-items: center; }
.lk-sync-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
}
.lk-sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); display: inline-block;
  box-shadow: 0 0 6px var(--teal);
}
.lk-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.lk-force-sync-btn,
.lk-upgrade-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12);
  background: var(--bg); color: var(--text); font-size: 0.82rem; font-weight: 600;
  box-shadow: var(--neu-flat); white-space: nowrap;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}
.lk-force-sync-btn:hover,
.lk-upgrade-btn:hover { box-shadow: var(--neu-raised); }
body.light-mode .lk-force-sync-btn,
body.light-mode .lk-upgrade-btn { border-color: rgba(0,0,0,0.1); }
.lk-upgrade-btn {
  border-color: rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.08);
  color: #ffc107;
}
.lk-upgrade-btn:hover { background: rgba(255, 193, 7, 0.14); }
body.light-mode .lk-upgrade-btn {
  background: rgba(255, 193, 7, 0.12);
  color: #b8860b;
}

.lk-upgrade-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  margin-bottom: 4px;
}
body.light-mode .lk-upgrade-plan {
  border-color: rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
}
.lk-upgrade-plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.lk-upgrade-plan-row strong { color: var(--text); }

/* Locker page layout */
body.lk-locker-page {
  min-height: 100vh;
}
.lk-locker-page .lk-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0 16px;
}
.lk-locker-page .lk-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.lk-locker-page .lk-title-row { flex-shrink: 0; }
.lk-locker-page .lk-workspace {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}
.lk-locker-page .lk-footer { flex-shrink: 0; }

/* Desktop: equal-height panels with internal scroll */
@media (min-width: 761px) {
  body.lk-locker-page {
    height: 100vh;
    overflow: hidden;
  }
  .lk-locker-page .lk-main {
    overflow: hidden;
  }
  .lk-locker-page .lk-workspace {
    min-height: 400px;
    align-items: stretch;
  }
  .lk-locker-page .lk-panel {
    height: 100%;
    min-height: 400px;
    max-height: 100%;
    overflow: hidden;
  }
}

/* Styled scrollbars inside vault panels */
.lk-notes-list,
.lk-file-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 166, 255, 0.5) rgba(255, 255, 255, 0.06);
}
.lk-notes-list::-webkit-scrollbar,
.lk-file-list::-webkit-scrollbar {
  width: 6px;
}
.lk-notes-list::-webkit-scrollbar-track,
.lk-file-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  margin: 4px 0;
}
.lk-notes-list::-webkit-scrollbar-thumb,
.lk-file-list::-webkit-scrollbar-thumb {
  background: rgba(88, 166, 255, 0.45);
  border-radius: 999px;
}
.lk-notes-list::-webkit-scrollbar-thumb:hover,
.lk-file-list::-webkit-scrollbar-thumb:hover {
  background: rgba(88, 166, 255, 0.7);
}
body.light-mode .lk-notes-list,
body.light-mode .lk-file-list {
  scrollbar-color: rgba(88, 166, 255, 0.55) rgba(0, 0, 0, 0.08);
}
body.light-mode .lk-notes-list::-webkit-scrollbar-track,
body.light-mode .lk-file-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}

/* Workspace */
.lk-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  min-width: 0;
}

/* Panel */
.lk-panel {
  background: var(--bg); border-radius: var(--radius);
  box-shadow: var(--neu-deep); border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}
body.light-mode .lk-panel { border-color: rgba(0,0,0,0.07); }

.lk-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.lk-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
body.light-mode .lk-panel-header { border-bottom-color: rgba(0,0,0,0.06); }

.lk-panel-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.95rem; font-weight: 700;
}

.lk-add-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: rgba(255,255,255,0.06); color: var(--text);
  font-size: 1.2rem; font-weight: 400; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lk-add-btn:hover { background: rgba(255,255,255,0.12); }
body.light-mode .lk-add-btn { background: rgba(0,0,0,0.06); }
body.light-mode .lk-add-btn:hover { background: rgba(0,0,0,0.1); }

.lk-delete-all-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; border: none;
  background: rgba(248,81,73,0.1); color: #f85149;
  font-size: 0.75rem; font-weight: 700; transition: background 0.15s;
}
.lk-delete-all-btn:hover { background: rgba(248,81,73,0.22); }

/* Note cards */
.lk-notes-panel-body { overflow: hidden; }
.lk-notes-list {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lk-secure-nudge {
  flex-shrink: 0;
  margin: 0 12px 12px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px; border: none; text-align: left;
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.35);
  color: var(--text); cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  z-index: 2;
}
.lk-secure-nudge:hover {
  background: rgba(88, 166, 255, 0.18);
  border-color: rgba(88, 166, 255, 0.55);
  transform: translateY(-1px);
}
body.light-mode .lk-secure-nudge {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.lk-secure-nudge-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(88, 166, 255, 0.2); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.lk-secure-nudge-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lk-secure-nudge-title { font-size: 0.78rem; font-weight: 700; line-height: 1.3; }
.lk-secure-nudge-desc { font-size: 0.7rem; color: var(--text-muted); line-height: 1.35; }
.lk-notes-empty { font-size: 0.82rem; color: var(--text-muted); padding: 12px 8px; }

.lk-note-card {
  padding: 14px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06); background: var(--bg);
  box-shadow: var(--neu-flat); transition: box-shadow 0.15s, border-color 0.15s;
}
.lk-note-card:hover { box-shadow: var(--neu-raised); border-color: rgba(88,166,255,0.25); }
.lk-note-card-active { border-color: var(--blue) !important; box-shadow: 0 0 0 2px rgba(88,166,255,0.15), var(--neu-flat) !important; }
body.light-mode .lk-note-card { border-color: rgba(0,0,0,0.07); }

.lk-note-card-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 5px; word-break: break-word; overflow-wrap: anywhere; }
.lk-note-card-preview { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; overflow-wrap: anywhere; }

/* File vault */
.lk-files-panel-body {
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}
.lk-dropzone {
  margin: 12px; border: 2px dashed rgba(255,255,255,0.1); border-radius: 10px;
  padding: 18px 16px; text-align: center; cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-muted);
}
.lk-dropzone:hover, .lk-dropzone-hover {
  border-color: var(--blue); background: rgba(88,166,255,0.04);
}
body.light-mode .lk-dropzone { border-color: rgba(0,0,0,0.1); }
.lk-dropzone-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-top: 4px; }
.lk-dropzone-sub   { font-size: 0.78rem; color: var(--text-muted); }

/* Upload progress in dropzone */
.lk-upload-progress { width: 100%; padding: 8px 0; }
.lk-upload-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 10px; }
.lk-upload-fill { height: 100%; width: 0; background: var(--blue); transition: width 0.1s linear; border-radius: 2px; }
.lk-upload-text { font-size: 0.78rem; color: var(--blue); font-weight: 600; text-align: center; }


/* File list rows */
.lk-file-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lk-file-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 11px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06); background: var(--bg);
  box-shadow: var(--neu-flat);
}
body.light-mode .lk-file-row { border-color: rgba(0,0,0,0.07); }

.lk-file-type-icon { flex-shrink: 0; color: var(--text-muted); display: flex; }
.lk-file-info { flex: 1; min-width: 0; }
.lk-file-name { display: block; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-file-meta { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.lk-file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.lk-file-btn {
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.lk-file-btn:hover { background: rgba(255,255,255,0.1); }
.lk-file-dl  { color: var(--blue); }
.lk-file-del { color: #f85149; }
.lk-file-btn:disabled { opacity: 0.55; cursor: default; }
.lk-file-btn.is-busy { pointer-events: none; }
.lk-file-progress {
  flex: 1 1 100%;
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 2px;
}
.lk-file-progress[hidden] { display: none !important; }
.lk-file-progress-track,
.note-pg-file-progress-track {
  height: 6px; border-radius: 99px;
  background: rgba(88,166,255,0.15); overflow: hidden;
}
.lk-file-progress-bar,
.note-pg-file-progress-bar {
  height: 100%; width: 0%;
  background: var(--blue);
  transition: width 0.2s ease;
}
.lk-file-progress-text,
.note-pg-file-progress-text {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
}
.note-pg-file-row { flex-wrap: wrap; }
.note-pg-file-progress {
  flex: 1 1 100%;
  display: flex; flex-direction: column; gap: 6px;
}
.note-pg-file-progress[hidden] { display: none !important; }
body.light-mode .lk-file-btn { background: rgba(0,0,0,0.05); }
body.light-mode .lk-file-btn:hover { background: rgba(0,0,0,0.1); }

/* ── Note Editor Modal ── */
.lk-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lk-modal {
  background: var(--bg); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
  padding: 28px 28px 24px; width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 14px;
}
body.light-mode .lk-modal {
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.08);
}

.lk-modal-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(88,166,255,0.1); color: var(--blue);
  display: flex; align-items: center; justify-content: center; align-self: center;
}
.lk-modal-icon-danger { background: rgba(248,81,73,0.1); color: #f85149; }
.lk-modal-title { font-size: 1.1rem; font-weight: 700; text-align: center; margin-top: -4px; }
.lk-modal-desc  { font-size: 0.82rem; color: var(--text-muted); text-align: center; line-height: 1.5; }
.lk-modal-label { font-size: 0.78rem; color: var(--text-muted); }
.lk-modal-input {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); font-family: var(--font); font-size: 0.88rem; outline: none;
  transition: border-color 0.15s;
}
.lk-modal-input:focus { border-color: var(--blue); }
body.light-mode .lk-modal-input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }
.lk-modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.lk-modal-error   { font-size: 0.75rem; color: #f85149; min-height: 1em; text-align: center; }
.lk-modal-success { font-size: 0.75rem; color: var(--teal); text-align: center; }

/* Note modal specific */
.lk-note-modal-inner { max-width: 820px; width: 95vw; gap: 0; padding: 0; overflow: hidden; }
.lk-note-modal-header {
  display: flex; align-items: center; gap: 8px; padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body.light-mode .lk-note-modal-header { border-bottom-color: rgba(0,0,0,0.06); }
.lk-note-title-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 1.1rem; font-weight: 700; color: var(--text); font-family: var(--font);
}
.lk-note-title-input::placeholder { color: var(--text-muted); font-weight: 400; }
.lk-note-toolbar { display: flex; gap: 2px; align-items: center; }
.lk-toolbar-btn {
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-muted); display: flex; align-items: center;
  justify-content: center; font-size: 0.82rem; font-weight: 700;
}
.lk-toolbar-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
body.light-mode .lk-toolbar-btn:hover { background: rgba(0,0,0,0.06); }
.lk-toolbar-divider {
  width: 1px; height: 18px; background: rgba(255,255,255,0.12); margin: 0 4px; flex-shrink: 0;
}
body.light-mode .lk-toolbar-divider { background: rgba(0,0,0,0.12); }
.lk-modal-close {
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; margin-left: 4px;
  flex-shrink: 0;
}
.lk-modal-close:hover { background: rgba(248,81,73,0.1); color: #f85149; }

.lk-note-editor {
  min-height: 360px; max-height: 62vh; overflow-y: auto;
  padding: 20px 24px; outline: none; font-size: 0.95rem; line-height: 1.75;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.lk-note-editor:empty::before {
  content: attr(data-placeholder); color: var(--text-muted); pointer-events: none;
}
.lk-note-modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.06); gap: 10px;
}
body.light-mode .lk-note-modal-footer { border-top-color: rgba(0,0,0,0.06); }

/* Buttons */
.lk-btn-primary {
  padding: 9px 20px; border-radius: 8px; border: none;
  background: var(--blue); color: #fff; font-size: 0.85rem; font-weight: 700;
  transition: opacity 0.15s;
}
.lk-btn-primary:hover { opacity: 0.88; }
.lk-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.lk-btn-secondary {
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12); background: transparent;
  color: var(--text-muted); font-size: 0.85rem; font-weight: 600; transition: all 0.15s;
}
.lk-btn-secondary:hover { border-color: rgba(255,255,255,0.22); color: var(--text); }
body.light-mode .lk-btn-secondary { border-color: rgba(0,0,0,0.12); }
.lk-btn-danger {
  padding: 9px 20px; border-radius: 8px; border: none;
  background: rgba(248,81,73,0.15); border: 1px solid rgba(248,81,73,0.35);
  color: #f85149; font-size: 0.85rem; font-weight: 700; transition: all 0.15s;
}
.lk-btn-danger:hover { background: rgba(248,81,73,0.25); }
.lk-btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Footer ── */
.lk-footer {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 20px 40px; border-top: 1px solid rgba(255,255,255,0.07);
  background: var(--bg); font-size: 0.8rem;
}
body.light-mode .lk-footer { border-top-color: rgba(0,0,0,0.08); }
.lk-footer-logo { font-weight: 800; color: var(--text); }
.lk-footer-nav  { display: flex; gap: 20px; flex: 1; }
.lk-footer-nav a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.lk-footer-nav a:hover { color: var(--text); }
.lk-footer-copy { color: var(--text-muted); margin-left: auto; }

@media (max-width: 760px) {
  body.lk-locker-page {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .lk-workspace { 
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .lk-panel {
    height: auto;
    min-height: 420px;
    max-height: min(68vh, 640px);
    overflow: hidden;
    width: 100%;
  }
  .lk-shell { padding: 0 16px; }
  .lk-header { padding: 0 12px; height: 52px; min-width: 0; overflow: hidden; }
  .lk-logo { margin-right: 12px; font-size: 0.95rem; }
  .lk-nav { gap: 2px; }
  .lk-nav-item { padding: 5px 8px; font-size: 0.75rem; }
  .lk-footer { padding: 12px 16px; gap: 12px; }
  .lk-footer-copy { margin-left: 0; font-size: 0.72rem; }
  .lk-footer-nav { gap: 12px; }
  .lk-locker-page .lk-main {
    flex: none;
    min-height: auto;
    overflow: visible;
    padding: 16px 0 28px;
  }
  .lk-locker-page .lk-shell {
    flex: none;
    min-height: auto;
    overflow: visible;
  }
  .lk-locker-page .lk-workspace {
    flex: none;
    min-height: auto;
    grid-template-rows: none;
    gap: 20px;
  }
  .lk-locker-page .lk-panel {
    min-height: 420px;
    max-height: min(68vh, 640px);
  }
  .lk-locker-page .lk-footer {
    display: none;
  }
  .lk-delete-all-btn {
    max-width: 100%;
    flex-shrink: 1;
  }
  .lk-delete-all-btn span,
  .lk-delete-all-btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lk-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .lk-vault-title {
    font-size: 1.35rem;
    margin-bottom: 4px;
    word-break: break-word;
  }
  .lk-shield-icon svg { width: 18px; height: 18px; }
  .lk-sync-status { font-size: 0.72rem; }
  .lk-title-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .lk-force-sync-btn,
  .lk-upgrade-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }
}

/* ── Recent vaults row (with X remove button) ── */
.recent-vault-row {
  display: flex; align-items: center; gap: 6px;
}
.recent-vault-btn {
  flex: 1; text-align: left; padding: 10px 14px; font-size: 0.85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-vault-remove {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.recent-vault-remove:hover { background: rgba(248,81,73,0.12); color: #f85149; }

/* ── Note page (note.html) ── */
.note-pg-shell {
  flex: 1;
  width: 100%;
  /* no max-width — fill the full screen width */
  padding: 12px 32px 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}
.note-leave-overlay[hidden] { display: none; }
.note-leave-dialog {
  max-width: 420px;
  gap: 12px;
  padding: 30px;
}
.note-leave-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(88,166,255,0.12);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.note-leave-status {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.4;
}
.note-leave-status:empty { display: none; }
.note-leave-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}
.note-leave-actions .lk-btn-primary,
.note-leave-actions .lk-btn-secondary { width: 100%; justify-content: center; }
.note-leave-cancel {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px;
  cursor: pointer;
}
.note-leave-cancel:hover { color: var(--text); }
.note-delete-icon {
  background: rgba(248,81,73,0.12);
  color: #f85149;
}
.note-delete-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.note-delete-actions button {
  flex: 1;
  justify-content: center;
}
.note-delete-actions .lk-btn-danger {
  background: #f85149;
  border-color: #f85149;
  color: #fff;
}
.note-delete-actions .lk-btn-danger:hover { background: #e6423a; }
.note-pg-topbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px; flex-shrink: 0;
}
.note-pg-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 600;
  text-decoration: none; padding: 7px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1); transition: all 0.15s; flex-shrink: 0;
}
.note-pg-back:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
body.light-mode .note-pg-back { border-color: rgba(0,0,0,0.12); }
body.light-mode .note-pg-back:hover { border-color: rgba(0,0,0,0.22); }
.note-pg-new-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  color: var(--text-muted); border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1); background: transparent;
  cursor: pointer; transition: all 0.15s;
}
.note-pg-new-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.note-pg-new-btn:disabled { opacity: 0.5; cursor: default; }
body.light-mode .note-pg-new-btn { border-color: rgba(0,0,0,0.12); }
body.light-mode .note-pg-new-btn:hover { border-color: rgba(0,0,0,0.22); background: rgba(0,0,0,0.04); }
.note-pg-vault-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
  color: var(--text-muted); text-transform: uppercase; flex: 1;
}
.note-pg-reload-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  font-size: 0.8rem; font-weight: 600; transition: all 0.15s; cursor: pointer; flex-shrink: 0;
}
.note-pg-reload-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
body.light-mode .note-pg-reload-btn { background: rgba(0,0,0,0.04); }
body.light-mode .note-pg-reload-btn:hover { background: rgba(0,0,0,0.08); }

.note-pg-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: stretch;
  min-height: 0; /* critical — lets children shrink inside a flex parent */
}
.note-pg-editor-panel {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0; height: 100%;
}
body.light-mode .note-pg-editor-panel { border-color: rgba(0,0,0,0.07); }

.note-pg-editor-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
body.light-mode .note-pg-editor-header { border-bottom-color: rgba(0,0,0,0.06); }
.note-pg-editor-body {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100%;
  padding: 20px 24px;
  outline: none;
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}
.note-pg-editor-body:empty::before {
  content: attr(data-placeholder); color: var(--text-muted); pointer-events: none;
}
.note-pg-editor-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.06); gap: 10px;
  flex-shrink: 0;
}
body.light-mode .note-pg-editor-footer { border-top-color: rgba(0,0,0,0.06); }

.note-pg-file-panel {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0; height: 100%;
}
body.light-mode .note-pg-file-panel { border-color: rgba(0,0,0,0.07); }
.note-pg-file-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem; font-weight: 700; color: var(--text-muted);
}
body.light-mode .note-pg-file-header { border-bottom-color: rgba(0,0,0,0.06); }
.note-pg-dropzone {
  margin: 10px; border-radius: 8px;
  border: 1.5px dashed rgba(88,166,255,0.25);
  padding: 18px 10px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 6px;
  cursor: pointer; transition: all 0.15s; color: var(--text-muted);
}
.note-pg-dropzone:hover, .note-pg-dropzone-hover { border-color: var(--blue); color: var(--text); }
.note-pg-dropzone-default {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.note-pg-dropzone-uploading { pointer-events: none; opacity: 0.85; }
.note-pg-dropzone-status {
  font-size: 0.82rem; font-weight: 600; color: var(--blue); margin: 0;
}
.note-pg-dropzone-title { font-size: 0.82rem; font-weight: 600; }
.note-pg-dropzone-sub   { font-size: 0.72rem; }
.note-pg-editor-dragover {
  outline: 2px dashed rgba(88,166,255,0.45);
  outline-offset: -4px;
  background: rgba(88,166,255,0.06);
}
.note-pg-file-list {
  flex: 1; padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; /* scrolls when files exceed panel height */
  min-height: 0;
}
.note-pg-file-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02); transition: background 0.15s;
}
.note-pg-file-row:hover { background: rgba(255,255,255,0.05); }
body.light-mode .note-pg-file-row { border-color: rgba(0,0,0,0.07); }
.note-pg-file-name {
  flex: 1; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-pg-file-actions { display: flex; gap: 4px; flex-shrink: 0; }
.note-pg-file-btn {
  position: relative;
  width: 26px; height: 26px; border-radius: 5px; border: none;
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.note-pg-file-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
body.light-mode .note-pg-file-btn:hover { background: rgba(0,0,0,0.08); }
.note-pg-file-btn:disabled { opacity: 0.6; cursor: default; }
.note-pg-file-btn.is-busy svg { opacity: 0; }
.note-pg-file-btn.is-busy::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid rgba(88,166,255,0.25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: note-pg-spin 0.7s linear infinite;
}
@keyframes note-pg-spin { to { transform: rotate(360deg); } }

/* Note page loader */
body.note-pg-loading .lk-header,
body.note-pg-loading .lk-main {
  visibility: hidden;
  pointer-events: none;
}

body.lk-auth-pending .lk-main {
  visibility: hidden;
  pointer-events: none;
}
.note-pg-loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.note-pg-loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.note-pg-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 36px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
body.light-mode .note-pg-loader-card {
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.note-pg-loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: note-pg-spin 0.75s linear infinite;
}
@keyframes note-pg-spin { to { transform: rotate(360deg); } }
.note-pg-loader-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.note-pg-loader-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 860px) {
  .lk-header { padding: 0 12px; height: 52px; }
  .lk-logo { margin-right: 12px; font-size: 0.95rem; }
  .lk-nav-item { padding: 5px 8px; font-size: 0.75rem; }
  .note-pg-topbar {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
  }
  .note-pg-back {
    font-size: 0.75rem;
    padding: 6px 10px;
    order: 1;
  }
  .note-pg-new-btn {
    order: 1;
    width: 28px;
    height: 28px;
  }
  .note-pg-vault-label {
    order: 3;
    flex: 1 1 100%;
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .note-pg-reload-btn {
    order: 2;
    margin-left: auto;
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  .note-pg-editor-header {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 6px;
  }
  .lk-note-title-input {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 0.95rem;
  }
  .lk-note-toolbar {
    flex-wrap: wrap;
    gap: 4px;
  }
  body.note-page {
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .note-page .lk-main {
    height: auto;
    min-height: calc(100vh - 56px);
    max-height: none;
    overflow: visible;
    display: block;
  }
  .note-pg-shell {
    flex: none;
    min-height: calc(100vh - 56px);
    padding: 10px 16px 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }
  .note-pg-body {
    flex: none;
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
  }
  .note-pg-editor-panel {
    flex: none;
    height: 72vh;
    min-height: 420px;
    max-height: none;
    order: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .note-pg-file-panel {
    flex: none;
    order: 2;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .note-pg-dropzone {
    padding: 14px 10px;
    margin: 8px;
  }
  .note-pg-dropzone svg {
    width: 22px;
    height: 22px;
  }
  .note-pg-editor-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
  .note-pg-file-list {
    flex: 0 0 auto;
    max-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* ABOUT + PRIVACY PAGES */
.grid-body,
.privacy-vault-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.grid-bg,
.privacy-grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(88, 166, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 18% 8%, rgba(88, 213, 255, 0.12), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(63, 185, 80, 0.1), transparent 28%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

.grid-page-wrapper,
.privacy-page-shell {
  min-height: 100vh;
}

.grid-nav,
.privacy-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  padding: 14px 60px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.grid-logo-img,
.privacy-logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.grid-nav-links,
.privacy-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.grid-nav-links a,
.privacy-nav-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.grid-nav-links a:hover,
.grid-nav-links a.active,
.privacy-nav-links a:hover,
.privacy-nav-links a.active {
  color: var(--text);
}

.grid-main,
.privacy-main {
  width: 100%;
  padding: 0 40px 56px;
  box-sizing: border-box;
}

.grid-hero,
.privacy-hero,
.grid-row-split,
.privacy-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.grid-hero,
.privacy-hero {
  padding: 70px 0 56px;
}

.grid-kicker,
.privacy-kicker,
.dev-kicker,
.privacy-panel-label {
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.grid-title,
.privacy-title {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(2.2rem, 6vw, 5.6rem);
  line-height: 0.95;
  font-weight: 900;
}

.grid-desc,
.privacy-intro,
.section-text,
.box-text,
.tech-card-sub,
.privacy-policy-card p,
.privacy-control-strip p {
  color: var(--text-muted);
  line-height: 1.7;
}

.cyan-text,
.cyan-num {
  color: var(--cyan);
}

.tech-card,
.hacker-box,
.privacy-panel,
.privacy-policy-card,
.privacy-signal-panel,
.privacy-control-strip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--neu-deep);
}

.tech-card,
.hacker-box,
.privacy-panel,
.privacy-policy-card,
.privacy-signal-panel {
  padding: 28px;
}

.tech-card-header,
.box-header,
.box-header-flex,
.privacy-signal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.box-header {
  justify-content: flex-start;
}

.tech-image-container {
  margin-top: 22px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
}

.tech-image,
.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-section {
  position: relative;
  padding: 58px 0;
  border-top: 1px solid var(--border);
}

.bg-watermark {
  position: absolute;
  right: 0;
  top: 28px;
  color: rgba(255,255,255,0.035);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

body.light-mode .bg-watermark {
  color: rgba(0,0,0,0.045);
}

.section-title {
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
  font-weight: 900;
}

.box-title {
  margin-bottom: 12px;
  font-size: 1.35rem;
  font-weight: 900;
}

.no-margin {
  margin: 0;
}

.numbered-list,
.privacy-check-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  list-style: none;
}

.numbered-list li,
.privacy-check-list li {
  color: var(--text-muted);
  line-height: 1.65;
}

.cyan-num {
  display: inline-block;
  min-width: 34px;
  font-weight: 900;
}

.pill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  border: 1px solid rgba(88, 213, 255, 0.32);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
}

.transfer-header {
  margin-bottom: 32px;
  text-align: center;
}

.transfer-header h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.cyan-line {
  width: 84px;
  height: 3px;
  margin: 18px auto 0;
  background: var(--cyan);
  border-radius: 999px;
}

.portrait-container {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1;
  max-width: 360px;
  border: 1px solid var(--border);
  box-shadow: var(--neu-deep);
}

.quote {
  color: var(--text);
  line-height: 1.8;
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.stats-table {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stat-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: 0;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.stat-val {
  font-size: 0.86rem;
  font-weight: 900;
}

.privacy-signal-header strong {
  color: var(--teal);
}

.privacy-signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.privacy-signal-grid div {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--neu-inset);
}

.privacy-signal-grid span,
.privacy-control-strip span,
.privacy-card-num {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.privacy-signal-grid strong {
  color: var(--cyan);
  font-size: 1.08rem;
}

.privacy-panel-primary {
  border-color: rgba(88, 213, 255, 0.35);
}

.privacy-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 34px 0;
}

.privacy-policy-card h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.privacy-control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  margin: 16px 0 42px;
}

.privacy-return-link {
  flex-shrink: 0;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 1px;
}

@media (max-width: 920px) {
  .grid-nav,
  .privacy-nav {
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 14px;
  }

  .grid-nav-links,
  .privacy-nav-links {
    width: 100%;
    justify-content: center;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .grid-main,
  .privacy-main {
    padding: 0 20px 42px;
  }

  .grid-hero,
  .privacy-hero,
  .grid-row-split,
  .privacy-split,
  .privacy-policy-grid {
    grid-template-columns: 1fr;
  }

  .reverse-mobile .grid-col-left {
    order: 2;
  }

  .reverse-mobile .grid-col-right {
    order: 1;
  }

  .privacy-policy-grid {
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .grid-title,
  .privacy-title {
    font-size: 2.35rem;
  }

  .tech-card,
  .hacker-box,
  .privacy-panel,
  .privacy-policy-card,
  .privacy-signal-panel {
    padding: 20px;
  }

  .privacy-signal-grid,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .privacy-control-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ══════════════════════════════════════════
   CODE TRANSFER SECTION
══════════════════════════════════════════ */

.ct-section {
  margin: 48px 0 60px;
  animation: ct-fadein 0.5s ease both;
}

@keyframes ct-fadein {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ct-section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 32px;
}

.ct-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

.ct-section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.6;
}

/* ── Two-panel layout ── */
.ct-panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: start;
}

.ct-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--neu-raised);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.2s;
}

.ct-panel:hover {
  box-shadow: var(--neu-deep);
}

.ct-panel-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.ct-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.ct-badge-send {
  background: rgba(88, 166, 255, 0.15);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.ct-badge-recv {
  background: rgba(63, 185, 80, 0.15);
  color: var(--teal);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.ct-panel-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Dropzone ── */
.ct-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(255,255,255,0.02);
}

.ct-dropzone:hover,
.ct-dropzone.drag-over {
  border-color: var(--blue);
  background: rgba(88, 166, 255, 0.05);
}

.ct-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.ct-upload-icon {
  color: var(--text-muted);
  transition: color 0.2s;
}

.ct-dropzone:hover .ct-upload-icon { color: var(--blue); }

.ct-drop-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.ct-drop-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ct-browse-btn {
  pointer-events: all;
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.ct-browse-btn:hover {
  background: rgba(88, 166, 255, 0.22);
  border-color: var(--blue);
}

/* ── Staged files ── */
.ct-staged-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ct-staged-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  animation: ct-fadein 0.25s ease both;
}

.ct-staged-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ct-staged-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  color: var(--text);
}

.ct-staged-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ct-staged-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 0;
  transition: color 0.2s;
}

.ct-staged-remove:hover { color: #f85149; }

/* ── Generate button ── */
.ct-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(88,166,255,0.3);
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.ct-generate-btn:hover {
  background: #4a96ef;
  box-shadow: 0 6px 20px rgba(88,166,255,0.4);
}

.ct-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Loading spinner ── */
.ct-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--text-muted);
  justify-content: center;
  padding: 8px 0;
}

.ct-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: ct-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes ct-spin {
  to { transform: rotate(360deg); }
}

/* ── Code display ── */
.ct-code-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: ct-fadein 0.4s ease both;
}

.ct-code-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ct-code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 10px;
  padding: 14px 18px;
}

.ct-code-value {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--blue);
  flex: 1;
  text-align: center;
  user-select: all;
}

.ct-copy-btn {
  background: rgba(88, 166, 255, 0.15);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--blue);
  border-radius: 6px;
  padding: 7px 9px;
  line-height: 0;
  flex-shrink: 0;
  transition: background 0.2s;
}

.ct-copy-btn:hover { background: rgba(88, 166, 255, 0.28); }
.ct-copy-btn.copied { color: var(--teal); border-color: var(--teal); background: rgba(63,185,80,0.12); }

.ct-code-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ct-code-hint svg { flex-shrink: 0; margin-top: 2px; }

/* Expiry countdown bar */
.ct-expiry-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.ct-expiry-bar {
  height: 100%;
  width: 100%;
  background: var(--blue);
  transform-origin: left;
  animation: ct-expiry 60s linear forwards;
}

@keyframes ct-expiry {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Reset button ── */
.ct-reset-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  align-self: center;
  transition: border-color 0.2s, color 0.2s;
}

.ct-reset-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ── Error text ── */
.ct-error {
  font-size: 0.78rem;
  color: #f85149;
  min-height: 18px;
  line-height: 1.4;
}

/* ── Divider ── */
.ct-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  padding-top: 80px;
}

.ct-divider-line {
  flex: 1;
  width: 1px;
  background: var(--border);
  min-height: 40px;
}

.ct-divider-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 6px 4px;
}

/* ── Receive input ── */
.ct-receive-input-group {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.ct-code-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.ct-code-input:focus {
  border-color: var(--teal);
  background: rgba(63, 185, 80, 0.05);
}

.ct-code-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: 0.82rem;
}

.ct-retrieve-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--teal);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(63, 185, 80, 0.25);
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.ct-retrieve-btn:hover {
  background: #37a845;
  box-shadow: 0 6px 20px rgba(63,185,80,0.35);
}

.ct-retrieve-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Incoming files ── */
.ct-incoming {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: ct-fadein 0.35s ease both;
}

.ct-incoming-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: 8px;
  padding: 9px 13px;
}

.ct-incoming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-incoming-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  animation: ct-fadein 0.25s ease both;
}

.ct-incoming-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text);
  min-width: 0;
}

.ct-incoming-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.ct-incoming-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ct-dl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 7px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.ct-dl-btn:hover { background: rgba(63, 185, 80, 0.22); }
.ct-dl-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Responsive ── */
@media (max-width: 800px) {
  .ct-panels {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ct-divider {
    flex-direction: row;
    padding: 0;
    padding-left: 60px;
  }

  .ct-divider-line {
    flex: 1;
    width: auto;
    height: 1px;
    min-height: unset;
  }

  .ct-receive-input-group {
    flex-direction: column;
  }
}

#droplock-toast-host {
  position: fixed;
  z-index: 4000;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
.droplock-toast {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface, #161b22);
  border: 1px solid rgba(88,166,255,0.35);
  color: var(--text, #e6edf3);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  animation: droplock-toast-in 0.2s ease;
}
.droplock-toast-error {
  border-color: rgba(248,81,73,0.5);
  background: #2b1517;
  color: #ffb4ae;
}
.droplock-toast-success {
  border-color: rgba(63,185,80,0.45);
}
.droplock-toast-out { opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
@keyframes droplock-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
