:root {
  color-scheme: light;
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;
  --ink: #152033;
  --muted: #667085;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(66, 133, 244, 0.34), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(234, 67, 53, 0.18), transparent 26%),
    radial-gradient(circle at 15% 92%, rgba(251, 188, 5, 0.25), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(52, 168, 83, 0.2), transparent 28%),
    linear-gradient(135deg, #f8fbff, #eef5ff);
}

main {
  width: min(100% - 24px, 520px);
  margin: 0 auto;
  padding: 22px 0;
}

header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy h1 {
  order: 1;
}

.brand-copy p {
  order: 2;
}

.logo {
  width: 58px;
  height: 58px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 20px 50px rgba(61, 86, 122, 0.16);
  backdrop-filter: blur(22px) saturate(160%);
}

.logo span {
  border-radius: 999px;
}

.blue { background: var(--blue); }
.red { background: var(--red); }
.yellow { background: var(--yellow); }
.green { background: var(--green); }

h1,
p {
  margin: 0;
}

p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.status,
.peer-card,
.device-roster,
.picker,
.file-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 20px 50px rgba(61, 86, 122, 0.14);
  backdrop-filter: blur(22px) saturate(160%);
}

.file-card.save-attention {
  outline: 3px solid rgba(66, 133, 244, 0.52);
  outline-offset: 3px;
}

.status {
  margin: 22px 0 14px;
  padding: 14px;
  text-align: center;
  font-weight: 700;
}

.status.connected {
  color: #0f6f3f;
}

.hidden {
  display: none;
}

.peer-card {
  min-height: 58px;
  margin-bottom: 14px;
  padding: 9px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
}

.device-roster {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 16px;
}

.device-roster.hidden {
  display: none;
}

.device-roster-head,
.roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-roster-head {
  justify-content: space-between;
  color: #344155;
}

.device-roster-head span {
  min-width: 30px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #0f6f3f;
  font-weight: 800;
  background: rgba(52, 168, 83, 0.14);
}

.device-roster-list {
  display: grid;
  gap: 7px;
}

.roster-row {
  min-height: 52px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
}

.roster-row > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.roster-row.self {
  background: rgba(66, 133, 244, 0.1);
}

.roster-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.peer-card.hidden {
  display: none;
}

.peer-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #17396f;
  background: rgba(66, 133, 244, 0.12);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
}

.peer-icon.ios,
.peer-icon.mac {
  color: #313746;
  background: rgba(49, 55, 70, 0.1);
}

.peer-icon.android {
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.14);
}

.peer-icon.windows {
  color: #12366f;
  background: rgba(66, 133, 244, 0.13);
}

.peer-icon.linux {
  color: #7a4b00;
  background: rgba(251, 188, 5, 0.18);
}

.peer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.peer-meta {
  color: var(--muted);
  font-size: 13px;
}

.picker {
  position: relative;
  min-height: 106px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "icon"
    "title"
    "text";
  justify-items: center;
  align-items: center;
  row-gap: 5px;
  padding: 14px 16px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(66, 133, 244, 0.13), rgba(52, 168, 83, 0.08) 58%, rgba(251, 188, 5, 0.08)),
    rgba(255, 255, 255, 0.5);
}

.picker::before {
  content: "↑";
  width: 42px;
  height: 42px;
  grid-area: icon;
  display: grid;
  place-items: center;
  border: 1px solid rgba(66, 133, 244, 0.18);
  border-radius: 10px 15px 10px 10px;
  color: #12366f;
  background:
    linear-gradient(135deg, transparent 0 13px, rgba(255, 255, 255, 0.72) 14px 19px, transparent 20px) top right / 19px 19px no-repeat,
    linear-gradient(135deg, rgba(66, 133, 244, 0.17), rgba(52, 168, 83, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 22px rgba(66, 133, 244, 0.1);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.picker span {
  grid-area: text;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

.picker strong {
  grid-area: title;
  line-height: 1.25;
  font-size: 15px;
}

.files-header {
  min-height: 44px;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

h2 {
  margin: 0;
  font-size: 20px;
}

.selected-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.selected-tools.hidden {
  display: none;
}

.selected-tools span {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #12366f;
  font-weight: 800;
  background: rgba(66, 133, 244, 0.12);
}

.selected-tools button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  color: white;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  background: var(--blue);
}

.selected-tools button:last-child {
  color: #344155;
  background: rgba(100, 112, 132, 0.12);
}

.file-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.file-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 246px;
  display: grid;
  grid-template-rows: auto minmax(62px, auto) 38px;
  gap: 9px;
  padding: 10px;
  overflow: hidden;
}

.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name,
.state {
  overflow: hidden;
  direction: ltr;
  text-align: right;
}

.name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 700;
  max-width: 100%;
  line-height: 1.35;
}

.state {
  color: var(--muted);
  font-size: 13px;
  max-width: 100%;
  line-height: 1.35;
}

.action button,
a {
  width: 100%;
  min-height: 38px;
  border: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  background: var(--blue);
}

.file-card .remove-file {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #9b2118;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(21, 32, 51, 0.18);
  font-size: 20px;
  line-height: 1;
}

.select-file {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.select-file input {
  position: absolute;
  opacity: 0;
}

.select-file span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(21, 32, 51, 0.18);
}

.select-file span::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: transparent;
}

.select-file input:checked + span::after {
  background: var(--blue);
}

.own-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border-radius: 999px;
  color: #0f6f3f;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(21, 32, 51, 0.16);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.ios-save-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: auto;
  padding: 12px;
  color: var(--ink);
  background: #f8fbff;
}

.ios-save-viewer.hidden {
  display: none;
}

.ios-save-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  background: #f8fbff;
}

.ios-save-bar > div {
  display: flex;
  gap: 8px;
}

.ios-save-bar button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  font: inherit;
  font-weight: 800;
  background: var(--blue);
}

.ios-save-bar button:last-child {
  color: #344155;
  background: rgba(100, 112, 132, 0.12);
}

.ios-save-copy {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #17396f;
  background: rgba(66, 133, 244, 0.12);
  line-height: 1.6;
}

.ios-save-images {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.ios-save-images figure {
  margin: 0;
  display: grid;
  gap: 8px;
}

.ios-save-images img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: white;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: default;
}

.ios-save-images figcaption {
  direction: ltr;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 360px) {
  .file-list {
    grid-template-columns: 1fr;
  }
}
