* {
  box-sizing: border-box;
  margin: 0;
}

:root {
  color-scheme: dark;
}

body {
  font-family: system-ui, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 1rem 1rem;
  background: #121212;
  color: #d8d8d8;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid #333;
  padding: 1rem 0;
}

header .brand {
  font-weight: bold;
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex: 1;
}

nav .whoami {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav .actions {
  margin-left: auto;
}

nav form {
  display: inline;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

h1 {
  margin: 1.5rem 0;
}

.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.banner {
  border: 1px solid;
  padding: 0.5rem;
  overflow-wrap: anywhere;
}

.banner[data-error] {
  border-color: #c66;
  background: #5c1a1a;
}

.banner[data-info] {
  border-color: #b08d57;
  background: #3a2c1a;
}

.banner-error {
  border-color: #c66;
  background: #5c1a1a;
}

.banner-info {
  border-color: #b08d57;
  background: #3a2c1a;
}

.banner-success {
  border-color: #57a05a;
  background: #1a3a1a;
}

.banner:empty {
  display: none;
}

.scrollable {
  overflow-x: auto;
}

.empty-table {
  text-align: center;
}

.done {
  color: #7bd88a;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid #2a2a2a;
}

.truncate {
  display: block;
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

fieldset {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 32rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

button {
  width: fit-content;
  white-space: nowrap;
}

.submit {
  margin-left: auto;
}

[data-upload-client] {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

[data-upload-client] [data-lines] {
  list-style: none;
  margin: 0;
  padding: 0;
}

[data-upload-client] [data-lines]:empty {
  display: none;
}

[data-upload-client] [data-lines] li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

[data-upload-client] .line-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

[data-upload-client] .line-head .truncate {
  flex: 1;
  max-width: none;
}

[data-upload-client] .line-head button,
[data-upload-client] .line-meter .meta {
  flex-shrink: 0;
}

[data-upload-client] .line-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-upload-client] .line-meter progress {
  flex: 1;
  min-width: 0;
}

[data-upload-client] .truncate {
  min-width: 0;
}

@media (max-width: 640px) {
  nav .whoami {
    display: none;
  }

  .title {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .title .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .title .actions button,
  .title .actions a {
    width: 100%;
  }

  .title .actions form {
    width: 100%;
    max-width: none;
  }
}
