/* M8 HUB shared components (WEB1 design 4): buttons, chips, glass cards,
   top bar, sidebar and drawer, dock, sheet, tabs, option cards, empty
   state, toast, language menu, switch, accordion, search palette.
   Uses only ui/tokens.css variables; nothing page-specific here. */

/* ------------------------------------------------------------- icons */
.m8i {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

/* ---------------------------------------------------------- surfaces */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 18px;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 14px 0;
}

/* ----------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-btn);
  font-weight: 650;
  font-size: 14.5px;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), opacity 0.18s;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  box-shadow: 0 14px 34px -10px rgba(192, 75, 255, 0.85);
}

.btn-secondary {
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.btn-secondary:hover {
  border-color: rgba(139, 92, 255, 0.55);
}

.btn-white {
  background: #fff;
  color: #1a1030;
}

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

.btn-ghost:hover {
  color: var(--text);
  background: var(--panel);
}

.btn-telegram {
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(34, 158, 217, 0.9);
}

.btn-lg {
  min-height: 52px;
  border-radius: var(--r-btn-lg);
  font-size: 15.5px;
  padding: 0 22px;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
  position: relative;
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn .dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ------------------------------------------------------------- chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--r-chip);
  font-size: 12px;
  font-weight: 650;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.chip svg {
  width: 13px;
  height: 13px;
}

.chip-ok {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
}

.chip-warn {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
}

.chip-bad {
  color: var(--bad);
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.25);
}

.chip-violet {
  color: #c4b2ff;
  background: rgba(139, 92, 255, 0.14);
  border-color: rgba(139, 92, 255, 0.3);
}

:root[data-theme="light"] .chip-violet {
  color: #6d3df0;
}

.chip-cyan {
  color: var(--cyan);
  background: rgba(56, 225, 255, 0.1);
  border-color: rgba(56, 225, 255, 0.25);
}

:root[data-theme="light"] .chip-cyan {
  color: #0e7490;
}

.chip-soon {
  height: 20px;
  padding: 0 7px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(255, 154, 90, 0.12);
  border-color: rgba(255, 154, 90, 0.3);
}

.chip-filter {
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.chip-filter .count {
  color: var(--faint);
  font-weight: 600;
}

.chip-filter[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: rgba(139, 92, 255, 0.55);
  color: var(--text);
}

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: 10px;
  z-index: 40;
  margin: 10px auto 0;
  max-width: 1400px;
  width: calc(100% - 2 * var(--gutter));
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border-radius: 22px;
  background: rgba(13, 11, 28, 0.66);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.78);
}

.topbar .spacer {
  flex: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-tile {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand);
  display: grid;
  place-items: center;
  box-shadow: var(--glow);
  flex: none;
}

.logo-tile img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.logo-text {
  display: none;
  line-height: 1.1;
}

.logo-text b {
  display: block;
  font-size: 15.5px;
  letter-spacing: 0.02em;
}

.logo-text span {
  font-size: 11.5px;
  color: var(--muted);
}

.search-pill {
  display: none;
  align-items: center;
  gap: 10px;
  height: 42px;
  width: min(420px, 34vw);
  padding: 0 8px 0 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--faint);
  font-size: 14px;
  text-align: left;
}

.search-pill:hover {
  border-color: var(--border-2);
}

.search-pill svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.search-pill span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-pill .kbd {
  flex: none;
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border-2);
}

.desk-only {
  display: none !important;
}

.wallet-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 12px 0 8px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 700;
  background: var(--panel-solid);
  isolation: isolate;
  white-space: nowrap;
}

.wallet-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  z-index: -1;
}

.wallet-chip .coin {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
}

.wallet-chip .coin svg {
  width: 14px;
  height: 14px;
}

.wallet-chip small {
  color: var(--muted);
  font-weight: 600;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #5b3df5, #c04bff);
  flex: none;
}

/* --------------------------------------------------- language picker */
.lang {
  position: relative;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
}

.lang-pill:hover,
.lang-pill[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--border-2);
}

.lang-pill svg {
  width: 16px;
  height: 16px;
}

.lang-pill .chev {
  width: 13px;
  height: 13px;
  transition: transform 0.18s;
}

.lang-pill[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 230px;
  padding: 6px;
  border-radius: 18px;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  animation: m8-fade-in 0.16s var(--ease);
}

.lang-menu[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  text-align: left;
  font-size: 14.5px;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: var(--panel-2);
}

.lang-option .code {
  font-size: 11px;
  font-weight: 750;
  color: var(--faint);
  width: 26px;
}

.lang-option .name {
  flex: 1;
}

.lang-option .check {
  width: 18px;
  height: 18px;
  color: var(--violet);
  opacity: 0;
}

.lang-option[aria-checked="true"] {
  background: var(--brand-soft);
}

.lang-option[aria-checked="true"] .check {
  opacity: 1;
}

/* ----------------------------------------------------------- sidebar */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px var(--gutter) 120px;
  display: block;
}

.sidebar {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  margin: 14px 10px 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav-group:first-child {
  margin-top: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px 8px 12px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  transition: background 0.16s, color 0.16s;
}

.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.nav-item svg.ico {
  width: 19px;
  height: 19px;
  flex: none;
}

.nav-item .label {
  flex: 1;
  min-width: 0;
}

.nav-item .label > span:first-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item .count {
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  padding: 1px 8px;
  border-radius: 8px;
  background: var(--panel);
}

.nav-item[aria-current="page"] {
  color: var(--text);
  background: var(--brand-soft);
}

.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 4px;
  background: var(--brand);
}

.nav-item[aria-current="page"] svg.ico {
  color: #c4b2ff;
}

.mini-badges {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
}

.mini-badge svg {
  width: 10px;
  height: 10px;
}

.mini-badge.new {
  color: #c4b2ff;
  background: rgba(139, 92, 255, 0.18);
}

.mini-badge.down {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.14);
}

.mini-badge.up {
  color: var(--bad);
  background: rgba(248, 113, 113, 0.14);
}

:root[data-theme="light"] .mini-badge.new {
  color: #6d3df0;
}

.side-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  background: var(--brand-soft);
  border: 1px solid rgba(139, 92, 255, 0.3);
}

.side-card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.side-card b {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

/* ------------------------------------------------------------ drawer */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}

.scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  z-index: 80;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(300px, 86vw);
  padding: 16px 12px 24px;
  overflow-y: auto;
  background: var(--panel-solid);
  border-right: 1px solid var(--border);
  transform: translateX(-104%);
  transition: transform 0.26s var(--ease);
}

.drawer.open {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}

/* -------------------------------------------------------------- dock */
.dock {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  height: 66px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 6px;
  border-radius: 24px;
  background: rgba(13, 11, 28, 0.78);
  border: 1px solid var(--border-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.8);
}

:root[data-theme="light"] .dock {
  background: rgba(255, 255, 255, 0.88);
}

.dock[hidden] {
  display: none;
}

.dock-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--faint);
  padding: 6px 0;
}

.dock-item svg {
  width: 22px;
  height: 22px;
}

.dock-item[aria-current="page"] {
  color: var(--text);
}

.dock-item[aria-current="page"] svg {
  color: #c4b2ff;
}

.dock-center {
  justify-self: center;
  width: 58px;
  height: 58px;
  margin-top: -26px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--glow), 0 0 0 5px var(--bg);
}

.dock-center svg {
  width: 26px;
  height: 26px;
}

/* -------------------------------------------------------------- tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}

.tab .count {
  font-size: 11.5px;
  color: var(--faint);
}

.tab[aria-selected="true"] {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-2);
}

/* -------------------------------------------------------------- sheet */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-wrap[hidden] {
  display: none;
}

/* A dialog's own scrim sits under its panel (the wrap is the stacking
   context, so the shared scrim z-index would otherwise cover the panel). */
.sheet-wrap > .scrim,
.palette-wrap > .scrim {
  z-index: 0;
}

.sheet,
.palette {
  z-index: 1;
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 10px 18px 22px;
  border-radius: 26px 26px 0 0;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  border-bottom: 0;
  animation: m8-sheet-up 0.24s var(--ease);
}

.sheet-grip {
  width: 44px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 5px;
  background: var(--border-2);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

@keyframes m8-sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* ------------------------------------------------------ option cards */
.options {
  display: grid;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  text-align: left;
  transition: border-color 0.16s, background 0.16s;
}

.option:hover:not([disabled]) {
  border-color: var(--border-2);
}

.option[aria-checked="true"] {
  border-color: rgba(139, 92, 255, 0.7);
  background: var(--brand-soft);
}

.option[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.option .opt-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}

.option .opt-ico svg {
  width: 20px;
  height: 20px;
}

.option .opt-text {
  flex: 1;
  min-width: 0;
}

.option .opt-text b {
  display: block;
  font-size: 14px;
}

.option .opt-text small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.option .radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  flex: none;
}

.option[aria-checked="true"] .radio {
  border: 6px solid var(--violet);
}

/* ------------------------------------------------------- empty state */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 18px;
  text-align: center;
  color: var(--muted);
}

.empty .empty-ico {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: #c4b2ff;
}

.empty .empty-ico svg {
  width: 28px;
  height: 28px;
}

.empty b {
  color: var(--text);
  font-size: 16px;
}

.empty p {
  margin: 0;
  max-width: 340px;
  font-size: 14px;
}

.empty .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ------------------------------------------------------------- toast */
.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------ switch */
.switch {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 28px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  flex: none;
  transition: background 0.18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--brand);
  border-color: transparent;
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
}

/* --------------------------------------------------------- accordion */
.acc-item {
  border-bottom: 1px solid var(--border);
}

.acc-item:last-child {
  border-bottom: 0;
}

.acc-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 2px;
  text-align: left;
  font-weight: 650;
}

.acc-q svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.18s;
  color: var(--faint);
}

.acc-q[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.acc-a {
  padding: 0 2px 14px;
  color: var(--muted);
  font-size: 14px;
}

.acc-a[hidden] {
  display: none;
}

/* ---------------------------------------------------- search palette */
.palette-wrap {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 12px 12px;
}

.palette-wrap[hidden] {
  display: none;
}

.palette {
  position: relative;
  width: min(640px, 100%);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.8);
  animation: m8-fade-in 0.16s var(--ease);
  overflow: hidden;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.palette-input svg {
  width: 20px;
  height: 20px;
  color: var(--faint);
  flex: none;
}

.palette-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 16px;
}

.palette-body {
  overflow-y: auto;
  padding: 10px 10px 14px;
}

.palette-label {
  margin: 10px 8px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.palette-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  text-align: left;
}

.palette-row:hover,
.palette-row:focus-visible,
.palette-row.active {
  background: var(--panel-2);
}

.palette-row .grow {
  flex: 1;
  min-width: 0;
}

.palette-row .grow b {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-row .grow small {
  color: var(--muted);
  font-size: 12.5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 6px;
}

/* ----------------------------------------------------------- spinner */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: m8-spin 0.8s linear infinite;
}

.skeleton {
  border-radius: var(--r-card-sm);
  background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel));
  background-size: 200% 100%;
  animation: m8-shimmer 1.3s linear infinite;
}

@keyframes m8-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------- breakpoints */
@media (min-width: 640px) {
  .sheet-wrap {
    align-items: center;
  }

  .sheet {
    border-radius: 26px;
    border-bottom: 1px solid var(--border-2);
  }

  .sheet-grip {
    display: none;
  }
}

@media (min-width: 980px) {
  .logo-text {
    display: block;
  }

  .search-pill {
    display: flex;
  }

  .mobile-only {
    display: none !important;
  }

  .desk-only {
    display: inline-flex !important;
  }

  .dock {
    display: none;
  }

  .layout {
    padding-bottom: 60px;
  }
}

@media (min-width: 1180px) {
  .menu-btn {
    display: none !important;
  }

  .layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .sidebar {
    display: block;
    position: sticky;
    top: calc(var(--topbar-h) + 28px);
    max-height: calc(100vh - var(--topbar-h) - 40px);
    overflow-y: auto;
    padding: 12px 10px 14px;
    scrollbar-width: thin;
  }
}

/* ------------------------------------------------------- product art */
.app-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 28%;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -10px rgba(0, 0, 0, 0.7);
  isolation: isolate;
}

.app-icon::before {
  content: "";
  position: absolute;
  inset: 0 0 52% 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  z-index: 1;
}

.app-icon-circle {
  position: absolute;
  width: 78%;
  height: 78%;
  right: -24%;
  bottom: -24%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.app-icon-text {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* A logo or photo inside the squircle: a soft neutral tile, the image
   contained with padding; the letters stay underneath as the fallback. */
.app-icon.has-img {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 1px var(--border-2), 0 8px 18px -10px rgba(0, 0, 0, 0.7);
}

:root[data-theme="light"] .app-icon.has-img {
  background: linear-gradient(145deg, #ffffff, #f1effa);
}

.app-icon.has-img .app-icon-text,
.app-icon.has-img .app-icon-circle {
  visibility: hidden;
}

.app-icon-img {
  position: absolute;
  inset: 12%;
  z-index: 2;
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.app-icon.glow {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 18px 50px -12px var(--glow-color);
}
