:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #1c2c42;
  background: #edf1f6;
  --line: #d5dde7;
  --muted: #52657c;
  --blue: #205ac6;
  --soft: #e8effc;
  --nav: #142b4a;
  --side: 216px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.titlebar {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 58px;
  gap: 48px;
  background: var(--nav);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 24px;
  letter-spacing: -1.2px;
  color: white;
  font-weight: 720;
}
.brand:hover {
  text-decoration: none;
}
.brandmark {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #417bea;
  width: 31px;
  height: 31px;
  font-size: 20px;
  color: #fff;
}
.titlebar nav {
  height: 100%;
  display: flex;
  gap: 4px;
}
.titlebar nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bbc9dc;
  padding: 0 16px;
  border-bottom: 3px solid transparent;
  font-weight: 550;
}
.titlebar nav a:hover {
  background: #223b5b;
  text-decoration: none;
}
.titlebar nav a[aria-current] {
  border-color: #68a7ff;
  color: #fff;
  background: #203c61;
}
.titlebar nav .ico {
  font-size: 16px;
}
.user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd7e6;
}
.avatar {
  margin-left: 12px;
  border: 1px solid #59708d;
  border-radius: 50%;
  height: 23px;
  width: 23px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 650;
}
.sign-out {
  font-size: 12px;
  border: 1px solid #788ca7;
  border-radius: 4px;
  padding: 4px 8px;
  color: white;
  background: transparent;
}
.auth-page { display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: min(100%, 360px);
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 8px;
  background: white;
}
.auth-card h1 { margin: 0 0 24px; font-size: 24px; }
.auth-card form, .auth-card label { display: grid; gap: 6px; }
.auth-card form { gap: 16px; }
.auth-card input, .auth-card button { padding: 9px 12px; border-radius: 4px; }
.auth-card input { border: 1px solid #a7b7ca; }
.auth-card button { background: var(--blue); color: white; border: 0; }
.workspace {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
aside {
  background: #f7f9fc;
  border-right: 1px solid var(--line);
  padding: 24px 10px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.side-title,
.detail-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.side-title {
  padding: 4px 10px 10px;
}
.side-title .ico {
  font-size: 15px;
}
.divider {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.side-list {
  display: grid;
  gap: 3px;
}
.side-link,
.tree-link,
.tree-expand {
  border: 0;
  background: transparent;
  color: #34465e;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  border-radius: 5px;
  padding: 9px 10px;
  font-weight: 500;
  font-size: 13px;
}
.side-link:hover,
.tree-link:hover,
.tree-expand:hover {
  background: #e9eef5;
}
.side-link.on,
.tree-line.on {
  color: #174ca8;
  background: #dfeafb;
}
.side-link.on {
  font-weight: 650;
}
.side-link .ico {
  font-size: 16px;
}
.side-link small {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.storage {
  margin: auto 6px 0;
  padding: 20px 2px 0;
  color: #3b506b;
}
.storage div {
  display: flex;
  gap: 9px;
  align-items: center;
}
.storage b {
  font-size: 12px;
}
.storage small {
  font-size: 11px;
}
.storage progress {
  height: 5px;
  width: 100%;
  margin: 9px 0 3px;
}
.workspace main {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 16px;
  min-width: 0;
  gap: 12px;
}
.workspace-title {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 35px;
}
.workspace-title h1 {
  font-size: clamp(21px, 2.5vw, 30px);
  letter-spacing: -1.1px;
  margin: 0;
  font-weight: 680;
}
.online {
  margin-left: auto;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  color: #40566a;
}
.online i,
.led {
  width: 7px;
  height: 7px;
  background: #299b69;
  border-radius: 50%;
  display: inline-block;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  box-shadow: 0 1px 2px #142b4a07;
}
.toolbar em {
  height: 21px;
  width: 1px;
  background: var(--line);
  margin: 0 4px;
}
.toolbar form {
  margin: 0;
}
.toolbar button,
.dialog-actions button,
.compact,
.square,
.mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  height: 33px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #34465e;
  font-weight: 550;
  font-size: 13px;
}
.toolbar button:hover:enabled,
.compact:hover,
.square:hover,
.mobile-toggle:hover {
  background: var(--soft);
  color: var(--blue);
}
button.primary,
.dialog-actions button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
button.primary:hover:enabled {
  background: #164cae;
  color: #fff;
}
.toolbar button:disabled {
  color: #8b99ac;
  opacity: 0.77;
}
.toolbar .primary:disabled {
  background: #e8edf4;
  border-color: transparent;
}
.toolbar .ico {
  font-size: 17px;
}
.toolbar .start:enabled .ico {
  color: #23845e;
}
.toolbar .pause:enabled .ico {
  color: #aa760b;
}
.toolbar .force:enabled .ico {
  color: #b56710;
}
.last {
  margin-left: auto;
}
.toolbar .square,
.square {
  width: 33px;
}
.mobile-toggle {
  display: none;
}
.panel,
.details {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  overflow: hidden;
}
.panel {
  flex: 1;
  min-height: 290px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  min-height: 56px;
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.count {
  border-radius: 4px;
  background: #eaf0f7;
  padding: 1px 7px;
  font-size: 12px;
  color: var(--muted);
}
.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #6a7c91;
  padding: 0 8px;
  min-width: 0;
  height: 30px;
}
.search input {
  width: 150px;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: inherit;
}
.table-scroll {
  overflow: auto;
  max-height: 58vh;
}
.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
  text-align: left;
  font-size: 13px;
}
.data th {
  background: #f1f4f8;
  color: #56677c;
  border-block: 1px solid var(--line);
  position: sticky;
  top: 0;
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
}
.data th,
.data td {
  padding: 8px 12px;
}
.data th + th {
  border-left: 1px solid #e0e6ed;
}
.data td {
  border-bottom: 1px solid #edf0f4;
}
.data tr:hover td {
  background: #f5f8fe;
}
.data tr.on td {
  background: #e7effd;
}
.data tr.on td:first-child {
  box-shadow: inset 3px 0 var(--blue);
}
.data .name-cell {
  max-width: 390px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data .name-cell .ico {
  margin-right: 8px;
  font-size: 16px;
  vertical-align: -1px;
}
.type-folder {
  color: #c48b22;
}
.type-file {
  color: #5684b3;
}
.type-torrent {
  color: #4b8d63;
}
.type-archive {
  color: #9a71aa;
}
.type-media {
  color: #b16f4d;
}
.data a {
  color: #203952;
}
.data tbody tr.selectable {
  cursor: pointer;
}
.file-table th button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.file-table th[aria-sort="ascending"] button::after {
  content: " ↑";
}
.file-table th[aria-sort="descending"] button::after {
  content: " ↓";
}
.checkbox {
  width: 28px;
}
.data input[type="checkbox"] {
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.progress {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.progress progress {
  width: 60px;
  height: 5px;
}
.storage progress,
.progress progress {
  border: 0;
  background: #e2e9f1;
  border-radius: 9px;
}
.storage progress::-webkit-progress-bar,
.progress progress::-webkit-progress-bar {
  background: #e2e9f1;
  border-radius: 9px;
}
.storage progress::-webkit-progress-value,
.progress progress::-webkit-progress-value {
  background: #4b80d4;
  border-radius: 9px;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8696ac;
}
.state.running i,
.state.ready i {
  background: #28905e;
}
.state.error i {
  background: #cb5256;
}
.state.paused i,
.state.scheduled i {
  background: #bd862a;
}
.empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty > .ico {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 25px;
  background: #eef3fb;
  color: #7290b7;
  border-radius: 12px;
}
.empty strong {
  font-size: 15px;
  font-weight: 600;
  color: #2a4059;
}
.detail-heading {
  background: #f6f8fb;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
#job-detail {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}
#job-detail dl {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 30px;
  margin: 0;
}
dt {
  font-size: 11px;
  color: #647589;
}
dd {
  margin: 3px 0 0;
  color: #243b55;
  overflow-wrap: anywhere;
}
.status {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 5px 17px;
  background: #e2e9f1;
  border-top: 1px solid #cbd5e2;
  font-size: 12px;
  color: #445a72;
}
.status > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.right {
  margin-left: auto;
}
#message:empty {
  display: none;
}
#message {
  border: 1px solid #ebd2a6;
  border-radius: 5px;
  background: #fff6df;
  color: #754c12;
  padding: 7px 12px;
  overflow-wrap: anywhere;
}
.tree-line {
  display: flex;
  align-items: center;
  border-radius: 4px;
  min-width: 0;
}
.tree-expand {
  font-size: 11px;
  padding: 5px;
  flex: none;
  width: 23px;
}
.tree-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  text-align: left;
  font-size: 13px;
  padding: 7px 2px;
  flex: 1;
}
.tree-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-children {
  margin-left: 14px;
  border-left: 1px solid var(--line);
  padding-left: 2px;
}
.tree-link .ico {
  color: #bb8524;
}
#tree {
  overflow: auto;
  max-height: 65vh;
}
#crumbs {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}
#crumbs a {
  font-size: 13px;
  overflow-wrap: anywhere;
}
#crumbs .ico {
  font-size: 12px;
  color: #9eabbc;
}
dialog {
  width: min(490px, 95vw);
  border: 1px solid #b5c3d4;
  border-radius: 9px;
  box-shadow: 0 20px 60px #11284538;
  padding: 0;
  color: inherit;
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #14294255;
}
dialog.wide {
  width: min(745px, 96vw);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 15px;
  background: #eff4fa;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 16px;
  margin: 0;
}
.dialog-head h2 .ico {
  color: var(--blue);
  margin-right: 5px;
}
dialog form {
  padding: 17px;
  display: grid;
  gap: 12px;
}
dialog label {
  display: grid;
  gap: 5px;
  color: #304760;
  font-size: 13px;
}
dialog input:not([type="checkbox"]),
dialog select {
  width: 100%;
  height: 34px;
  border: 1px solid #b6c5d5;
  border-radius: 4px;
  padding: 5px 8px;
  background: #fff;
  color: inherit;
}
dialog form p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-pair > * { min-width: 0; align-self: start; }
.folder-choice button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
}
.network-body { padding: 12px 17px; }
.vpn-body { padding: 16px; display: grid; gap: 12px; }
.vpn-body p { margin: 0; color: var(--muted); font-size: 13px; }
.vpn-body #vpn-status { color: #203d61; font-weight: 600; }
.vpn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vpn-actions button { border: 1px solid var(--line); border-radius: 4px; padding: 5px 9px; background: white; }
.vpn-body .dialog-actions { flex-wrap: wrap; }
.online.waiting i { background: #af731b; }
.network-body p { font-size: 13px; color: var(--muted); }
#dht-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: baseline;
  column-gap: 14px;
  row-gap: 9px;
  font-size: 13px;
}
#dht-stats dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
#dht-stats dt:nth-of-type(7), #dht-stats dd:nth-of-type(7) { padding-top: 9px; border-top: 1px solid var(--line); }
.dialog-actions button.danger { background: #a62735; color: white; }
#remove-name { overflow-wrap: anywhere; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}
.dialog-actions button {
  border-color: var(--line);
}
dialog input[type="checkbox"] {
  accent-color: var(--blue);
}
#week {
  overflow: auto;
}
#week table {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
  font-size: 11px;
}
#week input {
  width: 16px;
  height: 16px;
  margin: 2px;
}
#torrent-items {
  max-height: 32vh;
  overflow: auto;
  border-block: 1px solid var(--line);
  padding: 6px 0;
}
label.check {
  display: flex;
  align-items: center;
  gap: 6px;
}
#torrent-items label {
  padding: 4px 0;
  overflow-wrap: anywhere;
}
@media (min-width: 761px) {
  body {
    height: 100dvh;
  }
  .workspace main {
    overflow: auto;
  }
  .workspace {
    min-height: 0;
  }
  .panel {
    display: flex;
    flex-direction: column;
  }
  .table-scroll {
    min-height: 0;
  }
  .empty {
    flex: 1;
  }
  .details {
    flex: none;
  }
  .storage {
    flex: none;
  }
}
@media (max-width: 950px) {
  :root {
    --side: 185px;
  }
  .workspace main {
    padding: 17px 14px;
  }
  .toolbar button {
    padding: 6px;
  }
  .toolbar {
    gap: 2px;
  }
  .data th,
  .data td {
    padding: 7px 9px;
  }
}
@media (max-width: 760px) {
  .titlebar {
    height: 50px;
    padding: 0 12px;
    gap: 12px;
  }
  .titlebar nav a {
    padding: 0 9px;
  }
  .user {
    font-size: 0;
    gap: 0;
  }
  .user > .ico {
    display: none;
  }
  .avatar {
    font-size: 12px;
  }
  .workspace {
    display: block;
  }
  aside {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
    padding: 5px;
    font-size: 19px;
  }
  .workspace main {
    padding: 13px 9px;
  }
  .workspace-title {
    gap: 3px;
  }
  .side-open aside {
    display: flex;
    position: fixed;
    top: 50px;
    bottom: 32px;
    left: 0;
    width: 220px;
    z-index: 5;
    box-shadow: 8px 8px 24px #172c4929;
  }
  .side-open .workspace-title .mobile-toggle {
    position: relative;
    left: 217px;
    z-index: 6;
    background: white;
  }
  .toolbar .last {
    margin-left: 0;
  }
  .toolbar button {
    font-size: 12px;
  }
  .data {
    font-size: 12px;
  }
  .panel-head {
    flex-wrap: wrap;
    padding: 9px;
    gap: 5px;
  }
  .search input {
    width: 100px;
  }
  .status {
    gap: 10px;
    padding: 5px 8px;
    flex-wrap: wrap;
  }
  .status .right {
    font-size: 11px;
  }
  .form-pair {
    grid-template-columns: 1fr;
  }
  .online {
    font-size: 11px;
  }
  .file-table .name-cell {
    max-width: 270px;
  }
  .table-scroll {
    max-height: 58vh;
  }
  .user .avatar {
    margin-left: 0;
  }
}
