:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-hover: #f9fafb;
  --border: #e8eaed;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #6b7280;
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-on: #ffffff;
  --primary-rgb: 22, 163, 74;
  --primary-soft: rgba(var(--primary-rgb), 0.14);
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, 0.12);
  --error: #dc2626;
  --error-soft: rgba(220, 38, 38, 0.1);
  --warn: #ca8a04;
  --warn-soft: rgba(202, 138, 4, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;
  --topbar-h: 72px;
  --topbar-pill-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  --topbar-pill-radius: 999px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Top bar (pilules flottantes) ── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 300;
  background: #f4f4f4;
  border-bottom: none;
  overflow: visible;
  padding: 0.75rem 1.5rem;
}

.topbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 2.75rem;
  overflow: visible;
}

.topbar-pill {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--topbar-pill-radius);
  box-shadow: var(--topbar-pill-shadow);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.45rem 1rem 0.45rem 0.65rem;
  background: var(--surface);
  border-radius: var(--topbar-pill-radius);
  box-shadow: var(--topbar-pill-shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-logo {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

.brand:hover {
  text-decoration: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: var(--topbar-pill-radius);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-hover);
  background: var(--primary-soft);
  border: none;
}

.brand-version {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 960px) {
  .brand-version {
    display: none;
  }
}

.topnav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border-radius: var(--topbar-pill-radius);
  box-shadow: var(--topbar-pill-shadow);
  overflow: visible;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  min-height: auto;
  line-height: 1;
  color: #8e8e8e;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: none;
  border-radius: var(--topbar-pill-radius);
  margin-bottom: 0;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.topnav-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.75;
}

.topnav-link:hover {
  color: var(--text);
  background: #ededed;
  text-decoration: none;
}

.topnav-link.active {
  color: var(--primary-on);
  background: var(--primary);
  border-bottom-color: transparent;
  border-radius: var(--topbar-pill-radius);
  margin-bottom: 0;
}

.topnav-link.active svg {
  opacity: 1;
  color: #fff;
}

.topnav-link-transfers .topnav-transfers-count {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.topnav-link-transfers .topnav-transfers-count.topbar-queue-count-empty {
  display: none;
}

.topnav-link.active.topnav-link-transfers .topnav-transfers-count:not(.topbar-queue-count-empty) {
  background: #fff;
  color: var(--primary-hover);
}

.topnav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topnav-link.topnav-dropdown-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  margin: 0;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}

.topnav-dropdown.is-open > .topnav-dropdown-toggle,
.topnav-dropdown-toggle.active {
  color: var(--primary-on);
  background: var(--primary);
}

.topnav-dropdown.is-open > .topnav-dropdown-toggle svg,
.topnav-dropdown-toggle.active svg {
  color: #fff;
  opacity: 1;
}

.topnav-dropdown.is-open > .topnav-dropdown-toggle .topnav-chevron,
.topnav-dropdown-toggle.active .topnav-chevron {
  opacity: 1;
  color: #fff;
}

.topnav-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.topnav-dropdown.is-open .topnav-chevron {
  transform: rotate(180deg);
}

.topnav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 1000;
  min-width: 12rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--topbar-pill-shadow);
  overflow: hidden;
}

.topnav-dropdown.is-open .topnav-dropdown-menu {
  display: block;
  visibility: visible;
}

.topnav-dropdown-item {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-top: none;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.topnav-dropdown-menu li + li .topnav-dropdown-item {
  margin-top: 0.1rem;
}

.topnav-dropdown-item:hover {
  background: #ededed;
  color: var(--text);
  text-decoration: none;
}

.topnav-dropdown-item.active {
  color: var(--text);
  background: #ededed;
}

.topbar-actions {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions-utils,
.topbar-actions-user {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border-radius: var(--topbar-pill-radius);
  box-shadow: var(--topbar-pill-shadow);
}

.topbar-actions-user {
  padding: 0.25rem 0.35rem 0.25rem 0.5rem;
}

.topbar-vpn,
.topbar-plex {
  display: inline-flex;
  align-items: center;
}

.topbar-vpn-badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar-vpn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.45rem 0.25rem 0.35rem;
  border-radius: var(--topbar-pill-radius);
  border: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
}

.topbar-vpn-badge-off:hover {
  text-decoration: none;
}

.topbar-vpn-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  z-index: 1100;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.topbar-vpn-badge-wrap:hover .topbar-vpn-tooltip,
.topbar-vpn-badge-wrap:focus-within .topbar-vpn-tooltip {
  display: block;
}

.topbar-wan-ip-value {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.topbar-vpn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-vpn-icon svg {
  width: 1rem;
  height: 1rem;
}

.topbar-vpn-label {
  text-transform: uppercase;
}

.topbar-vpn-badge-ok {
  color: var(--ok);
  background: transparent;
  border-color: transparent;
}

.topbar-vpn-badge-off {
  color: var(--error);
  background: transparent;
  border-color: transparent;
}

.topbar-vpn-badge-action {
  cursor: pointer;
  font: inherit;
  appearance: none;
}

.topbar-vpn-badge-action:hover {
  border-color: transparent;
  background: transparent;
  color: var(--error);
  opacity: 0.85;
}

.topbar-vpn-badge-action:focus-visible {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.topbar-vpn-badge-pending {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  cursor: wait;
}

.topbar-status-loading {
  gap: 0.35rem;
  min-width: 4.25rem;
}

.topbar-status-loading .app-loading-spinner-badge {
  flex-shrink: 0;
}

.app-page-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
}

html.is-page-loading .app-page-loading {
  display: flex;
}

.app-page-loading .app-loading {
  min-height: 0;
  padding: 0;
}

.topbar-queue {
  display: inline-flex;
  align-items: center;
}

.topbar-queue-menu {
  position: relative;
}

.topbar-queue-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: none;
  border-radius: var(--topbar-pill-radius);
  background: transparent;
  color: #8e8e8e;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.topbar-queue-toggle:hover {
  background: #ededed;
  color: var(--text);
  opacity: 1;
}

.topbar-queue-menu.is-open > .topbar-queue-toggle {
  color: var(--text);
  background: #ededed;
}

.topbar-queue-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-queue-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.topbar-queue-count {
  position: absolute;
  top: -0.2rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.topbar-queue-count-empty {
  background: var(--muted);
}

.topbar-queue-empty {
  margin: 0;
  padding: 1rem 0.85rem;
  font-size: 0.82rem;
  text-align: center;
}

.topbar-queue-menu-panel {
  right: 0;
  left: auto;
  min-width: 18rem;
  max-width: min(22rem, calc(100vw - 2rem));
  max-height: min(24rem, calc(100vh - 5rem));
  display: none;
  flex-direction: column;
  padding: 0;
}

.topbar-queue-menu.is-open .topbar-queue-menu-panel {
  display: flex;
}

.topbar-queue-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.topbar-queue-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.topbar-queue-list {
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.topbar-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--border);
}

.topbar-queue-list .topbar-queue-item:first-child {
  border-top: none;
}

.topbar-queue-item-main {
  min-width: 0;
  flex: 1;
}

.topbar-queue-item-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-queue-item-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.topbar-queue-progress {
  margin-top: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.topbar-queue-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.35s ease;
}

.topbar-queue-progress-nas .topbar-queue-progress-bar {
  background: var(--warning, #d97706);
  animation: topbar-queue-pulse 1.2s ease-in-out infinite;
}

@keyframes topbar-queue-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.topbar-queue-pipeline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.topbar-queue-step {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
}

.topbar-queue-step.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.topbar-queue-step.is-done {
  border-color: var(--success, #16a34a);
  color: var(--success, #16a34a);
  background: color-mix(in srgb, var(--success, #16a34a) 10%, transparent);
}

.topbar-queue-step.is-waiting {
  border-style: dashed;
  color: var(--muted);
}

.topbar-queue-step.is-error {
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
  background: color-mix(in srgb, var(--danger, #dc2626) 8%, transparent);
}

.topbar-queue-step-arrow {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
}

.topbar-queue-item-qbit {
  align-items: stretch;
}

.topbar-queue-open {
  width: 100%;
  justify-content: center;
}

.topbar-queue-item-size {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
}

.topbar-queue-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.topbar-queue-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.topbar-queue-remove:hover {
  color: var(--error);
  background: rgba(220, 38, 38, 0.08);
}

.topbar-queue-remove:focus-visible {
  outline: 2px solid var(--error);
  outline-offset: 1px;
}

.topbar-queue-remove svg {
  width: 0.85rem;
  height: 0.85rem;
}

.tag-xs {
  font-size: 0.62rem;
  padding: 0.12rem 0.35rem;
  flex-shrink: 0;
}

.topbar-queue-footer {
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
}

.topbar-queue-send {
  width: 100%;
}

.topbar-queue-footer .alert {
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  padding: 0.45rem 0.6rem;
}

.topbar-user-menu {
  align-items: center;
}

.topbar-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border: none;
  border-radius: var(--topbar-pill-radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.topbar-user-toggle:hover {
  background: #ededed;
}

.topbar-user-menu.is-open > .topbar-user-toggle {
  background: #ededed;
  color: var(--text);
}

.topbar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.topbar-user-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-menu-list {
  right: 0;
  left: auto;
  min-width: 11rem;
}

.topnav-dropdown-action {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: none;
  border-top: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.topnav-dropdown-action:hover {
  background: var(--surface-hover);
  color: var(--error);
}

.logout-form {
  margin: 0;
}

/* ── Page layout ── */

.container {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header-main h1 {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.transfer-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.transfer-view-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.transfer-view-toggle.is-active {
  color: var(--warning, #d97706);
  background: color-mix(in srgb, var(--warning, #d97706) 10%, transparent);
}

.transfer-archived-notice {
  margin: 0 0 1rem;
  font-size: 0.88rem;
}

.transfer-page-stack .transfer-float-card-archived {
  opacity: 0.92;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.subtitle,
.page-subtitle {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ── Panels & cards ── */

.card,
.data-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.data-panel {
  padding: 0;
  overflow: hidden;
}

.settings-panel {
  padding: 1.25rem 1.5rem;
}

.settings-section h2 {
  margin-bottom: 1rem;
}

.settings-list {
  margin: 0;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.75rem 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.settings-row:first-child {
  border-top: none;
  padding-top: 0;
}

.settings-row dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.settings-row dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.settings-section-divider {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.settings-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.settings-section-head h2 {
  margin-bottom: 0.35rem;
}

.settings-section-desc {
  margin: 0;
  font-size: 0.875rem;
  max-width: 36rem;
}

.settings-form {
  max-width: 32rem;
}

.form-hint {
  margin: -0.35rem 0 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.settings-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.settings-test-result {
  margin-top: 0.75rem;
}

.settings-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  max-width: 36rem;
}

.form input[type="file"] {
  padding: 0.45rem 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
}

.form select {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.settings-fieldset {
  margin: 0 0 1.5rem;
  padding: 0 0 1.25rem;
  border: none;
  border-bottom: 1px solid var(--border);
}

.settings-fieldset:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-fieldset legend {
  padding: 0;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-toggles {
  margin-top: 0.85rem;
}

@media (max-width: 520px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Sheet — blocs formulaire ── */

.sheet-content-form {
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}

.sheet-body > [data-sheet-content] {
  display: none;
}

.sheet-body > [data-sheet-content].is-active {
  display: block;
}

.sheet-body > [data-sheet-content].is-active.sheet-content-form {
  display: flex;
}

.sheet-alert {
  margin-bottom: 0.85rem;
}

.sheet-callout {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.sheet-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sheet-block-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.sheet-block-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-on);
  background: var(--primary);
}

.sheet-block-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.sheet-block-desc {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.sheet-block-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field-stack label,
.field-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-row {
  display: grid;
  gap: 0.75rem;
}

.field-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.option-list li + li {
  border-top: 1px solid var(--border);
}

.option-list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.12s;
}

.option-list-item:hover {
  background: var(--surface-hover);
}

.option-list-item input {
  width: auto;
  flex-shrink: 0;
}

.option-list-item-highlight {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.file-field {
  padding: 0.75rem;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.file-field input[type="file"] {
  width: 100%;
  margin-bottom: 0.35rem;
}

.file-field-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.tag-ok {
  display: inline-flex;
  margin-right: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-soft);
}

.sheet-form-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 0.25rem;
  padding: 0.85rem 0 0;
  background: linear-gradient(to bottom, transparent, var(--surface) 28%);
}

.sheet-form-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.sheet-form-footer .settings-test-result {
  margin: 0 0 0.35rem;
}

.sheet-form-footer .settings-test-result:empty {
  display: none;
}

.sheet-meta {
  margin-top: 0.25rem;
}

.sheet-meta .settings-row {
  padding: 0.5rem 0;
}

@media (max-width: 420px) {
  .field-row-2 {
    grid-template-columns: 1fr;
  }
}

.connector-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.connector-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.connector-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.connector-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.connector-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}

/* ── Status indicators (Tailscale "Connected") ── */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-ok .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--ok-soft);
}

.status-ok {
  color: var(--text);
}

.status-off .status-dot {
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

.status-warn .status-dot {
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--warn-soft);
}

.status-warn {
  color: var(--text);
}

.status-error {
  color: var(--text);
}

.status-error .status-dot {
  background: var(--error);
  box-shadow: 0 0 0 2px var(--error-soft);
}

/* ── Tags & badges ── */

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.badge-ok,
.tag-ok {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.2);
  color: var(--ok);
}

.badge-off,
.tag-off {
  background: var(--bg);
  border-color: var(--border);
  color: var(--muted);
}

.badge-error,
.tag-error {
  background: var(--error-soft);
  border-color: rgba(220, 38, 38, 0.2);
  color: var(--error);
}

.badge-pending,
.tag-pending {
  background: var(--warn-soft);
  border-color: rgba(202, 138, 4, 0.2);
  color: var(--warn);
}

.badge-ready,
.tag-ready {
  background: var(--primary-soft);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary);
}

.badge-sent,
.tag-sent {
  background: var(--ok-soft);
  border-color: rgba(22, 163, 74, 0.2);
  color: var(--ok);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-on);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.72;
  cursor: wait;
}

.btn-spinner {
  display: none;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: btn-spinner-spin 0.75s linear infinite;
}

@keyframes btn-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
}

.btn-icon:hover {
  background: rgba(var(--primary-rgb), 0.22);
}

/* ── Data tables (Tailscale machines list) ── */

.table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td,
.data-table th,
.data-table td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th,
.table thead th {
  padding: 0.65rem 1.25rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.data-table tbody tr,
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.data-table tbody tr:last-child,
.table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover,
.table tbody tr:hover {
  background: var(--surface-hover);
}

.cell-primary {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.cell-secondary {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

/* ── Alerts ── */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.alert-ok {
  background: var(--ok-soft);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.alert-error {
  background: var(--error-soft);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-warn {
  background: var(--warn-soft);
  color: #854d0e;
  border: 1px solid rgba(202, 138, 4, 0.25);
}

.sync-result {
  margin-top: 0.5rem;
}

.htmx-indicator {
  display: none;
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline;
}

.htmx-indicator.loading-indicator-block,
.htmx-indicator.progress-block,
.htmx-indicator#magnet-progress,
.htmx-indicator#unlock-progress {
  display: none;
  margin-left: 0;
  margin-top: 1rem;
}

.htmx-request .htmx-indicator.progress-block,
.htmx-request.htmx-indicator.progress-block,
.htmx-request .htmx-indicator#magnet-progress,
.htmx-request.htmx-indicator#magnet-progress,
.htmx-request .htmx-indicator#unlock-progress,
.htmx-request.htmx-indicator#unlock-progress {
  display: block;
}

.loading-panel {
  padding: 1rem 1.1rem;
  background: var(--primary-soft);
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  border-radius: var(--radius);
}

.loading-panel-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  padding: 3rem 1rem;
  min-height: min(52vh, 28rem);
}

.app-loading-compact {
  gap: 0.65rem;
  padding: 1.25rem 1rem;
  min-height: 0;
}

.app-loading-inline {
  flex-direction: row;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem 0;
  min-height: 0;
  text-align: left;
}

.app-loading-chip {
  flex-direction: row;
  gap: 0.4rem;
  padding: 0;
  min-height: 0;
}

.app-loading-spinner {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-loading-spinner-compact {
  width: 2.75rem;
  height: 2.75rem;
}

.app-loading-spinner-inline,
.app-loading-spinner-chip {
  width: 1.65rem;
  height: 1.65rem;
}

.app-loading-spinner-badge {
  width: 1.35rem;
  height: 1.35rem;
}

.app-loading-ring {
  position: absolute;
  inset: 0;
  border: 4px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: app-loading-spin 0.85s linear infinite;
}

.app-loading-spinner-inline .app-loading-ring,
.app-loading-spinner-chip .app-loading-ring,
.app-loading-spinner-badge .app-loading-ring {
  border-width: 2px;
}

.app-loading-spinner-compact .app-loading-ring {
  border-width: 3px;
}

.app-loading-logo {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 8px;
}

.app-loading-spinner-compact .app-loading-logo {
  width: 1.65rem;
  height: 1.65rem;
}

.app-loading-spinner-inline .app-loading-logo,
.app-loading-spinner-chip .app-loading-logo,
.app-loading-spinner-badge .app-loading-logo {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 4px;
}

.app-loading-spinner-badge .app-loading-logo {
  width: 0.82rem;
  height: 0.82rem;
}

.app-loading-label {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
}

.app-loading-compact .app-loading-label,
.app-loading-inline .app-loading-label,
.app-loading-chip .app-loading-label {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
}

@keyframes app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.htmx-indicator.app-loading {
  display: none;
  margin-left: 0;
}

.htmx-request .htmx-indicator.app-loading,
.htmx-request.htmx-indicator.app-loading {
  display: flex;
}

.progress-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.progress-bar-indeterminate {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary),
    #fde047,
    var(--primary),
    transparent
  );
  animation: progress-slide 1.6s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.progress-steps {
  position: relative;
  min-height: 1.4rem;
  margin-bottom: 0.35rem;
}

.progress-step {
  position: absolute;
  inset: 0;
  opacity: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  animation: progress-step-cycle 20s ease-in-out infinite;
}

.progress-step:nth-child(1) { animation-delay: 0s; }
.progress-step:nth-child(2) { animation-delay: 4s; }
.progress-step:nth-child(3) { animation-delay: 8s; }
.progress-step:nth-child(4) { animation-delay: 12s; }
.progress-step:nth-child(5) { animation-delay: 16s; }

.progress-steps-3 .progress-step {
  animation-duration: 12s;
}

.progress-steps-3 .progress-step:nth-child(1) { animation-delay: 0s; }
.progress-steps-3 .progress-step:nth-child(2) { animation-delay: 4s; }
.progress-steps-3 .progress-step:nth-child(3) { animation-delay: 8s; }

.progress-steps-5 .progress-step {
  animation-duration: 20s;
}

@keyframes progress-step-cycle {
  0%,
  18% {
    opacity: 1;
    transform: translateY(0);
  }
  22%,
  100% {
    opacity: 0;
    transform: translateY(4px);
  }
}

.progress-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.magnet-form.htmx-request .magnet-submit,
.unlock-form.htmx-request .unlock-submit {
  opacity: 0.65;
  cursor: wait;
}

/* ── Auth ── */

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-md);
}

.auth-card-logo {
  display: block;
  width: 6rem;
  height: 6rem;
  margin: 0 auto 0.25rem;
  object-fit: contain;
}

.auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.auth-card .subtitle {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ── Forms ── */

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form input,
.search-input {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form input:focus,
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form textarea {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 120px;
}

.form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.tool-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.tool-grid .tool-card {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.tool-card-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tool-card-summary::-webkit-details-marker {
  display: none;
}

.tool-card-summary:hover {
  background: var(--surface-hover);
}

.tool-card-heading {
  min-width: 0;
  flex: 1;
}

.tool-card-heading h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.tool-card-heading .muted {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.tool-card-chevron {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: transform 0.2s ease, color 0.12s, background 0.12s;
}

.tool-card-summary:hover .tool-card-chevron {
  color: var(--text-secondary);
  background: var(--bg);
}

.tool-card-chevron svg {
  width: 1.1rem;
  height: 1.1rem;
}

.tool-card[open] .tool-card-chevron {
  transform: rotate(180deg);
}

.tool-card-body {
  padding: 0 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

.tool-result {
  margin-top: 1rem;
}

.download-link {
  display: inline-flex;
  padding: 0.45rem 0.9rem;
  background: var(--ok);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.break-all {
  word-break: break-all;
}

.table-compact td,
.table-compact th {
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.checkbox-row input {
  width: auto;
}

.deployment-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.deployment-toggle-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.deployment-toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.deployment-toggle-label {
  display: block;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.deployment-toggle-option input:checked + .deployment-toggle-label {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.15);
}

.deployment-toggle-option input:focus-visible + .deployment-toggle-label {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.file-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.inline-form {
  display: inline;
  margin-left: 0.75rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.breadcrumb .mono {
  color: var(--muted);
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.queue-card {
  margin-top: 0.5rem;
}

.queue-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.queue-header h2 {
  margin-bottom: 0.25rem;
}

.queue-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.queue-actions form {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

.queue-label {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.875rem;
}

.queue-error {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
}

.queue-empty {
  margin: 0;
  padding: 1.25rem 0;
}

.queue-row-ready {
  background: rgba(var(--primary-rgb), 0.06);
}

.queue-row-pending {
  background: rgba(202, 138, 4, 0.03);
}

.queue-row-error {
  background: rgba(220, 38, 38, 0.03);
}

.loading-panel-compact {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}

.loading-panel-compact .progress-bar {
  margin-bottom: 0.5rem;
}

.disabled-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-md);
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.modal #synology-modal-body,
.modal .modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.plex-user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.plex-user-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.plex-user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 150, 120, 0.12);
  color: #1a7a62;
  font-size: 0.82rem;
  font-weight: 700;
}

.plex-user-email {
  font-size: 0.84rem;
  color: var(--muted);
  word-break: break-word;
}

.modal h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Page transferts ── */

.transfer-page-root {
  min-height: min(52vh, 28rem);
}

.transfer-page-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 42rem;
}

.transfer-page-empty {
  margin: 0;
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.92rem;
}

.transfer-page-error {
  color: var(--danger, #dc2626);
}

.transfer-page-stack .transfer-float-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm);
}

.transfer-page-stack .transfer-float-title {
  font-size: 0.9rem;
  -webkit-line-clamp: 3;
}

.transfer-page-stack .transfer-float-bar-unified {
  height: 1.25rem;
}

.transfer-page-stack .transfer-float-phases {
  font-size: 0.78rem;
}

.transfer-float-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.transfer-retry-form {
  margin: 0;
}

.transfer-retry-btn {
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
}

.transfer-page-flash {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.transfer-page-flash-ok {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #15803d;
}

.transfer-page-flash-error {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--danger, #dc2626);
}

/* ── Cartes transfert (composants partagés) ── */

.transfer-float-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.transfer-float-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.transfer-sftp-link-wrap {
  position: relative;
  flex-shrink: 0;
}

.transfer-float-sftp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.15rem 0 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.transfer-float-sftp:hover,
.transfer-sftp-link-wrap.is-open .transfer-float-sftp {
  background: var(--bg);
  color: var(--text);
}

.transfer-float-sftp svg {
  width: 0.85rem;
  height: 0.85rem;
}

.transfer-sftp-tooltip {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 1200;
  display: none;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: min(24rem, 80vw);
  padding: 0.45rem 0.45rem 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.transfer-sftp-tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.transfer-sftp-hint {
  font-size: 0.68rem;
  line-height: 1.35;
}

.transfer-sftp-link-wrap.is-open .transfer-sftp-tooltip {
  display: flex;
}

.transfer-sftp-url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-sftp-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.transfer-sftp-copy:hover {
  background: var(--bg);
  color: var(--text);
}

.transfer-sftp-copy.is-copied {
  color: var(--success, #16a34a);
}

.transfer-sftp-copy svg {
  width: 0.8rem;
  height: 0.8rem;
}

.transfer-cancel-form {
  margin: 0;
}

.transfer-archive-form {
  margin: 0;
}

.transfer-float-archive {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.15rem 0 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.transfer-float-archive:hover {
  background: color-mix(in srgb, var(--warning, #d97706) 12%, transparent);
  color: var(--warning, #d97706);
}

.transfer-float-archive svg {
  width: 0.85rem;
  height: 0.85rem;
}

.transfer-unarchive-form {
  margin: 0;
}

.transfer-float-unarchive {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.15rem 0 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.transfer-float-unarchive:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.transfer-float-unarchive svg {
  width: 0.85rem;
  height: 0.85rem;
}

.transfer-float-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.15rem 0 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.transfer-float-delete:hover {
  background: color-mix(in srgb, var(--danger, #dc2626) 10%, transparent);
  color: var(--danger, #dc2626);
}

.transfer-float-delete svg {
  width: 0.85rem;
  height: 0.85rem;
}

.transfer-float-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin: -0.15rem -0.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.transfer-float-close:hover {
  background: var(--bg);
  color: var(--text);
}

.transfer-float-close svg {
  width: 0.9rem;
  height: 0.9rem;
}

.transfer-float-bar-seedbox.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-unified {
  position: relative;
  background: var(--bg);
  overflow: hidden;
  height: 1.125rem;
}

.transfer-float-bar-unified .transfer-float-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
}

.transfer-float-bar-pct {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  color: #fff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.65),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.transfer-float-bar-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  pointer-events: none;
  z-index: 1;
}

.transfer-float-bar-unified.phase-seedbox .transfer-float-bar-fill {
  background: var(--primary);
}

.transfer-float-bar-unified.phase-nas .transfer-float-bar-fill {
  background: #8b5cf6;
}

.transfer-float-bar-unified.phase-filebot .transfer-float-bar-fill {
  background: #7c3aed;
}

.transfer-float-bar-unified.phase-plex .transfer-float-bar-fill {
  background: #eab308;
}

.transfer-float-bar-unified.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-unified.is-error .transfer-float-bar-fill {
  background: var(--danger, #dc2626);
}

.transfer-float-bar-unified.is-pulse .transfer-float-bar-fill {
  transition: none;
}

.transfer-float-bar-unified.is-pulse .transfer-float-bar-fill.is-indeterminate {
  opacity: 0.85;
  animation: transfer-float-unified-pulse 1.4s ease-in-out infinite;
}

@keyframes transfer-float-unified-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.transfer-float-bar-combined {
  display: flex;
  gap: 3px;
  background: transparent;
}

.transfer-float-bar-segment {
  min-width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.transfer-float-bar-combined:not(.is-two-phase) .transfer-float-bar-segment-seedbox {
  flex: 4;
}

.transfer-float-bar-combined:not(.is-two-phase) .transfer-float-bar-segment-nas {
  flex: 4;
}

.transfer-float-bar-combined:not(.is-two-phase) .transfer-float-bar-segment-filebot {
  flex: 2;
}

.transfer-float-bar-combined.is-two-phase .transfer-float-bar-segment {
  flex: 1;
}

.transfer-float-bar-segment-seedbox .transfer-float-bar-fill {
  background: var(--primary);
}

.transfer-float-bar-segment-seedbox.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-segment-nas .transfer-float-bar-fill {
  background: #8b5cf6;
}

.transfer-float-bar-segment-nas.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-segment-nas.is-error .transfer-float-bar-fill {
  background: var(--danger, #dc2626);
}

.transfer-float-bar-segment-nas.is-warn .transfer-float-bar-fill {
  background: #8b5cf6;
}

.transfer-float-bar-segment-nas.is-pulse .transfer-float-bar-fill {
  transition: none;
}

.transfer-float-bar-segment-nas.is-pulse .transfer-float-bar-fill.is-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  width: 55% !important;
  height: 100%;
  animation: transfer-float-nas-slide 1.8s ease-in-out infinite alternate;
}

.transfer-float-bar-segment-filebot .transfer-float-bar-fill {
  background: #7c3aed;
}

.transfer-float-bar-segment-filebot.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-segment-filebot.is-error .transfer-float-bar-fill {
  background: var(--danger, #dc2626);
}

.transfer-float-bar-segment-filebot.is-pulse .transfer-float-bar-fill {
  transition: none;
}

.transfer-float-bar-segment-filebot.is-pulse .transfer-float-bar-fill.is-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  width: 55% !important;
  height: 100%;
  animation: transfer-float-nas-slide 1.8s ease-in-out infinite alternate;
}

.transfer-float-bar-half {
  flex: 1;
  min-width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.transfer-float-bar-half-seedbox .transfer-float-bar-fill {
  background: var(--primary);
}

.transfer-float-bar-half-seedbox.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-half-nas .transfer-float-bar-fill {
  background: #8b5cf6;
}

.transfer-float-bar-half-nas.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-half-nas.is-error .transfer-float-bar-fill {
  background: var(--danger, #dc2626);
}

.transfer-float-bar-half-nas.is-warn .transfer-float-bar-fill {
  background: #8b5cf6;
}

.transfer-float-bar-half-nas.is-pulse .transfer-float-bar-fill {
  transition: none;
}

.transfer-float-bar-half-nas.is-pulse .transfer-float-bar-fill.is-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  width: 55% !important;
  height: 100%;
  animation: transfer-float-nas-slide 1.8s ease-in-out infinite alternate;
}

.transfer-float-phases {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text);
  font-weight: 500;
}

.transfer-float-track-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.transfer-float-track-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.transfer-float-track-meta {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.35;
  color: var(--text-secondary);
}

.transfer-float-bar {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.transfer-float-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.transfer-float-bar-seedbox .transfer-float-bar-fill {
  background: var(--primary);
}

.transfer-float-bar-nas .transfer-float-bar-fill {
  background: #8b5cf6;
}

.transfer-float-bar-nas.is-done .transfer-float-bar-fill {
  background: var(--success, #16a34a);
}

.transfer-float-bar-nas.is-error .transfer-float-bar-fill {
  background: var(--danger, #dc2626);
}

.transfer-float-bar-nas.is-warn .transfer-float-bar-fill {
  background: #8b5cf6;
}

@keyframes transfer-float-nas-slide {
  from {
    left: 0;
  }
  to {
    left: 62%;
  }
}

@media (max-width: 900px) {
  .transfer-float-stack {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-width: 280px;
  }
}

@media (max-width: 640px) {
  .transfer-float-stack {
    top: auto;
    bottom: 1rem;
    left: 0.75rem;
    right: auto;
  }
}

/* ── Page d'accueil — barre de recherche (style Google) ── */

.search-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - var(--topbar-h));
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.search-hero-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0 0 2rem;
  align-self: center;
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.search-hero-logo-img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

.search-form {
  width: min(100%, 584px);
  margin-inline: auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-box:hover,
.search-box:focus-within {
  border-color: transparent;
  box-shadow:
    0 1px 6px rgba(32, 33, 36, 0.12),
    0 1px 2px rgba(32, 33, 36, 0.08);
}

.search-box-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--muted);
}

.search-box-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
}

.search-box-input::placeholder {
  color: #9aa0a6;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.search-actions .btn {
  border-radius: 4px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
}

.search-actions .btn-ghost {
  background: var(--bg);
  border-color: transparent;
}

.search-actions .btn-ghost:hover {
  background: #f1f3f4;
  border-color: transparent;
}

.search-indicator {
  align-self: center;
  margin-top: 1.25rem;
}

.search-result {
  width: min(100%, 584px);
  margin-inline: auto;
  margin-top: 1.5rem;
  text-align: left;
}

.search-result .alert {
  margin-top: 0;
}

.search-result:has(.search-prowlarr) {
  width: min(100%, 960px);
}

.search-prowlarr-summary {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.search-prowlarr-panel {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

.search-prowlarr-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.search-media-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease;
}

.search-media-card:hover {
  transform: translateY(-2px);
}

.search-media-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.search-media-card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.search-media-card-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.search-media-card-poster-placeholder svg {
  width: 2rem;
  height: 2rem;
  opacity: 0.55;
}

.search-media-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.search-sheet-body {
  overflow: auto;
  padding: 0 1rem 1.25rem;
}

.search-sheet-header .sheet-intro,
#search-sheet-meta {
  margin-bottom: 0;
}

.search-sheet-season-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-sheet-season-label {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-sheet-season-select {
  min-width: 9rem;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-sheet-season-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-release-item[hidden] {
  display: none;
}

.search-sheet-media {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.75rem;
}

.search-sheet-poster {
  margin-top: 0;
  flex-shrink: 0;
}

.search-sheet-plex {
  flex: 1;
  min-width: 0;
  padding-top: 0.15rem;
}

.search-sheet-plex-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.45rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-sheet-plex-ok {
  color: var(--ok);
  background: rgba(34, 150, 120, 0.1);
  border: 1px solid rgba(34, 150, 120, 0.25);
}

.search-sheet-plex-miss,
.search-sheet-plex-off {
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
}

.search-sheet-plex-detail {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.search-sheet-plex-meta {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.search-sheet-plex-link {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-hover);
  text-decoration: none;
}

.search-sheet-plex-link:hover {
  text-decoration: underline;
}

.search-sheet-radarr,
.search-sheet-sonarr {
  margin-top: 0.65rem;
}

.search-sheet-radarr-badge,
.search-sheet-sonarr-badge,
.search-sheet-arr-badge {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.search-sheet-radarr-ok,
.search-sheet-sonarr-ok,
.search-sheet-arr-ok {
  background: #e6f4ea;
  color: #137333;
}

.search-sheet-radarr-error,
.search-sheet-radarr-off,
.search-sheet-sonarr-error,
.search-sheet-sonarr-off,
.search-sheet-arr-error,
.search-sheet-arr-off {
  background: #fce8e6;
  color: #c5221f;
}

.search-sheet-radarr-btn,
.search-sheet-sonarr-btn,
.search-sheet-arr-btn {
  margin-top: 0.35rem;
}

.search-sheet-poster-img {
  display: block;
  width: 7.5rem;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.search-sheet-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.5rem;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}

.search-sheet-poster-placeholder svg {
  width: 2rem;
  height: 2rem;
  opacity: 0.55;
}

.search-release-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-release-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.search-release-item:last-child {
  border-bottom: none;
}

.search-release-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.search-release-line + .search-release-line {
  margin-top: 0.45rem;
}

.search-release-line-primary {
  align-items: stretch;
}

.search-release-primary-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0;
  min-width: 0;
}

.search-release-primary-text > span::before {
  content: "·";
  margin-right: 0.65rem;
  color: var(--border-strong);
}

.search-release-primary-text > .search-release-title::before {
  content: none;
  margin: 0;
}

.search-release-primary-text .search-release-title {
  min-width: 0;
  flex: 1 1 12rem;
}

.search-release-primary-text .search-release-quality,
.search-release-primary-text .search-release-size {
  flex-shrink: 0;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.search-release-line-meta {
  align-items: center;
}

.search-release-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.search-release-stats span {
  white-space: nowrap;
}

.search-release-action {
  flex-shrink: 0;
  max-width: 14rem;
}

.search-release-error {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 14rem;
  text-align: right;
}

.search-release-error-text {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--error);
}

.search-release-error-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary-hover);
  text-decoration: none;
}

.search-release-error-link:hover {
  text-decoration: underline;
}

.search-release-action form {
  margin: 0;
}

.search-release-add-form.is-loading .search-release-add-spinner {
  display: inline-block;
}

.search-release-add-form.is-loading .search-release-add-btn {
  min-width: 5.8rem;
}

.search-sheet-body .search-prowlarr-table {
  width: 100%;
}

.search-prowlarr-groups {
  display: flex;
  flex-direction: column;
}

.search-media-group {
  border-bottom: 1px solid var(--border);
}

.search-media-group:last-child {
  border-bottom: none;
}

.search-media-summary {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s;
}

.search-media-summary::-webkit-details-marker {
  display: none;
}

.search-media-summary:hover {
  background: var(--bg);
}

.search-media-chevron {
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 4.5rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.search-media-group[open] .search-media-chevron {
  transform: rotate(90deg);
}

.search-media-poster {
  width: 150px;
  height: 225px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.search-media-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.search-media-poster-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.55;
}

.search-media-heading {
  min-width: 0;
  flex: 1;
}

.search-media-title {
  margin: 0.75rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.search-media-meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
}

.search-media-count {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.search-media-releases {
  padding: 0 1rem 1rem 5.5rem;
}

.search-sheet-body .search-prowlarr-table thead th,
.search-media-releases .search-prowlarr-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.search-release-title {
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
  min-width: 0;
  flex: 1;
}

.search-release-stats span::before {
  content: "·";
  margin-right: 0.65rem;
  color: var(--border-strong);
}

.search-release-stats span:first-child::before {
  content: none;
  margin: 0;
}

.search-release-quality {
  font-size: inherit;
  line-height: 1.35;
  color: inherit;
}

.search-release-size {
  white-space: nowrap;
}

.search-release-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.search-release-poster {
  width: 46px;
  height: 69px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.search-release-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.search-release-poster-placeholder svg {
  width: 22px;
  height: 22px;
  opacity: 0.55;
}

.search-release-body {
  min-width: 0;
  flex: 1;
}

.search-release-title a {
  color: var(--text);
  text-decoration: none;
}

.search-release-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.search-release-primary-text > .search-release-plex::before {
  content: none;
  margin: 0;
}

.search-release-primary-text .search-release-plex {
  flex-shrink: 0;
}

.search-release-plex {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  vertical-align: middle;
}

.search-release-plex .app-loading-chip {
  display: inline-flex;
  vertical-align: middle;
}

.search-release-plex-badge {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.16rem 0.42rem;
  border-radius: var(--radius-sm);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.search-release-plex-ok {
  color: var(--ok);
  background: rgba(34, 150, 120, 0.1);
  border: 1px solid rgba(34, 150, 120, 0.25);
}

.search-release-plex-ok:hover {
  text-decoration: none;
  background: rgba(34, 150, 120, 0.16);
}

.search-release-plex-miss,
.search-release-plex-off {
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
}

.search-release-meta {
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.search-prowlarr-table .cell-actions form {
  margin: 0;
}

@media (max-width: 640px) {
  .search-hero-logo {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    gap: 0.6rem;
  }

  .search-hero-logo-img {
    width: 3.25rem;
    height: 3.25rem;
  }

  .search-box {
    padding: 0.75rem 1rem;
  }

  .search-prowlarr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .search-sheet-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .search-media-releases {
    padding-left: 1rem;
    overflow-x: auto;
  }

  .search-media-count {
    display: none;
  }
}

/* Legacy nav class alias */
.nav {
  display: none;
}

@media (max-width: 1024px) {
  .topnav {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topbar-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0.65rem 1rem;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .topnav-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }

  .topbar-actions {
    margin-left: 0;
  }

  .topbar-actions-utils {
    flex: 1;
    justify-content: flex-end;
  }

  .container {
    padding: 1.25rem 1rem 2rem;
  }

  .data-table th,
  .data-table td,
  .table th,
  .table td {
    padding: 0.75rem 0.85rem;
  }

  .sheet-panel {
    width: 100%;
    max-width: 100%;
  }
}

/* ── Paramètres — cartes & sheet ── */

.settings-category {
  margin-bottom: 2rem;
}

.settings-category-title {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.plex-stats-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .plex-stats-grid {
    grid-template-columns: 1fr;
  }
}

.plex-stat-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 11rem;
}

.plex-stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: rgba(229, 160, 13, 0.12);
  border: 1px solid rgba(229, 160, 13, 0.35);
  color: #b87d08;
}

.plex-stat-card-icon-show {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary-hover);
}

.plex-stat-card-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.plex-stat-card-body {
  flex: 1;
}

.plex-stat-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.plex-stat-card-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.plex-stat-count {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.plex-stripe-refresh {
  margin-top: 1.5rem;
}

.plex-stripe-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plex-stripe-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, rgba(99, 91, 255, 0.08), rgba(99, 91, 255, 0.02));
  border: 1px solid rgba(99, 91, 255, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.plex-stripe-card-off {
  background: var(--surface);
  border-color: var(--border);
}

.plex-stripe-card-error {
  background: var(--error-soft);
  border-color: rgba(220, 38, 38, 0.2);
}

.plex-stripe-card-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.plex-stripe-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: #635bff;
  color: #fff;
  flex-shrink: 0;
}

.plex-stripe-card-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.plex-stripe-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.plex-stripe-card-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.plex-stripe-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(99, 91, 255, 0.14);
}

.plex-stripe-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(99, 91, 255, 0.1);
  border-radius: var(--radius);
}

.plex-stripe-card-off .plex-stripe-stat {
  background: var(--bg);
  border-color: var(--border);
}

.plex-stripe-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: #635bff;
  word-break: break-word;
}

.plex-stripe-stat-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 720px) {
  .plex-stripe-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plex-stripe-stat-warn .plex-stripe-stat-value {
  color: var(--text-secondary);
}

.plex-stripe-stat-value-balance {
  color: var(--text);
  letter-spacing: -0.02em;
}

.plex-stripe-stat-value-pending {
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

.plex-stripe-panel {
  margin-bottom: 0;
}

.plex-stripe-customer-link {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.plex-stripe-customer-link:hover {
  color: #635bff;
  text-decoration: underline;
}

.plex-stripe-sheet-body {
  overflow: auto;
  padding: 0 1.5rem 1.5rem;
}

.plex-stripe-cell-open {
  cursor: pointer;
  transition: background 0.12s;
}

.plex-stripe-cell-open:hover,
.plex-stripe-cell-open:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.plex-stripe-sheet-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.plex-stripe-sheet-avatar {
  width: 3rem;
  height: 3rem;
}

.plex-stripe-sheet-name {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.plex-stripe-sheet-type,
.plex-stripe-sheet-email {
  margin: 0;
  font-size: 0.84rem;
}

.plex-stripe-sheet-stats {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.plex-stripe-sheet-stat {
  display: grid;
  gap: 0.35rem;
}

.plex-stripe-sheet-stat dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.plex-stripe-sheet-stat dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.plex-stripe-sheet-total {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.plex-stripe-sheet-plan {
  font-size: 0.82rem;
}

.plex-stripe-sheet-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.plex-stripe-payment-amount {
  font-weight: 600;
  white-space: nowrap;
}

.plex-stripe-sheet-foot {
  margin: 1.25rem 0 0;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.settings-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.settings-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.settings-card-icon-vpn {
  background: var(--primary-soft);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary-hover);
}

.settings-card-icon-agent {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.sheet-form-footer-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sheet-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.settings-card-body {
  flex: 1;
  min-width: 0;
}

.settings-card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.settings-card-desc {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-card-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.sheet-root.is-open {
  pointer-events: auto;
}

.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.sheet-root.is-open .sheet-overlay {
  opacity: 1;
}

.sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: 50vw;
  max-width: 50vw;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.sheet-root.is-open .sheet-panel {
  transform: translateX(0);
}

.sheet-root.search-sheet-root {
  inset: auto;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  left: 0;
}

.sheet-root.search-sheet-root .search-sheet-panel {
  width: min(50vw, 42rem);
  max-width: min(50vw, 42rem);
  height: 100%;
}

.sheet-root.plex-stripe-sheet-root {
  inset: auto;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  left: 0;
}

.sheet-root.plex-stripe-sheet-root .plex-stripe-sheet-panel {
  width: min(50vw, 36rem);
  max-width: min(50vw, 36rem);
  height: 100%;
}

body.sheet-open {
  overflow: hidden;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.sheet-intro {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.sheet-content .settings-form {
  max-width: none;
}

.sheet-data-panel {
  margin-top: 0.75rem;
}

.sheet-toolbar {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ── Compte — liste membres ── */

.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;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.25rem;
}

.members-list-head,
.members-list-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 1.15fr) minmax(4rem, 1fr) minmax(4rem, 0.85fr) minmax(4.5rem, 0.75fr) auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.members-list-head {
  padding: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.members-list-row {
  margin: 0;
  padding: 0.35rem 0;
}

.members-list-row + .members-list-row {
  margin-top: 0.15rem;
}

.members-field {
  min-width: 0;
}

.members-field-username {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.members-field-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.members-list .input-inline {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.3rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  box-shadow: none;
}

.members-list .input-inline::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.members-list .input-inline:focus {
  outline: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.members-list select.input-inline {
  padding-right: 1.25rem;
  cursor: pointer;
}

.member-you-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.members-field-actions .btn {
  min-width: 1.75rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.btn-danger-text {
  color: var(--error);
}

.btn-danger-text:hover {
  color: #b91c1c;
  background: var(--error-soft);
}

.members-field-password {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.member-password-hash {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.members-list .input-inline-password {
  flex: 1;
  min-width: 3.5rem;
}

.members-list .input-inline-password::placeholder {
  font-size: 0.75rem;
}

.members-add-form {
  margin-top: 1.25rem;
}

/* ── Documentation ── */

.docs-toc h2 {
  margin-bottom: 0.75rem;
}

.docs-toc-list {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}

.docs-toc-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.docs-toc-list a:hover {
  text-decoration: underline;
}

.docs-section {
  scroll-margin-top: 5rem;
}

.docs-section h2 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.docs-section h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
}

.docs-section p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.docs-list {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.docs-list-ordered {
  list-style: decimal;
}

.docs-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 1rem;
}

.docs-flow-step {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
}

.docs-flow-step strong {
  font-size: 0.875rem;
  color: var(--text);
}

.docs-flow-step span:last-child {
  color: var(--muted);
  line-height: 1.4;
}

.docs-flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.docs-flow-arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 0 0.15rem;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.docs-table th,
.docs-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.docs-table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
}

.docs-table td {
  color: var(--text-secondary);
}

.docs-table code {
  font-size: 0.8em;
}

@media (max-width: 640px) {
  .docs-toc-list {
    columns: 1;
  }

  .docs-flow-arrow {
    display: none;
  }
}

/* ── Discover (TMDB) ── */

.discover-page {
  max-width: 1200px;
  margin: 0 auto;
}

.discover-hero {
  margin-bottom: 1.5rem;
}

.discover-hero-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.discover-search-form {
  margin-top: 1.25rem;
  max-width: 560px;
}

.discover-search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.discover-search-box:focus-within {
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
}

.discover-search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}

.discover-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
}

.discover-search-indicator {
  margin: 0.75rem 0 0;
}

.discover-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.discover-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.discover-tab:hover {
  background: var(--bg);
  color: var(--text);
}

.discover-tab.active {
  background: var(--primary-soft);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary-on);
}

.discover-results {
  min-height: min(52vh, 28rem);
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.discover-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.discover-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.discover-card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.discover-card-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.discover-card-poster-placeholder svg {
  width: 2rem;
  height: 2rem;
  opacity: 0.55;
}

.discover-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.discover-card-meta,
.discover-card-type {
  font-size: 0.74rem;
}

.discover-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.discover-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.discover-pagination-info {
  font-size: 0.85rem;
}

.discover-attribution {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.discover-tmdb-logo {
  display: block;
  opacity: 0.85;
}

.discover-attribution-text {
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
}

.discover-detail {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.discover-detail-nav {
  margin-bottom: 1rem;
}

.discover-detail-backdrop {
  position: absolute;
  inset: -1rem -1.5rem auto;
  height: 280px;
  background-size: cover;
  background-position: center top;
  border-radius: var(--radius-lg);
  opacity: 0.22;
  mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.discover-detail-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.discover-detail-poster {
  width: 11rem;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.discover-detail-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
}

.discover-detail-type {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.discover-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.discover-detail-year {
  font-weight: 500;
  color: var(--muted);
}

.discover-detail-tagline {
  margin: 0 0 0.75rem;
  font-style: italic;
}

.discover-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.discover-detail-rating {
  font-weight: 600;
  color: var(--text);
}

.discover-detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.discover-genre-chip {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.discover-detail-overview {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 62ch;
}

.discover-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.discover-detail-arr form {
  margin: 0;
}

.discover-detail-arr .app-loading-inline,
.discover-tv-coverage-actions .app-loading-inline {
  padding: 0;
  min-height: 0;
}

.discover-arr-off {
  margin: 0;
  font-size: 0.85rem;
}

.discover-detail-plex {
  margin-top: 1rem;
}

.discover-tv-coverage-box {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--bg);
}

.discover-tv-coverage {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.discover-tv-coverage-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.discover-tv-coverage-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.discover-tv-coverage-title {
  font-size: 0.95rem;
  line-height: 1.4;
}

.discover-tv-coverage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.82rem;
}

.discover-tv-coverage-missing {
  color: #b45309;
}

.discover-tv-coverage-alert {
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
}

.discover-tv-coverage-seasons {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.discover-tv-season {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.discover-tv-season-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  list-style: none;
}

.discover-tv-season-summary::-webkit-details-marker {
  display: none;
}

.discover-tv-season-counts {
  font-size: 0.76rem;
  font-weight: 500;
}

.discover-tv-episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.35rem;
  padding: 0 0.75rem 0.75rem;
}

.discover-tv-episode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.72rem;
}

.discover-tv-episode.is-downloaded {
  border-color: rgba(34, 150, 120, 0.35);
  background: rgba(34, 150, 120, 0.08);
}

.discover-tv-episode.is-missing {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(180, 83, 9, 0.08);
}

.discover-tv-episode-code {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.discover-tv-episode-flags {
  display: inline-flex;
  gap: 0.2rem;
}

.discover-tv-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.discover-tv-flag.is-on {
  color: var(--ok);
  border-color: rgba(34, 150, 120, 0.35);
  background: rgba(34, 150, 120, 0.12);
}

.discover-tv-flag.is-partial {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(180, 83, 9, 0.12);
}

.discover-tv-coverage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0;
  font-size: 0.74rem;
}

.discover-tv-coverage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-top: 0.15rem;
}

.discover-tv-coverage-done {
  margin: 0;
  font-size: 0.82rem;
}

.discover-torrents {
  margin-top: 1rem;
}

.discover-torrents .search-result {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.discover-torrents:empty {
  display: none;
}

.discover-torrents .search-prowlarr {
  margin-top: 0;
}

.discover-torrents-indicator {
  margin: 0.75rem 0 0;
}

.discover-section {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
}

.discover-section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.discover-trailer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.discover-trailer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.discover-cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 1rem;
}

.discover-cast-card {
  text-align: center;
}

.discover-cast-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.discover-cast-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.discover-cast-name {
  margin: 0.45rem 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

.discover-cast-role {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .discover-detail-hero {
    grid-template-columns: 1fr;
  }

  .discover-detail-poster-wrap {
    display: flex;
    justify-content: center;
  }

  .discover-detail-backdrop {
    inset: -0.5rem -1rem auto;
    height: 200px;
  }

  .discover-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.75rem;
  }
}

.calendar-page {
  max-width: 1200px;
}

.calendar-view-toggle {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.calendar-tabs {
  margin-bottom: 1rem;
}

.calendar-panel {
  min-height: min(52vh, 28rem);
}

.arr-calendar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.arr-calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.arr-calendar-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.arr-calendar-month {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.arr-calendar-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.arr-calendar-weekdays,
.arr-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.arr-calendar-weekdays {
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}

.arr-calendar-weekday {
  padding: 0.45rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}

.arr-calendar-week + .arr-calendar-week {
  border-top: 1px solid var(--border);
}

.arr-calendar-day {
  min-height: 6.5rem;
  padding: 0.35rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--surface);
}

.arr-calendar-day:nth-child(7n) {
  border-right: none;
}

.arr-calendar-day.is-outside {
  background: var(--bg);
}

.arr-calendar-day.is-outside .arr-calendar-day-num {
  color: var(--muted);
}

.arr-calendar-day.is-today {
  background: var(--primary-soft);
}

.arr-calendar-day-num {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.arr-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 0;
}

.arr-calendar-event {
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  margin: 0;
  padding: 0.18rem 0.28rem 0.18rem 0.42rem;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0.25rem;
  background: var(--bg);
  color: inherit;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

button.arr-calendar-event:hover,
a.arr-calendar-event:hover {
  background: var(--surface-hover);
}

.arr-calendar-event-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.arr-calendar-event-downloaded {
  border-left-color: #22c55e;
}

.arr-calendar-event-missing {
  border-left-color: #ef4444;
}

.arr-calendar-event-unaired {
  border-left-color: #38bdf8;
}

.arr-calendar-event-unmonitored {
  border-left-color: #94a3b8;
}

.arr-calendar-premiere {
  color: #38bdf8;
  font-size: 0.55rem;
  line-height: 1.8;
  flex-shrink: 0;
}

.arr-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.75rem;
}

.arr-calendar-legend-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.25rem;
  border-radius: 999px;
  vertical-align: middle;
}

.arr-calendar-legend-dot.is-downloaded {
  background: #22c55e;
}

.arr-calendar-legend-dot.is-missing {
  background: #ef4444;
}

.arr-calendar-legend-dot.is-unaired {
  background: #38bdf8;
}

.arr-calendar-legend-dot.is-unmonitored {
  background: #94a3b8;
}

@media (max-width: 768px) {
  .arr-calendar-day {
    min-height: 4.5rem;
    padding: 0.25rem;
  }

  .arr-calendar-event {
    font-size: 0.62rem;
    padding-left: 0.35rem;
  }

  .arr-calendar-month {
    font-size: 1rem;
  }
}

#synology-browser {
  min-height: min(52vh, 28rem);
}

.calendar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
}

.calendar-count {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.calendar-card-static {
  cursor: default;
}

.calendar-status {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.calendar-status-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.calendar-status-pending {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-on);
}

.calendar-error {
  margin-top: 0.5rem;
}

.calendar-card-btn {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.calendar-card-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 10px;
}

.calendar-modal {
  max-width: 34rem;
}

.calendar-modal-shell,
.calendar-modal-body {
  padding: 0;
}

.calendar-modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.calendar-modal-hero {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calendar-modal-poster {
  flex-shrink: 0;
  width: 7.5rem;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.calendar-modal-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.calendar-modal-poster-placeholder svg {
  width: 2rem;
  height: 2rem;
  opacity: 0.55;
}

.calendar-modal-main {
  min-width: 0;
}

.calendar-modal-source {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calendar-modal-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.calendar-modal-original {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
}

.calendar-modal-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.calendar-modal-file {
  font-size: 0.78rem;
}

.calendar-modal-meta {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
}

.calendar-modal-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
}

.calendar-modal-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.calendar-modal-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.calendar-modal-dates {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.calendar-modal-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.calendar-modal-date-label {
  color: var(--text-secondary);
}

.calendar-modal-date-value {
  font-weight: 600;
  text-align: right;
}

.calendar-modal-overview {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.calendar-modal-actions {
  flex-wrap: wrap;
}

.calendar-modal-error {
  margin: 0 0 0.5rem;
  color: var(--danger, #dc2626);
}

.search-hero-hint {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  text-align: center;
}

a.search-media-card,
.search-media-card-link {
  text-decoration: none;
  color: inherit;
}

.search-media-card-meta {
  display: block;
  font-size: 0.78rem;
  line-height: 1.3;
}

.search-releases-page {
  max-width: 1120px;
  margin: 0 auto;
}

.search-releases-nav {
  margin-bottom: 1rem;
}

.search-releases-header {
  margin-bottom: 1.25rem;
}

.search-releases-title {
  margin: 0 0 0.85rem;
  font-size: 1.45rem;
}

.search-releases-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.search-releases-form .search-box {
  flex: 1 1 18rem;
}

.search-releases-summary {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.search-releases-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.search-releases-group-tab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-releases-group-tab:hover,
.search-releases-group-tab.is-active {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-releases-group-tab.is-active {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.search-releases-group-poster {
  width: 2.5rem;
  height: 3.75rem;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.search-releases-group-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.search-releases-group-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.search-releases-group-meta {
  font-size: 0.76rem;
}

.search-releases-panel {
  padding: 1rem 1.15rem;
}

.search-releases-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 0 -1.15rem 0.85rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.search-releases-filter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.search-releases-filter-episode {
  margin-left: auto;
}

.search-releases-panel-head {
  margin-bottom: 0.85rem;
}

.search-releases-panel-media {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-width: 0;
}

.search-releases-panel-poster {
  width: 5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.search-releases-panel-title {
  margin: 0;
  font-size: 1.15rem;
}

.search-releases-panel-meta {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.85rem;
}

.search-releases-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-releases-table-wrap {
  overflow-x: auto;
}

.search-releases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.search-releases-table th {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: bottom;
}

.search-releases-th-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.search-releases-th-label {
  font-weight: 600;
}

.search-releases-sort-icons {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.1rem;
  line-height: 1;
}

.search-releases-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
  border-radius: 2px;
  opacity: 0.45;
  transition: color 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.search-releases-sort-icon:hover {
  color: var(--primary);
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.search-releases-sort-icon.is-active {
  color: var(--primary);
  opacity: 1;
}

.search-releases-sortable.is-sorted .search-releases-th-label {
  color: var(--text);
}

.search-releases-col-type {
  white-space: nowrap;
  font-size: 0.78rem;
}

.search-releases-table th,
.search-releases-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.search-releases-table th {
  padding-bottom: 0.5rem;
}

.search-releases-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

.search-releases-col-title {
  min-width: 14rem;
}

.search-releases-col-title .search-release-title {
  display: block;
  line-height: 1.35;
}

.search-releases-col-quality,
.search-releases-col-size,
.search-releases-col-num {
  white-space: nowrap;
}

.search-releases-col-size {
  font-weight: 600;
}

.search-releases-col-action {
  width: 6.5rem;
  text-align: right;
}

.search-releases-col-plex {
  min-width: 6rem;
}

.search-release-item[hidden] {
  display: none;
}

.search-releases-empty {
  margin: 0;
  padding: 1rem 0;
}

@media (max-width: 760px) {
  .search-releases-table th:nth-child(4),
  .search-releases-table td:nth-child(4),
  .search-releases-table th:nth-child(6),
  .search-releases-table td:nth-child(6) {
    display: none;
  }
}

