:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #9aa7b8;
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(10, 17, 28, 0.74);
  --panel-strong: rgba(13, 23, 38, 0.9);
  --blue: #4cc9f0;
  --green: #80ed99;
  --yellow: #ffbe0b;
  --red: #ff5c7a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, #070b12 0%, #10192a 44%, #0b121b 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 88%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

#mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 13, 22, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #06111d;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(76, 201, 240, 0.25);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.hero-grid {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 22px;
  align-items: end;
  padding: 74px 0 26px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(48px, 8vw, 98px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-text {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.status-rack,
.hint-stack {
  display: grid;
  gap: 10px;
}

.status-rack > div,
.hint-stack > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.status-rack span,
.hint-stack span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-rack strong,
.hint-stack strong {
  display: block;
}

.transfer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.panel,
.saved-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title > span {
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

.drop-zone {
  min-height: 280px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(76, 201, 240, 0.5);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(76, 201, 240, 0.08), rgba(128, 237, 153, 0.05)),
    rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.drop-zone.dragging {
  transform: scale(1.01);
  border-color: rgba(128, 237, 153, 0.78);
  background: rgba(128, 237, 153, 0.1);
}

.drop-zone input {
  display: none;
}

.drop-zone strong,
.drop-zone small {
  display: block;
}

.drop-zone small,
.fine {
  color: var(--muted);
}

.drop-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06111d;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-size: 36px;
  line-height: 1;
  box-shadow: 0 18px 34px rgba(76, 201, 240, 0.2);
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow));
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--yellow));
}

.upload-actions,
.pin-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.primary,
.ghost,
.delete-btn,
.icon-btn {
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary,
.ghost,
.delete-btn {
  padding: 0 16px;
  white-space: nowrap;
}

.primary {
  color: #06111d;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 18px 38px rgba(76, 201, 240, 0.22);
  font-weight: 850;
}

.ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.delete-btn {
  color: #ffd7df;
  border: 1px solid rgba(255, 92, 122, 0.34);
  background: rgba(255, 92, 122, 0.12);
}

.icon-btn {
  width: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.primary:hover,
.ghost:hover,
.delete-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.save-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.save-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.share-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.share-card {
  display: grid;
  grid-template-columns: minmax(140px, auto) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(128, 237, 153, 0.28);
  border-radius: var(--radius);
  background: rgba(128, 237, 153, 0.08);
}

.pin-box span,
.share-link-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.pin-box strong {
  font-size: 40px;
  line-height: 1;
}

.share-link-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(128, 237, 153, 0.22);
}

.share-link-box a,
.file-share-output a {
  min-width: 0;
  overflow: hidden;
  color: var(--blue);
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

input:focus,
select:focus {
  border-color: rgba(76, 201, 240, 0.68);
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.12);
}

.fine {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.receive-panel {
  min-height: 100%;
}

.hint-stack {
  margin-top: 22px;
}

.saved-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 18px 0 40px;
  padding: 18px;
}

.saved-strip h2 {
  margin-bottom: 8px;
}

.file-browser-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(20px);
}

.file-browser-panel {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.file-browser-head,
.file-browser-toolbar,
.file-browser-summary,
.file-share-output {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.file-browser-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.file-browser-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
}

.file-browser-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 0 20px 20px;
}

.file-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.file-type-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #06111d;
  background: linear-gradient(135deg, var(--yellow), var(--green));
  font-size: 11px;
  font-weight: 900;
}

.file-row-meta {
  min-width: 0;
}

.file-row-meta strong,
.file-row-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row-meta span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.file-empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
}

.file-share-output {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(128, 237, 153, 0.25);
  border-bottom: 0;
  background: rgba(128, 237, 153, 0.08);
}

.file-share-output span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.file-share-output strong {
  font-size: 24px;
}

.login-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.login-panel h1 {
  margin: 0;
  font-size: 52px;
  line-height: 0.96;
}

@media (max-width: 900px) {
  .hero-grid,
  .transfer-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    padding-top: 42px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .saved-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .upload-actions,
  .pin-entry,
  .share-card,
  .share-link-box,
  .file-browser-toolbar,
  .file-row,
  .file-share-output {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .file-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .file-row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .file-row-actions button {
    padding: 0 8px;
  }

  h1 {
    font-size: 44px;
  }
}
