.theme-seg-mobile {
  display: none;
}

.theme-seg-mobile .theme-mobile-when-dark,
.theme-seg-mobile .theme-mobile-when-light {
  display: none;
}

.theme-seg-mobile .theme-mobile-when-dark:not([hidden]),
.theme-seg-mobile .theme-mobile-when-light:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.theme-seg {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  padding: 5px 25px;
  gap: 15px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  border: 1px solid var(--stroke);
  min-width: 0;
  width: max-content;
}

.theme-seg-btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.42rem 0.28rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: var(--fg-muted);
  background: transparent;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 2.65rem;
}

.theme-seg-lbl {
  line-height: 1;
}

.theme-seg-ico {
  opacity: 0.82;
}

.theme-seg-btn:hover {
  color: var(--fg);
}

.theme-seg-btn.is-selected {
  color: var(--fg);
  background: linear-gradient(180deg, var(--elev), var(--elev2));
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--fg) 12%, transparent);
}

.theme-seg-btn[data-theme-choice="dark"].is-selected {
  background: transparent;
  border: none;
  box-shadow: none;
}

.theme-seg-btn[data-theme-choice="system"].is-selected {
  background: transparent;
  border: none;
  box-shadow: none;
}

.theme-seg-btn.is-selected .theme-seg-ico {
  opacity: 1;
  color: var(--accent);
}

.theme-seg-mobile.theme-seg {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  gap: 0;
}

.theme-seg-mobile.theme-seg.theme-seg-mobile--chat {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  padding: 5px 25px;
  gap: 15px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  border: 1px solid var(--stroke);
  box-shadow: none;
  min-width: 0;
  width: auto;
}

.theme-seg-mobile .theme-seg-btn.is-selected {
  background: transparent;
  border: none;
  box-shadow: none;
}

.theme-seg-mobile.theme-seg.theme-seg-mobile--chat .theme-seg-btn.is-selected {
  color: var(--fg);
  background: linear-gradient(180deg, var(--elev), var(--elev2));
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--fg) 12%, transparent);
}

.theme-seg-mobile.theme-seg.theme-seg-mobile--chat .theme-seg-btn[data-theme-choice="dark"].is-selected {
  background: transparent;
  border: none;
  box-shadow: none;
}

.theme-seg-mobile.theme-seg.theme-seg-mobile--chat .theme-seg-btn.is-selected .theme-seg-ico {
  opacity: 1;
  color: var(--accent);
}

@media (min-width: 901px) {
  .theme-seg-mobile,
  .theme-seg-mobile.theme-seg {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .theme-seg {
    width: 100%;
  }

  .theme-seg-desktop {
    display: none !important;
  }

  .theme-seg-mobile {
    display: inline-grid;
    grid-template-columns: 1fr;
    min-width: 0;
    width: auto;
  }

  .theme-seg-mobile.theme-seg {
    width: auto;
    min-width: 0;
  }
}

.header-mobile-ctrl {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 900px) {
  .header-mobile-ctrl {
    display: flex;
  }
}

@media (min-width: 901px) {
  .theme-seg.theme-seg-desktop {
    grid-template-columns: repeat(4, auto);
    min-width: 0;
    width: max-content;
  }

  .theme-seg.theme-seg-desktop.theme-seg-desktop--chat {
    grid-template-columns: repeat(5, auto);
    min-width: 0;
    width: max-content;
  }
}
