/* ============================================================
   Wafer AI — Design System v2.6 "Aurora"
   Premium SaaS interface. RTL-first. stdlib-friendly.
   ============================================================ */

@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:400;font-display:swap;src:url('assets/plex-arabic-400-arabic.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+200C-200E,U+2010-2011,U+204F,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:400;font-display:swap;src:url('assets/plex-arabic-400-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:600;font-display:swap;src:url('assets/plex-arabic-600-arabic.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+200C-200E,U+2010-2011,U+204F,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:600;font-display:swap;src:url('assets/plex-arabic-600-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:700;font-display:swap;src:url('assets/plex-arabic-700-arabic.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+200C-200E,U+2010-2011,U+204F,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:700;font-display:swap;src:url('assets/plex-arabic-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root,
html[data-theme="dark"] {
  --bg: #06070D;
  --bg-secondary: #0A0C15;
  --surface: rgba(18, 21, 36, .72);
  --surface-solid: #121524;
  --surface-hover: rgba(31, 35, 56, .78);
  --border: rgba(148, 163, 216, .14);
  --border-strong: rgba(148, 163, 216, .26);
  --text-primary: #F5F6FC;
  --text-secondary: #A3ABCB;
  --text-muted: #6B7394;
  --wafer-lime: #8B5CF6;
  --wafer-lime-hover: #7C4DE8;
  --accent: #8B5CF6;
  --accent-2: #22D3EE;
  --wafer-violet: #A78BFA;
  --wafer-blue: #38BDF8;
  --grad: linear-gradient(120deg, #7C3AED, #4F46E5 60%, #3B82F6);
  --grad-text: linear-gradient(100deg, #C4B5FD, #818CF8 45%, #22D3EE);
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #FB7185;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow: 0 24px 70px rgba(2, 4, 14, .55);
  --shadow-soft: 0 10px 34px rgba(2, 4, 14, .38);
  --glow: 0 8px 30px rgba(124, 58, 237, .35);
  --transition-fast: 160ms ease;
  --transition-normal: 220ms ease;
  --transition-slow: 280ms ease;
  --sidebar-w: 252px;
  --sidebar-collapsed: 76px;
  --topbar-h: 84px;
  --accent-soft: rgba(139, 92, 246, .13);
  --accent-line: rgba(139, 92, 246, .34);
  --overlay: rgba(3, 4, 10, .72);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #E7EAF5;
  --bg-secondary: #DBE0F0;
  --surface: rgba(255, 255, 255, .92);
  --surface-solid: #FFFFFF;
  --surface-hover: #E9EDF9;
  --border: rgba(58, 68, 130, .24);
  --border-strong: rgba(58, 68, 130, .42);
  --text-primary: #0D1130;
  --text-secondary: #39416A;
  --text-muted: #5D668C;
  --wafer-lime: #7C3AED;
  --wafer-lime-hover: #6D31D8;
  --accent: #7C3AED;
  --accent-2: #0E7490;
  --wafer-violet: #7C3AED;
  --wafer-blue: #0369A1;
  --grad: linear-gradient(120deg, #7C3AED, #4F46E5 60%, #2563EB);
  --grad-text: linear-gradient(100deg, #6D28D9, #4F46E5 45%, #0E7490);
  --success: #059669;
  --warning: #B45309;
  --danger: #E11D48;
  --shadow: 0 22px 55px rgba(30, 37, 85, .20);
  --shadow-soft: 0 10px 28px rgba(30, 37, 85, .13);
  --glow: 0 8px 26px rgba(124, 58, 237, .30);
  --accent-soft: rgba(124, 58, 237, .14);
  --accent-line: rgba(124, 58, 237, .40);
  --overlay: rgba(24, 28, 50, .48);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}
body::before {
  content: '';
  position: fixed;
  inset: -20% -10%;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 82% 4%, rgba(124, 58, 237, .22), transparent 62%),
    radial-gradient(30% 30% at 8% 96%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(26% 24% at 18% 12%, rgba(59, 130, 246, .10), transparent 60%);
  z-index: 0;
  animation: auroraDrift 26s ease-in-out infinite alternate;
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(38% 34% at 82% 4%, rgba(124, 58, 237, .20), transparent 62%),
    radial-gradient(30% 30% at 8% 96%, rgba(14, 116, 144, .15), transparent 60%),
    radial-gradient(26% 24% at 18% 12%, rgba(37, 99, 235, .14), transparent 60%);
}
@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2.5%, -2%, 0) scale(1.06); }
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-line); color: var(--text-primary); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

html, body, .card, .sidebar, .topbar, button, input, textarea, select, table, .drawer, .modal,
.nav-link, .chat-card, .gallery-card, .stat, .balance-card, .tag, .toast {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* ---------- utility ---------- */
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, monospace; }
.hidden { display: none !important; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head-actions { display: flex; align-items: center; gap: 10px; }
.wallet-note { margin: 12px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.section-title { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.section-note { color: var(--text-muted); font-size: 11px; }
.eyebrow { color: var(--accent-2); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.page-title { font-size: 27px; line-height: 1.25; margin: 6px 0 2px; letter-spacing: -.025em; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: 12px; margin: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.logo-svg { width: 100%; height: 100%; display: block; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  inset: 0 0 0 auto;
  background: rgba(9, 11, 20, .82);
  backdrop-filter: blur(18px);
  border-left: 1px solid var(--border);
  padding: 22px 14px 18px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-normal), background-color .25s ease, border-color .25s ease;
}
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .78); }
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.main {
  width: calc(100% - var(--sidebar-w));
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  padding: 26px 34px 40px;
  transition: width var(--transition-normal), margin-right var(--transition-normal), padding .25s ease;
}
.main.expanded { width: calc(100% - var(--sidebar-collapsed)); margin-right: var(--sidebar-collapsed); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 26px; }
.brand-link { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px;
  background: var(--grad);
  border: 1px solid rgba(255, 255, 255, .16);
  display: grid; place-items: center;
  box-shadow: var(--glow);
}
.brand-mark .logo-svg { width: 30px; height: 30px; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-arabic { color: var(--text-muted); font-size: 10px; font-weight: 500; letter-spacing: .06em; }
.sidebar.collapsed .brand { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .brand-wordmark,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-mini span,
.sidebar.collapsed .mini-balance > span:first-child { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .side-bottom > * { justify-content: center; }
.sidebar.collapsed .points-chip { padding: 7px; gap: 4px; }
.sidebar.collapsed .points-label { display: none; }
.sidebar.collapsed .mini-balance { background: transparent; border: 0; padding: 0; }

/* ---------- nav ---------- */
.nav { display: grid; gap: 4px; }
.nav-section-label { color: var(--text-muted); font-size: 9px; letter-spacing: .12em; padding: 14px 12px 6px; text-transform: uppercase; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500;
  text-align: right;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-link.active {
  background: linear-gradient(120deg, rgba(124, 58, 237, .20), rgba(34, 211, 238, .07));
  color: var(--text-primary);
  border-color: var(--accent-line);
  font-weight: 600;
}
.nav-link.active::before {
  content: ''; position: absolute; right: 0; top: 18%; bottom: 18%;
  width: 3px; border-radius: 3px; background: var(--grad);
  box-shadow: 0 0 14px var(--accent-line);
}
.nav-link.active .nav-icon { color: var(--wafer-violet); }
.nav-icon { width: 22px; flex: 0 0 22px; text-align: center; font-size: 17px; color: var(--text-muted); transition: color var(--transition-fast); }
.nav-label { white-space: nowrap; }
.nav-badge { margin-right: auto; font-size: 9px; padding: 2px 7px; border-radius: 20px; background: var(--accent-soft); color: var(--wafer-violet); }
.side-bottom { margin-top: auto; display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.mini-balance {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 11px; color: var(--text-secondary);
}
.mini-balance strong { color: var(--wafer-violet); font-size: 15px; }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); min-width: 0; }
.user-mini span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini small { display: block; color: var(--text-muted); font-size: 10px; }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  background: var(--grad);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.sidebar-collapse { margin-right: auto; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--topbar-h); margin-bottom: 22px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); display: grid; place-items: center;
  font-size: 16px; flex: 0 0 38px;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
/* ---------- reusable points chip ---------- */
.points-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: 30px; cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--text-primary); font-size: 11px; font-weight: 700; white-space: nowrap;
  line-height: 1; transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  font-family: inherit;
}
.points-chip:hover { border-color: var(--wafer-violet); background: var(--surface-hover); transform: translateY(-1px); }
.points-chip:focus-visible { outline: 2px solid var(--wafer-violet); outline-offset: 2px; }
.points-icon {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 900;
  box-shadow: 0 0 12px rgba(124, 58, 237, .5);
  flex: 0 0 16px;
}
.points-value { font-variant-numeric: tabular-nums; min-width: 1ch; text-align: center; }
.points-label { color: var(--text-secondary); font-weight: 600; font-size: 10.5px; }
.points-chip[data-state="loading"] { opacity: .65; cursor: progress; }
.points-chip[data-state="loading"] .points-icon { animation: pulse 1.2s ease-in-out infinite; }
.points-chip[data-state="error"] { border-color: var(--danger); color: var(--danger); }
.points-chip[data-state="error"] .points-icon { background: var(--danger); box-shadow: none; }
.points-chip[data-state="empty"] { border-color: var(--border-strong); color: var(--text-muted); }
.points-chip.points-low { border-color: var(--danger); color: var(--danger); background: rgba(251, 113, 133, .12); }
.points-chip.points-low .points-icon { background: var(--danger); box-shadow: none; }
.points-chip-sidebar { padding: 6px 10px; font-size: 10.5px; }
.points-chip-drawer { width: 100%; justify-content: flex-start; margin-bottom: 6px; }
.points-chip-admin { padding: 6px 10px; font-size: 10.5px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; padding: 0; border: 1px solid var(--border-strong); }
.avatar-btn:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.account-wrap { position: relative; }
.account-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 45;
  width: 220px; padding: 8px; border-radius: var(--radius-md);
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: none; animation: fadeIn var(--transition-fast) both;
}
.account-menu.open { display: block; }
.account-menu button, .account-menu a {
  display: flex; width: 100%; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; text-align: right;
}
.account-menu button:hover, .account-menu a:hover { background: var(--surface-hover); color: var(--text-primary); }
.account-menu .danger { color: var(--danger); }

/* ---------- cards & primitives ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.panel-pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.split { grid-template-columns: minmax(0, 1.65fr) minmax(260px, .85fr); }
.stat { padding: 18px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; inset: auto -30px -55px auto; width: 110px; height: 110px; border-radius: 50%; background: var(--accent-soft); filter: blur(18px); }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); font-size: 11px; }
.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -.04em; margin: 14px 0 2px; }
.stat-note { color: var(--text-muted); font-size: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); border: 1px solid rgba(255, 255, 255, .14); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 38px rgba(124, 58, 237, .45); filter: brightness(1.08); }
.btn-secondary { background: var(--surface-hover); border: 1px solid var(--border); color: var(--text-primary); }
.btn-danger { background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .28); color: var(--danger); }
.ghost-btn { padding: 8px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; background: var(--surface); }
.ghost-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border-strong); }
.close { color: var(--text-muted); font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: var(--radius-sm); }
.close:hover { color: var(--text-primary); background: var(--surface-hover); }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 600; padding: 4px 9px; border-radius: 30px;
  background: var(--accent-soft); color: var(--wafer-violet); white-space: nowrap;
}
.tag.gray { color: var(--text-secondary); background: var(--surface-hover); }
.tag.blue { color: var(--wafer-blue); background: rgba(56, 189, 248, .1); }
.tag.danger { color: var(--danger); background: rgba(251, 113, 133, .1); }
.tag.success { color: var(--success); background: rgba(52, 211, 153, .1); }
.tag.warning { color: var(--warning); background: rgba(251, 191, 36, .1); }
.progress { height: 6px; border-radius: 20px; background: var(--surface-hover); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 10px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.empty-state { display: grid; place-items: center; text-align: center; gap: 8px; padding: 38px 18px; color: var(--text-muted); font-size: 12px; }
.empty-state .empty-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--wafer-violet); font-size: 21px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-hover), var(--border), var(--surface-hover)); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }

/* ---------- forms & tables ---------- */
.field label { display: block; color: var(--text-secondary); font-size: 11px; margin-bottom: 7px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 12.5px; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--wafer-violet); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 104px; resize: vertical; line-height: 1.8; }
.select { appearance: none; padding-left: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: left 14px center, left 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: right; font-size: 12px; white-space: nowrap; }
.table th { color: var(--text-muted); font-size: 10px; font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-hover); }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; }
.user-cell small { display: block; color: var(--text-muted); font-size: 10px; }

/* ---------- chat ---------- */
.chat-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 16px; min-height: 0; }
.chat-history { padding: 14px; display: flex; flex-direction: column; min-height: 0; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.history-head h3 { font-size: 12px; margin: 0; }
.history-list { overflow-y: auto; display: grid; gap: 3px; align-content: start; }
.history-item { display: flex; align-items: center; gap: 6px; padding: 10px 11px; border-radius: var(--radius-md); color: var(--text-secondary); transition: background var(--transition-fast); }
.history-link { flex: 1; min-width: 0; display: block; color: inherit; }
.history-item:hover, .history-item.active { background: var(--surface-hover); color: var(--text-primary); }
.history-item.active { box-shadow: inset -2px 0 var(--wafer-violet); }
.history-item strong { display: block; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small { color: var(--text-muted); font-size: 9.5px; }
.chat-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.history-toggle { display: none; }
.chat-title-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chat-title-wrap strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-select { width: auto; min-width: 190px; padding: 7px 30px 7px 10px; font-size: 11px; background-color: var(--bg-secondary); }
.chat-body { padding: 22px 20px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-stream { width: 100%; max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; gap: 20px; min-height: 100%; justify-content: flex-end; padding-top: 8px; }
.message { display: flex; align-items: flex-start; gap: 11px; max-width: 82%; animation: slideUp var(--transition-normal) both; }
.message.user { margin-right: auto; flex-direction: row-reverse; }
.message .avatar { width: 30px; height: 30px; flex-basis: 30px; }
.message.user .avatar { background: var(--grad); color: #fff; }
.message-bubble { padding: 12px 15px; border-radius: 16px; background: var(--surface-hover); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.95; min-width: 0; overflow-wrap: anywhere; }
.message.user .message-bubble { background: linear-gradient(120deg, rgba(124, 58, 237, .18), rgba(34, 211, 238, .08)); border-color: var(--accent-line); }
.message-bubble p { margin: 0 0 8px; }
.message-bubble p:last-child { margin: 0; }
.message-bubble code { font-family: ui-monospace, monospace; font-size: 11px; background: var(--bg); padding: 2px 5px; border-radius: 4px; direction: ltr; display: inline-block; }
.code-block { direction: ltr; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); margin-top: 11px; overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; color: var(--text-muted); font-size: 9.5px; border-bottom: 1px solid var(--border); }
.code-block pre { margin: 0; padding: 12px; color: var(--accent-2); font: 11.5px/1.75 ui-monospace, monospace; white-space: pre-wrap; }
.typing { display: flex; align-items: center; gap: 5px; padding: 12px 15px; border-radius: 14px; background: var(--surface-hover); width: fit-content; color: var(--text-secondary); font-size: 10.5px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--wafer-violet); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.chat-input { padding: 13px 16px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg-secondary); }
.chat-input-inner { width: 100%; max-width: 820px; margin-inline: auto; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 7px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.composer:focus-within { border-color: var(--wafer-violet); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { flex: 1; min-width: 0; resize: none; background: transparent; border: 0; outline: none; max-height: 140px; padding: 8px; font-size: 12.5px; line-height: 1.7; color: var(--text-primary); min-height: 40px; }
.composer textarea:focus { box-shadow: none; border: 0; }
.composer .icon-btn { width: 38px; height: 38px; flex-basis: 38px; }
.send-btn { width: 42px; height: 42px; flex: 0 0 42px; padding: 0; border-radius: 12px; font-size: 18px; }
.stop-btn { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: rgba(251, 113, 133, .12); color: var(--danger); border: 1px solid rgba(251, 113, 133, .25); }

body[data-page="chat"] .app { height: 100vh; height: var(--chat-vh, 100dvh); min-height: 0; }
body[data-page="chat"] .main { height: 100%; min-height: 0; display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden; }
body[data-page="chat"] .topbar { flex: 0 0 auto; margin-bottom: 14px; min-height: 66px; }
body[data-page="chat"] .chat-layout { flex: 1 1 auto; min-height: 0; }

/* ---------- images ---------- */
.image-create { padding: 20px; margin-bottom: 22px; }
.prompt-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: end; }
.prompt-row .textarea { min-height: 116px; }
.image-side { display: grid; gap: 12px; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--bg-secondary); border: 1px solid var(--border); }
.segment { flex: 1; padding: 8px 4px; border-radius: var(--radius-sm); font-size: 11px; color: var(--text-secondary); text-align: center; }
.segment:hover { background: var(--surface-hover); color: var(--text-primary); }
.segment.active { background: var(--surface-solid); color: var(--wafer-violet); box-shadow: var(--shadow-soft); font-weight: 600; }
.gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.gallery-card { overflow: hidden; cursor: zoom-in; position: relative; animation: fadeIn var(--transition-normal) both; }
.gallery-card:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.gallery-art { width: 100%; aspect-ratio: 1.25; object-fit: cover; transition: transform var(--transition-slow); }
.gallery-card:hover .gallery-art { transform: scale(1.035); }
.gallery-media { position: relative; }
.gallery-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 12, .5); opacity: 0; transition: opacity var(--transition-fast); color: #fff; font-size: 12px; pointer-events: none; }
.gallery-card:hover .gallery-overlay { opacity: 1; }
.gallery-info { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gallery-info strong { font-size: 11.5px; }
.gallery-info small { display: block; color: var(--text-muted); font-size: 9.5px; margin-top: 3px; }
.download { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-secondary); }
.download:hover { color: var(--wafer-violet); border-color: var(--accent-line); }

/* ---------- wallet ---------- */
.wallet-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); gap: 16px; margin-bottom: 18px; }
.balance-card { padding: 24px; min-height: 196px; position: relative; overflow: hidden; }
.balance-card::after { content: ''; position: absolute; left: -40px; bottom: -110px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid var(--accent-line); box-shadow: 0 0 0 24px var(--accent-soft), 0 0 0 50px rgba(124, 58, 237, .03); }
.balance-label { color: var(--text-secondary); font-size: 11px; }
.balance-number { font-size: 46px; font-weight: 700; letter-spacing: -.06em; margin: 16px 0 6px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.balance-number > span:last-child { font-size: 14px; color: var(--text-muted); letter-spacing: 0; -webkit-text-fill-color: var(--text-muted); }
.balance-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; position: relative; z-index: 1; }
.balance-foot .progress { flex: 1; }
.wallet-address { padding: 20px; }
.wallet-address p { font-size: 11px; color: var(--text-secondary); line-height: 1.8; margin: 0 0 12px; }
.address-box { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--radius-md); background: var(--bg-secondary); border: 1px solid var(--border); }
.address-box code { flex: 1; direction: ltr; text-align: left; font-size: 10.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-mini { padding: 7px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-secondary); font-size: 10px; }
.copy-mini:hover { color: var(--wafer-violet); border-color: var(--accent-line); }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 11px 15px; color: var(--text-secondary); font-size: 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-color: var(--wafer-violet); font-weight: 600; }
.admin-panel { display: none; animation: fadeIn var(--transition-normal) both; }
.admin-panel.active { display: block; }
.activity { display: grid; gap: 13px; }
.activity-row { display: flex; align-items: flex-start; gap: 11px; }
.activity-dot { width: 8px; height: 8px; margin-top: 6px; flex: 0 0 8px; border-radius: 50%; background: var(--wafer-violet); box-shadow: 0 0 0 4px var(--accent-soft); }
.activity-row p { margin: 0; font-size: 11.5px; }
.activity-row small { color: var(--text-muted); font-size: 9.5px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding-top: 12px; }
.chart .bar { flex: 1; border-radius: 5px 5px 0 0; background: var(--accent-line); min-height: 6px; }
.chart .bar:nth-child(3n) { background: var(--accent-2); opacity: .6; }
.chart-labels { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 9px; margin-top: 8px; }
.model-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--border); }
.model-row:last-child { border-bottom: 0; }
.model-meta strong { display: block; font-size: 12.5px; }
.model-meta small { color: var(--text-muted); font-size: 10px; }
.model-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cost-input { width: 66px; padding: 7px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary); border-radius: var(--radius-sm); text-align: center; font-size: 11px; }
.toggle { width: 42px; height: 24px; border-radius: 20px; background: var(--surface-hover); border: 1px solid var(--border); padding: 2px; display: inline-flex; align-items: center; }
.toggle i { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform var(--transition-fast), background var(--transition-fast); }
.toggle.on { background: var(--accent-soft); border-color: var(--accent-line); }
.toggle.on i { background: var(--wafer-violet); transform: translateX(-17px); }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(124, 58, 237, .20), transparent 48%),
    radial-gradient(ellipse at 85% 110%, rgba(34, 211, 238, .10), transparent 44%);
}
html[data-theme="light"] .login-page {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(124, 58, 237, .12), transparent 48%),
    radial-gradient(ellipse at 85% 110%, rgba(14, 116, 144, .10), transparent 44%);
}
.login-shell { width: min(440px, 100%); animation: slideUp var(--transition-slow) both; display: flex; flex-direction: column; }
.login-brand { display: flex; justify-content: center; margin-bottom: 26px; }
.login-brand .brand-mark { width: 58px; height: 58px; flex-basis: 58px; border-radius: 17px; }
.login-brand .brand-mark .logo-svg { width: 44px; height: 44px; }
.login-brand .brand-wordmark { font-size: 20px; }
.login-brand .brand-arabic { font-size: 12px; }
.login-card { padding: 32px 30px 26px; text-align: center; box-shadow: var(--shadow), 0 0 0 1px rgba(139, 92, 246, .10), 0 0 90px rgba(124, 58, 237, .14); }
.login-card h1 { font-size: 23px; margin: 0 0 6px; letter-spacing: -.02em; }
.login-card > p { color: var(--text-secondary); font-size: 14px; margin: 0 0 18px; }
/* WCAG AA: white on #1A7BA3 gives a 4.77:1 contrast ratio at 15px/600. */
.telegram { width: 100%; background: #1A7BA3; color: #fff; padding: 12px; border-radius: var(--radius-md); font-weight: 600; font-size: 15px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 8px 24px rgba(26, 123, 163, .35); }
.telegram:hover { background: #15688B; }
.telegram-retry, .telegram-reopen { width: 100%; margin-top: 8px; border: 1px solid var(--border-strong); background: var(--surface-hover); color: var(--text-primary); padding: 11px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; }
.telegram-retry:hover, .telegram-reopen:hover { border-color: var(--wafer-blue); color: var(--wafer-blue); }
.telegram-reopen { border-color: #2AABEE; color: #2AABEE; }
.demo-btn { width: 100%; margin-top: 10px; border: 1px solid var(--border); background: var(--surface-hover); color: var(--text-primary); padding: 11px; border-radius: var(--radius-md); font-size: 12px; font-weight: 600; }
.demo-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); }
#telegram-login-box { display: flex; justify-content: center; align-items: center; min-height: 44px; text-align: center; }
#telegram-login-box[hidden], .telegram-retry[hidden], .telegram-reopen[hidden] { display: none; }
#loginStatus { text-align: center; color: var(--text-muted); font-size: 13px; min-height: 18px; margin: 8px 0 0; }
#loginStatus[data-telegram-error], #telegram-login-box[data-telegram-error] { color: var(--danger); }
.handoff-hint { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.handoff-error { margin: 0; color: var(--danger); font-size: 14px; line-height: 1.7; }
.handoff-success { margin: 0; color: var(--success); font-size: 14px; line-height: 1.7; font-weight: 600; }
.login-foot { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 20px; }
.login-gift { background: linear-gradient(120deg, rgba(124, 58, 237, .16), rgba(34, 211, 238, .08)); border: 1px solid var(--accent-line); color: var(--text-primary); border-radius: var(--radius-md); padding: 11px 14px; font-size: 14px; margin: 0 0 16px; }
.login-gift strong { color: var(--wafer-violet); }
html[data-theme="light"] .login-gift strong { color: var(--accent); }
.login-bot-handle { margin-top: 8px; color: var(--text-secondary); font-size: 13px; }
.login-bot-handle a { color: var(--wafer-blue); direction: ltr; display: inline-block; }
.login-explainer { color: var(--text-secondary); font-size: 14px; line-height: 1.8; margin: 14px 0 0; text-align: center; }
.login-explainer a { color: var(--wafer-blue); text-decoration: underline; }
.login-legal { display: flex; justify-content: center; gap: 18px; margin-top: 14px; }
.login-legal a { color: var(--text-muted); font-size: 12px; }
.login-legal a:hover { color: var(--text-primary); }

/* ---------- toast / modal / drawer / lightbox ---------- */
.toast-stack { position: fixed; left: 22px; bottom: 22px; z-index: 120; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: var(--radius-md);
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  color: var(--text-primary); font-size: 11.5px;
  animation: toastIn var(--transition-normal) both;
}
.toast::before { content: '•'; font-size: 15px; line-height: 1; }
.toast.success::before { content: '✓'; color: var(--success); }
.toast.error::before { content: '!'; color: var(--danger); font-weight: 700; }
.toast.warning::before { content: '!'; color: var(--warning); font-weight: 700; }
.toast.info::before { content: 'i'; color: var(--wafer-blue); }
.toast.success { border-color: rgba(52, 211, 153, .3); }
.toast.error { border-color: rgba(251, 113, 133, .3); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: var(--overlay); backdrop-filter: blur(8px);
}
.modal-backdrop.show { display: flex; animation: fadeIn var(--transition-fast) both; }
.modal { width: min(460px, 100%); padding: 22px; animation: scaleIn var(--transition-normal) both; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface-solid); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.modal-head h3 { font-size: 16px; margin: 0; }
.modal p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.9; }
.modal code { display: block; direction: ltr; text-align: left; background: var(--bg-secondary); border: 1px solid var(--border); padding: 11px; border-radius: var(--radius-sm); font-size: 10.5px; color: var(--text-secondary); margin: 14px 0; overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.modal-lightbox { width: min(900px, 100%); background: transparent; border: 0; box-shadow: none; text-align: center; backdrop-filter: none; }
.lightbox-image { max-height: 72vh; max-width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow); margin: 0 auto; }
#lightboxTitle { font-size: 11px; color: var(--text-secondary); margin-top: 12px; }

.drawer-overlay { position: fixed; inset: 0; z-index: 59; background: var(--overlay); display: none; }
.drawer-overlay.show { display: block; animation: fadeIn var(--transition-fast) both; }
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(310px, 86vw); z-index: 60;
  background: var(--bg-secondary); border-left: 1px solid var(--border);
  padding: 20px; transform: translateX(102%);
  transition: transform var(--transition-slow);
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.bottom-nav { display: none; }

/* ---------- animations ---------- */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: none } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-14px) } to { opacity: 1; transform: none } }
@keyframes bounce { 0%, 70%, 100% { transform: translateY(0); opacity: .45 } 35% { transform: translateY(-4px); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes shimmer { to { background-position: -200% 0 } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
.reveal.revealed { opacity: 1; transform: none; }

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

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .wallet-hero, .pricing-hero { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-row { grid-template-columns: 1fr; }
  .image-side { grid-template-columns: 1fr 1fr auto; align-items: end; }
}

@media (max-width: 900px) {
  body[data-page="chat"] .chat-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .main { padding-inline: 22px; }
}

@media (max-width: 900px), (max-width: 1180px) and (pointer: coarse) {
  .sidebar { display: none; }
  .main, .main.expanded { width: 100%; margin: 0; padding: 18px 14px calc(84px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 70px; margin-bottom: 18px; align-items: flex-start; }
  .topbar-title .page-title { font-size: 21px; }
  .topbar-title .page-subtitle { font-size: 11px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-btn:first-child, .topbar-actions .notification-btn { display: none; }
  .points-chip { padding: 7px 10px; font-size: 10px; }
  .bottom-nav {
    display: flex; position: fixed; z-index: 40; bottom: 0; right: 0; left: 0;
    height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
    background: rgba(9, 11, 20, .88); border-top: 1px solid var(--border);
    justify-content: space-around; align-items: center; backdrop-filter: blur(16px);
  }
  html[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, .88); }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--text-muted); font-size: 9.5px; padding: 5px 9px; border-radius: 10px;
  }
  .bottom-nav a.active { color: var(--wafer-violet); background: var(--accent-soft); }
  .bottom-nav .nav-icon { font-size: 17px; }
  .chat-layout { display: block; }
  .chat-history {
    display: block; position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
    width: min(320px, 85vw); z-index: 60; border-radius: 0; margin: 0;
    transform: translateX(106%); transition: transform .3s ease;
    box-shadow: var(--shadow); background: var(--surface-solid); overflow-y: auto;
  }
  body.history-open .chat-history { transform: none; }
  .history-toggle { display: inline-flex; }
  .chat-toolbar { padding: 11px 12px; }
  .chat-body { padding: 16px 10px; }
  .message { max-width: 94%; }
  .chat-input { padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); }
  .composer { padding: 6px; }
  .toast-stack { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); max-width: none; }
  .gallery { gap: 10px; }
  .image-side { grid-template-columns: 1fr 1fr; }
  .image-side .btn { grid-column: 1 / -1; }
  .balance-card { min-height: 170px; padding: 20px; }
  .balance-number { font-size: 38px; }
}

@media (max-width: 430px) {
  .main { padding-inline: 10px; }
  .topbar-title .page-subtitle { display: none; }
  .page-title { font-size: 19px; }
  .points-chip { font-size: 9.5px; padding: 6px 9px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gallery-info { padding: 9px 10px; }
  .chat-toolbar { gap: 8px; }
  .model-select { width: 100%; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .login-card { padding: 26px 20px 20px; }
  .login-page { place-items: start center; padding-top: 44px; }
  .login-brand { margin-bottom: 14px; }
  .back-btn.login-back { margin-bottom: 8px; }
}

@media (max-width: 375px) {
  .stats { grid-template-columns: 1fr; }
  .topbar-actions .points-chip { display: none; }
  .gallery { grid-template-columns: 1fr; }
}

/* ---------- redesign additions ---------- */
.modal-open { overflow: hidden; }
.toast { transition: opacity var(--transition-fast), transform var(--transition-fast); }
.toast.leaving { opacity: 0; transform: translateX(12px); }
.avatar svg, .empty-icon svg { width: 70%; height: 70%; color: currentColor; }
.message .avatar { background: var(--surface-hover); border: 1px solid var(--border); color: var(--wafer-violet); }
.chat-empty { min-height: 100%; align-content: center; }
.chat-empty .empty-icon { width: 54px; height: 54px; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.suggestions .ghost-btn { border-radius: 999px; }
.composer-hint { text-align: center; color: var(--text-muted); font-size: 9.5px; margin-top: 7px; }
.generated-image { width: 100%; border-radius: var(--radius-sm); }
.dl-image { display: inline-block; margin-top: 8px; font-size: 11px; color: var(--wafer-violet); }
.cost-label { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 10px; }

/* ---------- public landing page (v2.6 Aurora) ---------- */
.landing-page { min-height: 100vh; display: flex; flex-direction: column; }
.landing-nav {
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: rgba(6, 7, 13, .78); backdrop-filter: blur(18px);
}
html[data-theme="light"] .landing-nav { background: rgba(233, 236, 247, .85); }
.landing-nav .brand { margin: 0; padding-bottom: 0; }
.landing-nav-links { display: flex; gap: 20px; margin-inline-start: auto; }
.landing-nav-links a { color: var(--text-secondary); font-size: 14px; transition: color var(--transition-fast); }
.landing-nav-links a:hover { color: var(--text-primary); }
.landing-nav-actions { display: flex; align-items: center; gap: 10px; }
.landing-main { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

.landing-hero { text-align: center; padding: clamp(48px, 9vh, 96px) 0 30px; position: relative; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--text-primary); border-radius: 999px; padding: 8px 18px; font-size: 14px;
  box-shadow: 0 0 30px rgba(124, 58, 237, .18); margin-bottom: 20px;
}
.hero-pill strong { color: var(--wafer-violet); }
html[data-theme="light"] .hero-pill strong { color: var(--accent); }
.landing-hero h1 {
  font-size: clamp(30px, 5.4vw, 52px); line-height: 1.4; margin: 0 0 16px;
  letter-spacing: -.02em; font-weight: 700;
}
.landing-sub { color: var(--text-secondary); font-size: 17px; line-height: 2; max-width: 660px; margin: 0 auto 26px; }
.landing-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.landing-cta .btn { padding: 14px 30px; font-size: 15px; border-radius: 999px; }
.hero-proof { color: var(--text-muted); font-size: 12.5px; margin: 0 0 8px; }

.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 34px auto 0; max-width: 900px;
}
.stat-chip { padding: 16px 10px; text-align: center; }
.stat-chip strong { display: block; font-size: 22px; font-weight: 700; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-chip span { color: var(--text-secondary); font-size: 12px; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px 0; }
.feature-card { padding: 22px 20px; position: relative; overflow: hidden; }
.feature-card::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 2px; background: var(--grad); opacity: .8; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--wafer-violet); font-size: 20px; margin-bottom: 14px;
}
html[data-theme="light"] .feature-icon { color: var(--accent); }
.feature-card h3 { font-size: 15.5px; margin: 0 0 7px; }
.feature-card p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.9; margin: 0; }

.landing-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 36px 0; }
.landing-shot { padding: 12px; margin: 0; }
.landing-shot img { border-radius: var(--radius-md); width: 100%; background: var(--bg-secondary); }
.landing-shot figcaption { color: var(--text-secondary); font-size: 13px; padding: 10px 4px 4px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px 0; counter-reset: step; }
.step-card { padding: 22px 20px; text-align: center; position: relative; }
.step-num {
  width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--grad); color: #fff; box-shadow: var(--glow);
}
.step-card h3 { font-size: 15px; margin: 0 0 6px; }
.step-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.9; margin: 0; }

.landing-pricing, .landing-faq { margin: 40px 0; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 18px; margin-bottom: 10px; background: var(--surface); backdrop-filter: blur(12px); }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.faq-item p { color: var(--text-secondary); font-size: 14px; line-height: 1.9; margin: 10px 0 2px; }

.cta-banner {
  margin: 44px 0 10px; padding: clamp(28px, 5vw, 48px);
  text-align: center; position: relative; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--accent-line);
  background:
    radial-gradient(80% 130% at 50% -30%, rgba(124, 58, 237, .30), transparent 65%),
    var(--surface);
}
.cta-banner h2 { font-size: clamp(21px, 3vw, 28px); margin: 0 0 10px; }
.cta-banner p { color: var(--text-secondary); font-size: 15px; margin: 0 0 20px; }

/* ---------- shared site footer with owner info ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 30px clamp(16px, 4vw, 48px) 26px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 26px; width: min(1120px, 100%); margin: 0 auto; }
.footer-col h4 { font-size: 13px; margin: 0 0 12px; color: var(--text-primary); }
.footer-col nav { display: grid; gap: 8px; }
.footer-col nav a { color: var(--text-secondary); font-size: 13px; transition: color var(--transition-fast); }
.footer-col nav a:hover { color: var(--text-primary); }
.footer-about p { color: var(--text-secondary); font-size: 13px; line-height: 1.9; margin: 10px 0 0; }
.owner-card { display: grid; gap: 8px; }
.owner-name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; }
.owner-badge { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; box-shadow: var(--glow); }
.owner-card a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; direction: ltr; justify-content: flex-end; }
.owner-card a:hover { color: var(--wafer-violet); }
.owner-card a .contact-ico { color: var(--wafer-violet); }
.footer-legal {
  width: min(1120px, 100%); margin: 22px auto 0; padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 12px;
}
.footer-legal nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-legal a { color: var(--text-secondary); font-size: 12px; }
.footer-legal a:hover { color: var(--text-primary); }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-legal { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------- public legal pages ---------- */
.legal-shell { width: min(760px, 100%); margin: 0 auto; padding: 28px 18px 40px; }
.legal-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.legal-back { display: flex; justify-content: flex-start; margin-bottom: 16px; }
.legal-card { padding: 30px clamp(18px, 4vw, 36px); }
.legal-card h1 { font-size: 24px; margin: 0 0 6px; }
.legal-card h2 { font-size: 17px; margin: 22px 0 8px; }
.legal-card p, .legal-card li { color: var(--text-secondary); font-size: 15px; line-height: 1.9; }
.legal-card ul { padding-inline-start: 20px; }
.legal-card a { color: var(--wafer-blue); text-decoration: underline; }
.legal-updated { color: var(--text-muted); font-size: 13px; }
.legal-foot-links { display: flex; justify-content: center; gap: 18px; margin-top: 22px; flex-wrap: wrap; }
.legal-foot-links a { color: var(--text-muted); font-size: 13px; }
.legal-foot-links a:hover { color: var(--text-primary); }
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color var(--transition-fast), transform var(--transition-fast); }
.contact-card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.contact-card .contact-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--wafer-violet); font-size: 17px; }
.contact-card strong { display: block; font-size: 13px; }
.contact-card small { color: var(--text-secondary); font-size: 11.5px; direction: ltr; display: inline-block; }
@media (max-width: 560px) { .contact-cards { grid-template-columns: 1fr; } }

/* ---------- error pages ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.error-card { width: min(460px, 100%); text-align: center; padding: 40px 30px; }
.error-code { font-size: 64px; font-weight: 700; letter-spacing: -.04em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.error-card h1 { font-size: 20px; margin: 6px 0 8px; }
.error-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.9; margin: 0 0 20px; }
.error-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- public mode (pricing viewable signed-out) ---------- */
body.public-mode .sidebar, body.public-mode .bottom-nav, body.public-mode .drawer,
body.public-mode .drawer-overlay, body.public-mode .topbar-actions,
body.public-mode .topbar .back-btn { display: none !important; }
body.public-mode .main { margin-inline-start: 0; }
.public-topbar { display: none; }
body.public-mode .public-topbar { display: flex; align-items: center; gap: 14px; padding: 14px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--border); }
body.public-mode .public-topbar .spacer { flex: 1; }
.public-login-cta { font-size: 14px; padding: 9px 18px; }
body.public-mode .topbar { display: none; }

/* ---------- chat history search + item actions ---------- */
.history-search { width: 100%; margin: 8px 0 6px; padding: 8px 10px; font-size: 13px; }
.history-item { position: relative; }
.history-item .history-actions { display: none; gap: 4px; margin-inline-start: auto; }
@media (hover: none) { .history-item .history-actions { display: inline-flex; } }
.history-item:hover .history-actions, .history-item:focus-within .history-actions { display: inline-flex; }
.history-action { border: 1px solid var(--border); background: var(--surface-hover); color: var(--text-secondary); border-radius: 6px; font-size: 11px; line-height: 1; padding: 5px 7px; }
.history-action:hover { color: var(--text-primary); border-color: var(--border-strong); }
.history-action.danger:hover { color: var(--danger); border-color: var(--danger); }
.admin-search { max-width: 260px; margin-bottom: 14px; }
.admin-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.admin-quick > div { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-secondary); }
.admin-quick span, .admin-quick small { display: block; color: var(--text-muted); font-size: 9.5px; }
.admin-quick strong { display: block; font-size: 22px; margin: 4px 0 2px; letter-spacing: -.03em; }
.usage { margin-bottom: 10px; }
.admin-version { margin-top: 14px; font-size: 11px; color: var(--text-muted); }
.wallet-charge, .deposit-submit { width: 100%; margin-top: 14px; }
.address-box .input { border: 0; background: transparent; padding: 4px 0; direction: ltr; text-align: left; }
.address-box .input:focus { box-shadow: none; }
.lightbox-wrap { display: grid; gap: 10px; justify-items: end; }
.lightbox-wrap .close { order: -1; }
.lightbox-wrap p { margin: 0; color: var(--text-secondary); font-size: 11px; text-align: center; width: 100%; }

/* ---------- BSC receive QR / wallet address ---------- */
[hidden] { display: none !important; }
.network-warning { color: var(--warning) !important; font-size: 10.5px !important; line-height: 1.8 !important; margin: 12px 0 0 !important; }
.wallet-address-row { display: flex; gap: 14px; align-items: stretch; }
.wallet-address-main { flex: 1; min-width: 0; }
.wallet-qr-thumb { flex: 0 0 104px; width: 104px; height: 104px; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: zoom-in; }
.wallet-qr-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.deposit-modal { width: min(520px, 100%); }
.deposit-qr-row { display: flex; gap: 16px; align-items: flex-start; }
.qr-figure { flex: 0 0 150px; max-width: 100%; margin: 0; text-align: center; }
.qr-thumb { display: block; width: 150px; max-width: 100%; padding: 7px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: zoom-in; }
.qr-thumb img, .qr-modal img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.qr-figure figcaption { margin-top: 7px; color: var(--text-secondary); font-size: 10px; }
.deposit-address-side { flex: 1; min-width: 0; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qr-modal { width: min(460px, 100%); text-align: center; }
.qr-modal img { width: min(360px, 100%); max-height: 60vh; margin: 0 auto; padding: 10px; background: #fff; border-radius: var(--radius-md); }
.qr-preview-address { direction: ltr; text-align: center; overflow-wrap: anywhere; font-size: 10.5px !important; }
.wallet-address .address-box code, .deposit-modal .address-box code { white-space: normal; overflow: visible; word-break: break-all; }
@media (max-width: 640px) {
  .wallet-address-row, .deposit-qr-row { flex-direction: column; align-items: center; }
  .wallet-address-main, .deposit-address-side { width: 100%; }
  .wallet-qr-thumb { flex-basis: auto; width: min(150px, 52vw); height: auto; aspect-ratio: 1; }
  .qr-figure { flex-basis: auto; width: min(160px, 62vw); }
  .qr-thumb { width: 100%; }
  .qr-actions { justify-content: center; }
}
.login-theme {
  position: fixed; top: 18px; left: 18px; z-index: 5;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 30px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  font-size: 11px; box-shadow: var(--shadow-soft);
}
.login-theme:hover { color: var(--text-primary); border-color: var(--border-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (max-width: 760px) {
  body[data-page="chat"] .chat-input { padding-bottom: calc(10px + 64px + env(safe-area-inset-bottom)); }
  .topbar-actions .points-chip { display: none; }
  .points-chip-drawer { display: inline-flex; }
  .admin-quick { grid-template-columns: 1fr; }
  .login-theme { top: 12px; left: 12px; }
}

/* Stage 1 — USDT BEP-20 deposit policy */
.network-warning-sub { color: var(--text-secondary) !important; font-size: 10.5px !important; line-height: 1.7 !important; margin: 4px 0 0 !important; }
.points-calculator { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft, rgba(127,127,127,.06)); }
.points-calculator .section-head { margin-bottom: 8px; }
.points-calculator .section-title { font-size: 13px; }
.calculator-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calculator-row label { font-size: 11px; color: var(--text-secondary); }
.calculator-row .input { max-width: 140px; }
.calculator-result { font-weight: 700; color: var(--accent, var(--success)); font-size: 14px; }
.calculator-rates, .calculator-note { color: var(--text-secondary) !important; font-size: 10.5px !important; margin: 6px 0 0 !important; line-height: 1.7 !important; }
.calculator-note { color: var(--warning) !important; }

/* Stage 4: standalone pricing page */
.pricing-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); gap: 16px; margin-bottom: 18px; }
.conversion-rates { padding: 14px 0 6px; }
.conversion-rate-main { font-size: 22px; font-weight: 800; color: var(--wafer-violet, var(--success)); margin: 0 0 6px; }
.conversion-rate-sub { font-size: 14px; color: var(--text-secondary); margin: 0; }
.pricing-calculator { margin-top: 10px; }
.pricing-address .wallet-qr-thumb { width: 92px; height: 92px; object-fit: contain; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.price-card { padding: 16px; }
.price-card-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.price-card-head strong { font-size: 15px; }
.price-card-cost { margin-top: 14px; font-size: 12px; color: var(--text-secondary); }
.price-card-cost span { font-size: 24px; font-weight: 800; color: var(--text-primary, var(--text)); }
.form-error { color: var(--danger, var(--warning)) !important; font-size: 11px !important; margin: 8px 0 0 !important; line-height: 1.6 !important; }

/* ---------- Pricing page redesign: prominent QR/address + mobile layout ---------- */
.pricing-address, .conversion-card { padding: 20px; }
.pricing-hero { grid-template-columns: minmax(320px, .95fr) minmax(0, 1.05fr); align-items: start; }
.pricing-address { position: relative; overflow: hidden; border-color: var(--accent-line); box-shadow: 0 14px 40px rgba(0, 0, 0, .16); }
.pricing-address::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--grad); }
.pricing-deposit { display: flex; gap: 18px; align-items: center; margin-top: 16px; }
.pricing-qr-panel { flex: 0 0 172px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pricing-qr-frame { padding: 10px; background: #fff; border: 2px solid var(--wafer-violet); border-radius: var(--radius-lg); box-shadow: 0 10px 28px rgba(124, 58, 237, .22); line-height: 0; transition: transform var(--transition-fast); }
.pricing-qr-frame:hover { transform: scale(1.03); }
.pricing-qr-img { display: block; width: 148px; height: 148px; object-fit: contain; }
.pricing-qr-caption { margin: 0; text-align: center; font-size: 10.5px; color: var(--text-secondary); }
.pricing-qr-download { font-size: 10px; }
.pricing-deposit-side { flex: 1; min-width: 0; }
.pricing-network-line { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.network-pill, .token-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 10px; line-height: 1.6; }
.network-pill { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--wafer-violet); font-weight: 700; }
.token-pill { background: var(--surface-hover); border: 1px solid var(--border); color: var(--text-primary); }
.address-label { display: block; margin-bottom: 6px; font-size: 10.5px; color: var(--text-secondary); }
.pricing-address-box { padding: 12px; background: var(--accent-soft); border-color: var(--accent-line); }
.pricing-address-box code { font-size: 11.5px; font-weight: 600; color: var(--text-primary); white-space: normal; word-break: break-all; overflow: visible; }
.pricing-copy { color: var(--wafer-violet); border-color: var(--accent-line); font-weight: 700; }
.pricing-network-meta { margin: 10px 0 0; font-size: 10.5px; line-height: 1.8; color: var(--text-secondary); }
.pricing-network-meta strong { color: var(--text-primary); }
.pricing-charge { margin-top: 12px; }
.pricing-warning-box { margin-top: 16px; padding: 12px 14px; border: 1px solid rgba(251, 191, 36, .3); border-radius: var(--radius-md); background: rgba(251, 191, 36, .08); }
.pricing-warning-box .network-warning { margin: 0 !important; font-weight: 700; }
.pricing-warning-box .network-warning-sub { margin-top: 4px !important; }
.conversion-card { display: flex; flex-direction: column; }
.rate-highlight { margin: 14px 0 4px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-hover); }
.rate-highlight .conversion-rate-main { font-size: 21px; }
.pricing-calculator { gap: 10px; }
.pricing-calculator .calculator-result { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--wafer-violet); }
.table-wrap { overflow-x: auto; }
.price-card { position: relative; overflow: hidden; }
.price-card::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 2px; background: var(--accent-line); }
.price-card-cost span { font-size: 28px; }

@media (max-width: 760px) {
  .pricing-hero { gap: 14px; }
  .pricing-deposit { flex-direction: column; align-items: stretch; gap: 14px; }
  .pricing-qr-panel { flex-basis: auto; width: 100%; order: -1; }
  .pricing-qr-frame { padding: 12px; }
  .pricing-qr-img { width: min(190px, 52vw); height: min(190px, 52vw); }
  .pricing-qr-caption { font-size: 11px; }
  .pricing-address-box code { white-space: normal; word-break: break-all; }
  .rate-highlight { padding: 14px; }
  .rate-highlight .conversion-rate-main { font-size: 18px; }
  .pricing-calculator { flex-direction: column; align-items: stretch; }
  .pricing-calculator .input { max-width: none; width: 100%; }
  .pricing-calculator .calculator-result { text-align: center; }
  .pricing-warning-box { padding: 11px 12px; }
}

@media (max-width: 430px) {
  .pricing-address, .conversion-card { padding: 16px; }
  .pricing-qr-img { width: min(170px, 58vw); height: min(170px, 58vw); }
  .rate-highlight .conversion-rate-main { font-size: 16px; }
  .pricing-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .price-card { padding: 12px; }
  .price-card-cost span { font-size: 22px; }
}

@media (max-width: 360px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ---------- Mobile UI hardening (presentation only; no logic/API changes) ---------- */
.back-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-primary);
  font-size: 12px; font-weight: 600; text-decoration: none; line-height: 1;
  flex: 0 0 auto;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.back-btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.back-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.back-btn-icon { font-size: 18px; font-weight: 700; }
.login-shell { position: relative; }
.back-btn.login-back { margin-bottom: 18px; align-self: flex-start; }

.topbar-title, .topbar-actions { min-width: 0; }
.topbar-title .page-title, .section-title, .price-card-head strong { overflow-wrap: anywhere; }
.section-head { flex-wrap: wrap; }

/* Keep every page inside the viewport on narrow phones */
html, body { max-width: 100%; overflow-x: hidden; }
.main, .app, .chat-layout, .wallet-hero, .pricing-hero { min-width: 0; max-width: 100%; }
.table-wrap, .pricing-table-wrap { max-width: 100%; overflow-x: auto; }
.address-box code, .mono, .qr-preview-address { overflow-wrap: anywhere; }
.drawer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.tabs { max-width: 100%; overflow-x: auto; }

@media (max-width: 760px) {
  .topbar { gap: 8px; min-height: 64px; margin-bottom: 16px; }
  .topbar .page-title { font-size: 20px; }
  .topbar-actions { gap: 5px; }
  .bottom-nav a, .bottom-nav button { min-height: 48px; }
  .icon-btn, .back-btn { min-width: 44px; min-height: 44px; }
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .chat-input { padding-bottom: calc(10px + 64px + env(safe-area-inset-bottom)); }
  .toast-stack { bottom: calc(74px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .topbar { gap: 6px; }
  .topbar .page-title { font-size: 18px; }
  .back-btn { padding: 8px 9px; }
}

@media (max-width: 360px) {
  .back-btn-label { display: none; }
  .back-btn { padding: 8px; }
  .section-head { gap: 8px; }
}

@media (max-width: 320px) {
  .main { padding-inline: 8px; }
  .topbar { gap: 4px; }
  .topbar .page-title { font-size: 17px; }
  .bottom-nav a, .bottom-nav button { padding: 5px 4px; font-size: 9px; }
}

/* ---------- Landing responsive ---------- */
@media (max-width: 900px) {
  .features-grid, .steps { grid-template-columns: 1fr 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .landing-nav-links { display: none; }
  .landing-shots { grid-template-columns: 1fr; }
  .features-grid, .steps { grid-template-columns: 1fr; }
}

/* ---------- Pricing: coherent palette + dark-red deposit warning ---------- */
.pricing-address, .conversion-card, .pricing-grid .price-card { border-color: var(--border); }
.pricing-address { border-color: var(--accent-line); }
.pricing-address .section-title, .conversion-card .section-title { color: var(--text-primary); }
.conversion-card .calculator-note { color: var(--text-secondary) !important; }

.pricing-warning-box {
  border: 1px solid #b4233f !important;
  background: rgba(120, 12, 34, .40) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  cursor: default;
}
.pricing-warning-box .network-warning { color: #ffd9e0 !important; }
.pricing-warning-box .network-warning-sub { color: #f1b6c4 !important; }
html[data-theme="light"] .pricing-warning-box {
  border-color: #9e1231 !important;
  background: #fdeaee !important;
  box-shadow: none;
}
html[data-theme="light"] .pricing-warning-box .network-warning { color: #750a20 !important; }
html[data-theme="light"] .pricing-warning-box .network-warning-sub { color: #8d1c35 !important; }

/* ---------- legal copyright + misc v2.6 ---------- */
.legal-copyright { text-align: center; color: var(--text-muted); font-size: 12px; margin: 18px 0 0; }
.legal-copyright a { color: var(--text-secondary); }
.legal-copyright a:hover { color: var(--wafer-violet); }
.balance-number { display: flex; align-items: baseline; gap: 10px; }
.history-list { overflow-x: hidden; }


/* ============================================================
   v3 "ورق وملصقات" — paper & stickers. New composition:
   right-aligned zine hero, sticker headline line, ticket stats,
   offset sheets, chunky pressed buttons. Cairo 900 display.
   ============================================================ */
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 800 900; font-display: swap;
  src: url('assets/Cairo-900-ar.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 800 900; font-display: swap;
  src: url('assets/Cairo-900-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root, html[data-theme="light"] {
  --bg: #F6F1E6;
  --bg-secondary: #EDE5D3;
  --surface: #FFFDF6;
  --surface-solid: #FFFDF6;
  --surface-hover: #FFFFFF;
  --border: rgba(23, 19, 12, .28);
  --border-strong: rgba(23, 19, 12, .85);
  --ink: #17130C;
  --text-primary: #17130C;
  --text-secondary: #57503F;
  --text-muted: #8A8170;
  --accent: #2B4BD8;
  --accent-deep: #1D36A3;
  --blue: #2B4BD8;
  --orange: #F26B1D;
  --accent-ink: #FFFDF6;
  --wafer-lime: #2B4BD8;
  --wafer-lime-hover: #1D36A3;
  --wafer-violet: #2B4BD8;
  --wafer-blue: #1D36A3;
  --accent-2: #F26B1D;
  --accent-soft: rgba(43, 75, 216, .10);
  --accent-line: rgba(43, 75, 216, .45);
  --grad: none; --grad-text: none; --glow: none;
  --shadow: 6px 6px 0 rgba(23, 19, 12, .9);
  --shadow-soft: 4px 4px 0 rgba(23, 19, 12, .9);
  --success: #2E7D4F; --warning: #B07818; --danger: #C0392B;
  --overlay: rgba(23, 19, 12, .6);
  color-scheme: light;
}
body { background: var(--bg); color: var(--ink); }
::selection { background: var(--blue); color: #fff; }

/* sheets & tickets */
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

/* buttons: chunky pressed stickers */
.btn { border-radius: 14px; }
.btn-primary {
  background: var(--ink); color: var(--surface);
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 rgba(23,19,12,.35);
  font-weight: 800; font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
}
.btn-primary:hover:not(:disabled) { filter: none; background: #2A241A; transform: translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(23,19,12,.35); }
.btn-primary:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(23,19,12,.35); }
.btn-secondary {
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgba(23,19,12,.2);
}
.btn-secondary:hover:not(:disabled) { background: #fff; }
.ghost-btn { background: transparent; border: 2px solid var(--border); color: var(--text-secondary); border-radius: 10px; }
.ghost-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); background: transparent; }

/* nav */
html[data-theme="light"] .landing-nav, html[data-theme="dark"] .landing-nav, .landing-nav {
  background: rgba(246, 241, 230, .92);
  border-bottom: 2px solid var(--ink);
}
.landing-nav-links a { color: var(--text-secondary); font-weight: 600; }
.landing-nav-links a:hover { color: var(--blue); }
.icon-btn { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); border-radius: 12px; }
.brand-mark { background: var(--surface); border: 2px solid var(--ink); box-shadow: 3px 3px 0 rgba(23,19,12,.85); }
.landing-nav-actions .btn-secondary { transform: rotate(-1.5deg); }

/* ---------- zine hero: right-aligned, sticker line ---------- */
.landing-hero { text-align: start; padding-top: 56px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #fff;
  border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 18px; font-size: 14px; font-weight: 700;
  transform: rotate(1.6deg);
}
.hero-pill svg { color: #fff; flex: none; }
.hero-pill strong { color: #fff; font-family: 'Cairo', sans-serif; }
.z-h1 { text-align: start; }
.z-l1 { display: inline-block; font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif; font-weight: 900; font-size: clamp(40px, 11vw, 64px); line-height: 1.25; letter-spacing: 0; }
.z-l2 {
  display: inline-block; font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif; font-weight: 900;
  font-size: clamp(40px, 11vw, 64px); line-height: 1.3;
  background: var(--blue); color: #fff;
  padding: 0 18px 6px; border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1.6deg);
}
.z-l3 { display: inline-block; margin-top: 14px; font-size: clamp(20px, 5.4vw, 28px); font-weight: 700; color: var(--text-secondary); }
.landing-sub { color: var(--text-secondary); font-size: 16px; max-width: 52ch; margin: 18px 0 26px; }
.landing-cta { justify-content: flex-start; }
.landing-cta .btn { border-radius: 14px; }
.hero-proof { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); margin-top: 4px; }
.hero-proof span { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof svg { color: var(--blue); flex: none; }

/* stats: rotating tickets */
.stats-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 900px; }
.stat-chip.card { padding: 18px 10px; text-align: center; }
.stat-chip:nth-child(1) { transform: rotate(-1.2deg); }
.stat-chip:nth-child(2) { transform: rotate(1deg); }
.stat-chip:nth-child(3) { transform: rotate(.8deg); }
.stat-chip:nth-child(4) { transform: rotate(-1deg); }
.stat-chip strong {
  background: none; -webkit-background-clip: initial; background-clip: initial;
  font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 34px; color: var(--blue);
}
.stat-chip:nth-child(4) strong { color: var(--orange); }
.stat-chip span { color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }

/* section titles */
.section-title { font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif; font-weight: 900; font-size: 22px; color: var(--ink); }

/* features: offset sheets, big blue icon squares */
.feature-card.card { box-shadow: var(--shadow-soft); }
.feature-card::before { display: none; }
.feature-card:nth-child(odd) { transform: rotate(-.5deg); }
.feature-card:nth-child(even) { transform: rotate(.5deg); }
.feature-card:hover { border-color: var(--blue); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--blue); color: #fff;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.feature-card h3 { color: var(--ink); font-weight: 800; }
.feature-card p { color: var(--text-secondary); }

/* steps: numbered tickets (a real sequence) */
.step-card.card { box-shadow: var(--shadow-soft); text-align: start; }
.step-num {
  width: 46px; height: 46px; margin: 0 0 12px;
  background: var(--orange); color: #fff;
  border: 2px solid var(--ink); border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 20px;
}
.step-card h3 { color: var(--ink); font-weight: 800; }
.step-card p { color: var(--text-secondary); }

/* shots / pricing / faq */
.landing-shot { background: var(--surface); }
.landing-shot figcaption { color: var(--text-secondary); }
.price-card::before { display: none; }
.price-card-cost span { color: var(--blue); font-family: 'Cairo', sans-serif; font-weight: 900; }
.price-card-head strong { color: var(--ink); }
.faq-item { background: var(--surface); border: 2px solid var(--ink); box-shadow: 3px 3px 0 rgba(23,19,12,.85); backdrop-filter: none; border-radius: 14px; }
.faq-item summary { color: var(--ink); font-weight: 700; }
.faq-item p { color: var(--text-secondary); }

/* cta: the ink slab */
.cta-banner {
  background: var(--ink); border: 2px solid var(--ink);
  border-radius: 20px; box-shadow: 6px 6px 0 rgba(23,19,12,.3);
}
.cta-banner::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 5px; background: var(--orange); }
.cta-banner h2 { color: var(--surface); font-family: 'Cairo', sans-serif; font-weight: 900; }
.cta-banner p { color: rgba(255, 253, 246, .72); }
.cta-banner p strong { color: var(--orange); }
.cta-banner .btn-primary { background: var(--orange); border-color: var(--ink); box-shadow: 4px 4px 0 rgba(255,253,246,.35); }
.cta-banner .btn-primary:hover:not(:disabled) { background: #ff7c2e; }

/* footer: ink base */
.site-footer { background: var(--ink); border-top: 4px solid var(--orange); }
.footer-col h4 { color: var(--orange); }
.footer-col nav a { color: rgba(255, 253, 246, .72); }
.footer-col nav a:hover { color: #fff; }
.footer-about p { color: rgba(255, 253, 246, .6); }
.site-footer .brand-wordmark strong { color: var(--surface); }
.site-footer .brand-arabic { color: rgba(255, 253, 246, .55); }
.site-footer .brand-mark { background: var(--surface); border-color: rgba(255,253,246,.3); box-shadow: 3px 3px 0 rgba(255,253,246,.25); }
.owner-name { color: var(--surface); }
.owner-card a { color: rgba(255, 253, 246, .75); }
.footer-legal { color: rgba(255, 253, 246, .5); border-top-color: rgba(255, 253, 246, .15); }
.footer-legal a { color: rgba(255, 253, 246, .65); }
.contact-ico svg { color: var(--orange); }

/* app-wide gradient stragglers */
.grad-text { background: none; -webkit-background-clip: initial; background-clip: initial; color: inherit; }
.balance-number, .error-code { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--blue); }

/* login page bits */
.login-gift { background: rgba(242, 107, 29, .12); border-color: rgba(242, 107, 29, .5); color: var(--ink); }
.login-gift svg { color: var(--orange); }

/* Site-wide continuation of the approved paper/sticker direction. */
:root,html[data-theme="light"] {
 --ink:#17130c;--text-muted:#6d6556;--grad:linear-gradient(#2b4bd8,#2b4bd8);--grad-text:linear-gradient(#2b4bd8,#2b4bd8);
 --edge:#17130c;--button-bg:#17130c;--button-text:#fffdf6;--slab:#17130c;--slab-text:#fffdf6;
 --hard-shadow:rgba(23,19,12,.7);--sticker-blue:#2b4bd8;
}
html[data-theme="dark"] {
 --bg:#191b20;--bg-secondary:#202329;--surface:#272a31;--surface-solid:#272a31;--surface-hover:#333741;
 --ink:#f6f1e6;--text-primary:#f6f1e6;--text-secondary:#d0cbbf;--text-muted:#ada99f;
 --border:#606269;--border-strong:#c2beb4;--edge:#b6b1a6;--accent:#99b0ff;--accent-deep:#bbcbff;--blue:#99b0ff;--orange:#ff9a5c;
 --accent-2:#ff9a5c;--wafer-lime:#99b0ff;--wafer-lime-hover:#bbcbff;--wafer-violet:#99b0ff;--wafer-blue:#99b0ff;
 --accent-soft:rgba(153,176,255,.13);--accent-line:#7d96eb;--grad:linear-gradient(#2b4bd8,#2b4bd8);--grad-text:linear-gradient(#99b0ff,#99b0ff);
 --button-bg:#a9bbff;--button-text:#171b2a;--slab:#101216;--slab-text:#f6f1e6;--hard-shadow:#0d0f13;
 --shadow:6px 6px 0 #0d0f13;--shadow-soft:4px 4px 0 #0d0f13;--glow:none;--overlay:rgba(0,0,0,.7);
 --success:#80d4a0;--warning:#ffd37d;--danger:#ff9ca8;color-scheme:dark;
}
body {color:var(--text-primary);}
body::before,html[data-theme="light"] body::before {background:none;}
.card,.faq-item {border-color:var(--edge);box-shadow:var(--shadow-soft);}
.btn-primary {background:var(--button-bg);color:var(--button-text);border-color:var(--edge);box-shadow:4px 4px 0 var(--hard-shadow);}
.btn-primary:hover:not(:disabled) {background:var(--button-bg);color:var(--button-text);filter:brightness(1.12);box-shadow:5px 5px 0 var(--hard-shadow);}
.btn-secondary,.icon-btn,.back-btn {background:var(--surface);color:var(--text-primary);border:2px solid var(--edge);}
.btn-secondary:hover:not(:disabled) {background:var(--surface-hover);}
.ghost-btn {border-color:var(--border);}
.page-title,.login-card h1,.legal-card h1,.error-card h1 {font-family:Cairo,'IBM Plex Sans Arabic',sans-serif;font-weight:900;}
.page-title {letter-spacing:0;}
.sidebar,html[data-theme="light"] .sidebar {background:var(--surface);border-left:2px solid var(--edge);backdrop-filter:none;}
.nav-link.active {background:var(--accent-soft);border:1px solid var(--accent-line);}
.nav-link.active::before {background:var(--blue);box-shadow:none;}
.avatar,.points-icon {background:var(--sticker-blue);color:#fff;box-shadow:none;}
.mini-balance,.points-chip {border-width:2px;border-radius:12px;}
.stat::after,.balance-card::after {display:none;}
.stat-value,.balance-number {font-family:Cairo,'IBM Plex Sans Arabic',sans-serif;font-weight:900;letter-spacing:0;}
.input,.select,.textarea,.composer {border:2px solid var(--border);background-color:var(--surface);font-size:14px;}
.input:focus,.select:focus,.textarea:focus,.composer:focus-within {border-color:var(--blue);box-shadow:0 0 0 3px var(--accent-soft);}
.composer textarea {font-size:15px;}
.chat-card {box-shadow:3px 3px 0 var(--hard-shadow);}
.chat-toolbar,.chat-input {background:var(--bg-secondary);}
.chat-toolbar {border-bottom:2px solid var(--border);}
.message-bubble {font-size:14px;background:var(--bg-secondary);border-color:var(--border);border-radius:14px;}
.message.user .message-bubble {background:var(--accent-soft);border:2px solid var(--accent-line);}
.message.user .avatar {background:var(--sticker-blue);}
.chat-input {border-top:2px solid var(--border);}
.code-block pre {color:var(--text-primary);}
.history-item.active {background:var(--accent-soft);}
.balance-card {border-top:5px solid var(--orange);}
.pricing-address,.conversion-card {box-shadow:var(--shadow-soft);}
.pricing-address::before {background:var(--orange);}
.pricing-qr-frame {border-color:var(--edge);box-shadow:4px 4px 0 var(--hard-shadow);}
.address-box {background:var(--bg-secondary);border:2px solid var(--border);}
.pricing-address-box code {font-size:12px;}
.login-page,html[data-theme="light"] .login-page {background:var(--bg);}
.login-card {box-shadow:var(--shadow);border-top:5px solid var(--orange);}
.login-gift {background:var(--accent-soft);border:2px solid var(--accent-line);color:var(--text-primary);}
.telegram {border:2px solid var(--edge);box-shadow:3px 3px 0 var(--hard-shadow);}
.login-theme {border:2px solid var(--edge);box-shadow:3px 3px 0 var(--hard-shadow);}
.legal-card {border-top:5px solid var(--orange);}
.legal-card h2 {color:var(--text-primary);}
.contact-card {border:2px solid var(--edge);}
html[data-theme] .landing-nav {background:var(--bg);border-bottom-color:var(--edge);}
html[data-theme] .feature-icon {background:var(--sticker-blue);color:#fff;border-color:var(--edge);box-shadow:3px 3px 0 var(--hard-shadow);}
.hero-pill {background:#c84d0b;color:#fff;}
.hero-pill strong {color:#fff;}
.z-l2 {background:var(--sticker-blue);}
.step-num {background:#c84d0b;color:#fff;}
.cta-banner {background:var(--slab);border-color:var(--edge);}
.cta-banner h2 {color:var(--slab-text);}
.cta-banner .btn-primary {color:#17130c;}
.site-footer {background:var(--slab);}
.site-footer .brand-wordmark strong,.owner-name {color:var(--slab-text);}
.site-footer .brand-mark {background:#fffdf6;}
.brand-mark {background:#fffdf6;box-shadow:3px 3px 0 var(--hard-shadow);border-color:var(--edge);}
.progress i {background:var(--blue);}
.public-topbar {background:var(--surface);}
body.public-mode .main {margin:0;width:100%;}
@media(max-width:1120px) {.pricing-hero,.wallet-hero {grid-template-columns:minmax(0,1fr);}}
@media(max-width:900px), (max-width:1180px) and (pointer:coarse) {
 .bottom-nav,html[data-theme="light"] .bottom-nav {background:var(--surface);border-top:2px solid var(--edge);backdrop-filter:none;}
}
@media(max-width:600px) {
 .login-page {padding:68px 18px 28px;}
 .login-card {padding:26px 20px;}
 .section-title {font-size:20px;}
 .pricing-deposit {min-width:0;}
 .pricing-grid {grid-template-columns:minmax(0,1fr);}
 .z-l1 {font-size:clamp(30px,10vw,40px);}
 .hero-pill {font-size:12px;padding-inline:12px;}
}
@media(min-width:1000px) {.stats-strip {grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(prefers-reduced-motion:reduce) {html {scroll-behavior:auto;}*,*::before,*::after {animation-duration:.01ms!important;transition-duration:.01ms!important;}}
.modal:not(.modal-lightbox) {border:2px solid var(--edge);box-shadow:var(--shadow);border-top:5px solid var(--orange);}
.modal-head h3 {font-family:Cairo,'IBM Plex Sans Arabic',sans-serif;font-weight:900;}
.settings-about-actions {display:flex;gap:8px;flex-wrap:wrap;}
.btn,.ghost-btn,.back-btn,.telegram-retry,.copy-mini,.tab {min-height:44px;}
.icon-btn,.close,.download {min-width:44px;min-height:44px;}
:focus-visible {outline:3px solid var(--blue);outline-offset:3px;}
@media(max-width:900px), (max-width:1180px) and (pointer:coarse) {
 body[data-page="chat"] .chat-card {height:100%;}
}
@media(max-width:390px) {.modal{padding:18px;}.model-row{gap:10px;}.modal .btn{white-space:normal;}.contact-card{padding:12px;}}
@media(max-width:360px) {.z-l1{font-size:30px;}.z-l2{font-size:36px;}.landing-nav{gap:8px;}.landing-nav-actions{gap:8px;}}
@media(max-width:320px) {.z-l1{font-size:27px;}.z-l2{font-size:32px;}.hero-pill{font-size:10.5px;padding-inline:8px;}.landing-nav .brand-arabic{display:none;}}

/* ---------- Card payments (Stripe Elements) ---------- */
.wallet-card { padding: 20px; border-color: var(--accent-line); }
.wallet-card-note { margin: 0 0 14px; color: var(--text-secondary); font-size: 11.5px; line-height: 1.8; }
.card-amount-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-amount-row label { font-size: 11px; color: var(--text-secondary); }
.card-amount-row .input { max-width: 130px; }
.card-amount-row .calculator-result { margin-inline-start: auto; }
.stripe-element-wrap { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-hover); }
.stripe-element-wrap:focus-within { border-color: var(--wafer-lime); box-shadow: 0 0 0 2px var(--accent-soft); }
#cardElementMount { min-height: 42px; }
.wallet-card-foot { margin: 10px 0 0; text-align: center; color: var(--text-muted); font-size: 10px; }
#cardPayBtn:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 760px) {
  .wallet-card { padding: 16px; }
  .card-amount-row .input { max-width: none; flex: 1 1 120px; }
  .card-amount-row .calculator-result { margin-inline-start: 0; width: 100%; text-align: center; }
}
