:root {
  color-scheme: dark;
  --bg: #0e1218;
  --surface: #151b24;
  --raised: #1c2531;
  --line: #293342;
  --text: #e3e9f0;
  --muted: #91a0b4;
  --accent: #8adbc6;
  --amber: #e9bb76;
  --error: #f29a98;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 550;
  white-space: nowrap;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:hover:not(:disabled) {
  background: var(--raised);
}
input,
select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  min-width: 0;
}
input::placeholder {
  color: #748298;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #8adbc619;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
.muted {
  color: var(--muted);
}
.primary {
  background: var(--accent);
  color: #092b24;
  border-color: var(--accent);
}
.primary:hover:not(:disabled) {
  background: #a6ecd9;
}
.primary span {
  margin-left: 12px;
  opacity: 0.65;
}
.quiet {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}
.icon {
  font-size: 20px;
  padding: 4px 10px;
  color: var(--muted);
}
.warning {
  color: var(--amber);
}
.boot {
  padding: 40px;
  color: var(--muted);
}
.topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 38px;
  padding: 0 32px;
  background: #10151ded;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.8px;
}
.brand-mark {
  font-size: 42px;
  color: var(--accent);
  font-weight: 400;
  line-height: 1;
}
.tag {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.2px;
  padding: 4px 5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-left: 3px;
}
.topbar nav {
  display: flex;
  align-self: stretch;
  gap: 8px;
}
.topbar nav button {
  position: relative;
  color: var(--muted);
  border-radius: 0;
  padding: 0 12px;
}
.topbar nav button.active {
  color: var(--text);
}
.topbar nav button.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  height: 2px;
  left: 12px;
  right: 12px;
  background: var(--accent);
}
.count {
  background: var(--raised);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 5px;
}
.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
#account-button {
  color: var(--muted);
  font-size: 12px;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 28px 32px;
  min-height: calc(100dvh - 114px);
}
.searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 8px 7px 16px;
}
.search-symbol {
  font-size: 30px;
  line-height: 1;
  color: var(--muted);
}
.searchbar input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 8px 0;
  box-shadow: none;
}
.searchbar:focus-within {
  border-color: #648d85;
}
.searchbar .primary {
  min-height: 40px;
}
.searchbar kbd {
  font:
    12px ui-monospace,
    monospace;
  color: var(--muted);
  border: 1px solid #3a4555;
  border-radius: 4px;
  padding: 3px 7px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 28px;
}
.filters label {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.filters input,
.filters select {
  font-size: 12px;
  padding: 7px 10px;
  background: var(--surface);
}
.filters input {
  width: 155px;
}
.filters .quiet {
  font-size: 11px;
  padding: 7px 9px;
  background: none;
  border: 0;
}
.filter-caption {
  font-size: 11px;
  color: #657488;
  margin-left: auto;
}
.sectionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
  gap: 12px;
  min-height: 32px;
}
.sectionbar > div {
  display: flex;
  align-items: center;
  gap: 13px;
}
.sectionbar strong {
  font-size: 13px;
}
.sectionbar .muted {
  font-size: 11px;
}
.shortcut-hint {
  color: #657488;
  font-size: 11px;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
th {
  background: var(--surface);
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
th button {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 16px;
}
th button span {
  color: var(--accent);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid #222c38;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover,
tbody tr.selected {
  background: #18222c;
}
.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 96px;
}
.numeric button {
  padding-left: 6px;
  padding-right: 16px;
}
.action-col {
  width: 68px;
  text-align: right;
  padding-left: 0;
}
.release-cell {
  min-width: 0;
}
.title-text {
  font-size: 13px;
  font-weight: 530;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.release-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.release-tags span {
  font-size: 10px;
  line-height: 1.4;
  color: #98a6ba;
  background: #202a36;
  padding: 2px 5px;
  border-radius: 3px;
}
.release-tags .group-tag {
  background: transparent;
  color: #82c6b7;
  padding-left: 3px;
}
.size-cell {
  white-space: nowrap;
  font-size: 12px;
}
.seeds {
  color: #91c5b2;
  font-size: 12px;
}
.peers {
  font-size: 12px;
}
.download {
  background: #18332e;
  color: var(--accent);
  border: 1px solid #295147;
  font-size: 20px;
  line-height: 1;
  min-width: 35px;
  padding: 8px;
}
.download:hover:not(:disabled) {
  background: #245043;
}
.download.added {
  border-color: transparent;
  background: transparent;
  font-size: 16px;
}
.empty {
  padding: 80px 20px 100px;
  text-align: center;
  color: var(--muted);
}
.empty-mark {
  display: inline-block;
  font-size: 48px;
  color: #496071;
  line-height: 1.2;
}
.empty h1,
.empty h2 {
  font-size: 18px;
  font-weight: 570;
  color: #bccad7;
  margin: 20px 0 10px;
}
.empty p {
  font-size: 12px;
  line-height: 1.6;
}
.chip {
  font-size: 11px;
  margin-top: 12px;
  border-color: var(--line);
  color: var(--muted);
  white-space: normal;
  max-width: 100%;
}
.chip span {
  margin-left: 8px;
  color: var(--accent);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  max-width: 1440px;
  margin: auto;
  padding: 15px 32px 20px;
  color: #657488;
  font-size: 10px;
  border-top: 1px solid #202a35;
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 12px;
}
.download-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
}
.status-pill {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.status-pill.running {
  background: #193a30;
  color: var(--accent);
}
progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  margin: 17px 0;
  background: #293442;
}
progress::-webkit-progress-bar {
  background: #293442;
}
progress::-webkit-progress-value {
  background: var(--accent);
}
progress::-moz-progress-bar {
  background: var(--accent);
}
.download-details {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.download-details strong {
  color: var(--text);
}
.download-details .quiet {
  padding: 5px 10px;
  font-size: 11px;
}
.speed-down {
  color: var(--accent);
}
.requester {
  margin-left: auto;
}
.inline-warning {
  color: var(--amber);
  font-size: 12px;
  line-height: 1.6;
}
.users-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child {
  border: 0;
}
.user-row strong {
  min-width: 100px;
}
.user-row button {
  margin-left: auto;
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #20362f;
  color: var(--accent);
  font-size: 11px;
}
.connection-panel {
  margin-top: 30px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.connection-panel p {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.login {
  width: min(360px, calc(100% - 40px));
  margin: 14vh auto;
}
.login .brand {
  margin-bottom: 38px;
}
.login form {
  display: grid;
  gap: 17px;
}
.login .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.form-error {
  color: var(--error);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
.form-error:empty {
  display: none;
}
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.login input {
  width: 100%;
  min-height: 43px;
  background: var(--surface);
}
dialog {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid #394a5a;
  border-radius: 12px;
  padding: 26px;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: #03090ecc;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 18px;
  margin: 0 0 8px;
}
dialog form {
  display: grid;
  gap: 18px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.release-title {
  overflow-wrap: anywhere;
  line-height: 1.7;
  font-size: 13px;
  margin: 0;
}
.form-row {
  display: flex;
  gap: 24px;
  align-items: end;
}
.form-row label:first-child {
  flex: 1;
}
.checkbox {
  display: flex;
  align-items: center;
  min-height: 40px;
}
.checkbox input {
  accent-color: var(--accent);
}
.password-tools {
  display: flex;
  gap: 8px;
}
.password-tools input {
  flex: 1;
  width: 100%;
  font-family: ui-monospace, monospace;
}
dialog .muted {
  font-size: 11px;
  margin: 0;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: #203b33;
  border: 1px solid #49715e;
  color: #d5f5e7;
  padding: 13px 20px;
  border-radius: 8px;
  box-shadow: 0 12px 40px #0006;
  max-width: calc(100% - 32px);
  font-size: 12px;
}
#toast.error {
  background: #3b2729;
  border-color: #825257;
  color: #f5ccca;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 800px) {
  .topbar {
    padding: 0 18px;
    gap: 16px;
  }
  .brand {
    font-size: 20px;
  }
  .brand .tag {
    display: none;
  }
  .topbar nav {
    gap: 0;
  }
  .topbar nav button {
    padding: 0 9px;
    font-size: 12px;
  }
  .account {
    gap: 0;
  }
  main {
    padding: 22px 18px;
  }
  .filters {
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .filter-caption,
  .shortcut-hint {
    display: none;
  }
  .filters label {
    font-size: 10px;
    gap: 6px;
  }
  .filters input {
    width: 130px;
  }
  .numeric {
    width: 76px;
  }
  .peers {
    display: none;
  }
  td {
    padding: 12px;
  }
  .action-col {
    width: 55px;
    padding-right: 10px;
  }
  .numeric button {
    padding-right: 12px;
  }
  footer {
    padding: 15px 18px;
  }
  .sectionbar > div {
    gap: 8px;
  }
  .sectionbar .muted {
    font-size: 10px;
  }
}
@media (max-width: 520px) {
  .topbar {
    height: auto;
    min-height: 95px;
    flex-wrap: wrap;
    padding: 10px 14px 0;
    gap: 0;
  }
  .topbar .brand {
    order: 0;
  }
  .account {
    order: 1;
  }
  .topbar nav {
    order: 2;
    width: 100%;
    height: 41px;
    margin-top: 4px;
  }
  .topbar nav button {
    flex: 1;
  }
  .topbar nav button.active:after {
    left: 8px;
    right: 8px;
  }
  main {
    padding: 18px 12px;
    min-height: calc(100dvh - 145px);
  }
  .searchbar {
    gap: 8px;
    padding-left: 10px;
  }
  .searchbar input {
    font-size: 14px;
  }
  .searchbar kbd,
  .search-symbol {
    display: none;
  }
  .searchbar .primary {
    padding: 9px 11px;
    font-size: 12px;
  }
  .searchbar .primary span {
    display: none;
  }
  .filters {
    gap: 9px;
  }
  .filters label {
    display: grid;
    gap: 5px;
  }
  .filters input {
    width: 120px;
  }
  .filters select {
    max-width: 115px;
  }
  .filters .quiet {
    margin-top: 15px;
  }
  .title-text {
    font-size: 12px;
  }
  .numeric {
    width: 65px;
  }
  .action-col {
    width: 47px;
  }
  .numeric button {
    padding: 10px 5px;
    font-size: 10px;
  }
  td {
    padding: 12px 8px;
  }
  .release-tags {
    gap: 3px;
    flex-wrap: wrap;
  }
  .release-tags span {
    font-size: 9px;
  }
  .size-cell {
    font-size: 11px;
  }
  .seeds {
    font-size: 11px;
  }
  .download {
    min-width: 30px;
    padding: 8px;
  }
  .empty {
    padding: 55px 8px;
  }
  .empty h1 {
    font-size: 17px;
  }
  .sectionbar .muted {
    display: none;
  }
  .download-card {
    padding: 13px;
  }
  .download-heading {
    gap: 8px;
  }
  .download-details {
    gap: 12px;
  }
  .user-row {
    padding: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .user-row strong {
    min-width: 70px;
  }
  .user-row .muted {
    font-size: 10px;
  }
  .connection-panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
  }
  footer {
    padding: 14px 12px;
    font-size: 9px;
  }
  dialog {
    padding: 20px;
  }
  .password-tools .quiet {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
