:root {
  color-scheme: dark;
  --rosewater: #f5e0dc;
  --green: #a6e3a1;
  --red: #f38ba8;
  --blue: #89b4fa;
  --text: #cdd6f4;
  --subtext: #a6adc8;
  --surface: #313244;
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
}

* {
  box-sizing: border-box;
  color: var(--text);
  scrollbar-color: var(--surface) var(--mantle);
}

html,
body {
  min-height: 100%;
  background-color: var(--base);
  padding: 0;
}

body,
form {
  display: flex;
  flex-direction: column;
}

body {
  margin: 0;
  font-family: monospace;
}

main {
  width: 100%;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre,
input,
button {
  font-family: monospace;
  font-size: 1em;
}

.page-content {
  width: fit-content;
  max-width: min(60rem, 100%);
  margin: 2rem auto;
  padding: 0 clamp(0rem, calc((100vw - 800px) / 40), 1rem);
}

.help-wrapper {
  display: block;
}

.help-text {
  margin: 0 0 1rem;
  line-height: 1.35;
  white-space: pre-wrap;
  font-size: clamp(0.7rem, calc(100vw / 85), 1rem);
}

.upload-form {
  margin: 0 0 1.5rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

input[type="text"],
input[type="file"],
button {
  background: var(--mantle);
  border: 1px solid var(--surface);
  color: var(--text);
}

input[type="text"],
input[type="file"] {
  min-width: min(32rem, calc(100vw - 3rem));
  padding: 0.45rem 0.55rem;
}

input[type="checkbox"] {
  accent-color: var(--blue);
}

button {
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.flash {
  margin: 0 0 1rem;
  white-space: pre-wrap;
}

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

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

.section-title {
  margin: 1.5rem 0 0.35rem;
}

.meta-line,
.file-meta {
  color: var(--subtext);
}

.file-list {
  display: grid;
  gap: 0.65rem;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding-top: 0.65rem;
  border-top: 1px dotted var(--surface);
}

.file-path {
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.actions form {
  display: block;
  margin: 0;
}

.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.empty {
  color: var(--subtext);
  padding-top: 0.65rem;
  border-top: 1px dotted var(--surface);
}

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

  .actions {
    gap: 0.55rem;
  }

  input[type="text"],
  input[type="file"] {
    min-width: 0;
    width: 100%;
  }
}
