:root {
  color-scheme: dark;
  --control-height: 44px;
  --bg: #101217;
  --panel: #191c24;
  --line: #2c303c;
  --muted: #a5adbd;
  --text: #eff2f8;
  --accent: #a8ebc4;
  --danger: #ff9f9f;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #242935;
  color: var(--text);
  padding: 10px 15px;
}
button:hover {
  background: #343b4b;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--accent);
  color: #14291d;
  border-color: var(--accent);
  font-weight: 650;
}
.primary:hover {
  background: #c3f5d7;
}
.danger {
  color: var(--danger);
  border-color: #774545;
}
input,
select {
  background: #11151d;
  border: 1px solid #414859;
  color: var(--text);
  border-radius: 8px;
  padding: 11px;
  min-width: 0;
}
/* One shared height for text fields and selects across every page and dialog. */
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='hidden']),
select {
  height: var(--control-height);
  box-sizing: border-box;
  padding-block: 0;
  line-height: normal;
}
select {
  padding-inline: 11px 34px;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
a {
  color: var(--accent);
}
aside {
  width: 220px;
  background: #14171e;
  border-right: 1px solid var(--line);
  padding: 34px 20px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 27px;
  letter-spacing: -1px;
  font-weight: 750;
  margin: 0 12px 42px;
}
.brand span {
  color: var(--accent);
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 7px;
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  background: none;
  border-color: transparent;
  padding: 13px;
}
nav button.active {
  background: #25352f;
  color: var(--accent);
}
.sidebar-foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  padding: 20px 10px;
}
.sidebar-foot button {
  margin-top: 16px;
  width: 100%;
  font-size: 12px;
}
main {
  margin-left: 220px;
  padding: 40px 42px;
  max-width: 1800px;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.9px;
  margin: 0 0 9px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.toolbar input {
  flex: 1;
  min-width: 180px;
}
.tabs {
  display: flex;
  background: #191e27;
  border-radius: 10px;
  padding: 4px;
  gap: 3px;
}
.tabs button {
  background: none;
  border-color: transparent;
  padding: 8px 13px;
  font-size: 13px;
}
.tabs button.selected {
  background: #384239;
  color: var(--accent);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 24px 18px;
}
.card {
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
  min-width: 0;
}
.card:hover {
  background: none;
  transform: translateY(-3px);
}
.poster {
  aspect-ratio: 2/3;
  border: 1px solid #39404b;
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(145deg, #293d40, #252332 60%, #333128);
  display: grid;
  place-items: center;
}
.poster .letter {
  font-size: 62px;
  font-weight: 750;
  color: #819b99;
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.poster .badge {
  position: absolute;
  top: 10px;
  left: 9px;
  background: #10151ee8;
  color: white;
}
.poster .state {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(transparent, #0c1015);
  font-size: 12px;
  color: #d7f2df;
}
.card h3 {
  margin: 11px 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  background: #29332e;
  color: var(--accent);
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 23px;
  margin: 16px 0;
}
.notice {
  padding: 13px 16px;
  border: 1px solid #5d5231;
  background: #302b20;
  color: #f2d896;
  border-radius: 9px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.6;
}
.error {
  border-color: #704147;
  background: #302026;
  color: #ffb8b8;
}
.success {
  border-color: #355e47;
  background: #1c3026;
  color: #b7eacb;
}
.empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed #3c4555;
  border-radius: 14px;
  margin: 20px 0;
}
.empty .symbol {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 12px;
}
.empty p {
  max-width: 540px;
  margin: 12px auto 24px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 26px 0;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 12px;
}
.stat strong {
  font-size: 32px;
  display: block;
  margin-top: 13px;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.row:last-child {
  border-bottom: 0;
}
.grow {
  flex: 1;
  min-width: 0;
}
.row p {
  margin: 5px 0;
  font-size: 13px;
  color: var(--muted);
}
.list-card {
  width: 100%;
  text-align: left;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}
.list-card strong {
  flex: 1;
}
.list-card small {
  min-width: 90px;
}
.list-card span {
  font-size: 12px;
}
.fields {
  display: grid;
  gap: 18px;
}
.fields label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.fields label.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fields small {
  line-height: 1.6;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 22px 0;
}
.login {
  max-width: 430px;
  margin: 12vh auto;
  padding: 30px;
}
.login .brand {
  margin: 0 0 35px;
}
.login button {
  width: 100%;
}
.loading {
  color: var(--muted);
  padding: 40px;
  text-align: center;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #485347;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
dialog {
  background: var(--bg);
  color: var(--text);
  border: 1px solid #485060;
  border-radius: 17px;
  width: min(900px, 94vw);
  max-height: 92vh;
  padding: 28px;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(4px);
}
.close {
  float: right;
  margin-left: 12px;
}
.detail-head {
  display: flex;
  gap: 24px;
  margin: 18px 0;
}
.detail-head .poster {
  width: 150px;
  flex-shrink: 0;
  align-self: flex-start;
}
.detail-head h2 {
  font-size: 29px;
  margin: 7px 0;
}
.detail-head p {
  font-size: 14px;
  color: #bec6d3;
}
.season {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}
summary {
  cursor: pointer;
  padding: 8px;
}
.episode {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 3px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.episode label {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}
.episode small {
  max-width: 160px;
  text-align: right;
}
.tags {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.progress {
  width: 100%;
  height: 5px;
  accent-color: var(--accent);
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(450px, 90vw);
  z-index: 10;
  background: #d3efdf;
  color: #183123;
  padding: 0;
  border-radius: 10px;
  box-shadow: 0 8px 40px #0008;
}
#toast:not(:empty) {
  padding: 16px 22px;
}
.calendar-date {
  font-size: 22px;
  font-weight: 650;
  min-width: 75px;
  color: var(--accent);
}
.subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
}
.subhead button {
  font-size: 12px;
}
@media (min-width: 1500px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  }
}
@media (max-width: 1000px) {
  aside {
    width: 185px;
    padding: 30px 12px;
  }
  main {
    margin-left: 185px;
    padding: 30px 24px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .two {
    grid-template-columns: 1fr;
  }
  .grid {
    gap: 20px 12px;
  }
}
@media (max-width: 650px) {
  aside {
    position: static;
    width: 100%;
    padding: 20px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 5px 17px;
    font-size: 24px;
  }
  .brand small {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 3px;
  }
  nav button {
    display: block;
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
  }
  nav button .nav-label {
    display: block;
  }
  .sidebar-foot {
    display: none;
  }
  main {
    margin: 0;
    padding: 25px 16px;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head button {
    font-size: 12px;
  }
  h1 {
    font-size: 26px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat {
    padding: 18px;
  }
  .stats {
    gap: 10px;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input {
    flex-basis: 100%;
  }
  .tabs {
    flex: 1;
    justify-content: center;
  }
  .detail-head {
    gap: 15px;
  }
  .detail-head .poster {
    width: 90px;
  }
  .detail-head h2 {
    font-size: 23px;
  }
  dialog {
    padding: 18px;
  }
  .list-card {
    gap: 10px;
    flex-wrap: wrap;
  }
  .row {
    flex-wrap: wrap;
  }
  .calendar-date {
    min-width: 60px;
  }
  .episode small {
    font-size: 10px;
  }
  .two {
    gap: 5px;
  }
  .login {
    margin: 8vh auto;
  }
  .panel {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Shared control dimensions, including native selects across browsers. */
.toolbar > input,
.toolbar > select,
.toolbar > button,
.toolbar > .tabs,
.activity-controls > select,
.calendar-toolbar button,
.month-picker > summary {
  height: var(--control-height);
  box-sizing: border-box;
}
.toolbar > select,
.activity-controls > select {
  line-height: normal;
  padding: 0 34px 0 12px;
  max-width: 100%;
}
.toolbar > .tabs {
  align-items: center;
}
.toolbar > .tabs button {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}
.search-hint {
  font-size: 12px;
  margin-top: -12px;
  margin-bottom: 24px;
}
.activity-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 26px 0;
}
.activity-summary > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.activity-summary span {
  font-size: 13px;
  color: var(--muted);
}
.activity-summary strong {
  font-size: 28px;
}
.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
.activity-main {
  margin: 0;
  min-width: 0;
}
aside.activity-health {
  position: static;
  inset: auto;
  width: auto;
  display: block;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.activity-health h2 {
  font-size: 16px;
  margin: 0 0 22px;
}
.activity-controls {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.activity-controls .tabs {
  max-width: 100%;
}
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.downloads-grid > .empty {
  grid-column: 1/-1;
}
.download-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: #141820;
  min-width: 0;
}
.download-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.service-dot {
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}
.service-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a8ebc4;
}
.service-dot.radarr::before {
  background: #efcf83;
}
.activity-status {
  font-size: 11px;
  border-radius: 6px;
  background: #253a31;
  color: #b6ebca;
  padding: 5px 8px;
}
.activity-status.is-warning {
  background: #443723;
  color: #f0cf85;
}
.download-card h3 {
  line-height: 1.5;
  overflow-wrap: anywhere;
  margin: 19px 0 22px;
}
.download-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}
.download-metrics small {
  font-size: 11px;
}
.download-progress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 12px 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #303642;
  accent-color: var(--accent);
}
.download-progress::-webkit-progress-bar {
  background: #303642;
  border-radius: 10px;
}
.download-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 10px;
}
.download-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 10px;
}
.download-eta {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 0;
}
.download-warning,
.health-detail {
  margin-top: 14px;
  border: 1px solid #5d5231;
  border-radius: 8px;
  background: #2c281f;
  color: #f0cf85;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.download-warning summary,
.health-detail summary {
  padding: 10px;
  line-height: 1.5;
}
.download-warning ul {
  padding: 0 15px 10px 28px;
  line-height: 1.7;
}
.health-detail p {
  padding: 0 12px 8px;
}
.activity-event {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.activity-event:last-child {
  border-bottom: 0;
}
.activity-event strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.activity-event p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.activity-event time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.event-icon {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--accent);
}
.activity-footnote {
  font-size: 11px;
  color: var(--muted);
  margin: 20px 0 0;
}
.engine-health {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.engine-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.engine-health > p {
  font-size: 12px;
  margin: 9px 0 0;
}
.health-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c8494;
}
.health-indicator.ok {
  background: #a8ebc4;
  box-shadow: 0 0 0 4px #a8ebc414;
}
.health-indicator.warning {
  background: #efcf83;
}
.calendar-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0;
}
.month-navigation {
  display: flex;
  gap: 8px;
  align-items: center;
}
.month-navigation > button {
  width: 40px;
  padding: 0;
  font-size: 24px;
}
.month-picker {
  position: relative;
}
.month-picker > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  padding: 0 16px;
  text-transform: capitalize;
}
.month-picker > summary::-webkit-details-marker {
  display: none;
}
.month-popover {
  position: absolute;
  top: 54px;
  left: 0;
  z-index: 3;
  width: 310px;
  max-width: calc(100vw - 40px);
  padding: 16px;
  background: #1c212b;
  border: 1px solid #414959;
  border-radius: 13px;
  box-shadow: 0 16px 45px #0008;
}
.picker-year {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.picker-year button {
  height: 32px;
  width: 32px;
  padding: 0;
  font-size: 22px;
}
.month-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.month-options button {
  font-size: 12px;
  text-transform: capitalize;
  background: transparent;
  border-color: transparent;
  padding: 5px;
  height: 38px;
}
.month-options button:hover {
  background: #303947;
}
.month-options button.selected {
  color: #153222;
  background: var(--accent);
}
@media (max-width: 1100px) {
  .activity-layout {
    grid-template-columns: 1fr;
  }
  aside.activity-health {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .activity-health h2 {
    grid-column: 1/-1;
    margin-bottom: 0;
  }
}
@media (max-width: 650px) {
  .activity-summary {
    gap: 8px;
  }
  .activity-summary > div {
    padding: 14px 10px;
    display: block;
  }
  .activity-summary span {
    font-size: 11px;
    display: block;
    min-height: 30px;
  }
  .activity-summary strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
  }
  .activity-controls .tabs {
    width: 100%;
  }
  .activity-controls .tabs button {
    padding: 8px;
    font-size: 12px;
    flex: 1;
  }
  .activity-controls > select {
    width: 100%;
  }
  .activity-event {
    flex-wrap: wrap;
  }
  .activity-event time {
    margin-left: 48px;
  }
  .activity-event .grow {
    min-width: calc(100% - 55px);
  }
  .calendar-toolbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .month-picker > summary {
    min-width: 170px;
  }
  .calendar-toolbar #current-month {
    font-size: 12px;
  }
  .month-popover {
    left: -35px;
  }
  aside.activity-health {
    display: block;
  }
}
.month-picker > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.release-detail {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}
.release-detail summary {
  padding: 5px 0;
}
.release-detail p {
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.episode-caption {
  font-size: 12px;
  color: var(--muted);
  margin: -12px 0 20px;
}

nav .nav-icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #9ca8bb;
  transition: color 0.15s ease;
}
nav button:hover .nav-icon,
nav button.active .nav-icon {
  color: var(--accent);
}
nav .nav-label {
  line-height: 20px;
}
@media (max-width: 650px) {
  nav button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 70px;
    padding: 10px 8px;
  }
  nav .nav-icon {
    width: 19px;
    height: 19px;
  }
  nav .nav-label {
    font-size: 11px;
    line-height: 15px;
  }
}
.detail-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  top: -28px;
  z-index: 4;
  background: var(--bg);
  padding: 8px 0;
  margin: -8px 0 0;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
}
.title-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 18px;
  margin: 24px 0;
}
.title-search h3 {
  margin: 0 0 6px;
}
.title-search p,
.section-help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}
.scope-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.scope-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 12px;
}
.scope-actions svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.scope-actions .search-auto {
  background: #25382e;
  color: var(--accent);
  border-color: #365243;
}
.scope-actions .search-manual {
  background: transparent;
}
.preferences-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 24px 0;
}
.preferences-panel > summary {
  font-weight: 600;
  font-size: 14px;
}
.preferences-panel .fields {
  padding: 16px 4px 8px;
}
.detail-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 20px;
}
.detail-danger-zone small {
  flex: 1;
  min-width: 180px;
  font-size: 11px;
  line-height: 1.7;
}
.detail-danger-zone button {
  font-size: 12px;
}
.episode-section > h3 {
  margin-bottom: 8px;
}
.season-card {
  padding: 0;
  overflow: hidden;
}
.season-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  list-style: none;
}
.season-card > summary::before {
  content: '›';
  font-size: 22px;
  color: var(--muted);
}
.season-card[open] > summary::before {
  content: '⌄';
}
.season-card > summary > div {
  flex: 1;
}
.season-card > summary strong {
  display: block;
  font-size: 15px;
}
.season-card > summary span:not(.badge) {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.season-card > summary::-webkit-details-marker {
  display: none;
}
.season-toolbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.season-toolbar label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.episodes-table {
  padding: 0 18px;
}
.episode-row {
  padding: 15px 0;
  gap: 12px;
}
.episode-row:first-child {
  border-top: 0;
}
.episode-row .episode-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.episode-title input {
  flex-shrink: 0;
}
.episode-title strong {
  font-size: 12px;
  line-height: 1.5;
  display: block;
  overflow-wrap: anywhere;
}
.episode-title small {
  display: block;
  font-size: 10px;
  text-align: left;
  max-width: none;
  margin-top: 6px;
}
.episode-number {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.episode-state {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.episode-state.available {
  color: var(--accent);
}
.episode-row .scope-actions button {
  padding: 7px;
  font-size: 11px;
}
.episode-row .scope-actions svg {
  width: 14px;
  height: 14px;
}
.back-link {
  background: transparent;
  border: 0;
  color: var(--accent);
  padding: 8px 0;
  font-size: 12px;
}
.release-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 24px 0 16px;
}
.release-toolbar input {
  flex: 1;
  min-width: 180px;
}
.release-toolbar small {
  font-size: 11px;
}
.release-toolbar button {
  font-size: 12px;
}
.release-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 18px;
  margin: 12px 0;
}
.release-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.release-heading h3 {
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  margin: 0;
  min-width: 0;
}
.release-heading .badge {
  flex-shrink: 0;
}
.release-rejected {
  background: #423322;
  color: #e8c68d;
}
.release-meta {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin: 14px 0;
}
.release-meta span:first-child {
  color: var(--text);
}
.release-reasons {
  font-size: 12px;
  color: #e8c68d;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.release-reasons summary {
  padding: 8px 0;
}
.release-reasons ul {
  padding-left: 20px;
  line-height: 1.7;
}
.release-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.release-bottom small {
  font-size: 11px;
}
.release-bottom button {
  font-size: 12px;
}
@media (max-width: 650px) {
  .detail-tools {
    top: -18px;
  }
  .title-search {
    align-items: flex-start;
    flex-direction: column;
  }
  .title-search > .scope-actions {
    width: 100%;
  }
  .title-search > .scope-actions button {
    flex: 1;
  }
  .season-card > summary {
    padding: 14px 12px;
    gap: 8px;
  }
  .season-card > summary .badge {
    font-size: 9px;
  }
  .season-toolbar {
    padding: 12px;
  }
  .episodes-table {
    padding: 0 12px;
  }
  .episode-row {
    flex-wrap: wrap;
  }
  .episode-row .episode-title {
    flex-basis: calc(100% - 95px);
  }
  .episode-row > .scope-actions {
    margin-left: 30px;
  }
  .release-heading {
    flex-direction: column;
    gap: 8px;
  }
  .release-bottom button {
    width: 100%;
  }
}
.discovery-intro {
  margin: 30px 0;
}
.discovery-intro h2 {
  font-size: 24px;
  margin: 0 0 8px;
}
.discovery-intro p,
.discovery-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.7;
}
.discovery-section {
  margin: 32px 0 40px;
}
.discovery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.discovery-heading h3 {
  font-size: 19px;
  margin: 0 0 7px;
}
.discovery-heading > small {
  white-space: nowrap;
}
.discovery-source,
.discovery-attribution {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.discovery-source {
  margin: 0 0 20px;
}
.discovery-attribution {
  margin-top: 20px;
}
.release-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.release-filters label {
  font-size: 11px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}
.release-filters select {
  width: 100%;
  font-size: 12px;
}
#release-count {
  font-size: 11px;
  margin: 18px 0;
}
.activity-live {
  display: flex;
  align-items: center;
  gap: 10px 20px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.activity-live label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.activity-live small {
  font-size: 11px;
}
.error-text {
  color: var(--danger);
}
@media (max-width: 650px) {
  .release-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .discovery-heading {
    align-items: flex-start;
    gap: 10px;
  }
}
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
  padding: 15px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.bulk-toolbar > div:first-child strong {
  font-size: 13px;
}
.bulk-toolbar small {
  display: block;
  font-size: 11px;
  margin-top: 6px;
}
.bulk-toolbar .actions {
  margin: 0;
  gap: 7px;
}
.bulk-toolbar button {
  font-size: 12px;
}
.media-selectable {
  position: relative;
  min-width: 0;
}
.media-selectable > .card {
  width: 100%;
}
.selection-control {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #101217e8;
  border: 1px solid #647166;
  border-radius: 7px;
  cursor: pointer;
}
.selection-control input {
  margin: 0;
  cursor: pointer;
}
.media-selectable.is-selected .poster {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #a8ebc455;
}
.selectable-list .selection-control {
  left: 10px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
}
.selectable-list .list-card {
  padding-left: 54px;
  min-height: 64px;
}
.selectable-list.is-selected .list-card {
  border-color: var(--accent);
  background: #213028;
}
.bulk-engine {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}
.bulk-engine legend {
  font-size: 15px;
  font-weight: 650;
  padding: 0 8px;
}
.bulk-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.bulk-fields label {
  min-width: 0;
}
.bulk-fields select {
  width: 100%;
  font-size: 12px;
}
.bulk-tags {
  margin: 18px 0 12px;
}
.bulk-engine > small {
  font-size: 11px;
  line-height: 1.6;
}
.bulk-result {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  font-size: 13px;
}
.bulk-result strong {
  display: block;
}
.bulk-result small {
  display: block;
  margin-top: 6px;
}
.bulk-result > span {
  max-width: 55%;
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}
.bulk-results {
  margin: 20px 0 24px;
}
@media (max-width: 650px) {
  .bulk-toolbar {
    padding: 14px;
  }
  .bulk-toolbar .actions {
    width: 100%;
  }
  .bulk-toolbar .actions button {
    flex: 1;
    min-width: 125px;
  }
  .bulk-fields {
    grid-template-columns: 1fr;
  }
  .bulk-engine {
    padding: 16px;
  }
  .bulk-result {
    align-items: flex-start;
  }
  .bulk-result > span {
    max-width: 50%;
  }
}

/* Manual search: compact release rows and an integrated association editor. */
#release-list { border: 1px solid var(--line); border-radius: 14px; background: #12151c; }
#release-list:has(> .empty) { border: 0; background: none; }
.release-row { display: grid; grid-template-columns: minmax(0, 1fr) 114px auto; align-items: center; gap: 14px; padding: 17px 18px; margin: 0; border: 0; border-bottom: 1px solid #ffffff0b; border-radius: 0; background: transparent; transition: background .15s; }
.release-row:last-child { border-bottom: 0; }
.release-row:first-child { border-radius: 14px 14px 0 0; }
.release-row:last-child { border-radius: 0 0 14px 14px; }
.release-row:only-child { border-radius: 14px; }
.release-row:hover { background: #ffffff03; }
.release-row.is-associating { background: #a8ebc405; }
.release-info { min-width: 0; }
.release-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.release-eyebrow > span + span:not(.release-quality)::before { content: '·'; margin-right: 8px; opacity: .5; }
.release-quality { color: #c2d2e8; font-size: 9px; font-weight: 650; padding: 3px 6px; background: #92b2e00e; border: 1px solid #92b2e026; border-radius: 4px; }
.release-info h3 { margin: 0; font-size: 12px; font-weight: 560; line-height: 1.55; overflow-wrap: anywhere; color: #e6eaf1; }
.release-row .release-meta { margin: 6px 0 0; gap: 6px 10px; font-size: 10px; color: #8a92a2; }
.release-row .release-meta span:first-child { color: #8a92a2; }
.release-protocol { text-transform: capitalize; }
.release-metrics { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; text-align: right; }
.release-metrics strong { display: block; font-size: 11px; font-weight: 550; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.release-metrics small { display: block; color: #778091; font-size: 9px; margin-top: 5px; }
.release-actions { display: flex; align-items: center; gap: 16px; padding-left: 15px; border-left: 1px solid #ffffff0c; }
.release-icon-group { display: flex; align-items: center; gap: 5px; }
.release-icon, .release-warning summary { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 34px; padding: 8px; border: 1px solid transparent; border-radius: 9px; color: #8f98a8; background: transparent; cursor: pointer; transition: color .15s, background .15s, border-color .15s; flex-shrink: 0; }
.release-icon svg, .release-warning svg, .association-symbol svg, .association-search svg, .association-selected svg, .association-confirm svg { width: 17px; height: 17px; flex-shrink: 0; }
.release-icon:hover { color: #edf2fa; background: #ffffff09; border-color: #ffffff15; }
.release-download { color: var(--accent); background: #a8ebc410; border-color: #a8ebc423; }
.release-download:hover { color: #c9ffdd; background: #a8ebc423; border-color: #a8ebc451; }
.release-download:disabled { opacity: .45; }
.release-download.is-done { color: var(--accent); background: transparent; border-color: transparent; opacity: .8; }
.match-score { --score-color: #b6a58e; position: relative; display: grid; place-items: center; width: 39px; height: 39px; flex-shrink: 0; border-radius: 50%; background: conic-gradient(var(--score-color) var(--match), #ffffff0c 0); }
.match-score::before { content: ''; position: absolute; inset: 2px; background: #13171e; border-radius: 50%; }
.match-score > span { position: relative; font-size: 10px; color: #d1d7e0; font-variant-numeric: tabular-nums; }
.match-score small { font-size: 7px; margin-left: 1px; color: #8c96a6; }
.match-score.is-high { --score-color: #91d5ac; }
.match-score.is-medium { --score-color: #9daecb; }
.release-warning { position: relative; }
.release-warning summary { color: #d4b077; list-style: none; }
.release-warning summary::-webkit-details-marker { display: none; }
.release-warning summary:hover, .release-warning[open] summary { background: #d4b07710; }
.release-warning-spacer { width: 34px; }
.release-warning > div { position: absolute; right: 0; top: calc(100% + 4px); width: min(290px, 70vw); z-index: 8; background: #20252e; border: 1px solid #ffffff18; padding: 16px; border-radius: 12px; color: #b8bfcb; font-size: 11px; line-height: 1.7; box-shadow: 0 12px 40px #0008; }
.release-warning strong { color: #e4c798; font-size: 11px; }
.release-warning ul { padding-left: 17px; margin: 8px 0; }
.release-warning p { margin-bottom: 0; }
.release-association { grid-column: 1 / -1; min-width: 0; }
.release-association[hidden] { display: none; }
.association-sheet { margin: 2px 0 0; background: #171c24; border: 1px solid #a8ebc425; border-radius: 12px; overflow: hidden; }
.association-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.association-heading { display: flex; gap: 12px; align-items: center; min-width: 0; }
.association-symbol { display: grid; place-items: center; width: 37px; height: 37px; background: #a8ebc40c; color: var(--accent); border: 1px solid #a8ebc41a; border-radius: 10px; flex-shrink: 0; }
.association-eyebrow { font-size: 8px; font-weight: 650; letter-spacing: 1.4px; color: #90a59d; }
.association-header h4 { margin: 4px 0 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
.association-help { color: #9aa4b4; font-size: 11px; margin: 14px 20px 10px; }
.association-source { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 20px 16px; }
.association-source > span { padding: 3px 7px; background: #ffffff05; border: 1px solid #ffffff0c; color: #b5becc; font-size: 9px; border-radius: 5px; }
.association-source > small { color: #778293; font-size: 9px; margin-left: 3px; }
.association-search { position: relative; margin: 0 20px 10px; }
.association-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #758395; pointer-events: none; }
.association-search input { padding-left: 37px; font-size: 11px; background: #11161d; border-color: #ffffff10; }
.association-episodes { max-height: 240px; overflow: auto; padding: 0 20px 14px; display: grid; gap: 5px; scrollbar-width: thin; scrollbar-color: #39454e transparent; }
.association-episode { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0; min-height: 49px; border: 1px solid #ffffff08; background: #ffffff02; border-radius: 7px; cursor: pointer; transition: background .15s, border-color .15s; }
.association-episode[hidden] { display: none; }
.association-episode:hover { background: #ffffff05; border-color: #ffffff15; }
.association-episode:has(input:checked) { border-color: #a8ebc43b; background: #a8ebc408; }
.association-episode input { width: 15px; height: 15px; flex-shrink: 0; margin: 0; }
.association-code { display: flex; gap: 4px; color: #738193; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.association-code b { color: #b1bdcc; font-weight: 550; }
.association-episode-title { flex: 1; color: #b8c2d0; font-size: 11px; line-height: 1.5; }
.association-selected { color: var(--accent); display: flex; opacity: 0; }
.association-episode:has(input:checked) .association-selected { opacity: 1; }
.association-no-results { color: var(--muted); text-align: center; font-size: 12px; margin: 10px 20px 20px; }
.association-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #ffffff0b; padding: 12px 20px; background: #11161b66; }
.association-count { font-size: 10px; color: #91a69b; }
.association-footer > div { display: flex; gap: 8px; }
.association-footer button { min-height: 35px; padding: 8px 12px; font-size: 11px; }
.association-cancel { color: #9ba7b6; border-color: transparent; background: transparent; }
.association-confirm { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.association-confirm svg { width: 14px; height: 14px; }
.episode-total { padding: 12px 0; }
.episode-total small { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  .release-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 15px 12px; }
  .release-info { grid-column: 1 / -1; }
  .release-metrics { width: 115px; text-align: left; }
  .release-actions { justify-self: end; padding-left: 0; border-left: 0; gap: 10px; }
  .release-icon, .release-warning summary { width: 38px; height: 38px; }
  .release-warning-spacer { width: 38px; }
  .association-header { padding: 15px 12px 0; }
  .association-help { margin-left: 12px; margin-right: 12px; }
  .association-source { padding-left: 12px; padding-right: 12px; }
  .association-source > small { flex-basis: 100%; margin: 3px 0 0; }
  .association-search { margin-left: 12px; margin-right: 12px; }
  .association-episodes { padding-left: 12px; padding-right: 12px; }
  .association-episode { gap: 8px; padding: 10px 8px; }
  .association-code { flex-direction: column; gap: 2px; }
  .association-footer { padding: 12px; flex-wrap: wrap; }
  .association-footer > div { width: 100%; justify-content: space-between; }
}

.match-score[data-match="0"] { --match: 0%; }
.match-score[data-match="33"] { --match: 33%; }
.match-score[data-match="67"] { --match: 67%; }
.match-score[data-match="100"] { --match: 100%; }
.association-search input { width: 100%; }
/* Series lifecycle is independent of file availability and monitoring. */
.poster-badges { position: absolute; top: 10px; left: 9px; right: 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.poster .poster-badges .badge { position: static; font-size: 9px; padding: 4px 7px; line-height: 1.3; }
.poster .poster-badges .series-status { background: #10151ee8; color: #c5ced9; font-weight: 450; }
.list-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.list-card .series-status { font-size: 10px; color: #aab7c8; font-weight: 450; }
#series-status-filter { min-width: 170px; }
.series-status { background: #ffffff09; color: #b7c2cf; }
.month-chevron { width: 16px; height: 16px; display: block; flex-shrink: 0; align-self: center; }
.cache-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cache-heading h2 { margin-bottom: 8px; }
.cache-heading p { margin: 0; font-size: 12px; }
.cache-heading button { flex-shrink: 0; }
.cache-total { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 18px; }
.cache-total strong { font-size: 27px; font-weight: 600; color: var(--accent); }
.cache-total span { color: var(--muted); font-size: 12px; }
.cache-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.cache-breakdown > div { display: grid; gap: 9px; padding: 18px; }
.cache-breakdown > div + div { border-left: 1px solid var(--line); }
.cache-breakdown strong { font-size: 12px; font-weight: 500; }
.cache-breakdown span { font-size: 18px; }
.cache-breakdown small, .cache-help { color: var(--muted); font-size: 11px; line-height: 1.7; }
#cache-message { color: var(--accent); font-size: 12px; }
@media (max-width: 650px) {
  .cache-heading { align-items: flex-start; flex-direction: column; }
  .cache-breakdown { grid-template-columns: 1fr; }
  .cache-breakdown > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.missing-count { display: block; margin-top: 6px; color: #a3afbf; font-size: 10px; font-weight: 450; line-height: 1.5; }
.list-card .missing-count { font-size: 10px; max-width: 145px; text-align: right; }
.file-info { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; margin: 12px 0; font-size: 12px; background: #ffffff02; }
.file-info summary { cursor: pointer; line-height: 1.7; }
.file-info summary span { color: var(--muted); font-size: 11px; margin-left: 10px; }
.file-info dl { display: grid; gap: 12px; margin: 16px 0 2px; }
.file-info dl > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
.file-info dt { color: var(--muted); }
.file-info dd { margin: 0; overflow-wrap: anywhere; }
.file-unavailable { font-size: 11px; }
.episode-row:has(.episode-file) { flex-wrap: wrap; }
.episode-file { flex-basis: 100%; min-width: 0; }
.episode-file .file-info { margin: 0 0 4px; }
.tracked-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.tracked-action strong { font-size: 12px; overflow-wrap: anywhere; }
.tracked-action small { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; }
.tracked-action p { grid-column: 1 / -1; color: var(--muted); line-height: 1.7; font-size: 12px; margin: 0; overflow-wrap: anywhere; }
.tracked-action .badge { align-self: start; font-size: 10px; }
@media (max-width: 650px) { .tracked-action { grid-template-columns: 1fr; } .tracked-action .badge { justify-self: start; } }
.library-sentinel { text-align: center; padding: 24px 0; font-size: 12px; color: var(--muted); }
.calendar-view-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.calendar-view-bar .calendar-toolbar { margin-bottom: 0; }
.calendar-grid-scroll { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.calendar-grid { min-width: 740px; background: #13171e; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays span { padding: 14px 12px; color: #9aa7b9; font-size: 11px; border-bottom: 1px solid var(--line); }
.calendar-cell { min-width: 0; min-height: 135px; padding: 10px 8px; border-right: 1px solid #ffffff09; border-bottom: 1px solid #ffffff09; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.outside-month { background: #090b1080; }
.calendar-day-number { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 8px; font-size: 11px; color: #aeb9c9; border-radius: 50%; }
.calendar-cell.is-today { background: #a8ebc404; }
.is-today .calendar-day-number { background: var(--accent); color: #14291d; font-weight: 650; }
.calendar-entry { padding: 8px; margin-top: 6px; border: 1px solid #b0c9ee1a; border-left: 2px solid #9dafcd; border-radius: 5px; background: #9dafcd0b; }
.calendar-entry.radarr { border-left-color: #b4d3ba; background: #b4d3ba09; }
.calendar-entry-type { display: block; font-size: 8px; letter-spacing: .5px; color: #8d9caf; margin-bottom: 4px; text-transform: uppercase; }
.calendar-entry strong { display: block; font-size: 10px; line-height: 1.6; font-weight: 550; overflow-wrap: anywhere; }
.calendar-entry small, .calendar-entry-state { display: block; margin-top: 5px; font-size: 9px; line-height: 1.5; color: #99a5b7; }
.calendar-entry-state { font-size: 8px; color: #7e8b9d; }
@media (max-width: 650px) {
  .calendar-grid-scroll { max-width: 100%; }
  .calendar-view-bar { align-items: flex-start; }
  .calendar-grid { min-width: 770px; }
}
/* Engine connection status belongs to the navigation, not page content. */
#sidebar-connections { display: grid; gap: 7px; }
.connection-info { position: relative; min-width: 0; }
.connection-info > summary { display: flex; align-items: center; gap: 6px; padding: 7px 0; cursor: pointer; list-style: none; font-size: 10px; }
.connection-info > summary::-webkit-details-marker { display: none; }
.connection-name { color: #cad2de; font-weight: 550; }
.connection-label { margin-left: auto; color: #94a292; font-size: 9px; }
.connection-dot { width: 6px; height: 6px; border-radius: 50%; background: #6d7582; flex-shrink: 0; }
.connection-dot.connected { background: #a8ebc4; box-shadow: 0 0 0 3px #a8ebc40b; }
.connection-dot.offline { background: #e4a386; }
.connection-dot.checking { background: #b5a480; }
.connection-i { display: grid; place-items: center; width: 13px; height: 13px; border: 1px solid #687486; border-radius: 50%; color: #9eabba; font-size: 9px; line-height: 1; flex-shrink: 0; }
.connection-popover { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 70; width: 260px; padding: 15px; border: 1px solid #3b4453; border-radius: 10px; background: #20252f; box-shadow: 0 12px 36px #0008; color: #bbc4d2; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.connection-popover strong { color: #e2e8f1; font-weight: 550; }
.connection-popover p { margin: 7px 0 0; }
#logout { display: flex; align-items: center; justify-content: center; gap: 8px; }
#logout svg { width: 16px; height: 16px; }
@media (max-width: 650px) {
  /* Six destinations stay visible, including Settings, above the home indicator. */
  #primary-sidebar { position: fixed; inset: auto 0 0; z-index: 50; width: 100%; padding: 0 8px env(safe-area-inset-bottom, 0px); border: 0; border-top: 1px solid #ffffff14; background: #14181ff5; backdrop-filter: blur(18px); }
  #primary-sidebar > .brand { display: none; }
  #primary-sidebar nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; overflow: visible; padding: 4px 0 6px; }
  #primary-sidebar nav button { min-width: 0; min-height: 52px; width: 100%; padding: 7px 1px; gap: 4px; text-align: center; border-radius: 8px; }
  #primary-sidebar nav .nav-label { font-size: 9px; line-height: 13px; }
  #primary-sidebar nav .nav-icon { width: 19px; height: 19px; }
  #primary-sidebar .sidebar-foot { display: flex; align-items: center; order: -1; gap: 10px; padding: 5px 6px 2px; margin: 0; border-bottom: 1px solid #ffffff07; }
  #sidebar-connections { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
  .connection-info > summary { font-size: 10px; gap: 5px; padding: 5px 0; }
  .connection-label { display: none; }
  .connection-popover { width: min(270px, 85vw); bottom: calc(100% + 12px); }
  .connection-info:last-child .connection-popover { left: -90px; }
  #primary-sidebar #logout { margin: 0; padding: 5px; width: 30px; min-height: 28px; background: transparent; border: 0; }
  #primary-sidebar .logout-label { display: none; }
  #app > main:not(.login) { margin: 0; padding-top: 25px; padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }
  #toast { bottom: calc(125px + env(safe-area-inset-bottom, 0px)); }
  /* Prevent Safari's focus zoom without shrinking controls visually afterwards. */
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='hidden']), select, textarea { font-size: 16px !important; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
}
@media (max-width: 650px) {
  .connection-label { display: inline; margin-left: 0; font-size: 8px; }
  #sidebar-connections { gap: 12px; }
}
/* Mobile layouts are composed for the viewport rather than scaled desktop rows. */
.mobile-calendar { display: none; }
@media (max-width: 650px) {
  .desktop-calendar { display: none; }
  .mobile-calendar { display: block; margin-top: 16px; }
  .compact-month { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #141820; }
  .compact-weekdays, .compact-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .compact-weekdays span { padding: 7px 0 10px; text-align: center; font-size: 10px; color: #8492a7; }
  .compact-days button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 44px; min-width: 0; padding: 4px 0; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-variant-numeric: tabular-nums; background: transparent; }
  .compact-days button[aria-current="date"] { border-color: #a8ebc43b; color: var(--accent); }
  .compact-days button[aria-pressed="true"] { background: var(--accent); color: #14291d; font-weight: 650; }
  .calendar-day-dots { display: flex; justify-content: center; gap: 3px; height: 4px; }
  .calendar-day-dots i { width: 4px; height: 4px; border-radius: 50%; background: #99afd1; }
  .calendar-day-dots .radarr { background: #a8d4b5; }
  [aria-pressed="true"] .calendar-day-dots i { background: #2b6544; }
  .calendar-day-agenda { margin: 20px 0; }
  .day-agenda-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .day-agenda-head h2 { font-size: 16px; margin: 0; text-transform: capitalize; }
  .day-agenda-head > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
  .calendar-day-agenda .calendar-entry { margin-top: 9px; padding: 14px; border-radius: 9px; }
  .calendar-day-agenda .calendar-entry strong { font-size: 13px; line-height: 1.6; }
  .calendar-day-agenda .calendar-entry small { font-size: 11px; }
  .calendar-day-agenda .calendar-entry-type, .calendar-day-agenda .calendar-entry-state { font-size: 10px; }
  .day-agenda-empty { color: var(--muted); padding: 18px 14px; border: 1px dashed var(--line); border-radius: 9px; font-size: 12px; line-height: 1.7; }
  .calendar-view-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
  .calendar-view-bar .calendar-toolbar { display: contents; }
  .calendar-view-bar .month-navigation { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-column: 1 / -1; width: 100%; gap: 8px; }
  .calendar-view-bar .month-picker { min-width: 0; }
  .calendar-view-bar .month-picker > summary { width: 100%; min-width: 0; justify-content: center; gap: 12px; }
  .calendar-view-bar .tabs { grid-column: 1; grid-row: 2; width: 100%; min-width: 0; height: 44px; flex: none; }
  .calendar-view-bar #current-month { grid-column: 2; grid-row: 2; width: auto; margin: 0; font-size: 11px; padding-inline: 12px; }
  .toolbar.library-filters { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 9px; align-items: stretch; }
  .library-filters #local-query, .library-filters .tabs, .library-filters #state-filter, .library-filters #series-status-filter { grid-column: 1 / -1; width: 100%; min-width: 0; margin: 0; }
  .library-filters .tabs { flex: none; justify-content: stretch; }
  .library-filters .tabs button { flex: 1; }
  .library-filters #sort { grid-column: 1; width: 100%; min-width: 0; }
  .library-filters #view-toggle { grid-column: 2; width: 100%; padding-inline: 8px; }
  .settings-connection-form .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 3px; }
  .settings-connection-form .actions button { width: 100%; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 12px; line-height: 1.4; }
  .settings-connection-form .actions .danger { grid-column: 1 / -1; background: transparent; border-color: #ff9f9f25; }
  .settings-connection-form small { font-size: 11px; line-height: 1.7; }
  #content:has(.settings-connection-form) > .two > .panel { padding: 20px 16px; margin-block: 0; }
  #content:has(.settings-connection-form) > .two { gap: 14px; margin: 20px 0; }
}
@media (max-width: 650px) {
  #app > main:not(.login) { padding-top: calc(25px + env(safe-area-inset-top, 0px)); }
}
.grid { align-items: start; }
@media (max-width: 650px) {
  .compact-days button { -webkit-tap-highlight-color: transparent; }
}
/* A dedicated sign-in screen, independent of the application's navigation layout. */
.login-screen { display: grid; place-items: center; width: 100%; max-width: none; min-height: 100vh; min-height: 100svh; margin: 0; padding: 48px 24px; background: radial-gradient(ellipse at 50% 15%, #a8ebc407, transparent 55%); }
.auth-wrap { width: 100%; max-width: 410px; }
.auth-brand { text-align: center; margin-bottom: 30px; }
.login-screen .auth-brand .brand { margin: 0; font-size: 37px; line-height: 1.2; letter-spacing: -1.9px; }
.auth-brand > span { display: block; margin-top: 9px; color: #788b87; font-size: 8px; font-weight: 600; letter-spacing: 2.5px; }
.auth-panel { padding: 32px; background: #191d25; border: 1px solid #ffffff10; border-radius: 18px; box-shadow: 0 16px 60px #0002; }
.auth-heading { margin-bottom: 26px; }
.auth-symbol { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 20px; color: #a8c9b6; border: 1px solid #a8ebc41c; background: #a8ebc407; border-radius: 11px; }
.auth-symbol svg { width: 19px; height: 19px; }
.auth-heading h1 { font-size: 24px; font-weight: 650; letter-spacing: -.7px; line-height: 1.3; margin: 0 0 10px; }
.auth-heading p { font-size: 13px; line-height: 1.8; color: #98a3b5; margin: 0; }
.auth-form { display: grid; gap: 16px; }
.auth-field label { display: block; margin-bottom: 9px; font-size: 12px; color: #bdc7d5; }
.auth-password { position: relative; }
.auth-password input { display: block; width: 100%; height: 48px; padding: 0 50px 0 13px; border-color: #394251; border-radius: 9px; font-size: 16px; background: #11161d; }
.auth-password input[aria-invalid="true"] { border-color: #c98d8d; }
.login .auth-toggle { position: absolute; display: grid; place-items: center; top: 4px; right: 4px; width: 40px; height: 40px; min-height: 40px; padding: 10px; background: transparent; border: 0; color: #8e9aab; border-radius: 7px; }
.auth-toggle:hover { color: #d6e2eb; }
.auth-toggle svg { width: 18px; height: 18px; }
.password-eye-slash { display: none; }
.auth-toggle[aria-pressed="true"] .password-eye-slash { display: block; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; font-size: 13px; border-radius: 9px; margin-top: 2px; }
.auth-submit svg { width: 16px; height: 16px; }
.auth-submit[aria-busy="true"] svg { opacity: .35; }
.auth-error { font-size: 12px; color: #efb1aa; line-height: 1.6; padding: 10px 12px; background: #ff9f9f08; border: 1px solid #ff9f9f1f; border-radius: 8px; }
.auth-error:empty { display: none; }
.auth-help { margin-top: 23px; padding-top: 19px; border-top: 1px solid #ffffff08; }
.auth-help summary { cursor: pointer; font-size: 11px; color: #8f9bad; line-height: 1.6; list-style: none; text-align: center; }
.auth-help summary::-webkit-details-marker { display: none; }
.auth-help p { margin: 14px 0 0; color: #919cad; font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }
.auth-help code { color: #bac9cc; font-size: 10px; }
.auth-caption { text-align: center; color: #62716e; margin: 22px 0 0; font-size: 10px; }
@media (max-width: 650px) {
  .login-screen { padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .auth-wrap { max-width: 380px; }
  .auth-brand { margin-bottom: 25px; }
  .auth-panel { padding: 26px 22px; border-radius: 15px; }
  .auth-heading h1 { font-size: 23px; }
  .auth-heading p { font-size: 12px; }
}
@media (max-width: 350px) {
  .login-screen { padding-inline: 14px; }
  .auth-panel { padding-inline: 18px; }
  .auth-heading h1 { font-size: 21px; }
}
@media (max-height: 580px) {
  .login-screen { align-items: start; padding-block: calc(18px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)); }
  .auth-brand { margin-bottom: 18px; }
  .auth-symbol { display: none; }
}
.auth-help summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
