*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --radius-sm: 0.625rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --radius-pill: 999px;
  --profile-avatar-ring-width: 3px;
  --profile-avatar-ring-inner: #fff;
  --profile-avatar-ring-gradient: linear-gradient(
    145deg,
    #1d4ed8 0%,
    #2563eb 28%,
    #3b82f6 52%,
    #60a5fa 78%,
    #818cf8 100%
  );
  --profile-avatar-ring-shadow: 0 4px 18px rgb(29 78 216 / 22%);
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f6f7f9;
}

:root[data-theme="dark"] body {
  color: #f3f4f6;
  background: #111827;
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .cabinet-header {
  background: #1f2937;
  color: #f3f4f6;
}

:root[data-theme="dark"] .form__field input,
:root[data-theme="dark"] .form__field select,
:root[data-theme="dark"] .form-select {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

:root[data-theme="dark"] .cabinet-nav__link {
  color: #d1d5db;
}

:root[data-theme="dark"] .cabinet-nav__link.active {
  background: #1e3a5f;
  color: #93c5fd;
}

:root[data-theme="dark"] a {
  color: #93c5fd;
}

:root[data-theme="dark"] .btn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #f9fafb;
}

:root[data-theme="dark"] .btn--ghost {
  color: #e5e7eb;
  border-color: #4b5563;
}

:root[data-theme="dark"] .btn--ghost:hover {
  background: #374151;
}

:root[data-theme="dark"] .alert--ok {
  background: #064e3b;
  color: #a7f3d0;
}

:root[data-theme="dark"] .alert--warn {
  background: #78350f;
  color: #fde68a;
}

:root[data-theme="dark"] .session-list__item {
  border-bottom-color: #374151;
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgb(0 0 0 / 65%);
}

a {
  color: #1d4ed8;
}

.shell {
  min-height: 100vh;
}

.shell--auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.shell__brand {
  margin-bottom: 1rem;
}

.shell__brand-link {
  display: inline-flex;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  object-fit: contain;
}

/* Геометрия verba-logo-full.svg: полотно 733.76×480.61, знак ~90.82–634 × 187.73–292.88 */
.cabinet-header__brand {
  --brand-header-mark-height: 1.75rem;
  display: inline-block;
  flex-shrink: 0;
  height: var(--brand-header-mark-height);
  width: calc(var(--brand-header-mark-height) * 543.18 / 105.15);
  margin-right: auto;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.brand-logo--header {
  height: calc(var(--brand-header-mark-height) * 480.61 / 105.15);
  width: auto;
  aspect-ratio: 733.76 / 480.61;
  margin-top: calc(var(--brand-header-mark-height) * -187.73 / 105.15);
  margin-left: calc(var(--brand-header-mark-height) * -90.82 / 105.15);
  flex-shrink: 0;
}

.card {
  width: 100%;
  max-width: 28rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.card--wide {
  max-width: 40rem;
}

.shell--cabinet .card {
  margin: 0 auto 2rem;
}

.cabinet-main {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
}

.settings-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-page > h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.settings-page > .alert,
.settings-page > .form__hint {
  margin: 0;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.settings-card__kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}

.settings-card__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-card__body > .form {
  margin-top: 0;
}

.settings-card__body > h2:not(.settings-card__kicker) {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.settings-card__link {
  margin: 0;
  font-size: 0.95rem;
  color: #374151;
}

:root[data-theme="dark"] .settings-card {
  background: #1f2937;
  box-shadow: 0 1px 3px rgb(0 0 0 / 35%);
}

:root[data-theme="dark"] .settings-card__kicker {
  color: #9ca3af;
}

:root[data-theme="dark"] .settings-card__link {
  color: #d1d5db;
}

.cabinet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.cabinet-nav {
  display: flex;
  gap: 0.75rem;
}

.cabinet-nav__link {
  text-decoration: none;
  color: #444;
  padding: 0.45rem 0.65rem;
  font-size: 0.9375rem;
  line-height: 1.25;
  border-radius: var(--radius-sm);
}

.cabinet-nav__link.active {
  color: #1d4ed8;
  background: #eff6ff;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.form__field-label {
  font-weight: 500;
  color: #374151;
}

.form__field-control {
  width: 100%;
}

.form__field input,
.form__field select,
.form__field textarea,
.form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  font: inherit;
  background: #fff;
  color: inherit;
}

.form__field select,
.form-select {
  appearance: none;
  padding-right: 2.25rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath fill=%27none%27 stroke=%27%236b7280%27 stroke-width=%271.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 d=%27M2.5 4.5 6 8l3.5-3.5%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.form--settings {
  gap: 1rem;
}

.theme-segment {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #eceff3;
}

.theme-segment__item {
  margin: 0;
  cursor: pointer;
}

.theme-segment__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.theme-segment__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: #6b7280;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.theme-segment__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.theme-segment__input:checked + .theme-segment__btn {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}

.theme-segment__input:focus-visible + .theme-segment__btn {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

:root[data-theme="dark"] .theme-segment {
  background: #374151;
  border-color: #4b5563;
}

:root[data-theme="dark"] .theme-segment__btn {
  color: #9ca3af;
}

:root[data-theme="dark"] .theme-segment__input:checked + .theme-segment__btn {
  background: #1f2937;
  color: #f9fafb;
}

.pill-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-choice__item {
  margin: 0;
  cursor: pointer;
}

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

.pill-choice__pill {
  display: inline-block;
  min-height: 2.25rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  line-height: 1.35;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.pill-choice__input:checked + .pill-choice__pill {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.pill-choice__input:focus-visible + .pill-choice__pill {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.pill-choice__input:disabled + .pill-choice__pill {
  opacity: 0.55;
  cursor: not-allowed;
}

:root[data-theme="dark"] .form__field-label {
  color: #e5e7eb;
}

:root[data-theme="dark"] .pill-choice__pill {
  background: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

:root[data-theme="dark"] .pill-choice__input:checked + .pill-choice__pill {
  background: #2563eb;
  border-color: #2563eb;
  color: #f9fafb;
}

@media (prefers-reduced-motion: reduce) {
  .pill-choice__pill {
    transition: none;
  }
}

.pill-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.notif-product-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  background: #f9fafb;
}

.notif-product-group__hint {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.45;
}

:root[data-theme="dark"] .notif-product-group {
  background: #1f2937;
  border-color: #4b5563;
}

:root[data-theme="dark"] .notif-product-group__hint {
  color: #9ca3af;
}

.pill-toggle__label {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  line-height: 1.45;
}

.pill-toggle__control {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
}

.pill-toggle__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pill-toggle__input:disabled {
  cursor: not-allowed;
}

.pill-toggle:has(.pill-toggle__input:disabled) .pill-toggle__label {
  cursor: not-allowed;
  opacity: 0.65;
}

.pill-toggle__track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.15s ease;
}

.pill-toggle__thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 18%);
  transition: transform 0.15s ease;
}

.pill-toggle__input:checked + .pill-toggle__track {
  background: #16a34a;
}

.pill-toggle__input:checked + .pill-toggle__track .pill-toggle__thumb {
  transform: translateX(1.25rem);
}

.pill-toggle__input:focus-visible + .pill-toggle__track {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

.pill-toggle__input:disabled + .pill-toggle__track {
  opacity: 0.55;
}

:root[data-theme="dark"] .pill-toggle__track {
  background: #4b5563;
}

:root[data-theme="dark"] .pill-toggle__input:checked + .pill-toggle__track {
  background: #22c55e;
}

:root[data-theme="dark"] .pill-toggle__thumb {
  background: #f9fafb;
}

@media (prefers-reduced-motion: reduce) {
  .pill-toggle__track,
  .pill-toggle__thumb {
    transition: none;
  }
}

.form__hint {
  color: #6b7280;
  font-size: 0.85rem;
}

.form__error {
  margin: 0.5rem 0 0;
  color: #b42318;
  font-size: 0.85rem;
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

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

.avatar-upload__zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-lg);
  background: #f9fafb;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.avatar-upload__zone--drag {
  border-color: #1d4ed8;
  background: #eff6ff;
}

.avatar-upload__zone--has-preview {
  padding-top: 1rem;
}

.avatar-upload__placeholder {
  display: flex;
  color: #9ca3af;
}

.avatar-upload__hint {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
}

.avatar-upload__preview-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.avatar-upload__preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}

.avatar-upload__processing {
  font-size: 0.8rem;
  color: #6b7280;
}

.avatar-upload__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.avatar-upload__control {
  display: flex;
  flex: 1 1 12rem;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.avatar-upload__control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}

.avatar-upload__control input[type="range"] {
  width: 100%;
}

.avatar-upload__rotate,
.avatar-upload__remove {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.avatar-upload__ready {
  margin-top: 0.5rem;
}


:root[data-theme="dark"] .avatar-upload__zone {
  background: #111827;
  border-color: #4b5563;
}

:root[data-theme="dark"] .avatar-upload__zone--drag {
  border-color: #3b82f6;
  background: #1e3a5f;
}

:root[data-theme="dark"] .avatar-upload__hint,
:root[data-theme="dark"] .avatar-upload__processing,
:root[data-theme="dark"] .avatar-upload__control-label {
  color: #9ca3af;
}

.form__footer {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.form--inline-actions {
  margin-top: 1rem;
}

.btn {
  font: inherit;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: #1d4ed8;
  color: #fff;
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  border-color: #d1d5db;
  color: #374151;
}

.alert {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert--error {
  color: #b42318;
  background: #fef3f2;
}

.alert--warn {
  color: #93370d;
  background: #fffaeb;
}

.profile-verify-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.profile-verify-banner > p {
  margin: 0;
  flex: 1 1 12rem;
}

.alert--ok {
  color: #027a48;
  background: #ecfdf3;
}

.alert__meta {
  font-size: 0.85rem;
  color: #667085;
}

.loading {
  color: #6b7280;
}

.section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.session-list__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.session-list__meta {
  font-size: 0.85rem;
  color: #6b7280;
}

:root[data-theme="dark"] .session-list__meta,
:root[data-theme="dark"] .form__hint {
  color: #9ca3af;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(0 0 0 / 45%);
}

.modal {
  width: 100%;
  max-width: 24rem;
  margin: 0;
}

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

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.15rem;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  border-radius: 4px;
}

.modal__close:hover {
  color: #111827;
}

.modal__close:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

:root[data-theme="dark"] .modal__close {
  color: #9ca3af;
}

:root[data-theme="dark"] .modal__close:hover {
  color: #f3f4f6;
}

.modal--avatar-editor {
  max-width: 26.5rem;
  padding: 1.25rem;
}

.avatar-crop {
  --crop-size: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin: 0 auto;
}

.avatar-crop__viewport {
  position: relative;
  box-sizing: border-box;
  width: var(--crop-size);
  height: var(--crop-size);
  min-width: var(--crop-size);
  min-height: var(--crop-size);
  max-width: var(--crop-size);
  max-height: var(--crop-size);
  flex: 0 0 var(--crop-size);
  overflow: hidden;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  background: #111827;
  cursor: grab;
  touch-action: none;
  user-select: none;
  overscroll-behavior: contain;
}

.avatar-crop__viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgb(255 255 255 / 85%);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 25%);
  pointer-events: none;
  background:
    linear-gradient(
      to right,
      rgb(255 255 255 / 35%) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      rgb(255 255 255 / 35%) 1px,
      transparent 1px
    );
  background-size: 33.33% 100%, 100% 33.33%;
}

.avatar-crop__viewport:active {
  cursor: grabbing;
}

.avatar-crop__image {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform-origin: center center;
  pointer-events: none;
}

.avatar-crop__hint {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.8rem;
}

.profile-form .profile-avatar-wrap {
  align-self: center;
  width: min(100%, 20rem);
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-xl);
  background: #eef0f6;
}

.profile-avatar-wrap {
  --profile-avatar-size: 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.profile-avatar__ring {
  display: inline-flex;
  flex-shrink: 0;
  padding: var(--profile-avatar-ring-width);
  border-radius: 50%;
  background: var(--profile-avatar-ring-gradient);
  box-shadow: var(--profile-avatar-ring-shadow);
}

.profile-avatar {
  display: inline-flex;
  flex-shrink: 0;
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  padding: 0;
  border: 2px solid var(--profile-avatar-ring-inner);
  background: none;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
}

.profile-avatar:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-avatar__img,
.profile-avatar__placeholder {
  display: block;
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 600;
  color: #4b5563;
  background: #e5e7eb;
}

.profile-avatar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.profile-avatar__action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
  color: #374151;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.25;
}

.profile-avatar__action:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.profile-avatar__action--delete:hover:not(:disabled) {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.profile-avatar__action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}

.avatar-editor__preview-stage {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  flex-shrink: 0;
  padding: var(--profile-avatar-ring-width);
  border-radius: 50%;
  background: var(--profile-avatar-ring-gradient);
  box-shadow: var(--profile-avatar-ring-shadow);
  box-sizing: content-box;
}

.avatar-editor__preview-disk {
  width: 120px;
  height: 120px;
  border: 2px solid var(--profile-avatar-ring-inner);
  border-radius: 50%;
  overflow: hidden;
  box-sizing: border-box;
}

.avatar-editor__toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: #f9fafb;
}

.avatar-editor__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: #374151;
  cursor: pointer;
}

.avatar-editor__tool:hover:not(:disabled) {
  background: #e5e7eb;
  color: #111827;
}

.avatar-editor__tool:first-child:hover:not(:disabled) {
  color: #b91c1c;
  background: #fef2f2;
}

.avatar-editor__tool:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.avatar-editor__tool--compact {
  width: 2rem;
  height: 2.5rem;
}

.avatar-editor__toolbar-scale {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.avatar-editor__toolbar-scale--inactive {
  opacity: 0.35;
  pointer-events: none;
}

.avatar-editor__scale-range {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.avatar-editor__preview-disk--clear {
  background:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 10px 10px;
  background-position:
    0 0,
    0 5px,
    5px -5px,
    -5px 0;
  background-color: #fff;
}

.avatar-editor__preview {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
}

.avatar-editor__preview--empty {
  border: 2px dashed #d1d5db;
}

.avatar-editor__processing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 75%);
  font-size: 0.85rem;
}

.avatar-editor__swatches {
  display: grid;
  grid-template-columns: repeat(5, 2.25rem);
  justify-content: center;
  gap: 0.5rem 0.625rem;
  width: 100%;
}

.avatar-editor__swatch {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  cursor: pointer;
}

.avatar-editor__swatch--clear {
  background:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 8px 8px;
  background-position:
    0 0,
    0 4px,
    4px -4px,
    -4px 0;
  background-color: #fff;
}

.avatar-editor__swatch--active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px #fff;
}

.avatar-editor__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  width: 100%;
  max-height: 10rem;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  background: #f9fafb;
}

.avatar-editor__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  background-color: #fff;
}

.avatar-editor__cell.avatar-editor__cell--clear-bg {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 6px 6px;
  background-position:
    0 0,
    0 3px,
    3px -3px,
    -3px 0;
}

.avatar-editor__cell--upload {
  background: #374151;
  color: #f9fafb;
}

.avatar-editor__cell--active {
  border-color: #1d4ed8;
}

.avatar-editor__emoji {
  font-size: 1.5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.avatar-editor__save {
  width: 100%;
  margin-top: 0.15rem;
}

:root[data-theme="dark"] .profile-avatar__placeholder {
  background: #374151;
  color: #e5e7eb;
}

:root[data-theme="dark"] .profile-avatar__action {
  background: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
}

:root[data-theme="dark"] {
  --profile-avatar-ring-gradient: linear-gradient(
    145deg,
    #2563eb 0%,
    #3b82f6 30%,
    #60a5fa 60%,
    #93c5fd 100%
  );
  --profile-avatar-ring-shadow: 0 4px 20px rgb(37 99 235 / 35%);
}

:root[data-theme="dark"] .profile-form .profile-avatar-wrap {
  background: #1f2937;
}

:root[data-theme="dark"] .avatar-editor__grid {
  background: #111827;
  border-color: #4b5563;
}

:root[data-theme="dark"] .avatar-editor__cell--upload {
  background: #4b5563;
}

:root[data-theme="dark"] .avatar-editor__toolbar {
  background: #111827;
  border-color: #4b5563;
}

:root[data-theme="dark"] .avatar-editor__tool {
  color: #e5e7eb;
}

:root[data-theme="dark"] .avatar-editor__tool:hover:not(:disabled) {
  background: #374151;
  color: #f9fafb;
}

:root[data-theme="dark"] .avatar-editor__swatch--clear,
:root[data-theme="dark"] .avatar-editor__cell--clear-bg {
  background-color: #374151;
}

