:root {
  color-scheme: light;
  --bg: var(--aerx-theme-bg-color, #f7f8fa);
  --surface: var(--aerx-theme-section-bg-color, #fff);
  --text: var(--aerx-theme-text-color, #17212b);
  --muted: var(--aerx-theme-subtitle-text-color, #586779);
  --line: var(--aerx-theme-section-separator-color, #e4e8ed);
  --accent: var(--aerx-theme-button-color, #245dcc);
  --on-accent: var(--aerx-theme-button-text-color, #fff);
  --danger: var(--aerx-theme-destructive-text-color, #bb3144);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--aerx-theme-bg-color, #14191f);
    --surface: var(--aerx-theme-section-bg-color, #1e252e);
    --text: var(--aerx-theme-text-color, #edf2f8);
    --muted: var(--aerx-theme-subtitle-text-color, #a7b4c4);
    --line: var(--aerx-theme-section-separator-color, #35404d);
    --accent: var(--aerx-theme-button-color, #598cf0);
    --danger: var(--aerx-theme-destructive-text-color, #ff8497);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--aerx-theme-bg-color, #14191f);
  --surface: var(--aerx-theme-section-bg-color, #1e252e);
  --text: var(--aerx-theme-text-color, #edf2f8);
  --muted: var(--aerx-theme-subtitle-text-color, #a7b4c4);
  --line: var(--aerx-theme-section-separator-color, #35404d);
  --accent: var(--aerx-theme-button-color, #598cf0);
  --danger: var(--aerx-theme-destructive-text-color, #ff8497);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
#app {
  max-width: 760px;
  margin: auto;
  padding: calc(
      22px + var(--aerx-safe-area-inset-top, 0px) +
        var(--aerx-content-safe-area-inset-top, 0px)
    )
    max(20px, var(--aerx-safe-area-inset-right, 0px))
    calc(
      32px + var(--aerx-safe-area-inset-bottom, 0px) +
        var(--aerx-content-safe-area-inset-bottom, 0px)
    )
    max(20px, var(--aerx-safe-area-inset-left, 0px));
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin: 6px 0 10px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}
h3 {
  font-size: 15px;
  margin: 0;
}
p {
  margin: 6px 0 16px;
  color: var(--muted);
}
small,
.muted {
  color: var(--muted);
  font-size: 13px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.3px;
  color: var(--muted);
  text-transform: uppercase;
}
.title-row,
.account-top,
.row,
.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.title-row {
  justify-content: space-between;
  margin-bottom: 22px;
}
.brand {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 16px;
  font-size: 27px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  margin: 0 0 24px;
}
.tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px #0000000d;
}
.account-select {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 13px;
  margin-top: 7px;
}
.current {
  border-left: 3px solid var(--accent);
  padding: 8px 13px;
  margin: 18px 0 22px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border-radius: 0 8px 8px 0;
}
.current p {
  margin: 2px 0;
  font-size: 13px;
}
.search {
  width: 100%;
  min-height: 48px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 15px;
  border-radius: 12px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0 22px;
}
.filter {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.filter[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 10px;
}
.list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.chat-row {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.chat-row:last-child {
  border: 0;
}
.row-text {
  flex: 1;
  min-width: 0;
}
.row-text h3 {
  overflow-wrap: anywhere;
}
.avatar {
  display: grid;
  place-items: center;
  height: 42px;
  width: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  font-size: 14px;
  font-weight: 700;
}
.avatar.large {
  width: 48px;
  height: 48px;
  font-size: 17px;
}
.switch {
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  border: 0;
  border-radius: 18px;
  padding: 3px;
  background: color-mix(in srgb, var(--muted) 30%, var(--surface));
}
.switch::after {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.15s;
}
.switch[aria-checked="true"] {
  background: var(--accent);
}
.switch[aria-checked="true"]::after {
  transform: translateX(18px);
}
.row-bottom {
  margin: 10px 0 0 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.text-button {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 8px 0;
  min-height: 40px;
  font-weight: 600;
  text-align: left;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.hint {
  font-size: 12px;
  margin: 16px 3px;
  line-height: 1.6;
}
.account-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
  background: var(--surface);
  margin: 12px 0;
}
.account-card.selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.account-card p {
  font-size: 13px;
  margin: 12px 0;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.button {
  min-height: 48px;
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
}
.button.secondary {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.danger {
  color: var(--danger);
}
.empty {
  padding: 42px 12px;
  text-align: center;
  max-width: 460px;
  margin: auto;
}
.empty-icon {
  display: grid;
  place-items: center;
  font-size: 34px;
  width: 74px;
  height: 74px;
  margin: 0 auto 24px;
  border-radius: 24px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.empty p {
  line-height: 1.6;
}
.spinner {
  display: inline-block;
  width: 25px;
  height: 25px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 16px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
  .switch::after {
    transition: none;
  }
}
#notice:not(:empty) {
  position: fixed;
  z-index: 5;
  max-width: min(600px, calc(100% - 32px));
  left: 50%;
  bottom: calc(20px + var(--aerx-safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 35px #0002;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 18px;
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
dialog::backdrop {
  background: #08142480;
  backdrop-filter: blur(4px);
}
.sheet-head {
  justify-content: space-between;
  margin-bottom: 18px;
}
.close {
  border: 0;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  font-size: 22px;
  background: var(--bg);
  color: var(--muted);
}
.field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  font-weight: 600;
}
.field input {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  width: 100%;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0;
}
.consent input {
  margin-top: 4px;
  min-width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.privacy {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.6;
}
.qr {
  width: min(100%, 250px);
  display: block;
  margin: 18px auto;
  border: 10px solid #fff;
  border-radius: 12px;
  background: #fff;
}
.sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.error {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 0;
}
.demo {
  border: 1px dashed var(--accent);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 18px;
}
@media (max-width: 360px) {
  #app {
    padding-left: 14px;
    padding-right: 14px;
  }
  .chat-row {
    padding: 13px;
  }
  .row-bottom {
    margin-left: 0;
  }
}
.demo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.demo .text-button {
  flex-shrink: 0;
  font-size: 12px;
  padding: 0;
}
