/* C4X Technology Architects design system - app/admin-tool chrome (tokens + components used so far). */
:root {
  --c4x-hero: #004675;
  --c4x-hero-deep: #00304f;
  --c4x-body-bg: #071b2c;
  --c4x-panel-bg: #0f2c42;
  --c4x-body-text: #eaf1f7;
  --c4x-muted: #9fb4c7;
  --c4x-accent: #00a4bf;
  --c4x-accent-dark: #00c0ce;
  --c4x-gold: #e8b84b;
  --c4x-border: rgba(255, 255, 255, 0.12);
  --c4x-white: #ffffff;
  --c4x-glow-cyan: #67e8f9;
  --c4x-glow-teal: #0891b2;
  --font-heading: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* {
  box-sizing: border-box;
}
/* Scrollbars: dark track on the navy canvas, a muted-blue thumb that turns teal on hover (never the browser's white gutter and grey thumb). */
:root {
  color-scheme: dark;
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 180, 199, 0.38) var(--c4x-body-bg);
}
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: var(--c4x-body-bg);
}
*::-webkit-scrollbar-thumb {
  background-color: rgba(159, 180, 199, 0.38);
  border: 3px solid var(--c4x-body-bg);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
  background-color: var(--c4x-accent);
}
body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--c4x-body-bg);
  color: var(--c4x-body-text);
  line-height: 1.6;
  background-image:
    radial-gradient(900px circle at 12% 0%, color-mix(in srgb, var(--c4x-glow-cyan) 22%, transparent), transparent 60%),
    radial-gradient(700px circle at 92% 18%, color-mix(in srgb, var(--c4x-glow-teal) 20%, transparent), transparent 55%),
    radial-gradient(800px circle at 50% 100%, color-mix(in srgb, var(--c4x-hero) 30%, transparent), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
.brand {
  font-family: var(--font-heading);
  line-height: 1.15;
}
h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 1rem;
}
a {
  color: var(--c4x-accent);
}
main {
  width: 100%; /* auto margins would otherwise shrink it to its content inside the shell grid */
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  color: #fff;
  background: linear-gradient(160deg, var(--c4x-hero-deep) 0%, var(--c4x-hero) 100%);
}
.topbar .brand {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.topbar nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.topbar nav a {
  color: #c7d0e0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.topbar nav a:hover,
.topbar nav a.active {
  color: #fff;
}
.panel {
  background: var(--c4x-panel-bg);
  border: 1px solid var(--c4x-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 8, 16, 0.35);
}
.section-panel {
  padding: 24px;
  margin-bottom: 24px;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 20px;
  text-align: center;
}
.stat-card .value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--c4x-accent);
}
.stat-card .label {
  font-size: 13px;
  color: var(--c4x-muted);
  margin-top: 4px;
}
.status-banner {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}
.status-banner-info {
  background: rgba(255, 255, 255, 0.05);
  color: var(--c4x-muted);
  border: 1px solid var(--c4x-border);
}
.status-banner-warn {
  background: color-mix(in srgb, var(--c4x-gold) 12%, transparent);
  color: var(--c4x-gold);
  border: 1px solid color-mix(in srgb, var(--c4x-gold) 40%, transparent);
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--c4x-border);
  color: var(--c4x-muted);
  background: var(--c4x-body-bg);
}
.badge-positive {
  color: #04222b;
  background: var(--c4x-accent);
  border-color: var(--c4x-accent);
}
.badge-pending {
  color: var(--c4x-gold);
  border-color: color-mix(in srgb, var(--c4x-gold) 50%, transparent);
  background: color-mix(in srgb, var(--c4x-gold) 14%, transparent);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c4x-border);
  font-size: 14px;
  overflow-wrap: anywhere;
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--c4x-muted);
  font-weight: 700;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .topbar nav {
    flex-wrap: wrap;
    gap: 14px;
  }
  main {
    padding: 16px;
  }
}

/* ---- app/admin chrome additions (C4X skill: buttons, forms, shell, modals) ---- */
html {
  scroll-behavior: smooth;
}
.muted {
  color: var(--c4x-muted);
}
.btn-block {
  width: 100%;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    filter 0.12s ease,
    background 0.12s ease;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-gold {
  background: var(--c4x-gold);
  color: #fff;
}
.btn-gold:hover:not(:disabled) {
  background: #cf9a2f;
}
.btn-accent {
  background: var(--c4x-accent);
  color: #fff;
}
.btn-accent:hover:not(:disabled) {
  background: var(--c4x-accent-dark);
}
.btn-outline {
  background: transparent;
  border-color: var(--c4x-border);
  color: var(--c4x-body-text);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--c4x-accent);
  color: var(--c4x-accent);
}
.btn-ghost {
  background: transparent;
  color: var(--c4x-muted);
  border: none;
  padding: 6px 10px;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--c4x-body-text);
}
.btn-danger {
  background: transparent;
  color: #ff9c92;
  border: 1px solid #ff9c92;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c4x-body-text);
  margin-bottom: 4px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: #0e283a;
  background: #fff;
  border: 1px solid var(--c4x-border);
  border-radius: 6px;
  padding: 9px 11px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select {
  height: 40px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c4x-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c4x-accent) 18%, transparent);
}
input:disabled {
  opacity: 0.7;
}
.field {
  margin-bottom: 14px;
}
.field-row {
  display: flex;
  gap: 12px;
}
.field-row > .field {
  flex: 1;
  min-width: 0;
}
@media (max-width: 640px) {
  .field-row {
    flex-direction: column;
    gap: 0;
  }
}
.status-banner-error {
  background: rgba(226, 87, 76, 0.12);
  color: #ff9c92;
  border: 1px solid rgba(226, 87, 76, 0.4);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar nav select {
  width: auto;
  height: 34px;
  padding: 4px 8px;
}
.app-shell {
  --rail-w: 220px;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: calc(100vh - 56px);
  transition: grid-template-columns 0.2s ease;
}
.app-shell.rail-collapsed {
  --rail-w: 0px;
}
.app-rail {
  border-right: 1px solid var(--c4x-border);
  background: var(--c4x-panel-bg);
  padding: 20px 14px;
  overflow: hidden auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}
.app-shell.rail-collapsed .app-rail {
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
}
.app-canvas {
  padding: 28px clamp(16px, 4vw, 64px) 96px;
  min-width: 0;
}
.rail-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c4x-muted);
  margin: 6px 8px;
  font-weight: 700;
}
.rail-link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--c4x-body-text);
  text-decoration: none;
  font-size: 14px;
}
.rail-link:hover,
.rail-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--c4x-accent);
}
@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .app-rail {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--c4x-border);
  }
  .app-shell.rail-collapsed .app-rail {
    display: none;
  }
}
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}
.login-card {
  width: min(400px, 100%);
  padding: 32px;
}
.bar-row {
  margin-bottom: 14px;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.bar-label .val {
  color: var(--c4x-muted);
}
.bar-track {
  background: var(--c4x-body-bg);
  border-radius: 5px;
  height: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--c4x-accent);
  border-radius: 5px;
}
.bar-fill.gold {
  background: var(--c4x-gold);
}
.bar-fill.red {
  background: #ff9c92;
}
#toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9000;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--c4x-panel-bg);
  border: 1px solid var(--c4x-border);
  border-left: 3px solid var(--c4x-accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(0, 8, 16, 0.45);
}
.toast.error {
  border-left-color: #ff9c92;
}
dialog.c4x-modal {
  padding: 0;
  border: 1px solid var(--c4x-border);
  border-radius: 10px;
  background: var(--c4x-panel-bg);
  color: var(--c4x-body-text);
  font-family: var(--font-body);
  box-shadow: 0 24px 64px rgba(0, 8, 16, 0.6);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}
dialog.c4x-modal.c4x-modal-wide {
  width: min(760px, calc(100vw - 32px));
}
dialog.c4x-modal[open] {
  display: flex;
  flex-direction: column;
  animation: c4x-modal-in 0.14s ease-out;
}
dialog.c4x-modal::backdrop {
  background: rgba(0, 8, 16, 0.7);
  backdrop-filter: blur(3px);
}
@keyframes c4x-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.c4x-modal[open] {
    animation: none;
  }
}
body:has(dialog.c4x-modal[open]) {
  overflow: hidden;
}
.c4x-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  background: linear-gradient(160deg, var(--c4x-hero-deep) 0%, var(--c4x-hero) 100%);
  border-bottom: 1px solid var(--c4x-border);
}
.c4x-modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.c4x-modal-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  padding: 0;
  background: transparent;
  color: #c7d0e0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.c4x-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.c4x-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.c4x-modal-body p {
  margin: 0 0 12px;
}
.c4x-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--c4x-border);
  background: rgba(0, 0, 0, 0.12);
}
@media (max-width: 640px) {
  dialog.c4x-modal,
  dialog.c4x-modal.c4x-modal-wide {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    max-height: 92dvh;
    border-radius: 12px 12px 0 0;
  }
  .c4x-modal-foot {
    flex-direction: column-reverse;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .c4x-modal-foot .btn {
    width: 100%;
    min-height: 44px;
  }
  .c4x-modal-close {
    width: 44px;
    height: 44px;
  }
}

/* ---- grid + form components ---- */
.c4x-grid {
  display: block;
}
.grid-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}
.grid-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.grid-filter {
  min-width: 140px;
}
.grid-filter label {
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--c4x-muted);
}
.grid-filter input,
.grid-filter select {
  height: 36px;
}
.grid-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.grid-per {
  width: auto;
  height: 32px;
  padding: 2px 8px;
  font-size: 13px;
}
.grid-cols {
  position: relative;
}
.grid-cols-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  padding: 10px 14px;
  min-width: 200px;
  max-height: 60vh;
  overflow: auto;
}
.grid-cols-pop[hidden] {
  display: none;
}
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  margin: 4px 0;
  cursor: pointer;
}
.check input {
  width: auto;
  height: auto;
}
.grid-batch {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  margin-bottom: 12px;
}
.grid-batch[hidden] {
  display: none;
}
.grid-table-wrap {
  overflow-x: auto;
  background: var(--c4x-panel-bg);
  border: 1px solid var(--c4x-border);
  border-radius: 10px;
}
.grid-table-wrap[aria-busy="true"] {
  opacity: 0.6;
}
.grid-table th.sel,
.grid-table td.sel {
  width: 36px;
}
.grid-table input[type="checkbox"] {
  width: auto;
  height: auto;
}
.grid-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.grid-table td.actions {
  text-align: right;
  white-space: nowrap;
}
.grid-table td.empty {
  text-align: center;
  color: var(--c4x-muted);
  padding: 28px;
}
.grid-table button.sort {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
}
.grid-pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}
.grid-pager span {
  margin-right: auto;
}
@media (max-width: 720px) {
  .grid-table thead {
    display: none;
  }
  .grid-table,
  .grid-table tbody,
  .grid-table tr,
  .grid-table td {
    display: block;
    width: 100%;
  }
  .grid-table tr {
    border-bottom: 1px solid var(--c4x-border);
    padding: 10px 12px;
  }
  .grid-table td {
    border: none;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }
  .grid-table td::before {
    content: attr(data-label);
    color: var(--c4x-muted);
    font-size: 12px;
    text-transform: uppercase;
    text-align: left;
  }
  .grid-table td.sel::before,
  .grid-table td.actions::before,
  .grid-table td.empty::before {
    content: none;
  }
  .grid-table td.actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .grid-filter {
    min-width: 100%;
  }
}
.c4x-form {
  display: block;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 18px;
}
.form-grid .field.wide {
  grid-column: 1 / -1;
}
.form-foot {
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: linear-gradient(to top, var(--c4x-body-bg) 70%, transparent);
}
.field-error {
  color: #ff9c92;
  font-size: 12px;
  margin-top: 4px;
}
.field-error[hidden] {
  display: none;
}
.field small {
  display: block;
  margin-top: 4px;
}
.kv-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.kv-row {
  display: flex;
  gap: 6px;
}
.kv-row input {
  flex: 1;
  min-width: 0;
}
.section-panel h2 {
  font-size: 1.1rem;
}

/* ---- device grids ---- */
.code {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #7ee0a8;
}
.code.warn {
  color: var(--c4x-gold);
}
.code.bad {
  color: #ff9c92;
}
.rssi.weak {
  color: #ff9c92;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--c4x-body-bg);
  border: 1px solid var(--c4x-border);
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
  font-size: 13px;
}
.chip-x {
  background: none;
  border: none;
  color: var(--c4x-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 6px;
}
.chip-x:hover {
  color: #ff9c92;
}
.results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 200px;
  overflow: auto;
}
.results .result {
  justify-content: flex-start;
  text-align: left;
}
.badge-negative {
  color: #ff9c92;
  border-color: rgba(226, 87, 76, 0.5);
  background: rgba(226, 87, 76, 0.14);
}

/* ---- template designer + template list ---- */
.tpl-thumb {
  display: block;
  max-width: 120px;
  max-height: 64px;
  border: 1px solid var(--c4x-border);
  border-radius: 4px;
  background: #fff;
  image-rendering: pixelated;
}
.designer {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 280px;
  grid-template-areas: "top top top" "tools stage props";
  gap: 12px;
  align-items: start;
}
.designer-top {
  grid-area: top;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  position: sticky;
  top: 56px;
  z-index: 20;
}
.designer-top .grow {
  flex: 1;
}
.designer-top select {
  width: auto;
  height: 32px;
  padding: 2px 8px;
}
.designer-tools {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  position: sticky;
  top: 120px;
}
.designer-tools .btn {
  justify-content: flex-start;
}
.designer-stage {
  grid-area: stage;
  overflow: auto;
  padding: 20px;
  min-height: 280px;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    10px 10px;
}
.designer-canvas {
  display: inline-block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.designer-props {
  grid-area: props;
  padding: 12px 14px;
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.designer-props h3 {
  text-transform: capitalize;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--c4x-border);
  cursor: pointer;
  color: var(--c4x-muted);
  padding: 0;
}
.swatch.on {
  border-color: var(--c4x-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c4x-accent) 35%, transparent);
}
.align {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
@media (max-width: 960px) {
  .designer {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "tools" "stage" "props";
  }
  .designer-tools {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }
  .designer-props,
  .designer-top {
    position: static;
    max-height: none;
  }
}

/* ---- logs ---- */
.cell-long {
  max-width: 38ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.grid-filter input[type="date"] {
  min-width: 150px;
}

/* Account avatar in the top bar: circular initials button with a dark popover (name, role, account settings, sign out). */
.user-menu {
  position: relative;
}
.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  color: var(--c4x-white);
  background: linear-gradient(150deg, var(--c4x-accent), var(--c4x-hero));
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
}
.avatar-btn:hover,
.avatar-btn[aria-expanded="true"] {
  border-color: var(--c4x-white);
}
.user-pop {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  padding: 6px;
  background: var(--c4x-hero-deep);
  color: var(--c4x-white);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.user-pop.hidden {
  display: none;
}
.user-pop-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.user-pop-head .muted {
  font-size: 12px;
}
.topbar nav .user-pop-item {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--c4x-white);
}
.topbar nav .user-pop-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--c4x-white);
}
.user-pop-sep {
  height: 1px;
  margin: 4px 2px;
  background: rgba(255, 255, 255, 0.14);
}
@media (max-width: 640px) {
  .avatar-btn {
    width: 44px;
    height: 44px;
  }
  .topbar nav .user-pop-item {
    padding: 12px 10px;
  }
}
