/* Core VPN compact customer layer. Keep information; reduce repeated space. */
.telegram-client .stack:has(>.device-table-row){display:flex;flex-direction:column;gap:0;padding:4px 8px;border:1px solid var(--line);border-radius:18px;background:var(--surface);overflow:hidden}
.telegram-client .device-table-row{display:grid;grid-template-columns:minmax(0,1fr) 62px 44px 44px;align-items:center;gap:4px;padding:10px 4px;background:transparent;border:0;min-width:0}
.telegram-client .device-table-row+.device-table-row{border-top:1px solid color-mix(in srgb,var(--line) 55%,transparent)}
.telegram-client .device-table-name{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.telegram-client .device-table-name small{display:block;font-size:10px;color:var(--muted);font-weight:400}
.telegram-client .device-table-protocol{font-size:11px;color:var(--muted)}
.telegram-client .device-table-row .device-table-action{width:44px;height:44px;min-height:44px;max-width:44px;padding:0;display:grid;place-items:center;border-radius:12px;background:transparent;box-shadow:none;border:0}
.telegram-client .device-table-row .device-table-action:active{background:var(--soft)}
.telegram-client .device-table-action[aria-busy="true"] svg{opacity:.35}
.telegram-client .device-table-action svg{width:18px;height:18px}
.telegram-client {--radius:20px}
.telegram-client .app {
  width:min(100%,600px);
  padding-inline:max(18px,var(--app-safe-left,0px),env(safe-area-inset-left));
  padding-bottom:calc(96px + max(env(safe-area-inset-bottom),var(--app-safe-bottom,0px)));
}
.telegram-client .view {padding-top:max(8px,var(--app-safe-top,0px),env(safe-area-inset-top));padding-bottom:12px}
.telegram-client .screen-head {padding:16px 0 18px}
.telegram-client .screen-head h1,.telegram-client .keys-title {font-size:27px;line-height:1.16;letter-spacing:-.04em}
.telegram-client .screen-head p {margin-top:6px;font-size:13px;line-height:1.5}
.telegram-client .section {margin:0 0 18px}
.telegram-client .section-title {margin-bottom:9px;font-size:12px}
.telegram-client .section-toolbar {gap:10px;margin-bottom:12px}
.telegram-client .section-toolbar h2,.telegram-client .ticket-header h2 {font-size:19px}
.telegram-client .card,.telegram-client .form-card,.telegram-client .overview,.telegram-client .tariff-builder,.telegram-client .settings-form {padding:16px;border-radius:20px}
.telegram-client .group,.telegram-client .admin-list {border-radius:20px}
.telegram-client .stack,.telegram-client .plan-list {gap:10px}
.telegram-client .row {min-height:58px;padding:12px 16px;gap:10px}
.telegram-client .row-title {font-size:14px;line-height:1.4}
.telegram-client .row-sub,.telegram-client .plan-desc {font-size:12px;line-height:1.5}
.telegram-client .row-value {font-size:12px;max-width:48%}
.telegram-client .icon {width:32px;height:32px;flex-basis:32px;border-radius:11px}
.telegram-client .badge {padding:4px 7px;font-size:10px;border-radius:7px}
/* Same actions everywhere. Touch targets stay 44px even as the visual UI shrinks. */
.telegram-client .button,.telegram-client .topup-grid button,.telegram-client .subscription-strip>button,.telegram-client .row-actions button,.telegram-client .status-controls button,.telegram-client .dialog-actions button,.telegram-client .issued-code button {
  min-height:44px;padding:10px 15px;gap:7px;border-radius:13px;font-size:13px;line-height:1.35;
}
.telegram-client .button svg {width:17px;height:17px;flex-basis:17px}
.telegram-client .grid2,.telegram-client .form-actions,.telegram-client .status-controls {gap:8px}
.telegram-client .button:disabled {cursor:default;opacity:.45}
.telegram-client .field {gap:6px;margin-bottom:14px}
.telegram-client .field label {font-size:12px}
.telegram-client .field input,.telegram-client .field select,.telegram-client .field textarea,.telegram-client .custom-topup input,.telegram-client .search-field input,.telegram-client .search-field select,.telegram-client .reply-box textarea {
  min-height:46px;padding:11px 13px;border-radius:13px;font-size:16px;line-height:1.4;
}
.telegram-client .field textarea {min-height:100px}
.telegram-client .form-hint {font-size:12px;line-height:1.5}
.telegram-client button:focus-visible,.telegram-client a:focus-visible,.telegram-client summary:focus-visible,.telegram-client input:focus-visible,.telegram-client textarea:focus-visible,.telegram-client select:focus-visible {
  outline:3px solid color-mix(in srgb,var(--blue) 55%,transparent);outline-offset:3px;
}
/* Home: retain the logo and real Telegram photo, with a smaller hero footprint. */
.telegram-client .studio-header {padding:10px 0 18px;gap:12px}
.telegram-client .studio-header .profile-avatar.mini {width:32px;height:32px;flex-basis:32px}
.telegram-client .studio-header .studio-identity {gap:8px}
.telegram-client .studio-header .studio-identity b {font-size:12px;max-width:180px}
.telegram-client .studio-hello {font-size:10px;margin-bottom:1px}
.telegram-client .studio-hero {padding:2px 0 18px}
.telegram-client .studio-orb,.telegram-client .studio-orb .core-brand-hero {width:76px;height:76px}
.telegram-client .studio-orb {margin:0 auto 10px;background:transparent;border:0;box-shadow:none}
.telegram-client .studio-hero .studio-state {margin:4px 0 12px;font-size:11px;gap:6px}
.telegram-client .studio-hero h1 {font-size:29px;line-height:1.12;max-width:17ch;margin-bottom:9px;letter-spacing:-.045em}
.telegram-client .studio-hero p {font-size:12px;line-height:1.55;max-width:37ch}
.telegram-client .studio-hero .studio-primary {min-height:46px;max-width:330px;margin-top:16px}
.telegram-client .studio-hero-note {font-size:10px;line-height:1.5;margin-top:10px;max-width:42ch}
.telegram-client .studio-term {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px;padding:13px 2px;border-block:1px solid var(--line)}
.telegram-client .studio-term>span {color:var(--muted);font-size:12px}
.telegram-client .studio-term>strong {font-size:13px;font-weight:650;line-height:1.4;text-align:right;font-variant-numeric:tabular-nums}
.telegram-client .studio-balance {padding:16px;border-radius:20px;margin-bottom:18px}
.telegram-client .studio-balance-top {gap:10px;font-size:12px}
.telegram-client .studio-money {font-size:30px;line-height:1.2;margin:6px 0 4px}
.telegram-client .studio-wallet-symbol {width:32px;height:32px}
.telegram-client .studio-wallet-symbol svg {width:18px;height:18px}
.telegram-client .studio-wallet-note {font-size:11px;line-height:1.5}
.telegram-client .studio-topup {margin-top:14px}
.telegram-client .studio-topup summary {min-height:44px;padding:10px 15px;font-size:13px;line-height:1.35;border-radius:13px}
.telegram-client .studio-topup[open] summary {margin-bottom:12px}
.telegram-client .studio-topup-content label {font-size:11px;margin-top:12px}
.telegram-client .studio-topup .home-topups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.telegram-client .studio-topup .home-topups button{min-width:0;padding-inline:6px;white-space:nowrap}
.telegram-client .studio-account {border-radius:20px}
.telegram-client .studio-account>.studio-section-head {padding:14px 16px 12px}
.telegram-client .studio-section-head h2,.telegram-client .studio-account>.studio-section-head h2 {font-size:14px}
.telegram-client .studio-section-head>span {font-size:11px}
.telegram-client .studio-account .row {min-height:62px}
.telegram-client .studio-help-card {min-height:64px;padding:14px 16px;margin-top:12px;gap:10px;border-radius:20px}
.telegram-client .studio-help-card b {font-size:13px}
.telegram-client .studio-help-card small {font-size:11px;line-height:1.45}
.telegram-client .studio-help-card>svg {width:19px;height:19px;flex-basis:19px}
/* Devices and legacy profile pages. */
.telegram-client .subscription-strip,.telegram-client .vip-strip {min-height:64px;padding:13px 16px;border-radius:18px;gap:12px}
.telegram-client .subscription-strip b {font-size:15px}
.telegram-client .subscription-strip span {font-size:11px}
.telegram-client .subscription-strip>button {min-height:44px;padding:9px 13px;font-size:12px}
.telegram-client .device-card {padding:16px;border-radius:20px}
.telegram-client .device-card-head {gap:10px;align-items:center}
.telegram-client .device-symbol {width:34px;height:34px;flex-basis:34px;border-radius:11px}
.telegram-client .device-symbol svg {width:19px;height:19px}
.telegram-client .device-meta h3 {font-size:14px;line-height:1.35}
.telegram-client .device-meta p {font-size:11px;margin-top:2px}
.telegram-client .device-card .device-time-left {margin-top:10px;font-size:11px;line-height:1.45}
.telegram-client .device-limit {font-size:11px;line-height:1.45;margin-top:5px}
.telegram-client .device-limit span {margin-top:2px}
.telegram-client .device-limit b {font-size:10px;letter-spacing:.025em}
.telegram-client .device-actions {gap:8px;margin-top:12px;grid-template-columns:minmax(0,1fr) auto}
.telegram-client .device-actions .button {min-height:44px;padding:10px 12px;font-size:12px}
.telegram-client .device-actions .button svg {width:16px;height:16px;flex-basis:16px}
.telegram-client .profile-head {padding:22px 16px!important}
.telegram-client .profile-head>.profile-avatar {width:56px;height:56px;margin-bottom:9px;font-size:22px}
.telegram-client .profile-name {font-size:22px}
.telegram-client .profile-user {font-size:12px}
.telegram-client .status-card,.telegram-client .status-card.is-vip {padding:18px;border-radius:20px}
.telegram-client .status-card h2 {font-size:24px}
.telegram-client .status-card p {font-size:13px}
.telegram-client .status-grid {margin:18px 0}
.telegram-client .status-grid>div {padding:12px 8px}
.telegram-client .status-grid b {font-size:12px}
.telegram-client .overview-icon {width:38px;height:38px;flex-basis:38px;border-radius:13px}
.telegram-client .vpn-no-plan {padding:22px 18px;border-radius:20px}
.telegram-client .vpn-no-plan h2 {font-size:21px}
.telegram-client .vpn-no-plan p {font-size:13px}
/* A real segmented switch rather than two outsized standalone buttons. */
.telegram-client .protocol-picker {margin-bottom:14px}
.telegram-client .protocol-picker .section-title {font-size:12px;margin-bottom:8px}
.telegram-client .protocol-switch,.telegram-client .protocol-switch.compact {padding:4px;gap:3px;border-radius:16px;background:var(--bg);border-color:var(--line)}
.telegram-client .protocol-option,.telegram-client .protocol-switch.compact .protocol-option {min-height:44px;padding:9px 12px;border-radius:12px;line-height:1.3;box-shadow:none}
.telegram-client .protocol-option b {font-size:13px;line-height:1.4;font-weight:650}
.telegram-client .protocol-option.active {background:var(--surface);color:var(--blue);box-shadow:0 1px 4px rgba(0,0,0,.06)}
.telegram-client .vip-protocol-field {padding:10px;border-radius:15px;background:var(--bg)}
.telegram-client .tariff-builder {padding:18px}
.telegram-client .period-single {min-height:27px;padding:4px 10px;margin-bottom:18px;font-size:11px}
.telegram-client .control-head {font-size:13px;gap:10px}
.telegram-client .control-head b {min-width:38px;height:38px;border-radius:12px;font-size:21px}
.telegram-client .device-range {display:block;width:100%;height:6px;margin:19px 0 10px;border-radius:999px;cursor:pointer}
.telegram-client .device-range::-webkit-slider-thumb {width:26px;height:26px;border:4px solid var(--surface);background:#246bfe;box-shadow:0 1px 6px rgba(0,0,0,.2)}
.telegram-client .device-range::-moz-range-thumb {width:18px;height:18px;border:4px solid var(--surface);background:#246bfe;box-shadow:0 1px 6px rgba(0,0,0,.2)}
.telegram-client .range-ticks {margin-top:6px;gap:0}
.telegram-client .range-ticks button {min-height:44px;padding:0;border-radius:9px;font-size:11px}
.telegram-client .tariff-summary {padding:18px 0;margin:12px 0;gap:12px}
.telegram-client .tariff-summary strong {font-size:27px;line-height:1.2}
.telegram-client .tariff-summary b {font-size:17px}
.telegram-client .tariff-summary span {font-size:11px}
.telegram-client .tariff-balance {margin:14px 0;font-size:13px}
.telegram-client .tariff-state-note,.telegram-client .balance-billing-state {font-size:11px;line-height:1.5;margin:10px 0}
.telegram-client .openvpn-plan-copy {gap:5px;margin:14px 0}
.telegram-client .openvpn-plan-copy b {font-size:15px}
.telegram-client .openvpn-plan-copy span {font-size:12px;line-height:1.5}
.telegram-client .subscription-stop {margin-top:16px!important}
.telegram-client .subscription-stop p {font-size:11px;margin-inline:0}
.telegram-client .wallet-card,.telegram-client .wallet-card.compact {padding:18px;border-radius:20px}
.telegram-client .wallet-card strong {font-size:32px}
.telegram-client .wallet-card small {font-size:11px}
.telegram-client .topup-grid,.telegram-client .custom-topup {gap:8px}
.telegram-client .custom-topup {grid-template-columns:minmax(0,1fr) auto}
.telegram-client .custom-topup .button {padding-inline:14px}
/* Warnings and instructions remain readable and present. */
.telegram-client .info-note,.telegram-client .vip-note,.telegram-client .protocol-warning,.telegram-client .guide-note,.telegram-client .tariff-state-note.warning {padding:11px 13px;border-radius:13px;font-size:11px;line-height:1.55}
.telegram-client .studio-guide {margin-top:18px;border-radius:18px}
.telegram-client .studio-guide>summary {min-height:66px;padding:14px 16px;gap:10px}
.telegram-client .studio-guide>summary b {font-size:14px}
.telegram-client .studio-guide>summary small {font-size:11px;margin-top:3px}
.telegram-client .studio-guide-icon {width:30px;height:30px;flex-basis:30px;border-radius:10px}
.telegram-client .studio-guide-icon svg {width:17px;height:17px}
.telegram-client .studio-guide>.vpn-help {padding:14px 14px 16px}
.telegram-client .guide-intro,.telegram-client .guide-warning {padding:14px;border-radius:16px;gap:5px}
.telegram-client .guide-intro b,.telegram-client .guide-warning b {font-size:14px}
.telegram-client .guide-intro span,.telegram-client .guide-warning span {font-size:12px;line-height:1.55}
.telegram-client .client-grid {gap:8px;margin-top:10px}
.telegram-client .client-card {padding:12px;gap:10px;border-radius:16px}
.telegram-client .client-card b {font-size:13px}
.telegram-client .client-card span {font-size:11px}
.telegram-client .client-logo {width:36px;height:36px;border-radius:11px;font-size:17px}
.telegram-client .client-card .button {min-height:44px;padding:9px 12px;font-size:12px}
.telegram-client .guide-details {margin-top:8px;border-radius:16px}
.telegram-client .guide-details summary {min-height:62px;padding:14px 38px 14px 14px}
.telegram-client .guide-details summary:after {top:20px;right:14px;font-size:19px}
.telegram-client .guide-details summary span {font-size:13px}
.telegram-client .guide-details summary small {font-size:11px}
.telegram-client .guide-body {padding:0 14px 14px}
.telegram-client .guide-body li {font-size:12px;line-height:1.65;margin-bottom:10px}
.telegram-client .guide-shots {gap:5px}
.telegram-client .guide-shot {min-height:110px;border-radius:12px}
.telegram-client .platform-list h4 {font-size:13px}
.telegram-client .platform-list p {font-size:12px;line-height:1.55}
/* Support, ticket details and legal screens. */
.telegram-client .support-list {margin-top:18px}
.telegram-client .ticket-row {min-height:62px;padding:12px 16px;gap:10px}
.telegram-client .ticket-row:first-child {border-top-left-radius:19px;border-top-right-radius:19px}
.telegram-client .ticket-row:last-child {border-bottom-left-radius:19px;border-bottom-right-radius:19px}
.telegram-client .ticket-header,.telegram-client .ticket-meta {gap:10px;margin-bottom:14px}
.telegram-client .chat-thread {padding:12px;gap:9px;border-radius:18px}
.telegram-client .chat-message {padding:10px 13px;font-size:13px;line-height:1.55;border-radius:16px 16px 4px 16px}
.telegram-client .chat-message.support {border-radius:16px 16px 16px 4px}
.telegram-client .reply-box {gap:8px}
.telegram-client .reply-box textarea {min-height:76px;max-height:180px}
.telegram-client .empty {padding:24px 18px;font-size:13px;line-height:1.6}
.telegram-client .legal-sheet {border:1px solid var(--line);border-radius:20px}
.telegram-client .legal-sheet section {padding:14px 16px}
.telegram-client .legal-sheet h2 {font-size:15px;line-height:1.4}
.telegram-client .legal-sheet p {font-size:12px;line-height:1.65}
.telegram-client .back-link {min-height:44px;margin:0 0 8px;padding:10px 0;font-size:13px}
/* Login and error gates also use the same density. Preserve the brand image. */
.telegram-client .gate {padding:18px;min-height:100dvh}
.telegram-client .gate-card,.telegram-client .access-gate {padding:22px 18px;border:1px solid var(--line);border-radius:22px}
.telegram-client .gate-card h1 {font-size:24px}
.telegram-client .gate-card p,.telegram-client .access-gate>p {font-size:12px;line-height:1.6;margin:8px 0 16px}
.telegram-client .access-gate h2 {font-size:21px}
.telegram-client .access-gate .access-lock {width:44px;height:44px;margin-bottom:10px}
.telegram-client .access-legal {padding:12px;margin-bottom:14px;border-radius:16px}
.telegram-client .access-legal>strong {font-size:13px}
.telegram-client .access-legal>span {font-size:11px;line-height:1.5}
.telegram-client .access-legal button {min-height:44px;padding:10px 12px;border-radius:12px;font-size:12px}
.telegram-client .access-help,.telegram-client .gate-note {font-size:11px;line-height:1.55}
.telegram-client .dialog {padding:18px 14px}
.telegram-client .dialog-card {width:min(100%,420px);padding:20px;border-radius:24px;max-height:calc(100dvh - 36px)}
.telegram-client .dialog-card h2 {font-size:21px}
.telegram-client .dialog-card h3 {font-size:17px}
.telegram-client .dialog-actions {bottom:-20px;margin:18px -20px -20px;padding:14px 20px 20px;gap:8px}
.telegram-client .toast {bottom:calc(90px + env(safe-area-inset-bottom));padding:11px 15px;border-radius:16px;font-size:12px}
/* Lower, quieter navigation. Still four/five equal, 44px-safe controls. */
.telegram-client .tabbar {width:min(calc(100% - 28px),552px);padding:5px;border-radius:24px;bottom:max(10px,env(safe-area-inset-bottom),var(--app-safe-bottom,0px))}
.telegram-client .tab {min-height:48px;padding:6px 2px;gap:3px;border-radius:16px;font-size:10px}
.telegram-client .tab-icon {width:19px;height:19px}
@media(min-width:760px) {
  .telegram-client body {padding-top:12px}
  .telegram-client .app {min-height:calc(100dvh - 12px)}
  .telegram-client .studio-header {padding-top:12px}
  .telegram-client .studio-hero h1 {font-size:31px}
  .telegram-client .studio-hero {padding-top:6px}
}
@media(max-width:430px) {
  .telegram-client .app {padding-inline:max(16px,var(--app-safe-left,0px),env(safe-area-inset-left))}
  .telegram-client .studio-header .studio-identity b {max-width:145px}
  .telegram-client .custom-topup {grid-template-columns:1fr}
  .telegram-client .client-card {grid-template-columns:36px minmax(0,1fr)}
  .telegram-client .client-card .button {grid-column:1/-1;width:100%}
  .telegram-client .device-actions {grid-template-columns:minmax(0,1fr) auto}
}
@media(max-width:370px) {
  .telegram-client .app {padding-inline:14px}
  .telegram-client .studio-header .studio-identity b {max-width:105px}
  .telegram-client .studio-hero h1 {font-size:27px}
  .telegram-client .studio-orb,.telegram-client .studio-orb .core-brand-hero {width:68px;height:68px}
  .telegram-client .studio-money {font-size:28px}
  .telegram-client .device-actions {grid-template-columns:1fr}
  .telegram-client .device-card-head {gap:8px}
  .telegram-client .device-card .badge {white-space:normal;text-align:center;max-width:75px}
  .telegram-client .tariff-summary strong {font-size:24px}
  .telegram-client .tariff-summary b {font-size:15px}
  .telegram-client .tab {font-size:9px}
  .telegram-client .row-value {max-width:44%}
}
@media(prefers-reduced-motion:reduce) {
  .telegram-client *,.telegram-client *::before,.telegram-client *::after {animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
@media(prefers-reduced-transparency:reduce) {
  .telegram-client .tabbar {background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none}
}
#app #tabbar.studio-nav {display:flex;align-items:stretch;gap:10px;padding:0;background:transparent;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
#app #tabbar .nav-main {display:grid;flex:1;min-width:0;padding:5px;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:0 8px 30px rgba(12,18,28,.06)}
#app #tabbar .nav-profile {flex:0 0 68px;margin:0;padding:10px 3px;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:0 8px 30px rgba(12,18,28,.06)}
#app #tabbar .nav-profile.active {background:var(--soft);color:var(--blue)}
#app #tabbar .tab {gap:5px;justify-content:center;align-items:center;color:var(--muted);font-weight:550}
#app #tabbar .tab.active {color:var(--blue)}
#app #tabbar .tab-icon {display:block;width:23px;height:23px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
#app #tabbar .tab span {font-size:10px;line-height:1.2;letter-spacing:0}
#app .vpn-plan-empty {display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;margin:18px 0 24px;padding:28px 22px;border:1px solid var(--line);border-radius:24px;background:var(--surface)}
#app .vpn-plan-empty-icon {display:grid;place-items:center;width:56px;height:56px;border-radius:18px;background:var(--soft);color:var(--blue)}
#app .vpn-plan-empty-icon svg {width:30px;height:30px}
#app .vpn-plan-empty h2 {margin:0;font-size:22px;letter-spacing:-.03em}
#app .vpn-plan-empty p {margin:0 0 8px;max-width:300px;color:var(--muted);font-size:14px;line-height:1.6}
#app .vpn-plan-empty .button {max-width:320px}
@media(forced-colors:active) {
  .telegram-client .button,.telegram-client .protocol-option,.telegram-client .device-range,.telegram-client .card {border:1px solid CanvasText}
}
