/* ==========================================================================
   Zorix — Cabinet shell (open-world control center)
   Scope: #cabinet-screen only. Login layer stays in login-openworld.css.
   ========================================================================== */

:root {
  --cs-bg: #06070c;
  --cs-bg-2: #0a0e18;
  --cs-panel: rgba(12, 16, 28, 0.88);
  --cs-panel-border: rgba(62, 140, 255, 0.16);
  --cs-panel-border-hi: rgba(180, 80, 255, 0.22);
  --cs-blue: #3a8cff;
  --cs-blue-soft: #5aa8ff;
  --cs-violet: #9b5cff;
  --cs-magenta: #c44bff;
  --cs-green: #3ee08a;
  --cs-text: #eef2ff;
  --cs-muted: rgba(190, 200, 230, 0.62);
  --cs-muted-2: rgba(160, 170, 205, 0.45);
  --cs-hud: rgba(58, 140, 255, 0.12);
  --cs-radius: 16px;
  --cs-radius-sm: 12px;
  --cs-touch: 44px;
}

/* ---- Stage when cabinet is visible ---- */
html:has(#cabinet-screen:not(.hidden)),
html:has(#cabinet-screen:not(.hidden)) body {
  background: var(--cs-bg) !important;
  background-color: var(--cs-bg) !important;
  min-height: 100dvh;
}

body:has(#cabinet-screen:not(.hidden)) {
  position: relative;
}

body:has(#cabinet-screen:not(.hidden))::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(26, 80, 180, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 40% at 88% 18%, rgba(140, 50, 200, 0.12), transparent 65%),
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(20, 40, 90, 0.35), transparent 70%),
    linear-gradient(180deg, #070910 0%, #06070c 45%, #08060f 100%);
}

body:has(#cabinet-screen:not(.hidden)) .wrap,
body:has(#cabinet-screen:not(.hidden)) #cabinet-screen {
  position: relative;
  z-index: 1;
}

#cabinet-screen {
  color: var(--cs-text);
  max-width: 920px;
  margin: 0 auto;
}

/* ---- Header ---- */
#cabinet-screen .cabinet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  margin-bottom: 8px;
  padding: 12px 0 10px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 14, 0.94);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#cabinet-screen .cabinet-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

#cabinet-screen .cabinet-brand .logo-wrap {
  display: block;
  line-height: 0;
}

#cabinet-screen .cabinet-brand .logo {
  height: 34px;
  width: auto;
  display: block;
}

#cabinet-screen .cabinet-user.who,
#cabinet-screen .cabinet-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

#cabinet-screen .cabinet-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

#cabinet-screen .cabinet-user .brand-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
}

#cabinet-screen #who-name,
#cabinet-screen .who-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #f2f4f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
}

#cabinet-screen #who-sub,
#cabinet-screen .who-sub {
  font-size: 11px;
  line-height: 1.2;
  color: rgba(160, 168, 180, 0.72);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 450;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
  opacity: 1;
}

#cabinet-screen .cabinet-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#cabinet-screen .cabinet-support-btn,
#cabinet-screen .cabinet-head .icon-btn,
#cabinet-screen .cabinet-head .logout-text-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  box-sizing: border-box;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(190, 198, 210, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  font: inherit;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

#cabinet-screen .cabinet-support-btn:hover,
#cabinet-screen .cabinet-head .icon-btn:hover,
#cabinet-screen .cabinet-support-btn:focus-visible,
#cabinet-screen .cabinet-head .icon-btn:focus-visible {
  color: #f2f4f7;
  border-color: rgba(55, 95, 160, 0.45);
  background: rgba(40, 70, 120, 0.18);
  outline: none;
  box-shadow: none;
}

#cabinet-screen .cabinet-support-btn:active,
#cabinet-screen .cabinet-head .icon-btn:active {
  background: rgba(40, 70, 120, 0.24);
}

#cabinet-screen .cabinet-support-btn svg,
#cabinet-screen .cabinet-head .icon-btn svg,
#cabinet-screen .cabinet-head .logout-text-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

#cabinet-screen .cabinet-head .logout-text-btn {
  color: rgba(190, 198, 210, 0.78);
  width: 34px;
  min-width: 34px;
  padding: 0;
  text-decoration: none;
  opacity: 1;
  letter-spacing: 0;
  font-size: 0;
}

#cabinet-screen .cabinet-head .logout-text-btn:hover,
#cabinet-screen .cabinet-head .logout-text-btn:active,
#cabinet-screen .cabinet-head .logout-text-btn:focus-visible {
  color: #e07070;
  text-decoration: none;
  border-color: rgba(180, 70, 70, 0.35);
  background: rgba(160, 50, 50, 0.10);
  outline: none;
  box-shadow: none;
}

/* ---- Account drawer ---- */
/* ---- Account details: compact secondary accordion ---- */
#cabinet-screen #profile-details,
#cabinet-screen .profile-details {
  margin: 0 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  box-shadow: none;
}

#cabinet-screen #profile-details > summary,
#cabinet-screen .profile-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 6px 0;
  min-height: 32px;
  font-size: 13px;
  font-weight: 500;
  color: #9aa0a8;
  user-select: none;
  letter-spacing: 0.01em;
  border: none;
  background: transparent;
}

#cabinet-screen #profile-details > summary::-webkit-details-marker,
#cabinet-screen .profile-details > summary::-webkit-details-marker { display: none; }

#cabinet-screen #profile-details > summary::after,
#cabinet-screen .profile-details > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  flex-shrink: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  float: none;
  transition: transform 0.22s ease;
}

#cabinet-screen #profile-details[open] > summary::after,
#cabinet-screen .profile-details[open] > summary::after {
  content: "";
  transform: rotate(45deg);
}

#cabinet-screen #profile-details::details-content {
  overflow: hidden;
  transition: height 0.28s ease, content-visibility 0.28s allow-discrete;
}

@supports (interpolate-size: allow-keywords) {
  #cabinet-screen #profile-details {
    interpolate-size: allow-keywords;
  }
  #cabinet-screen #profile-details:not([open])::details-content {
    height: 0;
  }
  #cabinet-screen #profile-details[open]::details-content {
    height: auto;
  }
}

#cabinet-screen #profile-details #profile-box,
#cabinet-screen #profile-details .profile-details-body,
#cabinet-screen .profile-details-body {
  padding: 2px 0 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#cabinet-screen #profile-box .kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

#cabinet-screen #profile-box .kv:last-child { border-bottom: none; }

#cabinet-screen #profile-box .kv .k {
  color: #8b919c;
  font-weight: 400;
  flex-shrink: 0;
}

#cabinet-screen #profile-box .kv .v {
  color: #e6e8eb;
  font-weight: 500;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cabinet-screen #profile-box .kv .v.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.05em;
  font-size: 12.5px;
}

#cabinet-screen #profile-box .kv-code .v-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

#cabinet-screen #profile-box .code-toggle {
  appearance: none;
  border: none;
  background: transparent;
  color: #8b919c;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  line-height: 1.2;
}

#cabinet-screen #profile-box .code-toggle:hover,
#cabinet-screen #profile-box .code-toggle:focus-visible {
  color: #c8cdd6;
  outline: none;
}

/* ---- Desktop tabs ---- */
/* ---- Top cabinet tabs: flat text + deep-blue underline ---- */
#cabinet-screen .cabinet-tabs {
  --cs-tab-gap: 28px;
  --cs-tab-ink: #8b919c;
  --cs-tab-ink-hover: #c8cdd6;
  --cs-tab-ink-active: #ffffff;
  --cs-tab-accent: #1e4fd6;
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--cs-tab-gap);
  margin: 4px 0 20px;
  padding: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

#cabinet-screen .cabinet-tabs::-webkit-scrollbar { display: none; }

#cabinet-screen .cabinet-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  appearance: none;
  border: none;
  margin: 0;
  padding: 12px 2px 14px;
  border-radius: 0;
  background: transparent;
  color: var(--cs-tab-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  box-shadow: none;
  outline: none;
  transition: color 0.22s ease;
}

#cabinet-screen .cabinet-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 1px;
  background: var(--cs-tab-accent);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.22s ease;
}

#cabinet-screen .cabinet-tab:hover {
  color: var(--cs-tab-ink-hover);
  background: transparent;
  box-shadow: none;
}

#cabinet-screen .cabinet-tab:focus {
  outline: none;
  box-shadow: none;
}

#cabinet-screen .cabinet-tab:focus-visible {
  color: var(--cs-tab-ink-active);
}

#cabinet-screen .cabinet-tab.active {
  color: var(--cs-tab-ink-active);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}

#cabinet-screen .cabinet-tab.active::after {
  transform: scaleX(1);
  opacity: 1;
}

@media (max-width: 900px) {
  #cabinet-screen .cabinet-tabs {
    --cs-tab-gap: 18px;
    margin: 2px 0 16px;
  }

  #cabinet-screen .cabinet-tab {
    font-size: 13px;
    padding: 10px 2px 12px;
  }
}

/* ---- Home layout (one surface, no nested frames / HUD) ---- */
#cabinet-screen #tab-home .cs-home-panel.home-status {
  display: block;
  background: #0e1118;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 26px 24px 20px;
  margin-bottom: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
}

#cabinet-screen #tab-home .cs-home-panel.home-status::before {
  display: none;
}


#cabinet-screen #tab-home .cs-home-body {
  display: grid;
  gap: 28px;
}

#cabinet-screen #tab-home .cs-home-left,
#cabinet-screen #tab-home .cs-home-right,
#cabinet-screen #tab-home .cs-home-traffic {
  min-width: 0;
}

#cabinet-screen #tab-home #home-status-hud,
#cabinet-screen #tab-home .cs-hud-label {
  display: none !important;
}

/* Mobile: hide desktop-only chrome */
#cabinet-screen #tab-home .cs-home-eyebrow {
  display: none;
}

#cabinet-screen #tab-home .cs-home-gauge {
  display: contents;
}

#cabinet-screen #tab-home .cs-home-ring {
  display: none;
}

#cabinet-screen #tab-home .cs-home-gauge-core {
  display: contents;
}

#cabinet-screen #tab-home .cs-home-submeta {
  display: contents;
}

#cabinet-screen #tab-home .cs-home-renew-prompt {
  display: none;
}

#cabinet-screen #tab-home .cs-home-quiet-row {
  display: grid;
  gap: 8px;
}

#cabinet-screen #tab-home #home-status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(190, 198, 214, 0.72);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

#cabinet-screen #tab-home #home-status-label.is-active {
  color: #3dcf86;
}

#cabinet-screen #tab-home #home-status-label.is-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3dcf86;
  flex-shrink: 0;
  box-shadow: none;
}

#cabinet-screen #tab-home #home-status-label.is-inactive {
  color: rgba(190, 198, 214, 0.55);
}

#cabinet-screen #tab-home .home-status-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#cabinet-screen #tab-home .home-days-num {
  font-size: 56px;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #f4f6fa;
}

#cabinet-screen #tab-home .home-days-unit {
  font-size: 16px;
  color: rgba(180, 190, 210, 0.62);
  font-weight: 500;
}

#cabinet-screen #tab-home .home-until {
  font-size: 13px;
  color: rgba(160, 170, 190, 0.55);
  margin: 0 0 18px;
  font-family: inherit;
  font-weight: 450;
}

#cabinet-screen #tab-home .home-meter {
  margin-bottom: 0;
}

#cabinet-screen #tab-home .home-meter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: rgba(180, 190, 210, 0.58);
  font-weight: 550;
}

#cabinet-screen #tab-home .home-meter-label strong {
  color: rgba(235, 240, 248, 0.92);
  font-weight: 600;
}

#cabinet-screen #tab-home .home-days-meter-label {
  display: none;
}

#cabinet-screen #tab-home .cs-home-traffic-kicker {
  font-size: 12.5px;
  font-weight: 550;
  color: rgba(180, 190, 210, 0.58);
  letter-spacing: 0;
  text-transform: none;
}

#cabinet-screen #tab-home .cs-home-traffic-kicker::first-letter {
  /* keep mobile label casing via content override below */
}

#cabinet-screen #tab-home .cs-home-traffic-label .cs-home-traffic-kicker {
  text-transform: none;
}
#cabinet-screen #tab-home .cs-home-traffic-label .cs-home-traffic-kicker {
  font-size: 0;
}
#cabinet-screen #tab-home .cs-home-traffic-label .cs-home-traffic-kicker::after {
  content: "Трафик";
  font-size: 12.5px;
  font-weight: 550;
  color: rgba(180, 190, 210, 0.58);
}

#cabinet-screen #tab-home .home-bar {
  height: 3px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

#cabinet-screen #tab-home .home-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.55s cubic-bezier(0.22, 0.7, 0.25, 1), background-color 0.3s ease;
}

#cabinet-screen #tab-home .home-bar.is-success > span {
  background: #2f6fdb;
}

#cabinet-screen #tab-home .home-bar.is-danger > span {
  background: rgba(220, 110, 120, 0.85);
}

#cabinet-screen #tab-home .home-bar.is-accent > span {
  background: #2f6fdb;
}

#cabinet-screen #tab-home .cs-home-connect {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}

#cabinet-screen #tab-home .cs-home-section-label {
  display: none;
}

#cabinet-screen #tab-home #home-traffic-meter {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

#cabinet-screen #tab-home #home-client-seg.client-seg {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: none;
  height: 40px;
  box-sizing: border-box;
  padding: 3px;
  margin: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
}

#cabinet-screen #tab-home #home-client-seg.client-seg::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 8px;
  background: rgba(47, 111, 219, 0.18);
  border: 1px solid rgba(47, 111, 219, 0.28);
  transition: transform 0.28s cubic-bezier(0.22, 0.7, 0.25, 1);
  pointer-events: none;
  z-index: 0;
}

#cabinet-screen #tab-home #home-client-seg.client-seg:has(.client-seg-btn:last-child.active)::before {
  transform: translateX(100%);
}

#cabinet-screen #tab-home .client-seg-btn {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: rgba(180, 190, 210, 0.58);
  border-radius: 8px;
  padding: 0 10px;
  line-height: 1;
  outline: none;
  position: relative;
  z-index: 1;
  transition: color 0.22s ease;
}

#cabinet-screen #tab-home .client-seg-btn:hover {
  color: rgba(235, 240, 248, 0.88);
}

#cabinet-screen #tab-home .client-seg-btn.active {
  background: transparent;
  color: #e8eef8;
  box-shadow: none;
}

#cabinet-screen #tab-home .home-connect-actions {
  display: grid;
  gap: 8px;
}

#cabinet-screen #tab-home #home-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cs-touch);
  padding: 12px 16px;
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  color: #f5f8ff;
  background: #1e4a9a;
  border: 1px solid rgba(70, 120, 200, 0.28);
  box-shadow: none;
  filter: none;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

#cabinet-screen #tab-home #home-open-btn:hover {
  background: #2758b0;
  filter: none;
  box-shadow: none;
}

#cabinet-screen #tab-home #home-open-btn[aria-disabled="true"],
#cabinet-screen #tab-home #home-open-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
  cursor: not-allowed;
}

#cabinet-screen #tab-home #home-copy-btn {
  width: 100%;
  min-height: var(--cs-touch);
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(220, 226, 238, 0.88);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

#cabinet-screen #tab-home #home-copy-btn:hover {
  border-color: rgba(47, 111, 219, 0.35);
  background: rgba(47, 111, 219, 0.08);
  color: #f0f4fa;
}

#cabinet-screen #tab-home .home-key-details {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

#cabinet-screen #tab-home .home-key-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 500;
  color: rgba(160, 170, 190, 0.55);
  user-select: none;
  transition: color 0.18s ease;
}

#cabinet-screen #tab-home .home-key-details > summary:hover {
  color: rgba(200, 210, 230, 0.78);
}

#cabinet-screen #tab-home .home-key-details > summary::-webkit-details-marker { display: none; }

#cabinet-screen #tab-home #home-key-url {
  display: block;
  padding: 8px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: rgba(170, 180, 200, 0.62);
  word-break: break-all;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

#cabinet-screen #tab-home .home-copy-status {
  margin-top: 2px;
  min-height: 18px;
  font-size: 12.5px;
  transition: opacity 0.35s ease;
}

#cabinet-screen #tab-home .home-copy-status.ok {
  color: rgba(220, 226, 238, 0.9);
}

#cabinet-screen #tab-home .cs-home-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#cabinet-screen #tab-home #home-renew-btn.home-renew-btn {
  width: 100%;
  min-height: var(--cs-touch);
  justify-content: center;
  border-radius: 11px;
  margin-top: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

#cabinet-screen #tab-home #home-renew-btn.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(190, 198, 214, 0.78);
  box-shadow: none;
}

#cabinet-screen #tab-home #home-renew-btn.btn-secondary:hover {
  color: #eef2f8;
  border-color: rgba(47, 111, 219, 0.4);
  background: rgba(47, 111, 219, 0.08);
}

#cabinet-screen #tab-home #home-renew-btn.btn-primary {
  background: rgba(47, 111, 219, 0.18);
  border: 1px solid rgba(47, 111, 219, 0.42);
  color: #e8eef8;
  box-shadow: none;
}

#cabinet-screen #tab-home #home-renew-btn.btn-primary:hover {
  background: rgba(47, 111, 219, 0.26);
}

@media (max-width: 768px) {
  #cabinet-screen #tab-home .home-days-num { font-size: var(--m-days, 40px); }

  #cabinet-screen #tab-home .client-seg-btn {
    min-height: var(--m-touch, 44px);
  }

  #cabinet-screen #tab-home #home-client-seg.client-seg {
    height: auto;
    min-height: var(--m-touch, 44px);
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status {
    padding: 18px 16px 14px;
  }

  /* traffic is a sibling now; body gap handles stack spacing */
  #cabinet-screen #tab-home .cs-home-connect {
    margin-top: 0;
  }
}

/* ==========================================================================
   DESKTOP HOME SIGNATURE SYSTEM V37 — instrument | product module | Z-edge
   Scope: #tab-home only @ min-width 769px
   ========================================================================== */

/* Hide product module on mobile; keep section label */
#cabinet-screen #tab-home .cs-home-app-module {
  display: none;
}
#cabinet-screen #tab-home .cs-home-traffic-rail {
  position: relative;
}
#cabinet-screen #tab-home .cs-home-traffic-ticks {
  display: none;
}
#cabinet-screen #tab-home .cs-home-ring-conc,
#cabinet-screen #tab-home .cs-home-ring-marker {
  display: none;
}
#cabinet-screen #tab-home .home-key-details > summary svg {
  display: none;
}

@media (min-width: 769px) {
  /* One graphite surface — soft top highlight, faint cool border, signature edge */
  #cabinet-screen #tab-home .cs-home-panel.home-status {
    position: relative;
    overflow: hidden;
    padding: 18px 26px 12px;
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.034) 0%, rgba(255, 255, 255, 0) 42%),
      linear-gradient(165deg, #171b23 0%, #13161d 52%, #10131a 100%);
    border: 1px solid rgba(148, 162, 186, 0.11);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  }

  /* Signature motif #1 — thin diagonal edge-slice (Z geometry), not a letter */
  #cabinet-screen #tab-home .cs-home-panel.home-status::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 56px;
    pointer-events: none;
    z-index: 2;
    background:
      linear-gradient(
        135deg,
        transparent 0%,
        transparent calc(50% - 0.55px),
        rgba(168, 182, 206, 0.28) 50%,
        transparent calc(50% + 0.55px),
        transparent 100%
      );
    opacity: 0.85;
  }

  #cabinet-screen #tab-home .cs-home-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
    grid-template-areas: "left right";
    gap: 0 36px;
    align-items: stretch;
    min-height: 0;
  }

  #cabinet-screen #tab-home .cs-home-left {
    grid-area: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    min-width: 0;
    padding-right: 0;
  }

  #cabinet-screen #tab-home .cs-home-traffic {
    width: 100%;
    max-width: 280px;
    margin: 14px 0 0;
    align-self: flex-start;
  }

  #cabinet-screen #tab-home .cs-home-right {
    grid-area: right;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    min-width: 0;
  }

  #cabinet-screen #tab-home .cs-home-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 540;
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: rgba(148, 160, 180, 0.48);
    margin: 0 0 8px;
  }

  /* ——— Subscription instrument ——— */
  #cabinet-screen #tab-home .cs-home-gauge {
    display: grid;
    place-items: center;
    width: 172px;
    height: 172px;
    margin: 0 0 10px;
    position: relative;
    flex-shrink: 0;
  }

  #cabinet-screen #tab-home .cs-home-ring {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: none !important;
    color: #1a4a96;
  }

  #cabinet-screen #tab-home .cs-home-ring-conc {
    display: block;
    stroke: rgba(90, 104, 128, 0.34);
    stroke-width: 0.9;
    fill: none;
  }

  #cabinet-screen #tab-home .cs-home-ring-conc-b {
    stroke: rgba(72, 86, 112, 0.22);
  }

  #cabinet-screen #tab-home .cs-home-ring-inner {
    stroke: rgba(68, 76, 92, 0.22);
    stroke-width: 0.85;
    fill: none;
  }

  #cabinet-screen #tab-home .cs-home-ring-ticks {
    stroke: rgba(126, 138, 160, 0.22);
    stroke-width: 0.95;
  }

  #cabinet-screen #tab-home .cs-home-ring-track {
    stroke: rgba(70, 78, 94, 0.58);
    stroke-width: 1.7;
  }

  #cabinet-screen #tab-home .cs-home-ring-arc {
    stroke: #0d3278;
    stroke-width: 1.7;
    stroke-linecap: round;
    filter: none !important;
  }

  #cabinet-screen #tab-home .cs-home-ring-arc.is-low {
    stroke: rgba(168, 92, 102, 0.82);
  }

  #cabinet-screen #tab-home .cs-home-ring-arc.is-empty {
    stroke: rgba(86, 94, 108, 0.4);
  }

  #cabinet-screen #tab-home .cs-home-ring-marker {
    display: block;
    fill: #1a4a96;
    opacity: 0;
    pointer-events: none;
  }

  #cabinet-screen #tab-home .cs-home-ring-marker.is-on {
    opacity: 1;
  }

  #cabinet-screen #tab-home .cs-home-gauge-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    transform: none;
  }

  #cabinet-screen #tab-home .home-status-top {
    margin: 0;
    padding: 0;
    gap: 0;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    line-height: 1;
  }

  #cabinet-screen #tab-home .home-days-num {
    font-size: 56px;
    font-weight: 740;
    letter-spacing: -0.052em;
    line-height: 0.88;
    color: #f7f9fd;
  }

  #cabinet-screen #tab-home .home-days-unit {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(168, 178, 196, 0.55);
    margin-top: 2px;
    line-height: 1;
  }

  #cabinet-screen #tab-home .cs-home-submeta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    width: 100%;
  }

  #cabinet-screen #tab-home #home-status-label {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: rgba(190, 198, 214, 0.72);
  }

  #cabinet-screen #tab-home #home-status-label.is-active {
    color: #3dcf86;
  }

  #cabinet-screen #tab-home #home-status-label.is-active::before {
    width: 5px;
    height: 5px;
  }

  #cabinet-screen #tab-home .home-until {
    font-size: 12px;
    margin: 0;
    font-weight: 440;
    color: rgba(148, 158, 176, 0.52);
  }

  #cabinet-screen #tab-home #home-days-meter {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* ——— Traffic: compact premium data-strip ——— */
  #cabinet-screen #tab-home #home-traffic-meter {
    margin: 14px 0 0;
    max-width: 280px;
    width: 100%;
  }

  #cabinet-screen #tab-home .cs-home-traffic-label {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 10px;
    margin-bottom: 9px;
  }

  #cabinet-screen #tab-home .cs-home-traffic-label .cs-home-traffic-kicker {
    font-size: 10px;
    font-weight: 540;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(148, 160, 180, 0.48);
  }

  #cabinet-screen #tab-home .cs-home-traffic-label .cs-home-traffic-kicker::after {
    content: none;
  }

  #cabinet-screen #tab-home #home-traffic-text {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 620;
    letter-spacing: -0.02em;
    color: #eef2f8;
    line-height: 1.15;
  }

  #cabinet-screen #tab-home #home-traffic-text .cs-home-traffic-used {
    font-size: 15px;
    font-weight: 640;
    letter-spacing: -0.02em;
    color: #eef2f8;
  }

  #cabinet-screen #tab-home #home-traffic-text .cs-home-traffic-of {
    font-size: 12.5px;
    font-weight: 460;
    letter-spacing: 0;
    color: rgba(152, 164, 184, 0.58);
  }

  #cabinet-screen #tab-home .cs-home-traffic-rail {
    position: relative;
    width: 100%;
  }

  #cabinet-screen #tab-home #home-traffic-meter .home-bar {
    height: 1.35px;
    max-width: none;
    width: 100%;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.06);
  }

  #cabinet-screen #tab-home #home-traffic-meter .home-bar > span {
    border-radius: 1px;
    background: #0d3278;
    transition: width 0.36s cubic-bezier(0.22, 0.7, 0.25, 1), background-color 0.18s ease;
  }

  #cabinet-screen #tab-home .cs-home-traffic-ticks {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0;
    pointer-events: none;
  }

  #cabinet-screen #tab-home .cs-home-traffic-ticks i {
    position: absolute;
    top: -3px;
    width: 1px;
    height: 6px;
    background: rgba(126, 138, 160, 0.28);
  }

  #cabinet-screen #tab-home .cs-home-traffic-ticks i:nth-child(1) { left: 33.333%; }
  #cabinet-screen #tab-home .cs-home-traffic-ticks i:nth-child(2) { left: 66.666%; }
  #cabinet-screen #tab-home .cs-home-traffic-ticks i:nth-child(3) { left: 100%; transform: translateX(-1px); }

  /* ——— Connection product module (inside surface, not a nested card) ——— */
  #cabinet-screen #tab-home .cs-home-connect {
    display: grid;
    gap: 14px;
    margin-top: 0;
    width: 100%;
    max-width: 420px;
  }

  #cabinet-screen #tab-home .cs-home-connect-head {
    display: none;
  }

  #cabinet-screen #tab-home .cs-home-app-module {
    display: grid;
    position: relative;
    min-height: 52px;
  }

  #cabinet-screen #tab-home .cs-home-app-face {
    display: none;
    align-items: center;
    gap: 14px;
    grid-area: 1 / 1;
  }

  #cabinet-screen #tab-home .cs-home-connect:has(.client-seg-btn[data-client-id="anywhere"].active) .cs-home-app-face.is-anywhere,
  #cabinet-screen #tab-home .cs-home-connect:has(.client-seg-btn[data-client-id="happ"].active) .cs-home-app-face.is-happ {
    display: flex;
  }

  /* Fallback before seg renders */
  #cabinet-screen #tab-home .cs-home-connect:not(:has(.client-seg-btn.active)) .cs-home-app-face.is-anywhere {
    display: flex;
  }

  #cabinet-screen #tab-home .cs-home-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  #cabinet-screen #tab-home .cs-home-app-name {
    font-size: 20px;
    font-weight: 680;
    letter-spacing: -0.028em;
    color: #f4f7fc;
    line-height: 1.1;
  }

  #cabinet-screen #tab-home .cs-home-app-plat {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 450;
    color: rgba(150, 162, 182, 0.55);
    letter-spacing: 0.01em;
  }

  @media (prefers-reduced-motion: no-preference) {
    #cabinet-screen #tab-home .cs-home-app-face {
      animation: none;
    }
    #cabinet-screen #tab-home .cs-home-connect:has(.client-seg-btn[data-client-id="anywhere"].active) .cs-home-app-face.is-anywhere,
    #cabinet-screen #tab-home .cs-home-connect:has(.client-seg-btn[data-client-id="happ"].active) .cs-home-app-face.is-happ,
    #cabinet-screen #tab-home .cs-home-connect:not(:has(.client-seg-btn.active)) .cs-home-app-face.is-anywhere {
      animation: csHomeAppFade 0.28s ease;
    }
  }

  @keyframes csHomeAppFade {
    from { opacity: 0.35; }
    to { opacity: 1; }
  }

  #cabinet-screen #tab-home #home-client-seg.client-seg {
    height: 36px;
    max-width: none;
    width: 100%;
    padding: 3px;
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid rgba(148, 162, 186, 0.08);
    border-radius: 8px;
  }

  #cabinet-screen #tab-home #home-client-seg.client-seg::before {
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 162, 186, 0.09);
    transition: transform 0.2s cubic-bezier(0.22, 0.7, 0.25, 1);
  }

  #cabinet-screen #tab-home .client-seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 12.5px;
    font-weight: 540;
    color: rgba(164, 174, 192, 0.5);
    transition: color 0.16s ease;
  }

  #cabinet-screen #tab-home .client-seg-btn[data-client-id="anywhere"]::before,
  #cabinet-screen #tab-home .client-seg-btn[data-client-id="happ"]::before {
    content: none !important;
    display: none !important;
  }

  #cabinet-screen #tab-home .client-seg-btn.active {
    color: rgba(236, 242, 252, 0.96);
  }

  #cabinet-screen #tab-home .client-seg-btn:hover {
    color: rgba(220, 228, 240, 0.86);
  }

  #cabinet-screen #tab-home .home-connect-actions {
    display: grid;
    gap: 11px;
    max-width: none;
    width: 100%;
  }

  /* Primary CTA — asymmetric diagonal corner + signature edge light on hover */
  #cabinet-screen #tab-home #home-open-btn {
    position: relative;
    isolation: isolate;
    min-height: 44px;
    width: 100%;
    max-width: none;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 640;
    letter-spacing: -0.01em;
    border-radius: 8px 2px 8px 8px;
    background: #14367a;
    border: 1px solid rgba(70, 110, 180, 0.18);
    box-shadow: none;
    filter: none;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  /* Signature motif #2 — edge light along diagonal cut */
  #cabinet-screen #tab-home #home-open-btn::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    pointer-events: none;
    z-index: 1;
    background:
      linear-gradient(
        135deg,
        transparent 0%,
        transparent calc(50% - 0.6px),
        rgba(210, 224, 255, 0.22) 50%,
        transparent calc(50% + 0.6px),
        transparent 100%
      );
    opacity: 0.55;
    transition: opacity 0.22s ease, filter 0.22s ease;
  }

  #cabinet-screen #tab-home #home-open-btn::after {
    content: " →";
    font-weight: 500;
    opacity: 0.78;
    position: relative;
    z-index: 2;
  }

  #cabinet-screen #tab-home #home-open-btn:hover {
    background: #19428c;
    filter: none;
    box-shadow: none;
    border-color: rgba(90, 130, 200, 0.24);
  }

  #cabinet-screen #tab-home #home-open-btn:hover::before {
    opacity: 1;
    filter: brightness(1.25);
  }

  #cabinet-screen #tab-home .cs-home-quiet-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
  }

  #cabinet-screen #tab-home #home-copy-btn {
    width: auto;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: rgba(186, 198, 218, 0.82);
    font-size: 12.5px;
    font-weight: 540;
    justify-content: flex-start;
    gap: 6px;
    transition: color 0.16s ease;
  }

  #cabinet-screen #tab-home #home-copy-btn svg {
    width: 13px;
    height: 13px;
    opacity: 0.85;
  }

  #cabinet-screen #tab-home #home-copy-btn:hover {
    background: transparent;
    border: none;
    color: rgba(236, 242, 252, 0.98);
  }

  #cabinet-screen #tab-home .home-key-details > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 540;
    padding: 0;
    color: rgba(186, 198, 218, 0.82);
    transition: color 0.16s ease;
  }

  #cabinet-screen #tab-home .home-key-details > summary svg {
    display: block;
    width: 13px;
    height: 13px;
    opacity: 0.85;
    flex-shrink: 0;
  }

  #cabinet-screen #tab-home .home-key-details > summary:hover {
    color: rgba(236, 242, 252, 0.98);
  }

  #cabinet-screen #tab-home #home-key-url {
    max-width: 420px;
    padding-top: 8px;
  }

  /* Renewal — delicate diagonal edge motif tying to CTA */
  #cabinet-screen #tab-home .cs-home-footer {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  #cabinet-screen #tab-home .cs-home-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 0;
    width: 40px;
    height: 1px;
    background:
      linear-gradient(
        90deg,
        transparent 0%,
        rgba(168, 182, 206, 0.0) 20%,
        rgba(168, 182, 206, 0.35) 100%
      );
    transform: skewX(-28deg);
    transform-origin: right center;
    pointer-events: none;
  }

  #cabinet-screen #tab-home .cs-home-renew-prompt {
    display: inline;
    font-size: 13px;
    color: rgba(176, 186, 204, 0.7);
    font-weight: 460;
  }

  #cabinet-screen #tab-home #home-renew-btn.home-renew-btn,
  #cabinet-screen #tab-home #home-renew-btn.btn-secondary,
  #cabinet-screen #tab-home #home-renew-btn.btn-primary {
    position: relative;
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 0 2px 0 0;
    margin: 0;
    border: none !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(232, 240, 255, 0.96);
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
    justify-content: flex-end;
    transition: color 0.16s ease;
  }

  #cabinet-screen #tab-home #home-renew-btn.home-renew-btn::after {
    content: " →";
    opacity: 0.84;
  }

  #cabinet-screen #tab-home #home-renew-btn.home-renew-btn::before {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 18px;
    transform: translateY(-50%);
    background:
      linear-gradient(
        135deg,
        transparent 0%,
        transparent calc(50% - 0.5px),
        rgba(168, 182, 206, 0.35) 50%,
        transparent calc(50% + 0.5px),
        transparent 100%
      );
    opacity: 0.7;
    pointer-events: none;
  }

  #cabinet-screen #tab-home #home-renew-btn.home-renew-btn:hover,
  #cabinet-screen #tab-home #home-renew-btn.btn-secondary:hover,
  #cabinet-screen #tab-home #home-renew-btn.btn-primary:hover {
    background: transparent !important;
    border: none !important;
    color: #f6f9ff;
    filter: none;
  }

  #cabinet-screen #tab-home #home-renew-btn.home-renew-btn:hover::before {
    opacity: 1;
  }

  /* Soft motion + prefers-reduced-motion */
  @media (prefers-reduced-motion: no-preference) {
    #cabinet-screen #tab-home .home-days-num.cs-home-days-tick {
      animation: csHomeDaysFade 0.26s ease;
    }

    @keyframes csHomeDaysFade {
      from { opacity: 0.72; }
      to { opacity: 1; }
    }

    #cabinet-screen #tab-home #home-open-btn,
    #cabinet-screen #tab-home #home-copy-btn,
    #cabinet-screen #tab-home #home-renew-btn,
    #cabinet-screen #tab-home .client-seg-btn,
    #cabinet-screen #tab-home .home-key-details > summary {
      transition-duration: 0.16s;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    #cabinet-screen #tab-home #home-client-seg.client-seg::before {
      transition: none !important;
    }
    #cabinet-screen #tab-home .home-bar > span {
      transition: none !important;
    }
    #cabinet-screen #tab-home .home-days-num.cs-home-days-tick {
      animation: none !important;
    }
    #cabinet-screen #tab-home .cs-home-app-face {
      animation: none !important;
    }
    #cabinet-screen #tab-home .cs-home-ring-marker {
      transition: none !important;
    }
    #cabinet-screen #tab-home #home-open-btn,
    #cabinet-screen #tab-home #home-copy-btn,
    #cabinet-screen #tab-home #home-renew-btn,
    #cabinet-screen #tab-home .client-seg-btn,
    #cabinet-screen #tab-home .home-key-details > summary {
      transition: none !important;
    }
    #cabinet-screen #tab-home #home-open-btn::before {
      transition: none !important;
    }
  }
}

/* Cabinet refresh toast — temporary, neutral; not permanent #cabinet-status success */
#cabinet-screen #cabinet-status.ok {
  color: rgba(200, 210, 230, 0.75);
}

#cabinet-toast.cabinet-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 120;
  transform: translateX(-50%) translateY(8px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(14, 16, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(235, 240, 248, 0.92);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

#cabinet-toast.cabinet-toast.is-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#cabinet-toast.cabinet-toast.is-out {
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
}

@media (min-width: 769px) {
  #cabinet-toast.cabinet-toast {
    bottom: 36px;
  }
}

/* Soft shell restyle for other panels (content unchanged) */
#cabinet-screen #tab-renew .section,
#cabinet-screen #tab-connect .section,
#cabinet-screen #tab-about .section {
  background: transparent;
}

#cabinet-screen #tab-renew .section-head h3,
#cabinet-screen #tab-connect .section-head h3,
#cabinet-screen #tab-about .about-block h3 {
  letter-spacing: -0.02em;
}

#cabinet-screen .keys-card,
#cabinet-screen .card {
  background: var(--cs-panel);
  border-color: var(--cs-panel-border);
}

#cabinet-screen .foot {
  margin-top: 28px;
  padding: 16px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--cs-muted-2);
}

#cabinet-screen .foot a {
  color: var(--cs-blue-soft);
}

/* ---- Mobile bottom nav ---- */
#cabinet-screen .mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  #cabinet-screen {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  #cabinet-screen .cabinet-tabs { display: none; }

  #cabinet-screen .cabinet-head {
    gap: 8px;
    padding: 8px 0 8px;
    margin-bottom: 6px;
    overflow: hidden;
  }

  #cabinet-screen .cabinet-brand .logo { height: 28px; }

  #cabinet-screen .cabinet-user {
    gap: 8px;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  #cabinet-screen #who-name,
  #cabinet-screen .who-name {
    max-width: min(132px, 34vw);
    font-size: 13px;
  }

  #cabinet-screen #who-sub,
  #cabinet-screen .who-sub {
    max-width: min(132px, 34vw);
  }

  #cabinet-screen .cabinet-head-actions {
    gap: 5px;
  }

  #cabinet-screen .cabinet-support-btn,
  #cabinet-screen .cabinet-head .icon-btn,
  #cabinet-screen .cabinet-head .logout-text-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  #cabinet-screen .cabinet-head .logout-text-btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
    font-size: 0;
  }

  #cabinet-screen #profile-details > summary,
  #cabinet-screen .profile-details > summary {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
  }

  #cabinet-screen #profile-box .kv {
    padding: 6px 0;
    font-size: 12.5px;
  }

  #cabinet-screen #profile-box .kv .v.mono {
    font-size: 12px;
  }

  #cabinet-screen .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    gap: 2px;
    background: rgba(8, 10, 18, 0.96);
    border-top: 1px solid rgba(58, 140, 255, 0.14);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #cabinet-screen .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: var(--cs-touch);
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--cs-muted-2);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: color 0.18s, background 0.18s;
  }

  #cabinet-screen .mobile-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
  }

  #cabinet-screen .mobile-nav-item.nav-tab.active {
    color: var(--cs-green);
    background: rgba(62, 224, 138, 0.08);
  }

  #cabinet-screen .foot {
    margin-top: 28px;
    padding: 18px 0 12px;
  }
}

@keyframes cs-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#cabinet-screen .cabinet-panel.active {
  animation: cs-fade-up 0.35s ease both;
}

/* Phase2 soft: narrow header who-name — after touch sizing so it wins */
@media (max-width: 480px) {
  #cabinet-screen #who-sub,
  #cabinet-screen .who-sub { display: none; }
}

@media (max-width: 400px) {
  /* tighter rules live in MOBILE POLISH V45 block at file end */
  #cabinet-screen #who-sub,
  #cabinet-screen .who-sub { display: none; }
}


/* ---- Desktop / tablet-wide shell: shared width + calm vertical rhythm ---- */
@media (min-width: 769px) {
  /* Fill .wrap grid (~1240px max + shared side padding); drop narrow 920px column */
  #cabinet-screen {
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Gather header → account → tabs → Home; reduce large vertical gaps */
  #cabinet-screen .cabinet-head {
    margin-bottom: 2px;
    padding: 14px 0 8px;
  }

  #cabinet-screen #profile-details,
  #cabinet-screen .profile-details {
    margin: 0 0 2px;
  }

  #cabinet-screen .cabinet-tabs {
    margin: 0 0 12px;
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status {
    margin-top: 0;
    margin-bottom: 8px;
  }
}

/* ==========================================================================
   Desktop materials / background / depth only (min-width: 769px)
   Surface · border · inner highlight · soft shadow — no layout/type changes
   ========================================================================== */
@media (min-width: 769px) {
  body:has(#cabinet-screen:not(.hidden)) {
    --cs-mat-bg: #0a0b0e;
    --cs-mat-surface: #12141a;
    --cs-mat-surface-raised: #14161d;
    --cs-mat-border: rgba(155, 170, 195, 0.11);
    --cs-mat-border-soft: rgba(155, 170, 195, 0.08);
    --cs-mat-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.055);
    --cs-mat-shadow: 0 8px 22px rgba(0, 0, 0, 0.20);
    --cs-mat-accent: #1e4fd6;
  }

  /* 1) Stage: deep graphite, almost-invisible soft gradients — no texture/glow */
  html:has(#cabinet-screen:not(.hidden)),
  html:has(#cabinet-screen:not(.hidden)) body {
    background: var(--cs-mat-bg) !important;
    background-color: var(--cs-mat-bg) !important;
  }

  body:has(#cabinet-screen:not(.hidden))::before {
    background:
      radial-gradient(ellipse 85% 50% at 50% -5%, rgba(255, 255, 255, 0.022), transparent 58%),
      radial-gradient(ellipse 70% 45% at 50% 105%, rgba(28, 36, 52, 0.16), transparent 62%),
      linear-gradient(180deg, #0b0c10 0%, #090a0d 48%, #0a0b0e 100%);
  }

  #cabinet-screen {
    background: transparent;
  }

  /* 4) Header — same material language (structure untouched) */
  #cabinet-screen .cabinet-head {
    background: rgba(16, 18, 24, 0.97);
    border-bottom: 1px solid var(--cs-mat-border-soft);
    box-shadow: var(--cs-mat-highlight);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #cabinet-screen .cabinet-user .avatar {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--cs-mat-border-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  #cabinet-screen .cabinet-support-btn,
  #cabinet-screen .cabinet-head .icon-btn,
  #cabinet-screen .cabinet-head .logout-text-btn {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--cs-mat-border-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  }

  #cabinet-screen .cabinet-support-btn:hover,
  #cabinet-screen .cabinet-head .icon-btn:hover,
  #cabinet-screen .cabinet-support-btn:focus-visible,
  #cabinet-screen .cabinet-head .icon-btn:focus-visible {
    background: rgba(30, 79, 214, 0.12);
    border-color: rgba(155, 170, 195, 0.14);
    box-shadow: none;
  }

  /* Tabs: keep flat; accent underline stays deep blue */
  #cabinet-screen .cabinet-tabs {
    --cs-tab-accent: var(--cs-mat-accent);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  /* 3) Home card — signature surface owns look; keep accent tokens only */
  #cabinet-screen #tab-home .home-bar.is-success > span,
  #cabinet-screen #tab-home .home-bar.is-accent > span {
    background: var(--cs-mat-accent);
  }

  /* Other panel cards — same material system */
  #cabinet-screen .keys-card,
  #cabinet-screen .card {
    background: var(--cs-mat-surface);
    border-color: var(--cs-mat-border);
    box-shadow: var(--cs-mat-highlight), 0 6px 18px rgba(0, 0, 0, 0.18);
  }

  #cabinet-screen .foot {
    border-top-color: var(--cs-mat-border-soft);
  }
}

/* === RENEW PREMIUM V44 — #tab-renew desktop only ==========================
   Stronger hierarchy / checkout polish. Keep «Продлить».
   Plans/prices/handlers unchanged. Graphite/white/muted/deep-blue only.
   No cyan/glow/fill-gradients. Desktop min-width 769px only.
   ========================================================================== */
@media (min-width: 769px) {
  #cabinet-screen #tab-renew {
    --renew-accent: #1e4fd6;
    --renew-accent-solid: #14367a;
    --renew-accent-hover: #19428c;
    --renew-border: rgba(160, 176, 200, 0.13);
    --renew-surface: #13161c;
    --renew-surface-hi: #161a22;
    --renew-surface-active: #152036;
    --renew-text: #f0f2f6;
    --renew-muted: rgba(168, 176, 190, 0.66);
    --renew-muted-2: rgba(140, 148, 164, 0.46);
    --renew-deep-edge: rgba(30, 79, 214, 0.88);
    --renew-deep-inset: rgba(30, 79, 214, 0.34);
    --renew-radius: 10px;
    --renew-line: 1px;
  }

  #cabinet-screen #tab-renew .section {
    max-width: none;
    width: 100%;
  }

  #cabinet-screen #tab-renew .section-head {
    margin-bottom: 14px;
  }

  #cabinet-screen #tab-renew .section-head h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--renew-text);
  }

  #cabinet-screen #tab-renew .section-head .hint {
    display: none;
  }

  /* Cards + summary as one finished checkout block */
  #cabinet-screen #tab-renew .plans {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    align-items: stretch;
    margin: 0;
  }

  #cabinet-screen #tab-renew button.plan,
  #cabinet-screen #tab-renew .plan {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto 1fr;
    align-items: start;
    column-gap: 8px;
    row-gap: 0;
    min-height: 0;
    height: 100%;
    padding: 11px 13px 12px;
    border-radius: var(--renew-radius);
    background: var(--renew-surface);
    border: var(--renew-line) solid var(--renew-border);
    box-shadow: none;
    transform: none;
    color: var(--renew-text);
    overflow: hidden;
    transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
  }

  #cabinet-screen #tab-renew .plan::before,
  #cabinet-screen #tab-renew .plan::after {
    content: none;
    display: none;
  }

  #cabinet-screen #tab-renew .plan:hover {
    transform: none;
    background: var(--renew-surface-hi);
    border-color: rgba(160, 176, 200, 0.2);
    box-shadow: none;
  }

  /* Unselected: visually calmer — quieter term/price/meta */
  #cabinet-screen #tab-renew .plan:not(.active) {
    background: #12151a;
    border-color: rgba(160, 176, 200, 0.1);
  }

  #cabinet-screen #tab-renew .plan:not(.active) .plan-duration {
    color: rgba(140, 148, 164, 0.4);
    font-weight: 600;
  }

  #cabinet-screen #tab-renew .plan:not(.active) .plan-price .num {
    color: rgba(220, 226, 236, 0.72);
    font-weight: 650;
    font-size: 25px;
  }

  #cabinet-screen #tab-renew .plan:not(.active) .plan-price .cur {
    color: rgba(140, 148, 164, 0.42);
  }

  #cabinet-screen #tab-renew .plan:not(.active) .plan-meta {
    color: rgba(140, 148, 164, 0.36);
  }

  #cabinet-screen #tab-renew .plan:not(.active) .plan-price-old {
    color: rgba(140, 148, 164, 0.28);
  }

  /* Selected = primary: stronger edge + deep-blue surface tint, no glow */
  #cabinet-screen #tab-renew .plan.active {
    border-color: var(--renew-deep-edge);
    border-width: var(--renew-line);
    background: var(--renew-surface-active);
    box-shadow: inset 0 0 0 1px var(--renew-deep-inset);
  }

  #cabinet-screen #tab-renew .plan.active .plan-duration {
    color: rgba(200, 214, 242, 0.92);
    font-weight: 700;
  }

  #cabinet-screen #tab-renew .plan.active .plan-price .num {
    color: #ffffff;
    font-weight: 780;
    font-size: 31px;
  }

  #cabinet-screen #tab-renew .plan.active .plan-price .cur {
    color: rgba(214, 224, 244, 0.82);
    font-weight: 550;
  }

  #cabinet-screen #tab-renew .plan.active .plan-meta {
    color: rgba(168, 176, 190, 0.52);
  }

  /* Popular card: same calm shell; badge is the only extra signal */
  #cabinet-screen #tab-renew .plan:has(.plan-badge):not(.active) {
    background: #12151a;
    border-color: rgba(160, 176, 200, 0.1);
  }

  #cabinet-screen #tab-renew .plan:has(.plan-badge).active {
    border-color: var(--renew-deep-edge);
    background: var(--renew-surface-active);
    box-shadow: inset 0 0 0 1px var(--renew-deep-inset);
  }

  /* Hierarchy: small term → main price → quiet description */
  #cabinet-screen #tab-renew .plan .plan-duration {
    grid-column: 1;
    grid-row: 1;
    order: unset;
    margin: 0;
    padding-top: 1px;
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--renew-muted-2);
    line-height: 1.2;
  }

  /* Популярный: only on popular plan, header-top integrated, deep blue, not a floating pill */
  #cabinet-screen #tab-renew .plan .plan-badge {
    position: static;
    top: auto;
    right: auto;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    margin: 0;
    padding: 0;
    border-radius: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: transparent;
    color: #1e4fd6;
    border: none;
    box-shadow: none;
    line-height: 1.2;
  }

  #cabinet-screen #tab-renew .plan .plan-price-old {
    grid-column: 1 / -1;
    grid-row: 2;
    order: unset;
    margin: 8px 0 0;
    color: rgba(140, 148, 164, 0.34);
    font-size: 10.5px;
  }

  #cabinet-screen #tab-renew .plan .plan-price {
    grid-column: 1 / -1;
    grid-row: 3;
    order: unset;
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 6px 0 0;
  }

  #cabinet-screen #tab-renew .plan .plan-price-old + .plan-price {
    margin-top: 1px;
  }

  #cabinet-screen #tab-renew .plan .plan-price .num {
    font-size: 26px;
    font-weight: 720;
    letter-spacing: -0.038em;
    color: #eef1f6;
    line-height: 1;
  }

  #cabinet-screen #tab-renew .plan .plan-price .cur {
    font-size: 12px;
    font-weight: 500;
    color: var(--renew-muted);
  }

  #cabinet-screen #tab-renew .plan .plan-meta {
    grid-column: 1 / -1;
    grid-row: 4;
    order: unset;
    margin-top: 10px;
    align-self: end;
    font-size: 10.5px;
    font-weight: 450;
    color: var(--renew-muted-2);
    line-height: 1.35;
  }

  /* Stronger summary — same radius/line weight as cards, tight gap */
  #cabinet-screen #tab-renew .renew-checkout-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 6px;
    padding: 13px 15px;
    background: var(--renew-surface);
    border: var(--renew-line) solid var(--renew-border);
    border-radius: var(--renew-radius);
    box-shadow: none;
  }

  #cabinet-screen #tab-renew .renew-selection {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    min-width: 190px;
    flex: 1 1 auto;
  }

  #cabinet-screen #tab-renew .renew-selection-label {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--renew-muted-2);
  }

  #cabinet-screen #tab-renew .renew-selection-main {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 14px;
  }

  #cabinet-screen #tab-renew .renew-selection-term {
    font-size: 19px;
    font-weight: 720;
    color: var(--renew-text);
    letter-spacing: -0.028em;
  }

  #cabinet-screen #tab-renew .renew-selection-price {
    font-size: 20px;
    font-weight: 760;
    color: #ffffff;
    letter-spacing: -0.028em;
  }

  #cabinet-screen #tab-renew .renew-selection-value {
    display: none;
  }

  #cabinet-screen #tab-renew .plan-actions.pay-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 0;
    flex: 0 1 auto;
  }

  /* Primary pay — Home/Connect diagonal edge detail */
  #cabinet-screen #tab-renew #renew-btn.btn-primary {
    position: relative;
    isolation: isolate;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 8px 2px 8px 8px;
    font-size: 13.5px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: #f5f8ff;
    background: var(--renew-accent-solid);
    border: 1px solid rgba(70, 110, 180, 0.22);
    box-shadow: none;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  }

  #cabinet-screen #tab-renew #renew-btn.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    pointer-events: none;
    z-index: 1;
    background:
      linear-gradient(
        135deg,
        transparent 0%,
        transparent calc(50% - 0.55px),
        rgba(210, 224, 255, 0.22) 50%,
        transparent calc(50% + 0.55px),
        transparent 100%
      );
    opacity: 0.55;
  }

  #cabinet-screen #tab-renew #renew-btn.btn-primary:hover {
    background: var(--renew-accent-hover);
    box-shadow: none;
    transform: none;
    filter: none;
  }

  /* Quiet secondary */
  #cabinet-screen #tab-renew #check-payment-btn.btn-ghost {
    min-height: 40px;
    padding: 8px 10px;
    background: transparent;
    color: var(--renew-muted-2);
    border: 1px solid transparent;
    box-shadow: none;
    font-weight: 500;
    font-size: 12.5px;
  }

  #cabinet-screen #tab-renew #check-payment-btn.btn-ghost:hover {
    color: var(--renew-muted);
    background: transparent;
    border-color: transparent;
    transform: none;
  }

  #cabinet-screen #tab-renew #payment-status.selected-note,
  #cabinet-screen #tab-renew #payment-status,
  #cabinet-screen #tab-renew #payment-status.renew-payment-status {
    display: block;
    width: 100%;
    margin-top: 8px;
    color: var(--renew-muted);
  }
}



/* ---- Connect tab: desktop device-connection redesign ---- */
/* Mobile-safe defaults for new connect structure (no visual redesign) */
#cabinet-screen #tab-connect .desktop-key-head h4 {
  display: none;
}

#cabinet-screen #tab-connect .connect-platform {
  display: none;
}

#cabinet-screen #tab-connect .connect-url-details {
  flex: 1 1 100%;
  margin: 0;
  border: none;
  background: transparent;
}

#cabinet-screen #tab-connect .connect-url-details > summary {
  display: none;
  list-style: none;
  cursor: pointer;
}

#cabinet-screen #tab-connect .connect-url-details > summary::-webkit-details-marker {
  display: none;
}

#cabinet-screen #tab-connect .connect-url-details .connect-url-hide {
  display: none;
}

#cabinet-screen #tab-connect .connect-url-details[open] .connect-url-show {
  display: none;
}

#cabinet-screen #tab-connect .connect-url-details[open] .connect-url-hide {
  display: inline;
}


/* New compose wrappers: inert on mobile */
#cabinet-screen #tab-connect .connect-compose,
#cabinet-screen #tab-connect .connect-compose-main {
  display: contents;
}

#cabinet-screen #tab-connect .connect-info-panel {
  display: none;
}

/* Connect util labels: mobile keeps full copy button text */
#cabinet-screen #tab-connect .connect-util-ico,
#cabinet-screen #tab-connect .connect-copy-short {
  display: none;
}
#cabinet-screen #tab-connect .connect-copy-full {
  display: inline;
}
#cabinet-screen #tab-connect .connect-utils {
  display: contents;
}


/* V53: do not force-open Connect URL on mobile — reveal stays behind details */
@media (max-width: 768px) {
  #cabinet-screen #tab-connect .connect-url-details:not([open]) > *:not(summary) {
    display: none !important;
  }
}

@media (min-width: 769px) {
  #cabinet-screen #tab-connect {
    --connect-ink: #e8ecf2;
    --connect-muted: rgba(170, 178, 192, 0.72);
    --connect-muted-2: rgba(140, 150, 168, 0.55);
    --connect-line: rgba(255, 255, 255, 0.07);
    --connect-panel: #101217;
    --connect-panel-border: rgba(255, 255, 255, 0.08);
    --connect-deep: #1a3d8f;
    --connect-deep-hover: #2148a3;
    --connect-deep-tint: rgba(30, 79, 214, 0.14);
    --connect-deep-border: rgba(30, 79, 214, 0.42);
  }

  #cabinet-screen #tab-connect .section {
    max-width: none;
    width: 100%;
  }

  #cabinet-screen #tab-connect .section-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 18px;
  }

  #cabinet-screen #tab-connect .section-head h3 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--connect-ink);
  }

  #cabinet-screen #tab-connect #keys-meta {
    display: none;
  }

  #cabinet-screen #tab-connect #desktop-key-card.keys-card,
  #cabinet-screen #tab-connect #desktop-key-card.card {
    background: var(--connect-panel);
    border: 1px solid var(--connect-panel-border);
    border-radius: 14px;
    padding: 26px 28px 22px;
    box-shadow: none;
  }

  #cabinet-screen #tab-connect .desktop-key-head {
    margin-bottom: 20px;
    align-items: flex-start;
  }

  #cabinet-screen #tab-connect .desktop-key-head h4 {
    display: none;
  }

  #cabinet-screen #tab-connect .desktop-key-head .mobile-key-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 450;
    color: var(--connect-muted);
    max-width: 42ch;
  }

  #cabinet-screen #tab-connect #desktop-key-status {
    flex-shrink: 0;
  }

  #cabinet-screen #tab-connect .connect-section-title {
    display: none;
  }

  /* Calm segmented control: Anywhere / Happ */
  #cabinet-screen #tab-connect .connect-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0 0 10px;
    padding: 3px;
    border: 1px solid var(--connect-line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--connect-line);
  }

  #cabinet-screen #tab-connect .connect-tab {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: var(--connect-muted-2);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    box-shadow: none;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  }

  #cabinet-screen #tab-connect .connect-tab:hover {
    color: var(--connect-ink);
    transform: none;
  }

  #cabinet-screen #tab-connect .connect-tab.active {
    color: #f2f5fa;
    background: var(--connect-deep-tint);
    border-color: var(--connect-deep-border);
    box-shadow: none;
  }

  #cabinet-screen #tab-connect .connect-tab .tab-title {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
  }

  #cabinet-screen #tab-connect .connect-tab .tab-meta {
    display: none;
  }

  #cabinet-screen #tab-connect .connect-tab:focus,
  #cabinet-screen #tab-connect .connect-tab:focus-visible,
  #cabinet-screen #tab-connect .connect-tab.active:focus-visible {
    outline: none;
    box-shadow: none;
  }

  /* Platform line tied to active client tab */
  #cabinet-screen #tab-connect .connect-platform {
    display: block;
    margin: 0 0 18px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted-2);
    letter-spacing: -0.01em;
  }

  #cabinet-screen #tab-connect .connect-platform-label {
    display: none;
  }

  #cabinet-screen #tab-connect .connect-platform-label.is-anywhere {
    display: inline;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-platform-label.is-anywhere {
    display: none;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-platform-label.is-happ {
    display: inline;
  }

  #cabinet-screen #tab-connect #connect-hint {
    display: none;
  }

  /* Actions: open primary, copy secondary; URL accordion below */
  #cabinet-screen #tab-connect .desktop-key-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  #cabinet-screen #tab-connect #open-app-btn.btn,
  #cabinet-screen #tab-connect #open-app-btn {
    order: 1;
    width: 100%;
    justify-content: center;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 650;
    color: #f5f8ff;
    background: var(--connect-deep);
    border: 1px solid rgba(70, 120, 200, 0.28);
    box-shadow: none;
    filter: none;
    background-image: none;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  }

  #cabinet-screen #tab-connect #open-app-btn:hover {
    background: var(--connect-deep-hover);
    box-shadow: none;
    filter: none;
    transform: none;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn.btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn {
    order: 2;
    width: 100%;
    justify-content: center;
    min-height: 42px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 550;
    color: rgba(220, 226, 238, 0.88);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f0f4fa;
    transform: none;
  }

  #cabinet-screen #tab-connect .connect-url-details {
    order: 3;
    flex: none;
    width: 100%;
    margin-top: 4px;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary {
    display: inline-block;
    padding: 2px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--connect-muted-2);
    user-select: none;
    transition: color 0.18s ease;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary:hover {
    color: var(--connect-muted);
  }

  #cabinet-screen #tab-connect #desktop-key-url,
  #cabinet-screen #tab-connect .connect-url-details #desktop-key-url {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--connect-line);
    background: rgba(0, 0, 0, 0.22);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11.5px;
    line-height: 1.45;
    color: rgba(170, 180, 200, 0.72);
    word-break: break-all;
    white-space: normal;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-status {
    min-height: 18px;
    margin: 0 0 8px;
    font-size: 12.5px;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-status.ok {
    color: rgba(220, 226, 238, 0.9);
  }

  #cabinet-screen #tab-connect #connect-diag {
    margin-bottom: 14px;
    border-radius: 10px;
    box-shadow: none;
  }


  /* Full-width 60/40 compose: controls + compact app info */
  #cabinet-screen #tab-connect .connect-compose {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 22px 28px;
    align-items: start;
    margin-bottom: 4px;
  }

  #cabinet-screen #tab-connect .connect-compose-main {
    display: block;
    min-width: 0;
  }

  #cabinet-screen #tab-connect .connect-info-panel {
    display: block;
    min-width: 0;
    padding: 16px 16px 15px;
    border: 1px solid var(--connect-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
  }

  #cabinet-screen #tab-connect .connect-info {
    display: none;
    align-items: flex-start;
    gap: 12px;
  }

  #cabinet-screen #tab-connect .connect-info-anywhere {
    display: flex;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-info-anywhere {
    display: none;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-info-happ {
    display: flex;
  }

  #cabinet-screen #tab-connect .connect-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  #cabinet-screen #tab-connect .connect-info-copy {
    min-width: 0;
  }

  #cabinet-screen #tab-connect .connect-info-name {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--connect-ink);
  }

  #cabinet-screen #tab-connect .connect-info-plat {
    margin: 0 0 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted-2);
  }

  #cabinet-screen #tab-connect .connect-info-note {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--connect-muted);
  }

  /* Compact traffic row — full width under compose */
  #cabinet-screen #tab-connect .desktop-key-meta {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 12px 0 2px;
    border-top: 1px solid var(--connect-line);
  }

  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-item,
  #cabinet-screen #tab-connect .desktop-key-meta .info-cell {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-label {
    margin: 0;
    font-size: 12.5px;
    font-weight: 550;
    color: var(--connect-muted-2);
  }

  #cabinet-screen #tab-connect .desktop-key-meta #desktop-key-traffic,
  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-value {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--connect-ink);
    letter-spacing: -0.01em;
  }

  /* Quiet old-keys accordion */
  #cabinet-screen #tab-connect #old-keys-panel.old-keys-panel {
    margin-top: 16px;
    padding: 0;
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-connect #old-keys-panel > summary {
    padding: 6px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted-2);
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-connect #old-keys-panel > summary:hover {
    color: var(--connect-muted);
  }

  #cabinet-screen #tab-connect #old-keys-panel .table-wrap {
    margin-top: 10px;
    border: 1px solid var(--connect-line);
    border-radius: 10px;
    overflow: auto;
    background: rgba(0, 0, 0, 0.18);
  }
}



/* About howto rows: desktop-only; mobile keeps legacy prose */
#cabinet-screen #tab-about .about-howto {
  display: none;
}

/* ==========================================================================
   Desktop About (#tab-about) — calm premium info center
   Scope: min-width 769px only. Mobile layout untouched.
   ========================================================================== */
@media (min-width: 769px) {
  #cabinet-screen #tab-about {
    --about-ink: #f2f4f7;
    --about-muted: rgba(190, 198, 210, 0.68);
    --about-muted-2: rgba(150, 160, 175, 0.48);
    --about-line: rgba(155, 170, 195, 0.12);
    --about-surface: #12141a;
    --about-surface-2: #101218;
    --about-accent: #1e4fd6;
    --about-radius: 12px;
  }

  #cabinet-screen #tab-about .about-shell {
    width: 100%;
    max-width: none;
    padding: 4px 0 8px;
    background: transparent;
  }

  #cabinet-screen #tab-about .about-hero {
    margin: 0 0 28px;
    padding: 0 0 22px;
    border-bottom: 1px solid var(--about-line);
  }

  #cabinet-screen #tab-about .about-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: var(--about-ink);
    line-height: 1.15;
  }

  #cabinet-screen #tab-about .about-intro {
    max-width: 65ch;
  }

  #cabinet-screen #tab-about .about-intro p {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--about-muted);
    font-weight: 450;
  }

  #cabinet-screen #tab-about .about-intro p:last-child {
    margin-bottom: 0;
  }

  #cabinet-screen #tab-about .about-block {
    margin: 0 0 28px;
    max-width: none;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  #cabinet-screen #tab-about .about-block:last-child {
    margin-bottom: 0;
  }

  #cabinet-screen #tab-about .about-block > h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--about-ink);
  }

  #cabinet-screen #tab-about .about-prose {
    max-width: 65ch;
  }

  #cabinet-screen #tab-about .about-prose p {
    margin: 0 0 10px;
    font-size: 14.5px;
    line-height: 1.62;
    color: var(--about-muted);
  }

  #cabinet-screen #tab-about .about-prose p:last-child {
    margin-bottom: 0;
  }

  /* Subscription howto — hide legacy prose on desktop; show 3-row section */
  #cabinet-screen #tab-about .about-sub .about-sub-legacy {
    display: none;
  }

  #cabinet-screen #tab-about .about-howto {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 4px 0;
    max-width: 720px;
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-about .about-howto-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 16px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #cabinet-screen #tab-about .about-howto-row + .about-howto-row {
    border-top: 1px solid var(--about-line);
  }

  #cabinet-screen #tab-about .about-howto-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    color: var(--about-accent);
    opacity: 0.82;
  }

  #cabinet-screen #tab-about .about-howto-icon svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  #cabinet-screen #tab-about .about-howto-copy {
    min-width: 0;
    flex: 1 1 auto;
  }

  #cabinet-screen #tab-about .about-howto-title {
    margin: 0 0 4px;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--about-ink);
  }

  #cabinet-screen #tab-about .about-howto-desc {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 450;
    color: var(--about-muted);
  }

  /* Apps — branded, quiet desktop cards (#public-apps-grid) */
  #cabinet-screen #tab-about .about-apps .apps-lead {
    margin: 0 0 16px;
    max-width: 65ch;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--about-muted);
  }

  #cabinet-screen #tab-about .about-apps .apps-grid,
  #cabinet-screen #tab-about #public-apps-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 920px;
  }

  #cabinet-screen #tab-about .about-apps .app-card {
    gap: 18px;
    padding: 22px 22px 18px;
    border-radius: var(--about-radius);
    background: var(--about-surface);
    border: 1px solid var(--about-line);
    border-left: 1.5px solid rgba(30, 79, 214, 0.55);
    box-shadow: none;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
  }

  #cabinet-screen #tab-about .about-apps .app-card:hover {
    transform: translateY(-2px);
    border-color: rgba(30, 79, 214, 0.28);
    border-left-color: rgba(30, 79, 214, 0.78);
    background: #14171f;
    box-shadow: none;
  }

  #cabinet-screen #tab-about .about-apps .app-card-top {
    gap: 16px;
    align-items: flex-start;
  }

  #cabinet-screen #tab-about .about-apps .app-card-mark {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    border: 1px solid rgba(30, 79, 214, 0.22);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
  }

  #cabinet-screen #tab-about .about-apps .app-card-mark img {
    width: 52px;
    height: 52px;
  }

  #cabinet-screen #tab-about .about-apps .app-card-title {
    margin: 2px 0 6px;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--about-ink);
  }

  #cabinet-screen #tab-about .about-apps .app-card-meta {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 450;
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-transform: none;
    color: rgba(150, 160, 175, 0.42);
  }

  #cabinet-screen #tab-about .about-apps .app-card-desc {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--about-muted);
  }

  #cabinet-screen #tab-about .about-apps .app-card-actions .btn {
    min-height: 34px;
    padding: 0 12px;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(155, 170, 195, 0.14);
    color: rgba(242, 244, 247, 0.78);
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
  }

  #cabinet-screen #tab-about .about-apps .app-card-actions .btn:hover {
    background: rgba(30, 79, 214, 0.08);
    border-color: rgba(30, 79, 214, 0.32);
    color: var(--about-ink);
    box-shadow: none;
  }

  /* Documents — compact accordion */
  #cabinet-screen #tab-about .about-docs-list {
    border: 1px solid var(--about-line);
    border-radius: var(--about-radius);
    background: var(--about-surface-2);
    overflow: hidden;
    max-width: 920px;
  }

  #cabinet-screen #tab-about .about-doc {
    border-bottom: 1px solid var(--about-line);
  }

  #cabinet-screen #tab-about .about-doc:last-child {
    border-bottom: none;
  }

  #cabinet-screen #tab-about .about-doc-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
  }

  #cabinet-screen #tab-about .about-doc-summary::-webkit-details-marker {
    display: none;
  }

  #cabinet-screen #tab-about .about-doc-summary::marker {
    content: "";
  }

  #cabinet-screen #tab-about .about-doc-summary::after {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 1.5px solid var(--about-muted-2);
    border-bottom: 1.5px solid var(--about-muted-2);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
    opacity: 0.7;
  }

  #cabinet-screen #tab-about .about-doc[open] > .about-doc-summary::after {
    transform: rotate(-135deg) translateY(-1px);
  }

  #cabinet-screen #tab-about .about-doc-summary:hover {
    background: rgba(255, 255, 255, 0.02);
  }

  #cabinet-screen #tab-about .about-doc-name {
    font-size: 14.5px;
    font-weight: 550;
    color: var(--about-ink);
    letter-spacing: -0.01em;
  }

  #cabinet-screen #tab-about .about-doc-meta {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 450;
    color: var(--about-muted-2);
    white-space: nowrap;
  }

  #cabinet-screen #tab-about .about-doc-body {
    padding: 0 18px 16px;
    border-top: none;
  }

  #cabinet-screen #tab-about .about-doc-body p {
    margin: 0 0 10px;
  }

  #cabinet-screen #tab-about .about-doc-link {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }

  #cabinet-screen #tab-about .about-doc-body a,
  #cabinet-screen #tab-about .about-prose a {
    color: #7aa2ff;
    text-decoration: none;
    font-weight: 500;
  }

  #cabinet-screen #tab-about .about-doc-body a:hover,
  #cabinet-screen #tab-about .about-prose a:hover {
    text-decoration: underline;
    color: #9bbbff;
  }

  #cabinet-screen #tab-about .about-doc-link a {
    font-size: 13.5px;
  }
}

/* ==== SHELL HEADER V24 ==== */
/* Single desktop header: logo | tabs | account+actions. Hide cabinet footer. */

#cabinet-screen .cabinet-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
  min-width: 0;
}

#cabinet-screen .cabinet-account {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
}

#cabinet-screen #account-trigger.cabinet-user {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: default;
  text-align: left;
}

#cabinet-screen .account-popover {
  display: none;
}

#cabinet-screen .account-popover-logout {
  display: none;
}

/* Hide cabinet footer (login footer #login-foot untouched) */
#cabinet-screen > .foot {
  display: none !important;
}

@media (max-width: 768px) {
  /* Mobile: tabs stay hidden (existing rule); account popover unused; profile-details stays */
  #cabinet-screen .cabinet-head {
    display: flex;
    flex-wrap: nowrap;
  }

  #cabinet-screen .cabinet-head-right {
    margin-left: auto;
    gap: 6px;
  }

  #cabinet-screen #account-trigger.cabinet-user {
    cursor: default;
    pointer-events: none;
  }

  #cabinet-screen #account-popover {
    display: none !important;
  }
}

@media (min-width: 769px) {
  #cabinet-screen .cabinet-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 20px;
    row-gap: 0;
    flex-wrap: nowrap;
    margin-bottom: 12px;
    padding: 10px 0 0;
    min-height: 52px;
    background: rgba(14, 16, 20, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
  }

  #cabinet-screen .cabinet-brand {
    grid-column: 1;
  }

  #cabinet-screen .cabinet-tabs {
    grid-column: 2;
    justify-self: center;
    align-self: stretch;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 28px;
    margin: 0;
    padding: 0;
    border: none;
    border-bottom: none;
    background: transparent;
    overflow: visible;
    max-width: 100%;
  }

  #cabinet-screen .cabinet-tab {
    padding: 14px 2px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: #8b919c;
  }

  #cabinet-screen .cabinet-tab:hover {
    color: #c8cdd6;
  }

  #cabinet-screen .cabinet-tab.active {
    color: #ffffff;
    font-weight: 600;
  }

  #cabinet-screen .cabinet-tab::after {
    bottom: 0;
    height: 2px;
    background: #1e4fd6;
    border-radius: 1px 1px 0 0;
  }

  #cabinet-screen .cabinet-head-right {
    grid-column: 3;
    margin-left: 0;
    gap: 12px;
  }

  #cabinet-screen .cabinet-user.who,
  #cabinet-screen .cabinet-user {
    margin-left: 0;
  }

  #cabinet-screen #account-trigger.cabinet-user {
    cursor: pointer;
    pointer-events: auto;
    border-radius: 10px;
    padding: 4px 8px 4px 4px;
    border: 1px solid transparent;
    transition: background-color 0.16s ease, border-color 0.16s ease;
  }

  #cabinet-screen #account-trigger.cabinet-user:hover,
  #cabinet-screen .cabinet-account.is-open #account-trigger.cabinet-user {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
  }

  #cabinet-screen #who-sub,
  #cabinet-screen .who-sub {
    display: none;
  }

  #cabinet-screen #who-name,
  #cabinet-screen .who-name {
    max-width: 140px;
    font-size: 13px;
    font-weight: 600;
    color: #f2f4f7;
  }

  /* Remove standalone account row on desktop */
  #cabinet-screen #profile-details,
  #cabinet-screen .profile-details {
    display: none !important;
  }

  #cabinet-screen .account-popover {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 80;
    width: min(300px, calc(100vw - 48px));
    padding: 10px 14px 12px;
    border-radius: 12px;
    border: 1px solid rgba(155, 170, 195, 0.16);
    background: #12141a;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
    color: #e8ecf2;
  }

  #cabinet-screen .account-popover[hidden] {
    display: none !important;
  }

  #cabinet-screen .account-popover-body {
    padding: 0;
    border-top: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #cabinet-screen #account-profile-box .kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    line-height: 1.35;
    min-width: 0;
  }

  #cabinet-screen #account-profile-box .kv:last-child {
    border-bottom: none;
  }

  #cabinet-screen #account-profile-box .kv .k {
    color: #8b919c;
    font-weight: 400;
    flex-shrink: 0;
  }

  #cabinet-screen #account-profile-box .kv .v {
    color: #e6e8eb;
    font-weight: 500;
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #cabinet-screen #account-profile-box .kv .v.mono {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    letter-spacing: 0.05em;
    font-size: 12.5px;
  }

  #cabinet-screen #account-profile-box .kv-code .v-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  #cabinet-screen #account-profile-box .code-toggle {
    appearance: none;
    border: none;
    background: transparent;
    color: #8b919c;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    line-height: 1.2;
  }

  #cabinet-screen #account-profile-box .code-toggle:hover,
  #cabinet-screen #account-profile-box .code-toggle:focus-visible {
    color: #c8cdd6;
    outline: none;
  }

  #cabinet-screen .account-popover-logout {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #c8cdd6;
    font: inherit;
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    text-align: center;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  }

  #cabinet-screen .account-popover-logout:hover,
  #cabinet-screen .account-popover-logout:focus-visible {
    color: #e07070;
    border-color: rgba(180, 70, 70, 0.35);
    background: rgba(160, 50, 50, 0.10);
    outline: none;
  }

  #cabinet-screen .cabinet-head-actions {
    gap: 6px;
  }
}

/* ==========================================================================
   Desktop Home stage / vertical composition (min-width: 769px)
   Vertical placement of #tab-home only — card internals untouched.
   ========================================================================== */
@media (min-width: 769px) {
  #cabinet-screen {
    --cs-desk-header-h: 64px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  #cabinet-screen .cabinet-head {
    flex-shrink: 0;
  }

  /* Main stage fills viewport under header — intentional bottom void */
  #cabinet-screen .cabinet-panels {
    flex: 1 1 auto;
    min-height: calc(100vh - var(--cs-desk-header-h));
    min-height: calc(100dvh - var(--cs-desk-header-h));
    display: flex;
    flex-direction: column;
    position: relative;
  }

  /* Faint graphite depth around main content — barely visible, no glow */
  #cabinet-screen .cabinet-panels::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(
        ellipse 72% 58% at 50% 34%,
        rgba(42, 48, 60, 0.22) 0%,
        rgba(22, 24, 30, 0.10) 42%,
        transparent 72%
      ),
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.012) 0%,
        transparent 28%,
        transparent 72%,
        rgba(18, 20, 26, 0.14) 100%
      );
  }

  #cabinet-screen .cabinet-panels > * {
    position: relative;
    z-index: 1;
  }

  /*
    Lower Home card ~6–10vh from prior flush-under-header placement.
    Upper-middle composition — NOT dead-center (no justify-content: center).
  */
  #cabinet-screen #tab-home {
    flex: 0 0 auto;
    padding-top: clamp(40px, 7vh, 88px);
    padding-bottom: 4vh;
    box-sizing: border-box;
    margin: 0;
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status {
    margin-top: 0;
  }
}

@media (min-width: 1440px) {
  #cabinet-screen {
    --cs-desk-header-h: 66px;
  }

  /* Large screens: more breathing room under header, still upper-middle */
  #cabinet-screen #tab-home {
    padding-top: clamp(52px, 8.5vh, 100px);
    padding-bottom: 5vh;
  }

  #cabinet-screen .cabinet-panels::before {
    background:
      radial-gradient(
        ellipse 64% 52% at 50% 36%,
        rgba(46, 52, 64, 0.24) 0%,
        rgba(24, 26, 32, 0.11) 44%,
        transparent 74%
      ),
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.014) 0%,
        transparent 26%,
        transparent 70%,
        rgba(16, 18, 24, 0.16) 100%
      );
  }
}
/* === end Desktop Home stage v38 === */

/* ==========================================================================
   Desktop HOME SCENE DEPTH / SURFACE MATERIAL V39 (min-width: 769px)
   Depth field · graphite surface · L/R fade · connection weight hierarchy
   No layout/grid/stage-padding/ring/traffic/header/mobile changes.
   ========================================================================== */
@media (min-width: 769px) {

  /* 1) Stage light field — faint graphite + cool-blue, very low opacity.
     Card reads embedded; not a blob glow. Stage padding untouched. */
  #cabinet-screen .cabinet-panels::before {
    background:
      radial-gradient(
        ellipse 70% 56% at 50% 36%,
        rgba(52, 72, 108, 0.14) 0%,
        rgba(36, 44, 60, 0.09) 34%,
        rgba(22, 24, 30, 0.05) 54%,
        transparent 74%
      ),
      radial-gradient(
        ellipse 88% 70% at 50% 42%,
        rgba(28, 32, 42, 0.18) 0%,
        transparent 68%
      ),
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.011) 0%,
        transparent 26%,
        transparent 72%,
        rgba(16, 18, 24, 0.12) 100%
      );
  }

  /* Home-local soft field behind the card (home tab only) */
  #cabinet-screen #tab-home {
    position: relative;
    isolation: isolate;
  }
  #cabinet-screen #tab-home::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: min(1180px, 100%);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(
        ellipse 62% 46% at 50% 42%,
        rgba(58, 82, 122, 0.11) 0%,
        rgba(40, 50, 70, 0.06) 40%,
        transparent 72%
      );
  }
  #cabinet-screen #tab-home > * {
    position: relative;
    z-index: 1;
  }

  /* 2) Home surface — stronger graphite, subtle top highlight,
     thin cool border, soft inner depth. No glass/glow/gradient border. */
  #cabinet-screen #tab-home .cs-home-panel.home-status {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.042) 0%, rgba(255, 255, 255, 0) 40%),
      linear-gradient(168deg, #1a1e28 0%, #141820 46%, #10141b 100%);
    border: 1px solid rgba(152, 170, 198, 0.145);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.055),
      inset 0 -12px 28px rgba(0, 0, 0, 0.18),
      0 14px 32px rgba(0, 0, 0, 0.26),
      0 2px 6px rgba(0, 0, 0, 0.16);
  }

  /* Keep signature edge readable on richer surface */
  #cabinet-screen #tab-home .cs-home-panel.home-status::after {
    opacity: 0.78;
    background:
      linear-gradient(
        135deg,
        transparent 0%,
        transparent calc(50% - 0.55px),
        rgba(168, 182, 206, 0.26) 50%,
        transparent calc(50% + 0.55px),
        transparent 100%
      );
  }

  /* 3) L/R transition — thin fade separator, same 1px line weight;
     zones read as one panel (not a thick divider). */
  #cabinet-screen #tab-home .cs-home-right {
    border-left: none;
    position: relative;
  }
  #cabinet-screen #tab-home .cs-home-right::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6%;
    bottom: 8%;
    width: 1px;
    pointer-events: none;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(158, 174, 200, 0.07) 12%,
      rgba(158, 174, 200, 0.13) 48%,
      rgba(158, 174, 200, 0.07) 86%,
      transparent 100%
    );
  }

  /* 5) Depth hierarchy — surface primary; quiet tertiary labels/actions
     (do not raise contrast of everything). */
  #cabinet-screen #tab-home .cs-home-eyebrow {
    color: rgba(148, 160, 180, 0.40);
  }
  #cabinet-screen #tab-home .cs-home-traffic-label .cs-home-traffic-kicker {
    color: rgba(148, 160, 180, 0.40);
  }
  #cabinet-screen #tab-home .home-until {
    color: rgba(148, 158, 176, 0.44);
  }
  #cabinet-screen #tab-home .cs-home-quiet-row,
  #cabinet-screen #tab-home .cs-home-quiet-row .btn,
  #cabinet-screen #tab-home .home-key-details > summary {
    color: rgba(154, 166, 186, 0.48);
  }
  #cabinet-screen #tab-home #home-copy-btn {
    color: rgba(168, 180, 200, 0.52);
    border-color: rgba(255, 255, 255, 0.05);
    background: transparent;
  }
  #cabinet-screen #tab-home .cs-home-footer {
    border-top-color: rgba(158, 174, 200, 0.07);
  }
  #cabinet-screen #tab-home .cs-home-renew-prompt,
  #cabinet-screen #tab-home .cs-home-footer {
    color: rgba(154, 166, 186, 0.50);
  }

  /* Ring + selected app stay secondary (slight presence, structure unchanged) */
  #cabinet-screen #tab-home .cs-home-ring {
    color: #1b4c9a;
  }
  #cabinet-screen #tab-home .cs-home-ring-arc {
    stroke: #0e347c;
  }
  #cabinet-screen #tab-home .cs-home-ring-marker {
    fill: #1b4c9a;
  }

  /* 4) Connection visual weight — icon/name up slightly; platform quieter;
     a bit more air around app header (not whole-zone enlarge). */
  #cabinet-screen #tab-home .cs-home-app-module {
    min-height: 54px;
    margin-bottom: 2px;
  }
  #cabinet-screen #tab-home .cs-home-app-face {
    gap: 15px;
  }
  #cabinet-screen #tab-home .cs-home-app-icon {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.10),
      0 1px 2px rgba(0, 0, 0, 0.22);
    filter: saturate(1.06) contrast(1.04);
  }
  #cabinet-screen #tab-home .cs-home-app-name {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #f7f9fd;
  }
  #cabinet-screen #tab-home .cs-home-app-plat {
    margin-top: 4px;
    color: rgba(148, 160, 180, 0.42);
    font-weight: 430;
  }
  #cabinet-screen #tab-home .cs-home-connect {
    gap: 15px;
  }
}

@media (min-width: 1440px) {
  #cabinet-screen .cabinet-panels::before {
    background:
      radial-gradient(
        ellipse 62% 50% at 50% 38%,
        rgba(56, 76, 112, 0.15) 0%,
        rgba(38, 46, 62, 0.09) 36%,
        rgba(24, 26, 32, 0.05) 54%,
        transparent 76%
      ),
      radial-gradient(
        ellipse 82% 66% at 50% 44%,
        rgba(28, 32, 42, 0.18) 0%,
        transparent 70%
      ),
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.012) 0%,
        transparent 24%,
        transparent 70%,
        rgba(14, 16, 22, 0.14) 100%
      );
  }
}
/* === end Desktop Home depth v39 === */




/* ==========================================================================
   Desktop HEADER / PROFILE REFINEMENT V40 (min-width: 769px)
   Premium one-line header: ZORIX | nav | support | avatar+name▾
   Mobile / logo / panel content untouched.
   ========================================================================== */
@media (min-width: 769px) {
  /* One-line composition */
  #cabinet-screen .cabinet-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 28px;
    row-gap: 0;
    flex-wrap: nowrap;
    margin-bottom: 10px;
    padding: 8px 0 0;
    min-height: 56px;
    background: rgba(14, 16, 20, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
  }

  /* Nav: slightly larger type, more spacing; active = bright + thin underline */
  #cabinet-screen .cabinet-tabs {
    grid-column: 2;
    justify-self: center;
    align-self: stretch;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-bottom: none;
    background: transparent;
    overflow: visible;
    max-width: 100%;
    --cs-tab-gap: 36px;
    --cs-tab-ink: #8b919c;
    --cs-tab-ink-hover: #d0d5de;
    --cs-tab-ink-active: #ffffff;
    --cs-tab-accent: #1e4fd6;
  }

  #cabinet-screen .cabinet-tab {
    padding: 16px 2px 14px;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--cs-tab-ink);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: color 0.22s ease;
  }

  #cabinet-screen .cabinet-tab:hover {
    color: var(--cs-tab-ink-hover);
    background: transparent;
  }

  #cabinet-screen .cabinet-tab.active {
    color: var(--cs-tab-ink-active);
    font-weight: 600;
    background: transparent;
    box-shadow: none;
  }

  #cabinet-screen .cabinet-tab::after {
    bottom: 0;
    height: 1px;
    background: var(--cs-tab-accent);
    border-radius: 0;
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.22s ease;
  }

  #cabinet-screen .cabinet-tab.active::after {
    transform: scaleX(1);
    opacity: 1;
  }

  /* Right cluster: support then profile */
  #cabinet-screen .cabinet-head-right {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 0;
  }

  #cabinet-screen .cabinet-head-actions {
    order: 1;
    gap: 0;
  }

  #cabinet-screen .cabinet-account {
    order: 2;
  }

  /* Hide refresh/logout icons from desktop header (stay in DOM for mobile + handlers) */
  #cabinet-screen .cabinet-head #refresh-btn,
  #cabinet-screen .cabinet-head #logout-btn {
    display: none !important;
  }

  /* Support: small subtle icon — no heavy square */
  #cabinet-screen .cabinet-support-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    color: rgba(160, 168, 180, 0.62);
    transition: color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
  }

  #cabinet-screen .cabinet-support-btn svg {
    width: 15px;
    height: 15px;
  }

  #cabinet-screen .cabinet-support-btn:hover,
  #cabinet-screen .cabinet-support-btn:focus-visible {
    color: #e8ecf2;
    background: rgba(255, 255, 255, 0.04);
    border-color: transparent;
    box-shadow: none;
    outline: none;
  }

  #cabinet-screen .cabinet-support-btn:active {
    background: rgba(255, 255, 255, 0.06);
  }

  /* Profile cluster: [avatar] Name ▾ — compact, no big frame */
  #cabinet-screen #account-trigger.cabinet-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    pointer-events: auto;
    padding: 2px 4px 2px 2px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    transition: background-color 0.16s ease, opacity 0.16s ease;
  }

  #cabinet-screen #account-trigger.cabinet-user:hover,
  #cabinet-screen .cabinet-account.is-open #account-trigger.cabinet-user {
    background: rgba(255, 255, 255, 0.035);
    border-color: transparent;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.04);
  }

  #cabinet-screen #who-sub,
  #cabinet-screen .who-sub {
    display: none !important;
  }

  #cabinet-screen #who-name,
  #cabinet-screen .who-name {
    max-width: 132px;
    font-size: 13px;
    font-weight: 550;
    letter-spacing: -0.01em;
    color: #e8ecf2;
    line-height: 1.2;
  }

  #cabinet-screen .account-caret {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    color: rgba(160, 168, 180, 0.70);
    margin-left: -2px;
    transition: transform 0.2s ease, color 0.16s ease;
    flex-shrink: 0;
  }

  #cabinet-screen .cabinet-account.is-open .account-caret {
    transform: rotate(180deg);
    color: rgba(200, 205, 214, 0.85);
  }

  /* Dropdown: graphite, thin border, soft fade/slide */
  #cabinet-screen .account-popover {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 80;
    width: min(292px, calc(100vw - 48px));
    padding: 10px 12px 10px;
    border-radius: 10px;
    border: 1px solid rgba(155, 170, 195, 0.14);
    background: #12141a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    color: #e8ecf2;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease;
    visibility: visible;
  }

  #cabinet-screen .account-popover[hidden] {
    display: block !important;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    visibility: hidden;
  }

  #cabinet-screen .account-popover-body {
    padding: 0 2px 4px;
    border-top: none;
    background: transparent;
  }

  #cabinet-screen #account-profile-box .kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    font-size: 12.5px;
    line-height: 1.35;
  }

  #cabinet-screen #account-profile-box .kv:last-child {
    border-bottom: none;
  }

  #cabinet-screen #account-profile-box .kv .k {
    color: #8b919c;
    font-weight: 400;
  }

  #cabinet-screen #account-profile-box .kv .v {
    color: #e6e8eb;
    font-weight: 500;
  }

  #cabinet-screen #account-profile-box .kv .v.mono {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    letter-spacing: 0.04em;
    font-size: 12px;
  }

  #cabinet-screen #account-profile-box .code-toggle {
    appearance: none;
    border: none;
    background: transparent;
    color: #8b919c;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
  }

  #cabinet-screen #account-profile-box .code-toggle:hover,
  #cabinet-screen #account-profile-box .code-toggle:focus-visible {
    color: #c8cdd6;
    outline: none;
  }

  #cabinet-screen .account-popover-action,
  #cabinet-screen .account-popover-logout {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: transparent;
    color: #c8cdd6;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  }

  #cabinet-screen .account-popover-action:hover,
  #cabinet-screen .account-popover-action:focus-visible {
    color: #f2f4f7;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
    outline: none;
  }

  #cabinet-screen .account-popover-logout {
    color: #a8aeb8;
    margin-top: 4px;
  }

  #cabinet-screen .account-popover-logout:hover,
  #cabinet-screen .account-popover-logout:focus-visible,
  #cabinet-screen .account-popover-logout:active {
    color: #e07070;
    border-color: rgba(180, 70, 70, 0.30);
    background: rgba(160, 50, 50, 0.08);
    outline: none;
  }
}

/* Hide desktop-only caret / refresh action on mobile */
@media (max-width: 768px) {
  #cabinet-screen .account-caret {
    display: none !important;
  }

  #cabinet-screen .account-popover-action {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cabinet-screen .cabinet-tab,
  #cabinet-screen .cabinet-tab::after,
  #cabinet-screen .account-popover,
  #cabinet-screen .account-caret,
  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-support-btn,
  #cabinet-screen .account-popover-action,
  #cabinet-screen .account-popover-logout {
    transition: none !important;
  }
}
/* === end Desktop HEADER / PROFILE V40 === */


/* ==========================================================================
   Desktop CONNECT ONE PREMIUM FLOW V41 (min-width: 769px)
   One cohesive surface: left interaction + embedded app preview.
   Mobile / other tabs / API untouched.
   ========================================================================== */
@media (min-width: 769px) {
  #cabinet-screen #tab-connect {
    --connect-ink: #f0f2f6;
    --connect-muted: rgba(168, 176, 190, 0.78);
    --connect-muted-2: rgba(140, 148, 164, 0.58);
    --connect-line: rgba(255, 255, 255, 0.08);
    --connect-panel: #14171e;
    --connect-panel-border: rgba(160, 176, 200, 0.12);
    --connect-deep: #14367a;
    --connect-deep-hover: #19428c;
    --connect-deep-tint: rgba(30, 79, 214, 0.16);
    --connect-deep-border: rgba(30, 79, 214, 0.38);
    --connect-green: #3dcf86;
  }

  #cabinet-screen #tab-connect .section {
    max-width: none;
    width: 100%;
  }

  /* Title lives inside the surface head on desktop */
  #cabinet-screen #tab-connect .section-head {
    display: none;
  }

  #cabinet-screen #tab-connect #desktop-key-card.keys-card,
  #cabinet-screen #tab-connect #desktop-key-card.card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0) 34%),
      var(--connect-panel);
    border: 1px solid var(--connect-panel-border);
    border-radius: 14px;
    padding: 28px 30px 22px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 10px 28px rgba(0, 0, 0, 0.22);
  }

  /* Top: title + subtitle left, status right */
  #cabinet-screen #tab-connect .desktop-key-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
  }

  #cabinet-screen #tab-connect .desktop-key-head-copy {
    min-width: 0;
  }

  #cabinet-screen #tab-connect .desktop-key-head h4 {
    display: block;
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--connect-ink);
  }

  #cabinet-screen #tab-connect .desktop-key-head .mobile-key-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 450;
    color: var(--connect-muted);
    max-width: 46ch;
  }

  /* Status: green dot + text only — no pill */
  #cabinet-screen #tab-connect #desktop-key-status {
    flex-shrink: 0;
    margin-top: 6px;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0;
    line-height: 1;
    font-weight: 600;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--connect-muted-2);
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge::after {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--connect-muted);
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-active::before {
    background: var(--connect-green);
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-active::after {
    content: "Активна";
    color: var(--connect-green);
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-inactive::after {
    content: "Неактивна";
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-expired::after {
    content: "Истекла";
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-quota::after {
    content: "Лимит";
  }

  #cabinet-screen #tab-connect .connect-section-title {
    display: none;
  }

  /* One scene: left flow + right preview, same surface */
  #cabinet-screen #tab-connect .connect-compose {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 0;
    align-items: stretch;
    margin-bottom: 0;
  }

  #cabinet-screen #tab-connect .connect-compose-main {
    display: block;
    min-width: 0;
    padding-right: 28px;
  }

  /* Compact horizontal segmented — no heavy frame */
  #cabinet-screen #tab-connect .connect-tabs {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: auto;
    max-width: 100%;
    margin: 0 0 10px;
    padding: 0;
    border: none;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
  }

  #cabinet-screen #tab-connect .connect-tab {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 96px;
    margin: 0;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: var(--connect-muted-2);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    box-shadow: none;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  }

  #cabinet-screen #tab-connect .connect-tab:hover {
    color: var(--connect-ink);
    background: rgba(255, 255, 255, 0.03);
    transform: none;
  }

  #cabinet-screen #tab-connect .connect-tab.active {
    color: #f2f5fa;
    background: var(--connect-deep-tint);
    border-color: var(--connect-deep-border);
    box-shadow: none;
  }

  #cabinet-screen #tab-connect .connect-tab .tab-title {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
  }

  #cabinet-screen #tab-connect .connect-tab .tab-meta {
    display: none;
  }

  #cabinet-screen #tab-connect .connect-tab:focus,
  #cabinet-screen #tab-connect .connect-tab:focus-visible,
  #cabinet-screen #tab-connect .connect-tab.active:focus-visible {
    outline: none;
    box-shadow: none;
  }

  #cabinet-screen #tab-connect .connect-platform {
    display: block;
    margin: 0 0 18px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted-2);
    letter-spacing: -0.01em;
  }

  #cabinet-screen #tab-connect .connect-platform-label {
    display: none;
  }

  #cabinet-screen #tab-connect .connect-platform-label.is-anywhere {
    display: inline;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-platform-label.is-anywhere {
    display: none;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-platform-label.is-happ {
    display: inline;
  }

  #cabinet-screen #tab-connect #connect-hint {
    display: none;
  }

  /* Actions: primary CTA + inline secondary utils */
  #cabinet-screen #tab-connect .desktop-key-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
  }

  #cabinet-screen #tab-connect #open-app-btn.btn,
  #cabinet-screen #tab-connect #open-app-btn {
    position: relative;
    isolation: isolate;
    order: 1;
    width: auto;
    min-width: 200px;
    max-width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 11px 20px;
    border-radius: 8px 2px 8px 8px;
    font-size: 14px;
    font-weight: 640;
    letter-spacing: -0.01em;
    color: #f5f8ff;
    background: var(--connect-deep);
    border: 1px solid rgba(70, 110, 180, 0.18);
    box-shadow: none;
    filter: none;
    background-image: none;
    text-decoration: none;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  #cabinet-screen #tab-connect #open-app-btn::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    pointer-events: none;
    z-index: 1;
    background:
      linear-gradient(
        135deg,
        transparent 0%,
        transparent calc(50% - 0.6px),
        rgba(210, 224, 255, 0.22) 50%,
        transparent calc(50% + 0.6px),
        transparent 100%
      );
    opacity: 0.55;
  }

  #cabinet-screen #tab-connect #open-app-btn::after {
    content: " →";
    font-weight: 500;
    opacity: 0.78;
    position: relative;
    z-index: 2;
  }

  #cabinet-screen #tab-connect #open-app-btn:hover {
    background: var(--connect-deep-hover);
    box-shadow: none;
    filter: none;
    transform: none;
  }

  #cabinet-screen #tab-connect .connect-utils {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    width: 100%;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn.btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn.connect-util {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--connect-muted);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: color 0.16s ease;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn:hover {
    background: transparent;
    border: none;
    color: var(--connect-ink);
    transform: none;
  }

  #cabinet-screen #tab-connect .connect-copy-full {
    display: none;
  }

  #cabinet-screen #tab-connect .connect-copy-short,
  #cabinet-screen #tab-connect .connect-util-ico {
    display: inline-block;
  }

  #cabinet-screen #tab-connect .connect-util-ico {
    flex-shrink: 0;
    opacity: 0.72;
  }

  #cabinet-screen #tab-connect .connect-url-details {
    order: 0;
    flex: none;
    width: auto;
    margin: 0;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted);
    list-style: none;
    cursor: pointer;
    user-select: none;
    transition: color 0.16s ease;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary::-webkit-details-marker {
    display: none;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary:hover {
    color: var(--connect-ink);
  }

  #cabinet-screen #tab-connect #desktop-key-url,
  #cabinet-screen #tab-connect .connect-url-details #desktop-key-url {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--connect-line);
    background: rgba(0, 0, 0, 0.22);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11.5px;
    line-height: 1.45;
    color: rgba(170, 180, 200, 0.72);
    word-break: break-all;
    white-space: normal;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-status {
    min-height: 16px;
    margin: 0 0 4px;
    font-size: 12px;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-status.ok {
    color: rgba(220, 226, 238, 0.88);
  }

  #cabinet-screen #tab-connect #connect-diag {
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: none;
  }

  /* Right preview — embedded, thin fade separator, no nested card */
  #cabinet-screen #tab-connect .connect-info-panel {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 4px 4px 4px 28px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    position: relative;
  }

  #cabinet-screen #tab-connect .connect-info-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6%;
    bottom: 6%;
    width: 1px;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.1) 18%,
      rgba(255, 255, 255, 0.1) 82%,
      transparent 100%
    );
    pointer-events: none;
  }

  #cabinet-screen #tab-connect .connect-info {
    display: none;
    align-items: flex-start;
    gap: 14px;
  }

  #cabinet-screen #tab-connect .connect-info-anywhere {
    display: flex;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-info-anywhere {
    display: none;
  }

  #cabinet-screen #tab-connect:has(.connect-tab[data-client-id="happ"].active) .connect-info-happ {
    display: flex;
  }

  #cabinet-screen #tab-connect .connect-info-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
  }

  #cabinet-screen #tab-connect .connect-info-copy {
    min-width: 0;
  }

  #cabinet-screen #tab-connect .connect-info-name {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--connect-ink);
  }

  #cabinet-screen #tab-connect .connect-info-plat {
    margin: 0 0 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted-2);
  }

  #cabinet-screen #tab-connect .connect-info-note {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--connect-muted);
  }

  /* Premium traffic metric strip */
  #cabinet-screen #tab-connect .desktop-key-meta {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 14px 0 0;
    border-top: none;
  }

  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-item,
  #cabinet-screen #tab-connect .desktop-key-meta .info-cell {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 0 0 10px;
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-label {
    margin: 0;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--connect-muted-2);
  }

  #cabinet-screen #tab-connect .desktop-key-meta #desktop-key-traffic,
  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-value {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--connect-ink);
    letter-spacing: -0.01em;
  }

  #cabinet-screen #tab-connect .desktop-key-meta::after {
    content: "";
    display: block;
    height: 1px;
    width: 100%;
    background: var(--connect-line);
  }

  /* Quiet old-keys accordion */
  #cabinet-screen #tab-connect #old-keys-panel.old-keys-panel {
    margin-top: 16px;
    padding: 0;
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-connect #old-keys-panel > summary {
    padding: 6px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--connect-muted-2);
    border: none;
    background: transparent;
  }

  #cabinet-screen #tab-connect #old-keys-panel > summary:hover {
    color: var(--connect-muted);
  }

  #cabinet-screen #tab-connect #old-keys-panel .table-wrap {
    margin-top: 10px;
    border: 1px solid var(--connect-line);
    border-radius: 10px;
    overflow: auto;
    background: rgba(0, 0, 0, 0.18);
  }
}

/* === CONNECT DENSITY V42 — #tab-connect desktop only ======================
   Tighten height ~10–15%, denser left flow, raise preview, stronger app mark.
   Structure / mobile / other tabs untouched.
   ========================================================================== */
@media (min-width: 769px) {
  #cabinet-screen #tab-connect #desktop-key-card.keys-card,
  #cabinet-screen #tab-connect #desktop-key-card.card {
    padding: 18px 22px 12px;
    border-radius: 13px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.035),
      0 6px 18px rgba(0, 0, 0, 0.18);
  }

  #cabinet-screen #tab-connect .desktop-key-head {
    gap: 14px;
    margin-bottom: 12px;
  }

  #cabinet-screen #tab-connect .desktop-key-head h4 {
    margin: 0 0 4px;
    font-size: 22px;
  }

  #cabinet-screen #tab-connect .desktop-key-head .mobile-key-note {
    font-size: 13.5px;
    line-height: 1.4;
    max-width: 44ch;
  }

  #cabinet-screen #tab-connect #desktop-key-status {
    margin-top: 2px;
  }

  #cabinet-screen #tab-connect .connect-compose {
    align-items: start;
  }

  #cabinet-screen #tab-connect .connect-compose-main {
    padding-right: 20px;
  }

  #cabinet-screen #tab-connect .connect-tabs {
    margin: 0 0 6px;
  }

  #cabinet-screen #tab-connect .connect-tab {
    min-height: 30px;
    min-width: 88px;
    padding: 5px 12px;
    font-size: 12.5px;
  }

  /* Platform quieter — denser under selector */
  #cabinet-screen #tab-connect .connect-platform {
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 450;
    color: rgba(130, 140, 156, 0.48);
    letter-spacing: 0;
  }

  #cabinet-screen #tab-connect .desktop-key-actions {
    gap: 8px;
    margin-bottom: 2px;
  }

  #cabinet-screen #tab-connect #open-app-btn.btn,
  #cabinet-screen #tab-connect #open-app-btn {
    min-width: 184px;
    min-height: 40px;
    padding: 9px 16px;
    font-size: 13.5px;
  }

  #cabinet-screen #tab-connect .connect-utils {
    gap: 2px 14px;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn.btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn.connect-util {
    font-size: 12px;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary {
    font-size: 12px;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-status {
    min-height: 14px;
    margin: 0 0 2px;
    font-size: 11.5px;
  }

  #cabinet-screen #tab-connect #connect-diag {
    margin-bottom: 6px;
  }

  /* Raise right preview toward interaction flow */
  #cabinet-screen #tab-connect .connect-info-panel {
    align-items: flex-start;
    padding: 0 0 0 18px;
    margin-top: 0;
  }

  #cabinet-screen #tab-connect .connect-info-panel::before {
    top: 4%;
    bottom: 18%;
  }

  #cabinet-screen #tab-connect .connect-info {
    gap: 12px;
  }

  /* App icon / name slightly stronger; platform quieter */
  #cabinet-screen #tab-connect .connect-info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  #cabinet-screen #tab-connect .connect-info-name {
    margin: 0 0 2px;
    font-size: 17.5px;
    font-weight: 700;
    letter-spacing: -0.025em;
  }

  #cabinet-screen #tab-connect .connect-info-plat {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 450;
    color: rgba(130, 140, 156, 0.48);
  }

  #cabinet-screen #tab-connect .connect-info-note {
    font-size: 12px;
    line-height: 1.35;
  }

  /* Traffic strip closer to main content */
  #cabinet-screen #tab-connect .desktop-key-meta {
    margin-top: 8px;
    padding: 8px 0 0;
  }

  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-item,
  #cabinet-screen #tab-connect .desktop-key-meta .info-cell {
    padding: 0 0 8px;
    gap: 12px;
  }

  #cabinet-screen #tab-connect #old-keys-panel.old-keys-panel {
    margin-top: 12px;
  }
}


/* ==========================================================================
   MOBILE POLISH V45 — max-width 768 (+ optional 400)
   Desktop ≥769 must remain unchanged. Appended last to win cascade.
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --cs-touch: 44px;
  }

  /* Global spacing when cabinet visible */
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: var(--m-pad-x, 18px) !important;
    padding-right: var(--m-pad-x, 18px) !important;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
  }

  #cabinet-screen {
    max-width: none;
    width: 100%;
    padding-bottom: calc(var(--m-nav-h, 64px) + env(safe-area-inset-bottom, 0px) + 20px);
    overflow-x: hidden;
  }

  #cabinet-screen .cabinet-panels,
  #cabinet-screen .cabinet-panel,
  #cabinet-screen .section,
  #cabinet-screen .card,
  #cabinet-screen .keys-card,
  #cabinet-screen .cs-home-panel {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* ---- Header: logo left + one account control ---- */
  #cabinet-screen .cabinet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
    min-height: var(--m-header-h, 44px);
    padding: 8px 0;
    margin-bottom: 10px;
    overflow: hidden;
  }

  #cabinet-screen .cabinet-tabs {
    display: none !important;
  }

  #cabinet-screen .cabinet-head-actions {
    display: none !important; /* refresh/support/logout live in account popover */
  }

  #cabinet-screen .cabinet-head-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    flex: 1 1 auto;
    margin-left: 8px;
  }

  #cabinet-screen .cabinet-account {
    min-width: 0;
    max-width: 100%;
  }

  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    min-height: 44px;
    max-width: 100%;
    gap: 8px;
    margin-left: 0;
    padding: 4px 6px 4px 4px;
    border-radius: 12px;
    box-sizing: border-box;
  }

  #cabinet-screen .cabinet-brand .logo {
    height: 26px;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  #cabinet-screen #who-name,
  #cabinet-screen .who-name {
    max-width: min(160px, 42vw);
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #cabinet-screen #who-sub,
  #cabinet-screen .who-sub {
    display: none;
  }

  /* legacy account details — header popover is the control */
  #cabinet-screen #profile-details {
    display: none !important;
  }

  #cabinet-screen #cabinet-status {
    margin-bottom: 12px;
  }

  /* ---- Bottom nav ---- */
  #cabinet-screen .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    gap: 2px;
    background: rgba(8, 10, 18, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  #cabinet-screen .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    min-width: 0;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: rgba(160, 170, 190, 0.62);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
    border-radius: 12px;
  }

  #cabinet-screen .mobile-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #cabinet-screen .mobile-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    flex-shrink: 0;
  }

  #cabinet-screen .mobile-nav-item.nav-tab.active {
    color: var(--cs-green, #3ee08a);
    background: rgba(62, 224, 138, 0.09);
  }

  #cabinet-screen .foot {
    margin-top: 20px;
    padding: 14px 0 8px;
  }

  /* ---- Home ---- */
  #cabinet-screen #tab-home .cs-home-body {
    gap: 16px;
  }

  #cabinet-screen #tab-home .home-days-num {
    font-size: var(--m-days, 40px) !important;
    line-height: 1;
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status {
    padding: 16px 16px 14px !important;
    margin-bottom: 4px;
  }

  #cabinet-screen #tab-home #home-client-seg.client-seg {
    max-width: none;
    width: 100%;
    height: auto !important;
    min-height: 44px;
    margin-bottom: 10px;
  }

  #cabinet-screen #tab-home .client-seg-btn {
    min-height: 44px !important;
    font-size: 13.5px;
  }

  #cabinet-screen #tab-home .home-connect-actions .btn,
  #cabinet-screen #tab-home #home-copy-btn,
  #cabinet-screen #tab-home #home-renew-btn,
  #cabinet-screen #tab-home .home-renew-btn {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
  }

  #cabinet-screen #tab-home .home-status-top {
    margin-bottom: 8px;
  }

  /* ---- Renew ---- */
  #cabinet-screen #tab-renew .section-head {
    margin-bottom: 14px;
  }

  #cabinet-screen #tab-renew .section-head h3 {
    font-size: 22px;
  }

  #cabinet-screen #tab-renew .plans {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #cabinet-screen #tab-renew .plan,
  #cabinet-screen #tab-renew button.plan {
    padding: 14px 14px 12px !important;
  }

  #cabinet-screen #tab-renew .plan .plan-price .num {
    font-size: 28px !important;
  }

  #cabinet-screen #tab-renew .renew-checkout-bar {
    margin-top: 14px;
    gap: 12px;
  }

  #cabinet-screen #tab-renew .plan-actions.pay-row,
  #cabinet-screen #tab-renew .plan-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px !important;
    margin-top: 12px;
  }

  #cabinet-screen #tab-renew .plan-actions .btn,
  #cabinet-screen #tab-renew #renew-btn,
  #cabinet-screen #tab-renew #check-payment-btn {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 44px;
    justify-content: center;
  }

  /* ---- Connect ---- */
  #cabinet-screen #tab-connect .section-head {
    margin-bottom: 12px;
  }

  #cabinet-screen #tab-connect .section-head h3 {
    font-size: 22px;
    margin: 0;
  }

  /* one title only — hide duplicate card heading */
  #cabinet-screen #tab-connect .desktop-key-head h4 {
    display: none !important;
  }

  #cabinet-screen #tab-connect .desktop-key-head .mobile-key-note {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cs-muted, rgba(190, 200, 230, 0.62));
  }

  #cabinet-screen #tab-connect .connect-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 14px;
    padding: 0;
    border: none;
    border-bottom: none;
  }

  #cabinet-screen #tab-connect .connect-tab {
    min-height: 44px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
  }

  #cabinet-screen #tab-connect .connect-tab.active {
    border-color: rgba(47, 111, 219, 0.45);
    background: rgba(47, 111, 219, 0.1);
    color: #e8eef8;
  }

  #cabinet-screen #tab-connect .desktop-key-actions,
  #cabinet-screen #tab-connect .url-box.desktop-key-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #cabinet-screen #tab-connect #open-app-btn.btn,
  #cabinet-screen #tab-connect #open-app-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  #cabinet-screen #tab-connect .connect-utils .btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* ---- About ---- */
  #cabinet-screen #tab-about .about-shell {
    padding-left: 2px;
    padding-right: 2px;
  }

  #cabinet-screen #tab-about .about-title,
  #cabinet-screen #tab-about .about-hero h2 {
    font-size: 22px !important;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
  }

  #cabinet-screen #tab-about .about-block {
    margin-bottom: 22px;
    max-width: none;
  }

  #cabinet-screen #tab-about .about-block h3 {
    font-size: 20px !important;
    margin: 0 0 10px;
  }

  #cabinet-screen #tab-about .about-block p,
  #cabinet-screen #tab-about .about-block li,
  #cabinet-screen #tab-about .about-intro p,
  #cabinet-screen #tab-about .about-prose p,
  #cabinet-screen #tab-about .apps-lead {
    font-size: 15.5px !important;
    line-height: 1.55 !important;
  }

  #cabinet-screen #tab-about .about-howto {
    gap: 12px;
  }

  #cabinet-screen #tab-about .about-docs {
    padding-bottom: 8px;
  }
}

/* Mid phones: keep pay stacked */
@media (max-width: 430px) {
  #cabinet-screen #tab-renew .plan-actions.pay-row,
  #cabinet-screen #tab-renew .plan-actions {
    flex-direction: column !important;
  }

  #cabinet-screen #tab-renew .plan-actions .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

@media (max-width: 400px) {
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: var(--m-pad-x-tight, 16px) !important;
    padding-right: var(--m-pad-x-tight, 16px) !important;
  }

  #cabinet-screen .cabinet-head {
    gap: 8px;
    padding: 6px 0;
    flex-wrap: nowrap !important;
  }

  #cabinet-screen .cabinet-brand .logo {
    height: 24px;
  }

  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    min-height: 40px;
    padding: 2px 4px 2px 2px;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 34px;
    height: 34px;
  }

  #cabinet-screen #who-name,
  #cabinet-screen .who-name {
    max-width: min(140px, 46vw);
    font-size: 13px;
  }

  #cabinet-screen .mobile-nav-item {
    font-size: 11px;
  }

  #cabinet-screen #tab-home .home-days-num {
    font-size: 38px !important;
  }

  #cabinet-screen #tab-about .about-title,
  #cabinet-screen #tab-about .about-hero h2 {
    font-size: 20px !important;
  }
}

/* Very narrow: stack connect app picker if needed */
@media (max-width: 340px) {
  #cabinet-screen #tab-connect .connect-tabs {
    grid-template-columns: 1fr !important;
  }
}

/* MOBILE POLISH V45b — hide login chrome when cabinet open; more about clearance */
body:has(#cabinet-screen:not(.hidden)) #top-nav,
body:has(#cabinet-screen:not(.hidden)) #login-foot {
  display: none !important;
}

@media (max-width: 768px) {
  #cabinet-screen {
    padding-bottom: calc(var(--m-nav-h, 64px) + env(safe-area-inset-bottom, 0px) + 28px) !important;
  }

  #cabinet-screen #tab-about .about-shell {
    padding-left: 2px;
    padding-right: 2px;
    padding-bottom: 12px;
  }

  #cabinet-screen #tab-about .about-docs:last-child,
  #cabinet-screen #tab-about .about-block:last-child {
    margin-bottom: 8px;
    padding-bottom: 16px;
  }
}

/* ==========================================================================
   MOBILE VISUAL PARITY V47 — match desktop quality, desktop ≥769 untouched
   Appended last. Primary breakpoint: max-width 768 (+ optional 400).
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --m-pad-x: 20px;
    --m-pad-x-tight: 16px;
    --m-section-gap: 22px;
    --m-card-pad: 20px;
    --m-row-gap: 14px;
    --m-title: 28px;
    --m-section: 21px;
    --m-body: 15.5px;
    --m-secondary: 13.5px;
    --m-days: 36px;
    --m-nav-h: 56px;
    --m-blue: #1e4fd6;
    --m-blue-soft: #2f6fdb;
    --m-surface: #12151c;
    --m-surface-2: #0e1118;
    --m-line: rgba(155, 170, 195, 0.12);
    --m-ink: #f2f4f7;
    --m-muted: rgba(190, 198, 210, 0.68);
    --m-muted-2: rgba(150, 160, 175, 0.48);
  }

  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: var(--m-pad-x) !important;
    padding-right: var(--m-pad-x) !important;
  }

  #cabinet-screen {
    padding-bottom: calc(var(--m-nav-h) + env(safe-area-inset-bottom, 0px) + 24px) !important;
  }

  /* ---- HEADER: desktop-shell feel ---- */
  #cabinet-screen .cabinet-head {
    min-height: 64px;
    height: auto;
    padding: 12px 0 !important;
    margin-bottom: 14px !important;
    gap: 12px !important;
    background: rgba(10, 11, 14, 0.96) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: none !important;
  }

  #cabinet-screen .cabinet-brand .logo {
    height: 28px !important;
  }

  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    min-height: 44px;
    padding: 4px 8px 4px 4px !important;
    gap: 10px !important;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  #cabinet-screen #who-name,
  #cabinet-screen .who-name {
    font-size: 14px !important;
    font-weight: 600;
    color: var(--m-ink);
    max-width: min(168px, 44vw);
  }

  /* ---- BOTTOM NAV: flat, light weight ---- */
  #cabinet-screen .mobile-bottom-nav {
    gap: 0 !important;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(8, 10, 14, 0.97) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: none !important;
  }

  #cabinet-screen .mobile-nav-item {
    gap: 3px !important;
    min-height: 48px !important;
    padding: 6px 2px !important;
    font-size: 11px !important;
    font-weight: 550 !important;
    color: var(--m-muted-2) !important;
    border-radius: 8px !important;
    background: transparent !important;
  }

  #cabinet-screen .mobile-nav-item svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 1.7;
  }

  #cabinet-screen .mobile-nav-item.nav-tab.active {
    color: var(--m-blue-soft) !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #cabinet-screen .mobile-nav-item.nav-tab.active svg {
    stroke: var(--m-blue-soft) !important;
  }

  /* ---- HOME: one compact premium card ---- */
  #cabinet-screen #tab-home .cs-home-panel.home-status {
    padding: 18px 18px 16px !important;
    margin-bottom: 0 !important;
    border-radius: 14px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 40%),
      linear-gradient(165deg, #171b23 0%, #13161d 55%, #10131a 100%) !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }

  #cabinet-screen #tab-home .cs-home-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  #cabinet-screen #tab-home .cs-home-left {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "days status"
      "until until"
      "traffic traffic";
    gap: 6px 12px;
    align-items: center;
  }

  #cabinet-screen #tab-home .home-status-top {
    grid-area: days;
    margin: 0 !important;
    gap: 8px !important;
    align-items: baseline;
  }

  #cabinet-screen #tab-home .home-days-num {
    font-size: var(--m-days) !important;
    font-weight: 720;
    letter-spacing: -0.03em;
    line-height: 1 !important;
    color: var(--m-ink);
  }

  #cabinet-screen #tab-home .home-days-unit {
    font-size: 14px !important;
    color: var(--m-muted);
  }

  #cabinet-screen #tab-home #home-status-label {
    grid-area: status;
    justify-self: end;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 600;
  }

  #cabinet-screen #tab-home .home-until {
    grid-area: until;
    margin: 0 !important;
    font-size: var(--m-secondary) !important;
    color: var(--m-muted-2) !important;
  }

  #cabinet-screen #tab-home #home-days-meter {
    display: none !important; /* days numeral carries the signal */
  }

  #cabinet-screen #tab-home .cs-home-traffic,
  #cabinet-screen #tab-home #home-traffic-meter {
    grid-area: traffic;
    margin: 4px 0 0 !important;
    max-width: none !important;
    width: 100%;
  }

  #cabinet-screen #tab-home .cs-home-traffic-label,
  #cabinet-screen #tab-home .home-meter-label {
    margin-bottom: 6px !important;
    font-size: 12px !important;
  }

  #cabinet-screen #tab-home .home-bar {
    height: 4px !important;
    border-radius: 99px;
  }

  #cabinet-screen #tab-home .cs-home-right {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #cabinet-screen #tab-home .cs-home-connect-head,
  #cabinet-screen #tab-home .cs-home-section-label {
    display: none !important;
  }

  #cabinet-screen #tab-home #home-client-seg.client-seg {
    width: 100% !important;
    max-width: none !important;
    min-height: 42px !important;
    height: 42px !important;
    margin: 0 0 10px !important;
    padding: 3px !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid var(--m-line) !important;
  }

  #cabinet-screen #tab-home .client-seg-btn {
    min-height: 36px !important;
    font-size: 13.5px !important;
    border-radius: 8px !important;
  }

  #cabinet-screen #tab-home .client-seg-btn.active {
    background: rgba(30, 79, 214, 0.22) !important;
    color: #e8eef8 !important;
  }

  #cabinet-screen #tab-home .home-connect-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #cabinet-screen #tab-home #home-open-btn,
  #cabinet-screen #tab-home .home-open-btn {
    min-height: 46px !important;
    border-radius: 11px !important;
    font-size: 14.5px !important;
  }

  #cabinet-screen #tab-home .cs-home-quiet-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
  }

  #cabinet-screen #tab-home #home-copy-btn {
    flex: 1 1 auto;
    min-height: 40px !important;
    width: auto !important;
  }

  #cabinet-screen #tab-home .home-key-details {
    flex: 0 0 auto;
  }

  #cabinet-screen #tab-home #home-renew-btn,
  #cabinet-screen #tab-home .home-renew-btn {
    margin-top: 4px;
    min-height: 44px !important;
    border-radius: 11px !important;
  }

  /* ---- RENEW: compact selectors ---- */
  #cabinet-screen #tab-renew .section-head {
    margin-bottom: 14px !important;
  }

  #cabinet-screen #tab-renew .section-head h3 {
    font-size: var(--m-title) !important;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: var(--m-ink);
  }

  #cabinet-screen #tab-renew .section-head .hint {
    font-size: var(--m-secondary);
    color: var(--m-muted-2);
  }

  #cabinet-screen #tab-renew .plans {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #cabinet-screen #tab-renew .plan,
  #cabinet-screen #tab-renew button.plan {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    column-gap: 12px !important;
    row-gap: 2px !important;
    padding: 12px 14px !important;
    min-height: 0 !important;
    border-radius: 12px !important;
    background: var(--m-surface) !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: none !important;
  }

  #cabinet-screen #tab-renew .plan .plan-duration {
    margin: 0 !important;
    font-size: 12px !important;
    letter-spacing: 0.08em;
    color: var(--m-muted-2) !important;
  }

  #cabinet-screen #tab-renew .plan .plan-price {
    margin: 0 !important;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
  }

  #cabinet-screen #tab-renew .plan .plan-price .num {
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
  }

  #cabinet-screen #tab-renew .plan .plan-price .cur {
    font-size: 13px !important;
  }

  #cabinet-screen #tab-renew .plan .plan-meta {
    margin: 0 !important;
    font-size: 12.5px !important;
    color: var(--m-muted) !important;
  }

  #cabinet-screen #tab-renew .plan .plan-price-old,
  #cabinet-screen #tab-renew .plan .plan-badge {
    display: none !important; /* no invented popular chrome on mobile */
  }

  #cabinet-screen #tab-renew .plan.active {
    border-color: rgba(30, 79, 214, 0.72) !important;
    background: rgba(30, 79, 214, 0.10) !important;
    box-shadow: inset 0 0 0 1px rgba(30, 79, 214, 0.22) !important;
  }

  #cabinet-screen #tab-renew .renew-checkout-bar {
    margin-top: 12px !important;
    padding-top: 12px;
    border-top: 1px solid var(--m-line);
    gap: 10px !important;
  }

  #cabinet-screen #tab-renew .renew-selection {
    margin: 0 !important;
    padding: 0 !important;
  }

  #cabinet-screen #tab-renew .plan-actions.pay-row,
  #cabinet-screen #tab-renew .plan-actions {
    margin-top: 8px !important;
    gap: 8px !important;
  }

  #cabinet-screen #tab-renew #renew-btn.btn-primary {
    min-height: 46px !important;
    border-radius: 11px !important;
    background: var(--m-blue) !important;
    border: none !important;
    box-shadow: none !important;
  }

  #cabinet-screen #tab-renew #renew-btn.btn-primary::before {
    display: none !important;
  }

  /* ---- CONNECT: compact desktop-like card ---- */
  #cabinet-screen #tab-connect .section-head {
    margin-bottom: 12px !important;
  }

  #cabinet-screen #tab-connect .section-head h3 {
    font-size: var(--m-title) !important;
    font-weight: 650;
    letter-spacing: -0.03em;
  }

  #cabinet-screen #tab-connect #desktop-key-card.keys-card,
  #cabinet-screen #tab-connect #desktop-key-card.card {
    padding: 18px 18px 16px !important;
    border-radius: 14px !important;
    background: var(--m-surface) !important;
    border: 1px solid var(--m-line) !important;
    box-shadow: none !important;
  }

  #cabinet-screen #tab-connect .desktop-key-head {
    margin-bottom: 12px !important;
  }

  #cabinet-screen #tab-connect .desktop-key-head .mobile-key-note {
    font-size: var(--m-secondary) !important;
    color: var(--m-muted) !important;
  }

  #cabinet-screen #tab-connect .connect-section-title {
    display: none !important;
  }

  #cabinet-screen #tab-connect .connect-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    margin: 0 0 12px !important;
    padding: 3px !important;
    border: 1px solid var(--m-line) !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, 0.025) !important;
  }

  #cabinet-screen #tab-connect .connect-tab {
    min-height: 42px !important;
    padding: 8px 10px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--m-muted-2) !important;
  }

  #cabinet-screen #tab-connect .connect-tab.active {
    background: rgba(30, 79, 214, 0.18) !important;
    border-color: transparent !important;
    color: #e8eef8 !important;
  }

  #cabinet-screen #tab-connect .connect-platform,
  #cabinet-screen #tab-connect #connect-hint {
    margin-bottom: 10px !important;
    font-size: var(--m-secondary) !important;
    color: var(--m-muted) !important;
  }

  #cabinet-screen #tab-connect .desktop-key-actions,
  #cabinet-screen #tab-connect .url-box.desktop-key-actions {
    gap: 8px !important;
  }

  #cabinet-screen #tab-connect #open-app-btn {
    min-height: 46px !important;
    border-radius: 11px !important;
    background: var(--m-blue) !important;
  }

  #cabinet-screen #tab-connect .connect-utils {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 8px !important;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn,
  #cabinet-screen #tab-connect .connect-url-details {
    flex: 1 1 0;
    min-width: 0;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn {
    width: auto !important;
    min-height: 40px !important;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--m-line);
    border-radius: 10px;
    padding: 0 10px;
    font-size: 13px;
  }

  #cabinet-screen #tab-connect .desktop-key-meta {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--m-line);
  }

  #cabinet-screen #tab-connect .desktop-key-meta .key-meta-item,
  #cabinet-screen #tab-connect .desktop-key-meta .info-cell {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  #cabinet-screen #tab-connect .connect-info-panel {
    display: none !important; /* picker already carries app identity */
  }

  /* ---- ABOUT: desktop structure, vertical ---- */
  #cabinet-screen #tab-about .about-title,
  #cabinet-screen #tab-about .about-hero h2 {
    font-size: var(--m-title) !important;
    font-weight: 650;
    letter-spacing: -0.03em;
    margin: 0 0 10px !important;
    color: var(--m-ink) !important;
  }

  #cabinet-screen #tab-about .about-hero {
    margin: 0 0 20px !important;
    padding: 0 0 16px !important;
    border-bottom: 1px solid var(--m-line);
  }

  #cabinet-screen #tab-about .about-intro p {
    font-size: var(--m-body) !important;
    line-height: 1.55 !important;
    color: var(--m-muted) !important;
    margin: 0 0 8px !important;
  }

  #cabinet-screen #tab-about .about-block {
    margin: 0 0 var(--m-section-gap) !important;
  }

  #cabinet-screen #tab-about .about-block > h3 {
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    margin: 0 0 10px !important;
    color: var(--m-ink) !important;
  }

  /* Hide prose wall; show feature rows like desktop */
  #cabinet-screen #tab-about .about-sub .about-sub-legacy {
    display: none !important;
  }

  #cabinet-screen #tab-about .about-howto {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  #cabinet-screen #tab-about .about-howto-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    margin: 0 !important;
    padding: 14px 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #cabinet-screen #tab-about .about-howto-row + .about-howto-row {
    border-top: 1px solid var(--m-line) !important;
  }

  #cabinet-screen #tab-about .about-howto-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--m-blue);
    opacity: 0.85;
    margin-top: 1px;
  }

  #cabinet-screen #tab-about .about-howto-icon svg {
    width: 18px;
    height: 18px;
  }

  #cabinet-screen #tab-about .about-howto-title {
    margin: 0 0 4px !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: var(--m-ink) !important;
    line-height: 1.35;
  }

  #cabinet-screen #tab-about .about-howto-desc {
    margin: 0 !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    color: var(--m-muted) !important;
  }

  #cabinet-screen #tab-about .about-apps .apps-lead {
    font-size: var(--m-secondary) !important;
    line-height: 1.5 !important;
    color: var(--m-muted) !important;
    margin: 0 0 12px !important;
  }

  #cabinet-screen #tab-about .about-apps .apps-grid,
  #cabinet-screen #tab-about #public-apps-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #cabinet-screen #tab-about .about-apps .app-card {
    padding: 14px 14px 12px !important;
    border-radius: 12px !important;
    background: var(--m-surface) !important;
    border: 1px solid var(--m-line) !important;
    border-left: 1.5px solid rgba(30, 79, 214, 0.55) !important;
    box-shadow: none !important;
    gap: 12px !important;
  }

  #cabinet-screen #tab-about .about-apps .app-card-mark,
  #cabinet-screen #tab-about .about-apps .app-card-mark img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
  }

  #cabinet-screen #tab-about .about-apps .app-card-title {
    font-size: 16px !important;
    margin: 0 0 4px !important;
  }

  #cabinet-screen #tab-about .about-apps .app-card-meta,
  #cabinet-screen #tab-about .about-apps .app-card-desc {
    font-size: 12.5px !important;
    color: var(--m-muted) !important;
  }

  #cabinet-screen #tab-about .about-apps .app-card .btn,
  #cabinet-screen #tab-about .about-apps .app-card a.btn {
    min-height: 40px !important;
    font-size: 13.5px !important;
  }

  #cabinet-screen #tab-about .about-docs-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #cabinet-screen #tab-about .about-doc {
    border-top: 1px solid var(--m-line);
  }

  #cabinet-screen #tab-about .about-doc-summary {
    padding: 12px 0 !important;
    font-size: 14px !important;
  }
}

@media (max-width: 400px) {
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: var(--m-pad-x-tight, 16px) !important;
    padding-right: var(--m-pad-x-tight, 16px) !important;
  }

  #cabinet-screen .cabinet-head {
    min-height: 60px;
    padding: 10px 0 !important;
  }

  #cabinet-screen #tab-home .home-days-num {
    font-size: 34px !important;
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status,
  #cabinet-screen #tab-connect #desktop-key-card.keys-card {
    padding: 16px 14px 14px !important;
  }

  #cabinet-screen #tab-renew .section-head h3,
  #cabinet-screen #tab-connect .section-head h3,
  #cabinet-screen #tab-about .about-title {
    font-size: 26px !important;
  }
}

/* V47b — keep ~20px side padding through 390; tighten only ≤360 */
@media (max-width: 768px) {
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status {
    padding: 16px 16px 14px !important;
  }

  #cabinet-screen #tab-home .cs-home-body {
    gap: 12px !important;
  }

  #cabinet-screen #tab-home .cs-home-left {
    gap: 4px 10px !important;
  }

  #cabinet-screen #tab-home #home-client-seg.client-seg {
    margin-bottom: 8px !important;
  }
}

@media (max-width: 360px) {
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* V47c — renew contrast + nav active sync polish */
@media (max-width: 768px) {
  #cabinet-screen #tab-renew .section-head h3 {
    color: #f2f4f7 !important;
  }

  #cabinet-screen #tab-renew .section-head .hint {
    color: rgba(190, 198, 210, 0.55) !important;
  }

  #cabinet-screen #tab-renew .plan,
  #cabinet-screen #tab-renew button.plan {
    color: #e8eef8 !important;
  }

  #cabinet-screen #tab-renew .plan .plan-duration {
    color: rgba(190, 198, 210, 0.72) !important;
  }

  #cabinet-screen #tab-renew .plan .plan-price .num {
    color: #f4f6f8 !important;
  }

  #cabinet-screen #tab-renew .plan .plan-price .cur {
    color: rgba(190, 198, 210, 0.62) !important;
  }

  #cabinet-screen #tab-renew .plan .plan-meta {
    color: rgba(170, 180, 198, 0.62) !important;
  }

  #cabinet-screen #tab-renew .plan.active .plan-duration,
  #cabinet-screen #tab-renew .plan.active .plan-meta {
    color: rgba(210, 220, 242, 0.88) !important;
  }

  #cabinet-screen #tab-renew .renew-selection-label,
  #cabinet-screen #tab-renew .renew-selection-term,
  #cabinet-screen #tab-renew .renew-selection-price {
    color: rgba(210, 218, 232, 0.85) !important;
  }

  #cabinet-screen #tab-renew #check-payment-btn {
    color: #e8eef8 !important;
    border-color: rgba(155, 170, 195, 0.22) !important;
  }
}

/* V47d — bottom nav active color reliability + about row compactness */
@media (max-width: 768px) {
  #cabinet-screen .mobile-nav-item.active,
  #cabinet-screen .mobile-nav-item.nav-tab.active {
    color: #2f6fdb !important;
    background: transparent !important;
  }

  #cabinet-screen .mobile-nav-item:not(.active) {
    color: rgba(150, 160, 175, 0.48) !important;
  }

  #cabinet-screen #tab-about .about-howto-row {
    padding: 12px 0 !important;
    gap: 10px !important;
  }

  #cabinet-screen #tab-about .about-howto-title {
    font-size: 14px !important;
  }

  #cabinet-screen #tab-about .about-howto-desc {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }
}

/* ==========================================================================
   MOBILE MICRO-POLISH V51 — header gap + connect hierarchy + about clearance
   Desktop ≥769 unchanged.
   ========================================================================== */

@media (max-width: 768px) {
  /*
   * Safe-area issue: index.html @≤520 sets
   *   .wrap { padding: max(18px, env(safe-area-inset-top)) ... }
   * while cabinet-shell only overrode left/right — top gap stacked under
   * browser chrome. For cabinet, kill wrap top pad; apply safe-area once
   * on the sticky header if needed (standalone PWA).
   */
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  #cabinet-screen .cabinet-head {
    min-height: 56px !important;
    height: auto !important;
    padding: max(6px, env(safe-area-inset-top, 0px)) 0 6px !important;
    margin-bottom: 6px !important;
    gap: 10px !important;
    align-items: center !important;
  }

  #cabinet-screen .cabinet-brand,
  #cabinet-screen .cabinet-head-right,
  #cabinet-screen .cabinet-account,
  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    align-items: center !important;
  }

  #cabinet-screen .cabinet-brand .logo {
    height: 26px !important;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
  }

  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    min-height: 44px !important;
    padding: 2px 4px 2px 2px !important;
  }

  /* Long pages: nav + safe-area + 24px */
  #cabinet-screen {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 24px) !important;
  }

  #cabinet-screen #tab-about .about-docs,
  #cabinet-screen #tab-about .about-block:last-child {
    padding-bottom: 20px !important;
    margin-bottom: 8px !important;
  }

  /* ---- Connect primary CTA: deep blue + WHITE text ---- */
  #cabinet-screen #tab-connect #open-app-btn.btn,
  #cabinet-screen #tab-connect #open-app-btn.btn-primary,
  #cabinet-screen #tab-connect #open-app-btn {
    min-height: 54px !important;
    height: auto !important;
    padding: 14px 18px !important;
    border-radius: 12px !important;
    background: #1e4fd6 !important;
    background-image: none !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 650 !important;
    letter-spacing: -0.01em;
    box-shadow: none !important;
    filter: none !important;
    clip-path: none !important;
  }

  #cabinet-screen #tab-connect #open-app-btn::before,
  #cabinet-screen #tab-connect #open-app-btn::after {
    display: none !important;
    content: none !important;
  }

  #cabinet-screen #tab-connect #open-app-btn:hover {
    background: #254fbf !important;
    color: #ffffff !important;
  }

  /* Home primary open CTA — same hierarchy */
  #cabinet-screen #tab-home #home-open-btn,
  #cabinet-screen #tab-home .home-open-btn {
    min-height: 54px !important;
    border-radius: 12px !important;
    background: #1e4fd6 !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 650 !important;
    border: none !important;
  }

  /* ---- Secondary actions: compact ---- */
  #cabinet-screen #tab-connect .connect-utils {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 2px;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn.btn,
  #cabinet-screen #tab-connect #copy-desktop-key-btn,
  #cabinet-screen #tab-connect .connect-url-details > summary {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    font-weight: 550 !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(155, 170, 195, 0.14) !important;
    color: rgba(210, 218, 232, 0.82) !important;
    box-shadow: none !important;
  }

  #cabinet-screen #tab-connect .connect-copy-full {
    display: none !important;
  }

  #cabinet-screen #tab-connect .connect-copy-short {
    display: inline !important;
  }

  #cabinet-screen #tab-connect .connect-url-details {
    flex: 1 1 0;
    min-width: 0;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    list-style: none;
  }

  #cabinet-screen #tab-connect .connect-url-details > summary::-webkit-details-marker {
    display: none;
  }

  #cabinet-screen #tab-connect #copy-desktop-key-btn {
    flex: 1 1 0;
    width: auto !important;
    justify-content: center !important;
    gap: 6px !important;
  }

  /* Home secondary copy / show-link row */
  #cabinet-screen #tab-home .cs-home-quiet-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #cabinet-screen #tab-home #home-copy-btn,
  #cabinet-screen #tab-home .home-key-details > summary {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    font-weight: 550 !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(155, 170, 195, 0.14) !important;
    color: rgba(210, 218, 232, 0.82) !important;
    width: auto !important;
  }

  #cabinet-screen #tab-home #home-copy-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  #cabinet-screen #tab-home .home-key-details {
    flex: 0 1 auto;
  }

  #cabinet-screen #tab-home .home-key-details > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
}

@media (max-width: 400px) {
  body:has(#cabinet-screen:not(.hidden)) .wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #cabinet-screen .cabinet-head {
    padding: max(4px, env(safe-area-inset-top, 0px)) 0 4px !important;
    min-height: 52px !important;
  }

  #cabinet-screen .cabinet-brand .logo {
    height: 24px !important;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 40px !important;
    height: 40px !important;
  }
}

/* ==========================================================================
   HEADER FULL-WIDTH SHELL V52
   Outer header shell = full viewport width.
   Inner content = existing cabinet max-width grid.
   ========================================================================== */

:root {
  --site-max-width: 920px;
  --site-pad-x: 28px;
  --site-pad-x-mobile: 18px;
}

/* When cabinet is open, do not let .wrap clip the header shell */
body:has(#cabinet-screen:not(.hidden)) .wrap {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: visible !important;
}

body:has(#cabinet-screen:not(.hidden)) {
  overflow-x: hidden;
}

#cabinet-screen {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  overflow: visible !important;
}

/* Outer shell: edge-to-edge background + border */
#cabinet-screen .cabinet-head {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
  border-radius: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Inner row: existing centered content width */
#cabinet-screen .cabinet-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  width: min(100%, var(--site-max-width));
  max-width: var(--site-max-width);
  margin: 0 auto;
  box-sizing: border-box;
  padding-left: var(--site-pad-x-mobile);
  padding-right: var(--site-pad-x-mobile);
  padding-top: 12px;
  padding-bottom: 10px;
  min-height: 56px;
}

/* Constrain page content to previous 920px column */
#cabinet-screen .cabinet-panels,
#cabinet-screen #profile-details,
#cabinet-screen #cabinet-status,
#cabinet-screen #cabinet-toast,
#cabinet-screen > .foot {
  width: min(100%, var(--site-max-width));
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: var(--site-pad-x-mobile);
  padding-right: var(--site-pad-x-mobile);
}

/* Bottom nav stays full-bleed */
#cabinet-screen .mobile-bottom-nav {
  width: 100%;
  max-width: none;
  left: 0;
  right: 0;
}

@media (max-width: 768px) {
  #cabinet-screen .cabinet-head-inner {
    padding-left: var(--site-pad-x-mobile);
    padding-right: var(--site-pad-x-mobile);
    padding-top: max(6px, env(safe-area-inset-top, 0px));
    padding-bottom: 6px;
    min-height: 56px;
    gap: 10px;
  }

  #cabinet-screen .cabinet-panels,
  #cabinet-screen #profile-details,
  #cabinet-screen #cabinet-status,
  #cabinet-screen #cabinet-toast,
  #cabinet-screen > .foot {
    padding-left: var(--site-pad-x-mobile);
    padding-right: var(--site-pad-x-mobile);
  }
}

@media (max-width: 400px) {
  #cabinet-screen .cabinet-head-inner,
  #cabinet-screen .cabinet-panels,
  #cabinet-screen #profile-details,
  #cabinet-screen #cabinet-status,
  #cabinet-screen #cabinet-toast,
  #cabinet-screen > .foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  #cabinet-screen .cabinet-head-inner {
    padding-top: max(4px, env(safe-area-inset-top, 0px));
    padding-bottom: 4px;
    min-height: 52px;
  }
}

@media (min-width: 769px) {
  #cabinet-screen .cabinet-head-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 28px;
    row-gap: 0;
    flex-wrap: nowrap;
    width: min(100%, var(--site-max-width));
    padding-left: 0;
    padding-right: 0;
    padding-top: 8px;
    padding-bottom: 0;
    min-height: 56px;
  }

  #cabinet-screen .cabinet-panels,
  #cabinet-screen #profile-details,
  #cabinet-screen #cabinet-status,
  #cabinet-screen #cabinet-toast,
  #cabinet-screen > .foot {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ==========================================================================
   MOBILE FINAL MICRO-FIX V53
   Desktop ≥769 unchanged for layout internals.
   ========================================================================== */

/* Compact subscription URL reveal (Home + Connect) */
#cabinet-screen .sub-url-reveal.has-url {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.22);
  max-width: 100%;
  box-sizing: border-box;
}

#cabinet-screen .sub-url-reveal .sub-url-label {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(160, 170, 188, 0.62);
  margin: 0 0 4px;
}

#cabinet-screen .sub-url-reveal .sub-url-masked {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.35;
  color: rgba(170, 180, 200, 0.78);
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 2.8em;
  white-space: normal;
}

#cabinet-screen #tab-home .home-key-details .home-url-hide {
  display: none;
}
#cabinet-screen #tab-home .home-key-details[open] .home-url-show {
  display: none;
}
#cabinet-screen #tab-home .home-key-details[open] .home-url-hide {
  display: inline;
}

/* Stop forcing Connect URL open on mobile */
@media (max-width: 768px) {
  #cabinet-screen #tab-connect .connect-url-details > *:not(summary) {
    display: revert !important;
  }
  #cabinet-screen #tab-connect .connect-url-details:not([open]) > *:not(summary) {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* ---- 1) Header vertical density ---- */
  #cabinet-screen .cabinet-head {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin-bottom: 4px !important;
    gap: 0 !important;
  }

  #cabinet-screen .cabinet-head-inner {
    min-height: 0 !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: max(2px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 2px !important;
  }

  #cabinet-screen .cabinet-brand,
  #cabinet-screen .cabinet-head-right,
  #cabinet-screen .cabinet-account,
  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    align-items: center !important;
  }

  #cabinet-screen #account-trigger.cabinet-user,
  #cabinet-screen .cabinet-user.who {
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 2px 0 0 !important;
  }

  #cabinet-screen .cabinet-brand .logo {
    height: 26px !important;
  }

  #cabinet-screen .cabinet-user .avatar {
    width: 40px !important;
    height: 40px !important;
  }

  /* ---- 2) Compact URL reveal boxes ---- */
  #cabinet-screen #tab-home #home-key-url.sub-url-reveal,
  #cabinet-screen #tab-connect #desktop-key-url.sub-url-reveal {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.22);
    font-size: inherit;
    word-break: normal;
    white-space: normal;
    overflow: hidden;
  }

  #cabinet-screen #tab-home #home-key-url.sub-url-reveal:not(.has-url),
  #cabinet-screen #tab-connect #desktop-key-url.sub-url-reveal:not(.has-url) {
    background: transparent;
    border: none;
    padding: 6px 0 0;
    color: rgba(160, 170, 188, 0.55);
    font-size: 12px;
  }

  /* ---- 3) Connect active badge: no pill ---- */
  #cabinet-screen #tab-connect .desktop-key-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status {
    order: 2;
    margin: 0 !important;
    align-self: flex-start !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 1 !important;
    font-weight: 600 !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge::before {
    content: "" !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    background: rgba(140, 150, 168, 0.55) !important;
    box-shadow: none !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge::after {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    color: rgba(170, 178, 192, 0.72) !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-active::before {
    background: #3dcf86 !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-active::after {
    content: "Подписка активна" !important;
    color: #3dcf86 !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-inactive::after {
    content: "Подписка неактивна" !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-expired::after {
    content: "Подписка истекла" !important;
  }

  #cabinet-screen #tab-connect #desktop-key-status .badge.b-quota::after {
    content: "Лимит трафика" !important;
  }

  /* Home status: under meta, not detached top-right pill */
  #cabinet-screen #tab-home .cs-home-left {
    grid-template-areas:
      "days days"
      "status status"
      "until until"
      "traffic traffic" !important;
    gap: 4px 10px !important;
  }

  #cabinet-screen #tab-home #home-status-label {
    grid-area: status !important;
    justify-self: start !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
  }

  #cabinet-screen #tab-home #home-status-label.is-active {
    color: #3dcf86 !important;
  }

  #cabinet-screen #tab-home #home-status-label.is-active::before {
    content: "" !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: #3dcf86 !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 400px) {
  #cabinet-screen .cabinet-head {
    min-height: 0 !important;
    padding: 0 !important;
  }

  #cabinet-screen .cabinet-head-inner {
    min-height: 0 !important;
    padding-top: max(2px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 2px !important;
  }
}


/* HIDE EMPTY WRAP WHEN CABINET OPEN (cabinet is outside .wrap since V54) */
body:has(#cabinet-screen:not(.hidden)) .wrap {
  display: none !important;
}

/* ==========================================================================
   DESKTOP HEADER FULL-WIDTH V54
   Desktop only. Mobile header already full-width — leave ≤768 untouched.
   Cabinet lives outside .wrap; outer shell spans viewport; inner stays 920.
   ========================================================================== */

@media (min-width: 769px) {
  #cabinet-screen {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
  }

  /* Outer shell: full viewport background + bottom border */
  #cabinet-screen .cabinet-head {
    display: block !important;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    background: rgba(14, 16, 20, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
  }

  /* Inner content: unchanged centered grid */
  #cabinet-screen .cabinet-head-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 28px;
    width: min(100%, var(--site-max-width, 920px));
    max-width: var(--site-max-width, 920px);
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }
}

/* ==========================================================================
   MOBILE SPACING MICRO-FIX V55
   Home + Connect vertical rhythm only. Desktop ≥769 untouched.
   Use padding (not collapsing margins) for reliable header gaps.
   ========================================================================== */

@media (max-width: 768px) {
  /* Home: ~20px header shell → card */
  #cabinet-screen #tab-home #home-section {
    padding-top: 8px !important;
  }

  #cabinet-screen #tab-home .cs-home-panel.home-status {
    margin-top: 0 !important;
    padding-top: 14px !important;
  }

  /* Connect: ~20px header → title; ~16px title → card */
  #cabinet-screen #tab-connect #connect-section {
    padding-top: 8px !important;
  }

  #cabinet-screen #tab-connect .section-head {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
  }
}
