:root {
  --cream: #fefdfe;
  --ink: #2f0b23;
  --blush: #de93c1;
  --coral: #ec605a;
  --plum: #754666;
  --rose: #bd75a1;
  --soft: #f7eaf2;
  --muted: #9a6f8b;
  --line: rgba(47, 11, 35, 0.08);
  --shadow: 0 18px 40px rgba(47, 11, 35, 0.12);
  --radius: 28px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top);
  --safe-b: env(safe-area-inset-bottom);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 10% 0%, #f8d6ea 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 20%, #e8a8d0 0%, transparent 50%),
    radial-gradient(80% 60% at 80% 100%, #f3c5c2 0%, transparent 45%),
    linear-gradient(160deg, #f6cfe6 0%, #fdeff7 42%, #e9b7d4 100%);
}

.stage {
  height: 100dvh;
  width: 100%;
  display: flex;
  justify-content: center;
}

.device {
  width: min(430px, 100%);
  height: 100dvh;
  background: color-mix(in srgb, var(--cream) 86%, white);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: calc(18px + var(--safe-t)) 22px calc(18px + var(--safe-b));
  position: relative;
  overflow: hidden;
}

.device::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(222, 147, 193, 0.35), transparent 70%);
  top: -70px;
  right: -80px;
  pointer-events: none;
}

.top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 4px 18px;
}

.top__hello {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.top__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rose);
}

.top__tag {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--plum);
}

.tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(47, 11, 35, 0.06);
  flex: 0 0 auto;
}

.tabs__btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  color: var(--plum);
  border: 0;
  border-radius: 999px;
  padding: 12px 8px;
  cursor: pointer;
}

.tabs__btn.is-active {
  background: var(--ink);
  color: var(--cream);
}

.workspace {
  position: relative;
  min-height: 0;
  margin-top: 18px;
}

.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.card {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.card__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(254, 253, 254, 0.62);
}

.card__input {
  width: 100%;
  font-family: inherit;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--cream);
  background: transparent;
  border: 0;
  outline: none;
  padding: 0;
}

@media (max-width: 480px) {
  .card__input {
    font-size: 24px;
  }
}

.card__input::placeholder {
  color: rgba(254, 253, 254, 0.28);
}

.kind {
  border: 0;
  margin: 0;
  padding: 4px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 0 0 auto;
}

.kind__opt {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kind__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kind__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(47, 11, 35, 0.08);
}

.kind__opt input:checked + .kind__icon {
  background: var(--soft);
  color: var(--coral);
  box-shadow: 0 0 0 3px rgba(236, 96, 90, 0.22);
}

.kind__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.slot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.slot > div {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}

.field--grow {
  flex: 1;
  margin-bottom: 0;
}

.field__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--plum);
}

.field__danger {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--coral);
}

.field__input,
.field__area {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: none;
}

.field__input {
  padding: 14px 16px;
}

.field__area {
  flex: 1;
  min-height: 0;
  resize: none;
  padding: 16px;
  line-height: 1.5;
}

.field__input:focus,
.field__area:focus {
  border-color: var(--blush);
  box-shadow: 0 0 0 4px rgba(222, 147, 193, 0.25);
}

.is-hidden {
  display: none !important;
}

.file-slots {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-slot {
  position: relative;
  flex: 1;
  min-height: 64px;
  display: flex;
  align-items: center;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(47, 11, 35, 0.06);
}

.file-slot.is-filled {
  padding-right: 8px;
}

.file-slot__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-slot__pick {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 16px;
  cursor: pointer;
}

.file-slot.is-filled .file-slot__pick {
  padding-right: 8px;
}

.file-slot__empty {
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

.file-slot__name {
  display: block;
  max-width: 100%;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-slot__size {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.file-slot__clear {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.file-slot__clear[hidden] {
  display: none;
}

.file-slot__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--soft);
  overflow: hidden;
  border-radius: 0 0 22px 22px;
}

.file-slot__progress[hidden] {
  display: none;
}

.file-slot__progress-bar {
  height: 100%;
  background: var(--blush);
  width: 0%;
  transition: width 0.3s ease;
}

.file-slot__status {
  position: absolute;
  right: 54px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d4edda;
  color: #155724;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.file-slot__status[hidden] {
  display: none;
}

.file-slot__error {
  position: absolute;
  right: 54px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8d7da;
  color: #721c24;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.file-slot__error[hidden] {
  display: none;
}

.file-slot__dl {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin-right: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
}

.recv-files {
  flex: none;
}

.recv-files .file-slot {
  flex: none;
}

.recv-files .file-slot__pick {
  cursor: default;
}

.actions {
  display: flex;
  justify-content: stretch;
  flex: 0 0 auto;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: var(--cream);
  background: var(--coral);
  border: 0;
  width: 100%;
  padding: 16px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(236, 96, 90, 0.28);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.04);
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.toast {
  position: absolute;
  left: 22px;
  right: 22px;
  top: calc(12px + var(--safe-t));
  z-index: 20;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 32px rgba(47, 11, 35, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  background: var(--ink);
  color: var(--cream);
}

.toast--danger {
  background: var(--coral);
  color: var(--cream);
}

.search-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.btn--icon {
  width: 52px;
  height: 52px;
  padding: 0;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  background: var(--ink);
  box-shadow: none;
}

.payload {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(47, 11, 35, 0.06);
  position: relative;
}

.payload__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.payload__text {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.payload__meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payload__copy {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.payload__copy:hover {
  background: var(--blush);
  transform: scale(1.05);
}

.payload__copy:active {
  transform: scale(0.95);
}

.payload__copy[hidden] {
  display: none;
}

.payload__copy-check {
  position: absolute;
  font-size: 16px;
  color: #155724;
}

.payload__copy-check[hidden] {
  display: none;
}

.payload__placeholder {
  margin: 0;
  color: var(--plum);
  font-size: 15px;
  line-height: 1.5;
}

@media (min-width: 480px) {
  .device {
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 1px rgba(47, 11, 35, 0.04), 40px 0 80px rgba(47, 11, 35, 0.08);
  }
}
