/* 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, v98 */
.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-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;
}

@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;
  }
}
