:root {
  --bg0: #0e1412;
  --bg1: #16201b;
  --ink: #e8f2ea;
  --muted: #9bb0a1;
  --accent: #3dcf8e;
  --warn: #f0b429;
  --danger: #ff6b6b;
  --line: rgba(232, 242, 234, 0.12);
  --card: rgba(22, 32, 27, 0.88);
  --android: #a4c639;
  --ios: #7ec8e3;
  --macos: #9aa4b2;
  --windows: #6cb6ff;
  --linux: #e6b35a;
  --ohos: #ff8a65;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg0);
  min-height: 100vh;
}
.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(61, 207, 142, 0.18), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(80, 140, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #101816, #0b100e 70%);
  z-index: -1;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.brand { display: flex; gap: 0.85rem; align-items: center; }
.brand p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.brand strong { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.version-pill {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}
.login-version {
  margin: -0.35rem 0 0.75rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
}
.mark {
  width: 2.25rem; height: 2.25rem; border-radius: 0.65rem;
  background: linear-gradient(135deg, var(--accent), #1f7a55);
  box-shadow: 0 0 0 1px rgba(61,207,142,0.35);
}
.auth { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; }
.license-bar {
  flex: 1 1 12rem;
  align-self: center;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  color: var(--muted);
  max-width: 28rem;
}
.license-bar.ok { border-color: rgba(61, 207, 142, 0.45); color: var(--accent); }
.license-bar.denied { border-color: rgba(255, 107, 107, 0.55); color: var(--danger); }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  overflow: hidden;
  margin-bottom: 0.05rem;
}
.lang-btn {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  font-size: 0.8rem;
}
.lang-btn.active {
  background: rgba(61, 207, 142, 0.2);
  color: var(--accent);
}
.lang-btn + .lang-btn { border-left: 1px solid var(--line); }
label { display: grid; gap: 0.25rem; font-size: 0.75rem; color: var(--muted); }
input,
select {
  background: var(--bg1);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  min-width: 12rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}
select {
  appearance: none;
  -webkit-appearance: none;
  font-family: "DM Sans", system-ui, sans-serif;
  padding-right: 2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 0.95rem) calc(50% - 0.12rem),
    calc(100% - 0.65rem) calc(50% - 0.12rem);
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
  background-repeat: no-repeat;
  cursor: pointer;
}
select:focus,
input:focus {
  outline: none;
  border-color: rgba(61, 207, 142, 0.55);
  box-shadow: 0 0 0 2px rgba(61, 207, 142, 0.12);
}
select option {
  background: var(--bg1);
  color: var(--ink);
}
button {
  background: var(--accent);
  color: #062216;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.secondary.danger-btn { color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }
button.secondary.danger-btn:hover { background: rgba(255, 107, 107, 0.12); }
button.danger { background: var(--danger); color: #1a0505; }

.layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  padding: 1.25rem 1.75rem 2.5rem;
}
.workspace-switch {
  grid-column: 1 / -1;
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  width: fit-content;
}
.workspace-switch[hidden] {
  display: none !important;
}
.workspace-tab {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.workspace-tab:hover { color: var(--ink); }
.workspace-tab.active {
  background: rgba(61, 207, 142, 0.18);
  color: var(--accent);
}
.workspace {
  display: contents;
}
.workspace[hidden] {
  display: none !important;
}
.workspace-platform .side-panel,
.workspace-users .side-panel,
.workspace-test-groups .side-panel {
  grid-column: 1 / -1;
}
.overview-panel { grid-column: 1 / -1; }
.install-month { margin-top: 1.25rem; }
.install-month h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.install-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.install-table th,
.install-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.install-table th { color: var(--muted, #9aa3b2); font-weight: 500; }
.install-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.install-table td.mono { font-family: var(--mono, ui-monospace, monospace); font-size: 0.8rem; opacity: 0.85; }
.install-table td.muted { color: var(--muted, #9aa3b2); text-align: center; }
.drill-panel { grid-column: 1; grid-row: span 2; min-height: 28rem; }
.side-panel { grid-column: 2; }

/* Self-host ops: apps list full-width; adoption + API keys as a bottom pair. */
.layout[data-mode="selfhost"] {
  grid-template-columns: 1fr 1fr;
}
.layout[data-mode="selfhost"] .overview-panel {
  grid-column: 1 / -1;
}
.layout[data-mode="selfhost"] #workspaceOps .drill-panel {
  grid-column: 1 / -1;
  grid-row: auto;
  min-height: 22rem;
}
.layout[data-mode="selfhost"] #workspaceOps .side-panel {
  grid-column: auto;
  grid-row: auto;
  min-height: 14rem;
}
.layout[data-mode="selfhost"] .workspace-platform .side-panel,
.layout[data-mode="selfhost"] .workspace-users .side-panel,
.layout[data-mode="selfhost"] .workspace-test-groups .side-panel {
  grid-column: 1 / -1;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.1rem 1.2rem;
}
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin: 0.75rem 0;
}
.list-toolbar label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.list-toolbar input[type="search"] {
  flex: 1 1 12rem;
  min-width: 10rem;
  width: 100%;
  box-sizing: border-box;
}
.list-toolbar label:has(input[type="search"]) {
  flex: 1 1 12rem;
  min-width: 10rem;
}
.list-toolbar select {
  min-width: 7rem;
  width: 100%;
  box-sizing: border-box;
}
.list-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted, #9aa3b2);
}
.list-pager .pager-actions {
  display: flex;
  gap: 0.4rem;
}
.plan-presets-block input[type="number"] {
  width: 100%;
  max-width: 8rem;
  box-sizing: border-box;
}
.stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(61, 207, 142, 0.08);
  border: 1px solid var(--line);
  min-width: 7rem;
}
.stat strong { display: block; font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: 0.8rem; }
.stat.warn {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.45);
}
.stat.warn strong { color: var(--danger); }
.storage-note { margin: 0.5rem 0 0; flex-basis: 100%; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  min-height: 1.5rem;
}
.crumb {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 0.15rem 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.crumb.current { color: var(--ink); cursor: default; }
.sep { color: var(--muted); }

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.view-head h2 { margin: 0; font-size: 1.05rem; }
.view-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.api-key-form {
  display: grid;
  gap: 0.75rem;
}
.api-key-form label { width: 100%; }
.api-key-form input { width: 100%; min-width: 0; }
.api-key-modal {
  width: min(28rem, 100%);
}
.edit-tags-modal {
  width: min(26rem, 100%);
}
.edit-tags-form {
  display: grid;
  gap: 0.75rem;
}
.edit-tags-form input {
  width: 100%;
  min-width: 0;
}
.edit-tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}
.version-lock {
  min-width: 8.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  gap: 0.65rem;
}
.version-lock .switch-copy strong {
  font-size: 0.8rem;
}
.version-lock .switch-copy small {
  font-size: 0.68rem;
}
.version-lock.is-unlocked {
  border-color: rgba(232, 242, 234, 0.14);
  background: rgba(255, 255, 255, 0.03);
}
.version-lock.is-unlocked .switch-copy strong {
  color: var(--muted);
}
.version-lock.is-locked {
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.1);
}
.version-lock.is-locked .switch-copy strong {
  color: var(--warn);
}
.version-lock.is-locked .switch-track {
  background: rgba(240, 180, 41, 0.28);
  border-color: rgba(240, 180, 41, 0.55);
}
.version-lock.is-locked .switch-thumb {
  background: var(--warn);
}
.pill.lock-pill {
  font-weight: 650;
}
.pill.lock-pill--on {
  color: var(--warn);
  border-color: rgba(240, 180, 41, 0.5);
  background: rgba(240, 180, 41, 0.12);
}
.pill.lock-pill--off {
  color: var(--muted);
  border-color: rgba(232, 242, 234, 0.16);
  background: rgba(255, 255, 255, 0.03);
}
.hint { margin: 0; color: var(--muted); font-size: 0.8rem; word-break: break-all; }
.empty { color: var(--muted); }

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.form-row label { flex: 1 1 10rem; }
.form-row input { min-width: 0; width: 100%; }
.form-msg.danger-text { color: var(--danger); }
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(8, 12, 10, 0.72);
  backdrop-filter: blur(8px);
}
.login-gate[hidden] { display: none; }

/* Right-side drawers (tenant edit / payment create) */
.drawer-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.drawer-gate[hidden] { display: none !important; }
.drawer-gate.is-open { pointer-events: auto; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(6, 10, 8, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.drawer-gate.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: relative;
  z-index: 1;
  width: min(26.5rem, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(28, 40, 34, 0.98), rgba(16, 22, 19, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.drawer-gate.is-open .drawer-panel { transform: translateX(0); }
.drawer-panel.unique-ids-panel {
  width: min(34rem, 100%);
}
.drawer-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid var(--line);
}
.drawer-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.drawer-head .hint { margin: 0; }
.drawer-close {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
}
.drawer-close:hover {
  color: var(--ink);
  border-color: rgba(61, 207, 142, 0.35);
}
.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 1.1rem 1.35rem 1.25rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}
.drawer-body label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.drawer-body label.switch-field {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  font-size: inherit;
}
.drawer-body input,
.drawer-body select {
  width: 100%;
  min-width: 0;
}
.drawer-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.drawer-check {
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(61, 207, 142, 0.05);
}
.switch-field {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.switch-field--compact {
  gap: 0.45rem;
  justify-content: flex-start;
}
.switch-field--compact .switch-track {
  width: 2.35rem;
  height: 1.3rem;
}
.switch-field--compact .switch-thumb {
  width: 0.95rem;
  height: 0.95rem;
}
.switch-field--compact .switch-copy strong {
  font-size: 0.78rem;
  font-weight: 600;
}
.force-update-cell {
  white-space: nowrap;
  min-width: 5.5rem;
}
.switch-field.drawer-check {
  display: flex;
}
.switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  min-width: 0;
  pointer-events: none;
}
.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.switch-thumb {
  position: absolute;
  top: 50%;
  left: 0.16rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--muted);
  transform: translateY(-50%);
  transition:
    left 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.switch-input:focus-visible + .switch-track {
  box-shadow: 0 0 0 2px rgba(61, 207, 142, 0.28);
  border-color: rgba(61, 207, 142, 0.55);
}
.switch-input:checked + .switch-track {
  background: rgba(61, 207, 142, 0.28);
  border-color: rgba(61, 207, 142, 0.55);
}
.switch-input:checked + .switch-track .switch-thumb {
  left: calc(100% - 1.3rem);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(61, 207, 142, 0.35), 0 1px 4px rgba(0, 0, 0, 0.35);
}
.switch-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.switch-copy strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
}
.switch-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.switch-field:has(.switch-input:checked) {
  border-color: rgba(61, 207, 142, 0.4);
  background: rgba(61, 207, 142, 0.1);
}
.drawer-foot {
  display: flex;
  gap: 0.65rem;
  padding: 0.95rem 1.35rem 1.2rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.drawer-foot button { flex: 1; }
body.drawer-open { overflow: hidden; }

.unique-ids-add-label { display: grid; gap: 0.35rem; }
.unique-ids-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.unique-ids-add-row input { flex: 1; min-width: 0; }
.unique-ids-add-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.unique-ids-list {
  margin-top: 0;
  max-height: none;
}
.unique-ids-list .api-key-meta strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  word-break: break-all;
}
.unique-ids-picker-entry {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.35rem;
}
.unique-ids-picker-entry button { width: fit-content; }
.unique-ids-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.test-groups-create {
  margin: 0.75rem 0 1rem;
}
.test-groups-list {
  margin-top: 0.5rem;
}
.test-group-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  background: rgba(10, 15, 12, 0.35);
  border: 1px solid var(--line);
  font-weight: 500;
}
.test-group-row:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, rgba(10, 15, 12, 0.35));
}
.test-group-row .api-key-meta strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 650;
}
.test-group-row .api-key-meta .hint,
.test-group-row .api-key-meta span {
  color: var(--muted);
}
.test-group-row .test-group-open-label {
  flex: 0 0 auto;
  pointer-events: none;
  color: var(--muted);
  font-size: 0.78rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.2rem 0.5rem;
}
#testGroupGate .drawer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
#testGroupGate .drawer-foot #testGroupDeleteBtn {
  margin-right: auto;
}
#uniqueIdsPickGate,
#uniqueIdsPickGroupsGate {
  z-index: 60;
}
.unique-ids-pick-modal {
  width: min(32rem, 94vw);
  max-width: 94vw;
  max-height: min(85vh, 40rem);
  display: flex;
  flex-direction: column;
}
.unique-ids-pick-modal .unique-ids-picker-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin: 0.75rem 0 0.35rem;
}
.unique-ids-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.unique-ids-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
}
.unique-ids-pick-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(10, 15, 12, 0.22);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-weight: 500;
  opacity: 0.62;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.unique-ids-pick-row:hover { opacity: 0.85; }
.unique-ids-pick-row.is-selected {
  opacity: 1;
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, rgba(10, 15, 12, 0.35));
}
.unique-ids-pick-check {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  border: 1.5px solid var(--line);
  border-radius: 0.25rem;
  background: transparent;
}
.unique-ids-pick-row.is-selected .unique-ids-pick-check {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(10, 15, 12, 0.35);
}
.unique-ids-pick-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.unique-ids-pick-meta strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  word-break: break-all;
}
.unique-ids-pick-meta span {
  color: var(--muted);
  font-size: 0.72rem;
}
.unique-ids-pick-row.is-selected .unique-ids-pick-meta span {
  color: color-mix(in srgb, var(--text) 70%, var(--muted));
}

.dist-chart {
  margin: 0.75rem 0 0.35rem;
}
.dist-chart:empty { display: none; }
.dist-chart-title {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.dist-pie-wrap { display: grid; gap: 0.35rem; }
.dist-pie-body {
  display: grid;
  grid-template-columns: minmax(8.5rem, 11rem) minmax(0, 1fr);
  gap: 0.85rem 1.1rem;
  align-items: center;
}
.dist-pie-svg {
  width: 100%;
  max-width: 11rem;
  aspect-ratio: 1;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.15));
}
.dist-pie-slice {
  cursor: pointer;
  stroke: var(--bg0, #0e1412);
  stroke-width: 0.6;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-origin: 50% 50%;
}
.dist-pie-slice:hover,
.dist-pie-slice.active {
  opacity: 0.92;
  stroke: var(--accent, #3dcf8e);
  stroke-width: 1.2;
}
.dist-pie-legend {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  max-height: 14rem;
  overflow: auto;
}
.dist-pie-legend-item {
  display: grid;
  grid-template-columns: 0.65rem minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 0.28rem 0.35rem;
  border-radius: 0.35rem;
  cursor: pointer;
}
button.dist-pie-legend-item:hover,
.dist-pie-legend-item.active {
  background: rgba(61, 207, 142, 0.1);
}
.dist-pie-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 0.12rem;
}
.dist-pie-legend-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-pie-legend-n,
.dist-pie-legend-pct {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.dist-pie-legend-pct {
  min-width: 2.4rem;
  text-align: right;
}
.patch-dist-modal {
  width: min(34rem, 94vw);
  max-width: 94vw;
}
@media (max-width: 640px) {
  .dist-pie-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .dist-pie-legend { width: 100%; max-height: 12rem; }
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 0.55rem;
}
.icon-btn svg { display: block; fill: currentColor; }
.users-yes { color: var(--accent); }
.users-no { color: var(--danger); }

.data-table-wrap { margin-top: 0.75rem; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: middle;
}
.data-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody tr:hover {
  background: rgba(61, 207, 142, 0.05);
}
.data-table tr.is-void { opacity: 0.55; }
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table .mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
}
.data-table.users-table {
  table-layout: fixed;
}
.data-table.users-table th,
.data-table.users-table td {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table.users-table .col-id { width: 26%; }
.data-table.users-table .col-version { width: 10%; }
.data-table.users-table .col-build { width: 10%; }
.data-table.users-table .col-patch { width: 10%; }
.data-table.users-table .col-exists { width: 12%; }
.data-table.users-table .col-platform { width: 10%; }
.data-table.users-table .col-seen { width: 22%; }
.data-table .row-sub {
  margin-top: 0.15rem;
  font-size: 0.78rem;
}
.data-table .row-actions {
  text-align: right;
  white-space: nowrap;
}
.data-table .row-actions button {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .drawer-panel { width: 100%; }
  .drawer-grid-2 { grid-template-columns: 1fr; }
}
.login-card {
  width: min(26rem, 100%);
  display: grid;
  gap: 0.75rem;
}
.login-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
}
.login-top h1 { margin: 0; font-size: 1.25rem; }
.login-card label { width: 100%; }
.login-card input { width: 100%; min-width: 0; }
.login-help { margin: 0; }
button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #2a6df4);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.form-actions button { flex: 1 1 auto; }
.form-msg:not(.danger-text) { color: var(--accent); }

.card-list { display: grid; gap: 0.65rem; }
.nav-card {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(61, 207, 142, 0.06);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
}
.nav-card.app-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  padding: 0.55rem 0.65rem 0.55rem 0.25rem;
}
.nav-card-main {
  flex: 1;
  background: transparent;
  color: inherit;
  border: 0;
  text-align: left;
  padding: 0.35rem 0.45rem;
  border-radius: 0.65rem;
}
.nav-card-main:hover { background: rgba(61, 207, 142, 0.08); }
.app-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-self: center;
  flex: 0 0 auto;
}
button.app-delete,
button.app-edit {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.version-actions .delete-menu {
  position: relative;
}
.version-actions .delete-menu-disabled,
.version-actions button.delete-menu-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.version-actions .delete-menu-disabled:disabled {
  pointer-events: none;
}
.version-actions .delete-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
  border-radius: 0.55rem;
  background: var(--danger);
  color: #1a0505;
  font-weight: 600;
}
.version-actions .delete-menu > summary::-webkit-details-marker {
  display: none;
}
.version-actions .delete-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 9.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.version-actions .delete-menu-panel button {
  width: 100%;
  justify-content: center;
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
}
.pill.muted {
  opacity: 0.65;
  font-weight: 500;
}
.form-row label.form-grow {
  flex: 1 1 16rem;
}
.nav-card:hover { border-color: rgba(61, 207, 142, 0.45); }
.nav-card--has-patches {
  background: rgba(61, 207, 142, 0.16);
  border-color: rgba(61, 207, 142, 0.38);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-card--has-patches:hover {
  border-color: rgba(61, 207, 142, 0.55);
  background: rgba(61, 207, 142, 0.2);
}
.nav-card--has-patches .nav-card-main:hover {
  background: rgba(61, 207, 142, 0.1);
}
.nav-card--no-patches {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
  opacity: 0.72;
}
.nav-card--no-patches:hover {
  border-color: rgba(61, 207, 142, 0.28);
  opacity: 0.88;
}
.nav-card--no-patches .nav-card-main:hover {
  background: rgba(255, 255, 255, 0.03);
}
.build-patch-mix {
  width: 100%;
  margin: 0.15rem 0 0.45rem;
}
.build-patch-mix.is-pending,
.build-patch-mix.is-empty {
  font-size: 0.75rem;
  color: var(--muted, #9aa3b2);
}
.build-patch-mix-bar {
  display: flex;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.build-patch-mix-seg { height: 100%; min-width: 2px; }
.build-patch-mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted, #9aa3b2);
}
.build-patch-mix-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.build-patch-mix-item i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 99px;
  display: inline-block;
}
.build-patch-mix-item b {
  color: var(--text, #e8edf5);
  font-weight: 600;
}
.nav-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.45rem; }
.nav-card-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.nav-card-cta { color: var(--accent); font-size: 0.8rem; font-weight: 600; }

.platform-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.platform-row .label { color: var(--muted); font-size: 0.8rem; margin-right: 0.25rem; }
.app-platforms-block {
  margin: 0 0 1.25rem;
  padding: 0.95rem 1rem 1.05rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: rgba(10, 15, 12, 0.35);
}
.app-platforms-block .drawer-subhead {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.app-platforms-block > .hint {
  margin: 0 0 0.75rem;
}
.platform-bind-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.field-block {
  display: grid;
  gap: 0.4rem;
}
.field-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.platform-kind-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.platform-chip {
  position: relative;
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}
.platform-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.platform-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.platform-chip:hover span {
  color: var(--ink);
  border-color: rgba(232, 242, 234, 0.28);
}
.platform-chip input:focus-visible + span {
  box-shadow: 0 0 0 2px rgba(61, 207, 142, 0.25);
}
.platform-chip.android input:checked + span {
  color: var(--android);
  border-color: rgba(164, 198, 57, 0.55);
  background: rgba(164, 198, 57, 0.14);
}
.platform-chip.ios input:checked + span {
  color: var(--ios);
  border-color: rgba(126, 200, 227, 0.55);
  background: rgba(126, 200, 227, 0.14);
}
.platform-chip.macos input:checked + span {
  color: var(--macos);
  border-color: rgba(154, 164, 178, 0.55);
  background: rgba(154, 164, 178, 0.14);
}
.platform-chip.windows input:checked + span {
  color: var(--windows);
  border-color: rgba(108, 182, 255, 0.55);
  background: rgba(108, 182, 255, 0.14);
}
.platform-chip.linux input:checked + span {
  color: var(--linux);
  border-color: rgba(230, 179, 90, 0.55);
  background: rgba(230, 179, 90, 0.14);
}
.platform-chip.ohos input:checked + span {
  color: var(--ohos);
  border-color: rgba(255, 138, 101, 0.55);
  background: rgba(255, 138, 101, 0.14);
}
.platform-bind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: end;
}
.platform-bind-row .form-grow {
  flex: 1 1 14rem;
  min-width: 0;
}
.platform-bind-row input {
  width: 100%;
  min-width: 0;
}
.platform-bind-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pill.platform-binding {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.pill.platform-binding .linkish {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  font: inherit;
  font-size: 0.72rem;
  text-decoration: underline;
}
button.filter-pill {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-weight: 600;
  font-size: 0.72rem;
  cursor: pointer;
}
button.filter-pill.active {
  color: var(--ink);
  border-color: rgba(61, 207, 142, 0.55);
  background: rgba(61, 207, 142, 0.16);
}
button.filter-pill.platform.android.active {
  color: var(--android);
  border-color: rgba(164, 198, 57, 0.55);
  background: rgba(164, 198, 57, 0.16);
}
button.filter-pill.platform.ios.active {
  color: var(--ios);
  border-color: rgba(126, 200, 227, 0.55);
  background: rgba(126, 200, 227, 0.16);
}

.table-wrap { overflow: auto; }
.table-wrap th.num,
.table-wrap td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }

/* Patch list / detail arches: keep headers and cells on the same grid */
.patches-table {
  table-layout: fixed;
  width: 100%;
}
.patches-table th,
.patches-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.patches-table .col-num { width: 4.5rem; }
.patches-table .col-platform { width: 6.5rem; }
.patches-table .col-arch { width: 9rem; }
.patches-table .col-size { width: 5.5rem; }
.patches-table .col-installs { width: 5rem; }
.patches-table .col-whitelist { width: 8rem; }
.patches-table .col-force { width: 7rem; white-space: nowrap; overflow: visible; }
.patches-table .col-status { width: 5.5rem; }
.patches-table .col-actions {
  width: auto;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.patches-table--detail .col-arch { width: 8rem; }
.patches-table--detail .col-size { width: 5.5rem; }
.patches-table--detail .col-installs { width: 5rem; }
.patches-table--detail .col-whitelist { width: 8rem; }
.patches-table--detail .col-force { width: 7rem; }
.patches-table--detail .col-status { width: 5.5rem; }

/* Shared column grid for resource snapshot + OTA snapshot tabs */
.artifact-meta-table {
  table-layout: fixed;
}
.artifact-meta-table th:nth-child(1),
.artifact-meta-table td:nth-child(1) {
  width: 5.5rem;
}
.artifact-meta-table th:nth-child(2),
.artifact-meta-table td:nth-child(2) {
  width: 6.5rem;
}
.artifact-meta-table th:nth-child(3),
.artifact-meta-table td:nth-child(3) {
  width: 13.5rem;
}
.artifact-meta-table th:nth-child(4),
.artifact-meta-table td:nth-child(4) {
  width: 6.5rem;
}
.artifact-meta-table th:nth-child(5),
.artifact-meta-table td:nth-child(5) {
  width: auto;
}
.artifact-meta-table td.mono {
  font-variant-numeric: tabular-nums;
}
.artifact-meta-table .actions {
  justify-content: flex-start;
}
.actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.actions.stacked { flex-direction: column; align-items: stretch; }
.patch-plat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem 0;
}

.artifact-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 15, 12, 0.35);
}
.artifact-tab {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.artifact-tab:hover { color: var(--ink); }
.artifact-tab.active {
  background: rgba(61, 207, 142, 0.18);
  color: var(--accent);
}
.patch-detail-actions {
  gap: 0.5rem;
  align-items: center;
  margin: 0 1.35rem 0.75rem;
  justify-content: flex-start;
}
.hint-inline {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}
tr.clickable-row {
  cursor: pointer;
}
tr.clickable-row:hover td {
  background: rgba(61, 207, 142, 0.06);
}
.patch-detail-gate {
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  z-index: 45;
}
.patch-detail-panel {
  width: min(64rem, 100%);
  height: min(92vh, 100%);
  max-height: 92vh;
  border-radius: 1rem;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}
.patch-detail-gate.is-open .patch-detail-panel {
  transform: none;
  opacity: 1;
}
.patch-detail-gate #patchDetailTabs {
  margin: 0 1.35rem 0.75rem;
}
.patch-detail-body {
  display: block;
  padding-top: 0.35rem;
}
.patch-detail-body .artifact-panel > .hint {
  margin: 0 0 0.75rem;
}
.artifact-panel > .hint {
  margin: 0 0 0.75rem;
}
.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.panel-toolbar .hint {
  margin: 0;
  flex: 1 1 12rem;
}

pre {
  background: #0a0f0c;
  border-radius: 0.75rem;
  padding: 0.75rem;
  overflow: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  max-height: 18rem;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 22rem;
  overflow: auto;
  padding-right: 0.15rem;
}
.api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
  max-height: 16rem;
  overflow: auto;
}
.api-key-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(10, 15, 12, 0.35);
}
.api-key-meta { display: grid; gap: 0.15rem; min-width: 0; }
.api-key-meta strong { font-size: 0.9rem; }
.api-key-meta span { color: var(--muted); font-size: 0.72rem; font-family: "IBM Plex Mono", monospace; }
.api-key-secret {
  margin: 0.75rem 0 0.35rem;
  padding: 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.08);
}
.api-key-secret-title {
  margin: 0 0 0.45rem;
  color: var(--warn);
  font-size: 0.8rem;
  font-weight: 600;
}
.api-key-secret code {
  display: block;
  word-break: break-all;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  background: #0a0f0c;
  margin-bottom: 0.55rem;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.inline-check input { min-width: auto; width: auto; }
.badge-revoked {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.4);
}
.audit-row {
  display: grid;
  grid-template-columns: 7.2rem minmax(5.5rem, auto) 1fr;
  gap: 0.45rem 0.65rem;
  align-items: baseline;
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  background: rgba(10, 15, 12, 0.55);
  font-size: 0.8rem;
  line-height: 1.35;
}
.audit-row:hover {
  border-color: var(--line);
  background: rgba(61, 207, 142, 0.06);
}
.audit-time {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  white-space: nowrap;
}
.audit-action {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.audit-action.warn { color: var(--warn); }
.audit-action.danger { color: var(--danger); }
.audit-meta {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-meta strong {
  color: var(--ink);
  font-weight: 600;
}
.audit-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.adoption-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.adoption-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.adoption-summary strong {
  color: var(--ink);
  font-weight: 600;
}
.adoption-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.5rem;
}
.adoption-card {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: rgba(10, 15, 12, 0.45);
  display: grid;
  gap: 0.35rem;
}
.adoption-card.ok {
  border-color: rgba(61, 207, 142, 0.4);
  background: rgba(61, 207, 142, 0.08);
}
.adoption-card.bad {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
}
.adoption-card.warn {
  border-color: rgba(240, 180, 41, 0.4);
  background: rgba(240, 180, 41, 0.08);
}
.adoption-type {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.adoption-card.ok .adoption-type { color: var(--accent); }
.adoption-card.bad .adoption-type { color: var(--danger); }
.adoption-card.warn .adoption-type { color: var(--warn); }
.adoption-metrics {
  display: flex;
  gap: 0.85rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.adoption-metrics b {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
}
.adoption-platforms {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.adoption-platform {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.65rem 0.7rem 0.75rem;
  background: rgba(10, 15, 12, 0.35);
}
.adoption-platform-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.adoption-platform-head .pill {
  font-weight: 700;
  text-transform: none;
}
.adoption-note {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 720px) {
  .audit-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

.pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
}
.pill.warn { color: var(--warn); border-color: rgba(240,180,41,0.4); }
.pill.danger { color: var(--danger); border-color: rgba(255,107,107,0.4); }
.pill.ok {
  color: var(--accent);
  border-color: rgba(61, 207, 142, 0.45);
  background: rgba(61, 207, 142, 0.08);
}
.pill.tag {
  color: #7eb8ff;
  border-color: rgba(126, 184, 255, 0.45);
  background: rgba(126, 184, 255, 0.1);
  font-weight: 600;
}
button.filter-pill.tag.active {
  color: #7eb8ff;
  border-color: rgba(126, 184, 255, 0.55);
  background: rgba(126, 184, 255, 0.16);
}
.pill.platform.android {
  color: var(--android);
  border-color: rgba(164, 198, 57, 0.45);
  background: rgba(164, 198, 57, 0.08);
}
.pill.platform.ios {
  color: var(--ios);
  border-color: rgba(126, 200, 227, 0.45);
  background: rgba(126, 200, 227, 0.08);
}
.pill.platform.macos {
  color: var(--macos);
  border-color: rgba(154, 164, 178, 0.45);
  background: rgba(154, 164, 178, 0.08);
}
.pill.platform.windows {
  color: var(--windows);
  border-color: rgba(108, 182, 255, 0.45);
  background: rgba(108, 182, 255, 0.08);
}
.pill.platform.linux {
  color: var(--linux);
  border-color: rgba(230, 179, 90, 0.45);
  background: rgba(230, 179, 90, 0.08);
}
.pill.platform.ohos {
  color: var(--ohos);
  border-color: rgba(255, 138, 101, 0.45);
  background: rgba(255, 138, 101, 0.08);
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .drill-panel, .side-panel, .overview-panel, .workspace-switch { grid-column: auto; grid-row: auto; }
  .workspace-platform .side-panel,
  .workspace-users .side-panel,
  .workspace-test-groups .side-panel { grid-column: auto; }
}
