/* Master cabinet v2 — shell on top of unified-theme + admin-suite-v2 */

.master-suite-v2 .master-crm-titlewrap {
  min-width: 0;
}

.master-crm-pagetitle {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.master-crm-pagesub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* Sidebar: SPA nav as buttons, match link look */
.app-sidebar .nav-menu button.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  text-align: left;
}

.app-sidebar .nav-menu button.nav-link i,
.app-sidebar .nav-menu button.nav-link .mst-nav-ico i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.app-sidebar .nav-menu button.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.95);
}

.app-sidebar .nav-menu button.nav-link:hover i,
.app-sidebar .nav-menu button.nav-link:hover .mst-nav-ico i {
  opacity: 1;
}

.app-sidebar .nav-menu button.nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.app-sidebar .nav-menu button.nav-link.active i,
.app-sidebar .nav-menu button.nav-link.active .mst-nav-ico i {
  opacity: 1;
}

.sidebar-logout.sidebar-logout--secondary {
  margin-bottom: 8px;
  text-decoration: none;
  color: rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-logout.sidebar-logout--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  filter: none;
}

/* Panels */
.master-panel {
  display: none;
  animation: masterFadeIn 0.22s ease;
}

.master-panel.visible {
  display: block;
}

@keyframes masterFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.master-home-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 4px;
}

.master-home-greeting {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.master-home-date {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.master-stats-error {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: var(--danger-soft);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}

.master-stats-error[hidden] {
  display: none !important;
}

.master-home-revenue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 55%);
  box-shadow: var(--shadow-xs);
}

.master-home-revenue[hidden] {
  display: none !important;
}

.master-home-revenue__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.master-home-revenue__value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.master-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1100px) {
  .master-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .master-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.master-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.master-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}

.master-kpi-icon--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.master-kpi-icon--success {
  background: var(--success-soft);
  color: var(--success);
}

.master-kpi-icon--info {
  background: var(--info-soft);
  color: var(--info);
}

.master-kpi-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.master-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.master-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.master-home-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .master-home-row {
    grid-template-columns: 1fr;
  }
}

.master-block-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-block-title i {
  color: var(--primary);
  opacity: 0.9;
}

.master-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.master-quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.master-quick-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.master-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.master-status-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.master-status-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.master-status-key {
  color: var(--muted);
  font-weight: 600;
}

.master-status-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.master-panel--placeholder {
  padding: 28px 24px;
  text-align: center;
  min-height: min(52vh, 420px);
}

.master-statistics-placeholder-inner {
  max-width: 400px;
  margin: 0 auto;
}

.master-statistics-placeholder-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(14, 165, 233, 0.08));
}

.master-placeholder-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.master-placeholder-text {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.master-placeholder-text a {
  color: var(--primary);
  font-weight: 600;
}

/* Лента мастера: только v3 в UI; #masterFeedOftRoot — скрытый служебный контейнер (см. order-feed-v3.css). */
body.master-feed-v3-only #panel-feed #masterFeedOftRoot {
  display: none !important;
}

/* Лента заказов (панель: v3 + технический fallback) */
.master-feed-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.master-feed-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-feed-title i {
  color: var(--primary);
}

.master-feed-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.45;
}

/* Лента v3: заголовок только в shell-навигации; в панели — сразу refresh и v3 */
#panel-feed.master-feed-v3-pilot-active .master-feed-toolbar {
  margin-bottom: 4px;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

#panel-feed.master-feed-v3-pilot-active .master-feed-title {
  display: none;
}

.master-feed-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.master-feed-refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.master-feed-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: var(--danger-soft);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 100%;
}

.master-feed-error[hidden] {
  display: none !important;
}

.master-feed-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.master-feed-loading[hidden] {
  display: none !important;
}

.master-feed-oft-root {
  min-height: 120px;
}

.master-myorders-list {
  min-height: 80px;
}

/* Чаты v2: контейнер из dashboard #sec-chat */
#panel-chats .master-chat-root {
  min-height: calc(100vh - 140px);
}

/* Финансы v2 */
/* ──────────────────────────────────────────────────────────────
 * Финансы v3 (premium) — панель #panel-finance
 * Сохраняем существующие id/hooks внутри, меняем только внешний UI.
 * ────────────────────────────────────────────────────────────── */
#panel-finance .mf-page {
  --mf-indigo: #4f46e5;
  --mf-indigo-2: #6366f1;
  --mf-emerald: #10b981;
  --mf-amber: #f59e0b;
  --mf-rose: #ef4444;
  --mf-bg: #ffffff;
  --mf-muted: rgba(15, 23, 42, 0.62);
  --mf-border: rgba(226, 232, 240, 0.95);
  --mf-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  padding-bottom: 10px;
}

#panel-finance .mf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

#panel-finance .mf-head__title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text, #0f172a);
}

#panel-finance .mf-head__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--mf-muted);
  max-width: 66ch;
}

#panel-finance .mf-head__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#panel-finance .mf-btn {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#panel-finance .mf-btn:active {
  transform: scale(0.99);
}

#panel-finance .mf-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

#panel-finance .mf-btn--ghost {
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
}

#panel-finance .mf-btn--ghost:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}

#panel-finance .mf-btn--chip {
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
}

#panel-finance .mf-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  border-radius: 12px;
  padding: 9px 10px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
  color: #475569;
}

#panel-finance .mf-range__inp {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  padding: 0;
  outline: none;
}

#panel-finance .mf-range__sep {
  color: rgba(100, 116, 139, 0.9);
  font-weight: 800;
}

#panel-finance .mf-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 980px) {
  #panel-finance .mf-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #panel-finance .mf-kpis {
    grid-template-columns: 1fr;
  }
}

#panel-finance .mf-kpi {
  display: flex;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid var(--mf-border);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 55%, #f4f6f9 100%);
  box-shadow: var(--mf-shadow);
  min-height: 86px;
}

#panel-finance .mf-kpi__ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(79, 70, 229, 0.1);
  color: var(--mf-indigo);
}

#panel-finance .mf-kpi--emerald .mf-kpi__ico {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

#panel-finance .mf-kpi--amber .mf-kpi__ico {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

#panel-finance .mf-kpi--slate .mf-kpi__ico {
  background: rgba(148, 163, 184, 0.18);
  color: #334155;
}

#panel-finance .mf-kpi__lbl {
  font-size: 12px;
  font-weight: 800;
  color: rgba(51, 65, 85, 0.88);
  margin-bottom: 6px;
}

#panel-finance .mf-kpi__val {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.1;
}

#panel-finance .mf-kpi__sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--mf-muted);
  font-weight: 700;
}

#panel-finance .mf-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

#panel-finance .mf-tab {
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  color: rgba(51, 65, 85, 0.9);
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#panel-finance .mf-tab.is-active {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(99, 102, 241, 0.26);
  color: #312e81;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
}

#panel-finance .mf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

@media (max-width: 1050px) {
  #panel-finance .mf-layout {
    grid-template-columns: 1fr;
  }
}

#panel-finance .mf-tabpanel {
  display: none;
}

#panel-finance .mf-tabpanel.is-active {
  display: block;
}

#panel-finance .mf-sec-title {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #0f172a;
}

#panel-finance .mf-muted {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--mf-muted);
}

#panel-finance .mf-attn {
  margin-bottom: 12px;
}

#panel-finance .mf-attn__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  #panel-finance .mf-attn__grid {
    grid-template-columns: 1fr;
  }
}

#panel-finance .mf-attn-card {
  border: 1px solid var(--mf-border);
  background: #fff;
  border-radius: 18px;
  padding: 12px 12px;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

#panel-finance .mf-attn-card__ico {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
}

#panel-finance .mf-attn-card__ico--rose {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

#panel-finance .mf-attn-card__ico--amber {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

#panel-finance .mf-attn-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

#panel-finance .mf-attn-card__title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
}

#panel-finance .mf-attn-card__val {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

#panel-finance .mf-attn-card__sub {
  font-size: 12px;
  color: var(--mf-muted);
  font-weight: 700;
}

#panel-finance .mf-attn-card__chev {
  color: rgba(100, 116, 139, 0.8);
}

#panel-finance .mf-sec--table {
  border: 1px solid var(--mf-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--mf-shadow);
  padding: 12px 12px 10px;
}

#panel-finance .mf-sec__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 10px;
}

#panel-finance .mf-sec__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#panel-finance .mf-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.9);
  color: rgba(100, 116, 139, 0.9);
}

#panel-finance .mf-search__inp {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  width: 220px;
  max-width: 70vw;
}

#panel-finance .mf-table {
  width: 100%;
  display: block;
}

#panel-finance .mf-tr {
  display: grid;
  grid-template-columns: 86px 1.25fr 140px 140px 130px 170px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
}

#panel-finance .mf-tr--head {
  padding-top: 6px;
  padding-bottom: 6px;
}

#panel-finance .mf-th {
  font-size: 11px;
  font-weight: 900;
  color: rgba(51, 65, 85, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#panel-finance .mf-tbody .mf-tr {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

#panel-finance .mf-td {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#panel-finance .mf-td--muted {
  color: rgba(100, 116, 139, 0.9);
  font-weight: 700;
}

#panel-finance .mf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(148, 163, 184, 0.18);
  color: rgba(51, 65, 85, 0.9);
}

#panel-finance .mf-pill--ok {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

#panel-finance .mf-pill--warn {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

#panel-finance .mf-pill--info {
  background: rgba(2, 132, 199, 0.14);
  color: #0369a1;
}

#panel-finance .mf-more {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.8);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
}

#panel-finance .mf-empty {
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(226, 232, 240, 0.95);
  color: rgba(100, 116, 139, 0.9);
  font-size: 13px;
  font-weight: 700;
}

#panel-finance .mf-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#panel-finance .mf-item {
  border: 1px solid var(--mf-border);
  background: #fff;
  border-radius: 18px;
  padding: 12px 12px;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}

#panel-finance .mf-side {
  position: sticky;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1050px) {
  #panel-finance .mf-side {
    position: static;
  }
}

#panel-finance .mf-side-card {
  border: 1px solid var(--mf-border);
  background: #fff;
  border-radius: 18px;
  padding: 12px 12px;
  box-shadow: var(--mf-shadow);
}

#panel-finance .mf-side-title {
  font-size: 12px;
  font-weight: 900;
  color: rgba(51, 65, 85, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

#panel-finance .mf-nextpay__date {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 4px;
}

#panel-finance .mf-nextpay__sum {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

#panel-finance .mf-nextpay__hint {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mf-muted);
}

#panel-finance .mf-balance__val {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

#panel-finance .mf-balance__sub {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mf-muted);
}

#panel-finance .mf-spark {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

#panel-finance .mf-spark__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  flex: 1;
}

#panel-finance .mf-spark__bar--a {
  background: rgba(79, 70, 229, 0.22);
}

#panel-finance .mf-spark__bar--b {
  background: rgba(16, 185, 129, 0.2);
}

#panel-finance .mf-spark__bar--c {
  background: rgba(245, 158, 11, 0.22);
}

#panel-finance .mf-link {
  margin-top: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: #4f46e5;
  font-weight: 900;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 8px;
}

@media (max-width: 900px) {
  #panel-finance .mf-tr {
    display: none;
  }
  #panel-finance .mf-tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #panel-finance .mf-tbody .mf-tr {
    display: block;
    border: 1px solid var(--mf-border);
    border-radius: 18px;
    padding: 12px 12px;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  }
}

.master-finance-form .master-finance-field {
  margin-bottom: 12px;
}

.master-finance-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.master-finance-textarea {
  min-height: 72px;
  resize: vertical;
}

.master-finance-form-msg {
  margin: 10px 0 4px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

.master-finance-form-msg[hidden] {
  display: none !important;
}

.master-finance-form-msg--err {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: var(--danger-soft);
  color: #b91c1c;
}

.master-finance-form-msg--ok {
  border: 1px solid rgba(5, 150, 105, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

.master-finance-list {
  min-height: 60px;
}

.master-finance-empty {
  padding: 16px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.master-finance-card {
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.master-finance-card:last-child {
  margin-bottom: 0;
}

.master-finance-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.master-finance-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.master-finance-order {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.master-finance-date {
  font-size: 12px;
  color: var(--muted);
}

.master-finance-status {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

.master-finance-status[data-payment-status='ожидает'] {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.master-finance-status[data-payment-status='переведено'] {
  background: rgba(2, 132, 199, 0.15);
  color: #0369a1;
}

.master-finance-status[data-payment-status='подтверждено'] {
  background: rgba(5, 150, 105, 0.15);
  color: #047857;
}

.master-finance-amounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.master-finance-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.master-finance-amounts strong {
  font-size: 14px;
  color: var(--text);
}

.master-finance-tech {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.35;
}

.master-finance-mark-btn {
  margin-top: 4px;
}

/* Кошелёк v2 */
.master-wallet-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Кошелёк v3 (premium) — scoped */
#panel-wallet .master-wallet-v3 {
  margin-top: 2px;
}

#panel-wallet .mw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0 10px;
}

#panel-wallet .mw-head__left {
  min-width: 220px;
  flex: 1;
}

#panel-wallet .mw-head__title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text, #0f172a);
}

#panel-wallet .mw-head__sub {
  margin: 6px 0 0;
  color: var(--muted, #64748b);
  font-size: 12.5px;
  line-height: 1.45;
}

#panel-wallet .mw-head__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#panel-wallet .mw-btn {
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.06);
  color: #4338ca;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#panel-wallet .mw-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

#panel-wallet .mw-btn--soft {
  background: rgba(148, 163, 184, 0.10);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

#panel-wallet .mw-btn:hover:not([disabled]) {
  background: rgba(99, 102, 241, 0.09);
}

#panel-wallet .mw-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid transparent;
}

#panel-wallet .mw-pill--amber {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.20);
  color: #92400e;
}

#panel-wallet .mw-pill--muted {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.22);
  color: #334155;
}

#panel-wallet .mw-note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.16);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(99, 102, 241, 0.04));
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.35;
}

#panel-wallet .mw-balance {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 12px 42px rgba(15, 23, 42, 0.07);
  padding: 16px;
  overflow: hidden;
}

#panel-wallet .mw-balance__decor {
  position: absolute;
  inset: -40px -40px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.16), transparent 62%);
  pointer-events: none;
}

#panel-wallet .mw-balance__row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  align-items: center;
}

#panel-wallet .mw-balance__label {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted, #64748b);
}

#panel-wallet .mw-balance__value {
  margin-top: 6px;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 950;
  color: var(--text, #0f172a);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

#panel-wallet .mw-balance__hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #64748b);
}

#panel-wallet .mw-callout {
  border-radius: 18px;
  padding: 12px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.7);
}

#panel-wallet .mw-callout--amber {
  border-color: rgba(245, 158, 11, 0.22);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.7));
}

#panel-wallet .mw-callout__title {
  font-weight: 950;
  color: var(--text, #0f172a);
  font-size: 12.5px;
}

#panel-wallet .mw-callout__sub {
  margin-top: 4px;
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.35;
}

#panel-wallet .mw-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

#panel-wallet .mw-kpi {
  border-radius: 18px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.06);
  padding: 14px 14px 12px;
  display: flex;
  gap: 12px;
  min-width: 0;
}

#panel-wallet .mw-kpi__ico {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.20);
}

#panel-wallet .mw-kpi--emerald .mw-kpi__ico {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.18);
}

#panel-wallet .mw-kpi--slate .mw-kpi__ico {
  background: linear-gradient(135deg, #334155, #64748b);
  box-shadow: 0 12px 28px rgba(51, 65, 85, 0.14);
}

#panel-wallet .mw-kpi--rose .mw-kpi__ico {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  box-shadow: 0 12px 28px rgba(244, 63, 94, 0.16);
}

#panel-wallet .mw-kpi__lbl {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #64748b);
}

#panel-wallet .mw-kpi__val {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 950;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

#panel-wallet .mw-kpi__sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

#panel-wallet .mw-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
  align-items: start;
}

#panel-wallet .mw-card {
  border-radius: 18px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.06);
  padding: 14px;
  min-width: 0;
}

#panel-wallet .mw-card--soft {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(245, 158, 11, 0.04));
}

#panel-wallet .mw-card__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

#panel-wallet .mw-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#panel-wallet .mw-card__meta {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 800;
}

#panel-wallet .mw-soon {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  font-size: 11px;
  font-weight: 950;
  border: 1px solid rgba(245, 158, 11, 0.18);
}

#panel-wallet .mw-sub__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#panel-wallet .mw-sub__name {
  font-size: 16px;
  font-weight: 950;
  color: var(--text, #0f172a);
}

#panel-wallet .mw-sub__badge {
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: #64748b;
}

#panel-wallet .mw-sub__badge.master-wallet-plan-badge--ok {
  background: #16a34a;
}

#panel-wallet .mw-sub__badge.master-wallet-plan-badge--bad {
  background: #dc2626;
}

#panel-wallet .mw-sub__meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

#panel-wallet .mw-sub__features {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text, #1e293b);
}

#panel-wallet .mw-sub__note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(245, 158, 11, 0.26);
  background: rgba(255, 251, 235, 0.6);
  color: #92400e;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

#panel-wallet .mw-info {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 12.5px;
  line-height: 1.5;
}

#panel-wallet .mw-soon-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#panel-wallet .mw-soon-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.75);
  text-align: left;
}

#panel-wallet .mw-soon-card[disabled] {
  opacity: 0.86;
  cursor: not-allowed;
}

#panel-wallet .mw-soon-card__ico {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
  flex-shrink: 0;
}

#panel-wallet .mw-soon-card__title {
  display: block;
  font-size: 12.5px;
  font-weight: 950;
  color: var(--text, #0f172a);
}

#panel-wallet .mw-soon-card__sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

#panel-wallet .mw-soon-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.18);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

#panel-wallet .mw-tx {
  min-height: 64px;
}

#panel-wallet .mw-empty {
  padding: 18px 14px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 13px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.7);
}

#panel-wallet .mw-empty strong {
  display: block;
  color: var(--text, #0f172a);
  margin-bottom: 4px;
  font-weight: 950;
}

#panel-wallet .mw-tx-table {
  width: 100%;
  border: 1px solid var(--border, #e8ecf4);
  border-radius: 14px;
  overflow: hidden;
}

#panel-wallet .mw-tx-tr {
  display: grid;
  grid-template-columns: 140px 1.1fr 130px;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e8ecf4);
  align-items: center;
}

#panel-wallet .mw-tx-tr.mw-tx-tr--head {
  background: rgba(99, 102, 241, 0.04);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #64748b);
}

#panel-wallet .mw-tx-tr:last-child {
  border-bottom: none;
}

#panel-wallet .mw-tx-desc {
  font-weight: 900;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-wallet .mw-tx-sub {
  font-size: 11.5px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}

#panel-wallet .mw-tx-amt {
  justify-self: end;
  font-weight: 950;
  white-space: nowrap;
}

#panel-wallet .mw-tx-amt--in {
  color: #16a34a;
}

#panel-wallet .mw-tx-amt--out {
  color: #dc2626;
}

#panel-wallet .mw-tx-cards {
  display: none;
}

@media (max-width: 980px) {
  #panel-wallet .mw-kpis {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  #panel-wallet .mw-grid {
    grid-template-columns: 1fr;
  }
  #panel-wallet .mw-balance__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #panel-wallet .mw-tx-table {
    display: none;
  }
  #panel-wallet .mw-tx-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #panel-wallet .mw-tx-card {
    border-radius: 16px;
    border: 1px solid var(--border, #e8ecf4);
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 12px;
  }
  #panel-wallet .mw-tx-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  #panel-wallet .mw-tx-card__title {
    font-weight: 950;
    color: var(--text, #0f172a);
    font-size: 12.5px;
    line-height: 1.25;
  }
  #panel-wallet .mw-tx-card__meta {
    margin-top: 4px;
    color: var(--muted, #64748b);
    font-size: 11.5px;
  }
}

.master-wallet-balance-card {
  padding: 22px 20px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #fde68a;
}

.master-wallet-balance-label {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.master-wallet-balance-label i {
  margin-right: 6px;
  opacity: 0.85;
}

.master-wallet-balance-value {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  color: #78350f;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.master-wallet-balance-hint {
  font-size: 12px;
  color: #a16207;
  margin-top: 6px;
}

.master-wallet-sub-card .master-block-title {
  margin-bottom: 12px;
}

.master-wallet-plan-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.master-wallet-plan-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  min-width: 0;
}

.master-wallet-plan-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
}

.master-wallet-plan-badge--ok {
  background: #16a34a;
}

.master-wallet-plan-badge--bad {
  background: #dc2626;
}

.master-wallet-plan-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.master-wallet-plan-features {
  font-size: 13px;
  color: var(--text);
}

.master-wallet-plan-desc {
  margin: 0 0 10px;
  line-height: 1.45;
}

.master-wallet-plan-desc--muted {
  color: var(--muted);
}

.master-wallet-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.master-wallet-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.master-wallet-feature-list li:last-child {
  border-bottom: none;
}

.master-wallet-feature-list .fa-check-circle {
  color: #16a34a;
  margin-top: 2px;
  flex-shrink: 0;
}

.master-wallet-tx-card .master-block-title {
  margin-bottom: 4px;
}

.master-wallet-tx-list {
  min-height: 48px;
}

.master-wallet-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.master-wallet-empty i {
  margin-right: 6px;
  opacity: 0.75;
}

.master-wallet-tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.master-wallet-tx-row:last-child {
  border-bottom: none;
}

.master-wallet-tx-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.master-wallet-tx-ico--in {
  background: #dcfce7;
  color: #16a34a;
}

.master-wallet-tx-ico--out {
  background: #fee2e2;
  color: #dc2626;
}

.master-wallet-tx-main {
  flex: 1;
  min-width: 0;
}

.master-wallet-tx-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-wallet-tx-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.master-wallet-tx-amt {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.master-wallet-tx-amt--in {
  color: #16a34a;
}

.master-wallet-tx-amt--out {
  color: #dc2626;
}

/* Реферальная программа v2 */
.master-referral-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.master-referral-code-card .master-block-title {
  margin-bottom: 14px;
}

.master-referral-code-row {
  margin-bottom: 14px;
}

.master-referral-code-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.master-referral-code-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-family: ui-monospace, monospace;
  color: #5b21b6;
  word-break: break-all;
}

.master-referral-link-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.master-referral-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.master-referral-link-input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.master-referral-copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.master-referral-copy-msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #047857;
}

.master-referral-copy-msg[hidden] {
  display: none !important;
}

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

@media (max-width: 720px) {
  .master-referral-stats-grid {
    grid-template-columns: 1fr;
  }
}

.master-referral-stat-card {
  padding: 16px 14px;
  text-align: center;
}

.master-referral-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.master-referral-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}

.master-referral-stat-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.master-referral-list-card .master-block-title {
  margin-bottom: 10px;
}

.master-referral-list {
  min-height: 40px;
}

.master-referral-empty {
  padding: 18px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.master-referral-empty i {
  margin-right: 6px;
  opacity: 0.8;
}

.master-referral-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.master-referral-row:last-child {
  border-bottom: none;
}

.master-referral-row-main {
  flex: 1;
  min-width: 0;
}

.master-referral-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.master-referral-row-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.master-referral-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.master-referral-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.master-referral-badge--wait {
  background: #fef9c3;
  color: #854d0e;
}

/* Нижняя навигация (мобильная) — master-dashboard-v2 */
@media (max-width: 767.98px) {
  /* Сильнее mobile-profi-style (!important): запас под нижнее меню + бейджи */
  body.master-suite-v2.profi-mobile-ready.cabinet-role-master .app-main {
    /* Fallback для Android WebView без поддержки env()/calc(env()) */
    padding-bottom: 104px !important;
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  body.master-suite-v2.profi-mobile-ready.app-shell {
    overflow-x: hidden;
    max-width: 100%;
  }

  body.master-suite-v2.profi-mobile-ready .app-main {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  /* Не даём «пустому» экрану при переключении разделов на узкой ширине */
  body.master-suite-v2.profi-mobile-ready #masterPanels > .master-panel.visible {
    min-height: min(58vh, 560px);
  }
}

.master-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 2px;
  min-height: 56px;
  /* Fallback для Android WebView без поддержки env() */
  padding: 6px 6px 8px;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}

.master-bottom-nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  max-width: 120px;
  margin: 0 auto;
  padding: 4px 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(226, 232, 240, 0.55);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.15;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.master-bottom-nav__btn i {
  font-size: 20px;
  line-height: 1;
  opacity: 0.9;
}

.master-bottom-nav__btn:active {
  background: rgba(255, 255, 255, 0.06);
  transform: scale(0.97);
}

.master-bottom-nav__btn--active {
  color: #f8fafc;
  background: rgba(99, 102, 241, 0.22);
}

.master-bottom-nav__btn--active i {
  color: #c7d2fe;
}

@media (min-width: 768px) {
  .master-bottom-nav {
    display: none !important;
  }

  .master-suite-v2 .app-main {
    padding-bottom: 0;
  }
}

/* Уведомления v2 */
.master-notifications-readall {
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

@media (max-width: 520px) {
  #panel-notifications .master-feed-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #panel-notifications .master-notifications-readall {
    width: 100%;
  }
}

.master-notifications-list {
  min-height: 48px;
}

.master-notifications-empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.master-notifications-empty i {
  margin-right: 8px;
  opacity: 0.75;
}

.master-notifications-empty--premium {
  padding: 28px 18px 26px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), var(--bg));
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.master-notifications-empty__ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 22px;
}

.master-notifications-empty__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.master-notifications-empty__sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 500;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

#master-notifications-error.master-feed-error {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.98);
  color: var(--text);
  font-weight: 500;
  padding: 14px 16px 16px;
}

.master-notifications-error-card__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.master-notifications-error-card__sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.master-notifications-error-retry {
  margin-top: 2px;
}

.master-notif-row {
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.master-notif-row:last-child {
  margin-bottom: 0;
}

.master-notif-row--unread {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.master-notif-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
}

.master-notif-row--unread .master-notif-text {
  font-weight: 600;
}

.master-notif-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.master-notif-date {
  font-size: 12px;
  color: var(--muted);
}

.master-notif-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.master-notif-status--new {
  background: #fef3c7;
  color: #b45309;
}

.master-notif-status--read {
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

/* Профиль мастера v2 */
.master-profile-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

/* Профиль мастера v3 (premium) — scoped */
#panel-profile .master-profile-v3 {
  margin-top: 2px;
}

#panel-profile .mp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 6px;
}

#panel-profile .mp-head__left {
  min-width: 220px;
  flex: 1;
}

#panel-profile .mp-head__title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text, #0f172a);
}

#panel-profile .mp-head__sub {
  margin: 4px 0 0;
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.38;
}

#panel-profile .mp-head__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#panel-profile .mp-btn {
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.06);
  color: #4338ca;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#panel-profile .mp-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
}

#panel-profile .mp-btn--primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: rgba(99, 102, 241, 0.32);
  color: #fff;
  box-shadow: 0 14px 34px rgba(99, 102, 241, 0.24);
}

#panel-profile .mp-note {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(16, 185, 129, 0.04));
  color: var(--muted, #64748b);
  font-size: 11.5px;
  line-height: 1.32;
}

#panel-profile .mp-hero {
  border-radius: 18px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
  padding: 12px;
  overflow: hidden;
}

#panel-profile .mp-hero__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

#panel-profile .mp-hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

#panel-profile .mp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

#panel-profile .mp-pill--indigo {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.20);
  color: #4338ca;
}

#panel-profile .mp-pill--muted {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.22);
  color: #334155;
}

#panel-profile .mp-pill--emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.20);
  color: #047857;
}

#panel-profile .mp-hero__user .master-profile-block {
  padding: 0;
  border: none;
  background: transparent;
}

#panel-profile .mp-hero__kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

#panel-profile .mp-mini {
  border-radius: 13px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.8);
  padding: 7px 8px;
  min-width: 0;
}

#panel-profile .mp-mini__lbl {
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
}

#panel-profile .mp-mini__val {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 950;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-profile .mp-quote {
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(255, 255, 255, 0.85));
  padding: 10px;
  display: flex;
  gap: 8px;
  min-width: 0;
}

#panel-profile .mp-quote__ico {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  flex-shrink: 0;
  font-size: 13px;
}

#panel-profile .mp-quote__title {
  font-size: 12px;
  font-weight: 950;
  color: var(--text, #0f172a);
}

#panel-profile .mp-quote__text {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.38;
}

#panel-profile .mp-hero__hint {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.7);
  color: var(--muted, #64748b);
  font-size: 11.5px;
  line-height: 1.32;
}

#panel-profile .mp-hero__hint strong {
  display: block;
  color: var(--text, #0f172a);
  margin-bottom: 3px;
  font-weight: 950;
}

#panel-profile .mp-tabs {
  margin: 8px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Mobile tab-mode для верхних вкладок профиля: виден 1 крупный раздел */
@media (max-width: 768px) {
  #panel-profile [data-mp-panel] {
    display: none;
  }
  #panel-profile [data-mp-panel].is-active {
    display: block;
  }
}

/* Mobile polish: не даём контейнерам распирать viewport вправо */
@media (max-width: 768px) {
  #panel-profile,
  #panel-profile .master-profile-v3,
  #panel-profile .mp-layout,
  #panel-profile .mp-main,
  #panel-profile .mp-side,
  #panel-profile .mp-card,
  #panel-profile .mp-tabs,
  #panel-profile .mp-form-nav,
  #panel-profile .mp-form-sec,
  #panel-profile .mp-editor,
  #panel-profile .mp-form-actions {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* локальная защита от горизонтального overflow (не глобальный body фикс) */
  #panel-profile .master-profile-v3 {
    overflow-x: clip;
  }

  #panel-profile .mp-tabs,
  #panel-profile .mp-form-nav {
    width: 100%;
  }

  #panel-profile input,
  #panel-profile textarea,
  #panel-profile select,
  #panel-profile button {
    max-width: 100%;
    box-sizing: border-box;
  }

  #panel-profile .mp-head {
    padding: 8px 0 4px;
    gap: 8px;
  }

  #panel-profile .mp-note {
    margin-bottom: 6px;
    padding: 7px 9px;
    font-size: 11px;
  }

  #panel-profile .mp-hero {
    padding: 10px;
    border-radius: 16px;
  }

  #panel-profile .mp-tabs {
    margin: 6px 0;
    padding: 5px;
  }
}

#panel-profile .mp-tabs::-webkit-scrollbar {
  display: none;
}

#panel-profile .mp-tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 12px;
  color: var(--muted, #64748b);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

#panel-profile .mp-tab.is-active {
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.20);
}

#panel-profile .mp-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 10px;
  align-items: start;
}

#panel-profile .mp-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

#panel-profile .mp-side .mp-card {
  padding: 11px 12px;
  border-radius: 15px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

#panel-profile .mp-side .mp-card__hd {
  margin-bottom: 7px;
}

#panel-profile .mp-side .mp-tiplist {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 12px;
  line-height: 1.35;
}

#panel-profile .mp-side .mp-tiplist li + li {
  margin-top: 4px;
}

/* Дубль чипов профессии: скрыт на планшете/мобиле, узел в DOM сохраняется */
@media (max-width: 1024px) {
  #panel-profile aside.mp-side > section.mp-card:has(#mp-pro-chips) {
    display: none;
  }
}

#panel-profile .mp-card {
  border-radius: 18px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.06);
  padding: 14px;
  min-width: 0;
}

#panel-profile .mp-card--soft {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(245, 158, 11, 0.04));
}

#panel-profile .mp-card__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

#panel-profile .mp-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#panel-profile .mp-card__meta {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 800;
}

#panel-profile .mp-muted {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 12.5px;
  line-height: 1.45;
}

#panel-profile .mp-form-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Анкета мастера — внутренняя навигация и секции */
#panel-profile .mp-form-nav {
  position: sticky;
  top: 6px;
  z-index: 2;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  margin: 10px 0 14px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#panel-profile .mp-form-nav::-webkit-scrollbar {
  height: 0;
}

#panel-profile .mp-form-nav {
  scrollbar-width: none;
}

#panel-profile .mp-form-tab {
  appearance: none;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.06);
  color: #4338ca;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

#panel-profile .mp-form-tab.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.10));
  border-color: rgba(99, 102, 241, 0.28);
}

@media (max-width: 430px) {
  #panel-profile .mp-form-tab {
    padding: 7px 10px;
    font-size: 11.5px;
  }
}

#panel-profile .mp-form-sec {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.72);
  padding: 12px;
  margin: 0 0 12px;
  scroll-margin-top: 74px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Mobile tab-mode: показываем только активную секцию анкеты */
@media (max-width: 768px) {
  #panel-profile .mp-form-sec[data-mp-form-section] {
    display: none;
  }
  #panel-profile .mp-form-sec.is-active[data-mp-form-section] {
    display: block;
  }
}

#panel-profile .mp-form-sec__hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

#panel-profile .mp-form-sec__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 950;
  color: var(--text, #0f172a);
}

#panel-profile .mp-form-sec__sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

#panel-profile .mp-help {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

#panel-profile .mp-help--lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.9);
}

/* Категории заказов — системный matching-блок; ниже mp-editor — поля анкеты */
#panel-profile .feed-cat-card.feed-cat-card--system-match {
  border-left: 4px solid rgba(99, 102, 241, 0.65);
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.11);
}

#panel-profile .mp-editor.mp-editor--profile-field {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
}

#panel-profile .mp-editor.mp-editor--profile-field .mp-editor__title {
  color: #1e293b;
}

/* spec: secondary — мягче карточка и заголовок, без конкуренции с «Категории заказов» */
#panel-profile .mp-editor.mp-editor--profile-field.mp-editor--profile-soft {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(165deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.032);
}

#panel-profile .mp-editor.mp-editor--profile-field.mp-editor--profile-soft .mp-editor__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

#panel-profile .mp-editor.mp-editor--profile-field.mp-editor--profile-soft .mp-editor__sub {
  color: #64748b;
  font-size: 0.72rem;
}

/*
 * Акценты карточек профиля: только левый край + полоска в шапке + бейдж счётчика.
 * В DOM: spec, skills, tools, subcat. Тело карточки — почти белое, без «пятен».
 */
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'],
#panel-profile .mp-editor.mp-editor--profile-field.mp-editor--profile-soft[data-mp-editor='spec'] {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-left-width: 3px;
  border-left-color: rgba(99, 102, 241, 0.48);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-left-width: 3px;
  border-left-color: rgba(20, 184, 166, 0.45);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-left-width: 3px;
  border-left-color: rgba(14, 165, 233, 0.48);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-left-width: 3px;
  border-left-color: rgba(245, 158, 11, 0.48);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'] .mp-editor__hd {
  border-radius: 10px;
  box-shadow: inset 0 2px 0 0 rgba(99, 102, 241, 0.32);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__hd {
  border-radius: 10px;
  box-shadow: inset 0 2px 0 0 rgba(45, 212, 191, 0.35);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__hd {
  border-radius: 10px;
  box-shadow: inset 0 2px 0 0 rgba(56, 189, 248, 0.38);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__hd {
  border-radius: 10px;
  box-shadow: inset 0 2px 0 0 rgba(251, 191, 36, 0.42);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'] .mp-editor__selrow,
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__selrow,
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__selrow,
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__selrow {
  border-color: rgba(148, 163, 184, 0.26);
  background: #f8fafc;
  box-shadow: none;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'] .mp-editor__presets,
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__presets,
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__presets,
#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__presets {
  background: transparent;
  box-shadow: none;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'] .mp-editor__selmeta {
  padding: 3px 10px 4px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(238, 242, 255, 0.75);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__selmeta {
  padding: 3px 10px 4px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: rgba(240, 253, 250, 0.75);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__selmeta {
  padding: 3px 10px 4px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(240, 249, 255, 0.78);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__selmeta {
  padding: 3px 10px 4px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(255, 251, 235, 0.85);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'] .mp-editor__sellbl {
  color: rgba(67, 56, 163, 0.88);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__sellbl {
  color: rgba(15, 118, 110, 0.9);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__sellbl {
  color: rgba(3, 105, 161, 0.9);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__sellbl {
  color: rgba(180, 83, 9, 0.92);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'] .mp-editor__selnum {
  color: #312e81;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__selnum {
  color: #0f766e;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__selnum {
  color: #0369a1;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__selnum {
  color: #b45309;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__preset.is-selected {
  color: #134e4a;
  border-color: rgba(13, 148, 136, 0.46);
  background: rgba(204, 251, 241, 0.88);
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.1);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__preset.is-selected .mp-editor__check {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.38);
  background: rgba(204, 251, 241, 0.96);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'] .mp-editor__preset:focus-visible {
  outline-color: #14b8a6;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__preset.is-selected {
  color: #0c4a6e;
  border-color: rgba(14, 165, 233, 0.48);
  background: rgba(224, 242, 254, 0.9);
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.1);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__preset.is-selected .mp-editor__check {
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.4);
  background: rgba(224, 242, 254, 0.96);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'] .mp-editor__preset:focus-visible {
  outline-color: #0ea5e9;
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__preset.is-selected {
  color: #7c2d12;
  border-color: rgba(245, 158, 11, 0.48);
  background: rgba(254, 243, 199, 0.88);
  box-shadow: 0 1px 4px rgba(217, 119, 6, 0.08);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__preset.is-selected .mp-editor__check {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(254, 243, 199, 0.96);
}

#panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] .mp-editor__preset:focus-visible {
  outline-color: #f59e0b;
}

/* Enhanced editors — визуально как блок «Категории ленты» (.feed-cat-card / .feed-cat-grid / .feed-cat-chip) */
#panel-profile .mp-editor {
  margin: 0 0 14px;
  padding: 11px 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 242, 255, 0.55) 48%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.05);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#panel-profile .mp-editor__hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

#panel-profile .mp-editor__title {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: #0f172a;
}

#panel-profile .mp-editor__sub {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.38;
  color: #475569;
}

#panel-profile .mp-editor__toggle {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#panel-profile .mp-editor__toggle:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(255, 255, 255, 1);
}

#panel-profile .mp-editor__chips .mp-muted {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}

#panel-profile .mp-editor__chips[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

#panel-profile .mp-editor__chips-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#panel-profile .mp-editor__chips-lbl {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

#panel-profile .mp-editor__chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  align-content: flex-start;
  min-width: 0;
}

#panel-profile .mp-editor__presets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 0 10px;
}

@media (min-width: 380px) {
  #panel-profile .mp-editor__presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 520px) {
  #panel-profile .mp-editor__presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  #panel-profile .mp-editor__presets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#panel-profile .mp-editor__preset {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  margin: 0;
  padding: 10px 22px 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#panel-profile .mp-editor__preset:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(255, 255, 255, 1);
}

#panel-profile .mp-editor__preset .mp-editor__check {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 140ms ease, transform 140ms ease;
  color: #3730a3;
  background: rgba(224, 231, 255, 0.95);
  border: 1px solid rgba(129, 140, 248, 0.55);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
}

#panel-profile .mp-editor__preset.is-selected {
  color: #1e1b4b;
  border-color: rgba(99, 102, 241, 0.65);
  background: linear-gradient(145deg, rgba(224, 231, 255, 0.95), rgba(199, 210, 254, 0.55));
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.18);
}

#panel-profile .mp-editor__preset.is-selected .mp-editor__check {
  opacity: 1;
  transform: scale(1);
}

#panel-profile .mp-editor__preset:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* «Виды работ»: группы + pills (аккордеон), без сетки карточек */
#panel-profile .mp-editor--skills-catalog .mp-editor__presets {
  display: block;
  margin: 0 0 8px;
}

#panel-profile .mp-editor--skills-catalog .mp-skills-acc {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#panel-profile .mp-editor--skills-catalog .mp-skills-details {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

#panel-profile .mp-editor--skills-catalog .mp-skills-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #0f172a;
  background: #f8fafc;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#panel-profile .mp-editor--skills-catalog .mp-skills-summary::-webkit-details-marker {
  display: none;
}

#panel-profile .mp-editor--skills-catalog .mp-skills-summary::marker {
  content: '';
}

#panel-profile .mp-editor--skills-catalog .mp-skills-summary::after {
  content: '';
  flex: 0 0 auto;
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

#panel-profile .mp-editor--skills-catalog .mp-skills-details[open] .mp-skills-summary::after {
  transform: rotate(-135deg);
}

#panel-profile .mp-editor--skills-catalog .mp-skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  padding: 10px 10px 12px;
  min-width: 0;
  background: #fff;
}

#panel-profile .mp-editor--skills-catalog .mp-editor__preset--pill {
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 26px 6px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.3;
}

#panel-profile .mp-editor--skills-catalog .mp-editor__preset--pill .mp-editor__check {
  top: 50%;
  right: 6px;
  margin-top: -9px;
}

#panel-profile .mp-editor__selrow--countonly {
  justify-content: flex-start;
  margin-top: 2px;
}

#panel-profile .mp-editor__selrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.9);
}

#panel-profile .mp-editor__selmeta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

#panel-profile .mp-editor__sellbl {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

#panel-profile .mp-editor__selnum {
  color: #0f172a;
  font-weight: 800;
  font-size: 0.875rem;
}

#panel-profile .mp-editor__clear {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#panel-profile .mp-editor__clear:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(255, 255, 255, 1);
}

#panel-profile .mp-editor__chips {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  margin: 0 0 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.92);
}

#panel-profile .mp-editor__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.55);
  background: rgba(224, 231, 255, 0.95);
  color: #3730a3;
  font-weight: 600;
  font-size: 0.6875rem;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#panel-profile .mp-editor__chip:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(255, 255, 255, 0.98);
}

#panel-profile .mp-editor__chips-toggle {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  align-self: flex-start;
  flex: 0 0 auto;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#panel-profile .mp-editor__chips-toggle:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(255, 255, 255, 1);
}

#panel-profile .mp-editor__chips-toggle--less {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(248, 250, 252, 0.95);
  color: #64748b;
}

#panel-profile .mp-editor__chip .mp-editor__x {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.65);
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}

#panel-profile .mp-editor__add {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
}

#panel-profile .mp-editor__inp {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.88);
  padding: 8px 10px;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #0f172a;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#panel-profile .mp-editor__inp:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(255, 255, 255, 1);
}

#panel-profile .mp-editor__btn {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: rgba(255, 255, 255, 0.92);
  color: #3730a3;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#panel-profile .mp-editor__btn:hover {
  border-color: rgba(99, 102, 241, 0.65);
  background: linear-gradient(145deg, rgba(224, 231, 255, 0.55), rgba(255, 255, 255, 0.98));
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

@media (min-width: 1024px) {
  #panel-profile .mp-editor {
    padding: 12px 14px 14px;
    margin: 0 0 14px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
  }

  #panel-profile .mp-editor__chips {
    padding: 8px 10px;
  }

  #panel-profile .mp-editor__chips-list {
    gap: 7px;
  }

  #panel-profile .mp-editor__add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    flex-direction: row;
    gap: 10px;
  }

  #panel-profile .mp-editor__inp {
    flex: none;
    min-width: 0;
    width: 100%;
  }

  #panel-profile .mp-editor__btn {
    width: auto;
    min-width: min(100%, 148px);
    align-self: center;
  }

  #panel-profile .mp-form-actions {
    position: static;
    bottom: auto;
    z-index: auto;
    margin-top: 12px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
}

/* Компакт + скролл длинных зон — только узкая ширина */
@media (max-width: 768px) {
  #panel-profile .master-profile-form {
    padding-bottom: 176px;
    padding-bottom: calc(176px + env(safe-area-inset-bottom));
  }

  #panel-profile .mp-editor {
    padding: 10px;
    margin: 0 0 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  }

  #panel-profile .mp-editor__hd {
    gap: 8px;
    margin: 0 0 8px;
  }

  #panel-profile .mp-editor__presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 8px;
    max-height: 160px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }

  #panel-profile .mp-editor--skills-catalog .mp-editor__presets {
    display: block;
    max-height: none;
    overflow: visible;
    grid-template-columns: none;
  }

  #panel-profile .mp-editor__preset {
    min-height: 42px;
    padding: 8px 20px 8px 8px;
    font-size: 0.7rem;
  }

  #panel-profile .mp-editor--skills-catalog .mp-editor__preset--pill {
    min-height: 34px;
    padding: 5px 24px 5px 8px;
    font-size: 0.66rem;
  }

  #panel-profile .mp-editor__selrow {
    gap: 8px;
    padding: 7px 9px;
    border-radius: 12px;
    margin: 0 0 8px;
  }

  #panel-profile .mp-editor__chips {
    margin: 0 0 8px;
    padding: 6px 8px;
    max-height: none;
    overflow: visible;
  }

  #panel-profile .mp-editor__chips-list {
    max-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }

  #panel-profile .mp-editor__chip {
    gap: 6px;
    padding: 5px 8px;
  }

  #panel-profile .mp-editor__chips-toggle {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  #panel-profile .mp-editor__add {
    gap: 8px;
  }

  #panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='spec'],
  #panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='skills'],
  #panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='tools'],
  #panel-profile .mp-editor.mp-editor--profile-field[data-mp-editor='subcat'] {
    background: #fff;
    box-shadow: none;
  }
}

@media (max-width: 379px) {
  #panel-profile .mp-editor__presets {
    grid-template-columns: 1fr;
  }

  #panel-profile .mp-editor--skills-catalog .mp-editor__presets {
    grid-template-columns: none;
  }
}

/* Планшет: чуть плотнее карточки, без внутреннего скролла пресетов/чипов */
@media (max-width: 1023px) and (min-width: 769px) {
  #panel-profile .mp-editor {
    padding: 12px 13px;
    margin: 0 0 12px;
  }

  #panel-profile .mp-editor__presets,
  #panel-profile .mp-editor__chips,
  #panel-profile .mp-editor__chips-list {
    max-height: none;
    overflow: visible;
  }
}

/* Switch cards */
#panel-profile .mp-switch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

#panel-profile .mp-switch {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

#panel-profile .mp-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#panel-profile .mp-switch__ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
}

#panel-profile .mp-switch__ui::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transition: left 140ms ease, background 140ms ease;
}

#panel-profile .mp-switch input:checked + .mp-switch__ui {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.28);
}

#panel-profile .mp-switch input:checked + .mp-switch__ui::after {
  left: 21px;
}

#panel-profile .mp-switch__title {
  font-weight: 950;
  font-size: 12.5px;
  color: var(--text, #0f172a);
  display: block;
}

#panel-profile .mp-switch__sub {
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
  display: block;
  margin-top: 4px;
}

@media (max-width: 980px) {
  #panel-profile .mp-switch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  #panel-profile .mp-tabs {
    padding: 6px;
    gap: 6px;
    border-radius: 14px;
  }
  #panel-profile .mp-tab {
    padding: 7px 10px;
    font-size: 11.5px;
    border-radius: 12px;
  }

  #panel-profile .mp-form-nav {
    padding: 8px;
    border-radius: 14px;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.96);
    margin: 8px 0 12px;
  }
  #panel-profile .mp-form-actions .btn-primary {
    width: 100%;
  }

  #panel-profile .mp-form-sec {
    padding: 10px;
    border-radius: 16px;
    margin-bottom: 10px;
  }

  #panel-profile .mp-form-sec__hd {
    margin-bottom: 8px;
  }

  #panel-profile .mp-form-sec__sub {
    font-size: 11.5px;
  }

  #panel-profile .mp-editor {
    padding: 10px;
    border-radius: 16px;
    margin-bottom: 10px;
  }

  #panel-profile .mp-editor__hd {
    gap: 8px;
    align-items: flex-start;
  }

  #panel-profile .mp-editor__toggle {
    padding: 7px 9px;
    border-radius: 12px;
  }

  #panel-profile .mp-editor__add {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #panel-profile .mp-editor__selrow {
    padding: 8px 10px;
    gap: 8px;
  }

  #panel-profile .mp-editor__clear {
    padding: 7px 9px;
  }

  #panel-profile .mp-editor__btn {
    width: 100%;
    justify-content: center;
  }

  #panel-profile .mp-help--lock {
    max-width: 100%;
    white-space: normal;
  }
}

/* Sticky «Сохранить» только при видимом bottom-nav (mobile), desktop ≥1024 — static выше */
@media (max-width: 767.98px) {
  #panel-profile .mp-form-actions {
    position: sticky;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 92;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.07);
  }
}

@media (max-width: 375px) {
  #panel-profile .mp-tabs {
    padding: 5px;
    gap: 5px;
  }
  #panel-profile .mp-tab {
    padding: 6px 9px;
    font-size: 11px;
  }
  #panel-profile .mp-form-nav {
    padding: 7px;
    gap: 6px;
  }
  #panel-profile .mp-form-tab {
    padding: 6px 9px;
    font-size: 11px;
  }
}

#panel-profile .mp-empty {
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.7);
  color: var(--muted, #64748b);
  font-size: 12.5px;
  line-height: 1.4;
}

#panel-profile .mp-actions-row {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#panel-profile .mp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#panel-profile .mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.16);
  color: #4338ca;
  font-size: 12px;
  font-weight: 900;
  max-width: 100%;
}

#panel-profile .mp-quick {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#panel-profile .mp-qbtn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.85);
  color: var(--text, #0f172a);
  padding: 10px 12px;
  font-weight: 900;
  font-size: 12.5px;
  cursor: pointer;
}

#panel-profile .mp-qbtn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

#panel-profile .mp-soon {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  font-size: 11px;
  font-weight: 950;
  border: 1px solid rgba(245, 158, 11, 0.18);
}

/* ── Предпросмотр профиля (клиентская карточка) ── */
#panel-profile .mp-preview {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

#panel-profile .mp-preview.is-open {
  display: flex;
}

#panel-profile .mp-preview__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

#panel-profile .mp-preview__panel {
  position: relative;
  margin: auto;
  width: min(720px, calc(100vw - 24px));
  max-height: min(88vh, 860px);
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#panel-profile .mp-preview__hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

#panel-profile .mp-preview__title {
  font-weight: 950;
  font-size: 14px;
  color: var(--text, #0f172a);
}

#panel-profile .mp-preview__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #64748b);
}

#panel-profile .mp-preview__close {
  appearance: none;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 14px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

#panel-profile .mp-preview__body {
  padding: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#panel-profile .mp-preview-card {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
  padding: 14px;
}

#panel-profile .mp-preview-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

#panel-profile .mp-preview-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.9);
  flex: 0 0 auto;
}

#panel-profile .mp-preview-avatar--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.45);
}

#panel-profile .mp-preview-who {
  min-width: 0;
  flex: 1;
}

#panel-profile .mp-preview-name {
  font-weight: 950;
  color: var(--text, #0f172a);
  font-size: 14px;
  line-height: 1.2;
}

#panel-profile .mp-preview-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#panel-profile .mp-preview-city {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 800;
}

#panel-profile .mp-preview-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: #4338ca;
  font-size: 12px;
  font-weight: 950;
}

#panel-profile .mp-preview-section {
  margin-top: 12px;
}

#panel-profile .mp-preview-h {
  font-weight: 950;
  font-size: 12.5px;
  color: var(--text, #0f172a);
  margin-bottom: 8px;
}

#panel-profile .mp-preview-bio {
  font-size: 12.5px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

#panel-profile .mp-preview-empty {
  font-size: 12.5px;
  color: var(--muted, #64748b);
}

#panel-profile .mp-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#panel-profile .mp-preview-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.16);
  color: #4338ca;
  font-size: 12px;
  font-weight: 950;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

#panel-profile .mp-preview-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#panel-profile .mp-preview-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.9);
  color: var(--text, #0f172a);
  font-size: 12px;
  font-weight: 900;
}

#panel-profile .mp-preview-trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#panel-profile .mp-preview-trustrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.85);
  color: var(--text, #0f172a);
  font-weight: 900;
  font-size: 12.5px;
}

#panel-profile .mp-preview-truststate {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted, #64748b);
  white-space: nowrap;
}

#panel-profile .mp-preview-trustrow--ok .mp-preview-truststate {
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.10);
  color: #047857;
}

#panel-profile .mp-preview-trustrow--wait .mp-preview-truststate {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

/* ── Premium: Документы / Портфолио / Отзывы (master profile) ── */
#panel-profile .master-profile-block .master-profile-muted {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

#panel-profile .master-profile-doclist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#panel-profile .master-profile-docitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.85);
}

#panel-profile .master-profile-docmain strong {
  display: block;
  font-weight: 950;
  font-size: 13px;
  color: var(--text, #0f172a);
}

#panel-profile .master-profile-docmeta {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #64748b);
}

#panel-profile .master-profile-doclink {
  appearance: none;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
  padding: 8px 10px;
  border-radius: 14px;
  font-weight: 950;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

#panel-profile .master-profile-portgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#panel-profile .master-profile-portitem {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.85);
}

#panel-profile .master-profile-portitem img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

#panel-profile .master-profile-revhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.85);
  margin-bottom: 10px;
}

#panel-profile .master-profile-revavg-val {
  font-weight: 950;
  font-size: 18px;
  color: var(--text, #0f172a);
}

#panel-profile .master-profile-revavg-lbl {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #64748b);
}

#panel-profile .master-profile-revcnt {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-weight: 900;
}

#panel-profile .master-profile-revlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#panel-profile .master-profile-revitem {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

#panel-profile .master-profile-revtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#panel-profile .master-profile-revauthor {
  font-weight: 950;
  font-size: 12.5px;
  color: var(--text, #0f172a);
}

#panel-profile .master-profile-revrating {
  font-weight: 950;
  font-size: 12.5px;
  color: #4338ca;
}

#panel-profile .master-profile-revtext {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

#panel-profile .master-profile-revdate {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(100, 116, 139, 0.9);
  font-weight: 800;
}

@media (max-width: 520px) {
  #panel-profile .master-profile-portgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #panel-profile .master-profile-docitem {
    flex-direction: column;
    align-items: stretch;
  }
  #panel-profile .master-profile-doclink {
    width: 100%;
    justify-content: center;
  }
}

body.mp-preview-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  #panel-profile .mp-preview__panel {
    width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    /* fallback for WebView, then modern dvh */
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    /* держим контент выше bottom-nav */
    padding-bottom: 0;
  }
  #panel-profile .mp-preview__body {
    /* запас под bottom-nav + safe-area */
    padding-bottom: 120px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
}

#panel-profile .mp-tiplist {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted, #64748b);
  font-size: 12.5px;
  line-height: 1.45;
}

#panel-profile .mp-tiplist li {
  margin: 0 0 8px;
}

#panel-profile .mp-tiplist li:last-child {
  margin-bottom: 0;
}

@media (max-width: 1050px) {
  #panel-profile .mp-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  #panel-profile .mp-hero__grid {
    grid-template-columns: 1fr;
  }
  #panel-profile .mp-hero__kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #panel-profile .mp-head__right {
    width: 100%;
    justify-content: space-between;
  }
  #panel-profile .mp-btn {
    flex: 1;
    justify-content: center;
  }
  #panel-profile .mp-hero {
    padding: 14px;
  }
  #panel-profile .mp-hero__kpis {
    grid-template-columns: 1fr;
  }
}

.master-profile-stack .section-card .master-profile-block {
  border: none;
  padding: 0;
  background: transparent;
}

.master-profile-block {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.master-profile-block > h3,
.master-profile-block > .master-profile-block-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.master-profile-muted {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.master-profile-loadwarn {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--text);
}

.master-profile-form-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.master-profile-usergrid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 20px;
  align-items: start;
}

.master-profile-avwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.master-profile-selfie-btn {
  font-size: 12px;
  padding: 8px 12px;
  white-space: nowrap;
}

.master-profile-avhint {
  margin: 0;
  max-width: 220px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.master-profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}

.master-profile-avatar--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
}

.master-profile-dl {
  margin: 0;
  display: grid;
  gap: 10px 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.master-profile-dl > div {
  min-width: 0;
}

.master-profile-dl dt {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.master-profile-dl dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.master-profile-access-head {
  margin-bottom: 12px;
}

.master-profile-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.master-profile-badge--ok {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.master-profile-badge--wait {
  background: rgba(251, 191, 36, 0.2);
  color: #b45309;
}

.master-profile-access-msg {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}

.master-profile-misswrap {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.master-profile-misstitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.master-profile-misslist {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.master-profile-chklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.master-profile-chkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.master-profile-chkico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.master-profile-chkico--ok {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.master-profile-chkico--no {
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

.master-profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items: start;
}

.master-profile-form-grid > .master-finance-field {
  margin: 0;
}

.master-profile-field-span2 {
  grid-column: 1 / -1;
}

.master-profile-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.master-profile-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.master-profile-doclist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.master-profile-docitem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.master-profile-docitem:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.master-profile-docmain {
  min-width: 0;
}

.master-profile-docmain strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.master-profile-docmeta {
  font-size: 12px;
  color: var(--muted);
}

.master-profile-doclink {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.master-profile-doclink:hover {
  text-decoration: underline;
}

.master-profile-portgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.master-profile-portitem {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.master-profile-portitem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.master-profile-revhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.master-profile-revavg {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.master-profile-revavg-val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.master-profile-revavg-lbl {
  font-size: 13px;
  color: var(--muted);
}

.master-profile-revcnt {
  font-size: 14px;
  color: var(--muted);
}

.master-profile-revlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.master-profile-revitem {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.master-profile-revtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.master-profile-revauthor {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.master-profile-revrating {
  font-size: 13px;
  font-weight: 700;
  color: #ca8a04;
}

.master-profile-revtext {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.master-profile-revdate {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .master-profile-usergrid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .master-profile-dl {
    text-align: left;
    width: 100%;
  }

  .master-profile-form-grid {
    grid-template-columns: 1fr;
  }

  .master-profile-field-span2 {
    grid-column: 1;
  }
}

/* Настройки мастера v2 */
.master-settings-wrap {
  margin-top: 12px;
}

.master-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.master-settings-tab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.master-settings-tab:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--primary);
}

.master-settings-tab--active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.master-settings-panels .master-settings-panel {
  display: none;
}

.master-settings-panels .master-settings-panel.visible {
  display: block;
}

.master-settings-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.master-settings-readonly {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}

.master-settings-subtitle {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.master-settings-check-row {
  margin-bottom: 14px;
}

.master-settings-city-form {
  margin-top: 12px;
}

.master-settings-hr {
  margin: 22px 0;
  border: none;
  border-top: 1px solid var(--border);
}

.master-settings-city-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
}

.master-settings-city-card--ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.master-settings-city-card--warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
}

.master-settings-city-lock {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ─── Главная v2: app-style ─── */
.master-home-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 4px 24px;
}

@media (min-width: 900px) {
  .master-home-app {
    max-width: 560px;
  }
}

.master-home-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* Главная: белая CRM-шапка скрыта целиком — заголовок/меню только в синей hero */
body.master-suite-v2.master-v2-home-active #masterCrmHeader {
  display: none !important;
}

/* ─── Главная: hero-шапка (premium indigo / glass) ─── */
.master-home-hero-card {
  position: relative;
  margin-bottom: 14px;
  border-radius: 28px;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 32%, #3730a3 58%, #4338ca 82%, #4c1d95 100%);
  box-shadow:
    0 18px 48px rgba(49, 46, 129, 0.38),
    0 6px 18px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.master-home-hero-card__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120px 90px at 92% 8%, rgba(255, 255, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 100px 80px at 4% 96%, rgba(255, 255, 255, 0.08), transparent 50%);
}

.master-home-hero-card__inner {
  position: relative;
  z-index: 1;
  padding: 16px 16px 14px;
  max-width: 100%;
  box-sizing: border-box;
}

.master-home-hero-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.master-home-hero-card__lead {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.master-home-hero-card__menu-btn {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.master-home-hero-card__menu-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
}

.master-home-hero-card__menu-btn:active {
  transform: scale(0.97);
}

.master-home-hero-card__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.master-home-hero-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  min-width: 0;
}

.master-home-hero-card__topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.master-home-hero-card__identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

.master-home-hero-identity__avatar {
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(160deg, rgba(30, 58, 138, 0.5), rgba(15, 23, 42, 0.55));
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.14) inset,
    0 8px 22px rgba(15, 23, 42, 0.28);
  box-sizing: border-box;
}

.master-home-hero-identity__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.master-home-hero-identity__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.96);
  background: linear-gradient(150deg, rgba(67, 56, 202, 0.75), rgba(15, 23, 42, 0.78));
}

.master-home-hero-identity__col {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  box-sizing: border-box;
}

.master-home-hero-identity__name {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(1.28rem, 2.6vw + 0.72rem, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.16;
  color: #fff;
  overflow-wrap: normal;
  word-break: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  box-sizing: border-box;
}

.master-home-hero-identity__col .master-home-hero-card__date-chip {
  margin-top: 0;
}

/* Статус под ФИО в колонке identity (премиум-компакт) */
.master-home-hero-identity__col .master-home-hero-online {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
}

.master-home-hero-card__notif-row--solo {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.master-home-hero-card__notif-row--solo .master-home-hero-notif {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.master-home-hero-card__sub {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
}

.master-home-hero-card__chip {
  flex-shrink: 0;
  max-width: 46%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.master-home-hero-card__chip:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

.master-home-hero-card__chip-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.master-home-hero-card__chip-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.master-home-hero-card__chip-name {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-home-hero-card__chip-meta {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-home-hero-card__chip-chev {
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.55;
}

.master-home-hero-card__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 0;
}

.master-home-hero-card__date {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-transform: capitalize;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 140px;
}

.master-home-hero-card__toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.master-home-mode-switch--hero {
  background: rgba(15, 23, 42, 0.18);
}

.master-home-mode-switch--hero .master-home-mode-btn {
  color: rgba(255, 255, 255, 0.78);
}

.master-home-mode-switch--hero .master-home-mode-btn--active {
  background: #fff;
  color: #1e3a8a;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12);
}

.master-home-hero-card--premium {
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.35) 0%, transparent 42%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 18%, #312e81 42%, #4338ca 72%, #5b21b6 100%);
  box-shadow:
    0 22px 56px rgba(30, 27, 75, 0.42),
    0 8px 22px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.master-home-hero-card--premium .master-home-hero-card__decor {
  background:
    radial-gradient(ellipse 180px 120px at 92% 4%, rgba(147, 197, 253, 0.22), transparent 55%),
    radial-gradient(ellipse 160px 110px at 6% 96%, rgba(167, 139, 250, 0.2), transparent 52%),
    radial-gradient(ellipse 100px 80px at 48% 38%, rgba(255, 255, 255, 0.08), transparent 65%),
    radial-gradient(ellipse 90px 70px at 72% 78%, rgba(59, 130, 246, 0.12), transparent 50%);
}

.master-home-hero-card--premium .master-home-hero-card__inner {
  padding: 18px 18px 16px;
}

.master-home-hero-card__grid {
  display: grid;
  grid-template-columns: 1fr minmax(168px, 36%);
  gap: 14px 18px;
  align-items: start;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 561px) {
  .master-home-hero-card__grid {
    grid-template-columns: 1fr minmax(200px, 38%);
    gap: 16px 20px;
  }
}

.master-home-hero-card__main {
  min-width: 0;
}

.master-home-hero-card__side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Hero: строка «уведомления + статус» (премиум) */
.master-home-hero-card__notif-online-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.master-home-hero-notif {
  flex: 1 1 118px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  box-sizing: border-box;
}

.master-home-hero-notif:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
}

.master-home-hero-notif--active {
  border-color: rgba(252, 165, 165, 0.45);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.12);
}

.master-home-hero-notif__icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.master-home-hero-notif__icon {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.94);
}

.master-home-hero-notif--active .master-home-hero-notif__icon {
  animation: master-home-bell-nudge 2.8s ease-in-out infinite;
}

.master-home-hero-notif__badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f87171, #dc2626);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.5);
}

.master-home-hero-notif--active .master-home-hero-notif__badge {
  animation: master-home-badge-soft-pulse 2.4s ease-in-out infinite;
}

.master-home-hero-notif__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-home-hero-notif__label--muted {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.master-home-hero-online {
  flex: 1 1 118px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.master-home-hero-online__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.master-home-hero-online__label {
  margin: 0;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-home-hero-online--ready {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.45);
}

.master-home-hero-online--ready .master-home-hero-online__label {
  color: #ecfdf5;
}

.master-home-hero-online--ready .master-home-hero-online__dot {
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35), 0 0 12px rgba(52, 211, 153, 0.55);
  animation: master-home-online-dot-glow 2.2s ease-in-out infinite;
}

.master-home-hero-online--office {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}

.master-home-hero-online--office .master-home-hero-online__label {
  color: rgba(255, 255, 255, 0.96);
}

.master-home-hero-online--office .master-home-hero-online__dot {
  background: #6ee7b7;
  box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.35), 0 0 10px rgba(52, 211, 153, 0.35);
  animation: master-home-online-dot-glow 2.8s ease-in-out infinite;
}

.master-home-hero-online--shift {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.28), rgba(16, 185, 129, 0.22));
  border-color: rgba(167, 139, 250, 0.42);
}

.master-home-hero-online--shift .master-home-hero-online__label {
  color: #f5f3ff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.master-home-hero-online--shift .master-home-hero-online__dot {
  background: #a7f3d0;
  box-shadow: 0 0 0 2px rgba(167, 243, 208, 0.35), 0 0 12px rgba(16, 185, 129, 0.45);
  animation: master-home-online-dot-glow 2.4s ease-in-out infinite;
}

.master-home-hero-online--profile {
  background: rgba(254, 243, 199, 0.2);
  border-color: rgba(251, 191, 36, 0.45);
}

.master-home-hero-online--profile .master-home-hero-online__label {
  color: #fef3c7;
}

.master-home-hero-online--profile .master-home-hero-online__dot {
  background: #fbbf24;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35);
  animation: master-home-online-dot-glow 2.6s ease-in-out infinite;
}

.master-home-hero-online--muted {
  background: rgba(15, 23, 42, 0.22);
  border-color: rgba(255, 255, 255, 0.18);
}

.master-home-hero-online--muted .master-home-hero-online__label {
  color: rgba(255, 255, 255, 0.86);
}

.master-home-hero-online--muted .master-home-hero-online__dot {
  background: rgba(255, 255, 255, 0.35);
  animation: none;
}

@keyframes master-home-online-dot-glow {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.92;
    filter: brightness(1.12);
  }
}

@keyframes master-home-bell-nudge {
  0%,
  88%,
  100% {
    transform: rotate(0deg);
  }
  90% {
    transform: rotate(11deg);
  }
  94% {
    transform: rotate(-9deg);
  }
  98% {
    transform: rotate(6deg);
  }
}

@keyframes master-home-badge-soft-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.45);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 3px 14px rgba(220, 38, 38, 0.55);
  }
}

.master-home-hero-card__date-chip {
  display: inline-block;
  margin-top: 2px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  text-transform: capitalize;
  max-width: 100%;
  box-sizing: border-box;
  letter-spacing: 0.02em;
}

.master-home-hero-card__mode-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.master-home-hero-card__mode-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.master-home-mode-switch--premium {
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  gap: 4px;
}

.master-home-mode--office .master-home-mode-switch--premium {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.master-home-mode--shift .master-home-mode-switch--premium {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
}

.master-home-mode-switch--premium .master-home-mode-btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
}

.master-home-hero-profile-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.master-home-hero-profile-btn__ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
}

.master-home-hero-profile-btn__ico i {
  opacity: 0.95;
}

.master-home-hero-profile-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.48);
}

.master-home-hero-profile-btn:active {
  transform: scale(0.99);
}

.master-home-hero-profile-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.master-home-hero-profile-btn__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.master-home-hero-profile-btn__chev {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 12px;
  opacity: 0.88;
}

@media (min-width: 561px) {
  .master-home-hero-card__side {
    max-width: min(300px, 100%);
  }
}

.master-home-hero-sr-name,
.master-home-hero-sr-meta {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.master-home-mode-hint-micro {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted, #64748b);
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
}

/* Главная (#panel-home): скрыта карточка «Лента заказов» (приём), блок «Что сейчас важно», плашка про режим смены. Лента в #panel-feed и навигация не затрагиваются. */
#panel-home #masterAvailabilityCard,
#panel-home #master-home-attention,
#panel-home .master-home-mode-hint-micro.master-home-office-only {
  display: none !important;
}

.master-home-section-title--quiet {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted, #64748b);
}

.master-home-quick-wrap {
  margin-top: 0;
}

/* ─── Быстрые действия: premium glass ─── */
.master-home-quick-wrap--premium {
  margin-top: 4px;
  padding: 18px 16px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 48%, #f4f6f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.07),
    0 4px 14px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  box-sizing: border-box;
  max-width: 100%;
}

.master-home-quick-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 2px;
  min-width: 0;
}

.master-home-quick-head__ico {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(196, 181, 253, 0.55) 0%, rgba(165, 180, 252, 0.35) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #312e81;
  font-size: 15px;
  box-shadow:
    0 2px 10px rgba(79, 70, 229, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.master-home-quick-head__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text, #0f172a);
  line-height: 1.2;
}

.master-home-quick-head__dots {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 4px 0 4px 8px;
}

.master-home-quick-head__dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.55);
}

.master-home-below-quick {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.master-home-section--tight {
  margin-bottom: 0 !important;
}

.master-home-hero--below-quick {
  margin-bottom: 0 !important;
}

.master-home-hero--below-quick .master-home-hero-glass {
  padding: 14px 14px 12px;
}

.master-home-hero--below-quick .master-home-avatar-wrap {
  width: 56px;
  height: 56px;
}

.master-home-hero--below-quick .master-home-name {
  font-size: 1.1rem;
}

/* «Профиль и развитие»: дубли имени/роли/статуса скрыты, JS по id сохраняется */
.master-home-profile-dev .master-home-hero-glass {
  position: relative;
}

.master-home-jsshim-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;
}

.master-home-profile-dev .master-home-hero-workline {
  margin-top: 0;
}

.master-home-profile-dev .master-home-progress-block {
  margin-top: 0;
}

.master-home-profile-dev .master-home-reviews-hint {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

.master-home-profile-dev .master-home-cta-profile {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  margin-top: 4px;
}

.master-home-finance-strip {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

.master-home-finance-strip__btn {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.master-home-revenue--inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.master-home-analytics-fold {
  border-radius: 16px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fafafa;
  overflow: hidden;
}

.master-home-analytics-fold__sum {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-home-analytics-fold__sum::-webkit-details-marker {
  display: none;
}

.master-home-analytics-fold__sum::after {
  content: '';
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted, #94a3b8);
  border-bottom: 2px solid var(--muted, #94a3b8);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.master-home-analytics-fold[open] .master-home-analytics-fold__sum::after {
  transform: rotate(-135deg);
}

.master-home-analytics-fold .master-home-section--card {
  margin: 0;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0 12px 12px;
}

.master-home-analytics-fold__stat {
  margin-top: 10px;
  width: 100%;
}

.master-home-section--nohead {
  padding-top: 0;
}

.master-home-extra {
  margin-top: 4px;
  border-radius: 16px;
  border: 1px dashed var(--border, #cbd5e1);
  background: rgba(248, 250, 252, 0.65);
  overflow: hidden;
}

.master-home-extra__summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text, #334155);
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-home-extra__summary::-webkit-details-marker {
  display: none;
}

.master-home-extra__summary::after {
  content: '';
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted, #94a3b8);
  border-bottom: 2px solid var(--muted, #94a3b8);
  transform: rotate(45deg);
}

.master-home-extra[open] .master-home-extra__summary::after {
  transform: rotate(-135deg);
}

.master-home-extra__body {
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Hero: одна колонка и вертикальный stack справа до ~561px — иначе «1fr | auto» сжимает заголовок и ФИО */
@media (max-width: 560.98px) {
  .master-home-hero-card--premium .master-home-hero-card__inner {
    padding: 14px 14px 12px;
  }

  .master-home-hero-card__grid {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .master-home-hero-card__main,
  .master-home-hero-card__side,
  .master-home-hero-card__topbar,
  .master-home-hero-card__identity {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .master-home-hero-card__identity {
    padding: 10px 12px;
    gap: 12px;
  }

  .master-home-hero-identity__avatar {
    width: 60px;
    height: 60px;
  }

  .master-home-hero-identity__name {
    font-size: clamp(1.22rem, 5.4vw + 0.52rem, 1.45rem);
    line-height: 1.14;
    letter-spacing: -0.022em;
  }

  .master-home-hero-card__side {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .master-home-hero-card__mode-block {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  .master-home-mode-switch--premium {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
  }

  .master-home-mode-switch--premium .master-home-mode-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .master-home-hero-card__notif-online-row {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
    box-sizing: border-box;
  }

  .master-home-hero-card__notif-online-row:not(.master-home-hero-card__notif-row--solo) .master-home-hero-notif,
  .master-home-hero-card__notif-online-row:not(.master-home-hero-card__notif-row--solo) .master-home-hero-online {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .master-home-hero-card__notif-row--solo .master-home-hero-notif {
    flex: 1 1 100%;
    width: 100%;
  }

  .master-home-hero-profile-btn {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 46px;
  }

  .master-home-hero-profile-btn__ico {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

@media (max-width: 430.98px) {
  .master-home-hero-card {
    border-radius: 22px;
    margin-bottom: 12px;
  }

  .master-home-hero-card--premium {
    border-radius: 24px;
  }

  .master-home-hero-card--premium .master-home-hero-card__inner {
    padding: 12px 12px 10px;
  }

  .master-home-hero-card__grid {
    gap: 10px;
  }

  .master-home-hero-card__identity {
    padding: 9px 10px;
    border-radius: 16px;
  }

  .master-home-hero-identity__avatar {
    width: 56px;
    height: 56px;
  }

  .master-home-hero-identity__col {
    gap: 6px;
  }

  .master-home-hero-card__topbar {
    margin-bottom: 10px;
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .master-home-hero-card__row {
    flex-wrap: wrap;
  }

  .master-home-hero-card__topbar {
    width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__chip,
  .master-home-hero-card__chip {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .master-home-hero-card__notif-online-row:not(.master-home-hero-card__notif-row--solo) {
    flex-direction: column;
    align-items: stretch;
  }

  .master-home-hero-card__notif-online-row:not(.master-home-hero-card__notif-row--solo) .master-home-hero-notif,
  .master-home-hero-card__notif-online-row:not(.master-home-hero-card__notif-row--solo) .master-home-hero-online {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }

  .master-home-hero-profile-btn {
    padding: 9px 12px;
  }

  .master-home-hero-identity__avatar {
    width: 60px;
    height: 60px;
  }
}

.master-home-date {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}

.master-home-notif-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}

.master-home-office-only > .master-home-section + .master-home-hero {
  margin-top: 6px;
}

.master-home-hero {
  margin-bottom: 16px;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(14, 165, 233, 0.4), rgba(168, 85, 247, 0.45));
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.master-home-hero-glass {
  border-radius: 20px;
  padding: 18px 16px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.master-suite-v2 .app-main .master-home-hero-glass {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.master-home-hero-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.master-home-avatar-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  background: linear-gradient(145deg, #e0e7ff, #f8fafc);
}

.master-home-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.master-home-avatar--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--muted);
}

.master-home-avatar--ph .master-home-avatar__ini {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #475569;
}

.master-home-hero-titles {
  min-width: 0;
  flex: 1;
}

.master-home-greeting {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
}

.master-home-name {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

.master-home-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.master-home-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.master-home-pill--muted {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.25);
}

.master-home-pill--wait {
  background: rgba(251, 191, 36, 0.18);
  color: #b45309;
  border-color: rgba(251, 191, 36, 0.35);
}

.master-home-pill--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.3);
}

.master-home-progress-block {
  margin-top: 14px;
}

.master-home-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.master-home-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.master-home-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width 0.35s ease;
}

.master-home-hero-stats {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.master-home-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.master-home-hero-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.master-home-hero-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.master-home-reviews-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.master-home-cta-profile {
  width: 100%;
  margin-top: 12px;
  border-radius: 14px;
  font-weight: 700;
}

/* Главный рабочий блок «Что требует внимания» */
.master-home-attention {
  margin-bottom: 14px;
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.32);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.09), rgba(14, 165, 233, 0.05));
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}

.master-home-attention__inner {
  padding: 14px 16px 16px;
  max-width: 100%;
  box-sizing: border-box;
}

.master-home-attention__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.master-home-attention__desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.95;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
}

.master-home-attention__btn {
  width: 100%;
  border-radius: 14px;
  font-weight: 700;
}

.master-home-block--home-secondary {
  display: none !important;
}

.master-activity-feed-preview {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--text);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.master-activity-feed-preview__hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.master-activity-feed-preview__hd i {
  opacity: 0.75;
  color: #6366f1;
}

.master-activity-feed-preview__body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.master-activity-feed-preview__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.master-activity-feed-preview__chip i {
  font-size: 11px;
  opacity: 0.8;
  color: #6366f1;
}

.master-activity-feed-preview__muted {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.master-activity-feed-timeline {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.master-activity-feed-tim-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  margin-bottom: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.master-activity-feed-tim-row:last-child {
  margin-bottom: 0;
}

.master-activity-feed-tim-row:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.04);
}

.master-activity-feed-tim-row--hot {
  border-color: rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(14, 165, 233, 0.05));
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.master-activity-feed-tim-row--hot:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(14, 165, 233, 0.08));
}

.master-activity-feed-timeline-empty {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.master-activity-feed-tim-ico {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 13px;
}

.master-activity-feed-tim-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.master-activity-feed-tim-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.master-activity-feed-tim-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* Inline finance drawer (карточка заказа) */
.master-finance-inline-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.master-finance-inline-root:not([hidden]) {
  pointer-events: auto;
}

body.master-finance-inline-open {
  overflow: hidden;
}

.master-finance-inline-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.master-finance-inline-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 520px);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
  overflow-x: hidden;
  padding: 16px 16px 22px;
  /* Fallback для Android WebView без поддержки env()/max() */
  padding-bottom: 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--bg, #fff);
  border: 1px solid var(--border);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
}

.master-finance-inline-form .form-input,
.master-finance-inline-form .master-finance-inline-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.master-finance-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.master-finance-inline-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.master-finance-inline-x {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.master-finance-inline-order {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #6366f1;
}

.master-finance-inline-field {
  margin-bottom: 12px;
}

.master-finance-inline-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.master-finance-inline-textarea {
  min-height: 64px;
  resize: vertical;
}

.master-finance-inline-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.master-finance-inline-actions .btn-primary,
.master-finance-inline-actions .btn-secondary {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
}

.master-settings-subfield-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.master-prefs-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
}

.master-settings-hint--tight {
  margin-top: 6px;
  font-size: 12px;
}

.master-settings-goto-tab {
  margin-top: 4px;
}

.master-home-taking {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.master-home-taking--hero {
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.master-home-taking--hero .master-home-taking-dot {
  background: rgba(226, 232, 240, 0.55);
}

.master-home-taking--hero .master-home-taking-dot--on {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25);
}

.master-home-taking-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.6);
  flex-shrink: 0;
}

.master-home-taking-dot--on {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.master-home-taking-dot--muted {
  background: rgba(148, 163, 184, 0.45);
}

.master-home-av-card {
  margin: 12px 0 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 48%, #f4f6f9 100%);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  padding: 14px 14px 12px;
}

.master-home-av-card--premium {
  position: relative;
  overflow: hidden;
}

.master-home-av-card--premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 180px 120px at 92% 18%, rgba(99, 102, 241, 0.14), transparent 55%),
    radial-gradient(ellipse 160px 110px at 8% 92%, rgba(14, 165, 233, 0.1), transparent 52%);
  pointer-events: none;
}

.master-home-av-card__hd,
.master-home-av-card__row,
.master-home-av-note,
.master-home-av-error {
  position: relative;
  z-index: 1;
}

.master-home-av-card__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.master-home-av-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.master-home-av-card__title i {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(14, 165, 233, 0.12));
  color: #4f46e5;
}

.master-home-av-card__row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
}

.master-home-av-state-ico {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

.master-home-av-card.is-on .master-home-av-state-ico {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

.master-home-av-state__title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.master-home-av-state__hint {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.68);
  margin-top: 2px;
}

.master-home-av-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.master-home-av-note {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.7);
}

.master-home-av-card.is-on .master-home-av-note {
  color: rgba(5, 46, 22, 0.78);
}

.master-home-av-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: rgba(153, 27, 27, 0.95);
  font-size: 12px;
  font-weight: 700;
}

.master-home-av-toggle {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(148, 163, 184, 0.35);
  position: relative;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}

.master-home-av-toggle[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.master-home-av-toggle:active {
  transform: scale(0.98);
}

.master-home-av-toggle__knob {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.18);
  transition: left 0.18s ease, box-shadow 0.18s ease;
}

.master-home-av-toggle.is-on {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.28);
}

.master-home-av-toggle.is-on .master-home-av-toggle__knob {
  left: 26px;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.18);
}

@media (max-width: 480.98px) {
  .master-home-av-card {
    padding: 13px 12px 11px;
    border-radius: 18px;
  }
  .master-home-av-card__row {
    grid-template-columns: 18px 1fr;
    gap: 10px 12px;
  }
  .master-home-av-countdown {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.master-home-hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.master-home-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.master-home-hint i {
  margin-top: 2px;
  color: #6366f1;
}

.master-home-hint--accent {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.06));
}

.master-home-hint--accent i {
  color: #4f46e5;
}

.master-home-hint--muted i {
  color: var(--muted);
}

.master-home-section {
  margin-bottom: 16px;
}

.master-home-section--card {
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}

.master-home-section-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-home-section-title i {
  opacity: 0.75;
  color: #6366f1;
}

.master-home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.master-home-section-head .master-home-section-title {
  margin: 0;
}

.master-home-link-all {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.master-home-do-now {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.master-home-do-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--text);
}

.master-home-do-card:active {
  transform: scale(0.98);
}

.master-home-do-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(14, 165, 233, 0.12));
  color: #4f46e5;
  font-size: 18px;
  flex-shrink: 0;
}

.master-home-do-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.master-home-do-title {
  font-size: 14px;
  font-weight: 800;
}

.master-home-do-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.master-home-do-arrow {
  opacity: 0.35;
  font-size: 12px;
}

.master-kpi-grid--home {
  margin-bottom: 0;
}

/* KPI главной: компактная premium-группа (без клика; значения — те же id для JS) */
.master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 12px 14px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  cursor: default;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 48%, #f4f6f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 10px 32px rgba(15, 23, 42, 0.06),
    0 1px 4px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

@media (max-width: 767.98px) {
  .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 10px 12px;
    margin-bottom: 12px;
  }
}

.master-home-kpi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 12px 8px 11px;
  text-align: center;
  border-radius: 17px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.98);
}

.master-home-kpi-card__ico {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 17px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.14);
  box-sizing: border-box;
}

.master-home-kpi-card__ico i {
  font-size: 1em;
  color: inherit;
}

.master-home-kpi-card--new .master-home-kpi-card__ico {
  background: linear-gradient(145deg, #a5b4fc 0%, #6366f1 45%, #4338ca 100%);
}

.master-home-kpi-card--wait .master-home-kpi-card__ico {
  background: linear-gradient(145deg, #fde68a 0%, #f59e0b 50%, #ea580c 100%);
}

.master-home-kpi-card--work .master-home-kpi-card__ico {
  background: linear-gradient(145deg, #93c5fd 0%, #3b82f6 50%, #1d4ed8 100%);
}

.master-home-kpi-card--done .master-home-kpi-card__ico {
  background: linear-gradient(145deg, #86efac 0%, #22c55e 50%, #15803d 100%);
}

.master-home-kpi-card__num {
  font-size: clamp(1.42rem, 2.8vw + 0.55rem, 1.72rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  max-width: 100%;
}

.master-home-kpi-card__lbl {
  margin-top: auto;
  padding-top: 1px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #64748b;
  letter-spacing: -0.01em;
  text-transform: none;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-kpi-card--elevated {
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

/* Перекрыть общий elevated для главной KPI (после .master-kpi-card--elevated) */
.master-home-kpi-card.master-kpi-card--elevated {
  border-radius: 17px;
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.055),
    0 1px 2px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  border-color: rgba(226, 232, 240, 0.98);
}

.master-home-revenue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  align-items: stretch;
}

.master-home-rev-card {
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.master-home-rev-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.master-home-rev-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.master-home-rev-more {
  grid-column: 1 / -1;
  border-radius: 14px;
  font-weight: 700;
  margin-top: 2px;
}

.master-home-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  min-width: 0;
  box-sizing: border-box;
}

.master-home-quick-grid--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.master-home-qbtn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--bg));
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.master-home-qbtn i {
  font-size: 18px;
  color: #6366f1;
}

.master-home-qbtn--qa .master-home-qbtn__icon-wrap i {
  font-size: 1em;
  color: inherit;
}

.master-home-qbtn:not(.master-home-qbtn--qa) span:last-child {
  font-size: 13px;
  font-weight: 700;
}

.master-home-qbtn:active {
  transform: scale(0.98);
}

.master-home-qbtn--secondary {
  padding: 11px 10px;
  min-height: 68px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  background: var(--bg);
  border-color: rgba(148, 163, 184, 0.35);
}

.master-home-qbtn--secondary i {
  font-size: 16px;
  color: #64748b;
}

.master-home-qbtn--secondary span:last-child {
  font-size: 12px;
  font-weight: 700;
}

/* Premium quick-action cards (mock-aligned) */
.master-home-qbtn--qa {
  position: relative;
  min-height: 124px;
  padding: 0;
  gap: 0;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.98);
  background: linear-gradient(165deg, #ffffff 0%, #fafbfc 40%, #f1f5f9 100%);
  box-shadow:
    0 8px 26px rgba(15, 23, 42, 0.07),
    0 1px 4px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 28px rgba(255, 255, 255, 0.45);
  align-items: stretch;
  overflow: hidden;
}

.master-home-qbtn--qa:hover {
  border-color: rgba(203, 213, 225, 0.95);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.1),
    0 1px 4px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 32px rgba(255, 255, 255, 0.55);
}

.master-home-qbtn--qa:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
}

.master-home-qbtn__dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.master-home-qbtn--feed .master-home-qbtn__dot {
  background: #6366f1;
}

.master-home-qbtn--orders .master-home-qbtn__dot {
  background: #3b82f6;
}

.master-home-qbtn--chats .master-home-qbtn__dot {
  background: #a855f7;
}

.master-home-qbtn--finance .master-home-qbtn__dot {
  background: #14b8a6;
}

.master-home-qbtn--profile .master-home-qbtn__dot {
  background: #8b5cf6;
}

.master-home-qbtn--notifications .master-home-qbtn__dot {
  background: #fb923c;
}

.master-home-qbtn__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px 12px 14px;
  box-sizing: border-box;
}

.master-home-qbtn__icon-wrap {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 22px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-sizing: border-box;
  filter: drop-shadow(0 4px 14px rgba(15, 23, 42, 0.18));
}

.master-home-qbtn--feed .master-home-qbtn__icon-wrap {
  background: linear-gradient(150deg, #818cf8 0%, #6366f1 45%, #4f46e5 100%);
  box-shadow:
    0 6px 18px rgba(79, 70, 229, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.master-home-qbtn--orders .master-home-qbtn__icon-wrap {
  background: linear-gradient(150deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  box-shadow:
    0 6px 18px rgba(37, 99, 235, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.master-home-qbtn--chats .master-home-qbtn__icon-wrap {
  background: linear-gradient(150deg, #c084fc 0%, #a855f7 45%, #7c3aed 100%);
  box-shadow:
    0 6px 18px rgba(124, 58, 237, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.master-home-qbtn--finance .master-home-qbtn__icon-wrap {
  background: linear-gradient(150deg, #2dd4bf 0%, #14b8a6 50%, #0d9488 100%);
  box-shadow:
    0 6px 18px rgba(13, 148, 136, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.master-home-qbtn--profile .master-home-qbtn__icon-wrap {
  background: linear-gradient(150deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
  box-shadow:
    0 6px 18px rgba(109, 40, 217, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.master-home-qbtn--notifications .master-home-qbtn__icon-wrap {
  background: linear-gradient(150deg, #fdba74 0%, #fb923c 50%, #ea580c 100%);
  box-shadow:
    0 6px 18px rgba(234, 88, 12, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.master-home-qbtn__title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.22;
  color: var(--text, #0f172a);
  letter-spacing: -0.02em;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
  overflow-wrap: normal;
  word-break: normal;
}

.master-home-qbtn__sub {
  margin-top: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #64748b;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-home-qbtn__sub--muted {
  color: #94a3b8;
  font-weight: 600;
}

.master-home-qbtn__sub--hot {
  color: #5b21b6;
}

.master-home-qbtn--feed .master-home-qbtn__sub--hot {
  color: #5b21b6;
}

.master-home-qbtn--orders .master-home-qbtn__sub--hot {
  color: #1d4ed8;
}

.master-home-qbtn--chats .master-home-qbtn__sub--hot {
  color: #6d28d9;
}

.master-home-qbtn--finance .master-home-qbtn__sub--hot {
  color: #0f766e;
}

.master-home-qbtn--profile .master-home-qbtn__sub--hot {
  color: #6d28d9;
}

.master-home-qbtn--notifications .master-home-qbtn__sub--hot {
  color: #c2410c;
}

.master-home-classic-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.master-home-classic-link:hover {
  color: #6366f1;
}

.master-home-two-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .master-home-two-col {
    flex-direction: row;
  }

  .master-home-two-col > .master-home-section {
    flex: 1;
    min-width: 0;
  }
}

.master-home-preview-list {
  min-height: 40px;
}

.master-home-order-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.master-home-order-card:last-child {
  margin-bottom: 0;
}

.master-home-order-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.master-home-order-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.master-home-order-tech {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.master-home-mini-price {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

.master-home-order-city {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.master-home-order-prob {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.master-home-order-status {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #6366f1;
}

.master-home-analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.master-home-analytics-cell {
  padding: 12px 8px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  text-align: center;
}

.master-home-analytics-val {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.master-home-analytics-lbl {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.master-home-muted {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.master-home-checklist-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.master-home-check-li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.master-home-check-li:last-child {
  border-bottom: none;
}

.master-home-check-li--ok {
  color: #15803d;
}

.master-home-check-ico {
  width: 22px;
  display: flex;
  justify-content: center;
  font-size: 12px;
}

/* ─── Главная v2: мобильная вёрстка (≤767px, проверка 360 / 390 / 430) ─── */
@media (max-width: 767.98px) {
  .master-suite-v2 #panel-home,
  .master-suite-v2 #panel-home * {
    box-sizing: border-box;
  }

  .master-suite-v2 #panel-home.master-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .master-suite-v2 #panel-home .master-home-app {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 12px;
    /* Fallback для Android WebView без поддержки env()/max() */
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 84px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(28px, calc(84px + env(safe-area-inset-bottom)));
  }

  .master-suite-v2 #panel-home .master-home-app > * {
    margin-bottom: 0 !important;
    max-width: 100%;
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-home-hero,
  .master-suite-v2 #panel-home .master-home-hero-glass {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .master-suite-v2 #panel-home .master-home-hero-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-home-avatar-wrap {
    align-self: flex-start;
  }

  .master-suite-v2 #panel-home .master-home-cta-profile {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .master-suite-v2 #panel-home .master-home-progress-block,
  .master-suite-v2 #panel-home .master-home-pills {
    width: 100%;
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-home-hero-stats {
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    gap: 10px 12px;
  }

  .master-suite-v2 #panel-home .master-home-hero-stat {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap--premium {
    display: grid;
    grid-auto-rows: 1fr;
    align-items: stretch;
    width: 100%;
    margin-bottom: 0 !important;
  }

  .master-suite-v2 #panel-home .master-kpi-card.master-kpi-card--elevated.master-home-kpi-card {
    padding: 11px 7px 10px;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
  }

  .master-suite-v2 #panel-home .master-home-quick-wrap--premium {
    padding: 16px 12px 18px;
    border-radius: 20px;
  }

  .master-suite-v2 #panel-home .master-home-quick-head {
    margin-bottom: 14px;
    gap: 10px;
  }

  .master-suite-v2 #panel-home .master-home-quick-head__title {
    font-size: 15px;
  }

  .master-suite-v2 #panel-home .master-home-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 13px;
    width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-quick-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .master-suite-v2 #panel-home .master-home-qbtn {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    min-height: 76px;
    align-self: stretch;
  }

  .master-suite-v2 #panel-home .master-home-qbtn--qa {
    min-height: 112px;
    padding: 0;
  }

  .master-suite-v2 #panel-home .master-home-qbtn__body {
    padding: 16px 10px 12px;
    gap: 8px;
  }

  .master-suite-v2 #panel-home .master-home-qbtn__dot {
    top: 10px;
    right: 10px;
  }

  .master-suite-v2 #panel-home .master-home-qbtn__icon-wrap {
    width: 48px;
    height: 48px;
    font-size: 19px;
    border-radius: 14px;
  }

  .master-suite-v2 #panel-home .master-home-qbtn__title {
    font-size: 13px;
  }

  .master-suite-v2 #panel-home .master-home-qbtn__sub {
    font-size: 10.5px;
  }

  .master-suite-v2 #panel-home .master-home-revenue-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    gap: 10px;
  }

  .master-suite-v2 #panel-home .master-home-rev-card {
    min-width: 0;
    max-width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-rev-val {
    font-size: 14px;
    max-width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-revenue-zero-msg {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .master-suite-v2 #panel-home .master-home-two-col {
    flex-direction: column !important;
    width: 100%;
    gap: 12px;
    margin-bottom: 0 !important;
  }

  .master-suite-v2 #panel-home .master-home-two-col > .master-home-section {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .master-suite-v2 #panel-home .master-home-order-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .master-suite-v2 #panel-home .master-home-order-top {
    min-width: 0;
    align-items: flex-start;
  }

  .master-suite-v2 #panel-home .master-home-order-tech {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 62%;
  }

  .master-suite-v2 #panel-home .master-home-mini-price {
    flex: 0 1 auto;
    max-width: 38%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    margin-left: auto;
    padding-left: 6px;
    text-align: right;
  }

  .master-suite-v2 #panel-home .master-home-analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .master-suite-v2 #panel-home .master-home-analytics-cell {
    min-width: 0;
    padding: 10px 4px;
  }

  .master-suite-v2 #panel-home .master-home-section--card {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .master-suite-v2 #panel-home .master-home-error-card {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-error-card__retry {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .master-suite-v2 #panel-home .master-home-hints button.master-home-hint {
    max-width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-do-card {
    max-width: 100%;
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-home-do-text {
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-home-greeting,
  .master-suite-v2 #panel-home .master-home-name,
  .master-suite-v2 #panel-home .master-home-pill,
  .master-suite-v2 #panel-home .master-home-rev-val,
  .master-suite-v2 #panel-home .master-home-order-tech,
  .master-suite-v2 #panel-home .master-home-order-prob,
  .master-suite-v2 #panel-home .master-home-do-title,
  .master-suite-v2 #panel-home .master-home-do-desc,
  .master-suite-v2 #panel-home .master-home-qbtn__title,
  .master-suite-v2 #panel-home .master-home-qbtn__sub,
  .master-suite-v2 #panel-home .master-home-qbtn:not(.master-home-qbtn--qa) span:last-child,
  .master-suite-v2 #panel-home .master-home-hint,
  .master-suite-v2 #panel-home .master-home-section-title,
  .master-suite-v2 #panel-home .master-home-analytics-val,
  .master-suite-v2 #panel-home .master-home-analytics-lbl,
  .master-suite-v2 #panel-home .master-home-check-li,
  .master-suite-v2 #panel-home .master-status-list,
  .master-suite-v2 #panel-home .master-home-error-card__title,
  .master-suite-v2 #panel-home .master-home-error-card__hint,
  .master-suite-v2 #panel-home .master-home-attention__desc {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .master-suite-v2 .master-bottom-nav__btn {
    max-width: none;
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 1px;
  }

  .master-suite-v2 .master-bottom-nav__badge {
    top: -1px;
    right: 0;
    min-width: 14px;
    max-width: 22px;
    height: 15px;
    padding: 0 3px;
    font-size: 8px;
    line-height: 15px;
  }

  .master-suite-v2 .master-bottom-nav__ico-wrap {
    max-width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-hero-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__inner {
    padding: 12px 12px 10px;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__name {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
    font-size: clamp(1.18rem, 3.8vw + 0.65rem, 1.4rem);
    line-height: 1.14;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__chip {
    max-width: min(48%, 168px);
  }

  .master-suite-v2 #panel-home .master-home-hero-card__toolbar {
    margin-top: 10px;
    padding-top: 8px;
  }

  .master-suite-v2 #panel-home .master-home-hints {
    max-width: 100%;
    overflow-x: hidden;
  }

  .master-suite-v2 #panel-home .master-home-revenue,
  .master-suite-v2 #panel-home #master-month-revenue-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* ─── Hero premium: компактный Android / узкие телефоны (≤480px) ─── */
@media (max-width: 480.98px) {
  .master-suite-v2 #panel-home .master-home-hero-card--premium {
    border-radius: 23px;
    margin-bottom: 10px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .master-suite-v2 #panel-home .master-home-hero-card--premium .master-home-hero-card__inner {
    padding: 14px 14px 12px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__grid {
    gap: 10px 12px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__topbar {
    margin-bottom: 8px;
    gap: 8px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__menu-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
    border-radius: 11px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__eyebrow {
    font-size: 9px;
    padding: 2px 8px;
    letter-spacing: 0.05em;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__identity {
    gap: 10px;
    align-items: flex-start;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__avatar {
    width: 56px;
    height: 56px;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__initials {
    font-size: 1rem;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__col {
    gap: 6px;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__name {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: clamp(1.125rem, 2.4vw + 0.52rem, 1.375rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
    max-width: 100%;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__col .master-home-hero-online {
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
  }

  .master-suite-v2 #panel-home .master-home-hero-online__label {
    font-size: 10.5px;
    line-height: 1.25;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__date-chip {
    font-size: 10px;
    padding: 3px 9px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__side {
    gap: 8px;
  }

  .master-suite-v2 #panel-home .master-home-mode-switch--premium .master-home-mode-btn {
    min-height: 42px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card__notif-online-row {
    gap: 8px;
  }

  .master-suite-v2 #panel-home .master-home-hero-notif {
    padding: 6px 10px;
  }

  .master-suite-v2 #panel-home .master-home-hero-notif__icon-wrap {
    width: 32px;
    height: 32px;
  }

  .master-suite-v2 #panel-home .master-home-hero-notif__icon {
    font-size: 14px;
  }

  .master-suite-v2 #panel-home .master-home-hero-notif__label {
    font-size: 10.5px;
  }

  .master-suite-v2 #panel-home .master-home-hero-profile-btn {
    min-height: 46px;
    max-height: 48px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 14px;
  }
}

/* KPI главной: 2×2 только при viewport ≤431px (после правил #panel-home ≤768, чтобы не перебивались) */
@media (max-width: 430.98px) {
  .master-suite-v2 #panel-home .master-home-hero-card--premium .master-home-hero-card__inner {
    padding: 12px 12px 10px;
  }

  .master-suite-v2 #panel-home .master-home-hero-card--premium {
    border-radius: 22px;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__avatar {
    width: 54px;
    height: 54px;
  }

  .master-suite-v2 #panel-home .master-home-hero-identity__name {
    font-size: clamp(1.05rem, 2.2vw + 0.48rem, 1.28rem);
  }

  .master-suite-v2 #panel-home .master-home-mode-switch--premium .master-home-mode-btn {
    min-height: 42px;
    font-size: 12px;
  }

  .master-suite-v2 #panel-home .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap--premium,
  .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium {
    gap: 9px;
    padding: 10px 8px 10px;
  }

  .master-suite-v2 #panel-home .master-home-kpi-card,
  .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium .master-home-kpi-card {
    padding: 10px 6px 9px;
    gap: 6px;
  }

  .master-suite-v2 #panel-home .master-home-kpi-card__ico,
  .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium .master-home-kpi-card__ico {
    width: 36px;
    height: 36px;
    font-size: 15px;
    border-radius: 11px;
  }

  .master-suite-v2 #panel-home .master-home-kpi-card__num,
  .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium .master-home-kpi-card__num {
    font-size: 1.3rem;
  }

  .master-suite-v2 #panel-home .master-home-kpi-card__lbl,
  .master-kpi-grid.master-kpi-grid--home.master-home-kpi-wrap.master-home-kpi-wrap--premium .master-home-kpi-card__lbl {
    font-size: 10px;
  }
}

/* Скелетон / загрузка главной — стабильная высота блоков */
#panel-home.master-home-panel--loading .master-home-hint-skel,
#panel-home.master-home-panel--loading .master-home-do-skel,
#panel-home.master-home-panel--loading .master-home-preview-skel {
  display: block;
}

#panel-home.master-home-panel--loading .master-home-hint-skel,
#panel-home.master-home-panel--loading .master-home-do-skel {
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12) 25%, rgba(148, 163, 184, 0.22) 37%, rgba(148, 163, 184, 0.12) 63%);
  background-size: 400% 100%;
  animation: masterHomeShimmer 1.1s ease-in-out infinite;
}

#panel-home.master-home-panel--loading .master-home-hint-skel {
  height: 52px;
  margin-bottom: 8px;
}

#panel-home.master-home-panel--loading .master-home-do-skel {
  height: 72px;
  margin-bottom: 8px;
}

#panel-home.master-home-panel--loading .master-home-preview-skel {
  height: 64px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 25%, rgba(148, 163, 184, 0.18) 37%, rgba(148, 163, 184, 0.1) 63%);
  background-size: 400% 100%;
  animation: masterHomeShimmer 1.1s ease-in-out infinite;
}

#panel-home:not(.master-home-panel--loading) .master-home-hint-skel,
#panel-home:not(.master-home-panel--loading) .master-home-do-skel,
#panel-home:not(.master-home-panel--loading) .master-home-preview-skel {
  display: none !important;
}

@keyframes masterHomeShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ─── Главная v2: UX (клики, доходы, ошибка, нижние бейджи, появление) ─── */
.master-home-hints button.master-home-hint {
  width: 100%;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.master-home-hints button.master-home-hint:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.master-home-hint--feed-pulse {
  animation: masterHomeHintPulse 2.1s ease-in-out infinite;
}

@keyframes masterHomeHintPulse {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 0 0 0 rgba(99, 102, 241, 0.35);
  }
  50% {
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.18), 0 0 0 8px rgba(99, 102, 241, 0);
  }
}

.master-home-click-card {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.master-home-click-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.master-home-click-card:active {
  transform: scale(0.992);
}

.master-home-hero-glass.master-home-click-card:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.master-home-revenue-zero-msg {
  grid-column: 1 / -1;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border: 1px dashed rgba(148, 163, 184, 0.45);
}

.master-home-revenue-grid--positive .master-home-rev-val {
  color: #15803d;
}

.master-home-revenue-grid--zero .master-home-rev-val {
  color: var(--muted);
}

.master-home-error-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-bottom: 16px;
  padding: 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.65), #fff);
  color: #991b1b;
  box-shadow: 0 6px 22px rgba(185, 28, 28, 0.08);
}

.master-home-error-card__icon {
  font-size: 22px;
  flex-shrink: 0;
}

.master-home-error-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.master-home-error-card__title {
  font-size: 14px;
  font-weight: 800;
}

.master-home-error-card__hint {
  font-size: 12px;
  font-weight: 600;
  color: #b91c1c;
  opacity: 0.92;
}

.master-home-error-card__retry {
  flex-shrink: 0;
  margin-left: auto;
}

.master-home-error-card[hidden] {
  display: none !important;
}

.master-bottom-nav__ico-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 48px;
  margin: 0 auto;
  overflow: visible;
}

.master-bottom-nav__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 14px;
  max-width: 22px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.45);
  pointer-events: none;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  box-sizing: border-box;
}

.master-bottom-nav__badge[hidden] {
  display: none !important;
}

#panel-home .master-home-app--enter {
  animation: masterHomeAppEnter 0.42s ease-out forwards;
}

@keyframes masterHomeAppEnter {
  from {
    opacity: 0.72;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Режим главной (legacy совместимость) ───────────────────── */
.master-home-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.master-home-mode-switch {
  display: inline-flex;
  border-radius: 12px;
  padding: 3px;
  background: rgba(148, 163, 184, 0.2);
  gap: 2px;
}

.master-home-mode-btn {
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.master-home-mode-btn--active {
  background: #fff;
  color: #312e81;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
}

/* Ранее на главной был переключатель режимов; теперь показываем блоки без привязки к office/shift. */

.master-home-shift-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px 16px;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.06);
}

.master-home-cta-feed-shift {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 14px;
}

.master-shift-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.master-shift-metric {
  padding: 12px 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border, #e8ecf4);
  text-align: center;
}

.master-shift-metric--accent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), #fff);
  border-color: rgba(16, 185, 129, 0.25);
}

.master-shift-metric__val {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: var(--text, #0f172a);
  line-height: 1.1;
}

.master-shift-metric__lbl {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
}

.master-home-shift-chats {
  width: 100%;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.master-shift-chat-badge {
  position: absolute;
  top: 6px;
  right: 14px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.master-shift-chat-badge[hidden] {
  display: none !important;
}

.master-home-details-aux {
  margin-top: 8px;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  overflow: hidden;
}

.master-home-details-aux__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 13px;
  color: var(--text, #1e293b);
  display: flex;
  align-items: center;
  gap: 10px;
}

.master-home-details-aux__summary::-webkit-details-marker {
  display: none;
}

.master-home-details-aux__summary i {
  transition: transform 0.2s ease;
  color: var(--muted, #64748b);
}

.master-home-details-aux[open] .master-home-details-aux__summary i {
  transform: rotate(-180deg);
}

.master-home-details-aux__body {
  padding: 0 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.master-home-mode--office .master-home-hero--office .master-home-progress-block,
.master-home-mode--office .master-home-hero--office .master-home-reviews-hint {
  display: none;
}

.master-home-mode--office .master-home-hero--office .master-home-hero-stats {
  margin-top: 4px;
}

/* Статистика MVP */
.master-statistics-mvp {
  padding: 8px 0 20px;
}

/* Статистика v3 (premium) — scoped */
#panel-statistics .master-stats-v3 {
  margin-top: 2px;
}

#panel-statistics .ms-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0 10px;
}

#panel-statistics .ms-head__left {
  min-width: 220px;
  flex: 1;
}

#panel-statistics .ms-head__title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text, #0f172a);
}

#panel-statistics .ms-head__sub {
  margin: 6px 0 0;
  color: var(--muted, #64748b);
  font-size: 12.5px;
  line-height: 1.45;
}

#panel-statistics .ms-head__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#panel-statistics .ms-btn {
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.06);
  color: #4338ca;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#panel-statistics .ms-btn:hover {
  background: rgba(99, 102, 241, 0.09);
}

#panel-statistics .ms-btn:active {
  transform: translateY(1px);
}

#panel-statistics .ms-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

#panel-statistics .ms-pill {
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

#panel-statistics .ms-pill.is-active {
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.20);
}

#panel-statistics .ms-note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(16, 185, 129, 0.04));
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.35;
}

#panel-statistics .ms-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin: 8px 0 12px;
}

#panel-statistics .ms-kpi {
  border-radius: 18px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.06);
  padding: 14px 14px 12px;
  display: flex;
  gap: 12px;
  min-width: 0;
}

#panel-statistics .ms-kpi__ico {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.24);
}

#panel-statistics .ms-kpi--emerald .ms-kpi__ico {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.18);
}

#panel-statistics .ms-kpi--amber .ms-kpi__ico {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.18);
}

#panel-statistics .ms-kpi--slate .ms-kpi__ico {
  background: linear-gradient(135deg, #334155, #64748b);
  box-shadow: 0 12px 28px rgba(51, 65, 85, 0.14);
}

#panel-statistics .ms-kpi__lbl {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #64748b);
}

#panel-statistics .ms-kpi__val {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 950;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

#panel-statistics .ms-kpi__sub {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

#panel-statistics .ms-kpi__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text, #1e293b);
}

#panel-statistics .ms-kpi__row span {
  color: var(--muted, #64748b);
}

#panel-statistics .ms-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 8px 0 12px;
}

#panel-statistics .ms-tabs::-webkit-scrollbar {
  display: none;
}

#panel-statistics .ms-tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 12px;
  color: var(--muted, #64748b);
  cursor: pointer;
  white-space: nowrap;
}

#panel-statistics .ms-tab.is-active {
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.20);
}

#panel-statistics .ms-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

#panel-statistics .ms-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

#panel-statistics .ms-grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

#panel-statistics .ms-card {
  border-radius: 18px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.06);
  padding: 14px;
  min-width: 0;
}

#panel-statistics .ms-card__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

#panel-statistics .ms-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

#panel-statistics .ms-card__meta {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#panel-statistics .ms-big {
  font-weight: 950;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text, #0f172a);
}

#panel-statistics .ms-delta {
  margin-top: 4px;
  font-size: 12px;
  color: #059669;
  font-weight: 900;
}

#panel-statistics .ms-muted {
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.4;
}

#panel-statistics .ms-mini {
  margin-top: 10px;
  height: 74px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.10), rgba(99, 102, 241, 0.00));
  border: 1px dashed rgba(99, 102, 241, 0.28);
  position: relative;
  overflow: hidden;
}

#panel-statistics .ms-mini::before {
  content: "";
  position: absolute;
  left: -20%;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: msShimmer 2.2s infinite;
}

@keyframes msShimmer {
  0% { transform: translateX(-30%); opacity: 0.0; }
  15% { opacity: 1; }
  50% { transform: translateX(240%); opacity: 0.8; }
  100% { transform: translateX(240%); opacity: 0.0; }
}

#panel-statistics .ms-progress {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#panel-statistics .ms-prow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text, #1e293b);
}

#panel-statistics .ms-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.20);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.20);
}

#panel-statistics .ms-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  width: 0%;
}

#panel-statistics .ms-fill.ms-fill--emerald {
  background: linear-gradient(90deg, #10b981, #34d399);
}

#panel-statistics .ms-fill.ms-fill--amber {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

#panel-statistics .ms-ring {
  display: flex;
  align-items: center;
  gap: 12px;
}

#panel-statistics .ms-ring__svg {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
}

#panel-statistics .ms-ring__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#panel-statistics .ms-ring__pct {
  font-size: 20px;
  font-weight: 950;
  color: #4338ca;
}

#panel-statistics .ms-ring__sub {
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

#panel-statistics .ms-empty {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.7);
  color: var(--muted, #64748b);
}

#panel-statistics .ms-empty__ico {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
  flex-shrink: 0;
}

#panel-statistics .ms-empty__title {
  font-weight: 950;
  color: var(--text, #0f172a);
  font-size: 12.5px;
}

#panel-statistics .ms-empty__sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

#panel-statistics .ms-skel {
  padding: 18px 0 8px;
}

#panel-statistics .ms-skel__bar {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148,163,184,0.22), rgba(148,163,184,0.12), rgba(148,163,184,0.22));
  background-size: 240% 100%;
  animation: msSkel 1.6s infinite;
}

@keyframes msSkel {
  0% { background-position: 0% 0%; }
  100% { background-position: 240% 0%; }
}

@media (max-width: 980px) {
  #panel-statistics .ms-kpis {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  #panel-statistics .ms-grid-3 {
    grid-template-columns: 1fr;
  }
  #panel-statistics .ms-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  #panel-statistics .ms-head__right {
    width: 100%;
    justify-content: space-between;
  }
  #panel-statistics .ms-btn {
    flex: 1;
    justify-content: center;
  }
  #panel-statistics .ms-pills {
    width: 100%;
    justify-content: space-between;
  }
  #panel-statistics .ms-pill {
    padding: 7px 8px;
    flex: 1;
    text-align: center;
  }
}

.master-statistics-mvp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.master-statistics-mvp-card {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.master-statistics-mvp-card.mvp-wide {
  grid-column: 1 / -1;
}

.master-statistics-mvp-card .mvp-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
  margin-bottom: 6px;
}

.master-statistics-mvp-card .mvp-val {
  font-size: 18px;
  font-weight: 900;
  color: var(--text, #0f172a);
}

.master-statistics-mvp-foot {
  margin: 16px 4px 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.master-statistics-mvp-skel {
  text-align: center;
  padding: 32px;
  color: var(--muted, #94a3b8);
}

@media (max-width: 520px) {
  .master-shift-metrics {
    grid-template-columns: 1fr;
  }
}

/* Умная подсказка «Смена» */
.master-shift-smart-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.09), rgba(245, 158, 11, 0.06));
}

.master-shift-smart-tip[hidden] {
  display: none !important;
}

.master-shift-smart-tip__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.master-shift-smart-tip__text {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text, #1e293b);
}

.master-shift-smart-tip__text strong {
  font-size: 13px;
  font-weight: 800;
}

.master-shift-smart-tip__go {
  flex-shrink: 0;
  padding: 8px 14px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
}

.master-shift-smart-tip__dismiss {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted, #64748b);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.master-shift-smart-tip__dismiss:hover {
  background: #fff;
  color: #0f172a;
}

.master-shift-smart-tip--compact {
  margin-bottom: 12px;
  padding: 10px 12px;
  gap: 8px 10px;
}

.master-shift-smart-tip--compact .master-shift-smart-tip__icon {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.master-shift-smart-tip--compact .master-shift-smart-tip__text {
  min-width: 0;
  font-size: 11.5px;
}

.master-shift-smart-tip--compact .master-shift-smart-tip__text strong {
  font-size: 12px;
}

/* Hero: рабочий статус и доход */
.master-home-hero-workline {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.master-home-workline-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.master-home-workline-rev {
  font-weight: 800;
  color: #15803d;
  font-size: 13px;
}

.master-home-hero-glass--busy .master-home-cta-profile {
  background: #fff !important;
  color: #4338ca !important;
  border: 1.5px solid rgba(99, 102, 241, 0.35) !important;
  box-shadow: none !important;
}

.master-home-hero-glass--busy .master-home-cta-profile:hover {
  background: rgba(99, 102, 241, 0.06) !important;
}

/* Статистика MVP — компактные блоки */
.master-statistics-mvp-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.mvp-block {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--border, #e8ecf4);
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.mvp-block-title {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted, #64748b);
}

.mvp-block-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text, #1e293b);
}

.mvp-block-row strong {
  font-weight: 800;
  text-align: right;
}

.mvp-block-note {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.mvp-block-big {
  font-size: 26px;
  font-weight: 900;
  color: #312e81;
  line-height: 1.1;
}

.mvp-block-pct {
  font-size: 15px;
  font-weight: 800;
  margin-left: 2px;
  color: #6366f1;
}

/* ==========================================================
   Mobile stabilization for Android/WebView (master-dashboard-v2)
   Цели:
   - убрать горизонтальный скролл из-за “шире viewport”
   - заставить grid/flex children ужиматься (min-width:0)
   - обеспечить перенос длинных значений/слов
   - не ломать desktop (правки только в mobile media)
   ========================================================== */

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
  }

  body.master-suite-v2.profi-mobile-ready.app-shell {
    max-width: 100%;
  }

  body.master-suite-v2.profi-mobile-ready .app-main,
  body.master-suite-v2.profi-mobile-ready #masterPanels,
  body.master-suite-v2.profi-mobile-ready #masterPanels > .master-panel {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Любой “карточный” контейнер не должен раздувать страницу */
  body.master-suite-v2.profi-mobile-ready .section-card,
  body.master-suite-v2.profi-mobile-ready .master-feed-toolbar,
  body.master-suite-v2.profi-mobile-ready .master-feed-error,
  body.master-suite-v2.profi-mobile-ready .master-feed-loading {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* ВАЖНО: не включаем overflow-wrap:anywhere глобально — это “ломает” визуальную иерархию на mobile.
     Переносы включаем точечно на длинных значениях/лейблах/табличных ячейках. */
  body.master-suite-v2.profi-mobile-ready :where(.mf-td, .ms-muted, .mw-info, .mw-balance__value, .ms-big, .mf-kpi__val, .ms-kpi__val, .mw-kpi__val) {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.master-suite-v2.profi-mobile-ready :where(.mf-head__title, .ms-head__title, .mw-head__title, .master-crm-pagetitle) {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Верхняя админская/CRM шапка (режим просмотра) — делаем компактной на mobile */
  body.master-suite-v2.profi-mobile-ready .admin-crm-header {
    padding: 8px 10px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  body.master-suite-v2.profi-mobile-ready .admin-crm-left {
    flex: 1 1 220px;
    min-width: 0;
    gap: 10px;
    align-items: flex-start;
  }

  body.master-suite-v2.profi-mobile-ready .admin-crm-right {
    flex: 1 1 220px;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.master-suite-v2.profi-mobile-ready .admin-crm-user {
    padding: 6px 10px;
    height: auto;
    min-height: 34px;
    max-width: 100%;
    min-width: 0;
  }

  body.master-suite-v2.profi-mobile-ready .master-crm-pagetitle {
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
  }

  body.master-suite-v2.profi-mobile-ready .master-crm-pagesub {
    font-size: 12px;
    line-height: 1.35;
    margin: 4px 0 0;
  }

  /* Внутренние page headers новых разделов: в 1 колонку */
  #panel-finance .mf-head,
  #panel-statistics .ms-head,
  #panel-wallet .mw-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #panel-finance .mf-head__right,
  #panel-statistics .ms-head__right,
  #panel-wallet .mw-head__right {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  /* Панели: не позволяем контенту быть шире viewport */
  #panel-home,
  #panel-finance,
  #panel-statistics,
  #panel-wallet {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Общие новые блоки: ужиматься внутри grid/flex */
  #panel-finance :where(.mf-page, .mf-layout, .mf-main, .mf-side, .mf-sec, .mf-table, .mf-tr, .mf-tbody, .mf-th, .mf-td),
  #panel-statistics :where(.master-stats-v3, .ms-kpis, .ms-tabs, .ms-layout, .ms-grid-3, .ms-grid-2, .ms-card),
  #panel-wallet :where(.master-wallet-v3, .mw-balance, .mw-kpis, .mw-grid, .mw-card, .mw-tx, .mw-tx-table, .mw-tx-tr),
  #panel-home :where(.master-home-app, .master-home-hero-card, .master-home-hero-card__grid, .master-home-hero-card__side, .master-home-quick-grid, .master-kpi-grid) {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Хедеры с контролами: wrap, без налезания */

  #panel-finance .mf-range {
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  #panel-finance .mf-range__inp {
    min-width: 0;
    max-width: 100%;
  }

  /* Таб‑панели: комфортный горизонтальный скролл, без сжатия в кашу */
  #panel-finance .mf-tabs,
  #panel-statistics .ms-tabs {
    max-width: 100%;
    min-width: 0;
  }

  /* KPI: если 2 колонки на 360/375 давят — уходим в 1 колонку ниже */
}

@media (max-width: 430px) {
  #panel-finance .mf-kpis,
  #panel-statistics .ms-kpis,
  #panel-wallet .mw-kpis {
    grid-template-columns: 1fr !important;
  }

  #panel-wallet .mw-balance {
    padding: 14px;
  }

  #panel-statistics .ms-head__right,
  #panel-wallet .mw-head__right {
    gap: 8px;
  }

  /* Ослабляем тяжёлые blur/backdrop на Android WebView */
  .master-bottom-nav,
  .master-home-hero-notif {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Админская шапка: ещё компактнее на узких экранах */
  body.master-suite-v2.profi-mobile-ready .admin-crm-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  body.master-suite-v2.profi-mobile-ready .admin-crm-header {
    padding: 8px 10px;
  }
}

/* ── ЭТАП 3: формы в кабинете мастера — поля не шире карточки на mobile ── */
@media (max-width: 768px) {
  body.master-suite-v2 #masterPanels input:not([type="checkbox"]):not([type="radio"]),
  body.master-suite-v2 #masterPanels textarea,
  body.master-suite-v2 #masterPanels select {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* ═══ Master v2 — premium sidebar (только #appSidebar.mst-sidebar-premium, не агрегатор / админ) ═══ */

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium button.mst-sb-nav-card {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  width: 100%;
  text-align: left;
  margin: 0;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 12px 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(129, 140, 248, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 22px rgba(79, 70, 229, 0.18);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-card:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.75);
  outline-offset: 2px;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5, #6366f1, #7c3aed);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4), 0 4px 14px rgba(79, 70, 229, 0.35);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-avatar-img[hidden] {
  display: none !important;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-avatar:has(img.mst-sb-user-avatar-img:not([hidden])) .mst-sb-user-avatar-fallback {
  display: none;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-info {
  flex: 1;
  min-width: 0;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-name {
  font: 700 13px/1.25 'Manrope', system-ui, sans-serif;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-user-role {
  margin-top: 2px;
  font: 500 11px/1.35 'Inter', system-ui, sans-serif;
  color: rgba(148, 163, 184, 0.95);
}

/* Подписка / кошелёк — indigo–violet (роль мастера), не emerald агрегатора */
body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.28);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.22);
  transform: translateY(-1px);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.75);
  outline-offset: 2px;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row__ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #6366f1, #7c3aed);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.4);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row__ico i {
  color: #fff;
  font-size: 12px;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row__text {
  flex: 1;
  min-width: 0;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row__eyebrow {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(196, 181, 253, 0.95);
  line-height: 1.3;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row__title {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-sb-sub-row__status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.28);
  border: 1px solid rgba(129, 140, 248, 0.5);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.25);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .sidebar-nav {
  padding-top: 2px;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-group-label {
  margin-top: 14px;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-group-label:first-of-type {
  margin-top: 4px;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-nav-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(49, 46, 129, 0.4);
  color: rgba(199, 210, 254, 0.88);
  transition: background 0.18s ease, color 0.18s ease;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .mst-nav-ico i {
  width: auto;
  font-size: 14px;
  opacity: 0.88;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-menu button.nav-link {
  position: relative;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.88);
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-menu button.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  transform: translateX(2px);
  box-shadow: none;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-menu button.nav-link:hover .mst-nav-ico {
  background: rgba(79, 70, 229, 0.35);
  color: #e0e7ff;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-menu button.nav-link.active {
  background: rgba(79, 70, 229, 0.22);
  color: #eef2ff;
  font-weight: 700;
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2), 0 2px 14px rgba(79, 70, 229, 0.2);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-menu button.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #a78bfa, #6366f1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.55);
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .nav-menu button.nav-link.active .mst-nav-ico {
  background: rgba(99, 102, 241, 0.32);
  color: #eef2ff;
}

body.master-suite-v2.cabinet-role-master #appSidebar.mst-sidebar-premium .sidebar-bottom {
  margin-top: auto;
  padding-top: 8px;
}

.admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .mst-sb-sub-row {
  display: none !important;
}

.admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .mst-sb-user-card {
  justify-content: center;
  margin-left: 8px;
  margin-right: 8px;
  padding: 10px 8px;
}

.admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .mst-sb-user-info {
  display: none !important;
}

.admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .nav-menu button.nav-link span:not(.mst-nav-ico) {
  display: none !important;
}

.admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .nav-menu button.nav-link {
  justify-content: center;
  padding: 10px 6px;
}

@media (max-width: 768px) {
  .admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .mst-sb-sub-row {
    display: flex !important;
  }

  .admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .mst-sb-user-info {
    display: block !important;
  }

  .admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .nav-menu button.nav-link span:not(.mst-nav-ico) {
    display: inline !important;
  }

  .admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .nav-menu button.nav-link {
    justify-content: flex-start;
    padding: 9px 10px;
  }

  .admin-sidebar-collapsed #appSidebar.mst-sidebar-premium .mst-sb-user-card {
    justify-content: flex-start;
    margin-left: 12px;
    margin-right: 12px;
    padding: 11px 13px;
  }
}
