/* ============ Auth ============ */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side {
  position: relative; overflow: hidden; padding: 40px 56px; display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(60% 50% at 60% 45%, rgba(130,110,255,.25), transparent 70%),
    radial-gradient(40% 30% at 20% 90%, rgba(233,207,152,.08), transparent 70%),
    var(--bg-side);
}
.auth-visual { flex: 1; display: grid; place-items: center; }
.auth-visual .orbit { max-width: 440px; }
.auth-quote h2 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 400; }
.auth-quote p { color: var(--muted); margin: 14px 0 0; }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-mobile-logo { display: none; margin-bottom: 36px; }
.auth-card h1 { font-size: 32px; font-weight: 400; margin: 34px 0 8px; }
.auth-sub { color: var(--muted); margin: 0 0 28px; }
.auth-foot { color: var(--dim); font-size: 12px; margin-top: 34px; text-align: center; }
.center { text-align: center; }

.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.tabs button { position: relative; z-index: 1; border: 0; background: transparent; padding: 10px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: color .3s; }
.tabs button.on { color: var(--inv-fg); }
.tabs-glider { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px; background: var(--inv-bg); transition: transform .45s var(--ease); }
.tabs[data-mode="register"] .tabs-glider { transform: translateX(100%); }

.tg-block { min-height: 52px; }
.tg-widget { display: flex; justify-content: center; min-height: 0; }
.tg-widget iframe { border-radius: 14px; }
.tg-fallback { height: 52px; border-radius: var(--radius-sm); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin: 26px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 52px; }
.pass-toggle { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--dim); cursor: pointer; display: grid; place-items: center; }
.pass-toggle:hover { color: var(--text); background: var(--surface-2); }
#authForm .hint { margin: 14px 0 0; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-logo { display: inline-flex; }
  .auth-card h1 { margin-top: 28px; }
}

/* ============ Dashboard ============ */
.dash { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 18px; display: flex; flex-direction: column; gap: 36px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(130,110,255,.06), transparent 40%), var(--bg-side);
}
.sidebar > .logo { padding: 0 10px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 500; font-size: 15px; transition: background .2s, color .2s; }
.side-nav a svg { width: 19px; height: 19px; flex: none; }
.side-nav a:hover { color: var(--text); background: var(--surface-2); }
.side-nav a.on { color: var(--text); background: rgba(var(--fg-rgb), .06); box-shadow: inset 0 0 0 1px var(--border); }
.side-nav a.on svg { color: var(--accent); }
.side-bottom { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.side-bottom .side-user { flex: 1; min-width: 0; }
.auth-main { position: relative; }
.auth-theme { position: absolute; top: 24px; right: 24px; }
.side-user { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-family: var(--display); font-size: 15px; color: #fff; background: linear-gradient(145deg, #4b3fbf, #17123f); box-shadow: 0 0 0 1px rgba(182,166,255,.3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { min-width: 0; display: grid; }
.who b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-main { padding: 44px clamp(20px, 4vw, 56px) 80px; min-width: 0; position: relative; }
.dash-main::before { content: ''; position: absolute; inset: 0 0 auto; height: 400px; pointer-events: none; background: radial-gradient(50% 100% at 70% 0%, rgba(130,110,255,.1), transparent 70%); }
.view { position: relative; animation: viewIn .5s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.dash-head h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 400; margin-top: 14px; }
.muted { color: var(--dim); font-weight: 400; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat { padding: 22px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.stat span { color: var(--dim); font-size: 13px; }
.stat b { display: block; margin-top: 8px; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }
.stat b.sm { font-size: 18px; padding-top: 8px; }
.stat b small { font-family: var(--font); font-size: 13px; color: var(--dim); }

.server-list { display: grid; gap: 16px; }
.srv { padding: 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
.srv.flagship { border-color: rgba(233,207,152,.3); background: radial-gradient(80% 60% at 100% 0%, rgba(233,207,152,.08), transparent 60%), var(--card); }
.srv.flagship .meter i { background: var(--grad-gold); }
.srv-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.srv-id { display: flex; align-items: center; gap: 14px; }
.srv-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); }
.srv-icon .flag { width: 24px; height: 16px; }
.srv h3 { font-size: 18px; font-weight: 500; }
.srv-id .muted { font-size: 13px; }
.srv-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 24px 0 0; padding-top: 22px; border-top: 1px solid var(--border); }
.srv-meta span { display: block; color: var(--dim); font-size: 12px; margin-bottom: 4px; }
.srv-meta b { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.srv-meta .meter { margin: 10px 0 0; max-width: 140px; }
.srv-res { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.srv-res span { font-size: 12.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.pc-res { display: block; margin-top: 8px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.soon-exp { font-style: normal; font-size: 12px; color: var(--warn); }
.copy { border: 0; background: transparent; color: var(--dim); cursor: pointer; padding: 2px 4px; border-radius: 6px; font-size: 14px; }
.copy:hover { color: var(--text); background: var(--surface-2); }

.status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); background: rgba(110,231,168,.1); }
.status.warn { color: var(--warn); background: rgba(245,194,107,.1); }
.status.info { color: var(--accent-2); background: rgba(108,200,255,.1); }
.status.bad { color: var(--bad); background: rgba(255,122,133,.1); }
.status.ok::before { animation: live 2s infinite; }

.srv-note { margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.srv-note b { color: var(--text); font-weight: 600; }
.srv-note.warn { border-color: rgba(245,194,107,.25); background: rgba(245,194,107,.05); }
.srv-note.info { display: flex; align-items: center; gap: 12px; border-color: rgba(108,200,255,.25); background: rgba(108,200,255,.05); }
.srv-note .row { margin-top: 8px; }
.spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid rgba(108,200,255,.25); border-top-color: var(--accent-2); animation: spin 0.9s linear infinite; }

.srv-config { margin-top: 20px; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.cfg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.srv-config pre { margin: 0; padding: 16px; max-height: 220px; overflow: auto; font-size: 12.5px; line-height: 1.6; color: var(--code-fg); background: var(--code-bg); white-space: pre-wrap; word-break: break-all; }

.empty { text-align: center; padding: 80px 24px; border-radius: var(--radius); border: 1px dashed var(--border-2); background: var(--surface); }
.empty-orb { width: 90px; height: 90px; margin: 0 auto 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, #a99bff 12%, #3b2f9f 50%, #0b0920 100%); box-shadow: 0 0 60px rgba(124,108,255,.45); animation: float 6s ease-in-out infinite; }
.empty h3 { font-size: 22px; font-weight: 500; }
.empty p { color: var(--muted); max-width: 420px; margin: 10px auto 28px; }

/* Order */
.order-grid { display: grid; grid-template-columns: 1fr 360px; gap: 30px; align-items: start; }
.block-title { font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.block-title:not(:first-child) { margin-top: 34px; }
.choice { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .25s, background .25s, transform .3s var(--ease); }
.choice:hover { border-color: var(--border-2); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.on { border-color: rgba(182,166,255,.6); background: rgba(182,166,255,.07); box-shadow: 0 0 0 3px rgba(182,166,255,.1); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice b { display: block; font-weight: 600; }
.choice small { color: var(--dim); font-size: 13px; }
.loc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.order-grid > div { min-width: 0; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.plan-choice { flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 16px; }
.plan-choice:hover { transform: translateY(-3px); }
.pc-name { font-family: var(--display); font-size: 14px; min-height: 40px; }
.pc-name i { display: block; font-style: normal; font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pc-speed { font-family: var(--display); font-weight: 300; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -0.03em; line-height: 1.1; margin-top: 8px; }
.pc-speed small { display: block; font-family: var(--font); font-size: 12px; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.plan-choice .meter { width: 100%; margin: 8px 0; }
.pc-price { color: var(--muted); font-size: 13px; }
.plan-choice.flagship .pc-name i { color: var(--gold); }
.plan-choice.flagship .meter i { background: var(--grad-gold); }
.plan-choice.flagship.on { border-color: rgba(233,207,152,.6); background: rgba(233,207,152,.06); box-shadow: 0 0 0 3px rgba(233,207,152,.1); }
.period-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.summary { position: sticky; top: 30px; }
.sum-card { padding: 28px; border-radius: var(--radius); border: 1px solid var(--border-2); background: radial-gradient(100% 50% at 50% 0%, rgba(130,110,255,.14), transparent 70%), var(--bg-2); box-shadow: var(--shadow); }
.sum-card.flagship { border-color: rgba(233,207,152,.4); background: radial-gradient(100% 50% at 50% 0%, rgba(233,207,152,.12), transparent 70%), var(--bg-2); }
.sum-plan { font-family: var(--display); font-size: 30px; margin: 14px 0 20px; display: grid; }
.sum-plan span { font-family: var(--font); font-size: 14px; color: var(--muted); }
.sum-card ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; font-size: 14px; color: var(--muted); }
.sum-card li::before { content: '✦'; color: var(--accent); font-size: 10px; margin-right: 10px; }
.sum-card.flagship li::before { color: var(--gold); }
.sum-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.sum-row.ok span:last-child { color: var(--ok); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 22px; border-top: 1px solid var(--border); }
.sum-total b { font-family: var(--display); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }
.sum-card .hint { margin: 14px 0 0; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.panel { padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.panel .block-title { margin-top: 0; }
.panel .hint { margin: -4px 0 18px; }
.tg-linked { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; font-weight: 600; }
.btn.danger { color: var(--bad); border-color: rgba(255,122,133,.25); }
.btn.danger:hover { background: rgba(255,122,133,.08); }

@media (max-width: 1200px) {
  .order-grid { grid-template-columns: 1fr 320px; }
}
@media (max-width: 1000px) {
  .order-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .stats, .srv-meta { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(16px); overflow-x: auto; }
  .sidebar > .logo span, .sidebar > .logo b { display: none; }
  .sidebar > .logo { padding: 0; font-size: 0; }
  .side-nav { display: flex; gap: 2px; }
  .side-nav a { padding: 9px 12px; font-size: 13px; white-space: nowrap; }
  .side-nav a svg { display: none; }
  .side-user { display: none; }
  .side-bottom { margin: 0 0 0 auto; }
  .dash-main { padding-top: 28px; }
  .period-pick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .stat b { font-size: 24px; }
  .srv { padding: 20px; }
  .srv-top { flex-direction: column; align-items: flex-start; }
}

/* ============ Support tickets ============ */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--on-grad); background: var(--grad); }
.side-nav a { position: relative; }

.tk-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.tk-list { display: grid; gap: 8px; max-height: calc(100vh - 200px); overflow-y: auto; padding-right: 2px; }
.tk-none { padding: 28px 22px; border-radius: 18px; border: 1px dashed var(--border-2); color: var(--dim); font-size: 14px; text-align: center; }
.tk-item {
  display: grid; gap: 6px; width: 100%; text-align: left; padding: 16px 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, background .2s;
}
.tk-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.tk-item.on { border-color: rgba(182,166,255,.55); background: rgba(182,166,255,.07); }
.tk-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tk-item-top b { font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.tk-item .status { font-size: 11px; padding: 4px 9px; }
.tk-item.unread .tk-item-top b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; box-shadow: 0 0 10px var(--accent); }
.tk-preview { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-meta { color: var(--dim); font-size: 12px; }

.tk-pane { min-width: 0; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); min-height: 520px; display: flex; flex-direction: column; }
.tk-pane > * { flex: 1; }
.tk-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; }
.tk-empty h3 { font-size: 22px; font-weight: 500; }
.tk-empty p { color: var(--muted); max-width: 380px; margin: 10px auto 26px; }

.tk-pane-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.tk-pane-head h3 { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.tk-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tk-back { display: none; }

.tk-new { padding: 0 0 24px; }
.tk-new .field, .tk-new .row, .tk-new .form-error { margin-left: 24px; margin-right: 24px; }
.tk-new .tk-pane-head { margin-bottom: 22px; }
.tk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin: 0 24px; }
.tk-row .field { margin-left: 0; margin-right: 0; }
select.input { appearance: none; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a3a1ad' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 14px; }
select.input option { background: var(--bg-2); color: var(--text); }
.tk-textarea { height: auto; min-height: 52px; padding: 14px 18px; resize: vertical; line-height: 1.55; font-family: var(--font); }

.tk-thread { display: flex; flex-direction: column; min-height: 520px; max-height: calc(100vh - 200px); }
.tk-messages { flex: 1; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 10px; max-width: 80%; }
.msg.mine { align-self: flex-end; }
.msg-ava { width: 32px; height: 32px; flex: none; border-radius: 10px; overflow: hidden; }
.msg-bubble { padding: 12px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.msg.support .msg-bubble { border-top-left-radius: 6px; }
.msg.mine .msg-bubble { border-top-right-radius: 6px; background: linear-gradient(160deg, rgba(182,166,255,.2), rgba(108,200,255,.08)); border-color: rgba(182,166,255,.28); }
.msg-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; font-size: 12px; }
.msg-head b { font-weight: 600; font-size: 13px; }
.msg-head span { color: var(--dim); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.tk-wait { align-self: center; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); padding: 6px 14px; border-radius: 999px; background: var(--surface-2); }
.tk-wait .spinner { width: 14px; height: 14px; }
.tk-composer { flex: none; display: flex; gap: 10px; align-items: flex-end; padding: 16px 22px 6px; border-top: 1px solid var(--border); }
.tk-composer .tk-textarea { resize: none; max-height: 200px; }
.tk-composer .btn { flex: none; width: 52px; height: 52px; padding: 0; border-radius: 16px; }
.tk-hint { flex: none; margin: 0; padding: 0 22px 14px; font-size: 11.5px; }

@media (max-width: 1000px) {
  .tk-layout { grid-template-columns: 1fr; }
  .tk-list { max-height: none; }
  .tk-layout.pane-open .tk-list { display: none; }
  .tk-layout:not(.pane-open) .tk-pane { display: none; }
  .tk-layout:not(.pane-open) .tk-list:has(.tk-none) + .tk-pane { display: flex; }
  .tk-back { display: inline-flex; }
  .tk-thread { max-height: calc(100vh - 140px); }
}
@media (max-width: 560px) {
  .tk-row { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .tk-pane-head { flex-wrap: wrap; padding: 14px 16px; }
  .tk-messages { padding: 18px 14px; }
  .tk-composer { padding: 12px 14px 6px; }
  .tk-new .field, .tk-new .row, .tk-new .form-error, .tk-row { margin-left: 16px; margin-right: 16px; }
  .tk-row .field { margin-left: 0; margin-right: 0; }
}

/* ============ Balance in nav ============ */
.nav-amount { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.side-nav a.on .nav-amount { color: var(--muted); }

/* ============ Trial ============ */
.trial-banner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 26px 28px; margin-bottom: 20px; border-radius: var(--radius);
  border: 1px solid rgba(233,207,152,.35);
  background: radial-gradient(70% 140% at 0% 50%, rgba(233,207,152,.14), transparent 60%), var(--card);
}
.trial-orb { width: 64px; height: 64px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, #f3dfb0 14%, #b98e4e 55%, #2a1d08 100%); box-shadow: 0 0 40px rgba(233,207,152,.4); animation: float 6s ease-in-out infinite; }
.trial-text { flex: 1; min-width: 240px; }
.trial-text h3 { font-size: 20px; font-weight: 500; margin: 8px 0 6px; }
.trial-text p { margin: 0; color: var(--muted); font-size: 14px; }
.trial-text .eyebrow::before { background: linear-gradient(90deg, transparent, var(--gold)); }
.trial-tag { font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; color: var(--gold); background: rgba(233,207,152,.12); vertical-align: middle; }
.srv.trial { border-color: rgba(233,207,152,.25); }
.srv-top .row { flex-wrap: nowrap; }
.srv-note.bad { border-color: rgba(255,122,133,.25); background: rgba(255,122,133,.05); }
.sum-later { margin-top: 8px; }

/* ============ Modal ============ */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--backdrop); backdrop-filter: blur(8px); animation: fadeIn .25s; }
.modal-card {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 30px; border-radius: 26px; border: 1px solid var(--border-2);
  background: radial-gradient(100% 40% at 50% 0%, rgba(130,110,255,.14), transparent 70%), var(--bg-2);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.9); animation: modalIn .4s var(--ease);
}
.modal-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-x:hover { color: var(--text); background: rgba(var(--fg-rgb), .08); }
.modal-title { font-size: 28px; font-weight: 400; margin: 14px 0 4px; }
.modal-card > div > .hint { margin: 0 0 22px; }
.modal-periods { grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* ============ Billing ============ */
.billing-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: start; }
.balance-card {
  position: relative; overflow: hidden; padding: 32px; border-radius: var(--radius); min-height: 230px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--border-2);
  background: radial-gradient(90% 90% at 100% 0%, rgba(130,110,255,.32), transparent 60%), radial-gradient(60% 60% at 0% 100%, rgba(108,200,255,.12), transparent 70%), var(--bg-2);
}
.balance-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(var(--fg-rgb), .08); box-shadow: 0 0 0 30px rgba(var(--fg-rgb), .02), 0 0 0 60px rgba(var(--fg-rgb), .015); }
.balance-amount { font-family: var(--display); font-weight: 300; font-size: clamp(40px, 5vw, 58px); letter-spacing: -0.03em; line-height: 1; margin: 22px 0 18px; font-variant-numeric: tabular-nums; }
.balance-card .hint { margin: 0; }

.topup .block-title { margin-bottom: 16px; }
.amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.amount { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; transition: border-color .2s, background .2s; }
.amount:hover { border-color: var(--border-2); }
.amount.on { border-color: rgba(182,166,255,.6); background: rgba(182,166,255,.1); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.method { padding: 14px 16px; }
.method.disabled { opacity: .65; }
.soon-tag { margin-left: auto; align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; color: var(--accent); background: rgba(182,166,255,.12); }
.soon-note { margin-top: 16px; padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--border-2); display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.soon-note b { color: var(--text); font-weight: 600; }
.soon-note .btn { justify-self: start; margin-top: 6px; }

.tx-table { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.tx-row { display: grid; grid-template-columns: 40px 1fr auto 110px; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); background: rgba(var(--fg-rgb), .012); }
.tx-row:last-child { border-bottom: 0; }
.tx-row:hover { background: var(--surface-2); }
.tx-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.tx-ico.in { color: var(--ok); background: rgba(110,231,168,.1); }
.tx-main { display: grid; min-width: 0; }
.tx-main b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main span { font-size: 12.5px; color: var(--dim); }
.tx-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amount.in { color: var(--ok); }
.tx-after { text-align: right; color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ============ 2FA ============ */
.twofa-steps { margin: 0 0 18px; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.twofa-setup { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.qr { width: 196px; height: 196px; padding: 14px; border-radius: 18px; background: #fff; display: grid; place-items: center; flex: none; }
.qr img, .qr canvas { display: block; }
.qr .hint { color: #555; text-align: center; }
.twofa-secret { display: grid; gap: 8px; justify-items: start; }
.twofa-secret code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .06em; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); word-break: break-all; }
.twofa-form { display: flex; gap: 10px; max-width: 420px; margin-bottom: 4px; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: .3em; text-align: center; }
.twofa-form .code-input { font-size: 17px; }
.backup-codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.backup-codes code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; text-align: center; padding: 10px; border-radius: 10px; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--border); }

.shield-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: var(--accent); background: linear-gradient(145deg, rgba(182,166,255,.2), rgba(108,200,255,.06)); border: 1px solid rgba(182,166,255,.3); box-shadow: 0 0 40px rgba(130,110,255,.25); }
.shield-ico svg { width: 30px; height: 30px; }
#twoFactorStep h1 { margin-top: 26px; }
#codeForm .hint { margin: 14px 0; }

@media (max-width: 1000px) {
  .billing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .methods { grid-template-columns: 1fr; }
  .tx-row { grid-template-columns: 36px 1fr auto; padding: 14px 16px; gap: 12px; }
  .tx-after { display: none; }
  .backup-codes { grid-template-columns: repeat(2, 1fr); }
  .srv-top .row { flex-wrap: wrap; }
  .trial-banner { padding: 22px; }
  .modal-card { padding: 24px 20px; }
}
