/* Sovetnik UI refinement layer.
   Kept separate from legacy styles so the visual system stays easy to maintain. */

:root {
  --composer-inset: 154px;
  --ui-navy: #12375f;
  --ui-blue: #246aa6;
  --ui-blue-soft: #eaf2fa;
  --ui-gold: #b58a3c;
  --ui-paper: rgba(255, 255, 255, 0.94);
  --ui-line: rgba(107, 137, 171, 0.22);
  --ui-muted: #687a90;
  --ui-focus: 0 0 0 3px rgba(37, 112, 176, 0.2);
  --ui-shadow-sm: 0 10px 26px rgba(21, 55, 93, 0.08);
  --ui-shadow-md: 0 20px 52px rgba(21, 55, 93, 0.12);
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus);
}

button:disabled {
  cursor: not-allowed;
  filter: saturate(0.72);
}

::selection {
  background: rgba(49, 119, 181, 0.2);
  color: #102f53;
}

/* Navigation */
.sidebar {
  border-right-color: rgba(100, 130, 166, 0.16);
  box-shadow: 15px 0 50px rgba(26, 55, 89, 0.035);
}

.account-card {
  min-height: 64px;
  border-color: var(--ui-line);
  background:
    radial-gradient(circle at 100% 0, rgba(73, 137, 197, 0.1), transparent 38%),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 9px 25px rgba(24, 56, 93, 0.055);
}

.settings-btn,
.new-chat,
.quick-new-chat-btn,
.voice-call-btn--topbar {
  display: inline-grid;
  place-items: center;
}

.sidebar-title {
  letter-spacing: -0.02em;
}

.search-chat {
  min-height: 42px;
  border-color: rgba(103, 136, 171, 0.2);
  background-color: rgba(255, 255, 255, 0.77);
}

.history {
  padding: 1px 2px 10px;
}

.history-item {
  position: relative;
  min-height: 47px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.history-item::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 3px;
  border-radius: 0 5px 5px 0;
  background: transparent;
}

.history-item:hover {
  border-color: rgba(99, 133, 170, 0.13);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(24, 57, 95, 0.05);
}

.history-item--active {
  border-color: rgba(69, 121, 177, 0.18);
  background: linear-gradient(145deg, #ffffff, #eef5fc);
  box-shadow: 0 10px 25px rgba(25, 65, 108, 0.08);
}

.history-item--active::before {
  background: linear-gradient(180deg, #2d79b9, #174a86);
}

.topbar {
  border-bottom-color: rgba(111, 141, 173, 0.13);
  background:
    linear-gradient(180deg, rgba(252, 254, 255, 0.94), rgba(248, 251, 253, 0.86));
}

.topbar-row {
  min-height: 47px;
}

.topbar-title h1 {
  letter-spacing: -0.035em;
}

.topbar-actions {
  align-items: center;
}

.topbar-actions .voice-call-btn,
.quick-new-chat-btn,
.menu-btn {
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 13px;
}

.menu-btn {
  gap: 7px;
  border-color: rgba(106, 140, 176, 0.22);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 21px rgba(25, 61, 100, 0.06);
}

/* New conversation */
.chat-feed:has(.chat-intro:not(.hidden)) {
  overflow-y: auto;
}

.chat-intro {
  min-height: 0;
  align-content: start;
  gap: 14px;
  padding: clamp(28px, 6.5vh, 68px) 0 22px;
}

.start-card {
  overflow: hidden;
  border-color: rgba(101, 136, 173, 0.18);
  border-radius: 25px;
  padding: clamp(27px, 3.1vw, 38px);
  box-shadow:
    0 24px 58px rgba(26, 58, 96, 0.105),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.start-card h2 {
  max-width: 740px;
  font-size: clamp(35px, 4.6vw, 48px);
  line-height: 1.02;
}

.start-subtitle {
  max-width: 650px;
  margin-top: 14px;
  line-height: 1.58;
}

.suggest-grid {
  gap: 10px;
}

.suggest {
  min-height: 58px;
  border-color: rgba(104, 137, 173, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 9px 25px rgba(26, 58, 96, 0.045);
}

.suggest:hover {
  transform: translateY(-2px);
}

/* Messages and context actions */
.message {
  border-color: rgba(111, 142, 175, 0.17);
}

.message--assistant {
  box-shadow: 0 11px 29px rgba(23, 56, 92, 0.055);
}

.message-actions {
  gap: 5px;
}

.message-action-btn {
  min-height: 31px;
  border-radius: 9px;
}

.followup-row {
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.followup-chip {
  scroll-snap-align: start;
  border-color: rgba(91, 127, 165, 0.19);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 7px 20px rgba(22, 57, 95, 0.05);
}

.message-sources {
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.source-pill {
  scroll-snap-align: start;
}

/* Composer */
.composer-wrap {
  border-top-color: rgba(100, 133, 169, 0.15);
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.79), rgba(246, 249, 252, 0.98));
}

.composer {
  border-color: rgba(97, 133, 171, 0.29);
  box-shadow:
    0 15px 40px rgba(21, 55, 93, 0.105),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.composer:focus-within {
  border-color: rgba(46, 112, 174, 0.5);
  box-shadow:
    0 17px 46px rgba(21, 65, 111, 0.14),
    0 0 0 3px rgba(40, 110, 174, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.composer textarea:focus-visible {
  box-shadow: none;
}

.model-switch,
.topic-select {
  border-color: rgba(101, 135, 172, 0.2);
}

.model-btn,
.topic-select,
.send-btn,
.voice-btn,
.attach-btn {
  min-height: 40px;
}

.send-btn {
  border-radius: 12px;
  box-shadow: 0 10px 23px rgba(25, 77, 132, 0.17);
}

.voice-btn,
.attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.voice-btn-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
}

.attach-btn::after,
.voice-call-btn::after {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Install prompt */
.install-banner {
  bottom: 18px;
  width: min(470px, calc(100vw - 24px));
  border-color: rgba(96, 132, 171, 0.24);
  border-radius: 19px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.98), transparent 43%),
    rgba(246, 250, 254, 0.96);
  box-shadow: 0 24px 65px rgba(10, 38, 71, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

body.ui-overlay-open .install-banner {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.install-banner-action {
  white-space: nowrap;
}

/* Authentication */
.modal-card--narrow {
  width: min(440px, 100%);
}

.auth-brand {
  margin-bottom: 12px;
}

.modal-card--narrow > .modal-kicker {
  margin-top: 0;
}

#authTitle {
  max-width: 350px;
  font-size: clamp(29px, 5vw, 38px);
  letter-spacing: -0.045em;
}

#authNote {
  max-width: 360px;
  line-height: 1.5;
}

.auth-tabs {
  padding: 3px;
  border: 1px solid rgba(98, 132, 169, 0.17);
}

.auth-tab {
  min-height: 39px;
}

.modal-form input {
  min-height: 46px;
}

.modal-form .auth-password-toggle {
  justify-self: end;
  min-height: 26px;
  margin: -5px 2px -1px;
  border: 0;
  background: transparent;
  color: #426b96;
  padding: 2px 0;
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.modal-form .auth-password-toggle:hover {
  color: #174a86;
  background: transparent;
  box-shadow: none;
}

.auth-yandex-button {
  min-height: 48px;
}

/* Settings */
.settings-menu-card {
  border-color: rgba(108, 140, 176, 0.21);
  box-shadow: 0 24px 60px rgba(15, 44, 78, 0.18);
}

.settings-menu-row {
  min-height: 48px;
  border-radius: 12px;
}

.settings-menu-row:hover {
  background: rgba(227, 238, 248, 0.75);
}

.settings-menu-icon {
  flex: 0 0 auto;
}

/* Support */
.support-layout {
  background:
    radial-gradient(circle at 90% 0, rgba(54, 119, 183, 0.12), transparent 30%),
    linear-gradient(145deg, #edf3f8, #e7eef4);
}

.support-panel {
  border-color: rgba(122, 154, 189, 0.24);
  box-shadow: 0 30px 80px rgba(19, 50, 85, 0.14);
}

.support-head {
  align-items: center;
}

.support-head h2 {
  font-size: clamp(31px, 4vw, 42px);
}

.support-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid rgba(96, 132, 171, 0.2);
  background: rgba(255, 255, 255, 0.78);
  color: #174a86;
  box-shadow: 0 9px 23px rgba(31, 82, 143, 0.08);
}

.support-back-btn span:first-child {
  font-size: 18px;
  line-height: 1;
}

.support-empty {
  display: grid;
  justify-items: center;
  max-width: 420px;
  color: var(--ui-muted);
  text-align: center;
}

.support-empty strong {
  margin-top: 13px;
  color: #173b62;
  font: 600 24px/1.1 Fraunces, Georgia, serif;
}

.support-empty p {
  margin: 9px 0 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.support-empty-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(73, 126, 181, 0.18);
  border-radius: 19px;
  background: linear-gradient(145deg, #ffffff, #e9f3fb);
  color: #246aa6;
  box-shadow: 0 15px 35px rgba(27, 71, 117, 0.12);
}

.support-empty-icon::before {
  content: "";
  width: 27px;
  height: 27px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a9 9 0 0 0-9 9v4a3 3 0 0 0 3 3h2v-7H5a7 7 0 0 1 14 0h-3v7h2v1h-5v2h5a3 3 0 0 0 3-3v-7a9 9 0 0 0-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a9 9 0 0 0-9 9v4a3 3 0 0 0 3 3h2v-7H5a7 7 0 0 1 14 0h-3v7h2v1h-5v2h5a3 3 0 0 0 3-3v-7a9 9 0 0 0-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.support-empty button {
  min-height: 42px;
  margin-top: 17px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(145deg, #174a86, #2d70ac);
  color: #fff;
  padding: 0 18px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 13px 28px rgba(25, 75, 127, 0.2);
}

.support-panel--guest {
  grid-template-rows: auto minmax(0, 1fr);
}

.support-form[hidden] {
  display: none !important;
}

.support-form input:focus,
.support-form textarea:focus {
  border-color: rgba(47, 111, 173, 0.54);
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.08);
}

/* FAQ */
.faq-nav {
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.faq-nav::-webkit-scrollbar {
  display: none;
}

.faq-nav a {
  scroll-snap-align: start;
}

.faq-card {
  border-color: rgba(88, 123, 161, 0.16);
}

/* Voice */
.voice-call-close {
  display: grid;
  place-items: center;
  padding: 0 0 3px;
}

.voice-call-duration {
  font-variant-numeric: tabular-nums;
}

/* Dark theme refinements */
:root[data-theme="dark"] {
  --ui-focus: 0 0 0 3px rgba(100, 174, 238, 0.25);
}

:root[data-theme="dark"] ::selection {
  background: rgba(100, 174, 238, 0.27);
  color: #f1f6ff;
}

:root[data-theme="dark"] .account-card,
:root[data-theme="dark"] .menu-btn,
:root[data-theme="dark"] .followup-chip {
  background: rgba(16, 33, 56, 0.82);
  border-color: rgba(135, 171, 211, 0.16);
}

:root[data-theme="dark"] .support-layout {
  background:
    radial-gradient(circle at 90% 0, rgba(47, 104, 176, 0.18), transparent 31%),
    linear-gradient(145deg, #07111f, #0d1c31);
}

:root[data-theme="dark"] .support-empty strong {
  color: #e4efff;
}

:root[data-theme="dark"] .support-empty {
  color: #98abc3;
}

:root[data-theme="dark"] .support-empty-icon,
:root[data-theme="dark"] .support-back-btn {
  border-color: rgba(135, 171, 211, 0.2);
  background: rgba(17, 36, 60, 0.9);
  color: #9bc6ed;
}

@media (max-width: 1080px) {
  .sidebar {
    border-right: 1px solid rgba(104, 137, 173, 0.18);
    box-shadow: 18px 0 58px rgba(8, 31, 59, 0.18);
  }
}

@media (max-width: 760px) {
  :root {
    --composer-inset: 160px;
  }

  .topbar {
    padding: max(10px, env(safe-area-inset-top)) 10px 8px;
  }

  .topbar-row {
    min-height: 42px;
  }

  .topbar-title h1 {
    max-width: 43vw;
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .voice-call-btn,
  .quick-new-chat-btn,
  .menu-btn {
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 12px;
  }

  .menu-btn {
    padding: 0 11px;
    font-size: 12px;
  }

  .chat-feed {
    padding-top: 5px;
  }

  .chat-intro {
    min-height: 0;
    align-content: start;
    gap: 9px;
    padding: 21px 0 8px;
  }

  .start-card {
    border-radius: 20px;
    padding: 20px 16px 18px;
  }

  .start-card h2 {
    font-size: clamp(28px, 8vw, 35px);
    line-height: 1.03;
  }

  .start-subtitle {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.47;
  }

  .suggest-grid {
    gap: 7px;
  }

  .suggest {
    min-height: 50px;
    border-radius: 14px;
    padding: 9px 8px 9px 36px;
    font-size: 11px;
    line-height: 1.25;
  }

  .suggest::before {
    left: 11px;
  }

  .chat-stream {
    scroll-padding-bottom: 18px;
  }

  .message {
    border-radius: 15px;
  }

  .followup-row,
  .message-sources {
    margin-right: -10px;
    padding-right: 20px;
  }

  .followup-chip {
    flex: 0 0 auto;
    max-width: min(82vw, 350px);
    min-height: 37px;
    border-radius: 12px;
    padding: 8px 11px;
    overflow: visible;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
  }

  .source-pill {
    min-height: 29px;
  }

  .source-pill-host {
    max-width: 48vw;
  }

  .chat-action {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .chat-action::after {
    width: 15px;
    height: 15px;
  }

  .message-action-btn {
    width: 36px;
    min-height: 34px;
  }

  .composer-wrap {
    padding: 7px 9px max(8px, env(safe-area-inset-bottom));
  }

  .composer {
    gap: 7px;
    border-radius: 15px;
    padding: 8px;
  }

  .composer textarea {
    min-height: 28px;
    max-height: 112px;
    line-height: 1.4;
  }

  .tools-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 41px 41px;
    gap: 6px;
  }

  .model-switch {
    order: 1;
    grid-column: 1;
    width: 100%;
  }

  .model-btn {
    min-width: 0;
    min-height: 36px;
    padding: 7px 5px;
    font-size: 10px;
  }

  .topic-select {
    order: 2;
    grid-column: 2 / -1;
    width: 100%;
    min-height: 36px;
    padding-left: 9px;
  }

  .topic-select > span {
    display: none;
  }

  .topic-select select {
    min-height: 34px;
    font-size: 11px;
  }

  .send-btn {
    order: 3;
    grid-column: 1 / 3;
    width: 100%;
    min-height: 40px;
  }

  .voice-btn {
    order: 4;
    grid-column: 3;
    width: 41px;
    height: 40px;
  }

  .attach-btn {
    order: 5;
    grid-column: 4;
    width: 41px;
    height: 40px;
  }

  .composer-meta {
    min-height: 15px;
  }

  .status {
    font-size: 10px;
  }

  .install-banner {
    bottom: calc(var(--composer-inset) + env(safe-area-inset-bottom) + 7px);
    grid-template-columns: 34px minmax(0, 1fr) auto 32px;
    gap: 8px;
    width: calc(100vw - 18px);
    border-radius: 16px;
    padding: 9px;
  }

  .install-banner-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .install-banner-title {
    font-size: 11px;
  }

  .install-banner-text {
    display: -webkit-box;
    margin-top: 2px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .install-banner-action {
    min-height: 34px;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 9px;
  }

  .install-banner-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .modal {
    align-items: center;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }

  .modal-card--narrow {
    max-height: calc(var(--app-height) - 16px);
    overflow-y: auto;
    border-radius: 21px;
    padding: 18px 16px;
  }

  .auth-brand {
    margin-bottom: 8px;
  }

  #authTitle {
    font-size: 29px;
  }

  #authNote {
    margin-top: 7px;
    font-size: 11px;
  }

  .auth-tabs {
    margin-top: 13px;
  }

  .modal-form {
    gap: 8px;
  }

  .modal-form input {
    min-height: 43px;
  }

  .auth-yandex-button {
    min-height: 44px;
  }

  .settings-menu-card {
    max-height: min(76dvh, calc(var(--app-height) - 22px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .settings-menu-head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: inherit;
  }

  .settings-menu-row {
    min-height: 47px;
  }

  .support-layout {
    place-items: stretch;
  }

  .support-panel {
    height: var(--app-height);
  }

  .support-head {
    min-height: 92px;
    flex-direction: row;
    align-items: center;
    padding: max(13px, env(safe-area-inset-top)) 14px 13px;
  }

  .support-head h2 {
    margin: 3px 0 4px;
    font-size: 27px;
  }

  .support-kicker,
  .support-status {
    font-size: 10px;
  }

  .support-status {
    max-width: 245px;
    line-height: 1.35;
  }

  .support-back-btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    border-radius: 12px;
    padding: 0 11px;
    font-size: 11px;
  }

  .support-messages {
    padding: 14px;
  }

  .support-empty {
    align-self: center;
    margin: auto;
    padding: 10px 8px 20px;
  }

  .support-empty strong {
    font-size: 22px;
  }

  .support-empty p {
    max-width: 310px;
    font-size: 12px;
  }

  .support-form {
    padding: 11px 12px max(12px, env(safe-area-inset-bottom));
  }

  .support-form textarea {
    min-height: 84px;
    max-height: 150px;
  }

  .faq-layout {
    padding-right: 10px;
    padding-left: 10px;
  }

  .faq-head {
    gap: 10px;
  }

  .faq-head h2 {
    font-size: 28px;
  }

  .faq-head p:last-child {
    max-width: 280px;
    font-size: 11px;
  }

  .faq-nav {
    position: relative;
    margin-right: -10px;
    margin-left: -10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding-right: 18px;
    padding-left: 10px;
  }

  .faq-grid {
    gap: 9px;
  }

  .faq-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    grid-template-areas:
      "number demo"
      "title demo"
      "copy copy"
      "example example";
    min-height: 0;
    border-radius: 18px;
    padding: 15px;
  }

  .faq-number {
    grid-area: number;
  }

  .faq-card h3 {
    grid-area: title;
    margin: 7px 0 8px;
    font-size: 18px;
  }

  .faq-card p {
    grid-area: copy;
    max-width: none;
    font-size: 11px;
    line-height: 1.55;
  }

  .faq-card code {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    grid-area: example;
    margin-top: 12px;
  }

  .faq-demo {
    position: relative;
    top: auto;
    right: auto;
    grid-area: demo;
    justify-self: end;
    width: 82px;
    height: 64px;
    border-radius: 14px;
  }

  .faq-demo--modes {
    height: 42px;
  }

  .faq-demo--document i {
    left: 11px;
    top: 7px;
    width: 42px;
    height: 50px;
  }

  .faq-demo--document b {
    margin: 10px 5px 0 58px;
    font-size: 7px;
  }

  .faq-demo--file {
    padding: 8px;
  }

  .faq-demo--file i {
    width: 21px;
    height: 37px;
  }

  .faq-demo--file i:nth-child(2) {
    height: 47px;
  }

  .faq-demo--voice i {
    width: 45px;
    height: 45px;
  }

  .voice-call-card {
    border-radius: 25px;
  }
}

@media (max-width: 370px) {
  .topbar-title {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .start-card h2 {
    font-size: 27px;
  }

  .suggest {
    padding-left: 32px;
    font-size: 10px;
  }

  .suggest::before {
    left: 9px;
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* v97 product polish: quieter depth, clearer actions and accessible touch targets. */
.sidebar,
.start-card,
.message--assistant,
.composer {
  box-shadow: 0 16px 42px rgba(19, 51, 86, 0.08);
}

.start-card::after {
  content: "";
  position: absolute;
  top: auto;
  right: auto;
  bottom: 0;
  left: 50%;
  width: min(56%, 260px);
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, rgba(42, 112, 175, 0.72), rgba(190, 145, 59, 0.62), transparent);
  transform: translateX(-50%);
}

.suggest {
  position: relative;
  padding-right: 38px;
  font-weight: 760;
  letter-spacing: -0.012em;
}

.suggest::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  opacity: 0.38;
  transform: translateY(-50%) rotate(45deg);
  transition: opacity 160ms ease, transform 160ms ease;
}

.suggest:hover::after {
  opacity: 0.75;
  transform: translate(2px, -50%) rotate(45deg);
}

.auth-field {
  margin: 1px 2px -5px;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.auth-field + input {
  margin-top: 0;
}

.message-action-btn,
.install-banner-close {
  display: inline-grid;
  place-items: center;
}

:root[data-theme="dark"] .auth-field {
  color: #a8bad1;
}

@media (max-width: 760px) {
  .topbar-actions .voice-call-btn,
  .quick-new-chat-btn,
  .menu-btn,
  .voice-btn,
  .attach-btn,
  .message-action-btn,
  .install-banner-close {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
  }

  .menu-btn {
    width: auto;
    padding-right: 13px;
    padding-left: 13px;
  }

  .suggest {
    min-height: 54px;
    padding-right: 31px;
    font-size: 12.5px;
    line-height: 1.32;
  }

  .suggest::after {
    right: 12px;
  }

  .tools-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px 44px;
  }

  .send-btn {
    min-height: 44px;
  }

  .install-banner {
    grid-template-columns: 38px minmax(0, 1fr) auto 44px;
  }

  .install-banner-text {
    font-size: 11.5px;
    line-height: 1.35;
  }

  .install-banner-action {
    min-height: 44px;
    padding: 0 13px;
    font-size: 11px;
  }
}

@media (max-width: 370px) {
  .suggest {
    font-size: 12px;
  }
}

/* Settings page and adaptive theme, v99 */
.sidebar-settings-btn {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(104, 137, 173, 0.2);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(70, 134, 194, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.76);
  color: #173c68;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(24, 57, 95, 0.055);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.sidebar-settings-btn[hidden] {
  display: none !important;
}

.sidebar-settings-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 104, 161, 0.34);
  box-shadow: 0 13px 28px rgba(24, 57, 95, 0.1);
}

.sidebar-settings-icon,
.sidebar-settings-arrow,
.settings-page-back-icon,
.theme-choice-icon {
  display: block;
  background: currentColor;
}

.sidebar-settings-icon {
  width: 21px;
  height: 21px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m27.2 18.2-2.3 1.8.8 2.8-2.9 2.9-2.8-.8-1.8 2.3h-4.4L12 24.9l-2.8.8-2.9-2.9.8-2.8-2.3-1.8v-4.4L7.1 12l-.8-2.8 2.9-2.9 2.8.8 1.8-2.3h4.4L20 7.1l2.8-.8 2.9 2.9-.8 2.8 2.3 1.8v4.4ZM16 11a5 5 0 1 0 0 10 5 5 0 0 0 0-10Zm0 2.3a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m27.2 18.2-2.3 1.8.8 2.8-2.9 2.9-2.8-.8-1.8 2.3h-4.4L12 24.9l-2.8.8-2.9-2.9.8-2.8-2.3-1.8v-4.4L7.1 12l-.8-2.8 2.9-2.9 2.8.8 1.8-2.3h4.4L20 7.1l2.8-.8 2.9 2.9-.8 2.8 2.3 1.8v4.4ZM16 11a5 5 0 1 0 0 10 5 5 0 0 0 0-10Zm0 2.3a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sidebar-settings-arrow {
  width: 8px;
  height: 13px;
  justify-self: end;
  opacity: 0.5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.2 2 0 4.2 7.8 12 0 19.8 2.2 22 12.2 12 2.2 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.2 2 0 4.2 7.8 12 0 19.8 2.2 22 12.2 12 2.2 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.settings-btn--logout::after {
  width: 18px;
  height: 18px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 3h9v2.5H6.5v13H13V21H4V3Zm13.2 4.2 4.8 4.8-4.8 4.8-1.8-1.8 1.7-1.7H9.5v-2.6h7.6L15.4 9l1.8-1.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 3h9v2.5H6.5v13H13V21H4V3Zm13.2 4.2 4.8 4.8-4.8 4.8-1.8-1.8 1.7-1.7H9.5v-2.6h7.6L15.4 9l1.8-1.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.settings-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  height: var(--app-height);
  min-width: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 8% 0, rgba(255, 255, 255, 0.92), transparent 31%),
    radial-gradient(circle at 92% 100%, rgba(53, 122, 183, 0.1), transparent 32%);
}

.settings-layout[hidden] {
  display: none !important;
}

.settings-page {
  width: min(1160px, 100%);
  height: min(860px, calc(var(--app-height) - 44px));
  min-height: 580px;
  overflow: hidden;
  border: 1px solid rgba(137, 166, 199, 0.24);
  border-radius: 30px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.98), transparent 34%),
    linear-gradient(145deg, rgba(250, 253, 255, 0.98), rgba(236, 243, 250, 0.96));
  box-shadow:
    0 28px 78px rgba(17, 49, 84, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.settings-page-head {
  min-width: 0;
  border-bottom: 1px solid rgba(105, 137, 172, 0.16);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(45, 117, 181, 0.1), transparent 36%),
    rgba(255, 255, 255, 0.58);
}

.settings-page-back {
  min-width: 94px;
  min-height: 42px;
  border: 1px solid rgba(100, 135, 172, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: #1b4c7e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(24, 57, 95, 0.06);
}

.settings-page-back-icon {
  width: 16px;
  height: 16px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m10.4 4-8 8 8 8 1.9-1.9-4.8-4.8H22v-2.6H7.5l4.8-4.8L10.4 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m10.4 4-8 8 8 8 1.9-1.9-4.8-4.8H22v-2.6H7.5l4.8-4.8L10.4 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.settings-page-title p,
.settings-page-title h2,
.settings-page-title span,
.settings-account-summary p {
  margin: 0;
}

.settings-page-title p {
  color: #7a8ca2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.settings-page-title h2 {
  margin-top: 2px;
  color: #102b4b;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.settings-page-title span {
  display: block;
  margin-top: 4px;
  color: #697b91;
  font-size: 12px;
  font-weight: 650;
}

.settings-account-summary {
  max-width: 270px;
  border: 1px solid rgba(101, 137, 176, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 13px;
  box-shadow: 0 8px 24px rgba(24, 57, 95, 0.05);
}

.settings-page-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.settings-page-nav {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(105, 137, 172, 0.15);
  padding: 18px 14px;
  background: rgba(244, 249, 253, 0.62);
}

.settings-page-nav .settings-menu-list {
  gap: 6px;
}

.settings-page-nav .settings-menu-row {
  min-height: 46px;
  border-radius: 14px;
  padding: 10px 11px;
  font-size: 13px;
}

.settings-page-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
}

.settings-page-content .settings-details {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
}

.settings-page-content .settings-detail-panel {
  border: 1px solid rgba(115, 149, 185, 0.2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(63, 131, 190, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.78);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 16px 40px rgba(24, 57, 95, 0.07);
}

.settings-page-content .settings-detail-panel h3 {
  margin-bottom: 14px;
  color: #15365d;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.settings-page-status {
  width: min(760px, 100%);
  min-height: 20px;
  margin: 12px auto 0;
  color: #55718e;
  text-align: center;
}

.theme-setting-card {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 13px;
  padding: 15px;
}

.theme-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 4px;
  border: 1px solid rgba(105, 139, 177, 0.17);
  border-radius: 15px;
  background: rgba(222, 234, 246, 0.58);
}

.theme-choice-btn {
  min-width: 0;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #5a708a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.theme-choice-btn:hover {
  color: #1a4c7d;
}

.theme-choice-btn[aria-checked="true"],
.theme-choice-btn--active {
  border-color: rgba(82, 128, 174, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: #173f6d;
  box-shadow: 0 7px 18px rgba(27, 67, 108, 0.1);
}

.theme-choice-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 0 !important;
  color: inherit;
}

.theme-choice-icon--system {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-6.7v1.8H17V22H7v-2.2h3.7V18H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm0 2v11h16V5H4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-6.7v1.8H17V22H7v-2.2h3.7V18H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm0 2v11h16V5H4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-choice-icon--light {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1h2v3h-2V1Zm0 19h2v3h-2v-3ZM1 11h3v2H1v-2Zm19 0h3v2h-3v-2ZM4.2 2.8l2.1 2.1-1.4 1.4-2.1-2.1 1.4-1.4Zm13.5 13.5 2.1 2.1-1.4 1.4-2.1-2.1 1.4-1.4ZM19.8 4.2l-2.1 2.1-1.4-1.4 2.1-2.1 1.4 1.4ZM6.3 17.7l-2.1 2.1-1.4-1.4 2.1-2.1 1.4 1.4ZM12 6.5a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm0 2a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1h2v3h-2V1Zm0 19h2v3h-2v-3ZM1 11h3v2H1v-2Zm19 0h3v2h-3v-2ZM4.2 2.8l2.1 2.1-1.4 1.4-2.1-2.1 1.4-1.4Zm13.5 13.5 2.1 2.1-1.4 1.4-2.1-2.1 1.4-1.4ZM19.8 4.2l-2.1 2.1-1.4-1.4 2.1-2.1 1.4 1.4ZM6.3 17.7l-2.1 2.1-1.4-1.4 2.1-2.1 1.4 1.4ZM12 6.5a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm0 2a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-choice-icon--dark {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 14.4A8.6 8.6 0 0 1 9.6 3 9 9 0 1 0 21 14.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 14.4A8.6 8.6 0 0 1 9.6 3 9 9 0 1 0 21 14.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

:root[data-theme="dark"] {
  --bg: #050b13;
  --bg-2: #0a1624;
  --sidebar: rgba(8, 18, 31, 0.95);
  --panel: rgba(9, 20, 34, 0.94);
  --line: rgba(141, 174, 209, 0.17);
  --line-soft: rgba(141, 174, 209, 0.1);
  --ink: #edf4fd;
  --ink-soft: #9eb0c5;
  --accent: #8cc7f0;
  --accent-2: #3d88c6;
  --gold: #d0aa63;
  --ui-navy: #dcecff;
  --ui-blue: #8bc4ef;
  --ui-blue-soft: rgba(92, 157, 211, 0.12);
  --ui-paper: rgba(10, 23, 39, 0.94);
  --ui-line: rgba(137, 171, 207, 0.17);
  --ui-muted: #9badc2;
  --ui-focus: 0 0 0 3px rgba(97, 171, 227, 0.28);
  --ui-shadow-sm: 0 11px 30px rgba(0, 0, 0, 0.23);
  --ui-shadow-md: 0 24px 64px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -8%, rgba(42, 111, 164, 0.25), transparent 34%),
    radial-gradient(circle at 92% 112%, rgba(196, 148, 71, 0.08), transparent 29%),
    linear-gradient(145deg, #050a11 0%, #08131f 54%, #0a1725 100%);
}

:root[data-theme="dark"] .ambient--a {
  background: rgba(42, 119, 178, 0.24);
}

:root[data-theme="dark"] .ambient--b {
  background: rgba(180, 127, 52, 0.09);
}

:root[data-theme="dark"] .grain {
  opacity: 0.055;
  background-image: radial-gradient(rgba(220, 234, 250, 0.28) 0.5px, transparent 0.5px);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .chat-layout {
  border-color: rgba(137, 171, 207, 0.15);
  background:
    linear-gradient(165deg, rgba(18, 38, 62, 0.48), transparent 34%),
    rgba(7, 17, 29, 0.94);
  box-shadow: 0 25px 78px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: rgba(137, 171, 207, 0.12);
  background: linear-gradient(180deg, rgba(10, 23, 39, 0.96), rgba(8, 19, 32, 0.88));
}

:root[data-theme="dark"] .account-card,
:root[data-theme="dark"] .sidebar-settings-btn,
:root[data-theme="dark"] .menu-btn,
:root[data-theme="dark"] .quick-new-chat-btn,
:root[data-theme="dark"] .voice-call-btn--topbar {
  border-color: rgba(137, 171, 207, 0.17);
  background:
    radial-gradient(circle at 100% 0, rgba(63, 135, 190, 0.13), transparent 44%),
    rgba(12, 27, 45, 0.88);
  color: #d9e9f8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .history-item:hover {
  border-color: rgba(137, 171, 207, 0.12);
  background: rgba(17, 35, 56, 0.72);
}

:root[data-theme="dark"] .history-item--active {
  border-color: rgba(97, 169, 224, 0.19);
  background: linear-gradient(145deg, rgba(23, 48, 76, 0.94), rgba(12, 29, 48, 0.9));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .history-title {
  color: #e8f1fb;
}

:root[data-theme="dark"] .start-card,
:root[data-theme="dark"] .message--assistant,
:root[data-theme="dark"] .composer {
  border-color: rgba(137, 171, 207, 0.16);
  background:
    radial-gradient(circle at 0 0, rgba(54, 125, 181, 0.13), transparent 39%),
    linear-gradient(145deg, rgba(13, 29, 48, 0.96), rgba(8, 20, 34, 0.94));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.21),
    inset 0 1px 0 rgba(218, 236, 252, 0.035);
}

:root[data-theme="dark"] .suggest {
  border-color: rgba(137, 171, 207, 0.16);
  background: linear-gradient(145deg, rgba(16, 35, 57, 0.9), rgba(10, 24, 41, 0.92));
  color: #cfe2f4;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .suggest:hover {
  border-color: rgba(101, 174, 229, 0.3);
  background: linear-gradient(145deg, rgba(23, 49, 78, 0.96), rgba(13, 31, 51, 0.95));
}

:root[data-theme="dark"] .message--user {
  border-color: rgba(125, 190, 239, 0.18);
  background: linear-gradient(145deg, #1d5b91, #143e68);
  box-shadow: 0 13px 32px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .settings-layout {
  background:
    radial-gradient(circle at 8% -5%, rgba(48, 122, 177, 0.2), transparent 35%),
    radial-gradient(circle at 94% 105%, rgba(194, 146, 65, 0.07), transparent 28%),
    linear-gradient(145deg, #050b13, #091724);
}

:root[data-theme="dark"] .settings-page {
  border-color: rgba(137, 171, 207, 0.16);
  background:
    radial-gradient(circle at 0 0, rgba(39, 97, 142, 0.14), transparent 35%),
    linear-gradient(145deg, rgba(10, 23, 39, 0.99), rgba(6, 15, 27, 0.98));
  box-shadow:
    0 34px 96px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(223, 239, 255, 0.04);
}

:root[data-theme="dark"] .settings-page-head {
  border-bottom-color: rgba(137, 171, 207, 0.12);
  background:
    radial-gradient(circle at 100% 0, rgba(47, 119, 174, 0.13), transparent 38%),
    rgba(9, 21, 36, 0.82);
}

:root[data-theme="dark"] .settings-page-title h2,
:root[data-theme="dark"] .settings-account-name,
:root[data-theme="dark"] .settings-page-content .settings-detail-panel h3,
:root[data-theme="dark"] .theme-setting-card b {
  color: #edf5ff;
}

:root[data-theme="dark"] .settings-page-title p {
  color: #7f9ab5;
}

:root[data-theme="dark"] .settings-page-title span,
:root[data-theme="dark"] .settings-account-meta,
:root[data-theme="dark"] .settings-detail-note,
:root[data-theme="dark"] .theme-setting-card span {
  color: #98abc1;
}

:root[data-theme="dark"] .settings-page-back,
:root[data-theme="dark"] .settings-account-summary {
  border-color: rgba(137, 171, 207, 0.17);
  background: rgba(14, 31, 51, 0.8);
  color: #cfe5f8;
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .settings-page-nav {
  border-right-color: rgba(137, 171, 207, 0.12);
  background: rgba(5, 15, 26, 0.36);
}

:root[data-theme="dark"] .settings-page-content .settings-detail-panel,
:root[data-theme="dark"] .theme-setting-card {
  border-color: rgba(137, 171, 207, 0.16);
  background:
    radial-gradient(circle at 100% 0, rgba(57, 127, 181, 0.12), transparent 35%),
    rgba(12, 27, 45, 0.84);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .theme-choice {
  border-color: rgba(137, 171, 207, 0.13);
  background: rgba(3, 11, 20, 0.56);
}

:root[data-theme="dark"] .theme-choice-btn {
  color: #8fa5bc;
}

:root[data-theme="dark"] .theme-choice-btn:hover {
  color: #d8eafb;
}

:root[data-theme="dark"] .theme-choice-btn[aria-checked="true"],
:root[data-theme="dark"] .theme-choice-btn--active {
  border-color: rgba(113, 179, 226, 0.2);
  background: linear-gradient(145deg, rgba(31, 67, 103, 0.92), rgba(17, 40, 66, 0.94));
  color: #f0f7ff;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .settings-page-content input,
:root[data-theme="dark"] .settings-page-content textarea,
:root[data-theme="dark"] .settings-page-content select {
  border-color: rgba(137, 171, 207, 0.18);
  background: rgba(4, 13, 23, 0.7);
  color: #edf5ff;
}

:root[data-theme="dark"] .settings-page-content input::placeholder,
:root[data-theme="dark"] .settings-page-content textarea::placeholder {
  color: #6f849b;
}

/* Keep every interface surface in the same dark material system. */
:root[data-theme="dark"] .composer-wrap {
  border-top-color: rgba(137, 171, 207, 0.13);
  background:
    linear-gradient(180deg, rgba(7, 17, 29, 0.76), rgba(6, 15, 26, 0.98));
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .composer:focus-within {
  border-color: rgba(105, 177, 230, 0.42);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(74, 145, 199, 0.08),
    inset 0 1px 0 rgba(218, 236, 252, 0.04);
}

:root[data-theme="dark"] .composer textarea {
  background: transparent;
  color: #edf5ff;
  caret-color: #8cc7f0;
}

:root[data-theme="dark"] .composer textarea::placeholder {
  color: #71859d;
}

:root[data-theme="dark"] .model-switch,
:root[data-theme="dark"] .topic-select {
  border-color: rgba(137, 171, 207, 0.17);
  background: rgba(5, 14, 25, 0.48);
}

:root[data-theme="dark"] .topic-select select,
:root[data-theme="dark"] .topic-select select option {
  background-color: #0b1c2e;
  color: #dceafb;
}

:root[data-theme="dark"] .composer-meta,
:root[data-theme="dark"] .tip {
  color: #8498b0;
}

:root[data-theme="dark"] .modal {
  background: rgba(2, 8, 15, 0.72);
  backdrop-filter: blur(18px) saturate(0.9);
}

:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .install-banner,
:root[data-theme="dark"] .payment-notice {
  border-color: rgba(137, 171, 207, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(51, 124, 180, 0.14), transparent 36%),
    linear-gradient(145deg, rgba(14, 31, 51, 0.98), rgba(7, 18, 31, 0.98));
  color: #edf5ff;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .modal-card h2,
:root[data-theme="dark"] .install-banner-title,
:root[data-theme="dark"] .payment-notice p,
:root[data-theme="dark"] .auth-brand,
:root[data-theme="dark"] .nickname-choice-card h2 {
  color: #edf5ff;
}

:root[data-theme="dark"] .modal-note,
:root[data-theme="dark"] .install-banner-text,
:root[data-theme="dark"] .auth-provider-note,
:root[data-theme="dark"] .nickname-rules {
  color: #9aadc3;
}

:root[data-theme="dark"] .modal-close,
:root[data-theme="dark"] .install-banner-close,
:root[data-theme="dark"] .payment-notice button {
  border-color: rgba(137, 171, 207, 0.18);
  background: rgba(14, 32, 53, 0.86);
  color: #d9e9f8;
}

:root[data-theme="dark"] .auth-tabs {
  border-color: rgba(137, 171, 207, 0.15);
  background: rgba(3, 11, 20, 0.5);
}

:root[data-theme="dark"] .auth-tab {
  background: transparent;
  color: #8fa4bb;
}

:root[data-theme="dark"] .auth-tab--active {
  border-color: rgba(110, 178, 228, 0.18);
  background: linear-gradient(145deg, rgba(31, 68, 104, 0.94), rgba(16, 39, 64, 0.94));
  color: #eef6ff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .auth-password-toggle,
:root[data-theme="dark"] .auth-password-toggle:hover {
  color: #8cc7f0;
}

:root[data-theme="dark"] .auth-provider-divider span {
  background: #0b1c2e;
  color: #8397ae;
}

:root[data-theme="dark"] .buy-btn,
:root[data-theme="dark"] .referral-secondary-btn,
:root[data-theme="dark"] .referral-history-pager button,
:root[data-theme="dark"] .faq-nav a {
  border-color: rgba(137, 171, 207, 0.17);
  background: linear-gradient(145deg, rgba(20, 43, 70, 0.92), rgba(11, 28, 47, 0.94));
  color: #dceafa;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .buy-btn--pro {
  background: linear-gradient(145deg, #245f91, #17426d);
  color: #f5f9ff;
}

:root[data-theme="dark"] .buy-btn--max {
  border-color: rgba(208, 170, 99, 0.26);
  background: linear-gradient(145deg, #493a27, #172b43);
  color: #fff6e5;
}

:root[data-theme="dark"] .support-form {
  border-top-color: rgba(137, 171, 207, 0.13);
  background: rgba(6, 16, 28, 0.58);
}

:root[data-theme="dark"] .support-head {
  border-bottom-color: rgba(137, 171, 207, 0.13);
}

:root[data-theme="dark"] .support-message--admin {
  border-color: rgba(137, 171, 207, 0.17);
  background: linear-gradient(145deg, rgba(18, 39, 64, 0.94), rgba(10, 25, 42, 0.94));
  color: #e6f0fb;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .faq-card code {
  border-color: rgba(137, 171, 207, 0.14);
  background: rgba(4, 13, 23, 0.58);
  color: #b9d2e8;
}

:root[data-theme="dark"] .payment-notice-icon,
:root[data-theme="dark"] .install-banner-icon {
  background: rgba(39, 88, 126, 0.42);
  color: #9fd2f4;
}

:root[data-theme="dark"] .payment-notice--failed .payment-notice-icon {
  background: rgba(130, 45, 54, 0.3);
  color: #ffb9c1;
}

:root[data-theme="dark"] .pending-upload,
:root[data-theme="dark"] .attachment-card,
:root[data-theme="dark"] .source-pill {
  border-color: rgba(137, 171, 207, 0.16);
  background: rgba(14, 31, 51, 0.82);
  color: #dceafa;
}

:root[data-theme="dark"] .attachment-preview {
  background: linear-gradient(145deg, #153653, #0c2238);
  color: #a7d4f2;
}

:root[data-theme="dark"] .message a {
  color: #8fc9f2;
  border-bottom-color: rgba(143, 201, 242, 0.36);
}

:root[data-theme="dark"] .message code {
  background: rgba(132, 175, 214, 0.11);
  color: #d7e9f9;
}

:root[data-theme="dark"] .document-body-paper,
:root[data-theme="dark"] .document-editor-paper,
:root[data-theme="dark"] .template-preview-img {
  color-scheme: light;
}

@media (max-width: 860px) {
  .settings-layout {
    place-items: stretch;
    padding: 0;
  }

  .settings-page {
    width: 100%;
    height: var(--app-height);
    min-height: 0;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
  }

  .settings-page-head {
    position: sticky;
    z-index: 5;
    top: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
    backdrop-filter: blur(22px);
  }

  .settings-page-back {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .settings-page-back > span:last-child {
    display: none;
  }

  .settings-page-title h2 {
    font-size: 25px;
  }

  .settings-page-title span {
    display: none;
  }

  .settings-account-summary {
    grid-column: 1 / -1;
    max-width: none;
  }

  .settings-page-grid {
    display: block;
  }

  .settings-page-nav {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(105, 137, 172, 0.15);
    padding: 12px;
  }

  .settings-page-nav .settings-menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-page-nav .settings-menu-separator {
    grid-column: 1 / -1;
    margin: 3px 0;
  }

  .settings-page-nav .settings-menu-row {
    min-height: 44px;
  }

  .settings-page-content {
    overflow: visible;
    padding: 14px 12px max(28px, env(safe-area-inset-bottom));
  }

  .settings-page-content .settings-detail-panel {
    border-radius: 19px;
    padding: 17px 14px;
  }
}

@media (max-width: 430px) {
  .settings-page-title p {
    font-size: 9px;
  }

  .settings-page-title h2 {
    font-size: 23px;
  }

  .settings-page-nav .settings-menu-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
    font-size: 12px;
  }

  .theme-choice-btn {
    gap: 5px;
    padding: 7px 5px;
    font-size: 10.5px;
  }

  .theme-choice-icon {
    width: 14px;
    height: 14px;
  }
}

/* v103: installation, registration consent and rules page. */
.install-banner-action {
  position: relative;
  isolation: isolate;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  background:
    radial-gradient(circle at 16% 0, rgba(255, 255, 255, 0.2), transparent 38%),
    linear-gradient(135deg, #174f88 0%, #246fb1 56%, #153f70 100%);
  color: #fff;
  padding: 0 15px;
  letter-spacing: -0.012em;
  box-shadow:
    0 12px 24px rgba(18, 66, 113, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.install-banner-action::before {
  content: "";
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 3h2v9.1l3.2-3.2 1.4 1.4-5.6 5.6-5.6-5.6 1.4-1.4 3.2 3.2V3Zm-6 14h2v2h10v-2h2v4H5v-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 3h2v9.1l3.2-3.2 1.4 1.4-5.6 5.6-5.6-5.6 1.4-1.4 3.2 3.2V3Zm-6 14h2v2h10v-2h2v4H5v-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.install-banner-action::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.18) 46%, transparent 72%);
  transform: translateX(-115%);
  transition: transform 420ms ease;
}

.install-banner-action:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow:
    0 16px 30px rgba(18, 66, 113, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.install-banner-action:hover::after {
  transform: translateX(115%);
}

.install-banner-action:active {
  transform: translateY(0) scale(0.98);
}

.install-banner-action:focus-visible,
.auth-terms input:focus-visible,
.auth-terms a:focus-visible,
.rules-back:focus-visible,
.rules-nav a:focus-visible,
.rules-footer a:focus-visible {
  outline: 3px solid rgba(74, 146, 214, 0.3);
  outline-offset: 2px;
}

.auth-terms {
  display: block;
  margin: 4px 0 2px;
  border: 1px solid rgba(91, 126, 168, 0.15);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(244, 249, 254, 0.96), rgba(234, 243, 251, 0.78));
  color: #526982;
  padding: 11px 12px 10px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-terms[hidden] {
  display: none;
}

.auth-terms-control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.auth-terms input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.auth-terms-check {
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid rgba(47, 91, 143, 0.38);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.auth-terms-check::after {
  width: 9px;
  height: 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.65);
  transition: opacity 140ms ease, transform 140ms ease;
}

.auth-terms input:checked + .auth-terms-check {
  border-color: #2169a9;
  background-color: #2169a9;
  transform: scale(1.02);
  box-shadow: 0 5px 13px rgba(33, 105, 169, 0.22);
}

.auth-terms input:checked + .auth-terms-check::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.auth-terms input:focus-visible + .auth-terms-check {
  box-shadow: var(--ui-focus);
}

.auth-terms-copy {
  font-size: 12px;
  font-weight: 790;
  line-height: 1.4;
}

.auth-terms > small {
  display: block;
  margin: 6px 0 0 32px;
  color: #788a9e;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.4;
}

.auth-terms a {
  color: #185a97;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(24, 90, 151, 0.3);
  text-underline-offset: 2px;
}

.rules-page-body {
  overflow: hidden;
}

.rules-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  height: var(--app-height);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
  background:
    radial-gradient(circle at 8% -5%, rgba(255, 255, 255, 0.96), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(43, 113, 181, 0.12), transparent 28%),
    linear-gradient(145deg, #eef3f7, #e5edf3);
}

.rules-shell {
  width: min(1060px, 100%);
  margin: 0 auto;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.rules-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px 0 20px;
}

.rules-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(84, 119, 158, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: #173f70;
  box-shadow: 0 10px 28px rgba(24, 57, 94, 0.08);
  backdrop-filter: blur(16px);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.rules-back:hover {
  transform: translateX(-2px);
  box-shadow: 0 14px 30px rgba(24, 57, 94, 0.13);
}

.rules-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rules-kicker {
  margin: 0 0 4px;
  color: #6d8096;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rules-head h1 {
  margin: 0;
  color: #102f53;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(30px, 4.2vw, 46px);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.rules-head p:last-child {
  margin: 6px 0 0;
  color: #687a91;
  font-size: 12px;
  font-weight: 700;
}

.rules-summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border: 1px solid rgba(44, 104, 165, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.96), transparent 42%),
    linear-gradient(145deg, rgba(250, 253, 255, 0.92), rgba(228, 240, 252, 0.85));
  padding: 19px;
  box-shadow: 0 20px 48px rgba(25, 61, 100, 0.09);
}

.rules-summary-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, #173f70, #2a72b2);
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  box-shadow: 0 12px 24px rgba(24, 70, 116, 0.2);
}

.rules-summary h2,
.rules-summary p {
  margin: 0;
}

.rules-summary h2 {
  color: #14385f;
  font-size: 15px;
}

.rules-summary p {
  margin-top: 5px;
  color: #536b85;
  font-size: 13px;
  line-height: 1.62;
}

.rules-nav {
  position: sticky;
  z-index: 4;
  top: 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid rgba(80, 112, 150, 0.15);
  border-radius: 16px;
  background: rgba(250, 252, 254, 0.86);
  padding: 7px;
  box-shadow: 0 16px 38px rgba(25, 54, 88, 0.08);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}

.rules-nav::-webkit-scrollbar {
  display: none;
}

.rules-nav a {
  flex: 0 0 auto;
  border-radius: 10px;
  color: #526b87;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.rules-nav a:hover {
  background: rgba(33, 100, 163, 0.08);
  color: #164d82;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rules-card {
  scroll-margin-top: 88px;
  border: 1px solid rgba(89, 122, 160, 0.15);
  border-radius: 20px;
  background: rgba(252, 253, 254, 0.86);
  padding: 20px;
  box-shadow: 0 14px 36px rgba(24, 57, 94, 0.06);
}

.rules-card > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 29px;
  height: 24px;
  border-radius: 999px;
  background: rgba(31, 99, 163, 0.09);
  color: #28659e;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.rules-card h2 {
  margin: 14px 0 7px;
  color: #15385f;
  font-size: 16px;
  line-height: 1.25;
}

.rules-card p {
  margin: 0;
  color: #5d7188;
  font-size: 12.5px;
  line-height: 1.65;
}

.rules-card a {
  color: #1d629e;
  font-weight: 900;
  text-underline-offset: 2px;
}

.rules-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  border: 1px solid rgba(89, 122, 160, 0.14);
  border-radius: 18px;
  background: rgba(252, 253, 254, 0.76);
  padding: 15px 17px;
}

.rules-footer p {
  margin: 0;
  color: #687a90;
  font-size: 11px;
  line-height: 1.5;
}

.rules-footer a {
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(145deg, #174f88, #246fb1);
  color: #fff;
  padding: 10px 13px;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(22, 69, 114, 0.18);
}

:root[data-theme="dark"] .auth-terms {
  border-color: rgba(137, 171, 207, 0.17);
  background: rgba(9, 22, 38, 0.72);
  color: #a9bbd0;
}

:root[data-theme="dark"] .auth-terms-check {
  border-color: rgba(142, 184, 225, 0.34);
  background-color: rgba(16, 35, 58, 0.96);
}

:root[data-theme="dark"] .auth-terms input:checked + .auth-terms-check {
  border-color: #63a9e7;
  background-color: #2d78bb;
}

:root[data-theme="dark"] .auth-terms a {
  color: #8bc7f4;
  text-decoration-color: rgba(139, 199, 244, 0.35);
}

:root[data-theme="dark"] .auth-terms > small {
  color: #8096ae;
}

:root[data-theme="dark"] .rules-layout {
  background:
    radial-gradient(circle at 9% -6%, rgba(47, 116, 174, 0.24), transparent 35%),
    radial-gradient(circle at 93% 5%, rgba(191, 145, 67, 0.07), transparent 27%),
    linear-gradient(145deg, #050b13, #091725);
}

:root[data-theme="dark"] .rules-back,
:root[data-theme="dark"] .rules-nav,
:root[data-theme="dark"] .rules-card,
:root[data-theme="dark"] .rules-footer {
  border-color: rgba(137, 171, 207, 0.16);
  background: rgba(10, 24, 41, 0.88);
  color: #e7f1fc;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .rules-summary {
  border-color: rgba(137, 171, 207, 0.17);
  background:
    radial-gradient(circle at 0 0, rgba(50, 119, 175, 0.16), transparent 43%),
    linear-gradient(145deg, rgba(14, 31, 52, 0.96), rgba(8, 20, 35, 0.94));
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .rules-head h1,
:root[data-theme="dark"] .rules-summary h2,
:root[data-theme="dark"] .rules-card h2 {
  color: #edf5ff;
}

:root[data-theme="dark"] .rules-kicker,
:root[data-theme="dark"] .rules-head p:last-child,
:root[data-theme="dark"] .rules-summary p,
:root[data-theme="dark"] .rules-card p,
:root[data-theme="dark"] .rules-footer p {
  color: #9eb1c7;
}

:root[data-theme="dark"] .rules-back {
  color: #dcecff;
}

:root[data-theme="dark"] .rules-nav a {
  color: #a8bbd0;
}

:root[data-theme="dark"] .rules-nav a:hover {
  background: rgba(117, 183, 255, 0.11);
  color: #e6f2ff;
}

:root[data-theme="dark"] .rules-card > span {
  background: rgba(117, 183, 255, 0.11);
  color: #9bd0f7;
}

:root[data-theme="dark"] .rules-card a {
  color: #8bc7f4;
}

/* Keep generated prompts and streamed text native to the dark palette. */
:root[data-theme="dark"] .suggest,
:root[data-theme="dark"] .followup-chip {
  border-color: rgba(137, 171, 207, 0.18) !important;
  background:
    radial-gradient(circle at 0 0, rgba(55, 126, 183, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(15, 33, 55, 0.96), rgba(8, 21, 37, 0.94)) !important;
  color: #dcecff !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16) !important;
}

:root[data-theme="dark"] .suggest:hover,
:root[data-theme="dark"] .followup-chip:hover {
  border-color: rgba(113, 183, 235, 0.32) !important;
  background: linear-gradient(145deg, rgba(21, 45, 73, 0.98), rgba(11, 29, 49, 0.97)) !important;
}

:root[data-theme="dark"] .message--assistant.message--streaming,
:root[data-theme="dark"] .message--assistant.message--streaming p,
:root[data-theme="dark"] .message--assistant.message--streaming li,
:root[data-theme="dark"] .message--assistant.message--streaming h3,
:root[data-theme="dark"] .message--assistant.message--streaming h4,
:root[data-theme="dark"] .message--assistant.message--streaming strong,
:root[data-theme="dark"] .message--assistant.message--streaming em,
:root[data-theme="dark"] .message--assistant.message--streaming blockquote,
:root[data-theme="dark"] .message--assistant.message--streaming code {
  color: #eaf2ff !important;
  -webkit-text-fill-color: #eaf2ff !important;
}

:root[data-theme="dark"] .message--typing span {
  background: #82bceb;
}

@media (max-width: 720px) {
  .install-banner-action {
    min-height: 44px;
    border-radius: 12px;
    padding: 0 13px;
  }

  .install-banner-action::before {
    width: 15px;
    height: 15px;
  }

  .rules-layout {
    padding: max(12px, env(safe-area-inset-top)) 11px max(22px, env(safe-area-inset-bottom));
  }

  .rules-head {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding-top: 3px;
  }

  .rules-head h1 {
    font-size: 30px;
  }

  .rules-summary {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    border-radius: 19px;
    padding: 15px;
  }

  .rules-summary-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 21px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .rules-card {
    border-radius: 17px;
    padding: 17px;
  }

  .rules-footer {
    align-items: stretch;
    flex-direction: column;
    border-radius: 17px;
  }

  .rules-footer a {
    text-align: center;
  }
}

@media (max-width: 390px) {
  .install-banner-action {
    gap: 6px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .rules-summary p,
  .rules-card p {
    font-size: 12px;
  }
}

/* v104: device-aware PWA installation guide. */
.install-guide-modal {
  z-index: 92;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 18%, rgba(48, 130, 209, 0.2), transparent 38%),
    rgba(7, 19, 34, 0.58);
  backdrop-filter: blur(22px) saturate(0.92);
}

.install-guide-card {
  width: min(680px, 100%);
  max-height: min(780px, calc(100dvh - 28px));
  overflow: auto;
  border: 1px solid rgba(107, 150, 197, 0.22);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0, rgba(99, 177, 236, 0.16), transparent 33%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.99), rgba(238, 246, 254, 0.98));
  padding: 18px;
  box-shadow:
    0 34px 100px rgba(4, 25, 51, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  scrollbar-width: thin;
  animation: install-guide-enter 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.install-guide-close {
  z-index: 4;
  top: 29px;
  right: 29px;
  border-color: rgba(111, 151, 195, 0.2);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.install-guide-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 148px;
  overflow: hidden;
  border: 1px solid rgba(83, 136, 191, 0.17);
  border-radius: 23px;
  background:
    radial-gradient(circle at 9% 15%, rgba(255, 255, 255, 0.98), transparent 31%),
    radial-gradient(circle at 94% 0, rgba(72, 150, 220, 0.18), transparent 38%),
    linear-gradient(135deg, #edf7ff, #dcebf9);
  padding: 24px 62px 24px 24px;
}

.install-guide-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(40, 102, 164, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 102, 164, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  content: "";
  mask-image: linear-gradient(90deg, transparent, #000 42%, #000);
}

.install-guide-device-icon {
  position: relative;
  display: grid;
  width: 80px;
  height: 80px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 25px;
  background: linear-gradient(145deg, #184f88, #2e7fbd);
  color: #fff;
  box-shadow:
    0 18px 38px rgba(20, 75, 126, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.install-guide-modal[data-platform="android"] .install-guide-device-icon {
  background: linear-gradient(145deg, #136f75, #1f9a90);
  box-shadow: 0 18px 38px rgba(13, 101, 101, 0.25);
}

.install-guide-device-icon::after {
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(52, 121, 184, 0.15);
  border-radius: 30px;
  content: "";
}

.install-guide-device-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-guide-heading {
  min-width: 0;
}

.install-guide-platform {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 0 8px;
  border: 1px solid rgba(56, 115, 175, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #3e6f9c;
  padding: 0 10px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.install-guide-heading h2 {
  max-width: 480px;
  margin: 0;
  color: #102f53;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.install-guide-heading > p:last-child {
  max-width: 490px;
  margin: 10px 0 0;
  color: #587087;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.52;
}

.install-guide-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 14px 3px 12px;
}

.install-guide-progress span {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2876b8, #66addb);
  box-shadow: 0 4px 10px rgba(35, 110, 174, 0.14);
}

.install-guide-modal[data-platform="android"] .install-guide-progress span {
  background: linear-gradient(90deg, #1b7779, #57b5a7);
}

.install-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.install-guide-step {
  min-width: 0;
  border: 1px solid rgba(86, 124, 164, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  box-shadow: 0 11px 28px rgba(22, 59, 97, 0.06);
}

.install-guide-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.install-guide-step-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(73, 132, 189, 0.16);
  border-radius: 12px;
  background: linear-gradient(145deg, #edf6ff, #dfeefa);
  color: #24669f;
}

.install-guide-modal[data-platform="android"] .install-guide-step-icon {
  border-color: rgba(37, 136, 129, 0.16);
  background: linear-gradient(145deg, #e9f8f5, #d9f0ec);
  color: #187871;
}

.install-guide-step-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-guide-step-number {
  color: #7990a8;
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.install-guide-step h3 {
  margin: 0;
  color: #173b62;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.install-guide-step p {
  margin: 7px 0 0;
  color: #667b91;
  font-size: 10.5px;
  font-weight: 620;
  line-height: 1.5;
}

.install-guide-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  border: 1px solid rgba(188, 137, 45, 0.19);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 249, 231, 0.9), rgba(250, 240, 210, 0.76));
  padding: 10px 12px;
}

.install-guide-note[hidden] {
  display: none;
}

.install-guide-note-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px;
  background: rgba(190, 137, 42, 0.13);
  color: #9a681d;
}

.install-guide-note-icon::before {
  content: "i";
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 700;
}

.install-guide-note p {
  margin: 0;
  color: #765c32;
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1.45;
}

.install-guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 13px;
}

.install-guide-primary,
.install-guide-secondary {
  min-height: 44px;
  border-radius: 13px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.install-guide-primary {
  min-width: 166px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, #174f88, #2b78b5);
  color: #fff;
  box-shadow: 0 12px 25px rgba(22, 73, 120, 0.23);
}

.install-guide-modal[data-platform="android"] .install-guide-primary {
  background: linear-gradient(135deg, #126c70, #22958b);
  box-shadow: 0 12px 25px rgba(13, 103, 99, 0.22);
}

.install-guide-secondary {
  border: 1px solid rgba(91, 129, 169, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #345a7d;
}

.install-guide-primary:hover,
.install-guide-secondary:hover {
  transform: translateY(-1px);
}

.install-guide-primary:disabled {
  cursor: wait;
  filter: saturate(0.65);
  opacity: 0.72;
}

.install-guide-primary:focus-visible,
.install-guide-secondary:focus-visible {
  outline: 3px solid rgba(63, 139, 207, 0.28);
  outline-offset: 2px;
}

:root[data-theme="dark"] .install-guide-card {
  border-color: rgba(132, 173, 214, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(48, 126, 187, 0.16), transparent 34%),
    linear-gradient(150deg, rgba(13, 29, 48, 0.99), rgba(6, 17, 30, 0.99));
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .install-guide-hero {
  border-color: rgba(133, 177, 218, 0.14);
  background:
    radial-gradient(circle at 94% 0, rgba(50, 129, 190, 0.19), transparent 42%),
    linear-gradient(135deg, rgba(18, 39, 64, 0.97), rgba(9, 24, 41, 0.98));
}

:root[data-theme="dark"] .install-guide-hero::before {
  background-image:
    linear-gradient(rgba(146, 190, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 190, 232, 0.045) 1px, transparent 1px);
}

:root[data-theme="dark"] .install-guide-platform {
  border-color: rgba(138, 181, 222, 0.14);
  background: rgba(8, 22, 38, 0.58);
  color: #90bde4;
}

:root[data-theme="dark"] .install-guide-heading h2,
:root[data-theme="dark"] .install-guide-step h3 {
  color: #edf5ff;
}

:root[data-theme="dark"] .install-guide-heading > p:last-child,
:root[data-theme="dark"] .install-guide-step p {
  color: #9fb1c5;
}

:root[data-theme="dark"] .install-guide-step {
  border-color: rgba(137, 171, 207, 0.14);
  background: rgba(10, 25, 42, 0.76);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .install-guide-step-icon {
  border-color: rgba(130, 181, 224, 0.15);
  background: linear-gradient(145deg, rgba(24, 57, 87, 0.88), rgba(14, 39, 64, 0.88));
  color: #8bc6f1;
}

:root[data-theme="dark"] .install-guide-modal[data-platform="android"] .install-guide-step-icon {
  border-color: rgba(80, 181, 166, 0.16);
  background: linear-gradient(145deg, rgba(17, 66, 67, 0.85), rgba(9, 48, 49, 0.86));
  color: #77d0c4;
}

:root[data-theme="dark"] .install-guide-step-number {
  color: #6e87a1;
}

:root[data-theme="dark"] .install-guide-note {
  border-color: rgba(207, 163, 74, 0.18);
  background: linear-gradient(145deg, rgba(72, 53, 19, 0.44), rgba(45, 35, 17, 0.5));
}

:root[data-theme="dark"] .install-guide-note p {
  color: #d6bb86;
}

:root[data-theme="dark"] .install-guide-note-icon {
  background: rgba(213, 164, 71, 0.12);
  color: #e2bf7b;
}

:root[data-theme="dark"] .install-guide-secondary {
  border-color: rgba(137, 171, 207, 0.17);
  background: rgba(14, 32, 53, 0.84);
  color: #d7e8f8;
}

@keyframes install-guide-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .install-guide-card {
    max-height: calc(var(--app-height, 100dvh) - 20px);
    border-radius: 24px;
    padding: 12px;
  }

  .install-guide-close {
    top: 22px;
    right: 22px;
  }

  .install-guide-hero {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 13px;
    min-height: 118px;
    border-radius: 19px;
    padding: 17px 47px 17px 16px;
  }

  .install-guide-device-icon {
    width: 60px;
    height: 60px;
    border-radius: 19px;
  }

  .install-guide-device-icon::after {
    inset: -4px;
    border-radius: 23px;
  }

  .install-guide-device-icon svg {
    width: 31px;
    height: 31px;
  }

  .install-guide-platform {
    min-height: 20px;
    margin-bottom: 6px;
    padding: 0 7px;
    font-size: 7.5px;
  }

  .install-guide-heading h2 {
    font-size: clamp(21px, 6vw, 27px);
  }

  .install-guide-heading > p:last-child {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.4;
  }

  .install-guide-progress {
    margin: 10px 2px 9px;
  }

  .install-guide-steps {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .install-guide-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    border-radius: 15px;
    padding: 9px 10px;
  }

  .install-guide-step-top {
    grid-row: 1 / span 2;
    display: grid;
    width: 38px;
    margin: 0;
  }

  .install-guide-step-icon {
    grid-area: 1 / 1;
    width: 38px;
    height: 38px;
  }

  .install-guide-step-number {
    z-index: 1;
    grid-area: 1 / 1;
    align-self: end;
    justify-self: end;
    min-width: 16px;
    height: 16px;
    border: 2px solid #f4f9fe;
    border-radius: 999px;
    background: #286da8;
    color: #fff;
    font-size: 6px;
    line-height: 12px;
    text-align: center;
  }

  :root[data-theme="dark"] .install-guide-step-number {
    border-color: #0b1d30;
    color: #fff;
  }

  .install-guide-step h3 {
    align-self: end;
    font-size: 11px;
  }

  .install-guide-step p {
    align-self: start;
    margin-top: 2px;
    font-size: 8.7px;
    line-height: 1.36;
  }

  .install-guide-note {
    grid-template-columns: 30px minmax(0, 1fr);
    margin-top: 8px;
    border-radius: 13px;
    padding: 8px 9px;
  }

  .install-guide-note-icon {
    width: 28px;
    height: 28px;
  }

  .install-guide-note p {
    font-size: 8.8px;
  }

  .install-guide-actions {
    margin-top: 9px;
  }

  .install-guide-primary,
  .install-guide-secondary {
    min-height: 42px;
    border-radius: 12px;
    font-size: 10px;
  }

  .install-guide-primary {
    flex: 1 1 auto;
  }
}

@media (max-width: 390px) {
  .install-guide-hero {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px;
    padding-left: 13px;
  }

  .install-guide-device-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
  }

  .install-guide-heading h2 {
    font-size: 21px;
  }

  .install-guide-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .install-guide-primary[hidden] + .install-guide-secondary {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .install-guide-card {
    animation: none;
  }
}

/* v107: live-chat function state and consistent button geometry */
.live-chat-interface[hidden] {
  display: none !important;
}

.live-chat-interface {
  animation: live-chat-interface-in 220ms ease both;
}

@keyframes live-chat-interface-in {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

.live-chat-switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
  cursor: pointer;
}

.live-chat-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.live-chat-switch > span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(85, 119, 155, 0.24);
  border-radius: 999px;
  background: rgba(148, 168, 191, 0.3);
  box-shadow: inset 0 1px 3px rgba(24, 48, 76, 0.12);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.live-chat-switch i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 43, 74, 0.2);
  transition: transform 190ms cubic-bezier(.2, .8, .2, 1);
}

.live-chat-switch input:checked + span {
  border-color: rgba(31, 116, 190, 0.55);
  background: linear-gradient(135deg, #1a5f9e, #2f8bd0);
  box-shadow: inset 0 1px 2px rgba(8, 43, 76, 0.16), 0 7px 18px rgba(39, 118, 187, 0.2);
}

.live-chat-switch input:checked + span i {
  transform: translateX(20px);
}

.live-chat-switch input:focus-visible + span {
  box-shadow: var(--ui-focus);
}

.live-chat-switch input:disabled + span {
  cursor: wait;
  opacity: 0.58;
}

.live-chat-studio:not(.is-enabled) {
  padding-block: 18px;
}

.live-chat-studio.is-enabled .live-chat-studio-head {
  padding-bottom: 2px;
}

.live-chat-studio[aria-busy="true"] .live-chat-install-state {
  opacity: 0.62;
}

:root[data-theme="dark"] .live-chat-switch > span {
  border-color: rgba(141, 175, 211, 0.22);
  background: rgba(76, 99, 125, 0.46);
}

:root[data-theme="dark"] .live-chat-switch input:checked + span {
  border-color: rgba(102, 181, 241, 0.56);
  background: linear-gradient(135deg, #2269a6, #409bdd);
}

button,
[role="button"] {
  font-family: inherit;
}

button > svg,
a > svg {
  display: block;
  flex: 0 0 auto;
}

:is(
  .settings-btn,
  .new-chat,
  .quick-new-chat-btn,
  .voice-call-btn--topbar,
  .menu-btn,
  .attach-btn,
  .voice-btn,
  .send-btn,
  .modal-close,
  .voice-call-close,
  .install-banner-close,
  .install-guide-close,
  .referrals-back-btn,
  .settings-page-back
) {
  align-items: center;
  justify-content: center;
  line-height: 1;
}

:is(
  .auth-tab,
  .auth-password-toggle,
  .auth-yandex-button,
  .support-back-btn,
  .referral-secondary-btn,
  .buy-btn,
  .theme-choice-btn,
  .nickname-cancel-btn,
  .live-chat-save-btn,
  .live-chat-code-box button,
  .live-chat-plan-row button,
  .live-chat-dashboard > header button
) {
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .live-chat-studio-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-chat-head-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px 52px;
    align-items: center;
  }

  .live-chat-install-state {
    justify-self: start;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
  }

  .live-chat-switch {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-chat-interface {
    animation: none;
  }
}

/* v108: touch targets and compact controls share one visual rhythm. */
.chat-action {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.faq-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rules-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rules-nav--has-more {
  box-shadow:
    inset -24px 0 20px -24px rgba(18, 67, 112, 0.85),
    0 16px 38px rgba(25, 54, 88, 0.08);
}

:root[data-theme="dark"] .rules-nav--has-more {
  box-shadow:
    inset -24px 0 20px -24px rgba(122, 188, 240, 0.85),
    0 16px 42px rgba(0, 0, 0, 0.2);
}

#authRulesLink {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  margin: -6px -3px;
  padding: 6px 3px;
}

.modal-form .auth-password-toggle,
.auth-tab,
.auth-yandex-button,
.support-back-btn,
.referral-secondary-btn,
.buy-btn,
.theme-choice-btn,
.nickname-cancel-btn,
.live-chat-save-btn,
.live-chat-code-box button,
.live-chat-plan-row button,
.live-chat-dashboard > header button {
  display: inline-flex;
}

.modal-form .auth-password-toggle {
  min-height: 34px;
  align-items: center;
  padding-block: 6px;
}

.live-chat-help-btn {
  width: 40px;
  height: 40px;
}

.live-chat-segmented button {
  min-height: 38px;
}

.live-chat-save-btn {
  min-height: 44px;
}

.live-chat-switch {
  width: 56px;
  height: 44px;
}

.live-chat-switch > span {
  inset: 5px 0;
}

.live-chat-switch i {
  width: 24px;
  height: 24px;
}

.live-chat-switch input:checked + span i {
  transform: translateX(22px);
}

@media (max-width: 760px) {
  .settings-btn,
  .new-chat {
    width: 42px;
    height: 42px;
  }

  .chat-action {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .modal-close,
  .auth-captcha-refresh,
  .live-chat-help-btn {
    width: 44px;
    height: 44px;
  }

  .auth-captcha {
    grid-template-columns: minmax(0, 1fr) 66px 44px;
  }

  .live-chat-studio {
    margin-inline: 0;
  }

  .live-chat-segmented button {
    min-height: 42px;
  }

  .live-chat-head-actions {
    grid-template-columns: minmax(0, 1fr) 44px 56px;
  }

  .auth-tab,
  .support-back-btn,
  .support-form button {
    min-height: 44px;
  }
}

:root[data-theme="dark"] .support-head h2 {
  color: #edf5ff;
}

:root[data-theme="dark"] .support-kicker,
:root[data-theme="dark"] .support-status {
  color: #a8bbd2;
}

:root[data-theme="dark"] .referrals-back-btn {
  border-color: rgba(137, 171, 207, 0.2);
  background: rgba(18, 39, 65, 0.96);
  color: #9fd0f4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .live-chat-install-state,
:root[data-theme="dark"] .live-chat-benefits span {
  color: #b8cbe1;
}

:root[data-theme="dark"] .live-chat-help-btn {
  color: #9ed3f8;
}

:root[data-theme="dark"] .live-chat-benefits b {
  color: #96cef6;
}

:root[data-theme="dark"] .live-chat-install-state.is-connected {
  color: #83dfb5;
}

:root[data-theme="dark"] .faq-demo {
  border-color: rgba(137, 171, 207, 0.18);
  background: linear-gradient(145deg, #172d48, #102238);
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .faq-demo--document i,
:root[data-theme="dark"] .faq-demo--file i {
  background: #203a58;
  color: #a9d5f5;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .faq-demo--document i::before,
:root[data-theme="dark"] .faq-demo--document i::after {
  background: #7592ae;
}

:root[data-theme="dark"] .faq-demo--document i::before {
  box-shadow: 0 10px #7592ae, 0 20px #7592ae;
}

:root[data-theme="dark"] .faq-demo--modes i,
:root[data-theme="dark"] .faq-demo--limit b {
  color: #a9c9e7;
}

:root[data-theme="dark"] .faq-demo--chat i,
:root[data-theme="dark"] .faq-demo--limit i {
  background: #587895;
}

.settings-menu-icon--personal {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7h13v3H5V7Zm18 0h4v3h-4V7Zm-3-3h3v9h-3V4ZM5 15h4v3H5v-3Zm9 0h13v3H14v-3Zm-5-3h3v9H9v-9ZM5 23h15v3H5v-3Zm20 0h2v3h-2v-3Zm-5-3h3v9h-3v-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7h13v3H5V7Zm18 0h4v3h-4V7Zm-3-3h3v9h-3V4ZM5 15h4v3H5v-3Zm9 0h13v3H14v-3Zm-5-3h3v9H9v-9ZM5 23h15v3H5v-3Zm20 0h2v3h-2v-3Zm-5-3h3v9h-3v-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.settings-menu-icon--support {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 3C8.8 3 3 8.8 3 16v8a4 4 0 0 0 4 4h6v-3H7a1 1 0 0 1-1-1v-2h5V12H6.8A9.8 9.8 0 0 1 16 6a9.8 9.8 0 0 1 9.2 6H21v10h4v1a2 2 0 0 1-2 2h-4v3h4a5 5 0 0 0 5-5v-7C28 8.8 23.2 3 16 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 3C8.8 3 3 8.8 3 16v8a4 4 0 0 0 4 4h6v-3H7a1 1 0 0 1-1-1v-2h5V12H6.8A9.8 9.8 0 0 1 16 6a9.8 9.8 0 0 1 9.2 6H21v10h4v1a2 2 0 0 1-2 2h-4v3h4a5 5 0 0 0 5-5v-7C28 8.8 23.2 3 16 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.settings-menu-row[data-notification-state="granted"] .settings-menu-icon--bell {
  color: #2a8a61;
}
