:root {
  --bg: #f6f7f3;
  --panel: #ffffff;
  --panel-2: #eef1ea;
  --ink: #151712;
  --muted: #60675b;
  --line: #d9ded3;
  --accent: #176b4d;
  --accent-2: #d8ede4;
  --danger: #a73535;
  --shadow: 0 20px 70px rgb(52 70 44 / 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 22px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.status-pill,
.primary-btn,
.ghost-btn,
.icon-btn,
.download-btn {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d18f28;
}

.status-pill.online .status-dot {
  background: var(--accent);
}

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

.upload-panel,
.side-panel,
.files-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-panel {
  overflow: hidden;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 42px;
  text-align: center;
  background:
    linear-gradient(135deg, rgb(23 107 77 / 0.10), transparent 36%),
    var(--panel);
  border-bottom: 1px solid var(--line);
  outline: none;
}

.dropzone.dragging,
.dropzone:focus-visible {
  background: var(--accent-2);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 3rem;
  line-height: 1;
}

.dropzone h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.dropzone p {
  max-width: 460px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.5;
}

.primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  padding: 0 18px;
  font-weight: 700;
}

.ghost-btn,
.icon-btn,
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
}

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

.ghost-btn:hover,
.download-btn:hover {
  border-color: var(--accent);
}

.danger {
  color: var(--danger);
}

.note-box {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.note-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  background: white;
}

textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(23 107 77 / 0.18);
}

.text-btn {
  min-width: 86px;
}

.transfer-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.transfer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: white;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.side-panel {
  display: grid;
}

.panel-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin-bottom: 0;
}

.device-name {
  margin-bottom: 3px;
  font-size: 1.2rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.address-list,
.peer-list,
.file-list {
  display: grid;
  gap: 10px;
}

.address-item,
.peer-item,
.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 10px;
}

.address-item code {
  overflow-wrap: anywhere;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.copy-btn {
  flex: 0 0 auto;
}

.peer-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.mode-row strong {
  color: var(--accent);
  font-size: 0.88rem;
}

.mode-row:not(.active) strong {
  color: var(--muted);
}

.compact {
  display: grid;
  gap: 10px;
}

.files-panel {
  margin-top: 18px;
  padding: 18px;
}

.files-head {
  margin-bottom: 14px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.file-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-type {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-2);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.file-main h3 {
  overflow: hidden;
  max-width: 46vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 880px) {
  .shell {
    width: min(100% - 20px, 760px);
    padding-top: 14px;
  }

  .topbar {
    display: grid;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.6rem);
  }

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

  .dropzone {
    min-height: 300px;
    padding: 26px 16px;
  }

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

  .file-item,
  .file-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .file-main h3 {
    max-width: calc(100vw - 124px);
  }
}
