:root {
  color-scheme: dark;

  --background: #0d0f12;
  --surface: #15181d;
  --border: #292e37;

  --text: #f1f3f5;
  --muted: #8c939e;

  --accent: #6ea8fe;
  --accent-hover: #82b4ff;

  --error: #ff7b72;
  --success: #7ee787;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

main {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

header {
  margin-bottom: 32px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

header p {
  margin-top: 6px;
  color: var(--muted);
}

section {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.section-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.state {
  flex: none;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.state.connected {
  color: var(--success);
}

.state.error {
  color: var(--error);
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font:
    600 1rem/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(110 168 254 / 12%);
}

input::placeholder {
  color: #555c66;
}

button {
  padding: 9px 15px;
  background: var(--accent);
  color: #08111f;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

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

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

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.download {
  flex: none;
  padding: 6px 10px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.download:hover {
  background: var(--surface);
  border-color: var(--accent);
  text-decoration: none;
}

@media (max-width: 600px) {
  main {
    padding: 32px 0;
  }

  section {
    padding: 18px;
  }

  .section-header {
    flex-direction: column;
    gap: 10px;
  }

  .file {
    align-items: flex-start;
  }

  .download {
    padding: 5px 8px;
  }
}
