:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface2: #212d3a;
  --border: #2a3847;
  --text: #e8ecf0;
  --muted: #7a8fa3;
  --accent: #2d8cff;
  --accent-dim: #1a5599;
  --green: #27ae60;
  --red: #e74c3c;
  --yellow: #f39c12;
  --radius: 12px;
  --radius-sm: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

body { padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }

/* ─── ШАПКА ─────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  min-width: 0;
}
.header-title--role {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-title--right {
  justify-content: flex-end;
  text-align: right;
}
.role-menu-arrow {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 13px solid #aeb0b3;
  flex: 0 0 auto;
  transition: transform .16s ease;
}
.header-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 2px solid #273947;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 34%, #f3d19a 0 8%, transparent 9%),
    radial-gradient(circle at 62% 36%, #8e522b 0 12%, transparent 13%),
    radial-gradient(circle at 45% 62%, #e28e43 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #351e16 0 48%, #b97034 49% 72%, #1c252f 73%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.header-title.role-menu-open .role-menu-arrow {
  transform: rotate(90deg);
}
.header-title .role-head {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.header-title .role-head b {
  color: #f0f50f;
  font-size: 1rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-title .role-head small {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-rename-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  flex: 0 0 auto;
}
.role-rename-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border: 2px solid #0aa6c0;
  border-radius: 50%;
  color: #0aa6c0;
  font-size: 0.65rem;
  font-weight: 700;
}
.role-menu {
  position: fixed;
  right: 12px;
  top: 54px;
  z-index: 180;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 12px 30px #0008;
}
.role-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  cursor: pointer;
}
.role-menu button:active { background: var(--surface2); }
.btn-admin {
  font-weight: 900;
  color: #f0f50f;
  font-size: 1.05rem;
}
.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-period-chips,
.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.admin-period-chips {
  margin-bottom: -4px;
}
.admin-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-card,
.admin-section,
.admin-user-card {
  background: linear-gradient(180deg, #243245 0%, #101820 100%);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: inset 0 1px 14px rgba(255,255,255,.06);
}
.admin-card b {
  display: block;
  color: #f0f50f;
  font-size: 1.05rem;
  line-height: 1.1;
}
.admin-card span,
.admin-row span,
.admin-user-card span {
  display: block;
  color: var(--text);
  font-size: .82rem;
}
.admin-card small,
.admin-row small,
.admin-user-card small,
.admin-note {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  margin-top: 4px;
}
.admin-section {
  margin-top: 12px;
}
.admin-section h3 {
  font-size: .9rem;
  margin-bottom: 8px;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(15,20,25,.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.admin-row b {
  color: #f0f50f;
  font-size: .92rem;
}
.admin-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-user-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-user-card b {
  color: #f0f50f;
  font-size: .96rem;
}
.onboarding-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 620px;
  margin: 0 auto;
}
.onboarding-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.choice-btn {
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, #27384e 0%, #101820 100%);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 12px 12px 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  box-shadow: inset 0 1px 16px rgba(255,255,255,.07), 0 3px 10px rgba(0,0,0,.25);
}
.choice-btn-copy {
  min-width: 0;
}
.choice-btn-copy span {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.choice-btn-copy small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.78rem;
}
.choice-count {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid #2d70ba;
  background: linear-gradient(180deg, #2b3e57 0%, #101923 100%);
  box-shadow: inset 0 1px 16px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.choice-count b {
  display: block;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.choice-count small {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1;
}
.catalog-item {
  align-items: center;
  justify-content: space-between;
}
#catalogTitle {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
}
.catalog-item-main {
  min-width: 0;
}
.catalog-item-main b {
  display: block;
  font-size: 0.92rem;
}
.catalog-item-main small {
  color: var(--muted);
  font-size: 0.76rem;
}
.catalog-item--other {
  min-height: 72px;
  align-items: center;
  border-color: #2d70ba;
  border-radius: 9px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(118, 151, 188, .72), rgba(42, 63, 87, .35) 38%, transparent 72%),
    linear-gradient(180deg, #263a52 0%, #111b27 46%, #060a0f 100%);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,.22),
    inset 0 0 20px rgba(45,112,186,.18),
    0 0 0 1px rgba(45,112,186,.38),
    0 4px 10px rgba(0,0,0,.42);
}
.catalog-item--other .catalog-item-main b {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.2;
}
.catalog-item--other .catalog-item-main small {
  color: #b5c1ca;
  font-size: 0.8rem;
  line-height: 1.25;
  margin-top: 3px;
}
.catalog-section-title {
  list-style: none;
  color: #f0f50f;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 12px 4px 4px;
  text-transform: none;
}
.catalog-popular {
  color: #f0f50f;
  font-size: 0.75rem;
  white-space: nowrap;
}
.roles-summary {
  position: relative;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid #2d70ba;
  background:
    radial-gradient(circle at 50% 0%, rgba(69, 91, 118, .55), transparent 58%),
    linear-gradient(180deg, #192331 0%, #10171f 100%);
  box-shadow: inset 0 1px 24px rgba(45, 140, 255, .13), 0 3px 12px rgba(0,0,0,.22);
}
.roles-summary.is-roles-summary-collapsed {
  padding-top: 10px;
  padding-bottom: 8px;
}
.roles-summary-loading {
  color: var(--muted);
  font-size: 0.86rem;
}
.role-limit-message {
  margin: 8px 2px 12px;
  color: #f0f50f;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
}
.role-limit-message .role-limit-sub-btn {
  margin-top: 10px;
}
.roles-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.roles-summary-head b {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.15;
  margin-bottom: 2px;
}
.roles-summary-head span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}
.roles-summary-head strong {
  min-width: 42px;
  text-align: center;
  color: #b8bdc2;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.roles-summary-month {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 34px 6px;
  color: #f0f50f;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}
.roles-summary-help {
  position: absolute;
  right: 14px;
  top: 92px;
}
.roles-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  margin-top: 2px;
  align-items: end;
}
.roles-summary-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 42px;
}
.roles-summary-item span {
  color: var(--muted);
}
.roles-summary-item b {
  display: block;
  color: #f0f50f;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.12;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roles-summary-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}
.roles-summary-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.roles-media-track {
  height: 7px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.roles-media-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8fd8ff);
}
.role-card {
  flex-direction: column;
  gap: 10px;
}
.role-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.role-card-title {
  color: #f0f50f;
  font-weight: 700;
}
.role-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.role-card-kind {
  color: var(--text);
  font-size: 0.92rem;
}
.role-card-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.role-card-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.role-media-mb {
  min-width: 92px;
  max-width: 44%;
  padding: 12px 14px;
  border-radius: 20px;
  text-align: center;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(180deg, #273649 0%, #121923 100%);
  border: 1px solid #2d8cff;
  box-shadow: inset 0 1px 14px rgba(45, 140, 255, .18), 0 2px 10px rgba(0, 0, 0, .24);
  white-space: nowrap;
}
.role-active-pill {
  color: var(--accent);
  font-size: 0.78rem;
  white-space: nowrap;
}
.role-card-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.roles-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 8px 0 12px;
  padding-bottom: 2px;
}
.roles-filter-chips::-webkit-scrollbar { display: none; }
.chip.chip--role-filter {
  padding: 8px 22px;
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(111, 105, 93, .92), rgba(43, 42, 40, .96));
  border-color: #2d70ba;
  box-shadow: inset 0 1px 10px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.22);
}
.chip.chip--role-filter.active {
  color: #fff;
  border-color: #2d8cff;
  background: linear-gradient(180deg, #6c675d 0%, #2f2d2a 100%);
}
.role-card-actions .role-open-btn {
  flex: 1;
}
.role-delete-btn {
  width: 44px;
  flex: 0 0 44px;
  border: 1px solid #6d2a2a;
  border-radius: var(--radius-sm);
  background: #4a1818;
  color: #ffb3b3;
  cursor: pointer;
  font-size: 1rem;
}
.role-delete-btn:active {
  background: #612020;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.btn-icon:active { background: var(--surface2); }
.btn-home {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 34px;
}
.btn-roles {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 34px;
}
.role-icon {
  display: block;
  width: 26px;
  height: 26px;
  transform: translateY(2px);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.role-icon__head,
.role-icon__body {
  fill: none;
  stroke: #d2d4d6;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-icon {
  display: block;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.home-icon__roof,
.home-icon__chimney,
.home-icon__body {
  fill: #d2d4d6;
}
.home-icon__door {
  fill: #18222c;
}

/* ─── СТРАНИЦЫ ───────────────────────────────────────────── */
.page { display: none; padding: 14px; }
.page.active { display: block; }

/* ─── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #263040;
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 200;
  border: 1px solid var(--border);
  max-width: 80vw;
  text-align: center;
  box-shadow: 0 4px 16px #0006;
}
.toast.error { background: #3a1a1a; border-color: var(--red); }
.toast.toast-persistent {
  width: min(540px, calc(100vw - 28px));
  max-width: none;
  padding: 16px 46px 16px 18px;
  border-radius: 18px;
  text-align: left;
}
.toast-persistent-text {
  display: block;
  white-space: pre-line;
  line-height: 1.42;
}
.toast-persistent-close {
  position: absolute;
  top: 7px;
  right: 9px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.hidden { display: none !important; }

/* ─── СТАТС-БАННЕР ───────────────────────────────────────── */
.stats-banner {
  display: block;
  background:
    radial-gradient(circle at 50% 0%, rgba(69, 91, 118, .55), transparent 58%),
    linear-gradient(180deg, #192331 0%, #10171f 100%);
  border: 1px solid #2d70ba;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  min-height: 260px;
  box-shadow: inset 0 1px 24px rgba(45, 140, 255, .13), 0 3px 12px rgba(0,0,0,.22);
}
.stats-banner.is-stats-collapsed {
  min-height: 0;
  padding-top: 10px;
  padding-bottom: 8px;
}
.stats-banner-top {
  display: grid;
  grid-template-columns: 42px 1fr 42px 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.stats-month-title {
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}
.stats-nav-btn,
.stats-help-btn {
  border: 0;
  background: transparent;
  color: #c9d0d5;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.stats-help-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #8c8f89;
  color: #fff;
  font-size: 1.15rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  min-height: 0;
  align-content: start;
  align-items: end;
}
.stats-month-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  position: relative;
}
.stats-month-title--spacer {
  visibility: hidden;
  pointer-events: none;
}
.stat-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 50px;
}
.stat-item--tile {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #2d70ba;
  background: linear-gradient(180deg, #27384b 0%, #0d141d 100%);
  box-shadow: inset 0 1px 16px rgba(255,255,255,.06), 0 3px 8px rgba(0,0,0,.24);
}
.stat-item .val { font-size: 1.1rem; font-weight: 700; color: #f0f50f; }
.stat-item .stat-den,
.stat-item .stat-sep { color: #b8bdc2; }
.stat-avg-num {
  display: inline-block;
  text-decoration-line: overline;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: none;
}
.stat-item .stat-date { color: var(--text); font-size: 0.95rem; }
.stat-item .lbl { font-size: 0.78rem; color: var(--muted); }
.stats-inline-month {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.stats-inline-nav {
  border: 0;
  background: transparent;
  color: #c9d0d5;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.stats-help-btn,
.stats-help-link,
.help-dot,
.portfolio-help-dot,
.resume-help-btn {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #8c8f89;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stats-help-link--top {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.stats-banner-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  position: relative;
}
.stats-footer-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.stats-banner.is-stats-collapsed .stats-grid {
  min-height: 0;
}
.stats-banner.is-stats-collapsed .stat-item {
  min-height: 42px;
}
.stats-memory-track {
  height: 7px;
  width: 100%;
  margin: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.stats-memory-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8fd8ff);
}
.stats-banner.is-stats-collapsed .stats-memory-track {
  margin-top: 0;
}
.stats-muted-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.72rem;
  cursor: pointer;
}
.stats-muted-toggle.active {
  color: var(--accent);
  border-color: #2d70ba;
}
.stats-collapse-toggle {
  width: 34px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c9d0d5;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stats-collapse-toggle:active {
  background: var(--surface2);
}
.stats-collapse-chevron {
  width: 20px;
  height: 20px;
  border-left: 6px solid var(--muted);
  border-top: 6px solid var(--muted);
  border-radius: 3px 0 0 0;
  transform: rotate(45deg);
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.45));
}
.stats-collapse-chevron.is-down {
  transform: rotate(225deg);
}
.stats-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  background: #87909a;
  padding: 0;
  cursor: pointer;
}
.stats-dot.active { background: #f0f50f; }
.is-stat-den-hidden .stat-den,
.is-stat-den-hidden .stat-sep,
.is-button-labels-hidden .menu-btn-sub {
  display: none !important;
}
.is-button-labels-hidden .menu-btn {
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.is-button-labels-hidden .menu-btn--wide {
  min-height: 58px;
}
.is-button-labels-hidden .menu-grid .menu-btn .menu-btn-title,
.is-button-labels-hidden .menu-btn--wide .menu-btn-title {
  min-height: 0;
}
.is-button-labels-hidden #btnNewProject,
.is-button-labels-hidden #btnOldProject {
  height: 54px;
  padding-top: 8px;
  padding-bottom: 8px;
}

@media (max-width: 390px) {
  .stats-banner {
    min-height: 260px;
    padding: 10px;
    margin-bottom: 10px;
  }
  .stats-banner.is-stats-collapsed {
    min-height: 0;
  }
  .stats-month-title {
    margin-bottom: 8px;
    font-size: 1rem;
    gap: 8px;
  }
  .stats-grid {
    gap: 6px 10px;
    align-content: start;
    align-items: end;
  }
  .stat-item {
    min-height: 40px;
  }
  .stat-item .val {
    font-size: 1.08rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  .stat-item .lbl {
    font-size: 0.76rem;
    line-height: 1.12;
  }
  .stats-banner-footer {
    gap: 7px;
    margin-top: 9px;
  }
  .stats-footer-row { gap: 5px; }
  .stats-muted-toggle {
    padding: 5px 7px;
    font-size: 0.68rem;
  }
}

/* ─── КНОПКИ ────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-secondary{ background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-danger   { background: #3a1a1a; color: var(--red); border: 1px solid #5a2a2a; }
.btn-primary:active, .btn-secondary:active, .btn-danger:active { opacity: .7; }
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled {
  opacity: .45;
  cursor: default;
}
.wide { width: 100%; }

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: stretch;
}
.action-row > * { flex: 1; min-width: 0; }
.sticky-bottom {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + 8px);
  background: var(--bg);
  padding-top: 10px;
  margin-top: 20px;
}

/* ─── ГЛАВНОЕ МЕНЮ ───────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.section-label.project-edit-section-title {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.media-upload-hint {
  margin: 0 0 8px;
}
.menu-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.menu-btn:active { background: var(--surface2); }
.menu-btn--wide {
  width: 100%;
  margin-bottom: 10px;
  min-height: 88px;
}
.menu-btn-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  color: #f0f50f;
  font-size: 0.98rem;
  line-height: 1.15;
  text-align: center;
}
.menu-title-icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  object-fit: contain;
  flex: 0 0 auto;
}
.menu-grid .menu-btn .menu-btn-title,
.menu-btn--wide .menu-btn-title {
  min-height: 24px;
  padding-left: 0;
  padding-right: 0;
}
.menu-btn-sub {
  display: block;
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  line-height: 1.22;
  text-align: center;
}
#btnNewProject,
#btnOldProject {
  touch-action: manipulation;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 70px;
  align-self: stretch;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.2;
}
#btnNewProject .menu-btn-title,
#btnOldProject .menu-btn-title {
  padding: 0;
}
#btnNewProject .menu-btn-title,
#btnOldProject .menu-btn-title {
  color: #f0f50f;
}
#btnNewProject .menu-btn-sub,
#btnOldProject .menu-btn-sub {
  color: #000;
}
#btnOldProject .menu-btn-sub {
  color: var(--muted);
}
.portfolio-quick-copy {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 24px;
  height: 21px;
  cursor: pointer;
}
.portfolio-quick-copy img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.stats-help-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.45;
}
.stats-help-page strong {
  color: #f0f50f;
}

/* ─── БЫСТРЫЙ ВЫБОР ПРОШЛЫХ МЕСЯЦЕВ ───────────────────────── */
.recent-months-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 10px;
  padding-bottom: 2px;
}
.recent-months-wrap::-webkit-scrollbar { display: none; }
.recent-months-nav { align-items: center; flex: 0 0 auto; min-width: max-content; flex-wrap: nowrap; }

/* ─── ЧИПСЫ ФИЛЬТРА ──────────────────────────────────────── */
.filter-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.filter-group { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 7px 15px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:active { opacity: 0.92; }

/* Чипы сортировки в окне проектов */
.chip.chip--status-all,
.chip.chip--fold-all {
  border-color: #687582;
  color: #d5d8dc;
  background: #252c32;
}
.chip.chip--status-draft,
.chip.chip--status-ready,
.chip.chip--fold-new,
.chip.chip--fold-old,
.chip.chip--month,
.chip.chip--archive {
  border-color: #324f6d;
  color: #cfe5f8;
  background: rgba(21, 38, 58, .68);
}
.chip.active {
  border-width: 2px;
  border-color: #f0f50f !important;
  padding: 6px 14px;
}
.chip.chip--archive {
  color: #f0f50f;
  border-color: rgba(45, 112, 186, .95);
  background:
    radial-gradient(circle at 50% 0%, rgba(82, 108, 140, .42), transparent 62%),
    linear-gradient(180deg, #24374d 0%, #101821 100%);
  box-shadow: inset 0 1px 12px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.26);
}
.chip.chip--archive:active {
  background: rgba(31, 58, 86, .78);
}
.archive-filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 9px;
  padding-bottom: 2px;
}
.archive-filter-row::-webkit-scrollbar { display: none; }
.chip.chip--archive-year:not(.active),
.chip.chip--archive-month:not(.active),
.chip.chip--archive-tag:not(.active) {
  border-color: #3b5871;
  color: #a9c7df;
  background: #142232;
}
.chip.chip--archive-year.active,
.chip.chip--archive-month.active,
.chip.chip--archive-tag.active {
  border-color: #3498db;
  color: #fff;
  background: #1f6dad;
}
.chip.chip--archive-month-label,
.chip.chip--archive-tag-label {
  border-color: #7d5ba6;
  color: #eadcff;
  background: #22182e;
}
.archive-tag-stats {
  margin: 0 0 12px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid #2d70ba;
  background:
    radial-gradient(circle at 50% 0%, rgba(69, 91, 118, .5), transparent 58%),
    linear-gradient(180deg, #24364b 0%, #111923 52%, #080c12 100%);
  box-shadow: inset 0 1px 18px rgba(255,255,255,.06), 0 3px 10px rgba(0,0,0,.28);
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.35;
}
.archive-tag-stats b {
  color: #f0f50f;
  font-weight: 700;
}

/* Совместимость со старыми селекторами по data-* */
.chip[data-fstatus="draft"].active  { border-color: #8bc34a; color: #fff; background: #4f8c2f; }
.chip[data-fstatus="ready"].active  { border-color: #95a5a6; color: #fff; background: #5d6d7e; }
.chip[data-fold="0"].active         { border-color: #fdd835; color: #222; background: #e6bc00; }
.chip[data-fold="1"].active         { border-color: #bdc3c7; color: #fff; background: #5d6973; }

/* ─── СПИСОК КАРТОЧЕК ────────────────────────────────────── */
.card-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.project-card-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.project-card-actions {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-end;
  padding: 6px 6px 6px 50%;
  background: #10171f;
}
.project-card-actions .pc-swipe-btn:only-child {
  grid-column: 1 / -1;
}
.pc-swipe-btn {
  border: 1px solid #324f6d;
  background: rgba(21, 38, 58, .86);
  color: #cfe5f8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 10px rgba(255,255,255,.06), 0 2px 7px rgba(0,0,0,.22);
}
.pc-swipe-btn--move {
  border-color: #687582;
  color: #d5d8dc;
  background: #252c32;
}
.pc-swipe-btn--portfolio {
  border-color: #2d70ba;
}
.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  z-index: 1;
  transition: transform .18s ease;
  touch-action: pan-y;
}
.project-card-shell.is-swiped .project-card {
  transform: translateX(-50%);
}
/* Как chip.chip--fold-old:not(.active) — старые проекты в ленте */
.project-card.project-card--old {
  border-color: #6d7d8a;
  background: #2a3036;
  color: #bdc3c7;
}
.project-card.project-card--old .pc-no { color: #e8edf0; }
.project-card.project-card--old .pc-desc { color: #9aaebc; }
.project-card.project-card--old .pc-meta { color: #9aaebc; }
.project-card:active { background: var(--surface2); }
.project-card.project-card--old:active { background: #323840; }
.pc-content { flex: 1; min-width: 0; }
.pc-side {
  width: 92px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.pc-project-no {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
}
.pc-media-plate {
  width: 76px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--surface2) 0%, #191919 100%);
}
.pc-thumb {
  position: relative;
  width: 100%;
  height: 76px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.pc-size {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  padding: 6px 4px 7px;
  text-shadow: 0 1px 3px rgba(0,0,0,.55);
}
.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: opacity .25s;
}
.card-thumb-img--placeholder {
  object-fit: contain;
  background: #1b2430;
}
.card-thumb-img.is-gif-media,
.media-cell img.is-gif-media,
.mf-media img.is-gif-media {
  image-rendering: auto;
  transform: translateZ(0);
}
.project-card .pc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-right: 112px;
}
.project-card .pc-no { font-weight: 700; font-size: 1rem; }
.project-card .pc-badges {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  position: absolute;
  top: 18px;
  right: 104px;
}
.project-card .pc-status { font-size: 0.74rem; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
/* Завершён — как chip.chip--status-ready:not(.active) */
.project-card .pc-status.status-ready {
  background: #252b32;
  color: #bdc3c7;
  border: 1px solid #5f6f7a;
}
/* В работе — как chip chip--status-draft неактивный */
.project-card .pc-status.status-draft {
  border: 1px solid #558b35;
  color: #8bc34a;
  background: #1a2910;
}
.project-card .pc-status.pc-status--portfolio {
  border: 1px solid #f0f50f;
  color: #f0f50f;
  background: rgba(240,245,15,.08);
}
/* Зелёные чипы счётчиков медиа (список зрителя) — не путать с status-ready серым */
.project-card .pc-media-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  max-width: 58%;
}
.project-card .pc-media-stat-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  background: #1a3a25;
  color: #8bc34a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pc-media-ico::before {
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  display: inline-block;
}
/* Unicode вместо литералов — лучше в WebView MAX */
.pc-media-ico--photo::before { content: "\1F4F7"; }
.pc-media-ico--video::before { content: "\1F3AC"; }
.pc-media-ico--doc::before { content: "\1F4C4"; }
.project-card.project-card--old .pc-media-stat-chip {
  background: #253528;
  color: #9ccc65;
}
.project-card .pc-month {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 8px;
  margin-top: 4px;
}
.project-card .pc-month--new {
  color: #1a1410;
  background: linear-gradient(180deg, #ffe082 0%, #ffc107 100%);
  border-color: #c9a31a;
  font-weight: 700;
}
.project-card .pc-month--old {
  color: #bdc3c7;
  background: #252b32;
  border-color: #6d7d8a;
}
.project-card .pc-desc {
  font-size: 0.88rem;
  margin-top: 6px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card .pc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-chip { font-size: 0.73rem; background: #1a3a50; color: var(--accent);
  padding: 2px 7px; border-radius: 8px; }
.project-card .pc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.project-card .pc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.pc-meta-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  object-fit: contain;
  display: block;
}
@media (max-width: 380px) {
  .pc-side { width: 78px; }
  .project-card .pc-top { padding-right: 90px; }
  .project-card .pc-badges { right: 88px; }
  .pc-media-plate { width: 68px; }
  .pc-thumb { height: 68px; }
  .pc-size { font-size: 0.8rem; padding: 5px 3px 6px; }
}

/* ─── РЕДАКТОР ПРОЕКТА ───────────────────────────────────── */
.project-header { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; color: var(--accent); }

.section-block { margin-bottom: 16px; }
.section-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 6px; font-weight: 600; }

.textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px;
  font-size: 16px; font-family: inherit; resize: vertical; line-height: 1.45;
}
.textarea:focus { outline: none; border-color: var(--accent); }

.input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px;
  font-size: 16px; font-family: inherit;
}
.input:focus { outline: none; border-color: var(--accent); }
.input.wide { width: 100%; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field > span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }

.rate-calc-hint { margin-bottom: 10px; }
.rate-calc-row { margin-top: 4px; }
.rate-calc-result { display: block; margin-top: 10px; }
.input--rate-out {
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #273242 0%, #1c2530 50%, #151b24 100%);
  border-color: var(--border);
  -moz-appearance: textfield;
}
.input--rate-out::-webkit-inner-spin-button,
.input--rate-out::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input--rate-out:focus {
  outline: none;
  border-color: var(--border);
  box-shadow: none;
}

/* ─── ТЕГИ ───────────────────────────────────────────────── */
.tag-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-wrap { display: inline-flex; align-items: stretch; max-width: 100%; }
.tag-toggle {
  padding: 6px 12px; border-radius: 10px; font-size: 0.82rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: background .12s, border-color .12s;
}
.tag-toggle.on { background: #1a3a50; color: var(--accent); border-color: var(--accent); }
.tag-wrap-custom .tag-toggle { border-radius: 10px 0 0 10px; }
.tag-delete {
  width: 30px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0;
  background: #2a1f25; color: #ff9d9d; cursor: pointer; font-size: 1rem; line-height: 1;
}
.tag-delete::before,
.project-link-delete::before,
.del-btn::before {
  content: "\00d7";
}
.tag-add-row {
  display: flex; gap: 8px; width: 100%; margin-top: 6px; align-items: center;
}
.tag-add-row input {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 16px;
}
.tag-add-row button { width: auto; white-space: nowrap; }
.tag-empty { width: 100%; color: var(--muted); font-size: 0.84rem; padding: 4px 0; }

.project-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 10px;
}
.project-link-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
}
.project-link-open {
  min-width: 138px;
  max-width: 220px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #344154 0%, #202833 52%, #10151c 100%);
  color: var(--text);
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-link-delete {
  width: 42px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: #2a1f25;
  color: #ff9d9d;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
.project-link-add-btn,
.project-link-save-btn {
  width: auto;
  min-width: 150px;
  margin-top: 4px;
}
.project-link-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.project-link-form.hidden { display: none; }
.project-link-save-btn { grid-column: 1 / 2; }
.project-view-links {
  margin: 12px 0 14px;
}
.project-view-links-title {
  margin-bottom: 8px;
}
.project-view-link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.project-view-link-btn {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #344154 0%, #202833 52%, #10151c 100%);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-view-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.project-view-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.08;
}
.project-view-sub {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.project-view-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.project-view-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.project-view-month,
.project-view-status {
  min-width: 120px;
  border-radius: 18px;
  padding: 7px 12px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
}
.project-view-month {
  background: #f0f50f;
  color: #222;
  box-shadow: inset 0 1px 4px rgba(255,255,255,.55), 0 1px 4px rgba(0,0,0,.32);
}
.project-view-status.is-draft {
  background: #789739;
  color: #fff;
  border: 1px solid #47a9db;
}
.project-view-status.is-ready {
  background: #252b32;
  color: #d8dde2;
  border: 1px solid #5f6f7a;
}
.project-view-desc {
  margin: 0 0 12px;
  color: #d8dde2;
  font-size: 0.98rem;
  line-height: 1.35;
  white-space: pre-line;
}
.project-view-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 6px 16px rgba(0,0,0,.18);
}
.project-view-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.project-view-portfolio {
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  max-width: 70px;
}
.project-view-portfolio .toggle {
  width: 54px;
  height: 28px;
}
.project-view-portfolio .toggle:after {
  width: 22px;
  height: 22px;
}
.project-view-portfolio .toggle:checked:after {
  transform: translateX(26px);
}
@media (max-width: 520px) {
  .project-link-form { grid-template-columns: 1fr; }
  .project-link-save-btn { grid-column: auto; }
  .project-link-open { min-width: 128px; max-width: calc(100vw - 120px); }
  .project-view-link-list { grid-template-columns: 1fr; }
  .project-view-card { grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; }
  .project-view-title { font-size: 1.18rem; }
  .project-view-month,
  .project-view-status { min-width: 106px; padding: 7px 10px; font-size: 0.78rem; }
  .project-view-meta { font-size: 0.84rem; gap: 10px; padding: 9px 12px; }
}

/* ─── TOGGLE ─────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; }
.toggle { width: 42px; height: 24px; appearance: none; background: var(--border);
  border-radius: 12px; position: relative; cursor: pointer; transition: background .2s; }
.toggle:checked { background: var(--accent); }
.toggle:after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px;
  background: #fff; border-radius: 50%; transition: transform .2s; }
.toggle:checked:after { transform: translateX(18px); }

/* ─── МЕДИА ─────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; margin-bottom: 10px; }
.media-cell { position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface); aspect-ratio: 1; border: 1px solid var(--border); }
.media-cell img, .media-cell video { width:100%; height:100%; object-fit: cover; display: block; }
.media-cell .media-type { position:absolute; left:4px; bottom:4px; background:#000a;
  color:#fff; font-size:0.68rem; padding:1px 5px; border-radius:6px; }
.media-cell .media-size-badge {
  position:absolute; left:4px; top:4px;
  background:rgba(0,0,0,.72); color:#fff;
  font-size:.68rem; font-weight:700; line-height:1;
  padding:3px 6px; border-radius:7px;
  max-width:58px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  box-shadow:0 1px 4px rgba(0,0,0,.28);
}
.media-cell .del-btn { position:absolute; top:4px; right:4px; background:#c0392b;
  color:#fff; border:none; border-radius:50%; width:22px; height:22px; font-size:0.8rem;
  cursor:pointer; display:flex; align-items:center; justify-content:center; }
.media-cell .media-bot-btn {
  position:absolute; right:4px; top:4px;
  width:30px; height:30px; border-radius:9px;
  border:1px solid rgba(47, 140, 255, .95);
  background: linear-gradient(180deg, #45a2ff 0%, #1f74d2 58%, #0d4282 100%);
  color:#fff; padding:0; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 8px rgba(0,0,0,.42), inset 0 1px 5px rgba(255,255,255,.26);
}
.media-bot-icon {
  width:18px; height:18px; display:flex; align-items:flex-start; justify-content:center;
  position:relative; color:#fff; font-size:18px; font-weight:800; line-height:14px;
  text-shadow:0 1px 2px rgba(0,0,0,.35);
}
.media-bot-icon::after {
  content:""; position:absolute; left:3px; right:3px; bottom:2px; height:6px;
  border:2px solid #fff; border-top:0; border-radius:0 0 4px 4px;
}
.media-cell.is-main-media {
  border-color:#f0f50f;
  box-shadow: 0 0 0 2px rgba(240,245,15,.22), inset 0 0 18px rgba(240,245,15,.08);
}
.media-cell.is-main-media::after {
  content:"Главная";
  position:absolute; right:4px; bottom:4px;
  background:rgba(240,245,15,.92); color:#141414;
  font-size:.66rem; font-weight:700; padding:2px 6px; border-radius:7px;
}
.doc-cell { padding: 10px; display:flex; flex-direction:column; align-items:center;
  justify-content:center; text-align:center; font-size:0.72rem; color:var(--muted);
  aspect-ratio: 1; }
.doc-cell .doc-icon { font-size:1.6rem; margin-bottom:4px; }

.upload-area {
  display: flex; align-items: center; justify-content: center;
  width: 100%; border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 18px; cursor: pointer; color: var(--muted); font-size: 0.9rem;
  gap: 8px; transition: border-color .15s;
}
.upload-area:hover { border-color: var(--accent); color: var(--accent); }
.upload-area input { display: none; }

.upload-progress { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.85rem;
  color: var(--muted); margin: 0 0 8px; }
.upload-progress-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--text); font-weight: 600; margin-bottom: 8px;
}
.upload-progress-status {
  display:inline-flex; align-items:center; gap:7px; min-width:0;
}
.upload-progress-spinner {
  width:14px; height:14px; border-radius:50%;
  border:2px solid rgba(255,255,255,.22);
  border-top-color:var(--accent);
  animation:spin .8s linear infinite;
  flex:0 0 auto;
}
.upload-progress-track {
  height: 6px; overflow: hidden; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
}
.upload-progress-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8fd8ff);
  transition: width .12s ease-out;
}
.upload-progress-name {
  margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── РЕЗЮМЕ ─────────────────────────────────────────────── */
.resume-summary-card {
  position: relative;
  background: linear-gradient(145deg, #111922 0%, #32445c 62%, #182433 100%);
  border: 1px solid #2d70ba;
  border-radius: var(--radius);
  padding: 14px 34px 14px 18px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 22px rgba(255,255,255,.06), 0 3px 12px rgba(0,0,0,.28);
}
.resume-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 18px;
  align-items: end;
}
.resume-summary-value {
  color: #f0f50f;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.resume-summary-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.resume-summary-cell--portfolio {
  grid-column: 1;
}
.resume-summary-cell--updated {
  grid-column: 1 / -1;
}
.resume-summary-switch {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-left: -4px;
  margin-bottom: 2px;
}
.resume-help-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.resume-portfolio-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
  cursor: pointer;
}
.resume-portfolio-switch input { display: none; }
.resume-portfolio-switch span {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #8f9295;
  position: relative;
  box-shadow: inset 0 1px 5px rgba(0,0,0,.35);
}
.resume-portfolio-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f4f5f6;
  box-shadow: 0 1px 5px rgba(0,0,0,.35);
  transition: transform .16s ease;
}
.resume-portfolio-switch input:checked + span { background: #27a9dc; }
.resume-portfolio-switch input:checked + span::after { transform: translateX(22px); }
.resume-add-media-btn {
  margin: 12px 0 10px;
}
.resume-media-grid {
  margin-bottom: 12px;
}
.resume-view-media-grid {
  margin: 10px 0 14px;
}
.resume-text {
  white-space: pre-wrap; font-family: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; min-height: 100px; margin-bottom: 14px; font-size: 0.9rem;
  line-height: 1.55;
}
.resume-meta {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

/* ─── СТАТИСТИКА ─────────────────────────────────────────── */
.stats-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stats-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.stats-card .sc-val { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.stats-card .sc-lbl { font-size: 0.78rem; color: var(--muted); }

.tag-stats-list { display: flex; flex-direction: column; gap: 8px; }
.tag-stat-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.tag-stat-row .ts-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.tag-stat-row .ts-meta { font-size: 0.8rem; color: var(--muted); display:flex; gap:12px; }
.tag-stat-row .ts-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px; }
.tag-stat-row .ts-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }

/* ─── ПОДЕЛИТЬСЯ ─────────────────────────────────────────── */
.share-link-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.share-link-box code { word-break: break-all; font-size: 0.85rem; color: var(--accent); }

/* ─── VIEWER ─────────────────────────────────────────────── */
.portfolio-summary {
  background: linear-gradient(145deg, #111922 0%, #32445c 62%, #182433 100%);
  border: 1px solid #2d70ba;
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 22px rgba(255,255,255,.06), 0 3px 12px rgba(0,0,0,.28);
}
.portfolio-summary--dashboard {
  position: relative;
  padding: 16px 20px 14px;
}
.portfolio-help-dot {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.portfolio-summary-title {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 10px;
  text-align: center;
}
.portfolio-summary--dashboard .portfolio-summary-title {
  text-align: left;
}
.portfolio-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.portfolio-summary-value {
  color: #f0f50f;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.portfolio-summary--dashboard .portfolio-summary-value {
  font-size: 1rem;
}
.portfolio-summary-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 3px;
}
.portfolio-resume-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.portfolio-resume-switch {
  flex: 0 0 auto;
}
.portfolio-stats-card {
  margin-top: 14px;
  padding: 12px 14px 14px;
  border: 1px solid #2d70ba;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(73, 96, 128, .82), rgba(8, 12, 18, .96));
  box-shadow: inset 0 1px 18px rgba(255,255,255,.05), 0 3px 10px rgba(0,0,0,.28);
}
.portfolio-stats-title {
  color: var(--text);
  font-size: 0.84rem;
  margin-bottom: 10px;
}
.portfolio-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.portfolio-stats-grid strong {
  display: block;
  color: #f0f50f;
  font-size: 1rem;
  line-height: 1.12;
  font-weight: 800;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.portfolio-stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.15;
  margin-top: 3px;
}
.portfolio-summary-views {
  font-size: 0.76rem;
  margin-top: 2px;
  white-space: nowrap;
}
.portfolio-note {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0 2px 18px;
}
.portfolio-note p + p { margin-top: 4px; }
.portfolio-main-btn { margin-bottom: 10px; }
.portfolio-selector-card {
  position: relative;
  margin-bottom: 12px;
  padding: 14px 48px 14px 16px;
  border: 1px solid rgba(50, 169, 231, .7);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(29, 69, 104, .9), rgba(11, 24, 36, .96));
  color: #fff;
  cursor: pointer;
}
.portfolio-selector-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.portfolio-selector-count { margin-top: 4px; color: #a8bbca; font-size: 13px; }
.portfolio-selector-chevron {
  position: absolute; right: 17px; top: 18px; color: #69c6f1; font-size: 20px;
}
.portfolio-selected-description {
  margin: -4px 4px 14px; color: #c5d2dc; white-space: pre-wrap; line-height: 1.4;
}
.portfolio-selected-actions { display: flex; gap: 8px; margin: -2px 0 12px; }
.portfolio-selected-actions button { flex: 1; }
.portfolio-modal-box { max-height: min(82vh, 720px); overflow-y: auto; }
.portfolio-modal-title { margin: 0 0 14px; font-size: 20px; }
.portfolio-modal-hint {
  margin: -4px 0 14px;
  color: #a8bbca;
  font-size: .82rem;
  line-height: 1.4;
}
.portfolio-choice-list { display: grid; gap: 9px; margin-bottom: 14px; }
.portfolio-choice-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center;
  gap: 10px; width: 100%; padding: 12px; border: 1px solid #31536d;
  border-radius: 12px; background: #101b24; color: #fff; text-align: left;
}
.portfolio-choice-row.is-selected { border-color: #39bdf4; background: #142b3d; }
.portfolio-choice-mark {
  display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #7891a3;
  border-radius: 50%; color: transparent;
}
.portfolio-choice-row.is-selected .portfolio-choice-mark {
  border-color: #39bdf4; background: #39bdf4; color: #07131c;
}
.portfolio-choice-list--multiple .portfolio-choice-mark { border-radius: 6px; }
.portfolio-choice-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.portfolio-choice-count { color: #a8bbca; font-size: 12px; white-space: nowrap; }
.portfolio-create-form { display: grid; gap: 12px; }
.portfolio-create-form textarea { min-height: 92px; resize: vertical; }
.portfolio-modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.portfolio-modal-actions > * { flex: 1; }
.portfolio-paid-action {
  flex-direction: column;
  gap: 2px;
}
.portfolio-main-btn .portfolio-paid-feature {
  margin-top: 0;
  line-height: 1.1;
}
.portfolio-audience-title { margin-top: 22px; }
.portfolio-copy-btn {
  padding-left: 24px;
}
.portfolio-projects-block { margin-top: 8px; }
.portfolio-projects-summary {
  position: relative;
  min-height: 52px;
  margin: 0 0 12px;
  padding: 14px 48px 14px 16px;
  border: 1px solid rgba(47, 143, 255, .72);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(48, 72, 102, .96), rgba(9, 15, 22, .98));
  box-shadow: inset 0 1px 10px rgba(255,255,255,.08), 0 0 0 1px rgba(0,0,0,.25);
}
.portfolio-projects-summary-title {
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
}
.portfolio-projects-summary-title strong {
  color: #f0f50f;
  font-size: 1.05rem;
}
.portfolio-projects-help-dot {
  position: absolute;
  top: 10px;
  right: 10px;
}
.portfolio-projects-note {
  margin: 4px 2px 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}
.portfolio-display-card {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(47, 143, 255, .75);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(48, 72, 102, .96), rgba(9, 15, 22, .98));
  box-shadow: inset 0 1px 10px rgba(255,255,255,.08), 0 0 0 1px rgba(0,0,0,.25);
}
.portfolio-display-card h2 {
  margin: 0 34px 8px 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
}
.portfolio-settings-help-dot {
  position: absolute;
  top: 14px;
  right: 14px;
}
.portfolio-display-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.portfolio-display-group {
  margin-top: 14px;
}
.portfolio-display-group h3 {
  margin: 0 0 8px;
  color: #f0f50f;
  font-size: .9rem;
  font-weight: 700;
}
.portfolio-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  padding: 6px 0;
  color: #fff;
  font-size: .86rem;
  line-height: 1.25;
  border-bottom: 1px solid rgba(120, 155, 190, .16);
}
.portfolio-display-row:last-child {
  border-bottom: 0;
}
.portfolio-paid-feature {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
}
.portfolio-watermark-card {
  padding: 0;
  margin-bottom: 14px;
}
.portfolio-watermark-card.is-disabled {
  opacity: .62;
}
.portfolio-watermark-lock {
  margin: 0 0 14px;
  line-height: 1.35;
}
.watermark-text-input {
  margin-top: 14px;
}
.watermark-position-label {
  margin-top: 14px;
}
.watermark-section-label {
  margin-top: 16px;
}
.watermark-preview {
  position: relative;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 10px 0 18px;
  background: linear-gradient(135deg, rgba(48, 68, 88, .9), rgba(11, 19, 28, .95));
}
.watermark-pos {
  position: absolute;
  max-width: 42%;
  border: 1px solid rgba(140, 170, 200, .45);
  border-radius: 999px;
  background: rgba(20, 32, 44, .88);
  color: var(--text);
  padding: 6px 8px;
  font-size: .72rem;
  line-height: 1.15;
}
.watermark-pos.active {
  border-color: var(--accent);
  color: #f0f50f;
}
.watermark-pos--top_right { top: 10px; right: 10px; }
.watermark-pos--bottom_right { right: 10px; bottom: 10px; }
.watermark-pos--top_left { top: 10px; left: 10px; }
.watermark-pos--bottom_left { left: 10px; bottom: 10px; }
.watermark-pos--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.watermark-size-row {
  margin: 6px 0 10px;
}
.watermark-size-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.watermark-size-label strong {
  color: #f0f50f;
  font-size: .86rem;
}
.watermark-size-range {
  width: 100%;
  margin: 2px 0 10px;
  accent-color: #2ea8ff;
}
.watermark-size-range,
.watermark-opacity-range {
  --range-progress: 0%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ea8ff 0 var(--range-progress), #e5e9ed var(--range-progress) 100%);
  outline: none;
}
.watermark-size-range::-webkit-slider-runnable-track,
.watermark-opacity-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}
.watermark-size-range::-webkit-slider-thumb,
.watermark-opacity-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -5.5px;
  border: 0;
  border-radius: 50%;
  background: #f4f6f8;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.watermark-size-range::-moz-range-track,
.watermark-opacity-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #e5e9ed;
}
.watermark-size-range::-moz-range-progress,
.watermark-opacity-range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #2ea8ff;
}
.watermark-size-range::-moz-range-thumb,
.watermark-opacity-range::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 50%;
  background: #f4f6f8;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.watermark-opacity-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.watermark-opacity-label strong {
  color: #f0f50f;
  font-size: .86rem;
}
.watermark-opacity-range {
  width: 100%;
  margin: 2px 0 10px;
  accent-color: #2ea8ff;
}
.watermark-preview-line {
  position: relative;
  min-height: 86px;
  border: 1px dashed rgba(140, 170, 200, .35);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.18);
  overflow: hidden;
}
.watermark-photo-preview {
  container-type: inline-size;
  aspect-ratio: 4 / 3;
  min-height: 0;
  max-height: 220px;
  border-style: solid;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,0) 34%),
    linear-gradient(160deg, rgba(51, 114, 155, .72), rgba(26, 44, 58, .95) 54%, rgba(8, 12, 18, .98));
}
.portfolio-watermark-card + .portfolio-main-btn {
  margin-top: 4px;
}
.watermark-photo-label {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: rgba(210, 224, 238, .38);
  font-size: .78rem;
  font-weight: 700;
  pointer-events: none;
}
.viewer-watermark {
  position: absolute;
  z-index: 3;
  --watermark-font-scale: 16;
  max-width: 94%;
  color: rgba(255,255,255,.86);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.viewer-watermark--small { --watermark-font-scale: 10; }
.viewer-watermark--medium { --watermark-font-scale: 16; }
.viewer-watermark--large { --watermark-font-scale: 24; }
@supports (font-size: 1cqw) {
  .viewer-watermark {
    font-size: clamp(10px, calc(var(--watermark-font-scale) * .42cqw), 180px);
  }
}
@supports not (font-size: 1cqw) {
  .viewer-watermark {
    font-size: clamp(10px, calc(var(--watermark-font-scale) * .08rem), 90px);
  }
}
.viewer-watermark--top_right { top: 8px; right: 8px; }
.viewer-watermark--bottom_right { right: 8px; bottom: 8px; }
.viewer-watermark--top_left { top: 8px; left: 8px; }
.viewer-watermark--bottom_left { left: 8px; bottom: 8px; }
.viewer-watermark--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.portfolio-viewers {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(90, 160, 230, .45);
}
.portfolio-viewer-row {
  display: block;
  padding: 12px 0 14px;
  border-bottom: 1px solid #2d70ba;
}
.portfolio-viewer-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
  align-items: start;
}
.portfolio-viewer-row--audience .portfolio-viewer-card-top {
  grid-template-columns: minmax(0, 1fr) 42px 104px;
}
.portfolio-viewer-main { min-width: 0; }
.portfolio-viewer-badge {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  max-width: 248px;
  min-height: 44px;
  border-radius: 999px;
  background: linear-gradient(160deg, #b3b3b3, #868686);
  overflow: hidden;
  box-shadow: inset 0 1px 8px rgba(255,255,255,.2), 0 2px 7px rgba(0,0,0,.35);
}
.portfolio-viewer-name-pill {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: 7px 14px 6px;
}
.portfolio-viewer-number {
  min-width: 72px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(145deg, #d2d2d2, #a9a9a9);
  color: #111;
  font-size: .9rem;
  font-weight: 700;
  box-shadow: inset 0 1px 8px rgba(255,255,255,.28), 0 1px 5px rgba(0,0,0,.32);
}
.portfolio-viewer-name {
  color: #101010;
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portfolio-viewer-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}
.portfolio-viewer-name-pill .portfolio-viewer-label {
  color: #101010;
  font-size: .82rem;
  line-height: 1.1;
  margin-top: 4px;
}
.portfolio-viewer-summary {
  display: grid;
  grid-template-columns: max-content max-content minmax(28px, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  padding-left: 14px;
}
.portfolio-viewer-summary-count {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
}
.portfolio-viewer-summary-count strong {
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
}
.portfolio-briefcase-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: none;
  stroke: #e8ecf0;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.55));
}
.portfolio-star {
  color: #f0f50f;
  font-size: .92rem;
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.portfolio-viewer-summary .portfolio-favorite-count {
  gap: 3px;
}
.portfolio-viewer-expand {
  justify-self: end;
  width: 30px;
  height: 28px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #d8dde2;
  cursor: pointer;
}
.portfolio-viewer-expand svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition: transform .16s ease;
}
.portfolio-viewer-chat {
  position: relative;
  align-self: center;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #dfe8ef;
  cursor: pointer;
}
.portfolio-viewer-chat svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.portfolio-viewer-chat:active { color: #2d8cff; }
.portfolio-viewer-chat:disabled { opacity: .5; }
.portfolio-viewer-chat-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  background: #ff4b5f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}
.portfolio-viewer-row:not(.is-collapsed) .portfolio-viewer-expand svg {
  transform: rotate(180deg);
}
.portfolio-access-toggle {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: end;
  align-content: start;
  gap: 1px;
  width: 104px;
  min-height: 104px;
  cursor: pointer;
}
.portfolio-favorite-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.portfolio-access-toggle input { display: none; }
.portfolio-access-switch {
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #8f9295;
  position: relative;
  box-shadow: inset 0 1px 5px rgba(0,0,0,.35);
}
.portfolio-access-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f4f5f6;
  box-shadow: 0 1px 5px rgba(0,0,0,.35);
  transition: transform .16s ease;
}
.portfolio-access-toggle input:checked + .portfolio-access-switch { background: #27a9dc; }
.portfolio-access-toggle input:checked + .portfolio-access-switch::after { transform: translateX(24px); }
.portfolio-access-title {
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.05;
}
.portfolio-access-state,
.portfolio-access-caption {
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.1;
}
.portfolio-access-switch { margin: 8px 0 9px; }
.portfolio-access-date {
  color: #fff;
  font-size: .7rem;
  line-height: 1.15;
}

.ref-summary {
  position: relative;
  padding: 14px;
  margin-bottom: 12px;
}
.ref-help-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #8c8f89;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ref-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0 34px 14px 0;
}
.ref-summary .portfolio-summary-value {
  color: #ffff00;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.08;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.ref-summary .portfolio-summary-value .stat-sep,
.ref-summary .portfolio-summary-value .stat-den {
  color: #b8bdc2;
}
.ref-summary .portfolio-summary-label {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  margin-top: 4px;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.ref-bonus-value {
  color: #ffff00;
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.ref-bonus-label {
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  margin-top: 4px;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.ref-progress-wrap {
  margin-top: 14px;
}
.ref-progress-bar {
  height: 6px;
  border: 1px solid rgba(45, 112, 186, .55);
  border-radius: 999px;
  background: rgba(10, 18, 26, .82);
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.45);
}
.ref-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f0a05e;
}
.ref-progress-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  margin-bottom: 0;
}
.ref-progress-mark {
  position: relative;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.ref-progress-mark b {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #050b10;
  background: #ffff00;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
.ref-progress-mark::after {
  content: "";
  position: absolute;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 11px solid #ffff00;
}
.ref-progress-mark.active b {
  background: #00b050;
}
.ref-progress-mark.active::after {
  border-top-color: #00b050;
}
.referral-copy-btn {
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px 0 46px;
}
.referral-copy-text {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  text-align: center;
}
.referral-link-icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  color: #d9dde0;
  cursor: pointer;
}
.referral-link-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.55));
}
.referral-title {
  color: #fff;
  font-size: 0.95rem;
  margin: 20px 22px 10px;
}
.referral-level-chips {
  margin-top: -2px;
}
.referral-list {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(90, 160, 230, .45);
}
.referral-row {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(84px, .46fr) minmax(88px, .52fr);
  grid-template-areas:
    "person direct total"
    "levels levels total";
  align-items: start;
  gap: 8px 10px;
  padding: 12px 0 14px;
  margin-bottom: 0;
  border-bottom: 1px solid #2d70ba;
}
.referral-person-pill,
.referral-levels {
  min-width: 0;
}
.referral-person-pill {
  grid-area: person;
  position: relative;
  display: flex;
  align-items: center;
  width: calc(100% + 20px);
  min-height: 52px;
  padding: 8px 58px 8px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a9a9a9, #838383);
  box-shadow: inset 0 1px 7px rgba(255,255,255,.42), 0 2px 6px rgba(0,0,0,.25);
  overflow: visible;
}
.referral-person-text {
  min-width: 0;
}
.referral-order {
  position: absolute;
  top: 0;
  right: -10px;
  width: 74px;
  height: 52px;
  border-radius: 999px;
  color: #111;
  background: linear-gradient(180deg, #d8d8d8, #b7b7b7);
  box-shadow: inset 0 1px 5px rgba(255,255,255,.7), 0 2px 5px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 700;
}
.referral-order b {
  color: inherit;
  font: inherit;
  line-height: 1;
}
.referral-order small {
  color: #686868;
  font-size: 0.48rem;
  font-weight: 500;
  line-height: 1.05;
  text-align: center;
}
.referral-direct-bonus,
.referral-date {
  color: #fff;
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.18;
}
.referral-direct-bonus {
  grid-area: direct;
  align-self: center;
  color: #f0f50f;
  font-size: 0.92rem;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
  transform: translateX(10px);
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.referral-name {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.18;
}
.referral-role-name {
  margin-top: 2px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.referral-total-mb {
  color: #f0f50f;
  font-size: 0.96rem;
  line-height: 1.1;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.referral-date {
  margin-top: 4px;
  color: #d0d0d0;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.referral-name {
  overflow-wrap: anywhere;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.referral-levels {
  grid-area: levels;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}
.referral-level-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.referral-level-line span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.12;
}
.referral-level-line b,
.referral-level-line em {
  color: #fff;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.12;
  white-space: nowrap;
}
.referral-level-line em {
  color: #f0f50f;
  grid-column: 3;
  text-align: center;
  transform: translateX(10px);
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.referral-total {
  grid-area: total;
  align-self: start;
  min-height: 64px;
  padding: 11px 8px 9px;
  border: 1px solid #2d70ba;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 116, 150, .52), transparent 58%),
    linear-gradient(180deg, #25364d 0%, #101923 100%);
  box-shadow: inset 0 1px 14px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.25);
  text-align: center;
}
.referral-total-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  text-transform: lowercase;
}
.ref-partner-help p {
  margin: 0 0 10px;
}

.partner-id-panel,
.partner-access-card {
  width: 100%;
  border: 1px solid rgba(47, 139, 239, .72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 116, 150, .5), transparent 62%),
    linear-gradient(180deg, #1d2938 0%, #10171f 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.24);
}
.partner-id-panel {
  min-height: 72px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.partner-id-panel span {
  color: var(--muted);
  font-size: .78rem;
}
.partner-id-panel b {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #f0f50f;
  font-size: 1rem;
  letter-spacing: 0;
}
.partner-id-panel small {
  color: #fff;
  font-size: .76rem;
}
.partner-access-card {
  margin-top: 10px;
  padding: 14px;
  text-align: center;
}
.partner-access-card p {
  margin: 0 0 12px;
  font-size: .86rem;
  line-height: 1.35;
}
.partner-access-actions {
  display: grid;
  gap: 10px;
}
.partner-access-actions .btn-secondary {
  margin: 0;
}
.partner-access-card > b {
  color: #f0f50f;
  font-size: .9rem;
}
.partner-access-progress {
  margin-top: 12px;
  color: var(--muted);
  font-size: .78rem;
}
.partner-summary {
  margin-top: 10px;
}
.partner-summary .partner-stats-grid {
  gap: 12px 14px;
  margin: 0;
  text-align: center;
}
.partner-money-card {
  margin-top: 10px;
  padding: 12px 0;
  border: 1px solid rgba(47, 139, 239, .72);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 116, 150, .38), transparent 64%),
    linear-gradient(180deg, #1d2938 0%, #10171f 100%);
  box-shadow: inset 0 1px 10px rgba(255,255,255,.06), 0 3px 10px rgba(0,0,0,.22);
}
.partner-money-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  text-align: center;
}
.partner-money-grid > div:first-child {
  grid-column: 1 / 3;
  grid-row: 1;
}
.partner-money-grid > div:nth-child(2) {
  grid-column: 2 / 4;
  grid-row: 1;
}
.partner-money-grid > div:last-child {
  grid-column: 3 / 5;
  grid-row: 1;
}
.partner-money-value {
  color: #f0f50f;
  font-size: 0.9rem;
  line-height: 1.1;
}
.partner-money-grid .portfolio-summary-label {
  margin-top: 5px;
}
.partner-copy-btn .referral-copy-text {
  color: #f0f50f;
}
.partner-action-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.partner-action-stack .portfolio-main-btn,
.partner-withdraw-btn {
  margin: 0;
}
.partner-referral-row {
  grid-template-columns: minmax(0, 1.22fr) minmax(84px, .46fr) minmax(88px, .52fr);
  grid-template-areas:
    "person direct total"
    "levels levels levels";
}
.partner-level-line {
  grid-template-columns: 42px 44px minmax(76px, 1fr) 38px minmax(64px, auto);
  gap: 8px;
}
.partner-level-line em {
  color: #fff;
  transform: none;
  text-align: left;
}
.partner-level-line i {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.12;
  white-space: nowrap;
  text-align: center;
}
.partner-level-line strong {
  color: #f0f50f;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.12;
  white-space: nowrap;
  text-align: left;
  text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.partner-referral-row .referral-total-mb {
  font-size: .86rem;
  white-space: nowrap;
}

.viewer-owner-header {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px; text-align: center;
}
.viewer-owner-header .vo-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.viewer-owner-header .vo-sub { font-size: 0.82rem; color: var(--muted); }

#page-sub > .hint { display: none; }
.sub-summary,
.sub-card {
  position: relative;
  border: 1px solid rgba(47, 139, 239, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 116, 150, .55), transparent 58%),
    linear-gradient(180deg, #192331 0%, #10171f 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,0.28);
  padding: 10px 12px;
  margin: 0 0 9px;
}
.sub-help-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.sub-summary-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
  text-align: center;
}
.sub-summary-paid {
  border-radius: 18px;
  border-color: rgba(57, 139, 239, .86);
  background:
    radial-gradient(circle at 50% 0%, rgba(91, 116, 65, .9), rgba(48, 66, 38, .76) 48%, rgba(8, 13, 18, .98) 100%),
    linear-gradient(180deg, #4e6336 0%, #182311 100%);
  box-shadow: inset 0 1px 18px rgba(180, 214, 110, .12), 0 5px 12px rgba(0,0,0,.28);
  padding: 18px 28px 16px;
}
.sub-summary-paid-head {
  margin-bottom: 18px;
  text-align: center;
}
.sub-summary-paid-head b {
  color: #d6df2d;
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.15;
}
.sub-summary-paid-head span {
  color: rgba(226, 231, 238, .64);
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 3px;
}
.sub-summary-paid-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: 34px;
  align-items: start;
}
.sub-summary-paid-grid b {
  color: #d6df2d;
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}
.sub-summary-paid-grid em {
  color: #fff;
  display: block;
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 7px;
  white-space: nowrap;
}
.sub-summary-paid-grid small {
  color: rgba(226, 231, 238, .72);
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 5px;
}
.sub-memory-breakdown-toggle {
  width: 36px;
  height: 28px;
  margin: 12px auto 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sub-memory-breakdown-toggle .stats-collapse-chevron {
  width: 16px;
  height: 16px;
  border-left-width: 5px;
  border-top-width: 5px;
}
.sub-memory-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 231, 238, .16);
}
.sub-memory-breakdown-item b {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.sub-memory-breakdown-item small {
  display: block;
  color: rgba(226, 231, 238, .68);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 4px;
}
.sub-memory-breakdown-item.is-total b {
  color: #d6df2d;
}
.sub-summary-title b,
.sub-grid b,
.sub-card h3,
.sub-line b,
.sub-memory b,
.sub-price {
  color: #ffff00;
  font-weight: 600;
}
.sub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sub-grid b {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}
.sub-details {
  border: 1px solid rgba(47, 139, 239, 0.58);
  border-radius: 8px;
  background: rgba(14, 22, 31, .86);
  color: rgba(226, 231, 238, .86);
  font-size: 0.88rem;
  line-height: 1.38;
  padding: 10px 12px;
  margin: 0 0 9px;
}
.sub-details p {
  margin: 0 0 9px;
}
.sub-details p:last-child {
  margin-bottom: 0;
}
.sub-grid small,
.sub-card p,
.sub-line span,
.sub-small,
.sub-history-row small,
.sub-grid em,
.sub-range,
.sub-state {
  color: rgba(226, 231, 238, 0.78);
  font-size: 0.74rem;
  line-height: 1.25;
  font-style: normal;
  display: block;
}
.sub-card h3 {
  font-size: 0.88rem;
  line-height: 1.2;
  margin: 0 0 8px;
  text-align: center;
}
.sub-card p {
  margin: 6px 0 8px;
}
.sub-card-accent {
  border-color: rgba(170, 70, 255, 0.9);
}
.sub-tariff-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 9px;
}
.sub-tariff-card {
  min-width: 0;
  border: 1px solid rgba(57, 139, 239, 0.82);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 58%, rgba(96, 125, 160, .58), rgba(35, 48, 65, .82) 42%, rgba(10, 15, 21, .98) 78%),
    linear-gradient(180deg, #101820 0%, #182230 55%, #33465c 100%);
  box-shadow: inset 0 1px 22px rgba(45, 140, 255, .16), 0 5px 12px rgba(0,0,0,.25);
  padding: 16px 18px 16px;
  text-align: left;
}
.sub-tariff-card.is-active { border-color: rgba(57, 139, 239, 0.82); }
.sub-tariff-card.is-current-active {
  border-color: rgba(139, 195, 74, .92);
  background:
    radial-gradient(circle at 40% 58%, rgba(102, 124, 70, .72), rgba(48, 65, 36, .82) 45%, rgba(10, 15, 21, .98) 82%),
    linear-gradient(180deg, #101820 0%, #182230 55%, #4f6038 100%);
}
.sub-tariff-paid {
  background:
    radial-gradient(circle at 50% 58%, rgba(144, 72, 210, .62), rgba(54, 41, 92, .76) 43%, rgba(10, 15, 21, .98) 78%),
    linear-gradient(180deg, #101820 0%, #182230 55%, #33465c 100%);
}
.sub-tariff-paid.is-paid-active {
  background:
    radial-gradient(circle at 40% 58%, rgba(102, 124, 70, .72), rgba(48, 65, 36, .82) 45%, rgba(10, 15, 21, .98) 82%),
    linear-gradient(180deg, #101820 0%, #182230 55%, #4f6038 100%);
}
.sub-tariff-card h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 14px;
  text-align: center;
}
.sub-tariff-title {
  position: relative;
  padding: 0 64px;
}
.sub-active-pill {
  position: absolute;
  top: 1px;
  right: 0;
  color: #d6df2d;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: lowercase;
}
.sub-memory-line {
  color: #fff;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 12px 4px;
}
.sub-memory-added {
  color: #d6df2d;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 6px 0 0;
  text-align: center;
  white-space: nowrap;
}
.sub-price {
  margin: 18px 0 10px;
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 4px #000;
}
.sub-tariff-card .sub-range {
  color: rgba(226, 231, 238, .68);
  font-size: 0.82rem;
  margin: 0 12px;
}
.sub-pay-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(57, 139, 239, .9);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  text-shadow: 0 1px 3px #000;
  background:
    radial-gradient(circle at 50% 20%, rgba(95, 122, 155, .9), rgba(36, 48, 64, .86) 48%, rgba(8, 13, 18, .98) 100%);
  box-shadow: inset 0 1px 12px rgba(255,255,255,.18), 0 4px 10px rgba(0,0,0,.35);
}
.sub-pay-btn-secondary {
  background:
    radial-gradient(circle at 50% 20%, rgba(95, 122, 155, .9), rgba(36, 48, 64, .86) 48%, rgba(8, 13, 18, .98) 100%);
  border-color: rgba(47, 139, 239, .82);
}
.sub-pay-btn:disabled {
  opacity: 1;
}
.sub-infinity-mark {
  display: inline-block;
  margin-left: 6px;
  font-size: 1.28em;
  line-height: 0.8;
  vertical-align: -0.06em;
}
.sub-paid-top {
  display: grid;
  grid-template-columns: 1fr minmax(128px, 174px);
  gap: 10px;
  align-items: start;
  margin-top: 2px;
}
.sub-paid-features {
  color: #fff;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 4px 12px 0;
  text-shadow: 0 2px 4px #000;
}
.sub-pack-wrap {
  min-width: 0;
}
.sub-pack-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  align-items: center;
}
.sub-pack-btn {
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(57, 139, 239, .9);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  background:
    radial-gradient(circle at 50% 20%, rgba(105, 123, 80, .95), rgba(40, 51, 35, .86) 48%, rgba(8, 13, 18, .98) 100%);
  box-shadow: inset 0 1px 12px rgba(255,255,255,.16), 0 4px 10px rgba(0,0,0,.35);
}
.sub-pack-btn:disabled {
  opacity: 1;
}
.sub-memory-warning {
  color: #ffcc66;
  font-size: 0.82rem;
  line-height: 1.3;
  margin: 8px 12px 0;
  text-shadow: 0 2px 4px #000;
}
.sub-due-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 18px;
}
.sub-due-row span {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
}
.sub-due-row b {
  color: #ffff00;
  font-size: 1.08rem;
  font-weight: 500;
  text-shadow: 0 2px 4px #000;
}
.sub-due-row b em,
.sub-daily-price {
  color: rgba(226, 231, 238, .74);
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
  text-align: center;
  text-shadow: 0 2px 4px #000;
}
.sub-extra-note {
  color: #ffff00;
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 10px 12px 14px;
  text-shadow: 0 2px 4px #000;
}
.sub-extra-amount {
  color: #ffff00;
  font-size: 1.08rem;
  line-height: 1.2;
  margin: 0 0 14px;
  text-align: center;
  text-shadow: 0 2px 4px #000;
}
.sub-memory-buy {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  align-items: center;
}
.sub-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0;
}
.sub-line b {
  font-size: 0.92rem;
}
.sub-history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(47, 139, 239, 0.35);
  padding: 8px 0;
}

/* ─── МОДАЛ ──────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: #000a; z-index: 300;
  display: flex; align-items: flex-end; padding: 16px;
}
.modal.hidden { display: none !important; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; width: 100%; max-width: 480px; margin: 0 auto;
}
.modal-box p { margin-bottom: 16px; line-height: 1.5; white-space: pre-line; }
.modal-box .modal-extra { margin-bottom: 14px; }

/* ─── УТИЛИТЫ ────────────────────────────────────────────── */
.hint { color: var(--muted); font-size: 0.88rem; margin-bottom: 12px; line-height: 1.5; }
.error { color: var(--red); font-size: 0.85rem; margin-top: 6px; }
.section-block .muted { color: var(--muted); font-size: 0.85rem; }
code { background: #1e2d3d; padding: 1px 5px; border-radius: 4px; font-size: .88em; }

/* ─── SPINNER ────────────────────────────────────────────── */
.spinner { text-align: center; padding: 40px 0; color: var(--muted); font-size: 0.9rem; }

/* ─── КНОПКИ СТАТУСА В РЕДАКТОРЕ ────────────────────────── */
.status-btn-group { display: flex; gap: 8px; }
.status-toggle {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  text-align: center;
}
.status-toggle[data-status="draft"].active {
  background: #1a2d14; border-color: #6aaa3a; color: #8bc34a;
}
.status-toggle[data-status="ready"].active {
  background: #1f1f2e; border-color: #5a6a8a; color: var(--text);
}

/* ─── FULLSCREEN МЕДИА ───────────────────────────────────── */
.media-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 12px;
  touch-action: none; /* отдаём свайп нашему обработчику */
  user-select: none;
}
.media-fullscreen.hidden { display: none !important; }
.media-fullscreen.is-document { touch-action: pan-y pinch-zoom; }
.mf-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 501;
}
.mf-media {
  max-width: 100vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.mf-media.is-document {
  align-items: stretch;
  width: 100%;
  height: 82vh;
  max-height: 82vh;
}
.document-preview-pages {
  --document-zoom: 1;
  width: 100%;
  height: 100%;
  padding: 48px 4px 20px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  cursor: zoom-in;
}
.document-preview-pages.is-zoomed { cursor: zoom-out; }
.portfolio-pdf-single-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 42px 18px;
}
.portfolio-pdf-single-page .document-preview-page-slot {
  width: 100%;
  max-width: 1100px;
  min-height: 0;
  margin: auto;
}
.media-fullscreen.portfolio-pdf-viewer .mf-actions {
  z-index: 502;
}
.media-fullscreen.portfolio-pdf-viewer .mf-dl {
  min-width: 132px;
}
.document-preview-page-slot {
  width: 100%;
  max-width: 1400px;
  min-height: 55vh;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.document-preview-page-slot[data-loaded="1"] { min-height: 0; }
.document-preview-pages.is-zoomed .document-preview-page-slot {
  margin-left: 0;
  margin-right: 0;
}
.mf-media .document-preview-page {
  display: block;
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
  transform: none;
  touch-action: auto;
  cursor: default;
}
.document-preview-loading,
.document-preview-error {
  margin: auto;
  padding: 20px;
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
}
.mf-media img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transform-origin: center center;
  transition: transform .12s ease;
  touch-action: none;
  cursor: zoom-in;
}
.mf-media img.is-zoomed {
  cursor: grab;
  transition: none;
}
.mf-media video {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-sm);
}
.mf-loader {
  position: absolute;
  inset: 0;
  min-width: 160px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #d8dde2;
  background: rgba(15,20,25,.72);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.mf-loader.hidden { display: none !important; }
.mf-loader-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #f0f50f;
  animation: spin .85s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.mf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2.2rem;
  width: 44px;
  height: 72px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 502;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.mf-prev { left: 6px; }
.mf-next { right: 6px; }
.mf-nav.hidden { display: none !important; }
.mf-actions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.mf-counter { color: rgba(255,255,255,0.55); font-size: 0.85rem; min-width: 36px; text-align: center; }
.mf-dl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mf-dl.hidden { display:none !important; }
.mf-zoom-btn {
  min-width: 42px;
  padding-inline: 13px;
  font-size: 1.25rem;
}
.mf-main-btn {
  border-color:#f0f50f;
  color:#f0f50f;
  background:rgba(240,245,15,.08);
}
.media-overlay-notice {
  position:absolute;
  left:50%;
  bottom:82px;
  transform:translateX(-50%);
  padding:8px 14px;
  border-radius:12px;
  background:rgba(10, 15, 21, .86);
  border:1px solid rgba(240,245,15,.65);
  color:#f0f50f;
  font-size:.88rem;
  font-weight:700;
  opacity:0;
  pointer-events:none;
  z-index:504;
  transition:opacity .12s ease;
  white-space:nowrap;
}
.media-overlay-notice.show { opacity:1; }

/* Multi-portfolio workspace */
.portfolio-overview-head {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 10px;
  padding: 24px 18px 20px;
  border: 1px solid #397bbb;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #101820, #42546b);
  box-shadow: inset 0 1px 8px rgba(255,255,255,.08);
}
.portfolio-overview-help {
  position: absolute;
  top: 10px;
  right: 10px;
}
.portfolio-overview-stat {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  text-align: center;
}
.portfolio-overview-stat strong {
  color: #f0f50f;
  font-size: 1.12rem;
}
.portfolio-overview-stat span {
  margin-top: 2px;
  color: #c5cdd5;
  font-size: .78rem;
}
.portfolio-overview-stat--views strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.portfolio-overview-stat--views .portfolio-overview-eye {
  width: 22px;
  height: 22px;
}
.portfolio-overview-eye {
  width: 24px;
  height: 24px;
  color: #e8ecf0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.55));
}
.portfolio-overview-eye circle {
  fill: currentColor;
  stroke: none;
}
.portfolio-new-btn {
  margin-bottom: 14px;
  border-color: #d4cec2;
  background: linear-gradient(145deg, #181714, #756f67);
}
.portfolio-list-grid {
  display: grid;
  gap: 14px;
}
.portfolio-list-card,
.portfolio-detail-card,
.portfolio-settings-mode-card {
  border: 1px solid #397bbb;
  border-radius: 24px;
  background: linear-gradient(145deg, #334968, #121a24);
  box-shadow: inset 0 1px 10px rgba(255,255,255,.08);
}
.portfolio-list-card {
  padding: 20px 14px 14px;
  cursor: pointer;
}
.portfolio-list-card-head,
.portfolio-detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.portfolio-list-card h2,
.portfolio-detail-card h1 {
  margin: 0;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 500;
}
.portfolio-list-card-head strong,
.portfolio-detail-title-row strong {
  color: #f0f50f;
  font-size: .88rem;
}
.portfolio-list-card-head strong span { color: #f0f50f; }
.portfolio-list-resume {
  display: grid;
  justify-items: end;
  gap: 4px;
  cursor: pointer;
  text-align: right;
}
.portfolio-list-resume input { display: none; }
.portfolio-list-resume input:checked + .portfolio-access-switch {
  background: #27a9dc;
}
.portfolio-list-resume input:checked + .portfolio-access-switch::after {
  transform: translateX(24px);
}
.portfolio-list-resume em {
  color: #b6c2cf;
  font-size: .74rem;
  font-style: normal;
  line-height: 1.15;
}
.portfolio-list-audience,
.portfolio-detail-audience {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  color: #f0f50f;
  font-size: 1rem;
}
.portfolio-audience-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: #d8dde2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.portfolio-list-actions,
.portfolio-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.portfolio-list-actions {
  grid-template-columns: 1fr;
  margin-top: 12px;
}
.portfolio-list-actions .btn-secondary,
.portfolio-detail-actions .btn-secondary {
  min-width: 0;
  padding-inline: 10px;
}
.portfolio-empty-state {
  padding: 30px 18px;
  border: 1px dashed #397bbb;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.portfolio-empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
}
.portfolio-detail-card {
  padding: 22px 14px 18px;
}
.portfolio-detail-description {
  margin: 12px 0;
  color: #e7ebef;
  font-style: italic;
  white-space: pre-wrap;
}
.portfolio-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 14px;
}
.portfolio-detail-stats > div {
  display: grid;
}
.portfolio-detail-stats strong {
  color: #f0f50f;
  font-size: 1.05rem;
}
.portfolio-detail-stats span {
  color: #b6c2cf;
  font-size: .76rem;
}
.portfolio-detail-actions { margin-bottom: 12px; }
.portfolio-pdf-btn {
  margin-bottom: 12px;
}
.portfolio-pdf-btn.is-locked {
  color: #aebbc7;
  border-color: #405266;
}

@media (max-width: 480px) {
  .portfolio-pdf-single-page {
    padding-inline: 34px;
  }
}
.portfolio-projects-detail-title { margin-top: 20px; }
.portfolio-settings-mode-card {
  margin-top: 16px;
  padding: 18px 14px;
}
.portfolio-settings-mode-card p {
  margin-bottom: 18px;
  color: #dfe5eb;
  font-size: .86rem;
}
.portfolio-settings-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.portfolio-settings-mode-options button {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 3px;
  border: 0;
  background: transparent;
  color: #dfe5eb;
  font: inherit;
  font-size: .76rem;
  cursor: pointer;
}
.portfolio-mode-indicator {
  width: 58px;
  height: 30px;
  border-radius: 999px;
  background: #a8a197;
  box-shadow: inset 0 1px 5px rgba(0,0,0,.4);
}
.portfolio-settings-mode-options button.active .portfolio-mode-indicator {
  background: #27a9dc;
  box-shadow: 0 0 0 2px rgba(240,245,15,.85), inset 0 1px 5px rgba(0,0,0,.35);
}
.portfolio-viewer-portfolios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 10px 10px 0;
  padding: 18px 26px 16px;
  border: 1px solid rgba(93,121,143,.72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 24% 8%, rgba(138,130,117,.9), rgba(74,69,61,.88) 38%, rgba(22,22,21,.98) 88%),
    linear-gradient(145deg, #777065, #171716);
  color: #fff;
  box-shadow: inset 0 1px 12px rgba(255,255,255,.09);
  transition: opacity .14s ease, transform .14s ease;
}
.portfolio-viewer-row.is-collapsed .portfolio-viewer-portfolios {
  display: none;
}
.portfolio-viewer-detail-metric {
  min-width: 0;
}
.portfolio-viewer-detail-metric > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}
.portfolio-viewer-detail-metric strong {
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
}
.portfolio-viewer-detail-metric > span {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: .76rem;
  line-height: 1.35;
}
.portfolio-briefcase-icon--detail {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}
.portfolio-viewer-portfolios ul {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  color: #f0f50f;
  font-size: .76rem;
  line-height: 1.55;
  list-style: none;
}
.portfolio-viewer-portfolio-title::before {
  content: "- ";
}
.portfolio-viewer-portfolios li {
  overflow-wrap: anywhere;
}
.portfolio-viewer-portfolios .portfolio-viewer-portfolio-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.portfolio-viewer-portfolio-title {
  min-width: 0;
}
.portfolio-viewer-portfolio-status {
  flex: 0 0 auto;
  color: #c6d3df;
  font-size: .68rem;
  text-align: right;
}
.portfolio-viewer-portfolio-item.is-closed .portfolio-viewer-portfolio-status {
  color: #ff8b91;
}
.portfolio-viewer-portfolios .portfolio-viewer-no-access {
  color: #b6c2cf;
}
.portfolio-viewer-portfolios .portfolio-viewer-no-access::before {
  content: "";
}
button.portfolio-access-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
button.portfolio-access-toggle .portfolio-access-switch.is-on {
  background: #27a9dc;
}
button.portfolio-access-toggle .portfolio-access-switch.is-on::after {
  transform: translateX(24px);
}

@media (max-width: 380px) {
  .portfolio-list-actions,
  .portfolio-detail-actions {
    grid-template-columns: 1fr;
  }
  .portfolio-viewer-card-top {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
  }
  .portfolio-viewer-row--audience .portfolio-viewer-card-top {
    grid-template-columns: minmax(0, 1fr) 38px 92px;
  }
  .portfolio-viewer-badge {
    min-height: 44px;
  }
  .portfolio-viewer-number {
    min-width: 72px;
    padding-inline: 10px;
  }
  .portfolio-viewer-name-pill {
    padding-left: 14px;
  }
  .portfolio-viewer-summary {
    gap: 9px;
    padding-left: 14px;
  }
  .portfolio-access-toggle {
    width: 92px;
  }
  .portfolio-viewer-chat {
    width: 38px;
    padding-inline: 5px;
  }
  .portfolio-viewer-portfolios {
    margin-inline: 2px;
    padding-inline: 16px;
    gap: 10px 12px;
  }
  .portfolio-viewer-portfolios .portfolio-viewer-portfolio-item {
    gap: 8px;
  }
  .portfolio-viewer-portfolio-status {
    font-size: .64rem;
  }
}
.btn-chats{position:relative}.chat-icon{font-size:25px;line-height:1}.chat-unread-badge{position:absolute;right:0;top:1px;min-width:17px;height:17px;padding:0 4px;border-radius:10px;background:#ff4b5f;color:#fff;font-size:10px;font-weight:800;line-height:17px;text-align:center}
.chat-list{display:flex;flex-direction:column;gap:8px;padding:12px 0}.chat-list-item{width:100%;display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border:1px solid #24445f;border-radius:15px;background:#111b24;color:#fff;text-align:left}.chat-list-avatar{display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:linear-gradient(145deg,#d9d9d9,#777);color:#111;font-weight:800}.chat-list-copy{display:flex;min-width:0;flex-direction:column;gap:5px}.chat-list-copy b,.chat-list-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-list-copy small,.chat-list-meta small{color:#8fa7bd}.chat-list-meta{display:flex;align-items:flex-end;flex-direction:column;gap:7px}.chat-list-meta b{display:grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border-radius:12px;background:#2f92f5;font-size:12px}.chat-empty{padding:50px 20px;text-align:center;color:#8fa7bd}
.page-chat{padding-bottom:88px}#chatViewerCard{position:sticky;top:var(--chat-sticky-top,60px);z-index:20;background:#0c1319;transition:box-shadow .16s ease}#chatViewerCard .chat-viewer-card{margin:0;padding-top:12px;transition:padding .16s ease}#chatViewerCard .portfolio-viewer-portfolios{margin-bottom:8px}#chatViewerCard.is-scroll-compact{box-shadow:0 10px 18px rgba(0,0,0,.4)}#chatViewerCard.is-scroll-compact .chat-viewer-card{padding-top:6px;padding-bottom:7px}#chatViewerCard.is-scroll-compact .portfolio-viewer-portfolios{display:none}
.chat-messages{display:flex;min-height:280px;overflow:visible;flex-direction:column;gap:8px;padding:5px 2px 16px}.chat-message{max-width:82%;padding:9px 11px;border-radius:15px;color:#fff;overflow-wrap:anywhere}.chat-message.is-mine{align-self:flex-end;border-bottom-right-radius:4px;background:#247ed0}.chat-message.is-theirs{align-self:flex-start;border-bottom-left-radius:4px;background:#273746}.chat-message small{display:block;margin-top:4px;color:#d3dfeb;font-size:10px;text-align:right}.chat-message-photo{display:block;max-width:100%;max-height:330px;margin-bottom:7px;border-radius:10px;object-fit:contain}
.chat-composer{position:fixed;z-index:8;right:10px;bottom:max(8px,env(safe-area-inset-bottom));left:10px;display:grid;grid-template-columns:42px minmax(0,1fr) 42px;gap:7px;align-items:end;padding:8px;border:1px solid #2a465e;border-radius:18px;background:#17232e}.chat-composer textarea{min-height:39px;max-height:100px;resize:none;border:0;background:#22313f;color:#fff}.chat-photo-button,.chat-send-button{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:50%;background:#2e8cf0;color:#fff;font-size:19px}.chat-photo-name{grid-column:1/-1;color:#8ebbe4;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
