:root {
  color-scheme: dark;
  --bg: #090b12;
  --bg-elevated: #0f121c;
  --surface: rgba(20, 24, 37, 0.88);
  --surface-solid: #141825;
  --surface-strong: #1a1f2f;
  --surface-hover: #202638;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f6fb;
  --muted: #929aaf;
  --muted-strong: #b9c0d1;
  --accent: #7868f8;
  --accent-bright: #988bff;
  --accent-soft: rgba(120, 104, 248, 0.16);
  --cyan: #4ed8c7;
  --green: #4bd39a;
  --amber: #f5b95b;
  --red: #f16d7a;
  --sidebar-width: 250px;
  --sidebar-compact: 78px;
  --topbar-height: 76px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f8;
  --bg-elevated: #f8f9fc;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #fff;
  --surface-strong: #f0f1f6;
  --surface-hover: #e9ebf3;
  --border: rgba(30, 34, 52, 0.09);
  --border-strong: rgba(30, 34, 52, 0.16);
  --text: #171a26;
  --muted: #697086;
  --muted-strong: #4b5368;
  --accent: #6758e8;
  --accent-bright: #7567f0;
  --accent-soft: rgba(103, 88, 232, 0.12);
  --shadow: 0 18px 55px rgba(45, 48, 65, 0.1);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -10%, rgba(120, 104, 248, 0.14), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.62; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 2000; top: 8px; left: 8px; padding: 10px 14px; border-radius: 9px; background: var(--accent); color: white; font-weight: 700; text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.boot-screen.is-leaving { opacity: 0; visibility: hidden; }
.boot-mark, .brand-symbol {
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(120, 104, 248, 0.2), rgba(78, 216, 199, 0.1));
  border: 1px solid rgba(152, 139, 255, 0.22);
  box-shadow: 0 14px 35px rgba(67, 54, 169, 0.22);
}
.brand-symbol { border-color: transparent; background: transparent; box-shadow: none; }
.boot-mark { width: 68px; height: 68px; }
.boot-copy { display: flex; flex-direction: column; }
.boot-copy strong { font-size: 20px; letter-spacing: -0.02em; }
.boot-copy span { color: var(--muted); font-size: 13px; }
.spinner {
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
}
.auth-ambient {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 104, 248, 0.22), rgba(78, 216, 199, 0.06) 42%, transparent 70%);
  filter: blur(20px);
  transform: translate(25%, -35%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: min(460px, 100%);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.auth-brand { display: flex; align-items: center; gap: 13px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.auth-brand .brand-symbol { width: 52px; height: 52px; }
.auth-brand > span:last-child { display: flex; flex-direction: column; }
.auth-brand strong { font-size: 18px; }
.auth-brand small { color: var(--muted); }
.auth-heading { margin: 30px 0 24px; }
.auth-heading h1 { margin: 8px 0 8px; font-size: clamp(28px, 6vw, 36px); letter-spacing: -0.045em; line-height: 1.1; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-card form { display: grid; gap: 17px; }
.auth-submit { width: 100%; justify-content: center; min-height: 48px; margin-top: 4px; }
.auth-note { display: flex; gap: 10px; margin-top: 22px; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--muted-strong); font-size: 12px; }
.auth-note svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--green); }
.form-error { min-height: 20px; margin: -4px 0 0; color: var(--red); font-size: 13px; }

.app-shell { min-height: 100vh; }
.connection-banner {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(245, 185, 91, .32);
  background: color-mix(in srgb, var(--bg-elevated) 94%, var(--amber) 6%);
  color: var(--amber);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}
.connection-banner svg { flex: 0 0 auto; width: 17px; height: 17px; }
.is-offline .main-shell { padding-top: 40px; }
.is-offline .topbar { top: 40px; }
.noscript-message { max-width: 680px; margin: 40px auto; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); color: var(--muted-strong); text-align: center; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  background: color-mix(in srgb, var(--bg-elevated) 95%, transparent);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px);
  transition: width 0.22s ease, transform 0.22s ease;
}
.brand-row { display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 3px 20px; }
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 0; border: 0; background: transparent; text-align: left; }
.brand-symbol { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 13px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; white-space: nowrap; overflow: hidden; }
.brand-copy strong { font-size: 16px; letter-spacing: -0.02em; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.nav-list { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.nav-item, .collapse-button {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted-strong); text-align: left;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.nav-item:hover, .collapse-button:hover { color: var(--text); background: var(--surface-hover); }
.nav-item.is-active { color: var(--text); background: linear-gradient(90deg, var(--accent-soft), rgba(120, 104, 248, 0.07)); border-color: rgba(120, 104, 248, 0.2); }
.nav-icon { flex: 0 0 23px; display: grid; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-icon.service-icon img { width: 19px; height: 19px; object-fit: contain; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: white; font-size: 10px; font-weight: 700; text-align: center; }
.nav-section-label { height: 34px; display: flex; align-items: end; padding: 0 13px 7px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 0.14em; white-space: nowrap; overflow: hidden; }
.nav-spacer { flex: 1; }
.sidebar-footer { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 13px; }
.sidebar-health { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px 10px; }
.sidebar-health-copy { display: flex; min-width: 0; flex-direction: column; white-space: nowrap; overflow: hidden; }
.sidebar-health-copy strong { font-size: 12px; font-weight: 650; }
.sidebar-health-copy small { color: var(--muted); font-size: 10px; }
.collapse-button { font-size: 12px; }
.collapse-button svg { flex: 0 0 auto; width: 18px; height: 18px; }
.sidebar-close { display: none; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left 0.22s ease; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(22px);
}
.topbar-context, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.context-copy h1 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.context-copy p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.sync-time { color: var(--muted); font-size: 11px; }
.icon-button, .toolbar-button, .user-button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--muted-strong);
}
.icon-button { width: 40px; padding: 0; }
.toolbar-button, .user-button { padding: 0 12px; }
.icon-button:hover, .toolbar-button:hover, .user-button:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-hover); }
.global-search-button kbd, .command-search kbd, .command-help kbd { padding: 2px 6px; border: 1px solid var(--border); border-bottom-color: var(--border-strong); border-radius: 6px; background: var(--surface-strong); color: var(--muted); font: 700 9px/1.5 inherit; }
.activity-button { position: relative; }
.activity-count { position: absolute; top: -5px; right: -5px; min-width: 18px; padding: 2px 5px; border: 2px solid var(--bg); border-radius: 999px; background: var(--accent); color: white; font-size: 8px; font-weight: 800; line-height: 1.3; }
.alert-count { background: var(--red); }
.activity-button.has-alerts { border-color: rgba(241,109,122,.35); color: var(--red); }
.menu-button { display: none; }
.toolbar-button.is-loading svg { animation: spin 0.75s linear infinite; }
.user-button { padding-left: 7px; font-size: 12px; }
.user-button > svg { width: 14px; height: 14px; }
.user-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-bright); font-weight: 750; }

.content { width: min(1480px, 100%); margin: 0 auto; padding: 30px 34px 60px; outline: none; }
.eyebrow { display: inline-block; color: var(--accent-bright); font-size: 9px; font-weight: 800; letter-spacing: 0.16em; }
.overview-toolbar { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.dashboard-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-widget { min-width: 0; margin: 0; }
.dashboard-widget.widget-wide { grid-column: 1 / -1; }
.dashboard-widget.metric-grid { margin-top: 0; }
.services-widget .section-heading { margin-top: 8px; }

.quick-actions-panel { min-width: 0; }
.quick-actions-panel .section-heading { margin-top: 6px; }
.quick-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-action-card {
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.quick-action-card:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--surface-hover); }
.quick-action-card:disabled { transform: none; }
.quick-action-icon { flex: 0 0 39px; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-bright); }
.quick-action-icon svg { width: 18px; height: 18px; }
.quick-action-copy { min-width: 0; display: grid; }
.quick-action-copy strong, .quick-action-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-action-copy strong { font-size: 13px; }
.quick-action-copy small { color: var(--muted); font-size: 11px; }

.overview-hero {
  position: relative; overflow: hidden; min-height: 230px; display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding: clamp(28px, 5vw, 48px); border: 1px solid rgba(120, 104, 248, 0.2); border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 48%, rgba(78, 216, 199, 0.12), transparent 17rem),
    radial-gradient(circle at 15% 115%, rgba(120, 104, 248, 0.22), transparent 25rem),
    linear-gradient(130deg, var(--surface-solid), color-mix(in srgb, var(--surface-solid) 80%, #25205a));
  box-shadow: var(--shadow);
}
.overview-hero::after { content: ""; position: absolute; right: -110px; top: -150px; width: 410px; height: 410px; border: 1px solid rgba(152,139,255,.15); border-radius: 50%; box-shadow: 0 0 0 45px rgba(152,139,255,.03), 0 0 0 90px rgba(152,139,255,.025); }
.overview-hero-copy { position: relative; z-index: 1; max-width: 720px; }
.overview-hero h2 { max-width: 650px; margin: 8px 0 12px; font-size: clamp(30px, 4.8vw, 52px); line-height: 1.03; letter-spacing: -0.052em; }
.overview-hero p { max-width: 650px; margin: 0; color: var(--muted-strong); font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.connection-score { position: relative; z-index: 1; flex: 0 0 auto; width: 154px; height: 154px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: rgba(9, 11, 18, .35); border: 1px solid rgba(152,139,255,.24); box-shadow: inset 0 0 50px rgba(120,104,248,.12), 0 20px 50px rgba(0,0,0,.18); backdrop-filter: blur(14px); }
.connection-score strong { font-size: 38px; line-height: 1; letter-spacing: -0.06em; }
.connection-score span { margin-top: 8px; color: var(--muted-strong); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }

.primary-button, .secondary-button, .text-button, .primary-small, .danger-small, .icon-text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; font-weight: 650; transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.primary-button, .secondary-button { min-height: 42px; padding: 0 16px; }
.primary-button { border: 1px solid transparent; background: linear-gradient(135deg, var(--accent), #6554df); color: white; box-shadow: 0 10px 24px rgba(87,70,199,.24); }
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(135deg, var(--accent-bright), var(--accent)); }
.secondary-button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.secondary-button:hover { transform: translateY(-1px); background: var(--surface-hover); }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--accent-bright); }
.primary-small, .danger-small, .icon-text-button { min-height: 33px; padding: 0 11px; font-size: 11px; }
.primary-small { border: 1px solid transparent; background: var(--accent); color: white; }
.danger-small { border: 1px solid rgba(241,109,122,.28); background: rgba(241,109,122,.1); color: var(--red); }
.icon-text-button { border: 1px solid var(--border); background: var(--surface-strong); color: var(--muted-strong); }
.icon-text-button:hover { color: var(--text); border-color: var(--border-strong); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.metric-card { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 17px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 25px rgba(0,0,0,.06); }
.metric-card:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.metric-icon { flex: 0 0 43px; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent-bright); }
.metric-copy { min-width: 0; display: grid; }
.metric-copy small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-copy strong { font-size: 25px; line-height: 1.15; letter-spacing: -.04em; }
.metric-copy span { color: var(--muted-strong); font-size: 10px; }
.metric-arrow { margin-left: auto; width: 15px; color: var(--muted); }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 34px 2px 14px; }
.section-heading h2, .page-intro h2 { margin: 4px 0 2px; font-size: 23px; letter-spacing: -.035em; }
.section-heading p, .page-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.service-card { position: relative; min-height: 148px; display: flex; flex-direction: column; gap: 17px; padding: 18px; overflow: hidden; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.service-card::after { content: ""; position: absolute; right: -35px; bottom: -50px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent-soft); filter: blur(8px); opacity: .35; }
.service-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-hover); }
.service-card.is-refreshing::before, .is-refreshing .service-card::before { content: ""; position: absolute; z-index: 3; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--surface-hover) 75%, transparent) 45%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.1s infinite; pointer-events: none; }
@keyframes shimmer { to { transform: translateX(100%); } }
.service-card-top { display: flex; align-items: center; justify-content: space-between; }
.service-logo { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 78%, white 2%); }
.service-logo img { width: 31px; height: 31px; object-fit: contain; }
.service-logo.small { width: 40px; height: 40px; border-radius: 12px; }
.service-logo.small img { width: 26px; height: 26px; }
.service-card-copy { min-width: 0; display: flex; flex-direction: column; }
.service-card-copy strong { font-size: 15px; }
.service-card-copy small { max-width: calc(100% - 20px); margin-top: 3px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-version { color: var(--muted); font-size: 9px; margin-top: 4px; }
.service-card-arrow { position: absolute; right: 17px; bottom: 17px; width: 16px; color: var(--muted); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(146,154,175,.1); }
.status-pill .status-dot { width: 6px; height: 6px; box-shadow: none; }
.status-online { color: var(--green); background: rgba(75,211,154,.1); }
.status-online .status-dot, .status-dot.status-online { background: var(--green); box-shadow: 0 0 0 3px rgba(75,211,154,.12); }
.status-error { color: var(--amber); background: rgba(245,185,91,.1); }
.status-error .status-dot, .status-dot.status-error { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,185,91,.12); }
.status-offline { color: var(--red); background: rgba(241,109,122,.1); }
.status-offline .status-dot, .status-dot.status-offline { background: var(--red); box-shadow: 0 0 0 3px rgba(241,109,122,.12); }
.status-unconfigured, .status-disabled { color: var(--muted); background: rgba(146,154,175,.09); }
.status-unconfigured .status-dot, .status-disabled .status-dot, .status-dot.status-unconfigured, .status-dot.status-disabled { background: var(--muted); }

.overview-lower { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-top: 14px; }
.data-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.05); }
.compact-panel { padding: 20px; }
.panel-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.panel-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-bright); }
.panel-heading h3, .panel-title-row h3 { margin: 0; font-size: 14px; }
.panel-heading p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.compact-list { display: grid; }
.compact-row { display: flex; align-items: center; gap: 12px; padding: 11px 3px; border: 0; border-top: 1px solid var(--border); background: transparent; text-align: left; }
.compact-row-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.compact-row-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.compact-row-copy small { color: var(--muted); font-size: 10px; }
.compact-row > svg { width: 14px; color: var(--muted); }
.speed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.speed-item { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 14px; border-radius: 13px; background: var(--surface-strong); }
.speed-arrow { grid-row: 1 / span 2; font-size: 24px; color: var(--cyan); }
.speed-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.speed-item small { color: var(--muted); font-size: 9px; }
.number-item { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.number-item strong { font-size: 20px; }

.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin: 2px 0 20px; }
.page-intro > div { max-width: 760px; }
.page-intro h2 { font-size: 29px; }
.intro-actions, .connection-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.service-quick-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted-strong); font-size: 10px; font-weight: 650; white-space: nowrap; }
.service-quick-button:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
.service-quick-button svg { width: 15px; height: 15px; }
.request-list, .torrent-list { overflow: hidden; }
.request-row, .library-row, .torrent-row { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 14px 18px; border-top: 1px solid var(--border); }
.request-row:first-child, .torrent-row:first-child { border-top: 0; }
.media-marker, .watched-marker { flex: 0 0 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-bright); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.media-tv { background: rgba(78,216,199,.1); color: var(--cyan); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.row-main span { color: var(--muted); font-size: 10px; }
.request-status { padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.request-1 { background: rgba(245,185,91,.1); color: var(--amber); }
.request-2 { background: rgba(75,211,154,.1); color: var(--green); }
.request-3 { background: rgba(241,109,122,.1); color: var(--red); }
.row-actions { display: flex; gap: 7px; }

.connection-empty { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-xl); background: var(--surface); }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-bright); }
.connection-empty h2 { margin: 0 0 5px; font-size: 20px; }
.connection-empty p { max-width: 570px; margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.connection-actions { justify-content: center; }
.bulk-action-bar { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 13px; padding: 11px 13px; border: 1px solid rgba(120,104,248,.2); border-radius: 13px; background: linear-gradient(90deg, var(--accent-soft), var(--surface)); }
.bulk-action-copy { min-width: 0; display: grid; }
.bulk-action-copy strong { font-size: 11px; }
.bulk-action-copy span { color: var(--muted); font-size: 9px; }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.bulk-actions .secondary-button { min-height: 33px; padding: 0 11px; font-size: 10px; }
.bulk-actions select { min-height: 33px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-strong); color: var(--text); font-size: 10px; }
.read-only-notice { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 10px; }
.read-only-notice svg { width: 16px; color: var(--accent-bright); }
.selection-control { flex: 0 0 auto; display: inline-grid; place-items: center; cursor: pointer; }
.selection-control input { position: absolute; opacity: 0; pointer-events: none; }
.selection-check { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-strong); }
.selection-control input:checked + .selection-check { border-color: var(--accent); background: var(--accent); }
.selection-control input:checked + .selection-check::after { content: "✓"; color: white; font-size: 11px; font-weight: 800; }
.selection-control input:disabled + .selection-check { opacity: .35; cursor: not-allowed; }
.empty-inline { grid-column: 1 / -1; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: var(--muted); text-align: center; }
.empty-inline svg { margin-bottom: 8px; color: var(--accent-bright); }
.empty-inline strong { color: var(--text); font-size: 12px; }
.empty-inline span { font-size: 10px; }

.library-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.library-panel { padding: 18px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 13px; }
.library-row { min-height: 61px; padding: 11px 2px; }
.library-row.is-clickable { cursor: pointer; border-radius: 11px; transition: background .16s ease, box-shadow .16s ease, border-color .16s ease; }
.library-row.is-clickable:hover { background: var(--surface-hover); }
.library-row.is-clickable:focus-visible { outline: 0; background: var(--surface-hover); box-shadow: 0 0 0 3px var(--accent-soft); }
.availability-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; }
.availability-dot.is-available { background: var(--green); box-shadow: 0 0 0 4px rgba(75,211,154,.09); }
.availability-dot.is-missing { background: var(--amber); box-shadow: 0 0 0 4px rgba(245,185,91,.09); }
.availability-dot.is-tracker-available { background: var(--accent-bright); box-shadow: 0 0 0 4px var(--accent-soft); }
.availability-dot.is-downloading { background: var(--cyan); box-shadow: 0 0 0 4px rgba(78,216,199,.1); }
.availability-dot.is-download-error { background: var(--red); box-shadow: 0 0 0 4px rgba(241,109,122,.1); }
.library-download-badge { width: fit-content; display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 4px 7px; border-radius: 999px; background: rgba(78,216,199,.1); color: var(--cyan) !important; font-size: 8px !important; font-weight: 750; }
.library-download-badge svg { width: 11px; height: 11px; }
.library-download-badge > span { color: inherit !important; font-size: inherit !important; }
.library-download-badge.has-error { background: rgba(241,109,122,.1); color: var(--red) !important; }
.library-tracker-badge { width: fit-content; display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 4px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-bright) !important; font-size: 8px !important; font-weight: 750; }
.library-tracker-badge svg { width: 11px; height: 11px; }
.library-tracker-badge > span { color: inherit !important; font-size: inherit !important; }
.library-tracker-badge.has-warnings { background: rgba(245,185,91,.1); color: var(--amber) !important; }
.library-tracker-badge.is-empty { background: var(--surface-strong); color: var(--muted) !important; }
.library-tracker-badge.has-error { background: rgba(241,109,122,.1); color: var(--red) !important; }

.transfer-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.transfer-strip .speed-item { border: 1px solid var(--border); background: var(--surface); }
.torrent-main { flex: 1; min-width: 0; }
.torrent-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.torrent-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.torrent-state { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.progress-track { width: 100%; height: 5px; display: block; overflow: hidden; border: 0; border-radius: 99px; background: var(--surface-strong); appearance: none; }
.progress-track::-webkit-progress-bar { border-radius: inherit; background: var(--surface-strong); }
.progress-track::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.progress-track::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.torrent-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.servarr-queue-panel { margin-bottom: 16px; padding: 18px; }
.queue-panel-description { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.queue-panel-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.queue-count { padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-bright); font-size: 9px; font-weight: 750; }
.queue-count.has-error { background: rgba(241,109,122,.1); color: var(--red); }
.servarr-queue-list { display: grid; gap: 8px; }
.servarr-queue-row { display: grid; grid-template-columns: auto minmax(190px, 1fr) minmax(110px, 180px) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }
.servarr-queue-row.has-warning { border-color: color-mix(in srgb, var(--amber) 38%, var(--border)); }
.servarr-queue-row.has-error { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); background: linear-gradient(90deg, rgba(241,109,122,.045), var(--bg-elevated)); }
.queue-service { padding: 5px 7px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 800; letter-spacing: .05em; }
.queue-service-sonarr { background: rgba(78,216,199,.1); color: var(--cyan); }
.queue-item-copy { min-width: 0; display: grid; }
.queue-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.queue-item-copy span, .queue-item-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.queue-item-copy .queue-message { margin-top: 4px; color: var(--amber); }
.has-error .queue-item-copy .queue-message { color: var(--red); }
.queue-progress { min-width: 0; display: flex; align-items: center; gap: 8px; }
.queue-progress .progress-track { flex: 1; }
.queue-progress span { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.queue-row-actions { justify-content: flex-end; flex-wrap: wrap; }
.torrent-advanced { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.torrent-advanced > h3, .torrent-advanced-heading h3 { margin: 0; font-size: 14px; }
.torrent-advanced > p, .torrent-advanced-heading p { margin: 4px 0 12px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.torrent-advanced-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.torrent-advanced-heading > strong { color: var(--muted-strong); font-size: 10px; white-space: nowrap; }
.torrent-advanced-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(230px, .6fr); gap: 14px; }
.torrent-files, .torrent-trackers { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }
.torrent-files h4, .torrent-trackers h4 { margin: 0 0 9px; font-size: 11px; }
.torrent-file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.torrent-file-row.is-skipped { opacity: .62; }
.torrent-file-copy { flex: 1; min-width: 0; display: grid; }
.torrent-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.torrent-file-copy span { color: var(--muted); font-size: 8px; }
.torrent-tracker-row { display: grid; padding: 9px 0; border-top: 1px solid var(--border); }
.torrent-tracker-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.torrent-tracker-row span { color: var(--muted); font-size: 8px; }
.tracker-status-4 strong { color: var(--green); }
.tracker-status-2 strong, .tracker-status-3 strong { color: var(--amber); }

.indexer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.indexer-card { padding: 17px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.indexer-top { display: flex; align-items: center; gap: 9px; }
.indexer-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.protocol-pill { padding: 3px 7px; border-radius: 999px; background: var(--surface-strong); color: var(--muted); font-size: 8px; text-transform: uppercase; }
.indexer-card p { margin: 11px 0 0; color: var(--muted); font-size: 10px; }

.watched-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.watched-card { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.watched-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.watched-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.watched-copy span { color: var(--muted); font-size: 10px; }
.watched-controls { display: flex; gap: 7px; }
.watched-controls select { width: 115px; }

.settings-form { display: grid; gap: 14px; }
.settings-card, .integration-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.settings-fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: var(--muted-strong); font-size: 10px; font-weight: 650; }
.field input, .field select, .watched-controls select {
  width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-strong); color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .watched-controls select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.integration-list { display: grid; gap: 12px; }
.integration-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.integration-identity { display: flex; align-items: center; gap: 11px; }
.integration-identity h3 { margin: 0; font-size: 14px; }
.integration-identity p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.integration-footer { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border); }
.toggle-field { display: inline-flex; align-items: center; gap: 9px; color: var(--muted-strong); font-size: 10px; cursor: pointer; }
.toggle-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 35px; height: 20px; border-radius: 99px; background: var(--surface-strong); border: 1px solid var(--border); transition: background .16s ease; }
.switch::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: transform .16s ease, background .16s ease; }
.toggle-field input:checked + .switch { background: var(--accent-soft); border-color: rgba(120,104,248,.35); }
.toggle-field input:checked + .switch::after { transform: translateX(15px); background: var(--accent-bright); }
.toggle-field.danger { color: var(--red); }
.settings-actions { position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 4px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 90%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.settings-message { margin-right: auto; color: var(--muted); font-size: 11px; }

.automation-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.automation-status { display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.automation-status-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-strong); color: var(--muted-strong); }
.automation-status-icon svg { width: 18px; height: 18px; }
.automation-status.tone-success .automation-status-icon { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.automation-status.tone-warning .automation-status-icon { color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.automation-status div { min-width: 0; display: grid; gap: 2px; }
.automation-status small, .automation-status span { color: var(--muted); font-size: 10px; }
.automation-status strong { font-size: 14px; }
.automation-runtime-error { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--red) 35%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--red) 8%, transparent); color: var(--red); font-size: 10px; }
.automation-runtime-error svg { flex: 0 0 17px; width: 17px; height: 17px; }
.automation-form { display: grid; gap: 14px; margin-top: 14px; }
.automation-section { padding: 20px; }
.automation-section .panel-heading { margin-bottom: 17px; }
.automation-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.automation-rules { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.automation-schedule-grid, .automation-artifact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.automation-schedule-fields { margin: 15px 0; }
.automation-secret-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 13px; margin: 15px 0; }
.smart-search-plan { margin-bottom: 14px; }
.smart-search-plan .section-heading { align-items: center; margin-bottom: 16px; }
.smart-search-plan .section-heading > div { max-width: 720px; }
.smart-plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.smart-plan-summary .speed-item { padding: 11px 13px; border: 1px solid var(--border); background: var(--bg-elevated); }
.smart-plan-summary .number-item strong { font-size: 16px; }
.smart-plan-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.smart-plan-list > .empty-inline { grid-column: 1 / -1; }
.smart-plan-item { min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 11px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-strong); }
.smart-plan-item.is-cooling { opacity: .7; }
.smart-plan-poster { position: relative; width: 44px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--bg-elevated); color: var(--muted); font-size: 7px; }
.smart-plan-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.smart-plan-poster.has-image .poster-fallback { display: none; }
.smart-plan-copy { min-width: 0; display: grid; gap: 3px; }
.smart-plan-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.smart-plan-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.smart-plan-copy > span, .smart-plan-copy small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 7px; font-weight: 750; }
.plan-badge.is-next { background: var(--accent-soft); color: var(--accent-bright); }
.smart-plan-more { margin: 12px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
.smart-search-settings .automation-rules { margin-bottom: 15px; }
.smart-search-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 15px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--green) 25%, var(--border)); border-radius: 11px; background: color-mix(in srgb, var(--green) 6%, transparent); color: var(--muted-strong); font-size: 9px; }
.smart-search-note svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--green); }
.recommendation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.recommendation-item { min-width: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-strong); color: var(--text); }
.recommendation-item:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.recommendation-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--accent-bright); background: var(--accent-soft); }
.recommendation-item.severity-error .recommendation-icon { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.recommendation-item.severity-success .recommendation-icon { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.recommendation-icon svg, .recommendation-item > svg { width: 16px; height: 16px; }
.recommendation-copy { min-width: 0; display: grid; gap: 2px; }
.recommendation-copy strong { font-size: 11px; }
.recommendation-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.automation-artifact-grid { margin-top: 14px; }
.artifact-list { display: grid; gap: 8px; }
.artifact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.artifact-row:first-child { border-top: 0; }
.artifact-row > div { min-width: 0; display: grid; gap: 2px; }
.artifact-row strong { font-size: 11px; }
.artifact-row span { color: var(--muted); font-size: 10px; }
.artifact-row .secondary-button { min-height: 34px; padding: 0 11px; text-decoration: none; }

.admin-section { margin-top: 16px; }
.admin-panel { padding: 20px; }
.admin-status-grid { margin-bottom: 12px; }
.diagnostic-file-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.diagnostic-file { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-strong); }
.diagnostic-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.diagnostic-file > span:not(.status-pill) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.diagnostic-file .status-pill { grid-column: 2; grid-row: 1 / span 2; }
.metric-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.metric-history-card { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-strong); }
.metric-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.metric-history-head span, .metric-history-card > small { color: var(--muted); font-size: 9px; }
.metric-history-head strong { font-size: 14px; }
.metric-sparkline { width: 100%; height: 92px; margin: 12px 0 5px; overflow: visible; }
.metric-sparkline polyline { fill: none; stroke: var(--accent-bright); stroke-width: 2; vector-effect: non-scaling-stroke; }
.compact-select { min-height: 36px; margin-left: auto; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-strong); color: var(--text); }
.admin-user-list, .extension-list { display: grid; gap: 10px; }
.admin-user-card { display: grid; grid-template-columns: minmax(170px, .75fr) minmax(360px, 1.8fr) auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-strong); }
.admin-user-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.admin-user-identity .user-avatar { flex: 0 0 36px; width: 36px; height: 36px; }
.admin-user-identity > div { min-width: 0; display: grid; }
.admin-user-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.admin-user-identity small { color: var(--muted); font-size: 9px; }
.admin-user-fields { display: grid; grid-template-columns: 1fr 1.35fr auto; align-items: end; gap: 10px; }
.admin-row-actions { display: flex; gap: 7px; }
.admin-create-form, .extension-create-form { display: grid; gap: 13px; margin-top: 15px; padding-top: 17px; border-top: 1px solid var(--border); }
.admin-create-form h3, .extension-create-form h3 { margin: 0; font-size: 13px; }
.admin-create-form > button, .extension-create-form > button { justify-self: end; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 10px 3px; border-top: 1px solid var(--border); }
.audit-row:first-child { border-top: 0; }
.audit-copy { min-width: 0; display: grid; }
.audit-copy strong { font-size: 11px; }
.audit-copy span, .audit-row time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.extension-card { padding: 17px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-strong); }
.extension-title { min-width: 0; display: grid; }
.extension-title strong { font-size: 13px; }
.extension-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.extension-card .settings-fields input, .extension-card .settings-fields select { background: var(--surface-solid); }

.pwa-settings-card { display: grid; gap: 15px; }
.pwa-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pwa-settings-heading > div { min-width: 0; }
.pwa-settings-heading h3 { margin: 0 0 5px; font-size: 16px; }
.pwa-settings-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; }
.pwa-settings-status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-bright); font-size: 12px; font-weight: 700; }
.pwa-preference-stats, .pwa-settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.pwa-preference-stats span { padding: 8px 10px; border-radius: 10px; background: var(--surface-strong); color: var(--muted-strong); font-size: 13px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 420px; display: flex; align-items: center; gap: 9px; padding: 13px 15px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); transform: translateY(10px); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast svg { flex: 0 0 auto; width: 17px; color: var(--green); }
.toast-error svg { color: var(--red); }
.toast span { font-size: 11px; }
.toast-action { margin-left: auto; padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-strong); color: var(--accent-bright); font-size: 10px; font-weight: 750; pointer-events: auto; }
.sidebar-backdrop { display: none; }

.collection-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto auto auto; gap: 8px; margin: 0 0 13px; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.collection-toolbar input, .collection-toolbar select { min-width: 0; min-height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-strong); color: var(--text); outline: 0; }
.collection-toolbar input:focus, .collection-toolbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.collection-toolbar .icon-button { min-height: 40px; }
.collection-filter-reset { min-height: 40px; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pagination > span { color: var(--muted); font-size: 10px; text-align: center; }
.pagination .secondary-button { min-height: 36px; padding: 0 12px; font-size: 10px; }

.mobile-bottom-nav { display: none; }

.command-dialog { width: min(720px, calc(100vw - 28px)); max-height: min(680px, calc(100vh - 28px)); margin: 8vh auto auto; padding: 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface-solid); color: var(--text); box-shadow: 0 35px 110px rgba(0,0,0,.58); }
.command-dialog::backdrop, .side-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(3,4,9,.72); backdrop-filter: blur(6px); }
.command-shell { display: flex; flex-direction: column; max-height: min(680px, calc(100vh - 28px)); }
.command-search { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.command-search > svg { color: var(--accent-bright); }
.command-search input { width: 100%; min-height: 43px; border: 0; background: transparent; color: var(--text); font-size: 15px; outline: 0; }
.command-search input::placeholder { color: var(--muted); }
.command-results { min-height: 160px; overflow: auto; padding: 8px; }
.command-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text); text-align: left; }
.command-item:hover, .command-item.is-selected { border-color: rgba(120,104,248,.2); background: var(--accent-soft); }
.command-icon { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-strong); color: var(--accent-bright); }
.command-icon svg { width: 16px; }
.command-copy { flex: 1; min-width: 0; display: grid; }
.command-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.command-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.command-item > svg { width: 14px; color: var(--muted); }
.command-help { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.command-help span { display: inline-flex; align-items: center; gap: 4px; }

.side-dialog { width: min(460px, 100vw); max-width: none; height: 100vh; max-height: none; margin: 0 0 0 auto; padding: 0; overflow: hidden; border: 0; border-left: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text); }
.side-dialog-shell { height: 100%; display: flex; flex-direction: column; }
.side-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 24px 20px; border-bottom: 1px solid var(--border); }
.side-dialog-header h2 { margin: 5px 0 0; font-size: 22px; }
.activity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 20px; border-bottom: 1px solid var(--border); }
.activity-toolbar > span { min-width: 0; color: var(--muted); font-size: 9px; }
.activity-list { flex: 1; overflow: auto; padding: 10px 20px 24px; }
.activity-row { display: flex; align-items: flex-start; gap: 11px; padding: 13px 2px; border-bottom: 1px solid var(--border); }
.activity-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-bright); }
.activity-icon svg { width: 15px; }
.activity-error .activity-icon { background: rgba(241,109,122,.1); color: var(--red); }
.activity-row > div { min-width: 0; display: grid; }
.activity-row strong { overflow-wrap: anywhere; font-size: 11px; }
.activity-row span { color: var(--muted); font-size: 9px; }
.alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 14px 2px; border-bottom: 1px solid var(--border); }
.alert-row.alert-warning .activity-icon { background: rgba(245,185,91,.1); color: var(--amber); }
.alert-row.alert-error .activity-icon { background: rgba(241,109,122,.1); color: var(--red); }
.alert-copy { min-width: 0; display: grid; }
.alert-copy strong { font-size: 11px; }
.alert-copy span { color: var(--muted); font-size: 9px; }
.alert-actions { grid-column: 2; display: flex; align-items: center; gap: 10px; }
.detail-content { flex: 1; overflow: auto; padding: 20px; }
.detail-lead { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.detail-marker { flex: 0 0 50px; width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); }
.detail-marker img { width: 32px; height: 32px; object-fit: contain; }
.detail-lead > div { min-width: 0; display: grid; }
.detail-lead strong { overflow-wrap: anywhere; font-size: 14px; }
.detail-lead span { color: var(--muted); font-size: 10px; }
.detail-overview { margin: 18px 0; color: var(--muted-strong); font-size: 11px; line-height: 1.65; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.detail-tags span { padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.detail-field { min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); }
.detail-field dt { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.detail-field dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 650; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.detail-trigger svg { width: 14px; height: 14px; }
.detail-dialog.is-library-detail { width: min(940px, calc(100vw - 36px)); height: auto; max-height: min(820px, calc(100vh - 36px)); margin: auto; border: 1px solid var(--border-strong); border-radius: 22px; box-shadow: 0 35px 120px rgba(0,0,0,.62); }
.detail-dialog.is-library-detail .side-dialog-shell { height: auto; max-height: min(820px, calc(100vh - 36px)); }
.detail-dialog.is-library-detail .side-dialog-header { padding: 22px 26px 18px; }
.detail-dialog.is-library-detail .side-dialog-header h2 { max-width: 760px; font-size: 27px; letter-spacing: -.035em; }
.detail-dialog.is-library-detail .detail-content { padding: 26px; }
.library-detail-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 28px; }
.detail-poster { position: relative; width: 220px; aspect-ratio: 2 / 3; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 16px; background: linear-gradient(145deg, var(--surface-strong), var(--bg-elevated)); color: var(--muted); box-shadow: 0 18px 45px rgba(0,0,0,.28); }
.detail-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.library-detail-copy { min-width: 0; }
.is-library-detail .detail-lead { gap: 16px; padding-bottom: 20px; }
.is-library-detail .detail-marker { flex-basis: 58px; width: 58px; height: 58px; border-radius: 16px; }
.is-library-detail .detail-marker img { width: 37px; height: 37px; }
.is-library-detail .detail-lead strong { font-size: 19px; }
.is-library-detail .detail-lead span { margin-top: 3px; font-size: 11px; line-height: 1.5; }
.is-library-detail .detail-overview { margin: 20px 0; font-size: 13px; line-height: 1.72; }
.is-library-detail .detail-tags span { padding: 5px 9px; font-size: 9px; }
.is-library-detail .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.is-library-detail .detail-field { padding: 13px; }
.is-library-detail .detail-field dt { font-size: 8px; }
.is-library-detail .detail-field dd { margin-top: 5px; font-size: 11px; }
.is-library-detail .detail-actions { gap: 10px; padding-top: 20px; }

.dashboard-dialog { width: min(760px, calc(100vw - 32px)); }
.dashboard-editor { display: grid; gap: 8px; overflow: auto; padding: 18px 26px; }
.dashboard-editor-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elevated); }
.dashboard-editor-row > input { width: 18px; height: 18px; accent-color: var(--accent); }
.dashboard-editor-copy { min-width: 0; display: grid; }
.dashboard-editor-copy strong { font-size: 11px; }
.dashboard-editor-copy small { color: var(--muted); font-size: 9px; }
.dashboard-editor-row select { min-height: 36px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-strong); color: var(--text); }
.dashboard-order-controls { display: flex; gap: 5px; }
.dashboard-order-controls .icon-button { width: 34px; min-height: 34px; }

.confirm-dialog { width: min(460px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.confirm-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 22px; }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(241,109,122,.1); color: var(--red); }
.confirm-icon svg { width: 19px; }
.confirm-shell h2 { margin: 0; font-size: 18px; }
.confirm-shell p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.confirm-shell footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.context-menu { position: fixed; z-index: 500; width: 245px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); }
.context-menu-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted-strong); text-align: left; font-size: 10px; }
.context-menu-item:hover, .context-menu-item:focus { background: var(--surface-hover); color: var(--text); }
.context-menu-item svg { width: 15px; }

.app-shell[data-density="compact"] .request-row,
.app-shell[data-density="compact"] .library-row,
.app-shell[data-density="compact"] .torrent-row { min-height: 50px; padding-top: 8px; padding-bottom: 8px; }
.app-shell[data-density="compact"] .service-card { min-height: 118px; padding: 14px; gap: 10px; }
.app-shell[data-density="compact"] .compact-row { padding-top: 7px; padding-bottom: 7px; }
.app-shell[data-density="compact"] .discover-card,
.app-shell[data-density="compact"] .indexer-card,
.app-shell[data-density="compact"] .watched-card { padding: 12px; }
.app-shell[data-density="detailed"] .request-row,
.app-shell[data-density="detailed"] .library-row,
.app-shell[data-density="detailed"] .torrent-row { min-height: 76px; padding-top: 18px; padding-bottom: 18px; }

.release-dialog {
  width: min(1050px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}
.release-dialog::backdrop { background: rgba(3,4,9,.76); backdrop-filter: blur(7px); }
.release-dialog-shell { display: flex; flex-direction: column; max-height: min(860px, calc(100vh - 32px)); }
.release-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px 19px; border-bottom: 1px solid var(--border); }
.release-dialog-header h2 { margin: 5px 0 2px; font-size: 23px; letter-spacing: -.035em; }
.release-dialog-header p { margin: 0; color: var(--muted); font-size: 11px; }
.release-search-controls { display: flex; align-items: end; gap: 10px; padding: 14px 26px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.release-search-controls:empty { display: none; }
.release-scope { flex: 1; display: grid; gap: 5px; }
.release-scope > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.release-scope select { width: 100%; min-height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-strong); color: var(--text); }
.release-results { min-height: 230px; overflow: auto; padding: 0 26px 24px; }
.release-loading { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); text-align: center; }
.release-loading .spinner { margin: 0 0 8px; }
.release-loading strong { color: var(--text); font-size: 13px; }
.release-loading small { font-size: 10px; }
.release-row { display: flex; align-items: center; gap: 16px; padding: 16px 2px; border-bottom: 1px solid var(--border); }
.release-row:last-child { border-bottom: 0; }
.release-row.is-rejected { opacity: .82; }
.release-main { flex: 1; min-width: 0; }
.release-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.release-heading > strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.release-badges, .release-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.release-badges { flex: 0 0 auto; justify-content: flex-end; }
.quality-badge { padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 750; white-space: nowrap; }
.release-meta { margin-top: 7px; color: var(--muted); font-size: 9px; }
.release-meta span:not(:last-child)::after { content: "·"; margin-left: 7px; color: var(--border-strong); }
.release-warning { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: var(--amber); font-size: 9px; }
.release-warning svg { flex: 0 0 auto; width: 14px; height: 14px; }
.release-result-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 0; }
.release-result-summary .speed-item { border: 1px solid var(--border); }
.release-filter-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: 8px; position: sticky; z-index: 2; top: 0; padding: 10px 0; background: var(--surface-solid); }
.release-filter-toolbar input, .release-filter-toolbar select { min-width: 0; min-height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-strong); color: var(--text); outline: 0; font-size: 10px; }
.release-filter-toolbar input:focus, .release-filter-toolbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.release-filtered-list { display: grid; }

.discover-search { display: flex; gap: 10px; margin-bottom: 18px; padding: 10px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.discover-search input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--surface-strong); color: var(--text); outline: none; }
.discover-search input:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.discover-search input::placeholder { color: var(--muted); }
.discover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.discover-grid > .empty-inline { grid-column: 1 / -1; min-height: 180px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.discover-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.discover-card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.discover-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.discover-marker { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.discover-marker.media-tv { background: rgba(78,216,199,.1); color: var(--cyan); }
.discover-copy { min-width: 0; }
.discover-heading { display: flex; align-items: center; gap: 8px; }
.discover-heading h3 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.year-pill { padding: 3px 7px; border-radius: 999px; background: var(--surface-strong); color: var(--muted); font-size: 8px; }
.discover-copy p { min-height: 3em; margin: 8px 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: var(--muted-strong); font-size: 10px; line-height: 1.5; }
.discover-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.media-state { padding: 3px 7px; border-radius: 999px; background: var(--surface-strong); }
.media-state.state-2, .media-state.state-3 { color: var(--amber); }
.media-state.state-4 { color: var(--cyan); }
.media-state.state-5 { color: var(--green); }

.media-poster, .request-poster, .library-poster, .discover-result-poster, .discovery-poster {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface-strong), var(--bg-elevated));
  color: var(--muted);
}
.media-poster img, .request-poster img, .library-poster img, .discover-result-poster img, .discovery-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.favorite-button {
  position: absolute;
  z-index: 3;
  top: 7px;
  right: 7px;
  width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
  background: rgba(8,10,17,.78);
  color: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
}
.favorite-button:hover, .favorite-button.is-favorite { border-color: rgba(152,139,255,.7); background: rgba(64,51,153,.9); color: white; }
.favorite-button svg { width: 17px; height: 17px; }
.favorite-button.is-favorite svg { fill: currentColor; }
.row-actions > .favorite-button, .detail-actions > .favorite-button, .discover-card-actions > .favorite-button { position: static; flex: 0 0 auto; }
.favorite-button-text { width: auto; min-height: 40px; display: inline-flex; gap: 8px; padding: 0 12px; }
.favorite-button-text span { font-size: 12px; font-weight: 650; }
.poster-fallback { font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.request-poster { width: 48px; height: 68px; border-radius: 9px; }
.library-poster { width: 42px; height: 60px; border-radius: 8px; }
.discover-result-poster { width: 74px; height: 106px; border-radius: 11px; }

.request-table { overflow: hidden; }
.request-table-head, .request-row { display: grid; grid-template-columns: minmax(310px, 2fr) minmax(130px, .75fr) 110px 95px minmax(190px, auto); align-items: center; gap: 14px; }
.request-table-head { padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.request-row { min-height: 92px; padding: 11px 18px; border-top: 1px solid var(--border); }
.request-table-head + .request-row { border-top: 0; }
.request-content-cell { min-width: 0; display: flex; align-items: center; gap: 12px; }
.request-requester { min-width: 0; display: grid; }
.request-requester strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.request-requester span, .request-date { color: var(--muted); font-size: 9px; }
.request-date { text-transform: capitalize; }
.request-row .row-actions { justify-content: flex-end; }

.discovery-group { margin: 28px 0 38px; }
.discovery-group + .discovery-group { padding-top: 30px; border-top: 1px solid var(--border); }
.favorite-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(145px, 165px); gap: 11px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.favorite-tile { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); scroll-snap-align: start; }
.favorite-poster { position: relative; width: 100%; aspect-ratio: 2 / 3; display: grid; place-items: center; overflow: hidden; background: var(--surface-strong); color: var(--muted); }
.favorite-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.favorite-tile-copy { min-height: 111px; display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.favorite-tile-copy strong { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; line-height: 1.4; }
.favorite-tile-copy span { color: var(--muted); font-size: 10px; }
.favorite-tile-copy .tile-action { min-height: 38px; }
.discovery-rails { display: grid; gap: 26px; }
.discovery-rail-section { min-width: 0; }
.rail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rail-heading h3 { margin: 0; font-size: 14px; }
.rail-heading span { color: var(--muted); font-size: 9px; }
.discovery-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(155px, 175px); gap: 11px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.discovery-rail > .empty-inline { width: min(520px, calc(100vw - 80px)); }
.discovery-tile { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); scroll-snap-align: start; transition: transform .16s ease, border-color .16s ease; }
.discovery-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.discovery-poster { width: 100%; aspect-ratio: 2 / 3; border: 0; border-radius: 0; }
.media-kind-badge { position: absolute; z-index: 1; top: 8px; left: 8px; padding: 4px 7px; border-radius: 999px; background: rgba(8,10,17,.82); color: #d7d2ff; font-size: 7px; font-weight: 850; letter-spacing: .05em; backdrop-filter: blur(7px); }
.media-kind-badge.media-tv { color: #9af4e9; }
.discovery-tile-copy { min-height: 153px; display: flex; flex-direction: column; gap: 7px; padding: 11px; }
.discovery-tile-copy h4 { min-height: 2.8em; margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 11px; line-height: 1.4; }
.discovery-tile-meta { display: flex; gap: 7px; color: var(--muted); font-size: 8px; }
.provider-list { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.provider-chip, .provider-more, .provider-unavailable { max-width: 100%; padding: 3px 6px; overflow: hidden; border-radius: 999px; background: rgba(78,216,199,.09); color: var(--cyan); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.provider-more, .provider-unavailable { background: var(--surface-strong); color: var(--muted); }
.tile-action { width: 100%; min-height: 33px; margin-top: auto; border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 800; }
.tile-action:hover { background: var(--accent); color: white; }
.discovery-loading, .calendar-loading { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); text-align: center; }
.discovery-loading .spinner, .calendar-loading .spinner { margin: 0 0 8px; }
.discovery-loading strong, .calendar-loading strong { color: var(--text); font-size: 13px; }
.discovery-loading span:last-child { font-size: 10px; }
.discover-card { grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; padding: 13px; }
.discover-copy .provider-list { margin-top: 8px; }

.pending-library-panel { margin-bottom: 18px; padding: 18px; border-color: color-mix(in srgb, var(--amber) 26%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 5%, var(--surface)), var(--surface)); }
.pending-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.pending-library-heading-actions { display: flex; align-items: center; gap: 10px; }
.tracker-scan-button { min-height: 38px; padding: 0 12px; font-size: 10px; white-space: nowrap; }
.tracker-scan-button svg { width: 14px; }
.pending-library-heading h3 { margin: 4px 0 1px; font-size: 18px; }
.pending-library-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.pending-count { min-width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(245,185,91,.12); color: var(--amber); font-size: 18px; }
.pending-library-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pending-library-list > .empty-inline { grid-column: 1 / -1; }
.pending-library-list .library-row { padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }
.library-panel .library-list { display: grid; }
.library-row { min-width: 0; }
.library-row .availability-dot { flex: 0 0 7px; }

.calendar-navigation { display: flex; gap: 7px; }
.calendar-navigation .secondary-button:first-child, .calendar-navigation .secondary-button:last-child { width: 40px; padding: 0; font-size: 19px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; margin: -5px 0 13px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-strong); font-size: 9px; }
.legend-item i { width: 9px; height: 9px; border-radius: 3px; background: var(--event-color); }
.event-cinema { --event-color: #f5b95b; --event-bg: rgba(245,185,91,.11); }
.event-streaming { --event-color: #988bff; --event-bg: rgba(120,104,248,.14); }
.event-physical { --event-color: #69a8ff; --event-bg: rgba(80,145,240,.12); }
.event-episode { --event-color: #4ed8c7; --event-bg: rgba(78,216,199,.1); }
.calendar-filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto; gap: 8px; margin-bottom: 13px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.calendar-filter-bar input, .calendar-filter-bar select { min-width: 0; min-height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-strong); color: var(--text); outline: 0; }
.calendar-filter-bar input:focus, .calendar-filter-bar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.calendar-warning { margin: 0 0 10px; color: var(--amber); font-size: 9px; }
.full-calendar-shell { overflow-x: auto; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.calendar-weekdays { min-width: 910px; display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.calendar-weekdays span { padding: 9px 10px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.full-calendar-shell .calendar-grid { min-width: 910px; gap: 0; }
.full-calendar-shell .calendar-grid-day { min-height: 142px; padding: 8px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.full-calendar-shell .calendar-grid-day:nth-child(7n) { border-right: 0; }
.full-calendar-shell .calendar-grid-day:nth-last-child(-n+7) { border-bottom: 0; }
.full-calendar-shell .calendar-grid-day.is-outside { background: color-mix(in srgb, var(--bg) 42%, transparent); opacity: .48; }
.full-calendar-shell .calendar-grid-day.is-today { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.full-calendar-shell .calendar-grid-heading { min-height: 23px; margin-bottom: 3px; }
.full-calendar-shell .calendar-grid-heading strong { width: 24px; height: 24px; display: grid; place-items: center; font-size: 10px; }
.full-calendar-shell .is-today .calendar-grid-heading strong { border-radius: 50%; background: var(--accent); color: white; }
.full-calendar-shell .calendar-grid-event { margin-top: 4px; padding: 6px; border-left-color: var(--event-color); background: var(--event-bg); }
.full-calendar-shell .calendar-grid-event strong { font-size: 8px; }
.full-calendar-shell .calendar-grid-event span { font-size: 7px; }
.calendar-more { display: block; margin-top: 5px; color: var(--muted); font-size: 7px; text-align: center; }

.calendar-list { overflow: hidden; }
.calendar-day { margin: 0; padding: 14px 18px 8px; border-top: 1px solid var(--border); color: var(--accent-bright); font-size: 10px; letter-spacing: .02em; text-transform: capitalize; }
.calendar-day:first-child { border-top: 0; }
.calendar-row { display: grid; grid-template-columns: 70px 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 18px; }
.calendar-time { color: var(--muted); font-size: 9px; }
.calendar-marker { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 800; }
.calendar-marker.media-tv { background: rgba(78,216,199,.1); color: var(--cyan); }
.availability-label { padding: 4px 8px; border-radius: 999px; background: var(--surface-strong); color: var(--muted); font-size: 8px; }
.availability-label.is-available { color: var(--green); }
.availability-label.is-missing { color: var(--amber); }
.view-mode-switcher { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.view-mode-button { min-height: 32px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.view-mode-button:hover, .view-mode-button.is-active { background: var(--accent-soft); color: var(--accent-bright); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-grid-day { min-width: 0; min-height: 125px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.calendar-grid-day.has-events { border-color: var(--border-strong); }
.calendar-grid-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; color: var(--muted); text-transform: capitalize; }
.calendar-grid-heading span { font-size: 8px; text-transform: uppercase; }
.calendar-grid-heading strong { color: var(--text); font-size: 15px; }
.calendar-grid-empty { display: block; color: var(--border-strong); text-align: center; }
.calendar-grid-event { display: grid; gap: 2px; margin-top: 5px; padding: 7px; overflow: hidden; border-left: 2px solid var(--accent); border-radius: 7px; background: var(--accent-soft); }
.calendar-grid-event.media-tv { border-left-color: var(--cyan); background: rgba(78,216,199,.08); }
.calendar-grid-event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.calendar-grid-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 7px; }

.storage-list { display: grid; gap: 12px; padding: 15px 18px 18px; }
.storage-row { display: grid; gap: 6px; }
.storage-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 9px; }
.storage-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-heading span, .storage-row small { color: var(--muted); font-size: 8px; }
.operations-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; }
.storage-summary-list, .queue-summary-list { display: grid; align-content: start; gap: 10px; }
.storage-summary-list h4, .queue-summary-list h4 { margin: 0 0 3px; color: var(--muted-strong); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.storage-summary-row { display: grid; gap: 6px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elevated); }
.storage-summary-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.queue-summary-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elevated); }
.queue-summary-row.has-error { border-color: rgba(241,109,122,.22); }
.queue-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(75,211,154,.1); color: var(--green); }
.has-error .queue-icon { background: rgba(241,109,122,.1); color: var(--red); }
.queue-icon svg { width: 15px; }
.queue-summary-row > div { min-width: 0; display: grid; }
.queue-summary-row strong { font-size: 10px; }
.queue-summary-row span { color: var(--muted); font-size: 8px; }
.queue-summary-row .service-quick-button span { display: none; }
.queue-summary-row .service-quick-button { width: 34px; min-height: 34px; padding: 0; }

.season-dialog { width: min(920px, calc(100vw - 32px)); }
.request-dialog-body { min-height: 330px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; overflow-y: auto; padding: 22px 26px; }
.request-preview { align-self: start; min-width: 0; }
.request-dialog-poster { position: relative; width: 100%; aspect-ratio: 2 / 3; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); color: var(--muted); box-shadow: var(--shadow-soft); }
.request-dialog-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.request-dialog-poster.has-image .poster-fallback { display: none; }
.request-preview-copy { display: grid; gap: 4px; padding-top: 12px; }
.request-preview-copy h3 { margin: 0; overflow: hidden; font-size: 15px; line-height: 1.25; text-overflow: ellipsis; }
.request-preview-copy p { margin: 0; color: var(--muted); font-size: 9px; }
.request-configuration { min-width: 0; display: grid; align-content: start; gap: 22px; }
.request-destination { display: grid; gap: 13px; }
.request-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.request-section-heading > div { display: grid; gap: 3px; }
.request-section-heading strong { font-size: 11px; }
.request-section-heading span { color: var(--muted); font-size: 8px; }
.request-section-heading .text-button { flex: 0 0 auto; }
.request-destination-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.request-field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.request-field:nth-child(2) { grid-column: 1 / -1; }
.request-field > span { color: var(--muted-strong); font-size: 8px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.request-field select { min-width: 0; width: 100%; min-height: 42px; padding: 0 36px 0 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); color: var(--text); font: inherit; font-size: 10px; text-overflow: ellipsis; }
.request-field select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.request-field small { color: var(--muted); font-size: 8px; }
.request-seasons { min-width: 0; display: grid; gap: 12px; }
.request-seasons[hidden] { display: none; }
.season-picker { max-height: 250px; display: grid; gap: 8px; overflow: auto; padding-right: 4px; }
.season-option { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elevated); cursor: pointer; }
.season-option:hover { border-color: var(--border-strong); }
.season-option input { position: absolute; opacity: 0; pointer-events: none; }
.season-check { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-strong); }
.season-option input:checked + .season-check { border-color: var(--accent); background: var(--accent); }
.season-option input:checked + .season-check::after { content: "✓"; color: white; font-size: 11px; font-weight: 800; }
.season-option-copy { display: grid; }
.season-option-copy strong { font-size: 11px; }
.season-option-copy small { color: var(--muted); font-size: 9px; }
.season-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 26px 20px; border-top: 1px solid var(--border); }

.app-shell[data-sidebar="compact"] .sidebar { width: var(--sidebar-compact); }
.app-shell[data-sidebar="compact"] .main-shell { margin-left: var(--sidebar-compact); }
.app-shell[data-sidebar="compact"] .brand-copy,
.app-shell[data-sidebar="compact"] .nav-label,
.app-shell[data-sidebar="compact"] .nav-badge,
.app-shell[data-sidebar="compact"] .nav-section-label span,
.app-shell[data-sidebar="compact"] .sidebar-health-copy,
.app-shell[data-sidebar="compact"] .collapse-button span { display: none; }
.app-shell[data-sidebar="compact"] .brand { justify-content: center; }
.app-shell[data-sidebar="compact"] .nav-item,
.app-shell[data-sidebar="compact"] .collapse-button { justify-content: center; padding: 0; }
.app-shell[data-sidebar="compact"] .sidebar-health { justify-content: center; }
.app-shell[data-sidebar="compact"] .collapse-button svg { transform: rotate(180deg); }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-grid, .indexer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-columns { grid-template-columns: 1fr; }
  .discover-grid { grid-template-columns: 1fr; }
  .operations-grid { grid-template-columns: 1fr; }
  .release-filter-toolbar { grid-template-columns: minmax(180px, 1fr) 1fr; }
  .automation-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  .connection-banner { left: 0; }
  .app-shell[data-sidebar="compact"] .connection-banner { left: 0; }
  .sidebar { width: min(300px, 88vw); transform: translateX(-105%); box-shadow: var(--shadow); }
  .app-shell[data-sidebar="compact"] .sidebar { width: min(300px, 88vw); }
  .app-shell[data-sidebar="compact"] .brand-copy,
  .app-shell[data-sidebar="compact"] .nav-label,
  .app-shell[data-sidebar="compact"] .nav-badge,
  .app-shell[data-sidebar="compact"] .nav-section-label span,
  .app-shell[data-sidebar="compact"] .sidebar-health-copy,
  .app-shell[data-sidebar="compact"] .collapse-button span { display: initial; }
  .app-shell[data-sidebar="compact"] .brand,
  .app-shell[data-sidebar="compact"] .nav-item,
  .app-shell[data-sidebar="compact"] .collapse-button,
  .app-shell[data-sidebar="compact"] .sidebar-health { justify-content: flex-start; }
  .main-shell, .app-shell[data-sidebar="compact"] .main-shell { margin-left: 0; }
  .mobile-menu-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; border: 0; background: rgba(2,3,8,.66); backdrop-filter: blur(3px); }
  .mobile-menu-open .sidebar-backdrop { display: block; }
  .sidebar-close, .menu-button { display: inline-flex; }
  .collapse-button { display: none; }
  .topbar { padding: 10px 16px; }
  .sync-time, .toolbar-button span, .user-button > span:not(.user-avatar) { display: none; }
  .toolbar-button { width: 40px; padding: 0; }
  .user-button { width: 40px; padding: 0; }
  .user-button > svg { display: none; }
  .content { padding: 24px 17px 98px; }
  .mobile-bottom-nav { position: fixed; z-index: 35; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px max(7px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-elevated) 94%, transparent); backdrop-filter: blur(20px); }
  .mobile-bottom-nav button { min-width: 0; display: grid; place-items: center; gap: 2px; padding: 5px 2px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 8px; }
  .mobile-bottom-nav button svg { width: 18px; height: 18px; }
  .mobile-bottom-nav button.is-active { background: var(--accent-soft); color: var(--accent-bright); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-widget.widget-wide { grid-column: auto; }
  .collection-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .collection-toolbar select { grid-column: span 1; }
  .collection-filter-reset { grid-column: 1 / -1; justify-self: start; }
  .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-action-bar { grid-template-columns: auto minmax(0, 1fr); }
  .bulk-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow: auto; padding-bottom: 5px; }
  .request-dialog-body { grid-template-columns: 135px minmax(0, 1fr); gap: 18px; }
  .overview-hero { min-height: 0; }
  .connection-score { display: none; }
  .overview-lower { grid-template-columns: 1fr; }
  .settings-fields.three { grid-template-columns: 1fr; }
  .recommendation-list { grid-template-columns: 1fr; }
  .smart-plan-list { grid-template-columns: 1fr; }
  .detail-dialog.is-library-detail { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
  .detail-dialog.is-library-detail .side-dialog-shell { max-height: calc(100vh - 24px); }
  .library-detail-layout { grid-template-columns: 175px minmax(0, 1fr); gap: 20px; }
  .detail-poster { width: 175px; }
  .is-library-detail .detail-grid { grid-template-columns: 1fr 1fr; }
  .diagnostic-file-grid, .metric-history-grid { grid-template-columns: 1fr; }
  .admin-user-card { grid-template-columns: 1fr; }
  .admin-user-fields { grid-template-columns: 1fr 1fr auto; }
  .admin-row-actions { justify-content: flex-end; }
  .servarr-queue-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .queue-progress, .queue-row-actions { grid-column: 2; }
  .torrent-advanced-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { min-height: 64px; }
  .content { padding: 20px 13px 102px; }
  .mobile-bottom-nav button { min-height: 52px; font-size: 12px; font-weight: 650; }
  .mobile-bottom-nav button svg { width: 20px; height: 20px; }
  .primary-button, .secondary-button, .icon-button, .toolbar-button, .user-button, .primary-small, .danger-small, .icon-text-button { min-height: 44px; }
  .eyebrow { font-size: 11px; }
  .section-heading p, .page-intro p { font-size: 14px; }
  .quick-action-card { min-height: 82px; padding: 12px 10px; }
  .quick-action-copy strong { font-size: 13px; }
  .quick-action-copy small { font-size: 11px; }
  .auth-screen { padding: 13px; }
  .auth-card { padding: 24px 20px; border-radius: 22px; }
  .overview-hero { padding: 28px 22px; }
  .overview-hero h2 { font-size: 32px; }
  .metric-grid, .service-grid, .indexer-grid, .watched-grid, .transfer-strip { grid-template-columns: 1fr; }
  .automation-status-grid, .smart-plan-summary { grid-template-columns: 1fr 1fr; }
  .smart-search-plan .section-heading { align-items: stretch; }
  .smart-search-plan .section-heading > button { width: 100%; }
  .detail-dialog.is-library-detail { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 17px; }
  .detail-dialog.is-library-detail .side-dialog-shell { max-height: calc(100vh - 16px); }
  .detail-dialog.is-library-detail .side-dialog-header { padding: 18px 17px 14px; }
  .detail-dialog.is-library-detail .side-dialog-header h2 { font-size: 22px; }
  .detail-dialog.is-library-detail .detail-content { padding: 17px; }
  .library-detail-layout { grid-template-columns: 1fr; gap: 20px; }
  .detail-poster { width: min(170px, 52vw); justify-self: center; }
  .is-library-detail .detail-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 82px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .intro-actions { width: 100%; justify-content: flex-start; }
  .collection-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .collection-toolbar select { grid-column: 1 / -1; }
  .collection-filter-reset { width: 100%; justify-self: stretch; }
  .pagination { justify-content: space-between; gap: 7px; }
  .pagination > span { font-size: 8px; }
  .global-search-button kbd { display: none; }
  .topbar-actions { gap: 6px; }
  #densityButton { display: none; }
  .release-filter-toolbar { grid-template-columns: 1fr; }
  .release-result-summary { grid-template-columns: 1fr; }
  .bulk-action-bar { grid-template-columns: auto minmax(0, 1fr); }
  .bulk-actions { width: 100%; }
  .detail-trigger span { display: none; }
  .detail-trigger { width: 34px; padding: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .request-row { align-items: flex-start; flex-wrap: wrap; }
  .request-row .row-main { min-width: calc(100% - 62px); }
  .request-status { margin-left: 57px; }
  .row-actions { flex: 1; justify-content: flex-end; }
  .torrent-row { align-items: stretch; flex-direction: column; }
  .torrent-row > button { align-self: flex-end; }
  .watched-card { align-items: flex-start; flex-wrap: wrap; }
  .watched-copy { min-width: calc(100% - 60px); }
  .watched-controls { width: 100%; margin-left: 56px; }
  .watched-controls select { flex: 1; }
  .settings-fields { grid-template-columns: 1fr; }
  .automation-schedule-grid, .automation-artifact-grid { grid-template-columns: 1fr; }
  .automation-secret-row { grid-template-columns: 1fr; }
  .automation-toggle-row { align-items: flex-start; flex-direction: column; }
  .admin-user-fields { grid-template-columns: 1fr; }
  .admin-row-actions { justify-content: stretch; }
  .admin-row-actions button { flex: 1; }
  .audit-row { grid-template-columns: auto minmax(0, 1fr); }
  .audit-row time { grid-column: 2; }
  .settings-actions { bottom: 8px; }
  .settings-message { display: none; }
  .toast-region { right: 10px; bottom: 10px; left: 10px; }
  .toast { min-width: 0; max-width: none; }
  .release-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .release-dialog-shell { max-height: calc(100vh - 16px); }
  .release-dialog-header { padding: 19px 17px 15px; }
  .release-search-controls { align-items: stretch; flex-direction: column; padding: 12px 17px; }
  .release-results { padding: 0 17px 18px; }
  .release-row { align-items: stretch; flex-direction: column; }
  .release-row > button { align-self: flex-end; }
  .release-heading { flex-direction: column; }
  .release-badges { justify-content: flex-start; }
  .discover-search { flex-direction: column; }
  .discover-card { grid-template-columns: auto minmax(0, 1fr); }
  .discover-card > button, .discover-card-actions { grid-column: 2; justify-self: end; }
  .calendar-row { grid-template-columns: 50px 38px minmax(0, 1fr); }
.calendar-row .availability-label { grid-column: 3; justify-self: start; }
  .request-dialog-body { grid-template-columns: 1fr; gap: 16px; padding: 16px 17px; }
  .request-preview { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: end; gap: 12px; }
  .request-dialog-poster { width: 74px; }
  .request-preview-copy { padding: 0 0 3px; }
  .request-destination-fields { grid-template-columns: 1fr; }
  .request-field:nth-child(2) { grid-column: auto; }
  .season-picker { max-height: 220px; padding: 0 2px 0 0; }
  .season-dialog-actions { padding: 13px 17px 17px; flex-direction: column-reverse; }
  .dashboard-editor { padding: 14px 17px; }
  .dashboard-editor-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dashboard-editor-row select { grid-column: 2 / -1; }
  .side-dialog { width: 100vw; }
  .command-dialog { margin-top: 8px; }
  .servarr-queue-panel { padding: 14px; }
  .servarr-queue-panel .panel-title-row { align-items: flex-start; }
  .queue-panel-summary { justify-content: flex-start; }
  .servarr-queue-row { grid-template-columns: 1fr; }
  .queue-service { width: fit-content; }
  .queue-progress, .queue-row-actions { grid-column: 1; }
  .queue-row-actions { justify-content: flex-start; }
  .torrent-advanced-heading { display: grid; }
  .torrent-advanced-heading > strong { white-space: normal; }
  .torrent-file-row { align-items: flex-start; flex-wrap: wrap; }
  .torrent-file-row > button { margin-left: auto; }
  .activity-toolbar { align-items: flex-start; flex-direction: column; }
  .pwa-settings-heading { flex-direction: column; }
  .pwa-settings-actions > button { flex: 1 1 100%; }
}

@media (max-width: 1100px) {
  .request-table-head { display: none; }
  .request-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px 14px; }
  .request-content-cell { grid-column: 1 / -1; }
  .request-requester { grid-column: 1; }
  .request-date { grid-column: 2; }
  .request-row .request-status { grid-column: 3; }
  .request-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 840px) {
  .pending-library-list { grid-template-columns: 1fr; }
  .calendar-filter-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .calendar-filter-bar select { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .request-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 12px; }
  .request-content-cell { grid-column: 1 / -1; }
  .request-row .row-main { min-width: 0; }
  .request-requester { grid-column: 1; }
  .request-date { grid-column: 2; }
  .request-row .request-status { grid-column: 1; margin-left: 0; justify-self: start; }
  .request-row .row-actions { grid-column: 2; justify-content: flex-end; }
  .request-row .row-actions .primary-small, .request-row .row-actions .danger-small { padding: 0 8px; }
  .pending-library-panel { padding: 13px; }
  .pending-library-heading { align-items: flex-start; }
  .pending-library-heading-actions { flex-direction: column-reverse; align-items: flex-end; }
  .pending-library-list .library-row, .library-panel .library-row { align-items: flex-start; flex-wrap: wrap; }
  .library-row .row-main { flex-basis: calc(100% - 78px); }
  .library-row .row-actions { width: 100%; justify-content: flex-end; }
  .discover-card { grid-template-columns: 62px minmax(0, 1fr); align-items: start; }
  .discover-result-poster { width: 62px; height: 89px; }
  .discover-card > button, .discover-card-actions { grid-column: 2; }
  .calendar-navigation { width: 100%; }
  .calendar-navigation .secondary-button:nth-child(2) { flex: 1; }
  .calendar-filter-bar { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 430px) {
  .quick-action-grid { grid-template-columns: 1fr; }
  .quick-action-card { min-height: 68px; }
  .connection-banner { justify-content: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
