:root {
  color-scheme: dark;
  --bg: #080c16;
  --sidebar: #0c1120;
  --surface: #101726;
  --surface-2: #141d2e;
  --surface-3: #1a2538;
  --border: #202c40;
  --border-soft: #192337;
  --text: #f2f5fb;
  --muted: #8b96aa;
  --dim: #5e6980;
  --cyan: #43c8e6;
  --cyan-soft: #123441;
  --violet: #9e7bff;
  --green: #57d6a1;
  --amber: #f5b85c;
  --red: #f26d7d;
  --shadow: 0 16px 50px #02050c55;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, #19284b55, transparent 35%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #0c1221, #090e1a);
  z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 10px 24px; }
.sidebar-brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.sidebar-brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.guardian-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #43617a;
  border-radius: 11px;
  color: #061018;
  background: linear-gradient(135deg, var(--cyan), #7e8cff);
  box-shadow: 0 0 25px #43c8e633;
  font-weight: 900;
}
.guardian-logo.large { width: 54px; height: 54px; margin-bottom: 18px; font-size: 22px; }
.main-nav { display: grid; gap: 4px; }
.nav-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: .18s ease;
}
.nav-link i { font-style: normal; color: var(--dim); font-size: 17px; text-align: center; }
.nav-link:hover { color: var(--text); background: #151d2d; }
.nav-link.active { color: var(--text); background: #182337; box-shadow: inset 3px 0 var(--cyan); }
.nav-link.active i { color: var(--cyan); }
.nav-badge { min-width: 20px; padding: 2px 6px; border-radius: 999px; color: #061018; background: var(--cyan); font-size: 10px; text-align: center; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 0; border-top: 1px solid var(--border-soft); }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-chip > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #0a111c; background: var(--green); font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.app-content { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: #080c16e8;
  backdrop-filter: blur(16px);
  z-index: 15;
}
.global-search {
  width: min(440px, 50vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #0c1220;
}
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.global-search kbd { padding: 3px 6px; border: 1px solid #2d394e; border-radius: 4px; color: var(--dim); background: #121a29; font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: #0e1523; }
.icon-button:hover { color: var(--text); border-color: #3b4b63; }
.notification-button { position: relative; font-size: 8px; }
.notification-button b { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.system-status { display: flex; align-items: center; gap: 8px; margin-left: 6px; padding: 7px 10px; border: 1px solid #244837; border-radius: 999px; color: var(--green); background: #10231c; font-size: 11px; }
.system-status i, .service-list i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.system-status.degraded { color: var(--amber); border-color: #5f4827; background: #271e11; }

.views { width: min(1540px, 100%); margin: 0 auto; padding: 30px; }
.view { display: none; animation: reveal .22s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.page-header { min-height: 78px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin: 5px 0 4px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.045em; }
.page-header p, .card-header p { margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.header-actions { display: flex; gap: 9px; }
.primary-button, .secondary-button, .text-button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 7px;
  font-weight: 700;
}
.primary-button { border: 1px solid var(--cyan); color: #071018; background: var(--cyan); }
.primary-button:hover { background: #72dcf2; }
.secondary-button { border: 1px solid #344159; color: var(--text); background: #131b2a; }
.text-button { min-height: 30px; padding: 0; border: 0; color: var(--cyan); background: transparent; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 13px; }
.metric-card, .card, .mini-metrics article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #111827, #0e1421);
  box-shadow: var(--shadow);
}
.metric-card { position: relative; min-height: 126px; display: flex; align-items: flex-start; gap: 13px; padding: 20px; overflow: hidden; }
.metric-card span, .mini-metrics span { display: block; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin: 6px 0 3px; font-size: 25px; letter-spacing: -.04em; }
.metric-card small { color: var(--dim); }
.metric-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 9px; font-size: 17px; }
.metric-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }
.metric-icon.violet { color: var(--violet); background: #2a2145; }
.metric-icon.amber { color: var(--amber); background: #352716; }
.metric-icon.red { color: var(--red); background: #391b25; }
.progress { position: absolute; left: 20px; right: 20px; bottom: 16px; height: 4px; border-radius: 999px; background: #222c3e; overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); }

.dashboard-actions { display: flex; align-items: center; gap: 14px; }
.dashboard-clock { color: var(--cyan); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(380px, 1.45fr) minmax(260px, .72fr) minmax(285px, .8fr);
  align-items: start;
  gap: 13px;
}
.cockpit-main, .cockpit-center, .cockpit-rail { display: grid; gap: 13px; min-width: 0; }
.live-card { min-height: 310px; }
.guardian-brain { min-height: 310px; }
.live-indicator { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.brain-terminal {
  min-height: 172px;
  padding: 17px;
  border: 1px solid #1b5a43;
  border-radius: 8px;
  color: #a9ffd2;
  background:
    repeating-linear-gradient(0deg, #092419, #092419 2px, #0a2a1d 2px, #0a2a1d 4px);
  box-shadow: inset 0 0 35px #0006;
}
.brain-terminal strong { color: var(--green); font-size: 10px; letter-spacing: .08em; }
.brain-terminal p { margin: 18px 0 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.65; }
.brain-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.brain-stats span { padding: 10px; border: 1px solid var(--border); background: #0b1220; }
.brain-stats small, .brain-stats strong { display: block; }
.brain-stats small { color: var(--dim); font-size: 8px; }
.brain-stats strong { margin-top: 6px; color: var(--cyan); font-size: 10px; }
.dashboard-media-grid { display: grid; grid-template-columns: repeat(5, minmax(82px, 1fr)); gap: 9px; }
.dashboard-media-card { min-width: 0; padding: 0; border: 0; color: var(--text); background: transparent; text-align: left; }
.dashboard-media-card > span {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101a2a;
}
.dashboard-media-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .2s ease; }
.dashboard-media-card:hover img { transform: scale(1.04); }
.dashboard-media-card strong, .dashboard-media-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-media-card strong { margin-top: 8px; font-size: 11px; }
.dashboard-media-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.dashboard-poster-fallback { height: 100%; display: grid; place-items: center; color: var(--cyan); font-size: 28px; font-weight: 900; }
.card { min-width: 0; padding: 19px; }
.span-two { min-height: 300px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-header h2 { margin: 3px 0 0; font-size: 17px; }
.status-copy { color: var(--muted); font-size: 11px; }
.empty-state { min-height: 240px; display: grid; place-items: center; align-content: center; padding: 25px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 210px; }
.empty-state strong { color: var(--text); font-size: 14px; }
.empty-state p { max-width: 430px; margin: 7px 0 0; line-height: 1.55; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 12px; border: 1px solid #2d3c53; border-radius: 50%; color: var(--cyan); background: #111c2b; font-size: 20px; }
.service-list { display: grid; gap: 8px; }
.service-item { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0c1320; }
.service-item.online { color: var(--green); }
.service-item.degraded { color: var(--amber); }
.service-item span { color: var(--text); }
.service-item b { font-size: 9px; letter-spacing: .08em; }
.service-list > div { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0c1320; }
.service-list b { color: var(--green); font-size: 9px; letter-spacing: .08em; }
.service-list i.offline, .service-list b.offline { color: var(--muted); box-shadow: none; }
.service-list i.service-available, .service-available { color: var(--green) !important; }
.service-list i.service-degraded, .service-degraded { color: var(--amber) !important; }
.service-list i.service-offline, .service-offline { color: var(--red) !important; }
.service-list i.service-not_configured, .service-not_configured { color: var(--muted) !important; box-shadow: none; }
.service-list i.service-degraded { background: var(--amber); }
.service-list i.service-offline { background: var(--red); }
.service-list i.service-not_configured { background: var(--muted); }
.action-list { display: grid; gap: 8px; }
.action-item { display: grid; grid-template-columns: 74px 1fr; gap: 3px 12px; width: 100%; padding: 12px; border: 1px solid var(--border-soft); border-radius: 8px; color: var(--text); background: #0c1320; text-align: left; }
.action-item:hover { border-color: #3d526e; background: #111b2a; }
.action-item .action-kind { grid-row: 1 / 3; align-self: center; color: var(--amber); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.action-item small { color: var(--muted); }
.action-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0c1320; }
.action-row > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--amber); background: #332515; font-style: normal; }
.action-row strong, .action-row small { display: block; }
.action-row small { margin-top: 3px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid #574628; border-radius: 999px; color: var(--amber); background: #251c10; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.pill.success { color: var(--green); border-color: #295442; background: #10261e; }
.timeline { display: grid; gap: 13px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 11px; }
.timeline-item i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px #43c8e666; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.timeline.large .timeline-item { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }

.hero-search { min-height: 78px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; margin-bottom: 15px; padding: 0 18px; border: 1px solid #2b3a51; border-radius: 12px; background: #111827; box-shadow: var(--shadow); }
.hero-search > span { color: var(--cyan); font-size: 22px; }
.hero-search input { min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
.hero-search button { min-height: 40px; padding: 0 17px; border: 0; border-radius: 7px; color: #071018; background: var(--cyan); font-weight: 800; }
.integration-notice, .safety-banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; padding: 14px 16px; border: 1px solid #29475c; border-radius: 9px; color: #b9dbe4; background: #10202d; }
.integration-notice i, .safety-banner i { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #1e4053; font-style: normal; }
.integration-notice p, .safety-banner p { margin: 3px 0 0; color: var(--muted); line-height: 1.45; }
.safety-banner { border-color: #2b5344; color: #c5f3df; background: #10231d; }
.safety-banner i { background: #1a4837; }
.media-section { margin-top: 28px; }
.media-section > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.media-section h2 { margin: 0; font-size: 19px; }
.tabs, .segmented, .history-filters { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #0c1320; }
.tabs button, .segmented button, .history-filters button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; }
.tabs button.active, .segmented button.active, .history-filters button.active { color: var(--text); background: var(--surface-3); }
.poster-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 13px; }
.media-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #0e1624; box-shadow: var(--shadow); }
.media-poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: linear-gradient(145deg, #17233a, #0a101b); }
.media-poster img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.media-card:hover .media-poster img { transform: scale(1.025); }
.poster-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: #354660; font-size: 44px; font-weight: 900; }
.media-rating { position: absolute; right: 8px; bottom: 8px; padding: 4px 7px; border-radius: 999px; color: #ffd166; background: #050812d9; font-size: 10px; font-weight: 800; }
.media-card-copy { display: grid; gap: 6px; padding: 11px; }
.media-card-copy small { color: var(--muted); font-size: 9px; }
.media-card-copy strong { min-height: 38px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.35; }
.media-card-copy button { width: 100%; min-height: 34px; margin-top: 3px; }
.poster-card { min-width: 0; }
.poster-art { aspect-ratio: 2 / 3; display: flex; align-items: flex-end; padding: 13px; border: 1px solid #2a3650; border-radius: 10px; background: linear-gradient(155deg, var(--poster-a), var(--poster-b)); box-shadow: var(--shadow); overflow: hidden; }
.poster-art span { padding: 4px 7px; border-radius: 999px; color: #fff; background: #050812b8; font-size: 9px; }
.poster-card strong { display: block; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-card small { display: block; margin-top: 3px; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.toolbar-search { min-width: 260px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: #0d1421; }
.toolbar-search input { width: calc(100% - 22px); border: 0; outline: 0; color: var(--text); background: transparent; }
.data-card { padding: 0; overflow: hidden; }
.cross-seed-card { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: center; gap: 18px; margin-top: 13px; }
.cross-seed-card h2 { margin: 5px 0; }
.cross-seed-card p { margin: 0; color: var(--muted); }
.cross-seed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tracker-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tracker-list .pill { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 35%, transparent); }
.cross-seed-activity { display: block; color: var(--muted); margin-top: 10px; }
.download-list { min-width: 0; }
.download-row { grid-template-columns: minmax(220px, 2fr) minmax(130px, 1fr) 110px 90px 110px 100px; }
.download-row > span { min-width: 0; }
.download-row > span:first-child strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-progress { height: 4px; display: block; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #202b3d; }
.row-progress b { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.compact-downloads { display: grid; gap: 8px; }
.compact-download { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 16px; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0c1320; }
.compact-download span { min-width: 0; }
.compact-download strong, .compact-download small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-download small { margin-top: 4px; color: var(--muted); }
.table-row { display: grid; align-items: center; gap: 14px; padding: 13px 17px; border-bottom: 1px solid var(--border-soft); }
.table-row.table-head { grid-template-columns: 2fr 1fr .8fr 1fr .7fr; color: var(--dim); background: #0c1320; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.table-row.download-head { grid-template-columns: 2fr 1.2fr .8fr .6fr .7fr .7fr; color: var(--dim); background: #0c1320; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.mini-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 13px; }
.mini-metrics article { padding: 18px; }
.mini-metrics strong { display: block; margin-top: 7px; font-size: 22px; }
.proposal-grid, .review-list { display: grid; gap: 11px; }
.proposal-card, .review-card { display: grid; grid-template-columns: minmax(180px, 1.5fr) 1fr 40px 1fr auto; align-items: center; gap: 18px; padding: 17px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(145deg, #111827, #0d1421); }
.proposal-card { grid-template-columns: minmax(200px, 1.4fr) minmax(280px, 1fr) auto; }
.review-card { grid-template-columns: minmax(240px, 1.4fr) minmax(260px, 1fr) auto; }
.proposal-main h2, .review-card h2 { margin: 4px 0; font-size: 17px; }
.proposal-main p, .review-card p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.proposal-stats, .review-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.proposal-stats small, .review-meta small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.proposal-stats strong, .review-meta strong { margin-top: 5px; color: var(--text); }
.proposal-card strong, .proposal-card small, .review-card strong, .review-card small { display: block; }
.proposal-card small, .review-card small { margin-top: 4px; color: var(--muted); }
.proposal-card .arrow { color: var(--cyan); font-size: 20px; text-align: center; }
.proposal-actions, .review-actions { display: flex; gap: 7px; }
.proposal-actions button, .review-actions button { min-height: 34px; padding: 0 11px; border: 1px solid #35435a; border-radius: 6px; color: var(--text); background: #151e2d; font-size: 10px; font-weight: 700; }
.review-actions .danger { color: var(--red); border-color: #653241; background: #25131a; }
.danger-button { min-height: 38px; padding: 0 14px; border: 1px solid #713344; border-radius: 7px; color: var(--red); background: #29131b; font-weight: 750; }
.history-filters { width: fit-content; margin-bottom: 8px; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 13px; }
.settings-nav { display: grid; align-content: start; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #0e1522; }
.settings-nav button { min-height: 40px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; }
.settings-nav button.active { color: var(--text); background: var(--surface-3); }
.settings-card + .settings-card { margin-top: 13px; }
.integration-list { display: grid; gap: 8px; }
.module-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.module-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0c1320; }
.module-row p { margin: 4px 0; color: var(--muted); line-height: 1.4; }
.module-row small { color: var(--dim); }
.integration-row, .setting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px; border: 1px solid var(--border-soft); border-radius: 8px; background: #0c1320; }
.integration-row > div, .setting-row > div { min-width: 0; }
.integration-row strong, .integration-row small, .setting-row strong, .setting-row p { display: block; }
.integration-row small, .setting-row p { margin: 4px 0 0; color: var(--muted); }

.library-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 13px; }
.library-summary span { padding: 14px 16px; border: 1px solid var(--border); border-radius: 9px; background: #0e1523; }
.library-summary small, .library-summary strong { display: block; }
.library-summary small { color: var(--dim); font-size: 9px; letter-spacing: .09em; }
.library-summary strong { margin-top: 6px; font-size: 19px; }
.library-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; }
.library-grid > .empty-state { grid-column: 1 / -1; }
.library-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #0e1624; box-shadow: var(--shadow); }
.library-poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #111c2c; }
.library-poster img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .2s ease; }
.library-card:hover .library-poster img { transform: scale(1.035); }
.library-poster > span { position: absolute; left: 8px; bottom: 8px; padding: 4px 7px; border-radius: 99px; color: var(--cyan); background: #050914df; font-size: 8px; font-weight: 800; }
.library-poster-fallback { height: 100%; display: grid; place-items: center; color: #354966; font-size: 42px; font-weight: 900; }
.library-copy { padding: 12px; }
.library-copy > small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.library-copy > strong { min-height: 38px; display: -webkit-box; margin-top: 6px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.35; }
.library-copy p { margin: 6px 0 11px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.library-copy footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-soft); color: var(--text); font-size: 9px; }
.library-copy footer b { color: var(--dim); font-size: 8px; }
.library-copy footer b.monitored { color: var(--green); }

#toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 390px; padding: 12px 15px; border: 1px solid var(--cyan); border-radius: 8px; color: var(--cyan); background: #0d1724; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
#toast.show { opacity: 1; transform: none; }
#toast.error { color: var(--red); border-color: var(--red); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(420px, 100%); padding: 36px; border: 1px solid #2b3950; border-radius: 14px; background: #0e1523; box-shadow: 0 30px 100px #0008; }
.auth-card h1 { margin: 8px 0; font-size: 27px; letter-spacing: -.04em; }
.auth-card p { margin: 0 0 25px; color: var(--muted); }
.auth-card label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.auth-card input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #344159; border-radius: 7px; outline: 0; color: var(--text); background: #090f1a; }
.auth-card input:focus { border-color: var(--cyan); }
.auth-card .primary-button { width: 100%; margin-top: 11px; }
.auth-card small { display: block; min-height: 18px; margin-top: 9px; color: var(--red); }
.request-dialog { width: min(760px, calc(100% - 28px)); padding: 0; border: 1px solid #33445e; border-radius: 14px; color: var(--text); background: #0d1421; box-shadow: 0 30px 100px #000c; }
.request-dialog::backdrop { background: #03060dcc; backdrop-filter: blur(5px); }
.request-card { position: relative; display: grid; grid-template-columns: 230px 1fr; min-height: 350px; }
.request-poster { min-height: 350px; border-radius: 13px 0 0 13px; background-position: center; background-size: cover; background-color: #111c2d; }
.request-poster.empty::after { content: "GUARDIAN"; height: 100%; display: grid; place-items: center; color: #40516b; font-weight: 900; writing-mode: vertical-rl; letter-spacing: .3em; }
.request-copy { align-self: center; padding: 32px; }
.request-copy h2 { margin: 7px 0 10px; font-size: 25px; }
.request-copy > p { max-height: 130px; margin: 0; overflow: auto; color: var(--muted); line-height: 1.55; }
.request-warning { display: grid; gap: 4px; margin-top: 20px; padding: 12px; border: 1px solid #5b4826; border-radius: 8px; color: var(--amber); background: #251c10; }
.request-warning span { color: #b8aa8e; font-size: 11px; line-height: 1.45; }
.dialog-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; color: var(--text); background: #0a101bcc; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .poster-grid { grid-template-columns: repeat(4, 1fr); }
  .proposal-card, .review-card { grid-template-columns: 1.4fr 1fr auto; }
  .proposal-card .arrow, .proposal-card > div:nth-child(4), .review-card > div:nth-child(3) { display: none; }
  .cockpit-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); }
  .cockpit-rail { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .library-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
  .mobile-only { display: grid !important; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-102%); transition: .22s ease; box-shadow: 20px 0 60px #0009; }
  .menu-open .sidebar { transform: none; }
  .topbar { height: 60px; padding: 0 14px; }
  .global-search { width: auto; flex: 1; }
  .global-search kbd, .system-status span { display: none; }
  .system-status { width: 36px; height: 36px; justify-content: center; padding: 0; border-radius: 8px; }
  .views { padding: 20px 14px 90px; }
  .cockpit-grid { display: block; }
  .cockpit-grid .card { margin-bottom: 12px; }
  .cockpit-rail { display: block; }
  .poster-grid { grid-template-columns: repeat(3, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { min-width: max-content; }
  .module-list { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
  .cross-seed-card { grid-template-columns: 1fr; }
  .cross-seed-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .topbar-actions .icon-button:not(#refresh) { display: none; }
  .page-header { display: block; }
  .page-header .primary-button, .page-header .header-actions { margin-top: 15px; }
  .metric-grid, .mini-metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 118px; padding: 15px; }
  .metric-card strong { font-size: 20px; }
  .metric-icon { display: none; }
  .poster-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { display: none; }
  .toolbar { display: block; }
  .toolbar-search { min-width: 0; margin-top: 10px; }
  .table-row.table-head, .table-row.download-head { display: none; }
  .download-row { grid-template-columns: 1fr 90px; gap: 9px; }
  .download-row > span:nth-child(n+3) { display: none; }
  .compact-download { grid-template-columns: 1fr; }
  .proposal-card, .review-card { grid-template-columns: 1fr; gap: 11px; }
  .proposal-actions, .review-actions { width: 100%; }
  .proposal-actions button, .review-actions button { flex: 1; }
  .hero-search { grid-template-columns: 24px 1fr; }
  .hero-search button { display: none; }
  .request-card { grid-template-columns: 1fr; }
  .request-poster { min-height: 210px; border-radius: 13px 13px 0 0; background-position: center 25%; }
  .request-copy { padding: 22px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
  .history-filters { max-width: 100%; overflow-x: auto; }
  .dashboard-actions { justify-content: space-between; width: 100%; margin-top: 15px; }
  .dashboard-media-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-media-card:nth-child(n+4) { display: none; }
  .library-summary { grid-template-columns: 1fr 1fr; }
  .library-grid { grid-template-columns: repeat(2, 1fr); }
}
