:root {
  --ink: #03030a;
  --ink-2: #080914;
  --panel: rgba(10, 12, 24, 0.76);
  --panel-strong: rgba(4, 5, 12, 0.92);
  --cyan: #00f5ff;
  --magenta: #ff2bd6;
  --lime: #86ff4d;
  --orange: #ff9f1c;
  --yellow: #fff4a3;
  --text: #e8f8ff;
  --muted: #93a6b8;
  --line: rgba(0, 245, 255, 0.22);
  --danger: #ff476f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 43, 214, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 10%, rgba(0, 245, 255, 0.14), transparent 30rem),
    radial-gradient(circle at 50% 95%, rgba(134, 255, 77, 0.09), transparent 32rem),
    linear-gradient(135deg, #020208 0%, #080912 48%, #03030a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: white; text-shadow: 0 0 12px var(--cyan); }

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 12, 24, 0.84), rgba(3, 3, 10, 0.80));
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.10) inset,
    0 22px 80px rgba(0, 0, 0, 0.35),
    0 0 42px rgba(0, 245, 255, 0.05);
  backdrop-filter: blur(18px);
  border-radius: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  margin-bottom: 18px;
}

.brand {
  color: var(--magenta);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.logo-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.logo-brand img {
  display: block;
  width: min(420px, 58vw);
  height: auto;
  max-height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 43, 214, 0.28)) drop-shadow(0 0 22px rgba(0, 245, 255, 0.18));
}

.toplinks {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.user-pill {
  border: 1px solid rgba(134,255,77,.36);
  color: var(--lime);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(0,0,0,.32);
  font-size: .84rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -100px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 43, 214, 0.22), transparent 68%);
}

.eyebrow {
  color: var(--magenta);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-shadow: 0 0 22px rgba(0, 245, 255, 0.28), 0 0 36px rgba(255, 43, 214, 0.18);
}

h2 { margin: 0 0 10px; }

.subtext {
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.status-grid { display: grid; gap: 14px; align-self: center; }
.status-card {
  border: 1px solid rgba(255, 43, 214, 0.22);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.32);
  padding: 16px;
}
.status-card span {
  display: block;
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}
code { color: var(--yellow); word-break: break-all; }

.messages { margin: 16px 0; display: grid; gap: 10px; }
.message {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--line);
}
.message.ok { border-color: rgba(134, 255, 77, 0.45); color: var(--lime); }
.message.warn { border-color: rgba(255, 244, 163, 0.45); color: var(--yellow); }
.message.bad { border-color: rgba(255, 71, 111, 0.5); color: var(--danger); }

.toolbar {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.pathline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-family: "JetBrains Mono", "Cascadia Mono", monospace;
}
.crumb { color: var(--cyan); }
.slash { color: var(--magenta); }

.upload-box, .inline-form, .lock-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lock-form { margin-top: 18px; justify-content: flex-start; }

.file-input input { display: none; }
.file-input span, button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(0, 245, 255, 0.36);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  color: var(--cyan);
  padding: 9px 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.07);
  white-space: nowrap;
}

button:hover, .file-input span:hover, .button-link:hover {
  border-color: var(--magenta);
  color: white;
  text-shadow: 0 0 12px var(--magenta);
}

button.danger, .danger {
  border-color: rgba(255, 71, 111, .5);
  color: var(--danger);
}
button.tiny {
  min-height: 30px;
  padding: 5px 10px;
  font-size: .78rem;
}
.button-link.wide { width: 100%; }

input, select {
  background: rgba(0,0,0,.44);
  border: 1px solid rgba(0,245,255,.28);
  color: var(--text);
  border-radius: 12px;
  min-height: 40px;
  padding: 10px 12px;
  outline: none;
}
input:focus, select:focus { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(255,43,214,.12); }

.auth {
  max-width: 560px;
  margin: 80px auto 0;
  padding: 28px;
}
.stack-form { display: grid; gap: 14px; margin-top: 22px; }
.stack-form label { display: grid; gap: 7px; color: var(--yellow); font-weight: 700; }
.stack-form button { justify-self: start; }

.table { margin-top: 18px; overflow: hidden; }
.table-head, .row {
  display: grid;
  grid-template-columns: 110px minmax(240px, 1fr) 120px 170px 170px;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
}
.dump-head, .dump-row { grid-template-columns: 90px minmax(220px, 1fr) 100px 150px minmax(380px, .8fr); }
.table-head {
  color: var(--cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background: rgba(0, 0, 0, 0.32);
  border-bottom: 1px solid var(--line);
}
.row { border-bottom: 1px solid rgba(255,255,255,0.055); }
.row:hover { background: rgba(0, 245, 255, 0.045); }
.type { font-weight: 900; letter-spacing: .12em; }
.type.dir { color: var(--lime); }
.type.file { color: var(--orange); }
.name { min-width: 0; overflow-wrap: anywhere; }
.name .icon { color: var(--magenta); margin-right: 7px; }
.mime { color: var(--muted); font-size: .78rem; margin-left: 8px; }
.muted { color: var(--muted); }
.actions, .manage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rename-form, .move-form { display: inline-flex; gap: 6px; align-items: center; }
.rename-form input { width: 120px; min-height: 30px; padding: 5px 8px; border-radius: 8px; }
.move-form select { width: 145px; min-height: 30px; padding: 5px 8px; border-radius: 8px; }
.empty { padding: 28px; color: var(--muted); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.settings-card { padding: 22px; }
.user-list { display: grid; gap: 10px; margin-top: 16px; }
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.26);
  border-radius: 14px;
  padding: 12px;
}
.status { display: block; font-size: .78rem; margin-top: 4px; }
.ok-text { color: var(--lime); }
.warn-text { color: var(--yellow); }
.fineprint { color: var(--muted); font-size: .86rem; line-height: 1.5; }

@media (max-width: 860px) {
  .hero, .settings-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .logo-brand img { width: min(300px, 70vw); max-height: 68px; }
  .table { overflow-x: auto; }
  .table-head, .row { min-width: 760px; }
  .dump-head, .dump-row { min-width: 1040px; }
  .toolbar { align-items: stretch; }
  .upload-box { justify-content: flex-start; }
}


/* v0.2.3 mobile pass */
.full-width { width: 100%; }
.file-input.full-width span { width: 100%; }
.compact-upload { margin-top: 14px; }

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1240px);
    padding: 10px 0 24px;
  }

  .panel {
    border-radius: 16px;
  }

  .topbar {
    padding: 10px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .logo-brand {
    justify-content: center;
  }

  .logo-brand img {
    width: min(100%, 360px);
    max-height: 58px;
  }

  .toplinks {
    justify-content: center;
    gap: 10px;
  }

  .toplinks a,
  .user-pill {
    font-size: .86rem;
  }

  .hero {
    padding: 18px;
    gap: 16px;
  }

  h1 {
    font-size: clamp(2rem, 14vw, 3.4rem);
  }

  .toolbar {
    padding: 12px;
    gap: 12px;
  }

  .pathline {
    width: 100%;
    font-size: .9rem;
  }

  .upload-box,
  .inline-form,
  .lock-form,
  .stack-form {
    width: 100%;
    justify-content: stretch;
  }

  .upload-box > *,
  .inline-form > *,
  .lock-form > *,
  .stack-form > *,
  .file-input span,
  button,
  .button-link {
    width: 100%;
  }

  input {
    width: 100%;
    min-width: 0;
  }

  /* v0.2.7: mobile file browser uses a compact list, not card tiles. */
  .table {
    overflow: hidden;
    display: block;
    margin-top: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 12, 24, 0.84), rgba(3, 3, 10, 0.80));
    border: 1px solid var(--line);
    box-shadow:
      0 0 0 1px rgba(255, 43, 214, 0.08) inset,
      0 16px 46px rgba(0, 0, 0, 0.28);
  }

  .table-head,
  .dump-head {
    display: none;
  }

  .table-head,
  .row,
  .dump-head,
  .dump-row {
    min-width: 0;
  }

  .row,
  .dump-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    grid-template-areas:
      "type name actions"
      "type size actions";
    align-items: center;
    gap: 4px 8px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.075);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

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

  .row > div:nth-child(1),
  .dump-row > div:nth-child(1) {
    grid-area: type;
    font-size: .72rem;
    line-height: 1.1;
  }

  .row > div:nth-child(2),
  .dump-row > div:nth-child(2) {
    grid-area: name;
    min-width: 0;
  }

  .row > div:nth-child(2) a,
  .dump-row > div:nth-child(2) a {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .row > div:nth-child(3),
  .dump-row > div:nth-child(3) {
    grid-area: size;
    color: var(--yellow);
    font-size: .78rem;
  }

  /* Hide date modified on mobile. */
  .row > div:nth-child(4),
  .dump-row > div:nth-child(4) {
    display: none;
  }

  .row > div:nth-child(5),
  .dump-row > div:nth-child(5) {
    grid-area: actions;
    justify-self: end;
    min-width: 0;
  }

  .actions {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .actions a {
    font-size: .78rem;
    white-space: nowrap;
  }

  .manage-actions {
    width: auto;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 6px;
  }

  .manage-actions a,
  .manage-actions button,
  .manage-actions input,
  .manage-actions select {
    width: 100%;
  }

  .rename-form,
  .move-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .rename-form input,
  .rename-form button,
  .move-form select,
  .move-form button {
    width: 100%;
  }

  .mime {
    display: none;
  }

  .empty {
    padding: 18px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-card {
    padding: 16px;
  }

  .user-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth {
    margin: 28px auto 0;
    padding: 20px;
  }
}


/* v0.2.8 upload progress dialog */
.upload-dialog {
  width: min(420px, calc(100% - 28px));
  border: 1px solid rgba(0, 245, 255, 0.45);
  border-radius: 22px;
  padding: 0;
  color: var(--text);
  background: linear-gradient(180deg, rgba(10, 12, 24, 0.98), rgba(3, 3, 10, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.16) inset,
    0 0 60px rgba(0, 245, 255, 0.13),
    0 24px 80px rgba(0, 0, 0, 0.55);
}

.upload-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
}

.upload-dialog-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.upload-dialog-title {
  color: var(--magenta);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.upload-dialog-status {
  color: var(--yellow);
  font-size: .94rem;
}

.upload-progress-track {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 245, 255, 0.36);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--lime));
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.4);
  transition: width 120ms linear;
}

.upload-progress-bar.indeterminate {
  width: 42%;
  animation: upload-indeterminate 1.05s infinite ease-in-out;
}

.upload-progress-meta {
  display: flex;
  justify-content: flex-end;
  color: var(--lime);
  font-weight: 900;
  font-family: "JetBrains Mono", "Cascadia Mono", monospace;
}

@keyframes upload-indeterminate {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(255%); }
}

button:disabled {
  opacity: .62;
  cursor: wait;
}

/* v0.2.9 dump move controls */
select option { background: #050610; color: var(--text); }
.move-form { border-left: 1px solid rgba(0,245,255,.16); padding-left: 6px; }
@media (max-width: 640px) { .move-form { border-left: 0; padding-left: 0; } }

/* v0.2.12 dump bulk actions */
.bulk-actions {
  margin-top: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: center;
}
.danger-zone {
  border-color: rgba(255, 71, 111, .34);
  box-shadow:
    0 0 0 1px rgba(255, 71, 111, .10) inset,
    0 22px 80px rgba(0, 0, 0, 0.35),
    0 0 42px rgba(255, 71, 111, 0.04);
}
.bulk-action-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}
.bulk-delete-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.bulk-delete-form input {
  min-width: 190px;
}
@media (max-width: 640px) {
  .bulk-actions {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .bulk-action-buttons,
  .bulk-delete-form {
    width: 100%;
    justify-content: stretch;
  }
  .bulk-action-buttons > *,
  .bulk-delete-form > * {
    width: 100%;
  }
}

/* v0.3.0 menu rewrite */
.menu-hero {
  margin-top: 18px;
  padding: 28px;
  overflow: hidden;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.choice-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  min-height: 180px;
  align-content: center;
  color: var(--text);
}
.choice-card strong {
  color: var(--cyan);
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.choice-card small {
  color: var(--muted);
  line-height: 1.45;
}
.choice-card:hover strong {
  color: white;
  text-shadow: 0 0 16px var(--cyan);
}
.choice-kicker {
  color: var(--magenta);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.danger-choice strong { color: var(--danger); }
.addremove-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.folder-tools {
  margin-top: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, auto);
  gap: 16px;
  align-items: center;
}
.user-folder-check {
  justify-content: flex-start;
  margin-bottom: 8px;
}
@media (max-width: 640px) {
  .menu-hero { padding: 18px; }
  .choice-grid { grid-template-columns: 1fr; gap: 12px; }
  .choice-card { min-height: 136px; padding: 18px; }
  .folder-tools { grid-template-columns: 1fr; padding: 14px; }
}

/* v0.3.2 cleaner directory upload panel */
.directory-upload-panel {
  margin-top: 18px;
  padding: 14px;
}
.directory-upload-panel .directory-upload-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: none;
}
.upload-target-card {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(0, 245, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.055), transparent 42%),
    rgba(0, 0, 0, 0.30);
  box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.06) inset;
}
.upload-target-card:hover {
  border-color: rgba(0, 245, 255, 0.34);
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.10) inset,
    0 0 26px rgba(0, 245, 255, 0.055);
}
.upload-target-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.upload-target-title {
  color: var(--yellow);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.upload-target-subtitle {
  color: var(--muted);
  font-size: .84rem;
  overflow-wrap: anywhere;
}
.upload-target-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.compact-file span,
button.primary-action {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 14px;
  min-width: 128px;
}
button.primary-action {
  border-color: rgba(255, 43, 214, 0.46);
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.18), rgba(0, 245, 255, 0.10));
}
button.primary-action:hover {
  border-color: var(--cyan);
  color: white;
  text-shadow: 0 0 12px var(--cyan);
}
@media (max-width: 900px) {
  .directory-upload-panel .directory-upload-options {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .directory-upload-panel {
    padding: 10px;
  }
  .upload-target-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .upload-target-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .compact-file span,
  button.primary-action {
    width: 100%;
    min-width: 0;
  }
}
