*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }

:root {
  
  --bg:          #141523;
  --bg-tint:     #1a1b2e;

  
  --glass:       #1d1e2d;
  --glass-bold:  #232435;
  --glass-border:#202131;

  
  --text:        #ffffff;
  --text2:       rgba(255,255,255,0.55);
  --text3:       rgba(255,255,255,0.3);

  
  --accent:      #3b82f6;
  --accent-soft: rgba(59,130,246,0.2);
  --accent-text: #93bbfd;

  
  --destructive: #ff453a;
  --success:     #34c759;

  
  --sep:         #25263a;

  
  --r-island:    24px;
  --r-card:      18px;
  --r-btn:       14px;
  --r-pill:      999px;

  
  --pad:         16px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h:       56px;
  --header-h:    52px;
}

body.no-blur *,
body.no-blur *::before,
body.no-blur *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.no-blur .bottom-nav,
body.no-blur .input-area,
body.no-blur .sort-dropdown {
  background: var(--bg-tint) !important;
}

html {
  height: 100%;
  height: 100dvh;
}
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  font-size: 16px;
  line-height: 1.4;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.view-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 100ms ease;
}
.view-content.transitioning { opacity: 0; }

.header {
  height: var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 6px 0 4px;
  gap: 4px;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.header-txt-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  padding: 6px 10px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.header-txt-btn:disabled { opacity: 0.35; }

.header-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 1px;
  height: 16px;
}
.header-sub-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-btn);
  background: transparent;
  border: none;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon:active { background: var(--glass); color: var(--text); }
.btn-icon svg { width: 20px; height: 20px; }

.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-width: none;
  
  padding-bottom: calc(var(--nav-h) + 24px + var(--safe-bottom));
  scroll-padding-bottom: calc(var(--nav-h) + 60px + var(--safe-bottom));
}
.scroll-area::-webkit-scrollbar { display: none; }

.nav-fade {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + 44px + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 75%);
  pointer-events: none;
  z-index: 99;
}
.bottom-nav {
  position: fixed;
  bottom: calc(10px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, calc(100% - 48px));
  height: var(--nav-h);
  display: flex;
  background: color-mix(in srgb, var(--bg-tint) 80%, transparent);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-island);
  z-index: 100;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 30%),
    0 8px 12px 6px rgb(0 0 0 / 15%),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}

.nav-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: calc(25% - 6px);
  background: var(--accent-soft);
  border-radius: calc(var(--r-island) - 5px);
  transition: left 0.3s cubic-bezier(.32,.72,.35,1.1);
  pointer-events: none;
  z-index: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text3);
  border: none;
  background: transparent;
  padding: 0;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}
.nav-item.active { color: var(--accent-text); }
.nav-item svg { width: 22px; height: 22px; }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.1px; }
body.kb-open .bottom-nav,
body.kb-open .nav-fade { display: none; }

body.kb-open .input-area {
  bottom: calc(6px + var(--kb-h, 0px));
}
body.kb-open .input-fade {
  bottom: var(--kb-h, 0px);
}
body.kb-open .messages-area {
  padding-bottom: calc(100px + var(--kb-h, 0px));
}

.island {
  margin: 0 var(--pad);
  background: var(--glass);
  border-radius: var(--r-card);
  overflow: hidden;
}

.section-lbl {
  padding: 24px var(--pad) 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-row {
  display: flex;
  align-items: center;
  padding: 13px var(--pad);
  gap: 12px;
  cursor: pointer;
  min-height: 48px;
  position: relative;
}
.settings-row::after {
  content: '';
  position: absolute;
  left: var(--pad);
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sep);
}
.settings-row:last-child::after { display: none; }
.settings-row:active { background: rgba(255,255,255,0.04); }

.settings-label {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}
.settings-label-sub {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}
.settings-val {
  font-size: 15px;
  color: var(--text2);
  margin-right: 2px;
}
.settings-chev { color: var(--text3); flex-shrink: 0; }
.settings-chev svg { width: 16px; height: 16px; }

.toggle {
  width: 51px;
  height: 31px;
  border-radius: var(--r-pill);
  background: var(--glass-bold);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
  padding: 0;
  outline: none;
}
.toggle.on { background: var(--success); }
.toggle::after {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.25s cubic-bezier(.25,.46,.45,.94);
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 1px 3px 1px rgb(0 0 0 / 15%);
}
.toggle.on::after { left: 22px; }

.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.9);
  font-weight: 700;
  flex-shrink: 0;
  border-radius: 50%;
}
.avatar-ph.sq, .avatar.sq { border-radius: var(--r-btn); }

.profile-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-bottom: calc(var(--nav-h) + 32px + var(--safe-bottom));
}
.profile-scroll::-webkit-scrollbar { display: none; }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px var(--pad) 16px;
}
.profile-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.profile-sub {
  font-size: 14px;
  color: var(--accent-text);
  margin-top: 3px;
  font-weight: 500;
}

.island > .profile-stats-row,
.profile-stats-row {
  display: flex;
  margin-bottom: 0;
  gap: 0;
}
.profile-stat {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  position: relative;
}
.profile-stat + .profile-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--sep);
}
.profile-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.profile-stat-lbl {
  font-size: 12px;
  color: var(--text2);
  margin-top: 3px;
}

.profile-section {
  
}
.profile-bonus-row {
  display: flex;
  align-items: center;
  padding: 16px var(--pad);
  gap: 14px;
}
.bonus-amount-big {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}
.bonus-amount-lbl {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}

.credits-block {
  padding: 24px 20px;
  text-align: center;
}
.credits-num {
  font-size: 52px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -2px;
}
.credits-lbl {
  font-size: 14px;
  color: var(--text2);
  margin-top: 6px;
}
.tier-badge {
  display: inline-block;
  margin-top: 12px;
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 5px 16px;
  font-size: 12px;
  color: var(--accent-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.claim-btn {
  margin: 16px var(--pad) 0;
  width: calc(100% - var(--pad) * 2);
  background: var(--accent);
  border: none;
  border-radius: var(--r-pill);
  padding: 15px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s;
}
.claim-btn:disabled {
  background: var(--glass-bold);
  color: var(--text3);
  cursor: default;
}
.claim-btn:active:not(:disabled) { transform: scale(0.97); }

.countdown {
  text-align: center;
  font-size: 14px;
  color: var(--text2);
  padding: 10px 0 0;
}
.countdown strong { color: var(--text2); font-variant-numeric: tabular-nums; }

.btn-primary {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--r-pill);
  padding: 15px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s;
}
.btn-primary:disabled { opacity: 0.25; cursor: default; }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }

.btn-secondary {
  width: 100%;
  background: var(--glass-bold);
  border: none;
  border-radius: var(--r-pill);
  padding: 14px;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}
.btn-secondary:active { background: rgba(255,255,255,0.15); }

.btn-danger {
  width: 100%;
  background: rgba(255,69,58,0.15);
  border: none;
  border-radius: var(--r-pill);
  padding: 15px;
  color: var(--destructive);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}
.btn-danger:active { background: rgba(255,69,58,0.25); }

.btn-sm {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--text2);
  font-size: 14px;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-sm:active { background: var(--glass-bold); color: var(--text); }
.btn-sm:disabled { opacity: 0.3; pointer-events: none; }

.info-card {
  
  overflow: hidden;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px var(--pad);
  font-size: 15px;
  position: relative;
}
.info-row::after {
  content: '';
  position: absolute;
  left: var(--pad);
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sep);
}
.info-row:last-child::after { display: none; }
.info-row-label { color: var(--text2); }
.info-row-val { color: var(--text); font-weight: 500; }

.form-field { margin-bottom: 12px; }
.form-label {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-btn);
  padding: 12px 14px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-textarea { resize: none; min-height: 90px; line-height: 1.5; }

.model-row {
  display: flex;
  align-items: center;
  padding: 14px var(--pad);
  gap: 12px;
  cursor: pointer;
  position: relative;
}
.model-row::after {
  content: '';
  position: absolute;
  left: var(--pad);
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sep);
}
.model-row:last-child::after { display: none; }
.model-row:active { background: rgba(255,255,255,0.04); }
.model-row.selected {}
.model-row.locked { opacity: 0.35; cursor: default; }
.model-name { font-size: 16px; font-weight: 500; color: var(--text); }
.model-desc { font-size: 13px; color: var(--text2); margin-top: 2px; line-height: 1.4; }
.model-check { flex-shrink: 0; color: var(--accent-text); }
.model-check svg { width: 18px; height: 18px; }
.model-lock { flex-shrink: 0; color: var(--text3); }
.model-lock svg { width: 16px; height: 16px; }

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-bottom: calc(var(--nav-h) + 32px + var(--safe-bottom));
}
.chat-list::-webkit-scrollbar { display: none; }

.chat-item {
  display: flex;
  align-items: center;
  padding: 14px var(--pad);
  gap: 13px;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.chat-item::after {
  content: '';
  position: absolute;
  left: 77px;
  right: var(--pad);
  bottom: 0;
  height: 1px;
  background: var(--sep);
}
.chat-item:last-child::after { display: none; }
.chat-item:active { background: rgba(255,255,255,0.06); }
.chat-item.selected { background: var(--accent-soft); }

.chat-info { flex: 1; min-width: 0; }
.chat-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.chat-preview {
  font-size: 14px;
  color: var(--text2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.chat-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.chat-check.checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  gap: 10px;
  text-align: center;
}
.empty-icon { font-size: 44px; margin-bottom: 4px; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text); }
.empty-desc { font-size: 15px; color: var(--text2); line-height: 1.5; }
.greeting-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 12px 24px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 16px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .15s, opacity .15s;
}
.greeting-btn:active { transform: scale(.96); opacity: .85; }
.greeting-btn svg { flex-shrink: 0; }

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 28px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 8px 3px rgb(0 0 0 / 15%);
  z-index: 10;
}
.fab:active { transform: scale(0.88); }
.fab svg { width: 22px; height: 22px; }

.messages-area {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-width: none;
  padding: 8px 0;
  padding-bottom: calc(105px + var(--safe-bottom));
  scroll-padding-bottom: calc(110px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}
.messages-area::-webkit-scrollbar { display: none; }

.load-more-area { text-align: center; padding: 8px; }
.load-more-area button {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--text2);
  font-size: 13px;
  padding: 6px 18px;
  cursor: pointer;
  font-family: inherit;
}
.load-more-area button:active { background: var(--glass-bold); }

.message-row { display: flex; padding: 2px 12px; align-items: flex-end; }
.message-row.user { justify-content: flex-end; }
.message-row.model { justify-content: flex-start; }

.message-row.user .msg-undo-btn { order: -1; margin-left: 0; margin-right: 6px; }

.bubble {
  max-width: min(78%, 500px);
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}
.bubble.user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}
.bubble.model {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 6px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #fff;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.85s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 3px 0;
}
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--text3);
  border-radius: 50%;
}
.typing-dots span:nth-child(1) { animation: tdot 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation: tdot 1.2s ease-in-out 0.2s infinite; }
.typing-dots span:nth-child(3) { animation: tdot 1.2s ease-in-out 0.4s infinite; }
@keyframes tdot { 0%,60%,100%{transform:translateY(0);opacity:.3} 30%{transform:translateY(-5px);opacity:1} }

.swipeable {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  
  width: 100%;
  max-width: min(78%, 500px);
  min-width: 0;
}

.swipe-mirror {
  position: absolute;
  top: -10000px;
  left: 0;
  width: 100%;
  visibility: hidden;
  pointer-events: none;
  contain: layout paint;
}

.swipe-mirror-card.bubble.model {
  width: 100%;
  
  max-width: 100%;
  color: transparent !important;
  background: transparent !important;
  border-color: transparent !important;
}
.swipe-mirror-card .typing-dots { padding: 3px 0; }

.swipe-stage {
  position: relative;
  overflow: hidden;
  padding: 0;
  
  max-width: 100%;
  min-height: 36px;
  touch-action: pan-y;
  cursor: default;
  user-select: text;
  
  transition: height 0.18s cubic-bezier(0.32, 0.72, 0.28, 1.0);
}

.swipe-stage { cursor: grab; }
.swipe-stage:active { cursor: grabbing; }
.swipe-stage.dragging {
  transition: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}
.swipe-stage.streamingTail { cursor: default; }

.swipe-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
  will-change: transform, opacity, filter;
  transform-origin: 50% 50%;
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
}
.swipe-card .typing-dots { padding: 3px 0; }
.swipe-card .cursor { vertical-align: text-bottom; }

.swipe-regen-hint {
  position: absolute;
  top: calc(50% - 22px);
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bold);
  border: 1px solid var(--glass-border);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform-origin: 50% 50%;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  z-index: 3;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.swipe-regen-hint svg { width: 20px; height: 20px; display: block; }
.swipe-regen-hint.armed {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.swipe-pager {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0;
  margin: 6px 0 2px 0;
  padding: 2px 4px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 12px;
  color: var(--text2);
  user-select: none;
  animation: pager-in 0.26s cubic-bezier(0.32, 0.72, 0.28, 1.0) both;
  box-shadow: 0 1px 2px rgba(0,0,0,0.16);
}
@keyframes pager-in {
  from { opacity: 0; transform: translateY(-3px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pager-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 0;
  font-family: inherit;
  transition: color 0.12s, background 0.12s, transform 0.12s;
}
.pager-btn:hover  { color: var(--text); background: var(--glass-bold); }
.pager-btn:active { transform: scale(0.86); background: var(--glass-bold); }
.pager-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.pager-btn svg { width: 14px; height: 14px; display: block; }

.pager-count {
  font-feature-settings: "tnum" 1, "lnum" 1;
  padding: 0 4px;
  display: inline-flex;
  align-items: baseline;
  min-width: 36px;
  justify-content: center;
  letter-spacing: 0.2px;
}
.pager-count b { color: var(--text); font-weight: 600; }
.pager-sep { opacity: 0.4; padding: 0 1px; }

.action-icons {
  display: flex;
  gap: 8px;
  padding: 2px 12px 6px;
}
.act-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.act-icon svg { width: 16px; height: 16px; }
.act-icon:active { color: var(--text); background: var(--glass); }
.act-icon:disabled { opacity: 0.3; pointer-events: none; }

.action-bar { display: flex; gap: 6px; padding: 4px 12px 6px; flex-wrap: wrap; }
.action-btn {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--r-pill); padding: 6px 14px; font-size: 13px;
  color: var(--text2); cursor: pointer; white-space: nowrap;
  font-family: inherit; display: flex; align-items: center; gap: 5px;
}
.action-btn svg { width: 14px; height: 14px; }
.action-btn:active { background: var(--glass-bold); color: var(--text); }
.action-btn:disabled { opacity: 0.3; pointer-events: none; }

.edit-ta {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 60px;
}
.edit-row { display: flex; gap: 8px; margin-top: 10px; }
.edit-save {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.edit-cancel {
  background: var(--glass-bold);
  color: var(--text2);
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.suggestions-row {
  position: fixed;
  bottom: calc(64px + var(--safe-bottom));
  left: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  z-index: 20;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.suggestions-row::-webkit-scrollbar { display: none; }
.suggestion-pill {
  flex-shrink: 0;
  max-width: 45%;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text1);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, transform 0.1s;
}
.suggestion-pill:active {
  transform: scale(0.95);
  background: var(--glass-bold);
}

.input-fade {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(70px + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 75%);
  pointer-events: none;
  z-index: 19;
}
.input-area {
  position: fixed;
  bottom: calc(6px + var(--safe-bottom));
  left: 14px;
  right: 14px;
  padding: 6px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: color-mix(in srgb, var(--bg-tint) 80%, transparent);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-island);
  box-shadow:
    0 -1px 2px rgb(0 0 0 / 30%),
    0 -4px 8px 3px rgb(0 0 0 / 15%),
    inset 0 1px 0 rgba(255,255,255,0.06);
  z-index: 20;
}

.input-wrap {
  flex: 1;
  min-height: 36px;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: flex-end;
  padding: 6px 10px;
}

.msg-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
}
.msg-input::placeholder { color: var(--text3); }

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.send-btn:disabled { opacity: 0.2; }
.send-btn:active:not(:disabled) { transform: scale(0.88); }
.send-btn svg { width: 17px; height: 17px; }

.no-credits-bar {
  background: rgba(255,69,58,0.1);
  border-top: 1px solid rgba(255,69,58,0.2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--destructive);
}
.no-credits-bar button {
  background: var(--destructive);
  border: none;
  color: #fff;
  border-radius: var(--r-pill);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.nsfw-chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--glass);
  color: var(--text2);
  font-family: inherit;
}
.nsfw-chip.on { background: var(--accent); color: #fff; }

.toast-stack {
  position: fixed;
  top: calc(var(--header-h) + 8px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 500;
  pointer-events: none;
}
.toast {
  background: color-mix(in srgb, var(--bg-tint) 70%, transparent);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 8px 3px rgb(0 0 0 / 15%);
}
.toast-enter-active { animation: toast-in 0.18s ease-out; }
.toast-leave-active { animation: toast-out 0.14s ease-in forwards; }
@keyframes toast-in  { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
@keyframes toast-out { from{opacity:1} to{opacity:0} }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--bg-tint);
  border-radius: var(--r-island) var(--r-island) 0 0;
  padding: 14px var(--pad) calc(16px + var(--safe-bottom));
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-padding-bottom: 120px;
  border: 1px solid var(--glass-border);
  border-bottom: none;
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--text3);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.modal-enter-active { animation: sheet-up 0.22s ease-out; }
.modal-leave-active { animation: sheet-dn 0.18s ease-in; }
@keyframes sheet-up { from{transform:translateY(100%)} to{transform:none} }
@keyframes sheet-dn { from{transform:none} to{transform:translateY(100%)} }

.message-enter-active { animation: msg-in 0.16s ease-out; }
@keyframes msg-in { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }

.bubble b, .bubble strong { font-weight: 700; }
.bubble i, .bubble em { font-style: italic; }
.bubble del { text-decoration: line-through; opacity: 0.6; }
.bubble code {
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.bubble.user code { background: rgba(0,0,0,0.12); }
.bubble pre {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 6px 0;
}
.bubble pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #ddd;
  white-space: pre;
}

.msg-undo-btn {
  opacity: 0.35;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--glass);
  border: none;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 4px; margin-left: 6px;
  font-family: inherit;
}
.msg-undo-btn svg { width: 12px; height: 12px; }
.message-row:hover .msg-undo-btn,
.message-row:active .msg-undo-btn { opacity: 0.6; }
.msg-undo-btn:active { background: rgba(255,69,58,0.2); color: var(--destructive); opacity: 1 !important; }

.image-bubble { padding: 3px; overflow: hidden; cursor: pointer; }
.gen-image {
  width: 100%;
  max-width: 280px;
  border-radius: var(--r-card);
  display: block;
}
.gen-image:active { opacity: 0.75; }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  overflow: hidden;
}
.lightbox img {
  max-width: 94%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 1;
}
.lightbox-toolbar {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.lightbox-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none; color: #fff;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit;
}
.lightbox-btn svg { width: 18px; height: 18px; }
.lightbox-btn:active { background: rgba(255,255,255,0.25); }

.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.sort-chip:active { background: var(--glass-bold); }
.sort-chip svg { width: 12px; height: 12px; }

.chat-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-tint);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  min-width: 170px;
  z-index: 100;
  overflow-y: auto;
  max-height: 70vh;
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 12px 6px rgb(0 0 0 / 15%);
}
.chat-dropdown-item {
  padding: 13px var(--pad);
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  position: relative;
}
.chat-dropdown-item::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--sep);
}
.chat-dropdown-item:last-child::after { display: none; }
.chat-dropdown-item:active { background: rgba(255,255,255,0.06); }
.chat-dropdown-danger { color: var(--destructive); }

.char-detail-screen {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.char-detail-screen::-webkit-scrollbar { display: none; }
.char-detail-photo {
  aspect-ratio: 16/9;
  background: var(--glass);
  position: relative;
  overflow: hidden;
  max-height: 260px;
}
.char-detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.char-detail-photo-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; font-weight: 700; color: var(--text3);
}
.char-detail-body { padding: var(--pad); }
.char-detail-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.4px;
}
.char-detail-score { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.char-detail-date { color: var(--text3, rgba(255,255,255,0.4)); }
.char-detail-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  white-space: pre-wrap;
}

.chars-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 10px 12px;
}
.chars-scroll::-webkit-scrollbar { display: none; }
.char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.char-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  overflow: hidden;
  cursor: pointer;
}
.char-card:active { opacity: 0.75; }
.char-photo-wrap {
  aspect-ratio: 2/3;
  background: var(--glass-bold);
  position: relative;
  overflow: hidden;
}
.char-photo-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.char-photo-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700;
  color: rgba(255,255,255,0.4);
}
.char-info { padding: 8px 10px; }
.char-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.char-desc {
  font-size: 12px; color: var(--text2); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.char-score { font-size: 11px; color: var(--text3); margin-top: 4px; }

.load-more-chars { grid-column: 1 / -1; text-align: center; padding: 10px 0 4px; }
.load-more-chars button {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--text2);
  font-size: 13px;
  padding: 8px 20px;
  cursor: pointer;
  font-family: inherit;
}
.load-more-chars button:active { background: var(--glass-bold); }

.settings-screen {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-width: none;
  padding-bottom: calc(var(--nav-h) + 24px + var(--safe-bottom));
  scroll-padding-bottom: calc(var(--nav-h) + 60px + var(--safe-bottom));
}
.settings-screen::-webkit-scrollbar { display: none; }
.search-bar {
  padding: 8px 12px;
  background: var(--bg);
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-btn);
  padding: 10px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.search-input::placeholder { color: var(--text3); }

.sort-chips {
  display: flex; gap: 6px;
  padding: 8px 12px 6px;
  overflow-x: auto;
}
.sort-chip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--text2);
  font-size: 14px; font-weight: 500;
  padding: 7px 18px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.sort-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sort-chip:active:not(.active) { background: var(--glass-bold); }

.community-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.community-controls {
  background: var(--bg);
  flex-shrink: 0;
}

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--glass-bold);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--accent); }
.login-screen .btn-primary {
  background: #fff;
  color: #141523;
}
.login-screen .btn-primary:active {
  background: rgba(255,255,255,0.85);
}
.tg-login-box {
  display: flex;
  justify-content: center;
  min-height: 40px;
}
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 4px 0 2px;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.shop-card { padding: 20px 16px; margin-bottom: 12px; }
.shop-tier { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.shop-desc { font-size: 13px; color: var(--text3); line-height: 1.5; }
.shop-feat { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text2); line-height: 1.5; margin-bottom: 4px; }
.shop-check { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.shop-divider { height: 1px; background: var(--glass-border); margin: 14px 0 4px; }
.shop-option { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.shop-option-border { border-top: 1px solid var(--glass-border); }
.shop-option-label { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.shop-btn { border: none; border-radius: 20px; padding: 7px 0; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; width: 80px; text-align: center; transition: opacity 0.15s; }
.shop-btn:disabled { opacity: 0.5; cursor: default; }
.shop-btn-ton { background: #0098ea; color: #fff; }
.shop-btn-stars { background: var(--accent); color: #fff; }

.streak-icon { flex-shrink: 0; }
.streak-none { opacity: 0.3; color: #888; }
.streak-common { color: #ffd700; filter: drop-shadow(0 0 3px rgba(255,215,0,0.4)); }
.streak-rare { color: #ff8c00; filter: drop-shadow(0 0 4px rgba(255,140,0,0.6)); }
.streak-epic { color: #ff3030; filter: drop-shadow(0 0 5px rgba(255,48,48,0.6)); }
.streak-legendary { color: #ff2020; filter: drop-shadow(0 0 6px rgba(255,32,32,0.8)); animation: streak-pulse 2s ease-in-out infinite; }
.streak-mythic { color: #da70d6; filter: drop-shadow(0 0 8px rgba(218,112,214,0.8)); animation: streak-pulse 1.5s ease-in-out infinite; }
@keyframes streak-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.streak-anim-up {
  animation: streak-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.streak-anim-up .streak-icon {
  animation: streak-fire-grow 1s ease-out;
}
.streak-anim-up .profile-stat-lbl {
  color: #ffd700 !important;
  font-weight: 600;
  animation: streak-label-fade 2.5s ease-out forwards;
}
.streak-num-pop {
  animation: streak-count-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes streak-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@keyframes streak-fire-grow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px currentColor); }
  40% { transform: scale(1.8); filter: drop-shadow(0 0 12px currentColor); }
  100% { transform: scale(1); }
}
@keyframes streak-count-up {
  0% { opacity: 0; transform: translateY(12px) scale(0.5); }
  50% { opacity: 1; transform: translateY(-4px) scale(1.3); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes streak-label-fade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0.5; }
}

.streak-anim-reset {
  animation: streak-shake 0.6s ease-in-out;
}
.streak-anim-reset .streak-icon {
  animation: streak-fire-die 2s ease-out forwards;
}
.streak-anim-reset .profile-stat-lbl {
  color: var(--destructive) !important;
  font-weight: 600;
}
.streak-old-val {
  position: absolute;
  color: var(--destructive);
  animation: streak-old-fly 1s ease-out forwards;
  pointer-events: none;
}
@keyframes streak-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}
@keyframes streak-fire-die {
  0% { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
  50% { opacity: 0.4; filter: drop-shadow(0 0 0px currentColor) grayscale(0.8); }
  100% { opacity: 0.3; filter: grayscale(1); }
}
@keyframes streak-old-fly {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.6); }
}

.art-mode-segmented {
  position: relative;
  display: flex;
  background: transparent;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r-pill);
  padding: 3px;
  overflow: hidden;
  user-select: none;
}
.art-mode-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  transition: transform 0.55s cubic-bezier(0.22, 1.4, 0.36, 1);
  will-change: transform;
}
.art-mode-indicator[data-pos="advanced"] { transform: translateX(100%); }
.art-mode-btn {
  flex: 1;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.3s ease, font-weight 0.3s ease;
  min-width: 0;
  letter-spacing: 0.1px;
}
.art-mode-btn.active {
  color: var(--accent);
  font-weight: 600;
}
.art-mode-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}
.art-mode-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  animation: art-mode-icon-in 0.4s cubic-bezier(0.22, 1.4, 0.36, 1);
}
@keyframes art-mode-icon-in {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.art-mode-hint {
  font-size: 12px;
  color: var(--text3);
  padding: 10px 4px 0;
  line-height: 1.4;
  min-height: 17px;
}

.webaccess-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.webaccess-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}
.url-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--glass-bold);
  border-radius: var(--r-btn);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  min-height: 48px;
}
.url-chip:active { background: color-mix(in srgb, var(--glass-bold) 60%, var(--accent)); }
.url-chip-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
}
.url-chip-icon svg { width: 100%; height: 100%; }
.url-chip-text {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.url-chip-action {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
}
.url-chip-action svg { width: 100%; height: 100%; }
.url-chip:hover .url-chip-action { color: var(--text2); }

.token-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--r-btn);
}
.token-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.token-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s;
}
.token-chip:active { transform: scale(0.98); }
.token-value {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  user-select: all;
  line-height: 1.4;
}
.token-copy {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
}
.token-copy svg { width: 100%; height: 100%; }
.token-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}
