:root {
  --ink: #10212b;
  --ink-soft: #263d45;
  --muted: #60717a;
  --paper: #f5f7f2;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: #d9e2dc;
  --line-strong: #b9c9c0;
  --teal: #087f70;
  --teal-dark: #075c53;
  --teal-soft: #d9f3e8;
  --amber: #a45b08;
  --amber-soft: #fff0c9;
  --red: #a52a2a;
  --red-soft: #fae3dc;
  --shadow: 0 16px 45px rgba(16, 33, 43, 0.09);
  --shadow-soft: 0 8px 24px rgba(16, 33, 43, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, #dcefe6 0, transparent 32%),
    radial-gradient(circle at 95% 12%, #e8e0cf 0, transparent 24%),
    linear-gradient(135deg, var(--paper), #eef3ee);
  color: var(--ink);
  font: 16px/1.55 "Trebuchet MS", "Segoe UI", sans-serif;
}

a {
  color: var(--teal-dark);
  font-weight: 650;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
dialog:focus-visible {
  outline: 3px solid #8bd7c8;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: auto;
  padding: 22px 24px;
}

.brand {
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.account-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-nav form {
  display: block;
  margin: 0;
}

.account-email {
  overflow-wrap: anywhere;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 24px 80px;
}

.shell:focus {
  outline: none;
}

.notices {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
}

.notice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.notice.success {
  border-color: #9dcfbd;
  background: #e8f7f0;
  color: var(--teal-dark);
}

.notice.error {
  border-color: #e4aaa3;
  background: #fff0ed;
  color: #862a24;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  max-width: 760px;
  margin: 0 0 12px;
  font: 700 clamp(2rem, 5vw, 4rem) / 1.02 "Palatino Linotype", Georgia, serif;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0;
  font-size: 1.15rem;
}

h3 {
  margin: 0;
}

p {
  margin-top: 0;
}

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

.section-nav {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 8px;
  border: 1px solid rgba(185, 201, 192, 0.85);
  border-radius: 14px;
  background: rgba(245, 247, 242, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--teal-dark);
  font-size: 0.9rem;
  text-decoration: none;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  background: var(--teal-soft);
}

.section-nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.section-nav a.is-active {
  background: var(--ink);
  color: #fff;
}

.topbar-link {
  text-decoration: none;
}

.quick-link-grid,
.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quick-link,
.integration-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  text-decoration: none;
}

.quick-link:hover,
.quick-link:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.quick-link span,
.integration-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.integration-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #9dcfbd;
  background: linear-gradient(120deg, #e8f7f0, #fffdf6);
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.copy-value,
.code-card,
.integration-card code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.copy-value,
.code-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f5f0;
}

.integration-card code {
  min-height: 70px;
  padding: 10px;
  border-radius: 9px;
  background: #f1f5f0;
  font-size: 0.82rem;
}

.copy-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--teal-dark);
  font-weight: 700;
}

.integration-rules {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.section-target {
  scroll-margin-top: 76px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading p {
  max-width: 570px;
  margin-bottom: 0;
}

.panel,
.auth-card,
.error-card,
.stats article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  margin-top: 20px;
  padding: 24px;
}

.auth-card,
.error-card {
  max-width: 470px;
  margin: 8vh auto;
  padding: 36px;
}

.error-card {
  text-align: center;
}

.error-card .button {
  width: auto;
  margin-top: 10px;
}

.error-code {
  margin: 0 0 4px;
  color: var(--teal);
  font: 700 3.8rem / 1 "Palatino Linotype", Georgia, serif;
  letter-spacing: -0.06em;
}

form {
  display: grid;
  gap: 10px;
}

.field-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label,
legend {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

input::placeholder {
  color: #718087;
  opacity: 1;
}

input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(165, 42, 42, 0.12);
}

.field-hint,
.field-error,
.stats article small {
  display: block;
  font-size: 0.82rem;
}

.field-hint,
.stats article small {
  color: var(--muted);
}

.field-hint code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.field-error {
  color: var(--red);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: 700 0.92rem inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled,
form[aria-busy="true"] .button {
  opacity: 0.62;
}

.button:disabled {
  cursor: not-allowed;
}

form[aria-busy="true"] .button {
  cursor: wait;
}

.primary {
  background: var(--teal);
  color: #fff;
}

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

.ghost {
  background: #e8f0eb;
  color: var(--teal-dark);
}

.ghost:hover {
  background: #dce9e1;
}

.danger {
  background: var(--red-soft);
  color: var(--red);
}

.danger:hover {
  background: #f3d4cf;
}

.small {
  min-height: 44px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stats article {
  min-width: 0;
  padding: 20px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.stats strong {
  display: block;
  margin-top: 5px;
  font: 700 1.8rem "Palatino Linotype", Georgia, serif;
  line-height: 1.15;
}

.stats article small {
  margin-top: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

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

.proxy-import-form {
  display: grid;
  gap: 18px;
}

.proxy-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.proxy-list-field textarea {
  width: 100%;
  min-height: 238px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.proxy-list-field textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 1px;
  border-color: var(--teal);
}

.format-guide {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: #f5f7ff;
}

/* Proxiware workspace: compact control-center surfaces, safe on narrow screens. */
.proxiware-page-head { align-items: flex-start; }
.proxiware-status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.proxiware-status-item { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); }
.proxiware-status-item strong { margin-left: auto; text-transform: capitalize; }
.proxiware-status-item small { color: var(--muted); }
.status-dot.is-good { background: var(--teal); }
.status-dot.is-warn { background: var(--amber); }
.proxiware-tabs { display: flex; width: 100%; max-width: 100%; min-width: 0; gap: 6px; overflow-x: auto; overflow-y: hidden; margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.proxiware-tab { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.proxiware-tab:hover, .proxiware-tab:focus-visible { background: var(--teal-soft); color: var(--teal-dark); }
.proxiware-tab.is-active { background: var(--teal); color: #fff; }
.proxiware-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.proxiware-overview-grid { margin-top: 16px; }
.proxiware-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.proxiware-detail-list div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); }
.proxiware-detail-list dt { color: var(--muted); font-size: .82rem; }
.proxiware-detail-list dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.proxiware-count-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.proxiware-count-grid .inventory-count { min-height: 58px; }
.proxiware-export { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.proxiware-export h3 { margin: 0; font-size: 1rem; }
.proxiware-export p { margin: 4px 0 0; }
.proxiware-export .proxiware-action-row { justify-content: flex-end; margin-top: 0; }
.proxiware-toolbar { margin: 0 0 16px; }
.proxiware-table { min-width: 920px; }
.proxiware-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.proxiware-action-row form { margin: 0; }
.admin-proxy-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 900px) {
  .proxiware-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxiware-count-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .proxiware-status-strip, .proxiware-detail-list { grid-template-columns: 1fr; }
  .proxiware-status-item { align-items: flex-start; flex-wrap: wrap; }
  .proxiware-status-item strong { margin-left: 0; }
  .proxiware-status-item small { flex-basis: 100%; }
  .proxiware-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxiware-count-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxiware-export { align-items: stretch; flex-direction: column; }
  .proxiware-export .proxiware-action-row > * { flex: 1 1 calc(50% - 8px); }
  .proxiware-tab { padding-inline: 12px; }
}

.format-guide summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.format-guide summary::-webkit-details-marker {
  display: none;
}

.format-guide summary > span:last-child {
  display: grid;
  gap: 2px;
}

.format-guide summary strong {
  color: var(--ink);
  font-size: 1rem;
}

.format-guide summary small {
  color: var(--muted);
  font-size: 0.78rem;
}

.format-guide[open] summary {
  margin-bottom: 10px;
}

.format-list {
  display: grid;
  gap: 7px;
}

.format-guide > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  margin-bottom: 3px;
}

.format-guide h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.format-guide p {
  grid-column: 2;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.format-guide code {
  display: block;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #3730a3;
  font: 0.76rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.format-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #e0e7ff;
  color: #4338ca;
}

.format-icon svg {
  width: 18px;
  height: 18px;
}

.proxy-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  gap: 14px;
  align-items: end;
  padding-top: 2px;
}

.file-field input[type="file"] {
  min-height: 46px;
  padding: 8px;
  font-size: 0.86rem;
}

.optional {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.import-submit-copy {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.import-submit-copy strong {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

details.panel > summary {
  list-style: none;
  cursor: pointer;
}

details.panel > summary::-webkit-details-marker {
  display: none;
}

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

.import-panel-summary {
  margin-bottom: 0;
  padding: 18px 22px;
}

.import-panel-summary > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.import-panel-summary .eyebrow {
  margin-bottom: 0;
}

.import-panel-summary strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.import-panel-summary small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.import-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.import-panel-toggle span {
  font-size: 1.15rem;
  line-height: 1;
}

.import-panel[open] .import-panel-toggle span {
  transform: rotate(45deg);
}

.import-panel-body {
  padding: 0 22px 22px;
}

.import-panel-body > .proxy-import-form {
  padding-top: 2px;
}

.info-callout {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}

.info-callout p:last-child {
  margin-bottom: 0;
}

.whitelist-callout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  align-items: center;
}

.copy-stack {
  display: grid;
  gap: 8px;
}

.inventory-summary {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(245, 247, 242, 0.76);
}

.admin-proxy-overview {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.admin-proxy-overview article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--shell-line, var(--line));
  border-radius: 14px;
  background: var(--shell-surface, var(--surface-strong));
}

.admin-proxy-overview article span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-proxy-overview article strong {
  color: var(--ink);
  font: 700 1.55rem/1.1 "Palatino Linotype", Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.admin-proxy-overview article small {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-proxy-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(245, 247, 242, 0.76);
}

.admin-proxy-count-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.admin-proxy-toolbar {
  grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(130px, 1fr)) repeat(3, minmax(120px, 0.9fr)) auto auto;
}

.admin-proxy-table {
  min-width: 1360px;
  table-layout: fixed;
}

.admin-proxy-table th:nth-child(1) { width: 11%; }
.admin-proxy-table th:nth-child(2) { width: 11%; }
.admin-proxy-table th:nth-child(3) { width: 7%; }
.admin-proxy-table th:nth-child(4) { width: 8%; }
.admin-proxy-table th:nth-child(5) { width: 8%; }
.admin-proxy-table th:nth-child(6) { width: 10%; }
.admin-proxy-table th:nth-child(7) { width: 7%; }
.admin-proxy-table th:nth-child(8) { width: 7%; }
.admin-proxy-table th:nth-child(9) { width: 7%; }
.admin-proxy-table th:nth-child(10) { width: 13%; }
.admin-proxy-table th:nth-child(11) { width: 11%; }

.admin-proxy-table tbody th[scope="row"] {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-proxy-scroll:focus-visible,
.proxy-inventory-scroll:focus-visible {
  outline: 3px solid #8bd7c8;
  outline-offset: 3px;
}

.admin-proxy-scroll-hint,
.proxy-inventory-scroll-hint {
  display: block;
  margin: 6px 0 0;
  color: var(--shell-muted);
  font-size: 0.78rem;
}

.admin-proxy-scroll-hint[hidden],
.proxy-inventory-scroll-hint[hidden] {
  display: none;
}

.admin-proxy-table .badge.archived {
  margin-left: 5px;
  vertical-align: middle;
}

.pagination-center {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.inventory-count-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.inventory-count-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.inventory-count-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-count {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  min-width: 94px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.inventory-count:hover,
.inventory-count:focus-visible,
.inventory-count.is-active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
  transform: translateY(-1px);
}

.inventory-count span {
  font-size: 0.78rem;
  font-weight: 700;
}

.inventory-count strong {
  font: 700 1.05rem/1 "Palatino Linotype", Georgia, serif;
}

.inventory-count.online,
.inventory-count.allow {
  border-color: #abd8c7;
}

.inventory-count.offline,
.inventory-count.risk,
.inventory-count.blocked {
  border-color: #e4b5ad;
}

.inventory-count.pending,
.inventory-count.suspect,
.inventory-count.awaiting {
  border-color: #e7d49d;
}

.inventory-count.duplicate {
  border-color: #e4b5ad;
}

.inventory-count.canonical {
  border-color: #abd8c7;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(5, minmax(110px, 0.7fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}

.inventory-toolbar .button {
  white-space: nowrap;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 32px 10px 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

.inventory-results-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.inventory-results-meta strong {
  color: var(--ink-soft);
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

.table-sort:hover,
.table-sort:focus-visible {
  color: var(--teal-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.page-link {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 750;
}

.page-link:hover,
.page-link:focus-visible,
.page-link.is-current {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.pagination-ellipsis {
  min-width: 24px;
  color: var(--muted);
  text-align: center;
}

.pagination .is-disabled {
  pointer-events: none;
  opacity: 0.48;
}

.egress-duplicate-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.35fr) auto auto;
}

.egress-member-toolbar {
  grid-template-columns: minmax(150px, 220px) auto;
  justify-content: start;
}

.compact-table {
  min-width: 620px;
}

.compact-data-table {
  min-width: 0;
}

.compact-data-table th,
.compact-data-table td {
  padding: 10px 9px;
}

.proxy-inventory-table {
  min-width: 1000px;
  table-layout: fixed;
}

.proxy-inventory-table th:nth-child(1) { width: 20%; }
.proxy-inventory-table th:nth-child(2) { width: 7%; }
.proxy-inventory-table th:nth-child(3) { width: 7%; }
.proxy-inventory-table th:nth-child(4) { width: 8%; }
.proxy-inventory-table th:nth-child(5) { width: 10%; }
.proxy-inventory-table th:nth-child(6),
.proxy-inventory-table th:nth-child(7) { width: 7%; }
.proxy-inventory-table th:nth-child(9) { width: 17%; }

.proxy-inventory-table tbody th[scope="row"] {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.proxy-inventory-table .numeric-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.proxy-inventory-table .duration-cell {
  white-space: normal;
  line-height: 1.35;
}

.proxy-inventory-table .earn-cell {
  white-space: normal;
  line-height: 1.35;
}

.proxy-inventory-table .earn-cell strong {
  font-variant-numeric: tabular-nums;
}

.rate-label {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

/* Keep the new earnings column readable without changing legacy mobile hooks. */
body.authenticated .proxy-inventory-table {
  min-width: 1300px;
}

body.authenticated .proxy-inventory-table th:nth-child(1) { width: 17%; }
body.authenticated .proxy-inventory-table th:nth-child(2),
body.authenticated .proxy-inventory-table th:nth-child(3) { width: 6%; }
body.authenticated .proxy-inventory-table th:nth-child(4) { width: 12%; }
body.authenticated .proxy-inventory-table th:nth-child(5) { width: 9%; }
body.authenticated .proxy-inventory-table th:nth-child(6) { width: 11%; }
body.authenticated .proxy-inventory-table th:nth-child(7),
body.authenticated .proxy-inventory-table th:nth-child(8) { width: 7%; }
body.authenticated .proxy-inventory-table th:nth-child(9) { width: 13%; }
body.authenticated .proxy-inventory-table th:nth-child(10) { width: 12%; }

.column-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.proxy-row-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.proxy-row-actions .button {
  min-height: 44px;
  padding: 7px 10px;
}

.proxy-row-actions form {
  min-width: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.replace-proxy-dialog {
  width: min(92vw, 520px);
}

.replace-proxy-dialog .dialog-body {
  display: grid;
  gap: 12px;
}

.replace-proxy-dialog .dialog-body > .eyebrow,
.replace-proxy-dialog .dialog-body > h2,
.replace-proxy-dialog .dialog-body > p {
  margin-bottom: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.settings-grid fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.check {
  display: block;
  margin: 5px 0;
}

.check input {
  width: auto;
  min-height: 0;
  margin-right: 8px;
  accent-color: var(--teal);
}

.table-wrap {
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

caption {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: left;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

thead th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.responsive-table tbody th[scope="row"] {
  color: var(--ink);
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.breakable {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.online,
.badge.allow,
.badge.active,
.badge.approved,
.badge.sent,
.badge.confirmed {
  background: var(--teal-soft);
  color: #09614f;
}

.badge.offline,
.badge.risk,
.badge.blocked,
.badge.deleted,
.badge.revoked,
.badge.failed {
  background: var(--red-soft);
  color: #8f2c26;
}

.badge.pending,
.badge.inconclusive,
.badge.suspect,
.badge.awaiting,
.badge.archived,
.badge.due,
.badge.never,
.badge.requested,
.badge.stale,
.badge.verifying {
  background: var(--amber-soft);
  color: #80500b;
}

.badge.duplicate {
  background: var(--red-soft);
  color: #8f2c26;
}

.badge.excluded {
  background: var(--red-soft);
  color: #8f2c26;
}

.badge.canonical {
  background: var(--teal-soft);
  color: #09614f;
}

.freshness {
  display: grid;
  gap: 2px;
  min-width: 150px;
  font-size: 0.78rem;
}

.freshness.fresh {
  color: #09614f;
}

.freshness.stale {
  color: #80500b;
}

.freshness strong {
  font-size: 0.82rem;
}

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

.freshness.fresh strong {
  color: var(--teal-dark);
}

.freshness.stale strong {
  color: var(--amber);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px;
  min-width: 220px;
}

.actions form {
  min-width: 150px;
}

.actions form[data-confirm-dialog] {
  min-width: auto;
}

.actions .field-hint {
  max-width: 220px;
}

.verification-error {
  display: grid;
  gap: 4px;
  max-width: 280px;
  color: var(--red);
  font-size: 0.84rem;
}

.token-reveal {
  border-color: #d9a83c;
  background: linear-gradient(120deg, #fff7dc, #fffdf6);
}

.api-key-table {
  min-width: 980px;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
}

.confirm-dialog {
  width: min(92vw, 440px);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(16, 33, 43, 0.24);
}

.confirm-dialog::backdrop {
  background: rgba(16, 33, 43, 0.56);
}

.dialog-body {
  padding: 26px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 840px) {
  .inline-form-wide {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

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

  .egress-duplicate-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-proxy-overview,
  .admin-proxy-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-proxy-total {
    grid-column: 1 / -1;
  }

  .inventory-search {
    grid-column: 1 / -1;
  }

  .inventory-toolbar .button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 24px 16px 56px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .brand {
    align-self: flex-start;
  }

  .account-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .account-email {
    display: none;
  }

  .page-head,
  .panel-head {
    display: block;
  }

  .section-nav {
    top: 4px;
    max-width: 100%;
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .section-nav a {
    flex: 0 0 auto;
  }

  .stats,
  .admin-stats,
  .inline-form,
  .proxy-import-grid,
  .proxy-upload-row,
  .settings-grid,
  .quick-link-grid,
  .integration-grid {
    grid-template-columns: 1fr;
  }

  .integration-hero,
  .copy-field {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel,
  .auth-card,
  .error-card {
    padding: 22px;
  }

  .proxy-import-grid,
  .proxy-upload-row {
    grid-template-columns: 1fr;
  }

  .format-guide {
    order: 2;
  }

  .auth-card,
  .error-card {
    margin: 4vh auto;
  }

  input {
    font-size: 16px;
  }

  .proxy-list-field textarea {
    font-size: 16px;
  }

  .button {
    width: 100%;
  }

  .inventory-summary {
    padding: 12px;
  }

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

  .admin-proxy-overview .admin-proxy-total {
    grid-column: 1 / -1;
  }

  .admin-proxy-counts {
    grid-template-columns: 1fr;
  }

  .inventory-count-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-count {
    min-width: 0;
  }

  .inventory-toolbar {
    grid-template-columns: 1fr;
  }

  .inventory-search {
    grid-column: auto;
  }

  .inventory-results-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination .button {
    width: 100%;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    overflow: visible;
  }

  table.responsive-table {
    display: block;
    min-width: 0;
  }

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .responsive-table tbody,
  .responsive-table tr {
    display: block;
  }

  .responsive-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-strong);
    box-shadow: var(--shadow-soft);
  }

  .responsive-table th,
  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
  }

  /* Put long endpoints on their own line so masked hosts never widen a card. */
  .responsive-table th[data-label="Endpoint"] {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .responsive-table th[data-label="Endpoint"]::before {
    display: block;
    margin-bottom: 6px;
  }

  .responsive-table tr > :last-child {
    border-bottom: 0;
  }

  .responsive-table th[data-label]::before,
  .responsive-table td[data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .responsive-table td[data-label="Actions"] {
    display: block;
  }

  .responsive-table td[data-label="Actions"]::before {
    display: block;
    margin-bottom: 8px;
  }

  .responsive-table .actions {
    display: grid;
    min-width: 0;
    gap: 12px;
  }

  .responsive-table .actions form,
  .responsive-table .actions .field-hint {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .freshness {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .button:hover {
    transform: none;
  }
}

/* TailAdmin-inspired application shell. Legacy component selectors above stay
   available for the existing forms/tables while the shell supplies the new
   visual hierarchy and responsive navigation. */
:root {
  --shell-bg: #f7f8fc;
  --shell-surface: #ffffff;
  --shell-line: #e4e7ec;
  --shell-ink: #101828;
  --shell-muted: #667085;
  --shell-primary: #465fff;
  --shell-primary-strong: #3641f5;
  --shell-primary-soft: #eef0ff;
  --shell-sidebar: 276px;
}

body.authenticated {
  min-width: 320px;
  background: var(--shell-bg);
  color: var(--shell-ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

body.authenticated .app-shell {
  min-height: 100vh;
}

body.authenticated .app-sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--shell-sidebar);
  display: flex;
  flex-direction: column;
  background: var(--shell-surface);
  border-right: 1px solid var(--shell-line);
  box-shadow: 8px 0 28px rgba(16, 24, 40, .025);
}

body.authenticated .app-sidebar[aria-hidden="true"] {
  visibility: hidden;
}

body.authenticated .brand-lockup {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}

body.authenticated .app-sidebar .brand {
  display: block;
  padding: 0;
  color: var(--shell-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(145deg, #6176ff, #3641f5);
  box-shadow: 0 8px 18px rgba(70, 95, 255, .24);
  color: #fff;
}

.brand-mark svg { width: 23px; height: 23px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 18px; letter-spacing: -.03em; }
.brand-copy small { color: var(--shell-muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.sidebar-nav .nav-label {
  padding: 18px 12px 8px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar-nav .nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #344054;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.sidebar-nav .nav-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
.sidebar-nav .nav-item:hover { background: #f5f7ff; color: var(--shell-primary); }
.sidebar-nav .nav-item[aria-current="page"] { background: var(--shell-primary-soft); color: var(--shell-primary); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--shell-line);
}

.drawer-account {
  display: none;
}

body.authenticated .system-card {
  padding: 14px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: #f9fafb;
  box-shadow: none;
}

.system-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.system-card strong { color: var(--shell-ink); font-size: 13px; }
.system-card p { margin: 8px 0 0; color: var(--shell-muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px #d1fadf; }

.app-main { min-height: 100vh; margin-left: var(--shell-sidebar); }
.app-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}

.topbar-context {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topbar-kicker {
  color: var(--shell-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.topbar-context strong {
  color: var(--shell-ink);
  font-size: 16px;
  letter-spacing: -.02em;
}

.global-search {
  width: min(430px, 45vw);
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--shell-line);
  border-radius: 10px;
  background: #fff;
  color: var(--shell-muted);
}

.global-search svg { width: 18px; height: 18px; flex: 0 0 auto; }
.global-search input { min-height: 40px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--shell-ink); }
.global-search kbd { padding: 2px 7px; border: 1px solid var(--shell-line); border-radius: 6px; background: #f9fafb; color: var(--shell-muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--shell-line); border-radius: 50%; background: #fff; color: #344054; }
.icon-button svg { width: 19px; height: 19px; }
.menu-button { display: none; border-radius: 10px; }
.account-summary { display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #e0e7ff, #c7d2fe); color: #3641f5; font-weight: 800; }
.account-copy { display: grid; gap: 1px; }
.account-copy strong { max-width: 190px; overflow: hidden; color: var(--shell-ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--shell-muted); font-size: 11px; }
.topbar-signout { width: auto !important; min-height: 42px; }

body.authenticated .shell {
  width: 100%;
  max-width: 1550px;
  margin: 0 auto;
  padding: 30px;
}

body.authenticated .page-head { align-items: flex-start; margin-bottom: 24px; }
body.authenticated .page-head h1 { max-width: 800px; margin-bottom: 8px; color: var(--shell-ink); font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif; font-size: clamp(24px, 3vw, 31px); line-height: 1.2; letter-spacing: -.035em; }
body.authenticated .eyebrow { color: var(--shell-primary); }
body.authenticated .muted { color: var(--shell-muted); }
body.authenticated .section-nav { position: static; margin-bottom: 20px; padding: 5px; border: 1px solid var(--shell-line); border-radius: 10px; background: #f2f4f7; box-shadow: none; }
body.authenticated .section-nav a { min-height: 44px; border-radius: 7px; color: #667085; }
body.authenticated .section-nav a[aria-current="page"], body.authenticated .section-nav a.is-active { background: #fff; color: var(--shell-primary); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
body.authenticated .panel, body.authenticated .stats article { border-color: var(--shell-line); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.04); }
body.authenticated .panel { margin-top: 20px; padding: 22px; }
body.authenticated .button.primary { background: var(--shell-primary); }
body.authenticated .button.primary:hover { background: var(--shell-primary-strong); }
body.authenticated .button.ghost { background: #f2f4f7; color: #344054; }
body.authenticated .button.ghost:hover { background: #e4e7ec; }
body.authenticated input, body.authenticated select { border-color: var(--shell-line); border-radius: 9px; }
body.authenticated table { border-color: var(--shell-line); }
body.authenticated .badge.active, body.authenticated .badge.online, body.authenticated .badge.allow, body.authenticated .badge.approved, body.authenticated .badge.confirmed { background: #ecfdf3; color: #039855; }
body.authenticated .quick-link { border-color: var(--shell-line); background: #f9fafb; color: var(--shell-ink); }
body.authenticated .quick-link:hover, body.authenticated .quick-link:focus-visible { background: var(--shell-primary-soft); border-color: #c7d2fe; }
body.authenticated .policy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body.authenticated .policy-grid article { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--shell-line); border-radius: 12px; background: #f9fafb; }
body.authenticated .policy-grid span { color: var(--shell-muted); font-size: 13px; }
body.authenticated .copy-value, body.authenticated .code-card, body.authenticated .integration-card code { background: #f9fafb; border-color: var(--shell-line); }
body.authenticated .info-callout { border-color: #c7d2fe; background: #f5f7ff; }
body.authenticated .format-guide { border-color: #c7d2fe; background: #f5f7ff; }
body.authenticated .format-guide code { background: #fff; border-color: #e0e7ff; }
body.authenticated .format-guide summary strong { color: var(--shell-ink); }
body.authenticated .inventory-summary,
body.authenticated .inventory-toolbar { border-color: var(--shell-line); background: #f9fafb; }
body.authenticated .inventory-count { border-color: var(--shell-line); background: #fff; color: var(--shell-ink); }
body.authenticated .inventory-count:hover,
body.authenticated .inventory-count:focus-visible,
body.authenticated .inventory-count.is-active { border-color: var(--shell-primary); background: var(--shell-primary-soft); color: var(--shell-primary-strong); }
body.authenticated .page-link { border-color: var(--shell-line); background: #fff; color: var(--shell-ink); }
body.authenticated .page-link:hover,
body.authenticated .page-link:focus-visible,
body.authenticated .page-link.is-current { border-color: var(--shell-primary); background: var(--shell-primary); color: #fff; }

body.authenticated.theme-dark {
  --shell-bg: #101828;
  --shell-surface: #182230;
  --shell-line: #344054;
  --shell-ink: #f2f4f7;
  --shell-muted: #b7c3d4;
  --shell-primary-soft: #202b63;
  /* Keep legacy components on the same accessible dark palette. */
  --ink: #f2f4f7;
  --ink-soft: #d0d5dd;
  --muted: #b7c3d4;
  --paper: #101828;
  --surface: #182230;
  --surface-strong: #1d2939;
  --line: #344054;
  --line-strong: #475467;
  --teal: #5eead4;
  --teal-dark: #7dd3c7;
  --teal-soft: #123e3a;
  --amber: #f5b544;
  --amber-soft: #4a3513;
  --red: #fda29b;
  --red-soft: #4b211e;
  background: var(--shell-bg);
  color: var(--shell-ink);
}

body.authenticated.theme-dark .app-topbar,
body.authenticated.theme-dark .global-search,
body.authenticated.theme-dark .icon-button,
body.authenticated.theme-dark .system-card,
body.authenticated.theme-dark .panel,
body.authenticated.theme-dark .stats article,
body.authenticated.theme-dark .quick-link,
body.authenticated.theme-dark .policy-grid article,
body.authenticated.theme-dark .copy-value,
body.authenticated.theme-dark .code-card,
body.authenticated.theme-dark .integration-card,
body.authenticated.theme-dark .integration-card code,
body.authenticated.theme-dark .info-callout,
body.authenticated.theme-dark .format-guide,
body.authenticated.theme-dark .empty { background: var(--shell-surface); color: var(--shell-ink); }
body.authenticated.theme-dark .global-search input,
body.authenticated.theme-dark .account-copy strong,
body.authenticated.theme-dark .system-card strong { color: var(--shell-ink); }
body.authenticated.theme-dark .sidebar-nav .nav-item { color: #d0d5dd; }
body.authenticated.theme-dark .sidebar-nav .nav-item:hover { background: #202b3c; color: #aab7ff; }
body.authenticated.theme-dark .section-nav { background: #1d2939; }
body.authenticated.theme-dark .section-nav a { color: #d0d5dd; }
body.authenticated.theme-dark .section-nav a[aria-current="page"],
body.authenticated.theme-dark .section-nav a.is-active { background: #27356f; color: #c7d2fe; }
body.authenticated.theme-dark input,
body.authenticated.theme-dark select,
body.authenticated.theme-dark textarea { background: #1d2939; color: var(--shell-ink); border-color: var(--shell-line); }
body.authenticated.theme-dark .format-guide code { background: #1d2939; color: #c7d2fe; border-color: #344054; }
body.authenticated.theme-dark .format-guide summary strong { color: var(--shell-ink); }
body.authenticated.theme-dark .format-guide summary small,
body.authenticated.theme-dark .format-guide p { color: var(--shell-muted); }
body.authenticated.theme-dark .inventory-summary,
body.authenticated.theme-dark .inventory-toolbar,
body.authenticated.theme-dark .inventory-count,
body.authenticated.theme-dark .page-link { background: #1d2939; border-color: var(--shell-line); color: var(--shell-ink); }
body.authenticated.theme-dark .inventory-count:hover,
body.authenticated.theme-dark .inventory-count:focus-visible,
body.authenticated.theme-dark .inventory-count.is-active { background: #202b63; border-color: #465fff; color: #c7d2fe; }
body.authenticated.theme-dark .page-link:hover,
body.authenticated.theme-dark .page-link:focus-visible,
body.authenticated.theme-dark .page-link.is-current { background: var(--shell-primary); border-color: var(--shell-primary); color: #fff; }
body.authenticated.theme-dark .button.ghost { background: #1d2939; color: #eaecf0; }
body.authenticated.theme-dark .button.ghost:hover { background: #273548; }
body.authenticated.theme-dark table { color: var(--shell-ink); }
body.authenticated.theme-dark .proxy-inventory-table tbody th[scope="row"],
body.authenticated.theme-dark .inventory-results-meta strong,
body.authenticated.theme-dark .table-sort { color: var(--shell-ink); }
body.authenticated.theme-dark .freshness.fresh,
body.authenticated.theme-dark .freshness.fresh strong { color: #6ce9b0; }
body.authenticated.theme-dark .freshness.stale,
body.authenticated.theme-dark .freshness.stale strong { color: #fdb022; }
body.authenticated.theme-dark .freshness span { color: var(--shell-muted); }
body.authenticated.theme-dark .badge.online,
body.authenticated.theme-dark .badge.allow,
body.authenticated.theme-dark .badge.active,
body.authenticated.theme-dark .badge.approved,
body.authenticated.theme-dark .badge.sent,
body.authenticated.theme-dark .badge.confirmed,
body.authenticated.theme-dark .badge.canonical { background: #123e3a; color: #6ce9b0; }
body.authenticated.theme-dark .badge.offline,
body.authenticated.theme-dark .badge.risk,
body.authenticated.theme-dark .badge.blocked,
body.authenticated.theme-dark .badge.deleted,
body.authenticated.theme-dark .badge.revoked,
body.authenticated.theme-dark .badge.failed,
body.authenticated.theme-dark .badge.duplicate,
body.authenticated.theme-dark .badge.excluded { background: #4b211e; color: #fda29b; }
body.authenticated.theme-dark .badge.pending,
body.authenticated.theme-dark .badge.inconclusive,
body.authenticated.theme-dark .badge.suspect,
body.authenticated.theme-dark .badge.awaiting,
body.authenticated.theme-dark .badge.requested,
body.authenticated.theme-dark .badge.stale,
body.authenticated.theme-dark .badge.verifying { background: #4a3513; color: #fdb022; }
body.authenticated.theme-dark .quick-link:hover,
body.authenticated.theme-dark .quick-link:focus-visible { background: #202b63; border-color: #465fff; }
body.authenticated.theme-dark .policy-grid span,
body.authenticated.theme-dark .integration-card p { color: var(--shell-muted); }
body.authenticated.theme-dark .drawer-account { border-color: var(--shell-line); }

.sidebar-overlay { display: none; }
.auth-shell { min-height: 100vh; max-width: 1180px; margin: 0 auto; padding: 38px 24px 80px; }

@media (max-width: 1099px) {
  body.authenticated .app-sidebar { transform: translateX(-101%); transition: transform .18s ease; box-shadow: 18px 0 38px rgba(16,24,40,.16); }
  body.authenticated .app-sidebar.open { transform: translateX(0); }
  body.authenticated .app-main { margin-left: 0; }
  body.authenticated .app-topbar { padding: 0 20px; }
  body.authenticated .menu-button { display: grid; }
  body.authenticated .sidebar-overlay.open { display: block; position: fixed; z-index: 35; inset: 0; border: 0; background: rgba(16,24,40,.45); }
  body.authenticated .drawer-account { display: grid; gap: 12px; padding: 16px; border-top: 1px solid var(--shell-line); }
  body.authenticated .drawer-account .account-summary { padding: 0; }
  body.authenticated .drawer-signout { width: 100% !important; }
  body.authenticated .shell { padding: 24px 20px 60px; }
  body.authenticated .inventory-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.authenticated .inventory-search { grid-column: 1 / -1; }
  body.authenticated .inventory-toolbar .button { width: 100%; }
}

@media (max-width: 680px) {
  body.authenticated .app-topbar { min-height: 68px; gap: 10px; }
  body.authenticated .account-copy, body.authenticated .theme-button, body.authenticated .topbar-signout { display: none; }
  body.authenticated .account-summary { padding-left: 0; }
  body.authenticated .shell { padding: 20px 14px 76px; }
  body.authenticated .page-head { flex-direction: column; }
  body.authenticated .panel { padding: 17px; border-radius: 13px; }
  body.authenticated .policy-grid { grid-template-columns: 1fr; }
}

@media (min-width: 681px) and (max-width: 1099px) {
  body.authenticated .shell { padding: 26px; }
  body.authenticated .page-head h1 { font-size: 28px; }
}

body.drawer-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  body.authenticated .app-sidebar { transition: none; }
}

/* Compact authenticated workspaces: keep controls discoverable, make data primary. */
body.authenticated {
  --shell-sidebar: 252px;
}

body.authenticated .brand-lockup,
body.authenticated .app-topbar {
  min-height: 68px;
}

body.authenticated .brand-lockup {
  padding-inline: 20px;
}

body.authenticated .sidebar-nav {
  padding: 10px 12px;
}

body.authenticated .sidebar-nav .nav-label {
  padding: 14px 10px 6px;
}

body.authenticated .sidebar-nav .nav-item {
  min-height: 42px;
  gap: 10px;
  margin: 2px 0;
  padding: 8px 10px;
}

body.authenticated .app-topbar {
  padding-inline: 24px;
}

body.authenticated .shell {
  max-width: 1680px;
  padding: 22px 24px 48px;
}

body.authenticated .page-head {
  margin-bottom: 18px;
}

body.authenticated .page-head h1 {
  margin-bottom: 5px;
}

body.authenticated .page-head p:last-child,
body.authenticated .panel-head p:last-child {
  margin-bottom: 0;
}

body.authenticated .panel,
body.authenticated .stats article {
  border-radius: 14px;
}

body.authenticated .panel {
  margin-top: 16px;
  padding: 18px;
}

body.authenticated .import-panel {
  padding: 0;
}

body.authenticated .import-panel-summary {
  padding: 16px 18px;
}

body.authenticated .import-panel-body {
  padding: 0 18px 18px;
}

body.authenticated .stats {
  gap: 10px;
}

body.authenticated .stats article {
  padding: 16px;
}

body.authenticated .stats strong {
  font-size: 1.55rem;
}

body.authenticated .panel-head {
  margin-bottom: 12px;
}

body.authenticated .inventory-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

body.authenticated .inventory-count-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
}

body.authenticated .inventory-count {
  min-width: 0;
  padding-inline: 9px;
}

body.authenticated .inventory-toolbar {
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 11px;
}

body.authenticated .inventory-toolbar label {
  font-size: 0.78rem;
}

body.authenticated .inventory-toolbar input,
body.authenticated .inventory-toolbar select {
  min-height: 42px;
  padding-block: 8px;
  font-size: 0.88rem;
}

body.authenticated .inventory-results-meta {
  margin-bottom: 6px;
}

body.authenticated .proxy-inventory-table th,
body.authenticated .proxy-inventory-table td,
body.authenticated .compact-data-table th,
body.authenticated .compact-data-table td {
  padding: 9px 8px;
}

.proxy-inventory-table caption,
.compact-data-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.authenticated .proxy-inventory-table tbody tr:hover,
body.authenticated .compact-data-table tbody tr:hover {
  background: #f8f9ff;
}

body.authenticated .compact-data-table .actions {
  min-width: 0;
  gap: 6px;
}

body.authenticated .proxy-inventory-table .proxy-row-actions {
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
}

body.authenticated .compact-data-table .actions form {
  min-width: 0;
}

body.authenticated .proxy-inventory-table .proxy-row-actions form {
  display: inline-flex;
  align-items: center;
}

body.authenticated .payout-table .actions {
  min-width: 240px;
}

body.authenticated .pagination {
  margin-top: 12px;
}

body.authenticated .page-link {
  min-width: 40px;
  min-height: 40px;
}

body.authenticated.theme-dark .proxy-inventory-table tbody tr:hover,
body.authenticated.theme-dark .compact-data-table tbody tr:hover {
  background: #202b3c;
}

@media (min-width: 701px) {
  body.authenticated .proxy-inventory-table tbody th[scope="row"] {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 1240px) {
  body.authenticated .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1099px) {
  body.authenticated .shell {
    padding: 20px 18px 54px;
  }
}

@media (max-width: 700px) {
  body.authenticated .shell {
    padding: 16px 12px 68px;
  }

  body.authenticated .page-head {
    margin-bottom: 14px;
  }

  body.authenticated .panel {
    margin-top: 12px;
    padding: 14px;
  }

  body.authenticated .import-panel {
    padding: 0;
  }

  body.authenticated .import-panel-summary {
    align-items: flex-start;
    padding: 14px;
  }

  body.authenticated .import-panel-summary small {
    display: none;
  }

  body.authenticated .import-panel-toggle {
    display: inline-flex;
    min-height: 44px;
  }

  body.authenticated .import-panel-body {
    padding: 0 14px 14px;
  }

  body.authenticated .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  body.authenticated .inventory-summary .inventory-count-group:nth-child(1),
  body.authenticated .inventory-summary .inventory-count-group:nth-child(4) {
    grid-column: 1 / -1;
  }

  body.authenticated .inventory-summary .inventory-count-list {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 5px;
  }

  body.authenticated .inventory-summary .inventory-count-group:nth-child(2),
  body.authenticated .inventory-summary .inventory-count-group:nth-child(3) {
    grid-column: auto;
  }

  body.authenticated .inventory-summary .inventory-count-group:nth-child(2) .inventory-count-list,
  body.authenticated .inventory-summary .inventory-count-group:nth-child(3) .inventory-count-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  body.authenticated .inventory-summary .inventory-count {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    min-height: 44px;
    gap: 6px;
    padding: 6px 8px;
  }

  body.authenticated .inventory-summary .inventory-count-group:nth-child(2) .inventory-count,
  body.authenticated .inventory-summary .inventory-count-group:nth-child(3) .inventory-count {
    padding-inline: 6px;
    font-size: 0.74rem;
  }

  body.authenticated .inventory-summary .inventory-count-group:nth-child(2) .inventory-count strong,
  body.authenticated .inventory-summary .inventory-count-group:nth-child(3) .inventory-count strong {
    font-size: 0.92rem;
  }

  body.authenticated .inventory-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.authenticated .inventory-toolbar input,
  body.authenticated .inventory-toolbar select {
    min-height: 44px;
  }

  body.authenticated .inventory-search {
    grid-column: 1 / -1;
  }

  body.authenticated .proxy-inventory-table,
  body.authenticated .compact-data-table {
    min-width: 0;
  }

  body.authenticated .responsive-table .proxy-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.authenticated .responsive-table .proxy-row-actions .button,
  body.authenticated .responsive-table .proxy-row-actions form {
    width: auto;
  }

  body.authenticated .responsive-table .proxy-row-actions form {
    display: inline-flex;
  }

  body.authenticated .proxy-inventory-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.authenticated .proxy-inventory-table th,
  body.authenticated .proxy-inventory-table td {
    display: grid;
    grid-template-columns: minmax(5.5rem, 36%) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  body.authenticated .proxy-inventory-table th[data-label="Endpoint"],
  body.authenticated .proxy-inventory-table td[data-label="Freshness"],
  body.authenticated .proxy-inventory-table td[data-label="Actions"] {
    display: block;
    grid-column: 1 / -1;
  }

  body.authenticated .proxy-inventory-table th[data-label="Endpoint"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Freshness"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Actions"]::before {
    display: block;
    margin-bottom: 4px;
  }

  body.authenticated .proxy-inventory-table td[data-label="Protocol"],
  body.authenticated .proxy-inventory-table td[data-label="Status"],
  body.authenticated .proxy-inventory-table td[data-label="Online hours"],
  body.authenticated .proxy-inventory-table td[data-label="Offline hours"] {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  body.authenticated .proxy-inventory-table td[data-label="Protocol"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Status"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Earning status"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Egress identity"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Online hours"]::before,
  body.authenticated .proxy-inventory-table td[data-label="Offline hours"]::before {
    display: inline;
    flex: 0 0 auto;
    margin-bottom: 0;
    font-size: 0.68rem;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"],
  body.authenticated .proxy-inventory-table td[data-label="Egress identity"],
  body.authenticated .proxy-inventory-table td[data-label="Earn"] {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(6.5rem, 30%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    overflow: visible;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .badge,
  body.authenticated .proxy-inventory-table td[data-label="Egress identity"] .badge {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .field-hint {
    grid-column: 2;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .earning-status-main,
  body.authenticated .proxy-inventory-table td[data-label="Earn"] .earn-main {
    grid-column: 2;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .earning-status-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .rate-label {
    margin-top: 0;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .field-hint,
  body.authenticated .proxy-inventory-table td[data-label="Earn"] .earn-main .field-hint {
    grid-column: 2;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table th[data-label]::before,
  body.authenticated .proxy-inventory-table td[data-label]::before {
    display: block;
    margin-bottom: 4px;
  }

  body.authenticated .proxy-inventory-table .freshness {
    gap: 1px;
  }

  body.authenticated .page-link {
    min-height: 44px;
  }

  .whitelist-callout {
    grid-template-columns: 1fr;
  }
}

/* UI clarity pass: simpler navigation, honest status, responsive provider cards. */
.system-card-neutral {
  display: block;
  color: inherit;
  text-decoration: none;
}

.system-card-neutral:hover,
.system-card-neutral:focus-visible {
  border-color: #c7d2fe;
  background: var(--shell-primary-soft);
}

.status-dot.is-neutral {
  background: #667085;
  box-shadow: 0 0 0 4px #eaecf0;
}

.status-dot.is-good {
  background: #12b76a;
  box-shadow: 0 0 0 4px #d1fadf;
}

.status-dot.is-warn {
  background: #f79009;
  box-shadow: 0 0 0 4px #fef0c7;
}

body.authenticated .priority-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checker-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: #f9fafb;
}

.checker-presets > div {
  display: grid;
  gap: 2px;
  margin-right: auto;
}

.checker-presets span {
  color: var(--shell-muted);
  font-size: .78rem;
}

.checker-presets [aria-pressed="true"] {
  border-color: #c7d2fe;
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.breadcrumbs {
  margin: -6px 0 16px;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--shell-muted);
  font-size: .82rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: "/";
  color: #98a2b3;
}

.breadcrumbs li[aria-current="page"] {
  color: var(--shell-ink);
  font-weight: 700;
}

.proxiware-page-actions {
  align-items: flex-start;
}

.action-menu {
  position: relative;
}

.action-menu > summary {
  list-style: none;
  cursor: pointer;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: var(--shell-surface);
  box-shadow: 0 18px 38px rgba(16, 24, 40, .16);
}

.action-menu-panel .button,
.action-menu-panel form {
  width: 100%;
}

.provider-state-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #a6f4c5;
  border-radius: 13px;
  background: #ecfdf3;
}

.provider-state-summary.is-attention {
  border-color: #fedf89;
  background: #fffaeb;
}

.provider-state-summary.is-paused {
  border-color: #d0d5dd;
  background: #f9fafb;
}

.provider-state-summary .status-dot {
  flex: 0 0 auto;
  margin-top: 6px;
}

.provider-state-summary > div {
  display: grid;
  gap: 2px;
}

.provider-state-summary span:last-child {
  color: #475467;
  font-size: .88rem;
}

.provider-status-details {
  margin-bottom: 12px;
}

.provider-status-details > summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--shell-primary);
  font-weight: 700;
}

.provider-status-details .proxiware-status-strip {
  margin-top: 4px;
}

.proxiware-nav-groups {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid var(--shell-line);
  border-radius: 13px;
  background: var(--shell-surface);
}

.proxiware-nav-root,
.proxiware-nav-groups summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--shell-muted);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.proxiware-nav-groups summary {
  list-style: none;
}

.proxiware-nav-groups summary::-webkit-details-marker {
  display: none;
}

.proxiware-nav-root:hover,
.proxiware-nav-root:focus-visible,
.proxiware-nav-groups summary:hover,
.proxiware-nav-groups summary:focus-visible,
.proxiware-nav-root.is-active,
.proxiware-nav-groups details.is-current > summary,
.proxiware-nav-groups details[open] > summary {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

.proxiware-nav-groups details {
  position: relative;
}

.proxiware-nav-groups details[open] > div {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: var(--shell-surface);
  box-shadow: 0 18px 38px rgba(16, 24, 40, .16);
}

.proxiware-nav-groups details > div a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--shell-ink);
  text-decoration: none;
}

.proxiware-nav-groups details > div a:hover,
.proxiware-nav-groups details > div a:focus-visible,
.proxiware-nav-groups details > div a[aria-current="page"] {
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
}

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

.compact-id {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.authenticated .inventory-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.authenticated .proxy-inventory-table th:nth-child(1) { width: 18%; }
body.authenticated .proxy-inventory-table th:nth-child(2),
body.authenticated .proxy-inventory-table th:nth-child(3) { width: 7%; }
body.authenticated .proxy-inventory-table th:nth-child(4) { width: 15%; }
body.authenticated .proxy-inventory-table th:nth-child(5) { width: 12%; }
body.authenticated .proxy-inventory-table th:nth-child(6),
body.authenticated .proxy-inventory-table th:nth-child(7) { width: 8%; }
body.authenticated .proxy-inventory-table th:nth-child(8) { width: 12%; }
body.authenticated .proxy-inventory-table th:nth-child(9) { width: 13%; }

body.authenticated.theme-dark .checker-presets,
body.authenticated.theme-dark .provider-state-summary.is-paused,
body.authenticated.theme-dark .proxiware-nav-groups,
body.authenticated.theme-dark .proxiware-nav-groups details > div,
body.authenticated.theme-dark .action-menu-panel {
  border-color: var(--shell-line);
  background: var(--shell-surface);
}

body.authenticated.theme-dark .provider-state-summary {
  border-color: #087f5b;
  background: #123e3a;
  color: #d1fadf;
}

body.authenticated.theme-dark .provider-state-summary.is-attention {
  border-color: #b54708;
  background: #4a3513;
  color: #fef0c7;
}

body.authenticated.theme-dark .provider-state-summary span:last-child,
body.authenticated.theme-dark .proxiware-nav-groups details > div a {
  color: var(--shell-muted);
}

body.anonymous {
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 8%, rgba(70, 95, 255, .16), transparent 30%),
    linear-gradient(135deg, #f8f9ff, #eef1f8);
  color: var(--shell-ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.auth-shell {
  min-height: 100dvh;
  max-width: none;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-layout {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(380px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(208, 213, 221, .9);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(16, 24, 40, .14);
}

.auth-brand-panel {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  background:
    radial-gradient(circle at 80% 15%, rgba(122, 139, 255, .42), transparent 28%),
    linear-gradient(145deg, #101828, #202b63);
  color: #fff;
}

.auth-brand-panel .eyebrow {
  color: #aeb9ff;
}

.auth-brand-panel h2 {
  max-width: 430px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.14;
  letter-spacing: -.035em;
}

.auth-brand-panel p:last-child {
  max-width: 430px;
  margin: 14px 0 0;
  color: #d0d5dd;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-lockup > span:last-child {
  display: grid;
}

.auth-brand-lockup strong {
  font-size: 1.1rem;
}

.auth-brand-lockup small {
  color: #aeb9ff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-layout .auth-card {
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: clamp(32px, 6vw, 64px);
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.auth-layout .auth-card h1 {
  margin-bottom: 8px;
  color: var(--shell-ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.15;
}

.auth-layout .auth-card form {
  margin-top: 18px;
}

.auth-layout .auth-card .button {
  margin-top: 8px;
}

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
}

@media (max-width: 1100px) {
  body.authenticated .priority-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.authenticated #proxy-status > .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .proxiware-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .proxiware-nav-groups {
    display: none;
  }

  .proxiware-mobile-nav {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
  }

  .proxiware-mobile-nav span {
    color: var(--shell-muted);
    font-size: .78rem;
    font-weight: 700;
  }

  .proxiware-mobile-nav select {
    min-height: 46px;
  }

  .admin-proxy-scroll-hint,
  .proxy-inventory-scroll-hint {
    display: none;
  }

  body.authenticated .proxiware-table {
    width: 100%;
    min-width: 0;
    border: 0;
  }

  body.authenticated .proxiware-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  body.authenticated .proxiware-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.authenticated .proxiware-table tr {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    background: var(--shell-surface);
  }

  body.authenticated .proxiware-table th,
  body.authenticated .proxiware-table td {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--shell-line);
    overflow-wrap: anywhere;
  }

  body.authenticated .proxiware-table tr > :last-child {
    border-bottom: 0;
  }

  body.authenticated .table-wrap:has(.proxy-inventory-table) {
    overflow: visible;
  }

  body.authenticated .proxy-inventory-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
  }

  body.authenticated .proxy-inventory-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  body.authenticated .proxy-inventory-table tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.authenticated .proxy-inventory-table tbody tr {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    background: var(--shell-surface);
  }

  body.authenticated .proxy-inventory-table th,
  body.authenticated .proxy-inventory-table td {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(5.5rem, 40%) minmax(0, 1fr);
    gap: 6px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--shell-line);
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table th[data-label="Endpoint"],
  body.authenticated .proxy-inventory-table td[data-label="Earning status"],
  body.authenticated .proxy-inventory-table td[data-label="Earn"],
  body.authenticated .proxy-inventory-table td[data-label="Freshness"],
  body.authenticated .proxy-inventory-table td[data-label="Actions"] {
    grid-column: 1 / -1;
  }

  body.authenticated .proxy-inventory-table th[data-label="Endpoint"] {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.authenticated .proxy-inventory-table th[data-label="Endpoint"]::before {
    display: block;
    margin-bottom: 4px;
  }

  body.authenticated .proxy-inventory-table tbody th[scope="row"] {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.authenticated .proxy-inventory-table th::before,
  body.authenticated .proxy-inventory-table td::before {
    content: attr(data-label);
    color: var(--shell-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  body.authenticated .proxy-inventory-table .earning-status-main,
  body.authenticated .proxy-inventory-table .earn-main {
    grid-column: 2;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table td[data-label="Earning status"] .field-hint,
  body.authenticated .proxy-inventory-table td[data-label="Earn"] .field-hint {
    grid-column: 2;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.authenticated .proxy-inventory-table tr > :last-child {
    border-bottom: 0;
  }

  body.authenticated .table-wrap:has(.admin-proxy-table) {
    overflow: visible;
  }

  body.authenticated .admin-proxy-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
  }

  body.authenticated .admin-proxy-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  body.authenticated .admin-proxy-table tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.authenticated .admin-proxy-table tbody tr {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    background: var(--shell-surface);
  }

  body.authenticated .admin-proxy-table th,
  body.authenticated .admin-proxy-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--shell-line);
    overflow-wrap: anywhere;
  }

  body.authenticated .admin-proxy-table th[data-label="Endpoint"] {
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.authenticated .admin-proxy-table tbody th[scope="row"] {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.authenticated .admin-proxy-table th::before,
  body.authenticated .admin-proxy-table td::before {
    content: attr(data-label);
    color: var(--shell-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  body.authenticated .admin-proxy-table th[data-label="Endpoint"]::before {
    display: block;
    margin-bottom: 4px;
  }

  body.authenticated .admin-proxy-table tr > :last-child {
    border-bottom: 0;
  }

  body.authenticated .proxiware-table th::before,
  body.authenticated .proxiware-table td::before {
    content: attr(data-label);
    color: var(--shell-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  body.authenticated .proxiware-table .actions,
  body.authenticated .proxiware-table .actions form {
    width: 100%;
  }

  body.authenticated .proxiware-table .actions .button {
    width: 100%;
  }

  body.authenticated .table-wrap:has(.proxiware-table) {
    overflow: visible;
  }

  .auth-layout {
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  }

  .auth-brand-panel {
    min-height: 560px;
    padding: 30px;
  }
}

@media (max-width: 700px) {
  body.authenticated .priority-action-grid,
  body.authenticated .inventory-summary {
    grid-template-columns: 1fr;
  }

  body.authenticated .inventory-summary .inventory-count-group:nth-child(1),
  body.authenticated .inventory-summary .inventory-count-group:nth-child(2),
  body.authenticated .inventory-summary .inventory-count-group:nth-child(3) {
    grid-column: 1;
  }

  .checker-presets {
    align-items: stretch;
    flex-direction: column;
  }

  .checker-presets > div {
    margin-right: 0;
  }

  .checker-presets .button {
    width: 100%;
  }

  .action-menu {
    flex: 1 1 auto;
  }

  .action-menu > summary {
    justify-content: center;
  }

  .action-menu-panel {
    right: auto;
    left: 0;
  }

  .breadcrumbs li:first-child {
    display: none;
  }

  .breadcrumbs li:nth-child(2)::before {
    content: none;
  }

  .auth-shell {
    padding: 14px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .auth-brand-panel {
    min-height: 0;
    gap: 38px;
    padding: 24px;
  }

  .auth-brand-panel h2 {
    font-size: 1.55rem;
  }

  .auth-layout .auth-card {
    padding: 28px 22px 32px;
  }
}

@media (max-width: 600px) {
  body.authenticated .proxiware-table tbody {
    grid-template-columns: 1fr;
  }

  body.authenticated .proxiware-table th,
  body.authenticated .proxiware-table td {
    grid-template-columns: minmax(6.5rem, 36%) minmax(0, 1fr);
  }
}

@media (min-width: 901px) {
  body.authenticated .admin-proxy-table {
    min-width: 1360px;
  }
}

/* Provider account credentials: masked text inputs (no browser password autofill). */
.secret-mask {
  -webkit-text-security: disc;
  text-security: disc;
}

/* Provider account forms: two even columns, actions on their own row. */
.account-form {
  margin-top: 12px;
}

.account-form > button {
  grid-column: 1 / -1;
  justify-self: start;
}

[data-lease-for][hidden] {
  display: none;
}

body.authenticated .compact-data-table .lease-consumer-select {
  min-height: 34px;
  min-width: 12rem;
  padding: 6px 30px 6px 10px;
}
