:root{
  --bg:#050505;
  --surface:#111111;
  --surface-2:#181818;
  --surface-3:#222222;
  --text:#ffffff;
  --muted:#989898;
  --line:#2c2c2c;
  --accent:#ffffff;
  --accent-text:#050505;
  --radius:24px;
}

*{box-sizing:border-box}
html{background:#000}
body{
  margin:0;
  min-height:100vh;
  background:radial-gradient(circle at top,#1a1a1a 0,#060606 36%,#000 100%);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;
}

button,input{font:inherit}
button{color:inherit}

.app-shell{
  width:min(100%,520px);
  min-height:100vh;
  margin:0 auto;
  position:relative;
  padding:0 18px 112px;
  background:linear-gradient(180deg,rgba(17,17,17,.72),rgba(3,3,3,.96));
}

.topbar{
  height:88px;
  padding-top:max(18px,env(safe-area-inset-top));
  display:grid;
  grid-template-columns:48px 1fr 48px;
  align-items:center;
  position:sticky;
  top:0;
  z-index:30;
  background:linear-gradient(180deg,#080808 72%,rgba(8,8,8,0));
}

.brand{
  justify-self:center;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:20px;
  font-weight:800;
}

.brand-logo{
  width:34px;height:34px;border-radius:11px;
  display:grid;place-items:center;
  background:linear-gradient(145deg,#fff,#777);
  color:#050505;font-weight:900;
  box-shadow:0 8px 24px rgba(255,255,255,.12);
}

.icon-button{
  width:42px;height:42px;border:1px solid var(--line);
  border-radius:50%;background:#171717;
  display:grid;place-items:center;font-size:20px;
}
.icon-button:last-child{justify-self:end}

.app-page{display:none;animation:pageIn .22s ease}
.app-page.active{display:block}
@keyframes pageIn{from{opacity:.3;transform:translateY(8px)}to{opacity:1;transform:none}}

.page-heading{margin:22px 2px 18px}
.page-heading h1{font-size:32px;font-weight:850;margin:0 0 18px}
.page-heading p{font-size:18px;font-weight:750;margin:0 0 4px}
.page-heading span{color:var(--muted);font-size:14px;line-height:1.45}

.status-card,.summary-card,.connect-card,.balance-card,.settings-card{
  background:linear-gradient(145deg,#1b1b1b,#111);
  border:1px solid rgba(255,255,255,.06);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:0 20px 50px rgba(0,0,0,.24);
}

.status-pill{
  display:inline-flex;align-items:center;gap:8px;
  font-size:13px;font-weight:800;
  background:#252525;border:1px solid #333;
  padding:7px 11px;border-radius:999px;
}
.dot{width:7px;height:7px;border-radius:50%;background:#fff;box-shadow:0 0 10px #fff}
.plan-name{font-size:17px;font-weight:750}
.small-dark-button,.secondary-button{
  background:#242424;border:1px solid #383838;border-radius:14px;padding:10px 15px;font-weight:700;
}

.progress-ring{
  --size:190px;
  width:var(--size);height:var(--size);margin:0 auto;border-radius:50%;
  display:grid;place-items:center;
  background:conic-gradient(#fff calc(var(--progress)*1%),#333 0);
  position:relative;
}
.progress-ring:before{
  content:"";position:absolute;inset:15px;border-radius:50%;background:#171717;
}
.progress-ring-inner{position:relative;display:grid;text-align:center}
.progress-ring-inner strong{font-size:58px;line-height:1}
.progress-ring-inner span{color:var(--muted);margin-top:8px}

.muted{color:var(--muted);font-size:14px}
.divider{height:1px;background:var(--line);margin:24px 0}
.thin-progress{height:8px;border-radius:999px;background:#303030;overflow:hidden}
.thin-progress span{display:block;height:100%;background:#fff;border-radius:inherit}

.primary-button,.primary-small{
  border:0;background:#fff;color:#050505;font-weight:850;
  border-radius:20px;min-height:62px;padding:0 22px;font-size:18px;
  box-shadow:0 15px 38px rgba(255,255,255,.12);
}
.primary-button:active,.primary-small:active{transform:scale(.985)}
.primary-small{min-height:46px;border-radius:14px;font-size:15px}

.quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.quick-card{
  min-height:126px;background:var(--surface-2);border:1px solid rgba(255,255,255,.05);
  border-radius:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:12px;font-weight:750;
}
.quick-icon,.list-icon,.large-icon{
  width:48px;height:48px;border-radius:16px;background:#2b2b2b;display:grid;place-items:center;font-size:22px;
}

.list-card{
  width:100%;min-height:92px;padding:18px 20px;border-radius:22px;
  background:var(--surface-2);border:1px solid rgba(255,255,255,.05);
  display:flex;align-items:center;gap:15px;
}
.list-card small,.device-item small{display:block;color:var(--muted);margin-top:4px}

.bottom-nav{
  position:fixed;left:50%;bottom:max(14px,env(safe-area-inset-bottom));transform:translateX(-50%);
  width:min(calc(100% - 28px),492px);
  height:82px;padding:8px;
  border:1px solid #2d2d2d;border-radius:30px;
  background:rgba(12,12,12,.94);backdrop-filter:blur(20px);
  display:grid;grid-template-columns:repeat(4,1fr);z-index:40;
  box-shadow:0 18px 50px rgba(0,0,0,.45);
}
.nav-item{
  border:0;background:transparent;border-radius:22px;color:#8f8f8f;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:12px;
}
.nav-item i{font-size:23px}
.nav-item.active{background:#fff;color:#050505;font-weight:800}

.tariff-list{display:grid;gap:12px}
.tariff-card{
  min-height:98px;border-radius:22px;border:1px solid #383838;background:#171717;
  padding:17px;display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:12px;cursor:pointer;
}
.tariff-card.selected{border-color:#fff;box-shadow:0 0 0 1px #fff inset}
.tariff-card input{display:none}
.radio-ui{width:23px;height:23px;border-radius:50%;border:2px solid #555;display:grid;place-items:center}
.tariff-card.selected .radio-ui:after{content:"";width:11px;height:11px;border-radius:50%;background:#fff}
.tariff-main,.tariff-price{display:flex;flex-direction:column}
.tariff-main strong,.tariff-price strong{font-size:17px}
.tariff-main small,.tariff-price small{color:var(--muted);margin-top:5px}
.tariff-price{text-align:right}
.tariff-price em{font-style:normal;font-size:12px;color:var(--muted)}

.accent-card{background:linear-gradient(145deg,#202020,#0f0f0f)}
.copy-field{
  display:flex;align-items:center;gap:10px;background:#222;border:1px solid #333;border-radius:16px;padding:0 14px;
}
.copy-field input{flex:1;min-width:0;background:transparent;border:0;color:#ddd;padding:15px 0;outline:none}
.copy-field button{border:0;background:transparent;font-size:20px}

.counter-badge{background:#2d2d2d;border-radius:999px;padding:8px 12px;font-weight:800}
.device-item{
  display:grid;grid-template-columns:40px 1fr 36px;align-items:center;gap:12px;padding:14px 0;border-top:1px solid var(--line);
}
.device-item>i{width:40px;height:40px;border-radius:12px;background:#0a0a0a;display:grid;place-items:center}
.device-item button{border:0;background:transparent;color:#aaa}

.profile-head{display:flex;align-items:center;gap:16px;margin-top:18px}
.profile-head h2{font-size:25px;margin:0 0 3px}
.avatar{width:72px;height:72px;border-radius:22px;background:linear-gradient(145deg,#fff,#777);color:#050505;display:grid;place-items:center;font-size:32px;font-weight:900}
.balance-value{font-size:44px}
.promo-row{display:grid;grid-template-columns:1fr auto;gap:10px}
.promo-row input{min-width:0;background:#202020;border:1px solid #444;color:#fff;border-radius:14px;padding:14px}
.promo-row button{border:0;border-radius:14px;padding:0 18px;font-weight:800}
.setting-row{min-height:68px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}
.setting-row:last-child{border-bottom:0}
.segmented{display:flex;background:#242424;padding:4px;border-radius:13px}
.segmented button{border:0;background:transparent;color:#999;padding:8px 13px;border-radius:10px}
.segmented button.active{background:#fff;color:#050505;font-weight:800}
.switch input{display:none}
.switch span{width:56px;height:32px;border-radius:999px;background:#3a3a3a;display:block;position:relative;transition:.2s}
.switch span:before{content:"";position:absolute;width:26px;height:26px;border-radius:50%;background:#fff;top:3px;left:3px;transition:.2s}
.switch input:checked+span{background:#fff}
.switch input:checked+span:before{left:27px;background:#050505}

.menu-link{width:100%;border:0;background:#181818;border-radius:15px;padding:15px;text-align:left;margin-bottom:10px}
.custom-modal,.custom-toast{background:#171717;color:#fff;border:1px solid #333}
.modal-content{border-radius:24px}
.toast-container{z-index:2000}

body.light-mode{
  --bg:#f4f4f4;--surface:#fff;--surface-2:#fff;--surface-3:#eee;
  --text:#111;--muted:#6c6c6c;--line:#ddd;
  background:#efefef;
}
body.light-mode .app-shell{background:#f4f4f4}
body.light-mode .topbar{background:linear-gradient(180deg,#f4f4f4 72%,rgba(244,244,244,0))}
body.light-mode .status-card,
body.light-mode .summary-card,
body.light-mode .connect-card,
body.light-mode .balance-card,
body.light-mode .settings-card,
body.light-mode .quick-card,
body.light-mode .list-card,
body.light-mode .tariff-card{background:#fff;color:#111;border-color:#ddd}
body.light-mode .bottom-nav{background:rgba(255,255,255,.94)}
body.light-mode .progress-ring:before{background:#fff}
body.light-mode .copy-field,
body.light-mode .promo-row input{background:#f1f1f1;color:#111}

@media(max-width:390px){
  .app-shell{padding-inline:13px}
  .tariff-card{grid-template-columns:28px 1fr auto;padding:14px 12px}
  .tariff-main strong,.tariff-price strong{font-size:15px}
  .quick-card{font-size:13px}
}
