:root {
  --bg: #090b0f;
  --bg-raise: rgba(16, 20, 26, 0.8);
  --text: #e8eeec;
  --muted: #8e9c99;
  --cyan: #79e2d4;
  --cyan-deep: #1c8f86;
  --cyan-ink: #06211e;
  --magenta: #e0b0dc;
  --line: rgba(121, 226, 212, 0.2);
  --line-strong: rgba(121, 226, 212, 0.45);
  --danger: #f0b4c4;
  --ok: #9ee0bc;
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(121, 226, 212, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 226, 212, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 12%, #000 15%, transparent 72%);
}

body::after {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028),
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.18;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

.wrap {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.mark {
  position: relative;
  color: var(--cyan);
  flex: 0 0 auto;
  margin-top: 4px;
}

.mark-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 8px rgba(224, 176, 220, 0.7);
}

.titles { min-width: 0; }

h1, h2, p { margin: 0; }

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 3.35rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
}

h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--magenta);
}

.tagline {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.02rem;
}

.top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(9, 11, 15, 0.45);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(121, 226, 212, 0.8);
}

.pill.is-live .dot { animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
  50% { opacity: 0.3; }
}

.card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 0 32px rgba(121, 226, 212, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  padding: 22px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 28px 16px;
  border: 1px dashed rgba(121, 226, 212, 0.35);
  border-radius: 16px;
  background: rgba(121, 226, 212, 0.025);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dropzone.is-over {
  border-style: solid;
  border-color: var(--cyan);
  background: rgba(121, 226, 212, 0.07);
  box-shadow: inset 0 0 0 1px rgba(121, 226, 212, 0.2), 0 0 24px rgba(121, 226, 212, 0.08);
}

.dropzone.is-locked { opacity: 0.6; }

.drop-title {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.drop-or { color: var(--muted); font-size: 0.9rem; }

.file-list, .offer-list, .receiver-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.file-list:empty, .offer-list:empty, .receiver-list:empty {
  display: none;
  margin: 0;
}

.file, .offer, .receiver {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 4px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.file:hover { background: rgba(121, 226, 212, 0.04); }

.file-name, .offer-name, .transfer-name, .receiver-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.file-name { font-weight: 500; }

.size, .meta, .label, .qr-caption, .remote-line, .mono {
  font-family: var(--mono);
}

.size, .meta, .hint, .qr-caption, .remote-line {
  color: var(--muted);
  font-size: 0.84rem;
}

.hint { margin-top: 8px; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.optional {
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.field { display: block; margin-top: 18px; }

input[type="text"], input[type="password"], input:not([type]) , #share-link {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(121, 226, 212, 0.22);
  background: rgba(6, 8, 12, 0.55);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#share-link { font-family: var(--mono); font-size: 0.82rem; }

input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(121, 226, 212, 0.12);
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #12161c inset;
}

.btn {
  border-radius: 999px;
  padding: 11px 16px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, #97f3e6, #63d6c8);
  color: var(--cyan-ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 8px 22px rgba(99, 214, 200, 0.16);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #b6fff4, #74e4d6);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(121, 226, 212, 0.05);
}

#create-btn, #password-btn, #download-btn { margin-top: 16px; min-width: 160px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: rgba(224, 176, 220, 0.55);
  background: rgba(224, 176, 220, 0.06);
}

.notice, .alert, .note {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 16px;
}

.notice {
  border: 1px solid var(--line);
  background: rgba(121, 226, 212, 0.06);
  color: var(--text);
}

.alert {
  border: 1px solid rgba(240, 180, 196, 0.4);
  background: rgba(240, 180, 196, 0.08);
  color: #ffd7e2;
}

.note {
  border: 1px solid rgba(224, 176, 220, 0.28);
  background: rgba(224, 176, 220, 0.06);
  color: var(--text);
}

.share-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-row input { min-width: 0; }

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: #f4fffc;
  color: #10211f;
}

.qr-wrap canvas, .qr-wrap img { display: block; width: 168px; height: 168px; }

.qr-caption { color: #3d5c57; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.68rem; }

.receivers { margin-top: 22px; }

.section-head, .list-head, .action-row, .transfer-top, .receiver-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.receiver {
  padding: 12px 0;
}

.receiver-head .status {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
}

.receiver-head .status.is-bad { color: var(--danger); }
.receiver-head .status.is-ok { color: var(--ok); }

.transfer { margin-top: 10px; }

.transfer-top { margin-bottom: 6px; }

.bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan) 72%, var(--magenta));
  transition: width 0.2s ease;
}

.offer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  padding: 12px 0;
}

.offer .bar, .offer .meta { grid-column: 2 / -1; }

.offer .meta.is-ok { color: var(--ok); font-weight: 500; }
.offer.is-done .offer-name { color: var(--muted); }
.offer .meta.is-bad { color: var(--danger); }

.check-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1c8f86;
}

.list-head { margin-top: 4px; }

.action-row { gap: 10px; flex-wrap: wrap; }

.status-line { min-height: 1.4em; margin-bottom: 8px; }

.remote-line { margin-bottom: 8px; }

.remote-line .mono { color: var(--cyan); }

#host-panel { margin-top: 18px; }

#reset-btn { margin-top: 18px; }

.foot {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .wrap { width: min(760px, calc(100% - 24px)); padding-top: 24px; }
  .top, .share-grid, .share-row, .top-actions { flex-direction: column; align-items: stretch; }
  .top { display: flex; }
  .share-grid { display: flex; }
  .top-actions, .qr-wrap { align-items: flex-start; }
  .card { padding: 16px; border-radius: 16px; }
  .dropzone { min-height: 150px; }
  #create-btn, #download-btn, #password-btn, #copy-btn, .btn-ghost { width: 100%; }
  .file { grid-template-columns: minmax(0, 1fr) auto; }
  .file .size { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
