@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Caveat:wght@500;600&display=swap");

:root {
  --bg: #070b1d;
  --panel: #0d1225;
  --text: #f5f6ff;
  --muted: #9299b5;
  --purple: #7425ff;
  --blue: #3f56ff;
  --green: #22e58a;
  --red: #ff6b79;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 18%, rgba(82, 58, 190, 0.22), transparent 31rem),
    radial-gradient(circle at 12% 70%, rgba(51, 45, 156, 0.14), transparent 30rem),
    radial-gradient(circle at 90% 55%, rgba(50, 61, 190, 0.12), transparent 28rem),
    linear-gradient(145deg, #090d20 0%, #070a18 50%, #060916 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(125, 91, 255, 0.9);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* APP / HEADER */
.app {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.brand-icon {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  background: linear-gradient(145deg, #7b31ff, #4e32ff);
  box-shadow:
    0 0 32px rgba(111, 44, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.brand-title {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -1.6px;
}

.brand-limits {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #e8e9ff;
}

.brand-subtitle {
  margin-top: 7px;
  color: #a0a7c2;
  font-size: 16px;
}

.header-note {
  text-align: right;
  padding-top: 3px;
}

.handwritten {
  color: #8291ff;
  font-family: "Caveat", cursive;
  font-size: 32px;
  line-height: 1;
  transform: rotate(-3deg);
  text-shadow: 0 0 22px rgba(101, 110, 255, 0.28);
}

.header-meta {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  color: #bdc2db;
  font-size: 14px;
}

/* DASHBOARD */
.dashboard {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(560px, 1.55fr) minmax(250px, 0.82fr);
  gap: 26px;
  align-items: start;
}

.center-column {
  min-width: 0;
}

/* SIDE CARDS */
.side-card {
  min-height: 690px;
  padding: 28px 27px;
  border: 1px solid rgba(126, 119, 220, 0.20);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(19, 26, 59, 0.92), rgba(10, 15, 37, 0.88));
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.side-card-title {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.side-card-subtitle {
  margin-top: 8px;
  color: #b2b8d1;
  font-size: 16px;
  line-height: 1.45;
}

.steps {
  margin-top: 29px;
  display: grid;
  gap: 28px;
}

.step {
  display: grid;
  grid-template-columns: 40px 58px 1fr;
  gap: 12px;
  align-items: center;
}

.step-number {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #7432ff, #4b43ff);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 0 22px rgba(96, 46, 255, 0.25);
}

.step-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(88, 76, 174, 0.17);
  color: #a8b3ff;
  font-size: 27px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.step-content {
  min-width: 0;
}

.step-content strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.step-content strong em {
  font-style: normal;
  color: #d1d5e9;
}

.step-content span {
  display: block;
  margin-top: 6px;
  color: #a0a7c0;
  font-size: 14px;
  line-height: 1.5;
}

.limit-list {
  margin-top: 29px;
  display: grid;
  gap: 26px;
}

.limit-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 15px;
  align-items: center;
}

.limit-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #b2a3ff;
  background: radial-gradient(circle, rgba(104, 75, 217, 0.25), rgba(61, 49, 132, 0.14));
  border: 1px solid rgba(142, 112, 255, 0.12);
  font-size: 20px;
  font-weight: 800;
}

.limit-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.limit-item span {
  display: block;
  margin-top: 5px;
  color: #a2a9c2;
  font-size: 14px;
}

.side-divider {
  height: 1px;
  margin: 31px 0 28px;
  background: rgba(156, 160, 200, 0.25);
}

.why-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.benefits {
  list-style: none;
  padding: 0;
  margin: 19px 0 0;
  display: grid;
  gap: 12px;
}

.benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d0d5eb;
  font-size: 14px;
}

.benefits li span {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #6c35ff, #423eff);
  color: white;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 0 17px rgba(95, 53, 255, 0.20);
}

.side-slogan {
  margin-top: 39px;
  color: #8291ff;
  font-family: "Caveat", cursive;
  font-size: 29px;
  line-height: 1.05;
  transform: rotate(-2deg);
  text-shadow: 0 0 20px rgba(101, 110, 255, 0.25);
}

.side-slogan span {
  display: block;
}

/* CENTER */
.mode-selector {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid rgba(137, 141, 170, 0.18);
  border-radius: 16px;
  background: rgba(31, 33, 53, 0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.mode-button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8f94ad;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.7px;
  cursor: pointer;
  transition: 150ms ease;
}

.mode-button:hover {
  color: white;
}

.mode-button.active {
  color: white;
  background: linear-gradient(100deg, #7628ff, #4c4cff);
  box-shadow:
    0 10px 25px rgba(81, 39, 255, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.13);
}

.mode-icon {
  margin-right: 7px;
}

/* MAIN PANEL */
.main-panel {
  min-width: 0;
  padding: 29px 30px 24px;
  border: 1px solid rgba(141, 130, 222, 0.25);
  border-radius: 23px;
  background:
    linear-gradient(150deg, rgba(13, 17, 36, 0.97), rgba(8, 12, 27, 0.97));
  box-shadow: var(--shadow);
}

.panel-header h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.9px;
}

.panel-header p {
  margin: 9px 0 0;
  color: #9aa1ba;
  font-size: 14px;
}

/* CODE */
.code-card {
  margin-top: 26px;
  padding: 24px 18px 20px;
  text-align: center;
  border: 1px solid rgba(125, 65, 255, 0.47);
  border-radius: 19px;
  background:
    radial-gradient(circle at 25% 20%, rgba(120, 35, 255, 0.19), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(45, 76, 255, 0.14), transparent 50%),
    #16102f;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.025),
    0 0 34px rgba(80, 35, 220, 0.10);
}

.code-label,
.section-title {
  color: #9295ad;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.25px;
}

.code-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.code {
  font-size: clamp(38px, 5vw, 50px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 10px;
  padding-left: 10px;
  color: white;
  text-shadow: 0 0 28px rgba(255,255,255,0.10);
}

/* Only text below the code remains visible. */
.code-status {
  margin-top: 10px;
  color: #989db5;
  font-size: 12px;
}

/* CONNECTION STATUS
   The original connection elements stay in the DOM for app.js,
   but their visual presentation is handled by the transfer-status
   elements placed directly below the code / connection area. */
.connection-status {
  display: none !important;
}

/* The transfer status is the single visible status line. */
.transfer-status {
  min-height: 42px;
  margin-top: 14px;
  padding: 0 14px;
  display: none;
  align-items: center;
  border: 1px solid rgba(137, 141, 170, 0.13);
  border-radius: 12px;
  background: rgba(29, 31, 45, 0.74);
  color: #d5d9e7;
  font-size: 13px;
  line-height: 1.45;
}

/* Sender: show the transfer/status line only after the peer connects.
   Before that, the only visible message below the code is
   "Waiting for receiver..." inside .code-status. */
#sendPanel:has(#sendConnectionStatus.connected) #sendStatus {
  display: flex;
}

/* The generated code disappears once the receiver connects. */
#sendPanel:has(#sendConnectionStatus.connected) .code {
  display: none;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-card {
  padding: 18px;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-status {
  margin-top: 0;
  color: var(--green);
  font-size: 13px;
}

/* Receiver: show its status line only after connection. */
#receivePanel:has(#receiveConnectionStatus.connected) #receiveStatus {
  display: flex;
}

/* While waiting for data, the receiver's status line sits immediately
   below the connection state. Received items remain underneath it. */
#receivePanel:has(#receiveConnectionStatus.connected) .received-items {
  margin-top: 14px;
}

.transfer-status.success {
  color: var(--green);
}

.transfer-status.error {
  color: var(--red);
}

/* FORM SECTIONS */
.section {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.section-hint {
  color: #747b97;
  font-size: 11px;
}

.file-button {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px dashed rgba(142, 147, 184, 0.30);
  border-radius: 13px;
  background: rgba(24, 25, 39, 0.78);
  color: #f0f1fa;
  cursor: pointer;
  transition: 150ms ease;
}

.file-button:hover {
  border-color: rgba(122, 77, 255, 0.65);
  background: rgba(47, 32, 89, 0.35);
}

.file-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.file-icon {
  font-size: 21px;
}

.file-button-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.file-button-copy strong {
  font-size: 14px;
}

.file-button-copy small {
  color: #838aa5;
  font-size: 11px;
}

.selected-file {
  min-height: 59px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(135, 140, 174, 0.16);
  border-radius: 12px;
  background: rgba(30, 31, 46, 0.78);
}

.selected-file-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(95, 54, 226, 0.18);
  font-size: 17px;
}

.file-info {
  min-width: 0;
  flex: 1;
}

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

.file-size {
  margin-top: 3px;
  color: #80879e;
  font-size: 11px;
}

.remove-file {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,0.06);
  color: #a4a9bb;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.remove-file:hover {
  color: white;
  background: rgba(255,255,255,0.11);
}

.message-input {
  width: 100%;
  min-height: 94px;
  resize: vertical;
  padding: 14px;
  border: 1px solid rgba(134, 139, 172, 0.20);
  border-radius: 13px;
  background: rgba(7, 9, 20, 0.88);
  color: #f5f6ff;
  font-size: 13px;
  line-height: 1.55;
}

.message-input::placeholder,
.code-input::placeholder {
  color: #626981;
}

.message-input:focus,
.code-input:focus {
  border-color: rgba(116, 73, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(107, 48, 255, 0.10);
  outline: none;
}

.character-count {
  margin-top: 6px;
  text-align: right;
  color: #737991;
  font-size: 10px;
}

/* BUTTONS */
.primary-button {
  width: 100%;
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(100deg, #7728ff 0%, #4a4cff 100%);
  color: white;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  box-shadow:
    0 13px 30px rgba(81, 39, 255, 0.20),
    inset 0 1px 0 rgba(255,255,255,0.13);
  transition: 150ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(81, 39, 255, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.14);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  background: linear-gradient(100deg, #3d2374, #302c78);
  color: #83869d;
  cursor: not-allowed;
  box-shadow: none;
}

/* RECEIVE */
.receive-code-container {
  margin-top: 27px;
}

.code-input {
  width: 100%;
  height: 67px;
  margin-top: 9px;
  border: 1px solid rgba(135, 140, 173, 0.23);
  border-radius: 13px;
  background: rgba(7, 9, 20, 0.88);
  color: white;
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 10px;
  padding-left: 10px;
}

.received-items {
  display: grid;
  gap: 10px;
  min-height: 106px;
  margin-top: 21px;
}

.waiting-message {
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border: 1px dashed rgba(130, 135, 170, 0.22);
  border-radius: 14px;
  color: #777e99;
  font-size: 12px;
}

.waiting-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #a28cff;
  background: rgba(89, 47, 179, 0.16);
  font-size: 21px;
}

.received-text,
.received-item {
  border: 1px solid rgba(132, 138, 172, 0.16);
  border-radius: 13px;
  background: rgba(29, 30, 44, 0.75);
}

.received-text {
  padding: 14px;
  color: #f0f2fa;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.received-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
}

.received-item-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(94, 54, 227, 0.17);
}

.received-item-content {
  min-width: 0;
  flex: 1;
}

.received-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.received-item-meta {
  margin-top: 3px;
  color: #7f869f;
  font-size: 10px;
}

.download-button {
  border: 1px solid rgba(128, 102, 255, 0.30);
  border-radius: 9px;
  padding: 8px 10px;
  background: rgba(80, 51, 172, 0.18);
  color: #bfb8ff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.download-button:hover {
  background: rgba(94, 57, 202, 0.32);
  color: white;
}

/* PROGRESS */
.progress-container {
  margin-top: 14px;
  padding: 12px 14px 13px;
  border: 1px solid rgba(131, 136, 170, 0.15);
  border-radius: 12px;
  background: rgba(27, 29, 43, 0.75);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #a1a6ba;
  font-size: 10px;
}

.progress-bar {
  height: 7px;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 99px;
  background: rgba(255,255,255,0.09);
}

.progress {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8d31ff, #5460ff);
  box-shadow: 0 0 14px rgba(113, 48, 255, 0.45);
  transition: width 120ms linear;
}

/* Transfer status is the only visible status box.
   CSS moves it visually into the connection-status position. */
.transfer-status {
  min-height: 42px;
  margin-top: 14px;
  padding: 0 14px;
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(137, 141, 170, 0.13);
  border-radius: 12px;
  background: rgba(29, 31, 45, 0.74);
  color: #d5d9e7;
  font-size: 13px;
  line-height: 1.45;
}

/* Waiting state: no lower status box. */
#sendPanel #sendStatus,
#receivePanel #receiveStatus {
  position: relative;
}

/* Once the sender has connected, show the existing sendStatus as the one status box. */
#sendPanel:has(#sendConnectionStatus.connected) #sendStatus {
  display: flex;
  color: #d5d9e7;
}

/* Once connected, the generated code itself disappears visually. */
#sendPanel:has(#sendConnectionStatus.connected) .code {
  display: none;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-card {
  padding: 18px;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-status {
  margin-top: 0;
  font-size: 13px;
  color: #22e58a;
}

/* Receiver: after connection, show only the connection/transfer status area. */
#receivePanel:has(#receiveConnectionStatus.connected) #receiveStatus {
  display: flex;
  color: #d5d9e7;
}

/* Receiver connection status is represented by transfer status. */
#receivePanel:has(#receiveConnectionStatus.connected) .received-items {
  margin-top: 14px;
}

/* Progress boxes stay visible while a transfer is actually in progress. */
#sendProgressContainer:not(.hidden),
#receiveProgressContainer:not(.hidden) {
  display: block;
}

.transfer-status.success {
  color: var(--green);
}

.transfer-status.error {
  color: var(--red);
}

/* FOOTER */
.footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: #555d78;
  font-size: 11px;
}

/* RESPONSIVE */
@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: minmax(220px, 0.72fr) minmax(500px, 1.35fr);
  }

  .limits-card {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .limits-card .limit-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .limits-card .benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .side-slogan {
    display: none;
  }
}

@media (max-width: 840px) {
  .app {
    width: min(700px, calc(100% - 28px));
    padding-top: 18px;
  }

  .site-header {
    align-items: center;
  }

  .header-note {
    display: none;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .connect-card,
  .limits-card {
    min-height: auto;
  }

  .connect-card {
    order: 2;
  }

  .center-column {
    order: 1;
  }

  .limits-card {
    order: 3;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .limits-card .limit-list {
    grid-template-columns: 1fr;
  }

  .limits-card .benefits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 18px, 500px);
    padding-bottom: 14px;
  }

  .site-header {
    margin-bottom: 14px;
  }

  .brand {
    gap: 12px;
  }

  .brand-icon {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 17px;
    font-size: 29px;
  }

  .brand-title {
    font-size: 28px;
    letter-spacing: -1px;
  }

  .brand-limits {
    flex-wrap: wrap;
    gap: 5px;
    font-size: 12px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .main-panel {
    padding: 23px 17px 18px;
    border-radius: 19px;
  }

  .mode-selector {
    height: 56px;
  }

  .code-card {
    padding: 20px 9px 18px;
  }

  .code {
    font-size: 35px;
    letter-spacing: 6px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .side-card {
    padding: 23px 19px;
    border-radius: 19px;
  }

  .step {
    grid-template-columns: 38px 50px 1fr;
  }

  .step-icon {
    width: 50px;
    height: 50px;
  }

  .code-input {
    height: 62px;
    font-size: 27px;
    letter-spacing: 7px;
  }

  .received-item {
    flex-wrap: wrap;
  }

  .download-button {
    margin-left: 50px;
  }
}

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


/* =========================================================
   SENDER — STEP 1 STATUS CLEANUP
   ========================================================= */

/* The separate sender connection box is no longer visible.
   Its connected class is still used by the app internally. */
#sendPanel #sendConnectionStatus {
  display: none !important;
}

/* There is no second status box below the form on SEND. */
#sendPanel #sendStatus {
  display: none !important;
}

/* After connection, only the status inside the code card remains.
   The numeric code and its label are hidden. */
#sendPanel:has(#sendConnectionStatus.connected) .code {
  display: none !important;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-label {
  display: none !important;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#sendPanel #sendCodeStatus {
  margin-top: 0;
  color: #22e58a;
  font-size: 13px;
  font-weight: 500;
}

/* While connected, keep the status visually clean. */
#sendPanel:has(#sendConnectionStatus.connected) #sendCodeStatus {
  color: #22e58a;
}


/* =========================================================
   FINAL SENDER STATUS UI
   ========================================================= */

/* After the receiver connects, the introductory Send header disappears. */
#sendPanel:has(#sendConnectionStatus.connected) .send-panel-header {
  display: none !important;
}

/* The connection/status element remains in the DOM for app.js only. */
#sendPanel #sendConnectionStatus {
  display: none !important;
}

/* There is never a second sender status box below the code card. */
#sendPanel #sendStatus {
  display: none !important;
}

/* Before connection, show the normal waiting state inside the code card. */
#sendPanel #sendCodeStatus {
  margin-top: 10px;
  color: #989db5;
  font-size: 12px;
}

/* Once connected, the code itself is hidden and only the status remains. */
#sendPanel:has(#sendConnectionStatus.connected) .code {
  display: none !important;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-label {
  display: none !important;
}

#sendPanel:has(#sendConnectionStatus.connected) .code-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin-top: 0;
}

#sendPanel:has(#sendConnectionStatus.connected) #sendCodeStatus {
  margin-top: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

/* Keep the explanatory footer readable inside the panel. */
#sendPanel .panel-footer-note {
  min-height: 34px;
  line-height: 1.45;
  white-space: normal;
}


/* =========================================================
   FINAL SENDER STATE — PEER CONNECTED
   ========================================================= */

/* Do not hide the header merely because the sender WebSocket opened.
   Hide it only after the other device actually connects. */
#sendPanel.peer-connected .send-panel-header {
  display: none !important;
}

#sendPanel.peer-connected .code {
  display: none !important;
}

#sendPanel.peer-connected .code-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin-top: 0;
}

#sendPanel.peer-connected #sendCodeStatus {
  margin-top: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

/* Keep the old DOM status elements available to app.js, but never render
   a second status box on the sender. */
#sendPanel #sendConnectionStatus,
#sendPanel #sendStatus {
  display: none !important;
}

/* =========================================================
   FINAL RECEIVER STATE — AFTER CONNECTION
   ========================================================= */

/* Once connected, the receiver no longer needs the code-entry UI. */
#receivePanel:has(#receiveConnectionStatus.connected) .panel-header,
#receivePanel:has(#receiveConnectionStatus.connected) .receive-code-container,
#receivePanel:has(#receiveConnectionStatus.connected) #connectButton {
  display: none !important;
}

/* Keep only the single connected/status message visible. */
#receivePanel:has(#receiveConnectionStatus.connected) #receiveStatus {
  display: flex !important;
  margin-top: 0;
}

/* Received files and messages remain directly below the connection status. */
#receivePanel:has(#receiveConnectionStatus.connected) .received-items {
  margin-top: 14px;
}

/* Receiver countdown uses the same simple footer treatment as SEND. */
#receivePanel .panel-footer-note {
  min-height: 34px;
  line-height: 1.45;
  white-space: normal;
}


/* RECEIVER: only the "Message received" success status is green. */
#receivePanel #receiveStatus.success {
  color: var(--green) !important;
}


/* FINAL SEND STATE:
   After the receiver connects, remove the SEND heading/subtitle.
   Keep the status message only. */
#sendPanel.peer-connected .send-panel-header h2,
#sendPanel.peer-connected .send-panel-header > p {
  display: none !important;
}

/* The 10/10 sender limit message is the visible status. */
#sendPanel #sendCodeStatus {
  color: var(--green) !important;
}


/* =========================================================
   VISUAL V2 — DARK NEON THREE-PANEL DESIGN
   Visual-only layer: functionality and DOM remain unchanged.
   ========================================================= */

/* Overall background */
html,
body {
  background:
    radial-gradient(circle at 50% 35%, rgba(70, 64, 190, 0.18), transparent 34rem),
    radial-gradient(circle at 8% 55%, rgba(112, 39, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 94% 55%, rgba(0, 211, 185, 0.10), transparent 30rem),
    #050817;
}

/* Slightly tighter, more dashboard-like composition */
.app {
  width: min(1520px, calc(100% - 34px));
  padding-top: 18px;
}

/* Keep header, but make it feel like the reference */
.site-header {
  margin-bottom: 18px;
}

.brand-icon {
  background: linear-gradient(145deg, #7b2cff 0%, #4e42ff 100%);
  box-shadow:
    0 0 36px rgba(103, 46, 255, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

.handwritten {
  color: #7f91ff;
}

/* Three distinct visual identities */
.connect-card {
  border-color: rgba(125, 91, 255, 0.48);
  background:
    radial-gradient(circle at 92% 8%, rgba(122, 52, 255, 0.24), transparent 25rem),
    radial-gradient(circle at 15% 88%, rgba(83, 50, 255, 0.18), transparent 24rem),
    linear-gradient(145deg, rgba(34, 24, 76, 0.96), rgba(12, 14, 42, 0.96));
  box-shadow:
    0 22px 60px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 34px rgba(100, 44, 255, 0.07);
}

.main-panel {
  border-color: rgba(74, 137, 255, 0.34);
  background:
    radial-gradient(circle at 12% 0%, rgba(83, 73, 255, 0.13), transparent 25rem),
    radial-gradient(circle at 95% 55%, rgba(22, 104, 255, 0.12), transparent 24rem),
    linear-gradient(150deg, rgba(9, 24, 61, 0.98), rgba(6, 14, 34, 0.98));
  box-shadow:
    0 28px 80px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.045),
    0 0 42px rgba(37, 103, 255, 0.08);
}

.limits-card {
  border-color: rgba(0, 231, 202, 0.48);
  background:
    radial-gradient(circle at 100% 0%, rgba(0, 229, 205, 0.17), transparent 24rem),
    radial-gradient(circle at 5% 92%, rgba(0, 164, 154, 0.14), transparent 25rem),
    linear-gradient(145deg, rgba(5, 45, 55, 0.96), rgba(7, 18, 34, 0.97));
  box-shadow:
    0 22px 60px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0 40px rgba(0, 213, 191, 0.08);
}

/* Left panel: stronger purple progression */
.connect-card .step-number {
  background: linear-gradient(145deg, #8a36ff, #5644ff);
  box-shadow: 0 0 24px rgba(111, 49, 255, 0.32);
}

.connect-card .step:nth-child(3) .step-number {
  background: linear-gradient(145deg, #2bdc9a, #0ba99a);
  box-shadow: 0 0 22px rgba(24, 216, 157, 0.25);
}

.connect-card .step-icon {
  background: rgba(108, 76, 215, 0.20);
  border: 1px solid rgba(139, 112, 255, 0.10);
}

.connect-card .step:nth-child(3) .step-icon {
  background: rgba(23, 176, 151, 0.16);
  color: #7ff4d0;
}

/* Center mode selector */
.mode-selector {
  height: 58px;
  padding: 5px;
  margin-bottom: 14px;
  border-color: rgba(115, 129, 205, 0.28);
  background: rgba(26, 32, 61, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.045),
    0 10px 30px rgba(0,0,0,0.18);
}

.mode-button.active {
  background: linear-gradient(100deg, #7628ff 0%, #4759ff 100%);
  box-shadow:
    0 10px 28px rgba(79, 58, 255, 0.30),
    inset 0 1px 0 rgba(255,255,255,0.16);
}

/* Center connection code card */
.code-card {
  border-color: rgba(78, 119, 255, 0.52);
  background:
    radial-gradient(circle at 20% 15%, rgba(105, 69, 255, 0.26), transparent 55%),
    radial-gradient(circle at 88% 88%, rgba(0, 132, 255, 0.20), transparent 50%),
    linear-gradient(145deg, #27366d 0%, #142a5d 48%, #0c2148 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 38px rgba(45, 103, 255, 0.12);
}

.code {
  text-shadow:
    0 0 30px rgba(255,255,255,0.14),
    0 0 48px rgba(101, 131, 255, 0.18);
}

/* File drop zone */
.file-button {
  border-color: rgba(112, 159, 255, 0.42);
  background:
    linear-gradient(145deg, rgba(53, 78, 139, 0.72), rgba(25, 43, 86, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 8px 24px rgba(0,0,0,0.16);
}

.file-button:hover {
  border-color: rgba(126, 170, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(63, 91, 157, 0.80), rgba(27, 49, 96, 0.80));
}

/* Message field */
.message-input,
.code-input {
  border-color: rgba(104, 145, 220, 0.28);
  background: rgba(4, 12, 29, 0.90);
}

.message-input:focus,
.code-input:focus {
  border-color: rgba(89, 133, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(55, 108, 255, 0.12);
}

/* Main action */
.primary-button {
  background: linear-gradient(100deg, #7728ff 0%, #3d78ff 100%);
  box-shadow:
    0 14px 32px rgba(55, 73, 255, 0.24),
    inset 0 1px 0 rgba(255,255,255,0.14);
}

.primary-button:hover:not(:disabled) {
  box-shadow:
    0 17px 38px rgba(55, 73, 255, 0.32),
    inset 0 1px 0 rgba(255,255,255,0.16);
}

/* Right panel icons become dark neon tiles */
.limits-card .limit-icon {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(2, 6, 17, 0.96), rgba(5, 10, 24, 0.96));
  border: 1px solid rgba(0, 236, 211, 0.12);
  color: #a7fff0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 18px rgba(0,0,0,0.22);
}

.limits-card .benefits li span {
  background: linear-gradient(145deg, #19e3a4, #06bba8);
  box-shadow: 0 0 18px rgba(12, 220, 173, 0.28);
}

.limits-card .side-divider {
  background: rgba(101, 222, 211, 0.22);
}

.limits-card .side-slogan {
  color: #25e7c4;
  text-shadow: 0 0 22px rgba(19, 225, 194, 0.24);
}

/* Received items use the same blue family as the center */
.received-text,
.received-item {
  border-color: rgba(85, 137, 255, 0.22);
  background: rgba(13, 30, 62, 0.78);
}

.waiting-message {
  border-color: rgba(91, 133, 224, 0.30);
  background: rgba(11, 26, 53, 0.40);
}

.waiting-icon {
  color: #a99aff;
  background: rgba(83, 67, 209, 0.20);
}

/* Countdown / footer */
.panel-footer-note {
  color: #c3cae0;
}

#sessionCountdown,
#receiveSessionCountdown {
  color: #c9d0e5;
}

/* Responsive: preserve the color identity when columns collapse */
@media (max-width: 1180px) {
  .connect-card {
    background:
      radial-gradient(circle at 92% 8%, rgba(122, 52, 255, 0.24), transparent 25rem),
      linear-gradient(145deg, rgba(34, 24, 76, 0.96), rgba(12, 14, 42, 0.96));
  }

  .limits-card {
    background:
      radial-gradient(circle at 100% 0%, rgba(0, 229, 205, 0.17), transparent 24rem),
      linear-gradient(145deg, rgba(5, 45, 55, 0.96), rgba(7, 18, 34, 0.97));
  }
}


/* =========================================================
   HOW IT WORKS — VISUAL SIDEBAR
   This section changes only the left information card.
   Transfer logic and the center/right UI are untouched.
   ========================================================= */

.connect-card {
  position: relative;
  overflow: hidden;
  min-height: 690px;
  padding: 35px 34px 28px;
  border-color: rgba(137, 72, 255, 0.55);
  background:
    radial-gradient(circle at 72% 4%, rgba(123, 49, 255, 0.28), transparent 34%),
    radial-gradient(circle at 5% 92%, rgba(76, 36, 220, 0.24), transparent 40%),
    linear-gradient(155deg, #20104f 0%, #171449 42%, #10143a 100%);
  box-shadow:
    0 22px 60px rgba(30, 11, 95, 0.30),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(130, 69, 255, 0.18);
}

.connect-card::before,
.connect-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(126, 73, 255, 0.28);
  transform: rotate(-18deg);
}

.connect-card::before {
  width: 430px;
  height: 260px;
  top: -145px;
  right: -185px;
  box-shadow: 0 0 70px rgba(104, 43, 255, 0.18);
}

.connect-card::after {
  width: 480px;
  height: 230px;
  left: -260px;
  bottom: -135px;
  box-shadow: 0 0 80px rgba(81, 42, 220, 0.16);
}

.how-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.how-art-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(2px);
}

.how-art-glow-one {
  width: 210px;
  height: 210px;
  top: -120px;
  right: -70px;
  background: radial-gradient(circle, rgba(137, 75, 255, 0.22), transparent 68%);
}

.how-art-glow-two {
  width: 260px;
  height: 190px;
  bottom: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(75, 53, 255, 0.22), transparent 68%);
}

.connect-card > *:not(.how-art) {
  position: relative;
  z-index: 2;
}

.connect-card .side-card-title {
  font-size: 29px;
  letter-spacing: -0.9px;
}

.connect-card .side-card-subtitle {
  margin-top: 9px;
  color: #b7b9ff;
  font-size: 16px;
}

.connect-card .steps {
  position: relative;
  margin-top: 31px;
  gap: 27px;
}

.connect-card .steps::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 41px;
  bottom: 41px;
  border-left: 2px dashed rgba(184, 186, 255, 0.68);
  filter: drop-shadow(0 0 5px rgba(137, 113, 255, 0.22));
}

.connect-card .step {
  grid-template-columns: 42px 64px 1fr;
  gap: 13px;
  align-items: center;
}

.connect-card .step-number {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #9b52ff 0%, #4e4bff 100%);
  font-size: 19px;
  box-shadow:
    0 0 24px rgba(116, 53, 255, 0.48),
    inset 0 1px 0 rgba(255,255,255,0.30);
}

.connect-card .step:nth-child(n+2) .step-number {
  background: linear-gradient(145deg, #9c54ff 0%, #4b48ff 100%);
}

.connect-card .step-icon {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(137, 112, 255, 0.08);
  background:
    radial-gradient(circle at 35% 30%, rgba(106, 88, 218, 0.27), rgba(43, 36, 104, 0.58));
  color: #c9b8ff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 8px 22px rgba(0,0,0,0.12);
}

.connect-card .step-icon svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connect-card .device-step-icon svg {
  width: 45px;
  height: 34px;
  stroke-width: 2.1;
}

.connect-card .step-content strong {
  font-size: 15px;
  line-height: 1.25;
}

.connect-card .step-content span {
  margin-top: 7px;
  color: #b5b7dc;
  font-size: 13px;
  line-height: 1.45;
}

.connect-card .step-content b {
  color: #c07aff;
  font-weight: 800;
}

.how-bottom-art {
  position: absolute !important;
  z-index: 3 !important;
  left: 31px;
  right: 27px;
  bottom: 20px;
  height: 118px;
  display: flex;
  align-items: flex-end;
  gap: 13px;
  pointer-events: none;
}

.how-bottom-art::before {
  content: "";
  position: absolute;
  left: -31px;
  right: -27px;
  bottom: -20px;
  height: 155px;
  background:
    radial-gradient(ellipse at 20% 100%, rgba(79, 43, 220, 0.25), transparent 56%),
    radial-gradient(ellipse at 72% 100%, rgba(89, 47, 238, 0.18), transparent 58%);
  pointer-events: none;
}

.device-phone,
.device-laptop,
.device-link,
.how-slogan {
  position: relative;
  z-index: 2;
}

.device-phone {
  width: 47px;
  height: 88px;
  flex: 0 0 47px;
  margin-left: 7px;
  border: 3px solid #c78cff;
  border-radius: 10px;
  transform: rotate(-9deg);
  background: linear-gradient(145deg, #26205c, #101838);
  box-shadow:
    0 0 18px rgba(159, 95, 255, 0.72),
    inset 0 0 15px rgba(85, 84, 255, 0.16);
}

.device-phone-speaker {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 12px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #d5a9ff;
}

.device-phone-screen {
  position: absolute;
  inset: 12px 4px 9px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 70% 30%, rgba(77, 106, 255, 0.45), transparent 55%),
    linear-gradient(160deg, #111d4b, #080f29);
}

.device-phone-home {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 7px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #c9a0ff;
}

.device-link {
  margin-bottom: 37px;
  color: #f0eaff;
  font-size: 27px;
  line-height: 1;
  text-shadow: 0 0 13px rgba(152, 111, 255, 0.8);
}

.device-laptop {
  width: 105px;
  flex: 0 0 105px;
  margin-bottom: 4px;
}

.device-laptop-screen {
  position: relative;
  width: 82px;
  height: 52px;
  margin: 0 auto;
  border: 3px solid #b67cff;
  border-bottom-width: 4px;
  border-radius: 7px 7px 4px 4px;
  transform: skew(-7deg);
  background: linear-gradient(145deg, #2a235d, #0e1735);
  box-shadow:
    0 0 18px rgba(147, 85, 255, 0.58),
    inset 0 0 15px rgba(81, 100, 255, 0.17);
}

.device-laptop-screen span {
  position: absolute;
  inset: 7px;
  border-radius: 2px;
  background:
    radial-gradient(circle at 60% 35%, rgba(78, 114, 255, 0.32), transparent 52%),
    #0b1430;
}

.device-laptop-base {
  width: 105px;
  height: 11px;
  margin: -1px auto 0;
  border-radius: 3px 3px 9px 9px;
  transform: skew(-12deg);
  background: linear-gradient(180deg, #d0a2ff, #7560cf);
  box-shadow: 0 7px 12px rgba(0,0,0,0.22);
}

.how-slogan {
  margin-left: auto;
  margin-right: 0;
  margin-bottom: -1px;
  color: #a87cff;
  font-family: "Caveat", cursive;
  font-size: 25px;
  line-height: 0.98;
  transform: rotate(-5deg);
  text-shadow: 0 0 18px rgba(139, 81, 255, 0.38);
}

.how-slogan span {
  display: block;
}

/* Keep the left card clean on narrower screens. */
@media (max-width: 1180px) {
  .connect-card {
    min-height: 620px;
  }

  .how-bottom-art {
    transform: scale(0.92);
    transform-origin: left bottom;
  }
}

@media (max-width: 840px) {
  .connect-card {
    min-height: 650px;
  }

  .how-bottom-art {
    transform: scale(0.92);
    transform-origin: left bottom;
  }
}

@media (max-width: 560px) {
  .connect-card {
    min-height: 690px;
    padding: 29px 23px 25px;
  }

  .connect-card .side-card-title {
    font-size: 27px;
  }

  .connect-card .step {
    grid-template-columns: 38px 52px 1fr;
    gap: 9px;
  }

  .connect-card .step-icon {
    width: 52px;
    height: 52px;
  }

  .connect-card .step-number {
    width: 38px;
    height: 38px;
  }

  .connect-card .steps::before {
    left: 18px;
  }

  .how-bottom-art {
    left: 18px;
    right: 15px;
    transform: scale(0.78);
    transform-origin: left bottom;
  }
}


/* ==================================================
   WHY USE PHONE ↔ PC — PRIVATE BY DESIGN
   ================================================== */

.benefits .benefit-private {
  align-items: flex-start;
  gap: 10px;
}

.benefits .benefit-private > span {
  margin-top: 2px;
}

.benefits .benefit-private > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.benefits .benefit-private strong {
  font-weight: 700;
}

.benefits .benefit-private small {
  display: block;
  font-size: 0.86em;
  line-height: 1.35;
  opacity: 0.72;
}

/* =========================================================
   SENDER — RECEIVER DISCONNECTED
   Keep the existing SEND/RECEIVE controls untouched.
   ========================================================= */

#sendPanel.peer-disconnected .send-panel-header {
  display: none !important;
}

#sendPanel.peer-disconnected .code {
  display: none !important;
}

#sendPanel.peer-disconnected .code-label {
  display: none !important;
}

#sendPanel.peer-disconnected .code-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin-top: 0;
}

#sendPanel.peer-disconnected #sendCodeStatus {
  margin-top: 0;
  color: var(--red) !important;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

