/* SMSNODE Mini App — light theme matching the reference screenshots */
:root{
  --bg:#f2f4f7;
  --card:#ffffff;
  --ink:#101828;
  --muted:#8b93a1;
  --line:#eceff3;
  --blue:#3da5ef;
  --blue-ink:#2b8fd6;
  --blue-soft:#eaf5fe;
  --green:#22c55e;
  --green-soft:#eefaf2;
  --red:#f05252;
  --radius:18px;
  --shadow:0 2px 10px rgba(16,24,40,.05);
  --safe-b:env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
/* `hidden` must beat the layout rules below (dashed attribute selectors lose ties) */
[hidden]{display:none!important}
html,body{margin:0;height:100%}
body{
  background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:15px;line-height:1.35;
}
#app{display:flex;flex-direction:column;min-height:100vh}

/* ── header ── */
.hdr{
  position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;
  gap:10px;padding:10px 14px;background:var(--card);border-bottom:1px solid var(--line);
}
.hdr-id{display:flex;align-items:center;gap:10px;min-width:0}
.avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;background:#e9edf2;flex:none}
.hdr-text{min-width:0}
.hdr-name{font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hdr-user{color:var(--muted);font-size:12.5px}
.hdr-actions{display:flex;align-items:center;gap:8px}
.icon-btn{
  position:relative;border:0;background:#f4f6f9;color:#5b6472;width:36px;height:36px;
  border-radius:50%;font-size:17px;line-height:1;
}
.lang-chip{
  border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 10px;
  font-size:12.5px;font-weight:600;color:#3a4351;
}
.badge{
  position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:#ef4444;color:#fff;font-size:11px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}

/* ── view ── */
.view{flex:1;padding:14px 14px 96px}

.section-title{display:flex;align-items:center;justify-content:space-between;margin:2px 0 10px}
.section-title h2{margin:0;font-size:17px;font-weight:700}
.section-title .count{color:var(--muted);font-weight:500}
.section-link{color:var(--blue-ink);font-size:13px;font-weight:600;border:0;background:none}

/* ── balance card ── */
.balance-card{
  background:linear-gradient(135deg,#eef0f3,#e8ebef);border-radius:22px;padding:16px 18px 14px;
  margin-bottom:14px;
}
.balance-card .label{font-size:11.5px;letter-spacing:.08em;color:#6b7280;font-weight:700}
.balance-card .amount{font-size:36px;font-weight:800;letter-spacing:-.5px;margin:2px 0 12px}
.balance-card .amount small{font-size:18px;font-weight:700;color:#5b6472;margin-left:3px}
.stats{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;border-top:1px solid #d9dde3;padding-top:10px}
.stats .k{font-size:10.5px;letter-spacing:.06em;color:#6b7280;font-weight:700}
.stats .v{font-size:15px;font-weight:700;margin-top:2px}
.balance-foot{display:flex;align-items:center;justify-content:space-between;margin-top:12px;gap:10px}
.mini-note{font-size:11.5px;color:#7b8492}

/* ── buttons ── */
.btn{
  border:0;border-radius:14px;padding:12px 16px;font-size:15px;font-weight:700;
  background:#edf0f4;color:#2f3742;
}
.btn.primary{background:var(--blue);color:#fff}
.btn.soft{background:var(--blue-soft);color:var(--blue-ink)}
.btn.block{display:block;width:100%}
.btn.ghost{background:#fff;border:1px solid var(--line);color:#2f3742}
.btn.danger-soft{background:#fdecec;color:#d64545}
.btn:disabled{opacity:.55}

/* ── quick tiles ── */
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.tile{
  text-align:left;border:0;border-radius:16px;padding:14px;background:var(--card);
  box-shadow:var(--shadow);
}
.tile .ico{font-size:17px;color:var(--blue-ink)}
.tile .t{font-weight:700;margin-top:6px}
.tile .s{color:var(--muted);font-size:12.5px;margin-top:2px}
.tile.sel{background:var(--blue-soft)}

/* ── number cards ── */
.ncard{
  background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:13px 14px;margin-bottom:10px;border:1.5px solid transparent;
}
.ncard.done{background:var(--green-soft);border-color:#cdebd8}
.ncard-top{display:flex;align-items:flex-start;gap:10px}
.nflags{display:flex;flex-direction:column;gap:3px;flex:none}
.nflags .fl{font-size:20px;line-height:1}
.nflags .svc{width:20px;height:20px;border-radius:50%;background:#25d366;color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:11px}
.nmain{flex:1;min-width:0}
.nnum{font-size:17px;font-weight:700;letter-spacing:-.2px}
.nmeta{color:var(--muted);font-size:12.5px;margin-top:2px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.nmeta .held{display:inline-flex;align-items:center;gap:4px}
.copy-mini{border:0;background:transparent;font-size:16px;color:#98a0ad;padding:2px 4px}
.nbar{height:6px;border-radius:99px;background:#eef1f5;margin:9px 0 10px;overflow:hidden}
.nbar i{display:block;height:100%;width:0;background:#c9d3df;transition:width .4s}
.ncard.done .nbar{display:none}
.nrow{display:flex;gap:8px}
.nrow .btn{flex:1;padding:9px 8px;font-size:14px;border-radius:12px}
.waiting{color:#98a0ad;font-size:12.5px;margin-bottom:9px}

/* OTP chip (green card) */
.otp-chip{
  display:flex;align-items:center;gap:6px;background:#e3f2e9;border-radius:12px;
  padding:11px 13px;margin:4px 0 10px;font-size:24px;font-weight:800;letter-spacing:.06em;
  color:#20302a;width:max-content;min-width:150px;
}
.otp-chip .copy-mini{font-size:15px}

/* action rows under the cards */
.action-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:12px 0}
.action-grid .btn{background:#f1f3f6;border-radius:13px;padding:11px;font-size:14px;
  display:flex;align-items:center;justify-content:center;gap:7px}
.action-grid .btn.wide{grid-column:span 2;background:var(--blue);color:#fff}

/* ── empty states ── */
.empty{text-align:center;padding:26px 18px 18px}
.empty .emoji{font-size:44px;line-height:1}
.empty h3{margin:12px 0 4px;font-size:17px}
.empty p{margin:0 0 16px;color:var(--muted);font-size:13.5px}

/* ── picker ── */
.steps{display:flex;align-items:center;gap:10px;margin:2px 0 14px}
.steps .dot{width:10px;height:10px;border-radius:50%;background:#cfd6df;flex:none}
.steps .dot.on{background:var(--blue)}
.steps .ln{flex:1;height:3px;border-radius:99px;background:#dfe4ea}
.steps .ln.on{background:var(--blue)}
.steps .lbl{font-size:12px;font-weight:600;color:#8b93a1}
.steps .lbl.on{color:var(--ink)}
.search{position:relative;margin:0 0 12px}
.search input{
  width:100%;border:1px solid var(--line);background:#f5f6f8;border-radius:13px;
  padding:13px 14px 13px 40px;font-size:15px;color:var(--ink);outline:none;
}
.search .mag{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#9aa3b0}
.list{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.row{
  width:100%;border:0;background:transparent;display:flex;align-items:center;gap:12px;
  padding:14px;text-align:left;border-bottom:1px solid var(--line);
}
.row:last-child{border-bottom:0}
.row .r-ico{width:34px;height:34px;border-radius:50%;background:#eef6fe;display:flex;
  align-items:center;justify-content:center;font-size:17px;flex:none}
.row .r-main{flex:1;min-width:0}
.row .r-t{font-weight:600}
.row .r-s{color:var(--muted);font-size:12.5px;margin-top:1px}
.pill{background:#f1f4f7;border-radius:999px;padding:5px 10px;font-size:12.5px;font-weight:600;color:#5b6472}
.chev{color:#b7bec8;font-size:18px}
.picker-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.picker-head .svc-ico{width:40px;height:40px;border-radius:50%;background:#25d366;color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:20px}
.picker-head .k{font-size:11px;letter-spacing:.07em;color:var(--blue-ink);font-weight:800}
.picker-head .n{font-size:22px;font-weight:800}

/* ── profile ── */
.kv{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:4px 16px;margin-bottom:14px}
.kv .r{display:flex;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}
.kv .r:last-child{border-bottom:0}
.kv .k{color:var(--muted)}
.kv .v{font-weight:600;text-align:right;word-break:break-word}
.ref-box{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;margin-bottom:14px}
.ref-box .link{background:#f5f6f8;border-radius:11px;padding:11px 12px;font-size:12.5px;
  color:#3a4351;word-break:break-all;margin:10px 0}
.ref-box .acts{display:flex;gap:9px}
.ref-box .acts .btn{flex:1}
.pref-row{display:flex;align-items:center;justify-content:space-between;padding:14px 0;border-bottom:1px solid var(--line)}
.pref-row:last-child{border-bottom:0}

/* ── live ── */
.seg{display:flex;background:#e9edf2;border-radius:12px;padding:3px;margin-bottom:12px}
.seg button{flex:1;border:0;background:transparent;border-radius:10px;padding:9px;font-size:13.5px;
  font-weight:600;color:#6b7280}
.seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(16,24,40,.08)}
.live-row{display:flex;align-items:center;gap:11px;padding:12px 14px;border-bottom:1px solid var(--line)}
.live-row:last-child{border-bottom:0}
.live-row .fl{font-size:19px}
.live-row .m{flex:1;min-width:0}
.live-row .t{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.live-row .num{color:var(--muted);font-size:12.5px;font-family:ui-monospace,Menlo,monospace}
.live-row .ago{color:var(--muted);font-size:12px}

/* ── tabs ── */
.tabs{
  position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;align-items:center;
  background:var(--card);border-top:1px solid var(--line);
  padding:6px 8px calc(6px + var(--safe-b));
}
.tab{
  flex:1;border:0;background:transparent;padding:6px 0;display:flex;flex-direction:column;
  align-items:center;gap:3px;color:#8b93a1;position:relative;
}
.tab .ti{font-size:19px;line-height:1}
.tab .tl{font-size:11px;font-weight:600}
.tab.on{color:var(--blue-ink)}
.tab.plus{
  flex:none;width:56px;height:56px;margin-top:-24px;border-radius:50%;background:var(--blue);
  color:#fff;font-size:30px;font-weight:300;line-height:1;box-shadow:0 6px 16px rgba(61,165,239,.45);
  display:flex;align-items:center;justify-content:center;
}
.tab.plus::after{content:""}
.tab-badge{position:absolute;top:0;right:22px}

/* ── sheet / popup ── */
.sheet-wrap{position:fixed;inset:0;z-index:50}
.sheet-backdrop{position:absolute;inset:0;background:rgba(17,24,39,.45)}
.sheet{
  position:absolute;left:0;right:0;bottom:0;background:var(--card);
  border-radius:22px 22px 0 0;padding:10px 18px calc(18px + var(--safe-b));
  animation:up .18s ease-out;
}
.sheet .grip{width:44px;height:4px;border-radius:99px;background:#d8dde4;margin:4px auto 14px}
.sheet h3{margin:0 0 8px;font-size:20px}
.sheet p{margin:0 0 14px;color:var(--muted);font-size:13.5px}
.sheet .remember{display:flex;align-items:center;justify-content:space-between;
  border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin-bottom:14px}
.sheet .remember .t{font-weight:600;font-size:14px}
.sheet .remember .s{color:var(--muted);font-size:12px}
.sheet .row2{display:flex;gap:10px}
.sheet .row2 .btn{flex:1;padding:14px}
.sheet .row2 .btn.primary{flex:1.25}
@keyframes up{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}

/* switch */
.switch{width:46px;height:27px;border-radius:99px;background:#dde3ea;position:relative;flex:none;transition:background .15s}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:21px;height:21px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:left .15s}
.switch.on{background:var(--blue)}
.switch.on::after{left:22px}

/* menu sheet */
.menu-item{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:12px;
  padding:15px 2px;border-bottom:1px solid var(--line);font-size:15px;font-weight:600;text-align:left}
.menu-item:last-child{border-bottom:0}

.toast{
  position:fixed;left:50%;bottom:86px;transform:translateX(-50%);z-index:80;
  background:#1f2937;color:#fff;border-radius:12px;padding:11px 16px;font-size:13.5px;
  max-width:86vw;text-align:center;
}
.loading{text-align:center;padding:40px 0;color:var(--muted)}
.spin{display:inline-block;width:26px;height:26px;border-radius:50%;
  border:3px solid #dfe4ea;border-top-color:var(--blue);animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

/* ── force-join screen ── */
.join-wrap{max-width:520px;margin:0 auto;text-align:center;padding:10px 4px 30px}
.join-emoji{font-size:54px;line-height:1;margin-top:14px}
.join-title{margin:10px 0 6px;font-size:26px;font-weight:800}
.join-sub{margin:0 auto 18px;color:var(--muted);font-size:14px;max-width:340px}
.join-list{display:flex;flex-direction:column;gap:10px;margin-bottom:18px}
.join-row{
  display:flex;align-items:center;justify-content:center;gap:9px;
  background:#eceff3;border-radius:16px;padding:16px;color:#2f3742;
  font-weight:700;text-decoration:none;
}
.join-row:active{background:#e2e6ec}
.join-meg{font-size:15px}
.join-name{font-size:15px}
.join-btn{padding:16px;border-radius:14px;font-size:16px}
