/*
 * NexusBot product experience layer.
 * Turns the operational dashboard into a guided customer workspace while
 * keeping the existing Material components and runtime behaviour intact.
 */

:root {
  --product-success: #16a36a;
  --product-success-soft: #e9fbf3;
  --product-premium: #7c5cff;
  --product-premium-soft: #f0edff;
  --product-warm: #f4b740;
  --product-ink: #081120;
}

[data-theme="dark"] {
  --product-success: #57d6a0;
  --product-success-soft: #123c30;
  --product-premium: #a999ff;
  --product-premium-soft: #29234d;
  --product-warm: #f2c96d;
  --product-ink: #f7f9ff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  background:
    radial-gradient(circle at 82% -20%, color-mix(in srgb, var(--md-sys-color-primary) 9%, transparent), transparent 36rem),
    var(--app-canvas);
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* Header: make the important destinations visible without looking like a toolbar. */
.top-app-bar {
  min-height: 76px;
  padding-inline: 24px;
  border-bottom-color: color-mix(in srgb, var(--app-border) 82%, transparent);
}

.top-app-bar .brand-block {
  width: auto;
  min-width: 250px;
}

.brand-icon {
  position: relative;
  background: linear-gradient(145deg, #4d8dff, #7668ff) !important;
  box-shadow: 0 10px 24px rgb(50 91 214 / 24%) !important;
}

.top-app-bar .brand-text h1 {
  font-size: 19px;
}

.top-app-bar .brand-subtitle {
  color: var(--app-text-muted);
  font-size: 11px;
  letter-spacing: -.01em;
}

.top-app-bar .header-actions {
  gap: 10px;
  flex-wrap: nowrap;
}

.commerce-entry,
.profile-entry {
  min-height: 46px;
  border: 1px solid var(--app-border);
  border-radius: 15px;
  color: var(--app-text);
  cursor: pointer;
  transition-property: transform, border-color, background-color, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.commerce-entry:hover,
.profile-entry:hover {
  transform: translateY(-1px);
  border-color: var(--app-selected-border);
  box-shadow: 0 10px 28px rgb(20 37 67 / 10%);
}

.commerce-entry:active,
.profile-entry:active {
  transform: scale(.97);
}

.commerce-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 13px 6px 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--product-premium-soft) 82%, var(--app-panel)), var(--app-panel));
  border-color: color-mix(in srgb, var(--product-premium) 28%, var(--app-border));
}

.commerce-entry > .material-symbols-outlined {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #8d6dff, #5d5df2);
  font-size: 18px !important;
  box-shadow: 0 6px 14px rgb(96 76 220 / 22%);
}

.commerce-entry__copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.commerce-entry__copy strong {
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.commerce-entry__copy small {
  color: var(--app-text-muted);
  font-size: 10px;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
}

.profile-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--app-panel);
  font-size: 12px;
  font-weight: 650;
}

.profile-entry__avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px;
  color: var(--md-sys-color-primary);
  background: var(--app-blue-soft);
  font-size: 19px !important;
}

#status-badge[disabled] {
  opacity: 1;
}

/* Account rail: orient first, then offer actions. */
.navigation-drawer {
  background: color-mix(in srgb, var(--app-panel-muted) 92%, var(--app-panel));
}

.drawer-header {
  padding: 26px 20px 10px;
}

.drawer-header h2 {
  color: var(--app-text);
  font-size: 14px;
  letter-spacing: -.01em;
  text-transform: none;
}

.drawer-subtitle {
  padding-left: 30px;
  line-height: 18px;
}

.drawer-search {
  padding-top: 10px;
}

.drawer-footer {
  padding: 14px 16px 16px;
  gap: 11px;
}

.drawer-plan-card {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--product-premium) 24%, var(--app-border));
  border-radius: 15px;
  color: var(--app-text);
  background: linear-gradient(145deg, color-mix(in srgb, var(--product-premium-soft) 58%, var(--app-panel)), var(--app-panel));
  cursor: pointer;
  text-align: left;
  transition-property: transform, border-color, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.drawer-plan-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--product-premium) 50%, var(--app-border));
  box-shadow: var(--app-shadow-sm);
}

.drawer-plan-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--product-premium);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.drawer-plan-card__topline .material-symbols-outlined {
  font-size: 16px !important;
}

.drawer-plan-card strong {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.drawer-usage-track {
  width: 100%;
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-border) 86%, transparent);
}

.drawer-usage-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6b63f6, #9a77ff);
  transition-property: width;
  transition-duration: 260ms;
  transition-timing-function: ease-out;
}

.drawer-active-row {
  min-height: 36px;
}

.drawer-active-label {
  font-size: 11px;
}

#add-account-btn {
  width: 100%;
  min-height: 46px;
  --md-filled-tonal-button-container-color: var(--md-sys-color-primary);
  --md-filled-tonal-button-label-text-color: var(--md-sys-color-on-primary);
  --md-filled-tonal-button-icon-color: var(--md-sys-color-on-primary);
}

/* Workspace title uses human context instead of internal identifiers. */
.content-document {
  padding-top: 28px;
}

.workspace-header {
  min-height: auto;
  margin-bottom: 18px;
  padding-inline: 2px;
}

.workspace-eyebrow,
.journey-eyebrow,
.status-card-eyebrow,
.commerce-kicker {
  display: block;
  color: var(--md-sys-color-primary);
  font-size: 10px;
  line-height: 15px;
  font-weight: 750;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.workspace-eyebrow {
  margin: 0 0 7px 42px;
}

.workspace-header-title {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 34px;
  text-wrap: balance;
}

.workspace-header-subtitle {
  color: var(--app-text-muted);
  font-size: 13px;
  text-wrap: pretty;
}

/* Guided journey: the default screen now answers “what next?”. */
.journey-panel {
  --journey-progress: 0%;
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 25%, var(--app-border));
  border-radius: 22px;
  background:
    radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--product-premium) 12%, transparent), transparent 20rem),
    linear-gradient(145deg, color-mix(in srgb, var(--app-panel) 96%, var(--md-sys-color-primary)), var(--app-panel));
  box-shadow: 0 16px 40px rgb(14 39 83 / 8%);
}

.journey-panel::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
}

.journey-panel__intro {
  max-width: 660px;
}

.journey-panel__intro h3 {
  margin: 5px 0 5px;
  color: var(--app-text);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.25;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.journey-panel__intro p {
  margin: 0;
  color: var(--app-text-muted);
  font-size: 13px;
  text-wrap: pretty;
}

.journey-progress {
  height: 5px;
  margin: 21px 0 16px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-border) 76%, transparent);
}

.journey-progress span {
  display: block;
  width: var(--journey-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--product-premium));
  transition-property: width;
  transition-duration: 320ms;
  transition-timing-function: ease-out;
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.journey-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 62px;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--app-text-muted);
  background: color-mix(in srgb, var(--app-panel-muted) 84%, transparent);
  cursor: pointer;
  text-align: left;
  transition-property: transform, color, border-color, background-color;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.journey-step:hover {
  transform: translateY(-1px);
  color: var(--app-text);
  border-color: var(--app-border-strong);
}

.journey-step__index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--app-text-muted);
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  font-size: 11px;
  font-weight: 750;
}

.journey-step strong,
.journey-step small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-step strong {
  color: inherit;
  font-size: 12px;
  line-height: 17px;
  font-weight: 700;
}

.journey-step small {
  margin-top: 1px;
  color: var(--app-text-muted);
  font-size: 10px;
  line-height: 14px;
}

.journey-step__state {
  color: var(--app-border-strong);
  font-size: 17px !important;
}

.journey-step.is-complete {
  color: var(--product-success);
  background: color-mix(in srgb, var(--product-success-soft) 70%, transparent);
}

.journey-step.is-complete .journey-step__index {
  color: var(--product-success);
  border-color: color-mix(in srgb, var(--product-success) 28%, var(--app-border));
  background: var(--product-success-soft);
}

.journey-step.is-complete .journey-step__state {
  color: var(--product-success);
}

.journey-step.is-current {
  color: var(--md-sys-color-primary);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 34%, var(--app-border));
  background: var(--app-blue-soft);
}

.journey-step.is-current .journey-step__index {
  color: var(--md-sys-color-on-primary);
  border-color: transparent;
  background: var(--md-sys-color-primary);
}

.journey-step.is-current .journey-step__state {
  color: var(--md-sys-color-primary);
}

.journey-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 17px;
  padding: 13px 14px 13px 17px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--app-panel) 88%, transparent);
}

.journey-next > div > span,
.journey-next > div > strong {
  display: block;
}

.journey-next > div > span {
  color: var(--app-text-muted);
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.journey-next > div > strong {
  margin-top: 2px;
  color: var(--app-text);
  font-size: 13px;
  line-height: 18px;
}

.journey-action,
.pricing-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #3479ef, #6861f2);
  box-shadow: 0 10px 22px rgb(54 83 208 / 22%);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition-property: transform, box-shadow, filter;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.journey-action:hover,
.pricing-card__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 28px rgb(54 83 208 / 28%);
  filter: saturate(1.08);
}

.journey-action:active,
.pricing-card__button:active {
  transform: scale(.97);
}

.journey-action .material-symbols-outlined {
  font-size: 17px !important;
}

/* Launch card becomes a clear outcome card, not a collection of dim chips. */
.status-hero {
  min-height: 154px;
  padding: 25px 26px;
  border-radius: 22px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--app-panel) 95%, var(--md-sys-color-primary)), var(--app-panel));
  box-shadow: var(--app-shadow-sm);
}

.status-hero::before {
  top: 22px;
  bottom: 22px;
  width: 3px;
  background: linear-gradient(var(--md-sys-color-primary), var(--product-premium));
}

.status-hero-icon {
  background: linear-gradient(145deg, var(--app-blue-soft), color-mix(in srgb, var(--product-premium-soft) 72%, var(--app-blue-soft)));
}

.status-hero-info {
  min-width: 0;
}

.status-card-eyebrow {
  margin-bottom: 3px;
}

#launch-card-title {
  margin: 0 0 10px;
  color: var(--app-text);
  font-size: 18px;
  line-height: 25px;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.status-hero-chips md-assist-chip[disabled] {
  opacity: 1;
}

.status-hero-hint,
.callout-banner {
  max-width: 680px;
  margin-top: 10px;
  padding: 8px 11px;
  line-height: 19px;
  text-wrap: pretty;
}

.overview-command-bar {
  min-height: 54px;
  padding: 7px 10px 7px 15px;
  border-style: dashed;
  background: color-mix(in srgb, var(--app-panel-muted) 72%, transparent);
}

.bulk-actions-label {
  margin-right: auto;
  color: var(--app-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#shutdown-btn,
.overview-command-bar .command-separator {
  display: none;
}

.dashboard-card-value,
#progress-text,
.commerce-balance strong,
.pricing-card__price strong,
.referral-earned strong {
  font-variant-numeric: tabular-nums;
}

/* Technical logs stay available but stop dominating the novice experience. */
.activity-details {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: var(--app-panel);
  box-shadow: var(--app-shadow-xs);
}

.activity-details > summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  min-height: 70px;
  gap: 12px;
  padding: 13px 17px;
  color: var(--app-text);
  cursor: pointer;
  list-style: none;
}

.activity-details > summary::-webkit-details-marker {
  display: none;
}

.activity-details__icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px;
  color: var(--app-text-muted);
  background: var(--app-panel-muted);
  font-size: 19px !important;
}

.activity-details summary strong,
.activity-details summary small {
  display: block;
}

.activity-details summary strong {
  font-size: 13px;
}

.activity-details summary small {
  margin-top: 2px;
  color: var(--app-text-muted);
  font-size: 11px;
  line-height: 16px;
}

.activity-details__chevron {
  color: var(--app-text-muted);
  font-size: 20px !important;
  transition-property: transform;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.activity-details[open] .activity-details__chevron {
  transform: rotate(180deg);
}

.activity-details > .form-section {
  padding: 0 16px 16px;
  border-top: 1px solid var(--app-border);
}

.activity-details .terminal-window {
  margin-top: 16px;
}

/* Customer monetisation surface. */
#dashboard-dialog.commerce-dialog {
  --md-dialog-container-width: min(1080px, calc(100vw - 32px));
  --md-dialog-container-max-width: 1080px;
  --md-dialog-container-shape: 24px;
  min-width: min(1080px, calc(100vw - 32px));
}

.commerce-dialog__headline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.commerce-dialog__headline > .material-symbols-outlined {
  width: 42px !important;
  height: 42px !important;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #8d6dff, #5d5df2);
  font-size: 21px !important;
}

.commerce-dialog__headline small,
.commerce-dialog__headline strong {
  display: block;
}

.commerce-dialog__headline small {
  color: var(--app-text-muted);
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.commerce-dialog__headline strong {
  color: var(--app-text);
  font-size: 19px;
  line-height: 26px;
  letter-spacing: -.025em;
}

.commerce-dialog__content {
  width: min(1000px, calc(100vw - 80px));
  max-height: min(72vh, 780px);
  overflow-y: auto;
  padding-right: 4px;
}

.commerce-profile-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 15px;
  border: 1px solid var(--app-border);
  border-radius: 17px;
  background: var(--app-panel-muted);
}

.commerce-profile-strip__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.commerce-avatar {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px;
  border-radius: 12px;
  color: var(--md-sys-color-primary);
  background: var(--app-blue-soft);
  font-size: 20px !important;
}

.commerce-profile-strip__identity strong,
.commerce-profile-strip__identity small,
.commerce-balance strong,
.commerce-balance small {
  display: block;
}

.commerce-profile-strip__identity strong {
  overflow: hidden;
  color: var(--app-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commerce-profile-strip__identity small,
.commerce-balance small {
  color: var(--app-text-muted);
  font-size: 10px;
}

.commerce-balance {
  flex: 0 0 auto;
  text-align: right;
}

.commerce-balance strong {
  color: var(--app-text);
  font-size: 18px;
}

.commerce-dialog #dashboard-tabs {
  position: static;
  margin: 16px 0 20px;
}

.commerce-tab {
  margin-top: 0;
}

.current-plan-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--product-premium) 30%, var(--app-border));
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--product-premium) 16%, transparent), transparent 18rem),
    linear-gradient(145deg, var(--product-premium-soft), var(--app-panel));
}

.current-plan-card h3 {
  margin: 4px 0 4px;
  color: var(--app-text);
  font-size: 25px;
  line-height: 32px;
  letter-spacing: -.04em;
}

.current-plan-card p {
  max-width: 610px;
  margin: 0;
  color: var(--app-text-muted);
  font-size: 12px;
  line-height: 18px;
}

.current-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.current-plan-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--app-text-muted);
  font-size: 11px;
}

.current-plan-meta .material-symbols-outlined {
  color: var(--product-premium);
  font-size: 16px !important;
}

.pricing-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 27px 2px 15px;
}

.pricing-heading h3 {
  margin: 3px 0 0;
  color: var(--app-text);
  font-size: 20px;
  line-height: 27px;
  letter-spacing: -.035em;
}

.pricing-heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--app-text-muted);
  font-size: 11px;
  line-height: 17px;
  text-align: right;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pricing-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 342px;
  flex-direction: column;
  padding: 19px;
  border: 1px solid var(--app-border);
  border-radius: 19px;
  background: var(--app-panel);
  box-shadow: var(--app-shadow-xs);
}

.pricing-card--featured {
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 50%, var(--app-border));
  box-shadow: 0 15px 34px rgb(51 83 177 / 11%);
}

.pricing-card__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--md-sys-color-primary);
  background: var(--app-blue-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pricing-card__top {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--app-text);
  font-size: 14px;
  font-weight: 750;
}

.pricing-card__icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px;
  color: var(--md-sys-color-primary);
  background: var(--app-blue-soft);
  font-size: 18px !important;
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-height: 43px;
  margin-top: 19px;
  color: var(--app-text);
}

.pricing-card__price strong {
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -.04em;
}

.pricing-card__price span {
  color: var(--app-text-muted);
  font-size: 10px;
}

.pricing-card > p {
  min-height: 38px;
  margin: 7px 0 12px;
  color: var(--app-text-muted);
  font-size: 11px;
  line-height: 17px;
}

.pricing-card ul {
  display: grid;
  gap: 8px;
  margin: 0 0 19px;
  padding: 0;
  list-style: none;
}

.pricing-card li {
  position: relative;
  padding-left: 20px;
  color: var(--app-text);
  font-size: 11px;
  line-height: 17px;
}

.pricing-card li::before {
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--product-success);
  content: "✓";
  font-size: 12px;
  font-weight: 800;
}

.pricing-card__button {
  width: 100%;
  margin-top: auto;
}

.pricing-card__button--secondary {
  color: var(--app-text);
  background: var(--app-panel-muted);
  border: 1px solid var(--app-border);
  box-shadow: none;
}

.pricing-card__button--secondary:hover {
  border-color: var(--app-selected-border);
  box-shadow: var(--app-shadow-sm);
}

.pricing-card.is-current::after {
  position: absolute;
  inset: 8px 9px auto auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--product-success);
  background: var(--product-success-soft);
  content: "Текущий";
  font-size: 9px;
  font-weight: 750;
}

.pricing-card.is-current .pricing-card__badge {
  display: none;
}

.billing-stage-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  color: var(--app-text-muted);
  background: var(--app-panel-muted);
  font-size: 10px;
  line-height: 16px;
}

.billing-stage-note > .material-symbols-outlined {
  flex: 0 0 auto;
  color: var(--product-success);
  font-size: 18px !important;
}

.billing-stage-note strong {
  color: var(--app-text);
}

.referral-hero {
  display: grid;
  justify-items: center;
  min-height: 360px;
  padding: 38px 24px;
  border: 1px solid color-mix(in srgb, var(--product-premium) 25%, var(--app-border));
  border-radius: 21px;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--product-premium) 16%, transparent), transparent 22rem), var(--app-panel);
  text-align: center;
}

.referral-hero__icon {
  width: 58px !important;
  height: 58px !important;
  margin-bottom: 15px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #8d6dff, #5d5df2);
  font-size: 28px !important;
  box-shadow: 0 12px 24px rgb(98 75 222 / 22%);
}

.referral-hero h3 {
  max-width: 560px;
  margin: 5px 0 5px;
  color: var(--app-text);
  font-size: 24px;
  line-height: 31px;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.referral-hero > p {
  max-width: 580px;
  margin: 0 0 20px;
  color: var(--app-text-muted);
  font-size: 12px;
}

.referral-link {
  max-width: min(600px, 100%);
  padding: 11px 14px;
  overflow: hidden;
  border: 1px dashed var(--app-selected-border);
  border-radius: 13px;
  color: var(--md-sys-color-primary);
  background: var(--app-blue-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-earned {
  margin-top: 23px;
}

.referral-earned small,
.referral-earned strong {
  display: block;
}

.referral-earned small {
  color: var(--app-text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.referral-earned strong {
  color: var(--product-success);
  font-size: 24px;
}

.proxy-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--app-border);
  border-radius: 19px;
  background: var(--app-panel);
}

.proxy-offer h3 {
  margin: 4px 0 3px;
  color: var(--app-text);
  font-size: 19px;
  letter-spacing: -.03em;
}

.proxy-offer p {
  margin: 0;
  color: var(--app-text-muted);
  font-size: 11px;
}

.proxy-offer__price strong,
.proxy-offer__price small {
  display: block;
  white-space: nowrap;
}

.proxy-offer__price strong {
  color: var(--app-text);
  font-size: 20px;
}

.proxy-offer__price small {
  color: var(--app-text-muted);
  font-size: 10px;
}

.commerce-list-title {
  margin: 22px 2px 8px;
  color: var(--app-text);
  font-size: 13px;
}

/* Login has a concise promise instead of an unexplained credential form. */
#login-overlay {
  --md-dialog-container-width: min(470px, calc(100vw - 28px));
}

#login-overlay [slot="content"]::before {
  display: block;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 24%, var(--app-border));
  border-radius: 15px;
  color: var(--app-text-muted);
  background: linear-gradient(145deg, var(--app-blue-soft), var(--app-panel));
  content: "Подключите Telegram-аккаунт, настройте сценарий по подсказкам и управляйте всеми запусками из одного места.";
  font-size: 11px;
  line-height: 17px;
}

.native-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--app-panel) 78%, transparent);
}

.native-auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--app-text-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.native-auth-tab.is-active {
  color: var(--app-text);
  background: var(--app-blue-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-sys-color-primary) 24%, transparent);
}

.native-auth-field {
  position: relative;
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--app-text-muted);
  font-size: 11px;
  font-weight: 650;
}

.native-auth-field small { font-weight: 500; }

.native-auth-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--app-border-strong, var(--app-border));
  border-radius: 14px;
  outline: none;
  color: var(--app-text);
  background: color-mix(in srgb, var(--app-panel) 86%, transparent);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.native-auth-field input:focus {
  border-color: var(--md-sys-color-primary);
  background: var(--app-panel-raised);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent);
}

.native-auth-field input[error] {
  border-color: var(--md-sys-color-error, #ef4444);
}

.native-auth-field--password input { padding-right: 48px; }

.native-reveal-button {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--app-text-muted);
  background: transparent;
  cursor: pointer;
}

.native-reveal-button:hover { color: var(--app-text); background: var(--app-blue-soft); }

.native-auth-submit {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  color: var(--md-sys-color-on-primary, #fff);
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 12px 26px rgb(37 99 235 / 24%);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.native-auth-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }

.auth-legal-links,
.commerce-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.auth-legal-links {
  justify-content: center;
  margin-top: 16px;
}

.commerce-legal-links {
  justify-content: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--app-border);
}

.auth-legal-links a,
.commerce-legal-links a {
  color: var(--app-text-muted);
  font-size: 10px;
  line-height: 16px;
  text-decoration: none;
  text-underline-offset: 3px;
}

.auth-legal-links a:hover,
.commerce-legal-links a:hover {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
}

@media (max-width: 1120px) {
  .top-app-bar .brand-block { min-width: 210px; }
  .profile-entry > span:last-child,
  .commerce-entry__copy small { display: none; }
  .profile-entry { padding-right: 6px; }
  .journey-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 839px) {
  .top-app-bar { min-height: 70px; padding-inline: 14px; }
  .top-app-bar .brand-block { min-width: 0; }
  .navigation-drawer { inset-block-start: 70px; height: calc(100dvh - 70px); }
  .content-document { padding-top: 22px; }
  .journey-panel { padding: 21px; }
  .journey-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-step:last-child { grid-column: 1 / -1; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card { min-height: auto; }
  .pricing-card > p { min-height: auto; }
  .pricing-card__button { margin-top: 8px; }
  .pricing-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .pricing-heading > p { max-width: none; text-align: left; }
  .commerce-dialog__content { width: calc(100vw - 64px); }
}

@media (max-width: 719px) {
  .top-app-bar { min-height: 64px; }
  .navigation-drawer { inset-block-start: 64px; height: calc(100dvh - 64px); }
  .brand-subtitle,
  #help-btn,
  #status-badge { display: none; }
  .commerce-entry { padding-right: 8px; }
  .commerce-entry__copy { display: none; }
  .profile-entry { display: none; }
  .workspace-eyebrow { margin-left: 0; }
  .workspace-header-subtitle { padding-left: 0; margin-top: 6px; }
  .journey-panel { padding: 18px; border-radius: 19px; }
  .journey-panel__intro h3 { font-size: 20px; }
  .journey-next { align-items: stretch; flex-direction: column; }
  .journey-action { width: 100%; }
  .status-hero { padding: 20px; }
  .bulk-actions-label { display: none; }
  .overview-command-bar { overflow-x: auto; }
  .commerce-profile-strip { align-items: flex-start; }
  .current-plan-card { align-items: stretch; flex-direction: column; }
  .current-plan-card md-filled-tonal-button { width: 100%; }
  .proxy-offer { grid-template-columns: 1fr auto; }
  .proxy-offer md-filled-tonal-button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 520px) {
  .top-app-bar .brand-text h1 { font-size: 16px; }
  .journey-steps { grid-template-columns: 1fr; }
  .journey-step:last-child { grid-column: auto; }
  .status-hero-actions { flex-direction: column; }
  .status-hero-actions > * { width: 100%; }
  .commerce-dialog__content { width: calc(100vw - 48px); }
  .commerce-profile-strip { flex-direction: column; }
  .commerce-balance { text-align: left; }
  .proxy-offer { grid-template-columns: 1fr; }
  .proxy-offer md-filled-tonal-button { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .journey-progress span,
  .drawer-usage-track > span,
  .activity-details__chevron {
    transition-duration: .01ms;
  }
}

/* Critical local fallback when optional CDN web components are unavailable. */
md-dialog:not(:defined) { display: none; }

md-dialog:not(:defined)[open].dialog-fallback {
  position: fixed;
  z-index: 10000;
  top: 50%;
  left: 50%;
  display: block;
  width: min(var(--md-dialog-container-width, 680px), calc(100vw - 24px));
  max-width: min(1080px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--app-border-strong, rgb(148 163 184 / 35%));
  border-radius: var(--md-dialog-container-shape, 24px);
  color: var(--app-text, #e7edf7);
  background: var(--app-panel-raised, #111827);
  box-shadow: 0 0 0 100vmax rgb(2 6 23 / 72%), 0 30px 90px rgb(0 0 0 / 45%);
  transform: translate(-50%, -50%);
}

md-dialog:not(:defined)[open].dialog-fallback > [slot="headline"] {
  padding: 24px 24px 0;
}

md-dialog:not(:defined)[open].dialog-fallback > [slot="content"] {
  display: block;
  padding: 20px 24px;
}

md-dialog:not(:defined)[open].dialog-fallback > [slot="actions"] {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 22px;
}
