:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #111820;
  --panel-2: #151e28;
  --panel-3: #1a2531;
  --border: #263342;
  --border-strong: #33465b;
  --text: #e8eef5;
  --muted: #8fa0b2;
  --muted-2: #66788b;
  --accent: #4ba3ff;
  --accent-strong: #2587ef;
  --accent-soft: rgba(75, 163, 255, .12);
  --success: #45c486;
  --warning: #f2b84b;
  --danger: #ff657a;
  --danger-soft: rgba(255, 101, 122, .12);
  --shadow: 0 14px 34px rgba(0, 0, 0, .24);
  --radius: 14px;
  --radius-sm: 9px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(75, 163, 255, .12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #79baff; }
button, input, select { font: inherit; }
button, input[type="checkbox"], input[type="radio"], select { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 10px 22px;
  background: rgba(11, 15, 20, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #6f67ff);
  color: white; font-weight: 900; font-size: 18px;
  box-shadow: 0 8px 20px rgba(75, 163, 255, .2);
}
.brand strong { display: block; font-size: 15px; line-height: 1.05; letter-spacing: .03em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.topnav { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.nav-link {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: #8dc5ff; }

.account-area { display: flex; align-items: center; gap: 8px; }
.login-form { display: flex; gap: 7px; align-items: center; }
.login-form input { width: 118px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}
.user-chip small { color: var(--muted); font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(69,196,134,.12); }

.app-shell {
  width: min(100%, 2400px);
  margin: 0 auto;
  padding: 22px;
}

.page-heading {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.page-heading h1 { margin: 0; font-size: clamp(23px, 2vw, 30px); line-height: 1.15; letter-spacing: -.03em; }
.page-heading p { margin: 5px 0 0; color: var(--muted); }
.heading-meta { color: var(--muted); font-size: 12px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(21,30,40,.92), rgba(17,24,32,.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filters-panel { position: sticky; top: 90px; max-height: calc(100vh - 112px); overflow-y: auto; }
.panel-header { padding: 16px 16px 13px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 14px; }

.search-stack { display: grid; gap: 10px; }
.input, input[type="text"], input[type="password"], input[type="number"], select {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0d131a;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(75,163,255,.12);
  background: #101820;
}
.search-field { width: 100%; font-size: 14px; }

.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.control-row select { width: 100%; }

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .015em;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-strong); color: white; }
.btn-primary:hover { background: #3597f6; color: white; }
.btn-secondary { background: var(--panel-3); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: #213044; color: white; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); border-color: rgba(255,101,122,.28); color: #ff8d9d; }
.btn-danger:hover { background: rgba(255,101,122,.2); color: #ffc1c9; }
.btn-compact { min-height: 32px; padding: 6px 10px; }
.btn-block { width: 100%; }

.filter-group { border-top: 1px solid var(--border); }
.filter-group:first-of-type { border-top: 0; }
.filter-group summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  color: #cad5e1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  user-select: none;
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: '+'; color: var(--muted-2); font-size: 16px; font-weight: 500; }
.filter-group[open] summary::after { content: '−'; }
.filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 12px 13px; }
.filter-option {
  min-width: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,.015);
}
.filter-option:hover { background: var(--panel-3); color: var(--text); }
.filter-option input { accent-color: var(--accent); }
.filter-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-actions { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.filter-actions .btn { flex: 1; }
.hint { padding: 10px 14px 0; color: var(--muted-2); font-size: 11px; }

.results-panel { min-width: 0; overflow: hidden; }
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}
.results-toolbar-left, .results-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: #0e151d;
  font-size: 11px;
  font-weight: 700;
}
.stat-pill strong { color: var(--text); }

.table-scroll { overflow: auto; max-width: 100%; }
table.rlstable, table.usertable {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
table.rlstable th, table.usertable th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 11px;
  background: #121b24;
  color: #aab9c8;
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
table.rlstable td, table.usertable td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(38,51,66,.78);
  color: #c8d3de;
  vertical-align: middle;
  white-space: nowrap;
}
table.rlstable tbody tr:hover td, table.usertable tbody tr:hover td { background: rgba(75,163,255,.045); }
td.reg, td.alt, td.regdate, td.altdate { text-align: center; }
td.regname, td.altname { text-align: left; }
.release-name { max-width: 760px; font-family: var(--mono); font-size: 11.5px; color: #d8e5f2; overflow: hidden; text-overflow: ellipsis; }
.release-name.nuked { color: var(--danger); }
.release-name.requested { color: var(--warning); }
.section-badge {
  display: inline-flex; align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #8fc7ff;
  font-size: 10px;
  font-weight: 800;
}
.nuke-reason { color: #ff9baa; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.table-muted { color: var(--muted); }

.cell-input, .cell-select {
  min-height: 31px !important;
  padding: 5px 7px !important;
  font-size: 11px !important;
  min-width: 70px;
}
.cell-input.nuke { min-width: 210px; }
.cell-select { min-width: 120px; }

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(9,14,19,.72);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}
.table-footer-actions { display: flex; gap: 8px; align-items: center; }

.notice {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
}
.notice.success { border-color: rgba(69,196,134,.28); background: rgba(69,196,134,.07); color: #9be0bd; }
.notice.error { border-color: rgba(255,101,122,.3); background: rgba(255,101,122,.07); color: #ffb0bb; }

.empty-state { padding: 46px 22px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 16px; }

.requests-wrap { padding: 14px; }
.request-status {
  display: inline-flex; padding: 4px 8px; border-radius: 999px;
  background: var(--panel-3); color: var(--muted); font-weight: 800; font-size: 10px;
}
.request-status.status-0 { background: var(--accent-soft); color: #8fc7ff; }
.request-status.status-2, .request-status.status-3, .request-status.status-4, .request-status.status-5 { background: rgba(69,196,134,.11); color: #8ce0b5; }
.request-status.status-1 { background: var(--danger-soft); color: #ff9baa; }
.inline-form { display: inline; }

.mobile-filter-toggle { display: none; margin-bottom: 12px; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr; }
  .account-area { grid-column: 1 / -1; justify-content: flex-end; }
  .dashboard-grid { grid-template-columns: 250px minmax(0, 1fr); }
  .filter-options { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .topbar { position: relative; padding: 10px 14px; gap: 10px; }
  .brand small { display: none; }
  .topnav { grid-column: 1 / -1; order: 3; }
  .account-area { grid-column: auto; }
  .login-form input { width: 96px; }
  .app-shell { padding: 14px; }
  .dashboard-grid { display: block; }
  .filters-panel { position: static; max-height: none; margin-bottom: 14px; }
  .filters-panel.is-collapsed { display: none; }
  .mobile-filter-toggle { display: inline-flex; }
  .filter-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 560px) {
  .topbar { display: flex; flex-wrap: wrap; }
  .brand-block { flex: 1; }
  .account-area { width: 100%; justify-content: stretch; }
  .login-form { width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; }
  .login-form input { width: 100%; min-width: 0; }
  .user-chip { margin-left: auto; }
  .filter-options { grid-template-columns: 1fr; }
  .control-row { grid-template-columns: 1fr; }
  .results-toolbar, .table-footer { align-items: stretch; flex-direction: column; }
  .results-toolbar-left, .results-toolbar-right, .table-footer-actions { width: 100%; }
  .results-toolbar-right .btn, .table-footer-actions .btn { flex: 1; }
}

/* ================================================================
   RDS V8.1 phone layout
   ================================================================ */
.mobile-nav-toggle,
.mobile-filter-close,
.mobile-actionbar,
.mobile-card-controls { display: none; }

.mobile-nav-backdrop[hidden] { display: none !important; }
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(0,0,0,.58);
}

@media (max-width: 760px) {
  html { background: #090d12; }
  body {
    min-width: 0;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom));
    font-size: 14px;
    background: #090d12;
  }
  body.mobile-nav-open,
  body.filters-open { overflow: hidden; }

  /* Header: deliberately simple on a phone. */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0,1fr) 46px;
    gap: 8px;
    min-height: 60px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    background: rgba(9,13,18,.97);
    border-bottom: 1px solid #1e2833;
    backdrop-filter: blur(14px);
  }
  .brand-block { min-width: 0; display: flex; align-items: center; }
  .brand { gap: 9px; }
  .brand-mark { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }

  .mobile-nav-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #273442;
    border-radius: 11px;
    background: #111821;
  }
  .mobile-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: #dbe6f2;
    transition: transform .18s ease, opacity .18s ease;
  }
  .mobile-nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mobile-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .mobile-nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .topnav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: min(82vw, 330px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: calc(72px + env(safe-area-inset-top)) 12px 22px;
    overflow-y: auto;
    background: #0d131a;
    border-left: 1px solid #26313d;
    box-shadow: -20px 0 48px rgba(0,0,0,.42);
    transform: translateX(105%);
    transition: transform .2s ease;
  }
  .topnav.is-mobile-open { transform: translateX(0); }
  .nav-link {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
  }

  /* Anonymous login is clear and touch-friendly, not squeezed into the nav. */
  .account-area {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
  }
  .login-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 2px;
  }
  .login-form input,
  .login-form .btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    border-radius: 10px;
  }
  .user-chip { min-height: 38px; max-width: calc(100% - 92px); }
  .account-area > .btn { min-height: 38px; }

  .app-shell { width: 100%; padding: 10px; }
  .page-heading { display: none; }
  .dashboard-grid { display: block; }
  .panel { border-radius: 12px; box-shadow: none; }

  /* Search is a sheet on phones, not a giant sidebar above the data. */
  .mobile-filter-toggle {
    display: flex;
    width: 100%;
    min-height: 46px;
    margin: 0 0 10px;
    font-size: 14px;
  }
  .filters-panel { display: none; }
  .filters-panel:not(.is-collapsed) {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    max-height: 100dvh;
    margin: 0;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: #0b1118;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .filters-panel .panel-header {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    background: rgba(11,17,24,.98);
    border-bottom: 1px solid #26313d;
  }
  .filters-panel .panel-header h2 { font-size: 14px; }
  .filters-panel .panel-header p { margin-top: 3px; }
  .mobile-filter-close {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid #2a3745;
    border-radius: 11px;
    background: #121b24;
    color: #eef5fb;
    font-size: 28px;
    line-height: 1;
  }
  .search-stack { padding: 14px; }
  .search-field,
  .control-row select,
  .search-stack .btn { min-height: 48px; font-size: 16px; }
  .control-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter-group summary { min-height: 50px; padding: 13px 14px; font-size: 12px; }
  .filter-options { grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 12px 13px; }
  .filter-option { min-height: 44px; font-size: 12px; }
  .filter-option input[type='checkbox'] { width: 22px; height: 22px; }
  .filter-actions { position: sticky; bottom: 0; background: rgba(11,17,24,.98); }

  /* Results become a release feed. */
  .results-panel { overflow: visible; border: 0; background: transparent; }
  .results-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 0 0 9px;
    border: 0;
    background: transparent;
  }
  .results-toolbar-left,
  .results-toolbar-right {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .results-toolbar-left::-webkit-scrollbar,
  .results-toolbar-right::-webkit-scrollbar { display: none; }
  .stat-pill { flex: 0 0 auto; min-height: 30px; font-size: 11px; }
  .results-toolbar-right .btn { min-height: 34px; }

  .table-scroll { overflow: visible; }
  table.rlstable,
  table.usertable {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
  }
  table.rlstable thead,
  table.usertable thead { display: none; }
  table.rlstable tbody,
  table.usertable tbody {
    display: block;
    padding: 0;
  }
  table.rlstable tbody tr,
  table.usertable tbody tr {
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0,1fr));
    gap: 0;
    margin: 0 0 9px;
    overflow: hidden;
    border: 1px solid #26323f;
    border-radius: 12px;
    background: #101720;
  }
  table.rlstable tbody tr:hover td,
  table.usertable tbody tr:hover td { background: transparent; }

  table.rlstable td,
  table.usertable td {
    display: none;
    min-width: 0;
    padding: 9px 10px;
    white-space: normal;
    border: 0;
    color: #cbd7e3;
  }
  table.rlstable td::before,
  table.usertable td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #708194;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.1;
    text-transform: uppercase;
  }

  /* Primary mobile fields. */
  table.rlstable td.mobile-col-release-name,
  table.usertable td.mobile-col-release-name {
    display: block;
    grid-column: 1 / -1;
    padding: 12px 12px 10px;
    border-bottom: 1px solid #202b36;
  }
  table.rlstable td.mobile-col-release-name::before,
  table.usertable td.mobile-col-release-name::before { display: none; }
  .release-name {
    width: 100%;
    max-width: none;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
    font-size: 13px;
    line-height: 1.42;
  }

  table.rlstable td.mobile-col-request,
  table.rlstable td.mobile-col-section,
  table.rlstable td.mobile-col-age,
  table.rlstable td.mobile-col-size,
  table.usertable td.mobile-col-status,
  table.usertable td.mobile-col-age,
  table.usertable td.mobile-col-user {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    border-right: 1px solid #202b36;
  }
  table.rlstable td.mobile-col-size { border-right: 0; }
  table.rlstable td.mobile-col-request {
    align-items: center;
    min-width: 58px;
  }
  table.rlstable td.mobile-col-request::before { text-align: center; }
  table.rlstable td.mobile-col-request input[type='checkbox'] {
    width: 26px;
    height: 26px;
    accent-color: var(--accent);
  }
  .section-badge { width: fit-content; }

  /* Important nuke information stays visible. Other metadata is expandable. */
  table.rlstable td.mobile-secondary,
  table.usertable td.mobile-secondary { display: none; }
  table.rlstable td.mobile-secondary.mobile-important,
  table.usertable td.mobile-secondary.mobile-important,
  table.rlstable tr.is-expanded td.mobile-secondary,
  table.usertable tr.is-expanded td.mobile-secondary,
  body.edit-mode table.rlstable td,
  body.edit-mode table.usertable td {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    border-top: 1px solid #202b36;
  }
  table.rlstable td.mobile-important { color: #ff9baa; }
  .nuke-reason { max-width: none; overflow: visible; white-space: normal; overflow-wrap: anywhere; }

  .mobile-card-controls {
    display: block;
    grid-column: 1 / -1;
    padding: 0 !important;
    border-top: 1px solid #202b36 !important;
  }
  .mobile-card-controls::before { display: none !important; }
  .mobile-card-more {
    width: 100%;
    min-height: 40px;
    border: 0;
    background: #0c1219;
    color: #8fa3b7;
    font-size: 11px;
    font-weight: 800;
  }

  .cell-input,
  .cell-select,
  .cell-input.nuke {
    width: 100%;
    min-width: 0;
    min-height: 46px !important;
    font-size: 16px !important;
  }

  .table-footer {
    margin-top: 6px;
    padding: 10px 2px 0;
    flex-direction: column;
    align-items: stretch;
    border: 0;
    background: transparent;
  }
  .table-footer-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .table-footer-actions .btn { width: 100%; min-height: 46px; }

  .mobile-actionbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 75;
    display: none;
    padding: 7px;
    border: 1px solid #324153;
    border-radius: 14px;
    background: rgba(13,19,26,.96);
    box-shadow: 0 14px 40px rgba(0,0,0,.42);
    backdrop-filter: blur(14px);
  }
  .mobile-actionbar.is-visible { display: block; }
  .mobile-actionbar .btn { width: 100%; min-height: 48px; font-size: 14px; }

  .notice { margin-bottom: 10px; font-size: 13px; }
  .empty-state { padding: 30px 14px; }
}

@media (max-width: 430px) {
  .control-row,
  .filter-options { grid-template-columns: 1fr; }
  table.rlstable tbody tr,
  table.usertable tbody tr { grid-template-columns: auto repeat(3,minmax(0,1fr)); }
  .stat-pill { font-size: 10px; }
}

/* Phone user-agent override keeps the same feed in landscape. */
@media (min-width: 761px) and (max-width: 1000px) {
  body.device-phone .dashboard-grid { display: block; }
  body.device-phone .page-heading { display: none; }
  body.device-phone .mobile-filter-toggle { display: flex; width: 100%; margin-bottom: 10px; }
  body.device-phone .filters-panel.is-collapsed { display: none; }
}

/* V8.1 mobile final-order/overflow corrections. */
@media (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .topnav { visibility: hidden; pointer-events: none; }
  .topnav.is-mobile-open { visibility: visible; pointer-events: auto; }

  table.rlstable td.mobile-col-release-name { order: 1; }
  table.rlstable td.mobile-col-request { order: 2; }
  table.rlstable td.mobile-col-section { order: 3; }
  table.rlstable td.mobile-col-age { order: 4; }
  table.rlstable td.mobile-col-size { order: 5; }
  table.rlstable td.mobile-secondary { order: 6; }
  table.rlstable td.mobile-secondary.mobile-important { order: 6; }
  table.rlstable td.mobile-card-controls {
    display: block;
    order: 7;
    grid-column: 1 / -1;
  }
}

/* RDS V8.2: performance-only release; V8.1 mobile presentation retained. */

/* ================================================================
   RDS V8.2.4 mobile navigation hardening
   - high-contrast drawer
   - explicit close control
   - guaranteed mobile Requests destination
   ================================================================ */
.mobile-nav-header,
.mobile-nav-requests,
.mobile-requests-shortcut { display: none; }

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto 46px;
  }
  .brand-block { grid-column: 1; }
  .mobile-requests-shortcut {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid #47739f;
    border-radius: 10px;
    background: #eaf4ff;
    color: #0b4f87;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
    white-space: nowrap;
  }
  .mobile-requests-shortcut:hover,
  .mobile-requests-shortcut:focus { background: #ffffff; color: #07385f; }
  .mobile-requests-shortcut.active { background: #d8ebff; color: #07385f; }
  .mobile-nav-toggle { grid-column: 3; }

  .topnav {
    width: min(88vw, 360px);
    padding: calc(12px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
    gap: 8px;
    background: #f7fafc;
    border-left: 1px solid #c7d3df;
    box-shadow: -22px 0 56px rgba(0,0,0,.46);
    color: #14202b;
  }
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin-bottom: 4px;
    padding: 0 2px 10px 4px;
    border-bottom: 1px solid #d8e0e8;
    color: #152331;
    font-size: 16px;
    font-weight: 900;
  }
  .mobile-nav-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #b8c6d3;
    border-radius: 10px;
    background: #ffffff;
    color: #172534;
    font-size: 30px;
    line-height: 1;
  }
  .topnav .nav-link {
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #d3dde6;
    border-radius: 11px;
    background: #ffffff;
    color: #172534;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: .025em;
    box-shadow: 0 1px 2px rgba(12,28,44,.04);
  }
  .topnav .nav-link:hover,
  .topnav .nav-link:focus {
    background: #edf6ff;
    border-color: #8bbbe8;
    color: #083f70;
  }
  .topnav .nav-link.active {
    background: #dceeff;
    border-color: #6aa9e4;
    color: #073d6b;
  }
  .mobile-nav-requests {
    display: flex !important;
    order: -10;
    background: #e3f2ff !important;
    border-color: #6ba8df !important;
    color: #063f70 !important;
  }
  /* Avoid a duplicate Requests entry for sessions already authorized by the desktop nav logic. */
  .topnav .nav-request-authorized { display: none; }
}

/* ================================================================
   RDS V8.2.5 mobile drawer tap/navigation reliability
   ================================================================ */
@media (max-width: 760px) {
  .topnav .nav-link {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(75, 163, 255, .18);
  }
}


/* ================================================================
   RDS V8.2.7 mobile navigation stacking + real-menu correction
   The backdrop must sit behind the sticky header because .topnav is
   a descendant of .topbar and cannot escape its stacking context.
   ================================================================ */
@media (max-width: 760px) {
  /* When the drawer is open, lift the complete header stacking context
     above the backdrop. This makes the visible links the actual tap target. */
  body.mobile-nav-open .topbar { z-index: 90; }
  .mobile-nav-backdrop { z-index: 80; }

  /* V8.2.7 uses only the genuine access-controlled nav links. */
  .mobile-nav-requests { display: none !important; }
  .topnav .nav-request-authorized { display: flex; }

  .topnav {
    z-index: 95;
    background: #f7fafc;
    color: #14202b;
  }
  .topnav .nav-link {
    display: flex;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
    background: #ffffff;
    color: #172534;
  }
}

/* ================================================================
   RDS V8.2.8 mobile navigation full-panel layout
   Show the whole navigation set at once instead of a narrow scrolling drawer.
   ================================================================ */
@media (max-width: 760px) {
  .topnav {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    align-items: stretch;
    gap: 10px;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid #c7d3df;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.48);
    transform: translateY(-12px) scale(.985);
    transform-origin: top center;
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
  }
  .topnav.is-mobile-open {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  .mobile-nav-header {
    grid-column: 1 / -1;
    min-height: 48px;
    margin: 0;
    padding: 0 0 8px 4px;
  }
  .mobile-nav-close {
    width: 42px;
    height: 42px;
  }
  .topnav .nav-link {
    width: 100%;
    min-height: 58px;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
    line-height: 1.15;
    font-size: 14px;
  }
}

@media (min-width: 430px) and (max-width: 760px) {
  .topnav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ================================================================
   RDS V8.3.0 mobile navigation theme restoration
   Restore the original dark RDS palette while keeping V8.2.8's
   full-panel grid and improving label readability.
   ================================================================ */
@media (max-width: 760px) {
  .mobile-nav-backdrop {
    background: rgba(0, 0, 0, .58);
  }

  .topnav {
    background: #0d131a;
    border-color: #26313d;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .58);
  }

  .mobile-nav-header {
    border-bottom-color: #26313d;
    color: #eef5fc;
  }

  .mobile-nav-close {
    border-color: #33465b;
    background: #111821;
    color: #eef5fc;
  }
  .mobile-nav-close:hover,
  .mobile-nav-close:focus {
    border-color: #4b6a89;
    background: #182431;
    color: #ffffff;
  }

  .topnav .nav-link {
    border-color: #263442;
    background: #111821;
    color: #dbe6f2;
    font-weight: 800;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  }
  .topnav .nav-link:hover,
  .topnav .nav-link:focus {
    background: #182431;
    border-color: #3f6488;
    color: #ffffff;
  }
  .topnav .nav-link.active {
    background: rgba(75, 163, 255, .16);
    border-color: #3b78b2;
    color: #a9d5ff;
  }

  .mobile-requests-shortcut {
    border-color: #345776;
    background: #111821;
    color: #dbe6f2;
  }
  .mobile-requests-shortcut:hover,
  .mobile-requests-shortcut:focus {
    border-color: #4b87bd;
    background: #182431;
    color: #ffffff;
  }
  .mobile-requests-shortcut.active {
    border-color: #3b78b2;
    background: rgba(75, 163, 255, .16);
    color: #a9d5ff;
  }
}


/* ================================================================
   RDS V8.4.1 Admin / Log surfaces
   - shared current RDS theme
   - responsive forms and tables
   ================================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.admin-form-grid { display: grid; gap: 11px; }
.admin-form-grid .field { min-width: 0; }
.admin-form-grid input,
.admin-form-grid select { width: 100%; }
.admin-help { margin: 0; color: var(--muted); font-size: 12px; }
.admin-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-danger-zone { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.admin-table-scroll { overflow: auto; max-width: 100%; }
table.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
table.admin-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 11px;
  background: #121b24;
  color: #aab9c8;
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
table.admin-table td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(38,51,66,.78);
  color: #c8d3de;
  vertical-align: middle;
  white-space: nowrap;
}
table.admin-table tbody tr:hover td { background: rgba(75,163,255,.045); }
table.admin-table .admin-message {
  min-width: 320px;
  max-width: 860px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 11px;
}
.admin-access-badge {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #8fc7ff;
  font-weight: 900;
  font-size: 10px;
}
.admin-type-badge {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--panel-3);
  color: #b8c6d4;
  font-weight: 800;
  font-size: 10px;
}
.admin-delete-form { margin: 0; }

@media (max-width: 820px) {
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  table.admin-table { display: block; width: 100%; min-width: 0; }
  table.admin-table thead { display: none; }
  table.admin-table tbody { display: block; }
  table.admin-table tr {
    display: block;
    margin: 0 0 9px;
    overflow: hidden;
    border: 1px solid #26323f;
    border-radius: 12px;
    background: #101720;
  }
  table.admin-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid #202b36;
    white-space: normal;
    text-align: right;
  }
  table.admin-table td:last-child { border-bottom: 0; }
  table.admin-table td::before {
    content: attr(data-label);
    flex: 0 0 86px;
    color: #708194;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
  }
  table.admin-table .admin-message {
    display: block;
    min-width: 0;
    max-width: none;
    text-align: left;
  }
  table.admin-table .admin-message::before { display: block; margin-bottom: 6px; }
  .admin-delete-form .btn { width: 100%; }
}

/* ================================================================
   RDS V8.4.1 Profile / delegated access / log filtering
   ================================================================ */
.user-chip-link { text-decoration: none; }
.user-chip-link:hover,
.user-chip-link:focus { border-color: var(--accent); color: #fff; }

.profile-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.profile-summary-grid { display: grid; gap: 10px; }
.profile-readonly {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.profile-readonly span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.profile-readonly strong { color: #dce8f3; font-size: 14px; }
.profile-readonly small { color: var(--muted); font-size: 11px; }

.admin-access-form {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.admin-access-form select {
  min-width: 74px;
  height: 32px;
  padding: 4px 25px 4px 8px;
}
.admin-access-form + .table-muted,
.admin-access-badge + .table-muted { margin-left: 7px; }

.log-filter-panel { margin-bottom: 14px; }
.log-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 11px;
  align-items: end;
}
.log-filter-grid input,
.log-filter-grid select { width: 100%; }
.log-filter-checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 8px;
}
.log-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.log-view-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.log-view-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: #aebdcb;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.log-view-tabs a:hover,
.log-view-tabs a:focus { border-color: #456e92; color: #fff; }
.log-view-tabs a.active {
  border-color: #3b78b2;
  background: rgba(75,163,255,.14);
  color: #a9d5ff;
}
.log-ip-link { color: #8fc7ff; text-decoration: none; font-family: var(--mono); }
.log-ip-link:hover,
.log-ip-link:focus { color: #fff; text-decoration: underline; }
.log-ip-table td:first-child { font-family: var(--mono); }

@media (max-width: 1050px) {
  .profile-layout { grid-template-columns: 1fr 1fr; }
  .profile-layout > .panel:first-child { grid-column: 1 / -1; }
  .log-filter-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 640px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-layout > .panel:first-child { grid-column: auto; }
  .log-filter-grid { grid-template-columns: 1fr; }
  .log-filter-checks { grid-column: auto; grid-template-columns: 1fr; }
  .log-filter-actions { grid-column: auto; display: grid; grid-template-columns: 1fr 1fr; }
  .log-filter-actions .btn { width: 100%; }
  .log-view-tabs a { flex: 1 1 0; justify-content: center; }
  .admin-access-form { width: 100%; justify-content: flex-end; }
  .admin-access-form select { flex: 1 1 auto; }
}

/* RDS V9.0 security/navigation integration */
.logout-form { margin: 0; display: inline-flex; }

/* ================================================================
   RDS V9.0.6 Passkeys + remote SITE LISTREQ queue
   ================================================================ */
.passkey-login-btn { white-space: nowrap; }
.passkey-inline-message {
  max-width: 240px;
  color: #a9d5ff;
  font-size: 11px;
  line-height: 1.25;
}
.passkey-inline-message.error { color: #ff9b9b; }
.passkey-panel { grid-column: 1 / -1; }
.passkey-enroll-grid {
  display: grid;
  grid-template-columns: minmax(180px,1fr) minmax(220px,1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.passkey-list { display: grid; gap: 9px; margin-top: 12px; }
.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.passkey-item > div { min-width: 0; display: grid; gap: 4px; }
.passkey-item strong { color: #dce8f3; }
.passkey-item small { color: var(--muted); overflow-wrap: anywhere; }
.passkey-remove-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.passkey-remove-form input { width: 180px; }
.site-request-table code { white-space: normal; overflow-wrap: anywhere; }
.site-request-raw-panel { margin-top: 16px; }
.site-request-raw {
  margin: 0;
  padding: 14px;
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #090f15;
  color: #b8c7d5;
  font: 12px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .passkey-enroll-grid { grid-template-columns: 1fr; }
  .passkey-item { align-items: stretch; flex-direction: column; }
  .passkey-remove-form { display: grid; grid-template-columns: 1fr auto; }
  .passkey-remove-form input { width: 100%; }
  .passkey-inline-message { display: none; }
}

/* ================================================================
   PreDB V9.1.2 branding
   ================================================================ */
.brand {
  min-width: 0;
}
.brand-logo {
  display: block;
  width: auto;
  height: 46px;
  max-width: 152px;
  object-fit: contain;
}
@media (max-width: 760px) {
  .brand-logo {
    height: 38px;
    max-width: 122px;
  }
}
@media (max-width: 360px) {
  .brand-logo {
    height: 34px;
    max-width: 110px;
  }
}
