:root {
  --bg: #090a0d;
  --card: #131418;
  --card2: #1b1d23;
  --card3: #252831;
  --line: rgba(255, 255, 255, .065);
  --line-subtle: rgba(255, 255, 255, .035);
  --text: #f4f4f6;
  --muted: #8b8f9a;
  --muted-dim: #606470;
  --up: #34d399;
  --down: #f87171;
  --accent: #ffffff;
  --violet: #d4d4d8;
  --brand: linear-gradient(180deg, #ffffff 0%, #cfcfd4 100%);
  --safe-top: calc(env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  background: radial-gradient(circle at 50% 0%, #151821 0%, #090a0d 75%);
  background-attachment: fixed;
}
button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  outline: none !important; -webkit-tap-highlight-color: transparent !important;
}
button:focus, button:focus-visible, button:active {
  outline: none !important;
}
input, textarea { font: inherit; color: inherit; outline: none; }
svg { display: block; }
b { font-weight: 650; }

#app { max-width: 520px; margin: 0 auto; padding: calc(var(--safe-top) + 14px) 16px calc(120px + var(--safe-bottom)); }
.screen { animation: fade .25s cubic-bezier(.2, .9, .3, 1); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 3D Apple Emojis & Pins ---------- */
.emoji-img { width: 18px; height: 18px; object-fit: contain; vertical-align: -2px; display: inline-block; filter: drop-shadow(0 2px 5px rgba(0,0,0,.45)); }
.emoji-img-lg { width: 24px; height: 24px; object-fit: contain; vertical-align: -3px; display: inline-block; filter: drop-shadow(0 3px 7px rgba(0,0,0,.5)); }
.emoji-img-xl { width: 44px; height: 44px; object-fit: contain; display: inline-block; filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)); }
.pin-img { width: 14px; height: 14px; object-fit: contain; display: inline-block; vertical-align: -1.5px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 14px; }
.round {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card2);
  border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  transition: transform .14s, background .14s;
}
.round:active { transform: scale(.94); background: var(--card3); }
.round img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ini {
  font-weight: 700; font-size: 16px;
  background: linear-gradient(145deg, #ffffff, #a5a5ab);
  width: 100%; height: 100%; display: grid; place-items: center; color: #090a0d;
  letter-spacing: -0.02em;
}
.demo-pill {
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
  padding: 5px 12px; border-radius: 99px; background: var(--card2);
  border: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px rgba(52, 211, 153, .4); }
.dot.yellow { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, .4); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; margin-bottom: 12px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.pad { padding: 16px; }
.section-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 20px 6px 10px; font-size: 15px; font-weight: 700; color: #9fa3ae;
  text-transform: lowercase; letter-spacing: -0.01em;
}
.section-title span { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: lowercase; }
.row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; width: 100%; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 15px; font-weight: 600; }
.row .s { font-size: 13px; color: var(--muted); margin-top: 3px; }
.row .end { text-align: right; font-weight: 600; font-size: 15px; }
.row .end .s { font-weight: 500; font-size: 12.5px; }
.row > .chev { color: #6d717d; flex: none; }
.row:active { background: rgba(255, 255, 255, .03); }
.up { color: var(--up); } .down { color: var(--down); }

.tile-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card3); color: #d7d7d7; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 50px; padding: 0 20px; border-radius: 16px; font-weight: 650; font-size: 15.5px;
  background: var(--card3); border: 1px solid var(--line); color: var(--text);
  text-align: center; transition: transform .14s, opacity .14s, background .14s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: #f4f4f6; color: #090a0d; border-color: #f4f4f6; box-shadow: 0 4px 16px rgba(255, 255, 255, .15); }
.btn.white { background: #f4f4f6; color: #090a0d; border-color: #f4f4f6; box-shadow: 0 4px 16px rgba(255, 255, 255, .15); }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); color: #e6e7eb; }
.btn.sm { min-height: 38px; font-size: 13.5px; border-radius: 13px; padding: 0 14px; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.btn.danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .25); color: var(--down); }
.btn.success { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .25); color: var(--up); }

/* ---------- tab bar (liquid glass) ---------- */
#nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-bottom));
  width: min(calc(100% - 28px), 440px); height: 72px; z-index: 20; padding: 4px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(38, 38, 38, .62); backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .4s cubic-bezier(.3, 1.4, .5, 1), box-shadow .3s;
  animation: navIn .7s cubic-bezier(.2, 1.2, .3, 1) both .1s;
}
#nav.dragging { transform: translateX(-50%) scale(1.025); box-shadow: 0 20px 50px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12); }
@keyframes navIn { from { transform: translate(-50%, 90px) scale(.9); opacity: 0; } }
#nav .ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); transform: translateX(var(--x, 0px)); transition: transform .5s cubic-bezier(.3, 1.35, .5, 1); pointer-events: none; }
#nav.dragging .ind { transition: transform .09s linear; }
#nav .ind i {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .2);
  transition: transform .42s cubic-bezier(.3, 1.6, .5, 1), background .25s, box-shadow .25s;
}
#nav.dragging .ind i {
  transform: scale(1.22, 1.16); background: rgba(255, 255, 255, .24);
  backdrop-filter: blur(6px) brightness(1.25); -webkit-backdrop-filter: blur(6px) brightness(1.25);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5), inset 0 1.5px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
#nav button {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #9d9d9d; text-align: center; transition: color .25s;
  outline: none !important; border: none !important; -webkit-tap-highlight-color: transparent !important;
  user-select: none; -webkit-user-select: none;
}
#nav button:focus, #nav button:focus-visible, #nav button:active {
  outline: none !important; border: none !important; box-shadow: none !important;
}
#nav button .ni { display: grid; place-items: center; width: 28px; height: 28px; transition: transform .45s cubic-bezier(.3, 1.8, .5, 1); }
#nav button.on, #nav button.hot { color: #fff; }
#nav button.hot .ni { transform: scale(1.18); }
#nav button.pop .ni { animation: navPop .55s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes navPop { 0% { transform: scale(1); } 35% { transform: scale(1.3) translateY(-3px); } 100% { transform: scale(1); } }

/* ---------- search & segments ---------- */
.search {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 0 16px; height: 46px;
  color: var(--muted); margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .03);
  transition: border-color .15s, background .15s;
}
.search:focus-within {
  border-color: rgba(255, 255, 255, .22);
  background: var(--card2);
}
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 14.5px; min-width: 0; color: var(--text); }
.search input::placeholder { color: var(--muted-dim); }

.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  padding: 8px 14px; border-radius: 99px; font-weight: 600; font-size: 13px;
  color: var(--muted); background: var(--card); border: 1px solid var(--line);
  white-space: nowrap; flex: none; transition: transform .14s, background .14s, color .14s, border-color .14s;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button:active { transform: scale(.95); }
.seg button.on {
  background: #f4f4f6; color: #090a0d; border-color: #f4f4f6;
  box-shadow: 0 2px 12px rgba(255, 255, 255, .15);
}
.seg-count { font-size: 11px; padding: 2px 6px; border-radius: 99px; background: rgba(0,0,0,.2); font-weight: 700; }
.seg button.on .seg-count { background: #090a0d; color: #fff; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650;
  padding: 3px 8px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line);
  color: #dbdce0; letter-spacing: .01em; text-transform: lowercase;
}
.badge.pending { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .25); color: #fbbf24; }
.badge.approved { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .25); color: #34d399; }
.badge.rejected { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .25); color: #f87171; }
.badge.lock { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .3); color: #fca5a5; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

/* ---------- letter cards ---------- */
.letter-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin-bottom: 12px;
  transition: transform .14s, background .14s, border-color .14s; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.letter-card:active { transform: scale(.985); background: var(--card2); border-color: rgba(255, 255, 255, .12); }
.letter-card.pinned {
  border-color: rgba(245, 158, 11, .35);
  background: linear-gradient(165deg, #181510 0%, #131418 100%);
  box-shadow: 0 6px 24px rgba(245, 158, 11, .07), inset 0 1px 0 rgba(245, 158, 11, .12);
}
.letter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.letter-text {
  font-size: 14.5px; line-height: 1.5; color: #ededf0; word-break: break-word; margin-bottom: 12px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line-subtle); border-radius: 14px; padding: 12px 14px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
.letter-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.reac-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reac-pill {
  background: var(--card2); border: 1px solid var(--line); padding: 4px 9px; border-radius: 99px;
  font-size: 12px; display: inline-flex; align-items: center; gap: 5px; color: #dbdce0; font-weight: 600;
}
.reply-pill {
  font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--card2);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px;
}
.reply-pill.has { color: var(--up); background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .25); }

/* ---------- sheets ---------- */
#sheets { position: relative; z-index: 50; }
.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.scrim {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .68);
  animation: sfade .22s ease both; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sheet {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100% - var(--safe-top) - 10px);
  overflow-y: auto; overscroll-behavior: contain;
  background: #111216; border: 1px solid rgba(255, 255, 255, .08); border-bottom: 0;
  border-radius: 30px 30px 0 0; padding: 8px 18px calc(34px + var(--safe-bottom));
  animation: sup .28s cubic-bezier(.2, .9, .3, 1) both; box-shadow: 0 -16px 50px rgba(0, 0, 0, .7);
}
.sheet-wrap.full .sheet { min-height: calc(100% - var(--safe-top) - 10px); }
.sheet-wrap.out .sheet { animation: sdown .2s ease both; }
.sheet-wrap.out .scrim { animation: sfadeout .2s ease both; }
@keyframes sup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sdown { to { transform: translateY(100%); } }
@keyframes sfade { from { opacity: 0; } }
@keyframes sfadeout { to { opacity: 0; } }
.grab { width: 42px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .2); margin: 6px auto 16px; cursor: grab; }
.sheet .close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center;
  color: #c1c3c9; z-index: 2; transition: transform .12s, background .12s;
}
.sheet .close:active { transform: scale(.92); background: var(--card3); }
.sh-title { text-align: center; font-size: 22px; line-height: 1.25; font-weight: 750; margin: 6px 30px 14px; text-transform: lowercase; }
.sh-sub { text-align: center; color: var(--muted); margin: -6px 10px 18px; font-size: 14px; line-height: 1.35; text-transform: lowercase; }
.sh-label { font-size: 13px; font-weight: 650; color: #a4a7b2; margin: 18px 4px 8px; text-transform: lowercase; }

.sheet-head-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; margin-bottom: 14px; padding-right: 46px;
}
.sheet-info { font-size: 13.5px; color: var(--muted); }

.banner-lock {
  background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .28);
  border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px;
  color: #fca5a5; display: flex; align-items: center; gap: 10px;
}

.quote-box {
  background: #0b0c0f; border: 1px solid var(--line); border-radius: 18px;
  padding: 15px 16px; font-size: 14.5px; line-height: 1.5; color: #f2f2f5;
  border-left: 3px solid #f4f4f6; margin-bottom: 14px; word-break: break-word;
}

/* ---------- replies thread ---------- */
.reply-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.reply-item-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; align-items: center; }
.reply-item-head b { color: #f4f4f6; font-size: 13px; text-transform: lowercase; }
.reply-item-text { font-size: 14px; color: #dedfe4; line-height: 1.45; word-break: break-word; }

.reply-actions { display: inline-flex; align-items: center; gap: 5px; }
.reply-act-btn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 4px 8px; border-radius: 9px; background: rgba(255, 255, 255, .05);
  color: #9fa3ae; border: 1px solid var(--line); transition: background .12s, color .12s, transform .1s;
  cursor: pointer; text-transform: lowercase;
}
.reply-act-btn:active { transform: scale(.94); }
.reply-act-btn.edit:hover, .reply-act-btn.edit:active { background: rgba(255, 255, 255, .12); color: #fff; }
.reply-act-btn.del { color: #f87171; background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .2); }
.reply-act-btn.del:active { background: rgba(248, 113, 113, .2); }
.reply-edit-box { background: #0b0c0f; border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-top: 8px; }
.reply-edit-input {
  width: 100%; min-height: 64px; background: transparent; border: none; outline: none;
  font-size: 13.5px; color: var(--text); resize: none; line-height: 1.4; padding: 0;
}

.reply-form { margin-top: 14px; }
.reply-form textarea {
  width: 100%; min-height: 90px; background: #0b0c0f; border: 1px solid var(--line);
  border-radius: 18px; padding: 13px 15px; font-size: 14.5px; resize: none; outline: 0;
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.reply-form textarea:focus { border-color: rgba(255, 255, 255, .22); box-shadow: 0 0 0 3px rgba(255, 255, 255, .04); }
.reply-form textarea::placeholder { color: var(--muted-dim); }

/* ---------- stats views ---------- */
.stats-hero { text-align: center; padding: 14px 0 20px; }
.stats-hero .amt {
  font-size: 52px; font-weight: 850; letter-spacing: -.03em; margin: 4px 0; color: #ffffff;
  text-shadow: 0 2px 20px rgba(255, 255, 255, .15);
}
.stats-hero .lbl { color: var(--muted); font-size: 13px; text-transform: lowercase; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 16px 14px; text-align: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.stat-box .n { font-size: 26px; font-weight: 750; margin-top: 4px; letter-spacing: -.02em; }
.stat-box .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: lowercase; }

/* ---------- 7-day bar chart ---------- */
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 16px 14px 14px; margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.chart-title { font-size: 14px; font-weight: 700; color: #f4f4f6; text-transform: lowercase; }
.chart-sub { font-size: 12px; color: var(--muted); text-transform: lowercase; }
.bars-wrap { display: flex; align-items: flex-end; justify-content: space-between; height: 110px; gap: 6px; padding-top: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 10.5px; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
.bar-col.today .bar-val { color: #fff; font-weight: 700; }
.bar-track { width: 100%; max-width: 32px; flex: 1; display: flex; align-items: flex-end; background: rgba(255, 255, 255, .035); border-radius: 8px; overflow: hidden; }
.bar-pillar {
  width: 100%; border-radius: 8px; background: rgba(255, 255, 255, .18);
  min-height: 4px; transition: height .5s cubic-bezier(.2, .9, .3, 1), background .2s;
}
.bar-col.today .bar-pillar {
  background: linear-gradient(180deg, #ffffff 0%, #a1a3ac 100%);
  box-shadow: 0 2px 10px rgba(255, 255, 255, .25);
}
.bar-lbl { font-size: 11px; font-weight: 600; color: var(--muted-dim); margin-top: 6px; text-transform: lowercase; }
.bar-col.today .bar-lbl { color: #f4f4f6; font-weight: 700; }
.bar-col.future { opacity: .32; }

/* ---------- admin duel card ---------- */
.duel-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.duel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.duel-users { display: flex; justify-content: space-between; margin-bottom: 10px; }
.duel-user { display: flex; flex-direction: column; }
.duel-user.right { align-items: flex-end; text-align: right; }
.duel-name { font-size: 14.5px; font-weight: 700; color: #fff; text-transform: lowercase; }
.duel-cnt { font-size: 12px; color: var(--muted); margin-top: 2px; text-transform: lowercase; }
.duel-cnt b { color: #f4f4f6; }
.duel-bar { height: 8px; width: 100%; border-radius: 99px; background: rgba(255, 255, 255, .08); display: flex; overflow: hidden; }
.duel-fill-left { height: 100%; background: linear-gradient(90deg, #ffffff, #cfcfd4); border-radius: 99px 0 0 99px; transition: width .5s; }
.duel-fill-right { height: 100%; background: #4b4f58; border-radius: 0 99px 99px 0; transition: width .5s; }

/* ---------- funnel grid ---------- */
.funnel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.funnel-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 10px; text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.funnel-val { font-size: 20px; font-weight: 750; color: #fff; margin-bottom: 2px; }
.funnel-lbl { font-size: 11px; color: var(--muted); line-height: 1.25; text-transform: lowercase; }

/* ---------- top letter card ---------- */
.top-letter-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.top-letter-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 8px; background: rgba(245, 158, 11, .12); color: #f59e0b;
  margin-bottom: 8px; text-transform: lowercase;
}
.top-letter-text { font-size: 13.5px; color: #e4e4e7; line-height: 1.45; margin-bottom: 10px; font-style: italic; }
.top-letter-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- backup view ---------- */
.backup-card {
  text-align: center; padding: 28px 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; margin-bottom: 14px; box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
}
.backup-card .ico {
  width: 68px; height: 68px; border-radius: 50%; background: var(--card2);
  border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 14px;
}

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 100;
  background: rgba(244, 244, 246, .96); color: #090a0d; padding: 12px 18px; border-radius: 16px;
  font-weight: 600; font-size: 14px; max-width: min(90%, 420px); text-transform: lowercase;
  text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- empty state ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14.5px; text-transform: lowercase; }
.empty-state {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 30px 18px; margin: 10px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .03);
  animation: fade .25s ease;
}
.empty-state-icon { margin-bottom: 10px; display: flex; justify-content: center; }
.empty-state-title { font-size: 16px; font-weight: 700; color: #f4f4f6; margin-bottom: 5px; }
.empty-state-sub { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ---------- admin notes card ---------- */
.note-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.note-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.note-body {
  background: #0b0c0f; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: #ededef;
  min-height: 48px; word-break: break-word;
}
.note-meta { font-size: 11.5px; color: var(--muted); margin-top: 8px; text-transform: lowercase; }
.note-edit-area {
  width: 100%; min-height: 80px; background: #0b0c0f; border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 14px; padding: 10px 12px; font-size: 13.5px; color: #fff; resize: none; outline: none;
}

/* ---------- scrollbars off ---------- */
html { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

