/* User portal - macOS look: translucent sidebar, large titles, soft cards, system controls. Light and dark. */
:root {
  --tint: #007aff; --bg: #f5f5f7; --surface: #fff; --surface-2: #f2f2f7; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #a1a1a6;
  --line: rgba(60, 60, 67, .12); --fill: rgba(120, 120, 128, .12); --bar: rgba(246, 246, 248, .76);
  --green: #34c759; --red: #ff3b30; --orange: #ff9500; --bubble: #e9e9eb;
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --r: 16px; --r-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e; --surface: #2c2c2e; --surface-2: #3a3a3c; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
    --line: rgba(84, 84, 88, .6); --fill: rgba(120, 120, 128, .26); --bar: rgba(36, 36, 38, .76);
    --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --bubble: #48484a; --shadow: 0 0 0 .5px rgba(255, 255, 255, .08);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--tint); text-decoration: none; cursor: pointer; }
.sub { color: var(--text-2); } .small { font-size: 12.5px; } .num { font-variant-numeric: tabular-nums; } .center-text { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
[hidden] { display: none !important; }

/* ---- window: sidebar + content ---- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 14px; background: var(--bar); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-right: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--text); padding: 2px 8px 16px; }
.logo img { height: 26px; max-width: 130px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 15px; background: linear-gradient(135deg, var(--tint), color-mix(in srgb, var(--tint) 60%, #5e5ce6)); }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 14px; transition: background .12s; }
.tabs a:hover { background: var(--fill); } .tabs a.on { background: var(--tint); color: #fff; font-weight: 500; }
.tabs svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.wallet-card { margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.wallet-card b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; } .wallet-card .who { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 1120px; width: 100%; margin: 0 auto; padding: 30px 28px 80px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

/* ---- surfaces ---- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.aside { position: sticky; top: 24px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.tile b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero { background: linear-gradient(135deg, var(--tint), color-mix(in srgb, var(--tint) 62%, #5e5ce6)); color: #fff; box-shadow: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px; }
.hero .sub { color: rgba(255, 255, 255, .78); } .hero b { display: block; font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero button { background: #fff; color: var(--tint); }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: #fff; font-size: 12px; font-weight: 600; margin-right: 8px; vertical-align: 2px; }

/* grouped list, System Settings style */
.group { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.group-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 22px 14px 8px; }
.cell { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 46px; position: relative; color: var(--text); }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: 1px solid var(--line); }
a.cell:hover, .cell.tap:hover { background: var(--surface-2); } .cell.tap { cursor: pointer; }
.cell .grow { flex: 1; min-width: 0; } .cell .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .val { color: var(--text-2); text-align: right; } .chev { color: var(--text-3); font-size: 18px; }
.empty { text-align: center; color: var(--text-2); padding: 40px 16px; }

/* ---- controls ---- */
button { font: inherit; font-weight: 500; border: 0; border-radius: 8px; padding: 7px 16px; background: var(--tint); color: #fff; cursor: pointer; transition: opacity .15s, transform .1s; }
button:hover { opacity: .88; } button:active { transform: scale(.98); } button:disabled { opacity: .4; cursor: default; }
button.lg { padding: 11px 22px; font-size: 16px; width: 100%; border-radius: 12px; }
button.plain { background: var(--fill); color: var(--tint); } button.red { background: var(--fill); color: var(--red); }
button.link { background: none; color: var(--tint); padding: 4px 2px; } button.link.red { color: var(--red); }
label.f { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--text-2); }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 116px; resize: vertical; } textarea.short { min-height: 70px; }
input[type=checkbox] { display: inline-block; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--tint); flex: none; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--tint); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--tint) 20%, transparent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; margin-bottom: 12px; max-width: 100%; }
.seg button { background: none; color: var(--text); padding: 5px 14px; border-radius: 7px; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--surface); box-shadow: 0 .5px 1px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .1); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; padding: 7px; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; text-align: left; color: var(--text); font-weight: 400; }
.chip.on { border-color: var(--tint); background: color-mix(in srgb, var(--tint) 9%, var(--surface)); }
.chip span { display: block; font-size: 12px; color: var(--text-2); }
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.badge.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.badge.bad { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.badge.run { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.meter { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; display: flex; margin-top: 8px; }
.meter i { display: block; height: 100%; } .meter .g { background: var(--green); } .meter .r { background: var(--red); }
.banner { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .pair > * { margin-top: 0; min-width: 0; } .pair > label.f > * { margin-top: 6px; }
.secret { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; margin: 6px 0 14px; }
pre { margin: 0; white-space: pre-wrap; }
.qr { display: block; width: 190px; height: 190px; margin: 4px auto 14px; border-radius: 12px; }
.code-row { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; } .code-row input { margin-top: 0; flex: 1; min-width: 0; }
.code-row button { flex: none; border-radius: var(--r-sm); white-space: nowrap; min-width: 112px; }

/* ---- compose ---- */
.counted { position: relative; } .counted .count { position: absolute; right: 10px; bottom: 7px; font-size: 11px; color: var(--text-3); pointer-events: none; font-variant-numeric: tabular-nums; }
.counted .count.over { color: var(--red); font-weight: 600; } .counted textarea { padding-bottom: 24px; } .counted input { padding-right: 76px; }
.sugs { display: grid; gap: 8px; margin: 6px 0 14px; }
.sug { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; display: grid; gap: 8px; }
.sug input, .sug select { margin-top: 0; background: var(--surface); } .sug .link { justify-self: start; }
.fold { margin-bottom: 10px; } .fold > summary { cursor: pointer; font-weight: 600; padding: 8px 0; display: flex; justify-content: flex-start; align-items: center; list-style: none; }
.fold > summary::before { content: "›"; display: inline-block; margin-right: 8px; color: var(--text-3); transition: transform .15s; } .fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary::-webkit-details-marker { display: none; } .fold > summary > button { margin-left: auto; }
details.fold:not(.card) { border-top: 1px solid var(--line); } details.fold:not(.card):first-of-type { border-top: 0; }
.rules ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; } .rules li { margin-bottom: 6px; }

/* ---- message preview (phone) ---- */
.phone { background: var(--surface); border-radius: 34px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 16px; }
.screen { background: var(--bg); border-radius: 24px; min-height: 400px; padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.screen .who { text-align: center; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.bubble { align-self: flex-start; max-width: 86%; background: var(--bubble); border-radius: 18px; padding: 9px 13px; white-space: pre-wrap; word-break: break-word; }
.chips-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .chips-row::-webkit-scrollbar { display: none; }
.chipbtn { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--tint); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.rcard { align-self: flex-start; width: 86%; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); flex: none; }
.rcard img, .rcard .ph { display: block; width: 100%; object-fit: cover; background: var(--fill); } .rcard .ph { display: grid; place-items: center; font-size: 11px; color: var(--text-2); padding: 6px; text-align: center; }
.rcard .m-SHORT { height: 66px; } .rcard .m-MEDIUM { height: 100px; } .rcard .m-TALL { height: 156px; }
.rcard .b { padding: 10px 13px; } .rcard .t { font-weight: 600; word-break: break-word; } .rcard .d { color: var(--text-2); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.rcard .act { border-top: 1px solid var(--line); text-align: center; padding: 9px; color: var(--tint); font-weight: 500; font-size: 14px; }
.rcard.hz { display: grid; grid-template-columns: 92px 1fr; width: 94%; } .rcard.hz img, .rcard.hz .ph { height: 100%; min-height: 92px; grid-row: span 9; }
.rcard.hz.right { grid-template-columns: 1fr 92px; } .rcard.hz.right img, .rcard.hz.right .ph { grid-column: 2; grid-row: 1 / span 9; } .rcard.hz.right > :not(img):not(.ph) { grid-column: 1; }
.carousel { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; } .carousel .rcard { width: 190px; scroll-snap-align: start; }
.carousel.sm .rcard { width: 132px; } .carousel.sm .m-TALL { height: 110px; }

/* ---- bar chart ---- */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 8px; }
.chart .col { flex: 1; min-width: 3px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; }
.chart i { display: block; border-radius: 2px; } .chart .g, .legend .g { background: var(--green); } .chart .r, .legend .r { background: var(--red); } .chart .w, .legend .w { background: var(--text-3); }
.chart-x { display: flex; justify-content: space-between; color: var(--text-2); font-size: 11px; margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* ---- sheets & toasts ---- */
dialog { border: 0; padding: 0; background: var(--surface); color: var(--text); border-radius: 18px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 24px 80px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(0, 0, 0, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog form { padding: 24px; } dialog h2 { text-align: center; }
dialog .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; } dialog .actions button { border-radius: 10px; padding: 10px; }
dialog.doc { width: min(640px, calc(100vw - 32px)); } .doc-text { white-space: pre-wrap; max-height: 56vh; overflow: auto; font-size: 14px; line-height: 1.7; color: var(--text); background: var(--surface-2); border-radius: var(--r-sm); padding: 14px 16px; }
#toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 99; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
#toast div { background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--text); box-shadow: var(--shadow), 0 0 0 .5px var(--line); padding: 9px 18px; border-radius: 99px; font-size: 13.5px; font-weight: 500; max-width: 92vw; }
#toast div.err { color: var(--red); }

/* ---- sign in ---- */
.auth2 { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px; color: #fff;
  background: radial-gradient(1200px 600px at 10% 10%, color-mix(in srgb, var(--tint) 70%, #64d2ff) 0%, transparent 60%), radial-gradient(900px 600px at 90% 90%, #5e5ce6 0%, transparent 60%), linear-gradient(135deg, var(--tint), #5e5ce6); }
.hero-in { max-width: 440px; } .auth-hero h1 { font-size: 40px; margin: 18px 0 8px; } .hero-tag { font-size: 18px; opacity: .9; margin-bottom: 34px; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; } .features li { display: flex; gap: 14px; align-items: flex-start; }
.features b { display: block; font-size: 16px; } .features span { opacity: .85; font-size: 14px; }
.f-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 1 !important; }
.f-ico svg { width: 20px; height: 20px; }
.auth-logo { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-size: 28px; font-weight: 700; overflow: hidden; }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 360px; } .auth-box h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-box .seg { margin: 20px 0 0; } .auth-box form { margin-top: 14px; } .auth-box form input + input, .auth-box form > div + div { margin-top: 10px; } .auth-box form .lg { margin-top: 16px; }
.agree { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 10px; font-size: 13px; color: var(--text-2); cursor: pointer; } .agree input { margin-top: 2px; }
/* the first-run and standalone screens reuse the centred box */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; } .auth .auth-box { text-align: center; } .auth .auth-box form { text-align: left; margin-top: 24px; }

@media (max-width: 860px) {
  h1 { font-size: 26px; } .cols { grid-template-columns: 1fr; } .aside { position: static; }
  .app { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo { padding: 0; font-size: 15px; } .logo-mark { width: 24px; height: 24px; font-size: 13px; }
  .wallet-card { margin: 0; flex-direction: row; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; box-shadow: none; background: var(--fill); } .wallet-card b { font-size: 13px; } .wallet-card .sub { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: row; gap: 0; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); padding: 5px 2px calc(5px + env(safe-area-inset-bottom)); }
  .tabs a { flex: 1; flex-direction: column; gap: 1px; font-size: 10px; padding: 4px 2px; border-radius: 8px; color: var(--text-2); min-width: 0; }
  .tabs a.on { background: none; color: var(--tint); } .tabs a:hover { background: none; } .tabs svg { width: 23px; height: 23px; }
  .page { padding: 18px 14px 100px; } .card { padding: 16px; }
  input, textarea, select { font-size: 16px; }  /* stops iOS zooming on focus */
  .auth2 { grid-template-columns: 1fr; } .auth-hero { padding: 28px 22px; place-items: start; } .auth-hero h1 { font-size: 28px; margin: 12px 0 4px; } .hero-tag { font-size: 15px; margin-bottom: 0; }
  .features { display: none; } .auth-logo { width: 46px; height: 46px; font-size: 22px; border-radius: 13px; } .auth-panel { place-items: start center; padding-top: 24px; }
  .seg { display: flex; } .seg button { flex: 1; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* language menu */
.lang-pick { width: auto; min-width: 0; margin: 0; padding: 6px 10px; font-size: 13px; }
.lang-pick.side { width: 100%; margin-top: 10px; }
.lang-corner { position: absolute; top: 14px; right: 16px; z-index: 5; }
.auth2 { position: relative; }
@media (max-width: 820px) { .lang-pick.side { display: none; } }

/* show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 40px; }
.pw-eye { position: absolute; right: 2px; bottom: 0; width: 36px; height: 100%; max-height: 44px; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; opacity: .5; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pw-eye:hover, .pw-eye:focus-visible { opacity: .9; background: none; }
.pw-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .pw-eye { right: auto; left: 2px; }
[dir=rtl] .pw-wrap > input { padding-right: 10px; padding-left: 40px; }

/* USDT payment sheet */
dialog.pay { width: min(420px, calc(100vw - 24px)); overflow: hidden; }
dialog.pay form { padding: 0 22px 22px; }
.pay-head { display: flex; align-items: center; gap: 12px; margin: 0 -22px; padding: 16px 16px 16px 22px; background: linear-gradient(135deg, color-mix(in srgb, #26a17b 16%, var(--surface)), var(--surface) 70%); border-bottom: .5px solid color-mix(in srgb, var(--text) 10%, transparent); }
.pay-head b { display: block; font-size: 16px; }
.pay-head .net { display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: #1a8a68; background: color-mix(in srgb, #26a17b 16%, transparent); }
.coin { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #26a17b; color: #fff; font-size: 22px; font-weight: 700; box-shadow: 0 4px 12px rgba(38, 161, 123, .35); }
.pay-head .x { flex: none; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.pay-amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; width: 100%; margin: 20px 0 0; padding: 4px; border: 0; background: none; box-shadow: none; color: var(--text); cursor: pointer; }
.pay-amount .num { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.pay-amount .num i { font-style: normal; color: #26a17b; }
.pay-amount small { font-size: 15px; font-weight: 600; opacity: .6; }
.pay-amount svg { width: 16px; height: 16px; align-self: center; opacity: .45; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pay-amount:hover svg { opacity: .9; }
.pay-hint { text-align: center; font-size: 12.5px; color: #1a8a68; margin: 2px 0 16px; }
.qr-card { width: 196px; margin: 0 auto 16px; padding: 12px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 10px 30px rgba(0, 0, 0, .1); }
.qr-card .qr { width: 172px; height: 172px; margin: 0; border-radius: 6px; }
.addr { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--surface-2); }
.addr .mono { font-size: 12.5px; word-break: break-all; margin-top: 2px; }
.addr button { flex: none; border-radius: 10px; padding: 8px 12px; white-space: nowrap; }
.pay-wait { margin: 16px 0 12px; }
.pay-wait .row { gap: 10px; align-items: center; }
.pay-status { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #26a17b; box-shadow: 0 0 0 0 rgba(38, 161, 123, .5); animation: pulse 1.6s infinite; }
.pay-status.over .pulse { background: var(--orange); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(38, 161, 123, 0); } 100% { box-shadow: 0 0 0 0 rgba(38, 161, 123, 0); } }
.pay-wait progress { display: block; width: 100%; height: 4px; margin-top: 8px; border: 0; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--text) 10%, transparent); appearance: none; -webkit-appearance: none; }
.pay-wait progress::-webkit-progress-bar { background: transparent; }
.pay-wait progress::-webkit-progress-value { background: #26a17b; border-radius: 99px; transition: width 1s linear; }
.pay-wait progress::-moz-progress-bar { background: #26a17b; border-radius: 99px; }
dialog.pay.late progress::-webkit-progress-value { background: var(--orange); }
dialog.pay.late progress::-moz-progress-bar { background: var(--orange); }
.pay-warn { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; font-size: 12px; line-height: 1.5; color: color-mix(in srgb, var(--text) 65%, transparent); }
.pay-warn svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--orange); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pay-done { text-align: center; padding: 36px 0 20px; }
.pay-done .tick { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: #26a17b; color: #fff; box-shadow: 0 10px 30px rgba(38, 161, 123, .4); animation: pop .35s ease-out; }
.pay-done .tick svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse, .pay-done .tick { animation: none; } }

/* avatar and profile card */
.avatar { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--tint), #5e5ce6); color: #fff; font-weight: 600; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; } .avatar.xl { width: 84px; height: 84px; font-size: 34px; box-shadow: 0 0 0 3px var(--surface), 0 8px 24px rgba(0, 0, 0, .14); }
.wallet-card .who { display: flex; align-items: center; gap: 7px; min-width: 0; } .wallet-card .who .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile { position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px 24px; margin-bottom: 8px; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 13%, var(--surface)), var(--surface) 60%), var(--surface); }
.profile .who { min-width: 180px; } .profile .name { font-size: 24px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.avatar-btn { position: relative; flex: none; padding: 0; border: 0; background: none; box-shadow: none; border-radius: 50%; cursor: pointer; }
.avatar-btn .cam { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .16); }
.avatar-btn .cam svg { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.chip.ok { color: #1a8a68; background: color-mix(in srgb, #26a17b 15%, transparent); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; } .profile-actions button { border-radius: 10px; padding: 8px 14px; }
@media (max-width: 820px) { .profile { padding: 20px 16px; gap: 14px; } .avatar.xl { width: 64px; height: 64px; font-size: 26px; } .profile .name { font-size: 20px; } .profile-actions { width: 100%; } .wallet-card .who .sub { display: inline; } }

/* API reference */
.docs h3 { font-size: 15px; margin: 22px 0 8px; } .docs h3:first-child { margin-top: 0; } .docs .seg { margin-bottom: 8px; }
.code { border-radius: 12px; overflow: hidden; background: #1e1e22; color: #e6e6eb; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .3); direction: ltr; text-align: left; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; background: #2a2a30; font-size: 12px; color: #a1a1a6; font-weight: 600; letter-spacing: .02em; }
.code-bar button { padding: 3px 10px; border-radius: 7px; border: 0; background: rgba(255, 255, 255, .1); color: #e6e6eb; font-size: 12px; box-shadow: none; cursor: pointer; }
.code-bar button:hover { background: rgba(255, 255, 255, .2); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; white-space: pre; tab-size: 4; }
.code code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; }
.tbl { overflow-x: auto; border-radius: 12px; background: var(--surface-2); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; } .tbl td { padding: 9px 14px; vertical-align: top; text-align: start; border-top: .5px solid color-mix(in srgb, var(--text) 9%, transparent); }
.tbl tr:first-child td { border-top: 0; } .tbl td.mono { white-space: nowrap; word-break: normal; }
.verb { display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 6px; font: 600 11.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: center; color: #fff; background: #248a3d; }
.verb.get { background: #0a84ff; }

/* customer service + tickets */
.cs-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.cs-card.muted { color: var(--text-2); }
.cs-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; } .cs-top b { font-size: 16px; }
.cs-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--tint) 12%, transparent); color: var(--tint); }
.cs-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cs-chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.cs-chan { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
a.cs-chan:hover { background: color-mix(in srgb, var(--tint) 10%, var(--surface-2)); } .cs-chan b { word-break: break-all; }
.cs-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-2); white-space: pre-wrap; font-size: 13.5px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 1px; }
.back { display: inline-block; color: var(--text-2); font-size: 13px; margin-bottom: 4px; }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.tmsg { max-width: 82%; } .tmsg.me { align-self: flex-end; } .tmsg.them { align-self: flex-start; }
.tmeta { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; display: flex; gap: 5px; align-items: center; } .tmsg.me .tmeta { justify-content: flex-end; }
.tbody { padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); }
.tmsg.me .tbody { background: var(--tint); color: #fff; }
.tag-cs { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: color-mix(in srgb, var(--tint) 16%, transparent); color: var(--tint); }
.treply textarea { min-height: 80px; }

/* ---- top bar: language + account in the top-right ---- */
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 11px 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-ava { display: inline-flex; border-radius: 50%; transition: box-shadow .15s; }
.tb-ava:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 24%, transparent); }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.bar-top { display: contents; }        /* desktop: logo sits in the sidebar column, controls hidden */
.bar-ctrl { display: none; }
.topbar + .page { padding-top: 22px; }

@media (max-width: 860px) {
  .sidebar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
  .topbar { display: none; }            /* on phones the controls move into the top bar below */
  .bar-top { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
  .bar-ctrl { display: flex; align-items: center; gap: 8px; }
  .sidebar .wallet-card { display: none; }   /* balance stays on Home and the Wallet tab */
  .avatar.sm { width: 28px; height: 28px; }
}

/* account entry pinned to the bottom-left of the sidebar */
.acct-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 8px 8px; border-radius: 10px; color: var(--text); }
.acct-row:hover { background: var(--fill); }
.acct-row .grow { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row svg { width: 16px; height: 16px; flex: none; opacity: .4; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wallet-card { margin-top: auto; }
@media (max-width: 860px) { .sidebar .acct-row { display: none; } }  /* on phones the account lives in the bottom tab bar */
