#tab-torrents {
  color: var(--text);
  --torrent-muted: var(--text2, #a7b1c2);
  --torrent-border: var(--border3, #384151);
  --torrent-bg: var(--bg2, #191f29);
}
.torrent-head, .torrent-tools, #torrent-pages {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.torrent-head { justify-content: space-between; }
#torrent-status, #torrent-mode { color: var(--torrent-muted); font-size: 13px; line-height: 1.5; margin: 5px 0; }
#torrent-mode { margin-bottom: 16px; }
.torrent-tools { margin-bottom: 12px; }
.torrent-tools select, .torrent-tools input {
  font: inherit; font-size: 13px; padding: 8px 10px; min-height: 36px; max-width: 100%;
  color: var(--text); background: var(--torrent-bg); border: 1px solid var(--torrent-border); border-radius: 6px;
}
.torrent-tools input { width: 240px; }
#tab-torrents [hidden] { display: none; }
.torrent-list {
  border: 1px solid var(--torrent-border); border-radius: 9px;
  background: var(--torrent-bg); overflow: hidden;
}
.torrent-columns, .torrent-journal-row > summary {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 12px;
  align-items: center; gap: 14px; padding: 11px 16px;
}
.torrent-columns { font-size: 12px; color: var(--torrent-muted); }
.torrent-journal-row { border-top: 1px solid var(--torrent-border); }
.torrent-journal-row > summary { font-size: 13px; list-style: none; cursor: pointer; }
.torrent-journal-row > summary::-webkit-details-marker { display: none; }
.torrent-journal-row > summary::after {
  content: ''; width: 6px; height: 6px; justify-self: end; margin-right: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  color: var(--torrent-muted); transform: rotate(45deg);
}
.torrent-journal-row[open] > summary::after { transform: rotate(225deg); }
.torrent-journal-row[open] > summary, .torrent-journal-row > summary:hover { background: #828fac0d; }
.torrent-journal-row > summary:focus-visible { outline: 2px solid var(--accent, #9487ff); outline-offset: -3px; }
.torrent-account, .torrent-activity, .torrent-outcome, .torrent-facts dd { overflow-wrap: anywhere; min-width: 0; }
.torrent-time { color: var(--torrent-muted); font-variant-numeric: tabular-nums; }
.torrent-outcome { justify-self: start; padding: 2px 7px; border: 1px solid currentColor; border-radius: 5px; font-size: 12px; }
.torrent-outcome[data-tone="ok"] { color: #55d6a7; }
.torrent-outcome[data-tone="problem"] { color: #ff8585; }
.torrent-outcome[data-tone="waiting"] { color: #f6c466; }
[data-theme="light"] .torrent-outcome[data-tone="ok"] { color: #08724d; }
[data-theme="light"] .torrent-outcome[data-tone="problem"] { color: #a61e36; }
[data-theme="light"] .torrent-outcome[data-tone="waiting"] { color: #805600; }
.torrent-detail { border-top: 1px solid var(--torrent-border); padding: 12px 16px; font-size: 13px; line-height: 1.6; }
.torrent-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px 24px; margin: 0; }
.torrent-facts dt, .torrent-last, .torrent-reasons, .torrent-metrics span, .torrent-metrics small { color: var(--torrent-muted); }
.torrent-facts dt, .torrent-metrics span, .torrent-metrics small { font-size: 12px; }
.torrent-facts dd { margin: 2px 0 0; }
.torrent-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; padding: 12px 0; }
.torrent-metrics strong, .torrent-metrics span, .torrent-metrics small { display: block; }
.torrent-metrics strong { font-size: 19px; }
.torrent-comparison { margin: 6px 0; }
.torrent-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.torrent-buttons .btn-danger { background: #ba3c4c; color: white; padding: 7px 11px; border: 0; border-radius: 6px; }
.torrent-buttons .btn-ghost { padding: 7px 11px; border: 1px solid var(--torrent-border); border-radius: 6px; }
#tab-torrents button:disabled { opacity: .5; cursor: not-allowed; }
.torrent-detail ol, .torrent-detail ul { margin: 5px 0; padding-left: 20px; }
.torrent-empty { text-align: center; padding: 32px 12px; margin: 0; color: var(--torrent-muted); }
#torrent-pages { justify-content: flex-end; margin-top: 12px; font-size: 12px; }
@media (max-width: 760px) {
  .torrent-columns { display: none; }
  .torrent-journal-row:first-of-type { border-top: 0; }
  .torrent-journal-row > summary {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 10px;
    grid-template-areas: "account time caret" "activity outcome caret";
    gap: 5px 10px; padding: 10px 12px;
  }
  .torrent-account { grid-area: account; }
  .torrent-time { grid-area: time; font-size: 11px; }
  .torrent-activity { grid-area: activity; }
  .torrent-outcome { grid-area: outcome; }
  .torrent-journal-row > summary::after { grid-area: caret; }
  .torrent-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .torrent-tools > select, .torrent-tools > input { flex: 1 1 160px; min-width: 0; }
}
