.client-topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.client-topbar .brand { justify-self: center; }
.client-topbar .top-action:first-child { justify-self: start; }
.client-topbar .top-action-group { justify-self: end; }
.top-action { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 700; }
.client-heading { margin: 4px 0 6px; font-size: clamp(32px, 8vw, 42px); line-height: 1.05; letter-spacing: -1.2px; }
.client-subtitle { margin: 0 0 18px; color: var(--muted); font-size: 16px; }
.tariff-card, .limit-card { padding: 20px; }
.tariff-head { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 15px; }
.tariff-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 16px; background: linear-gradient(145deg, #0a6cff, #0e49d8); color: white; font-size: 28px; box-shadow: 0 12px 26px rgba(0,90,255,.32); }
.tariff-label { color: var(--muted); font-size: 14px; }
.tariff-name { margin-top: 3px; font-size: 26px; font-weight: 800; }
.date-list { display: grid; gap: 13px; margin: 20px 0; }
.date-row { display: flex; justify-content: space-between; gap: 12px; }
.date-row span:first-child { color: var(--muted); }
.limit-card { margin-top: 14px; }
.limit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.limit-value { font-size: 29px; font-weight: 800; }
.limit-label { color: var(--muted); font-size: 12px; }
.control-heading { margin: 28px 0 13px; font-size: 22px; }
.control-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.control-card { border: 1px solid var(--border); border-radius: 17px; padding: 18px; background: var(--surface); text-align: left; cursor: pointer; }
.control-title { color: var(--muted); }
.control-count { margin-top: 10px; font-size: 34px; font-weight: 800; }
.control-card.blue { border-color: rgba(36,130,255,.35); }
.control-card.orange { border-color: rgba(255,138,22,.35); }
.control-card.purple { border-color: rgba(181,76,255,.35); }
.control-card.green { border-color: rgba(47,208,90,.35); }
.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 30; transform: translateX(-50%); width: min(100%, 560px); display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 14px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 91%, transparent); backdrop-filter: blur(22px); }
.nav-button { display: grid; justify-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.nav-button .nav-icon { font-size: 22px; }
.nav-button.active { color: var(--blue); }
.documents-list { display: grid; gap: 11px; }
.document-card { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; }
.file-icon {
  --file-accent: #8da2c7;
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 56px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--file-accent) 24%, #162238);
  border-radius: 12px;
  background: linear-gradient(145deg, #121c30 0%, #07101f 72%, #050b15 100%);
  color: var(--file-accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 0 18px color-mix(in srgb, var(--file-accent) 8%, transparent),
    0 7px 16px rgba(0,0,0,.20);
  flex-shrink: 0;
}
.file-icon::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--file-accent) 15%, transparent), transparent 72%);
  pointer-events: none;
}
.file-icon-art {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--file-accent) 82%, transparent));
}
.file-icon-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 31px;
  transform: translateX(-50%);
  max-width: 38px;
  color: currentColor;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.25px;
  text-align: center;
  text-shadow: 0 0 6px color-mix(in srgb, var(--file-accent) 90%, transparent);
}
.file-icon-image .file-icon-label { top: 38px; font-size: 7px; }
.file-icon-pdf { --file-accent: #ff4458; }
.file-icon-document { --file-accent: #3385ff; }
.file-icon-sheet { --file-accent: #2fd35d; }
.file-icon-image { --file-accent: #3a8cff; }
.file-icon-archive { --file-accent: #ff9f2f; }
.file-icon-generic { --file-accent: #a78bfa; }

/* Иконки файлов автоматически подстраиваются под выбранную тему. */
:root[data-theme="light"] .file-icon {
  border-color: color-mix(in srgb, var(--file-accent) 34%, rgba(40, 76, 120, .16));
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--file-accent) 9%, #ffffff) 0%,
      #f7faff 62%,
      #eaf1fa 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .96),
    inset 0 0 16px color-mix(in srgb, var(--file-accent) 6%, transparent),
    0 5px 13px rgba(43, 79, 122, .13);
}
:root[data-theme="light"] .file-icon::after {
  background: radial-gradient(
    circle at 50% 45%,
    color-mix(in srgb, var(--file-accent) 11%, transparent),
    transparent 72%
  );
}
:root[data-theme="light"] .file-icon-art {
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--file-accent) 36%, transparent));
}
:root[data-theme="light"] .file-icon-label {
  text-shadow: 0 0 3px color-mix(in srgb, var(--file-accent) 28%, transparent);
}

:root[data-theme="dark"] .file-icon {
  border-color: color-mix(in srgb, var(--file-accent) 24%, #162238);
  background: linear-gradient(145deg, #121c30 0%, #07101f 72%, #050b15 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 0 18px color-mix(in srgb, var(--file-accent) 8%, transparent),
    0 7px 16px rgba(0,0,0,.20);
}
.document-name { font-weight: 700; overflow-wrap: anywhere; }
.document-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.filter-button { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; padding: 9px 12px; background: var(--surface-soft); color: var(--muted); cursor: pointer; }
.filter-button.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.profile-card { padding: 20px; }
.profile-title { display: flex; align-items: center; gap: 14px; }
.profile-avatar { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(145deg,var(--blue),var(--blue-2)); color: white; font-size: 24px; font-weight: 800; }
.profile-list { display: grid; gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; }
.profile-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px; background: var(--surface-soft); }
.profile-row span { color: var(--muted); }
.settings-grid { display: grid; gap: 12px; margin-top: 14px; }
.password-panel { padding: 20px; margin-top: 15px; }
.password-panel h2 { margin-top: 0; }
.login-brand { justify-content: center; }
.telegram-note { display: none; margin: 12px 0 0; padding: 11px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); font-size: 13px; }
.in-telegram .telegram-note { display: block; }
@media (max-width: 430px) {
  .document-card { grid-template-columns: 45px 1fr; }
  .document-card .badge { grid-column: 2; justify-self: start; }
}


/* Карточка документа и подробная шкала 1–6 */
.document-card { cursor: pointer; font: inherit; }
.document-card:hover { border-color: color-mix(in srgb, var(--blue) 55%, var(--border)); }
.document-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); outline-offset: 2px; }
.document-step-preview { margin-top: 5px; color: var(--blue); font-size: 12px; font-weight: 700; }
.back-action { white-space: nowrap; }
.document-detail-page { padding-bottom: 118px; }
.document-summary-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px; }
.detail-file-icon { width: 58px; height: 68px; border-radius: 14px; }
.detail-file-icon .file-icon-art { width: 41px; height: 48px; }
.detail-file-icon .file-icon-label { top: 38px; font-size: 9px; }
.detail-file-icon.file-icon-image .file-icon-label { top: 48px; font-size: 8px; }
.document-summary-copy { min-width: 0; }
.detail-document-name { font-size: 19px; }
.document-current-step { margin-top: 7px; color: var(--blue); font-size: 13px; font-weight: 800; }
.steps-timeline { display: grid; margin-top: 26px; padding: 0 6px; }
.timeline-step { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 15px; min-height: 104px; }
.timeline-rail { display: grid; grid-template-rows: 52px 1fr; justify-items: center; min-height: 100%; }
.step-marker { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 20px; font-weight: 800; line-height: 1; box-sizing: border-box; }
.step-connector { width: 3px; min-height: 48px; border-radius: 3px; background: var(--border); }
.step-copy { padding: 9px 0 25px; }
.step-number-label { margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.step-title { color: var(--muted); font-size: 18px; font-weight: 750; line-height: 1.25; }
.timeline-step.completed .step-marker { border-color: var(--blue); background: var(--blue); color: #fff; }
.timeline-step.completed .step-connector { background: var(--blue); }
.timeline-step.completed .step-number-label,
.timeline-step.completed .step-title { color: var(--text); }
.timeline-step.active .step-marker { border-color: var(--blue); background: var(--surface); color: var(--blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 14%, transparent); }
.timeline-step.active .step-connector { background: linear-gradient(to bottom, var(--blue) 0 30%, var(--border) 30% 100%); }
.timeline-step.active .step-number-label { color: var(--blue); }
.timeline-step.active .step-title { color: var(--text); font-weight: 850; }
.sync-note { margin: 15px 0 4px; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 430px) {
  .document-summary-card { grid-template-columns: 52px minmax(0, 1fr); }
  .document-summary-card .badge { grid-column: 2; justify-self: start; }
  .timeline-step { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .step-title { font-size: 17px; }
}


/* 2.3.3: кнопка обновления Mini App */
.top-action-group { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.top-action-group .icon-button { width: 40px; height: 40px; }
@keyframes p24-app-refresh-spin { to { transform: rotate(360deg); } }


/* 2.3.3 FIX1: заметная кнопка «Обновить» Mini App */
.mini-refresh-button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 0 9px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--blue); cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.mini-refresh-button:hover { background: var(--surface-soft); }
.mini-refresh-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; transform-origin: 50% 50%; }
.mini-refresh-button.is-refreshing .mini-refresh-icon { animation: p24-app-refresh-spin .65s linear infinite; }
.mini-refresh-button:disabled { opacity: .7; cursor: wait; }
@media (max-width: 420px) {
  .mini-refresh-button { padding: 0 7px; gap: 4px; font-size: 11px; }
  .client-topbar { grid-template-columns: auto 1fr auto; }
  .client-topbar .brand-copy span { display: none; }
}

/* 2.3.5: вращается только иконка, кнопка остаётся неподвижной */
.mini-refresh-button.is-refreshing { transform: none !important; animation: none !important; }


/* P24_CLIENT_DOCUMENT_WORKFLOW_MINIAPP_STYLE_2_4_19 */
.mini-documents-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.step-date{font-size:12px;color:var(--muted);margin-top:6px}


/* P24_MINIAPP_SECTION_VISIBILITY_STYLES_2_5_41 */
.mini-dev-dot{margin-left:3px;color:#f59e0b;font-size:8px}.mini-feature-development{text-align:center;padding:46px 18px;margin:20px}.mini-feature-development>div{font-size:32px}.mini-feature-development h1{margin:8px 0}.mini-feature-development span{display:inline-flex;padding:5px 10px;border-radius:999px;background:rgba(245,158,11,.15);color:#d97706;font-weight:800}.mini-feature-development p{color:var(--muted)}

/* P24_MINIAPP_FEATURE_TREE_STYLES_2_5_42 */


/* P24_MINIAPP_SCOPED_DEVELOPMENT_STYLES_2_5_44 */
.mini-dev-dot{color:#d97706}

/* P24_MINIAPP_BRAND_LOGO_3_1_5 */
.auth-page { grid-template-columns: minmax(0, 1fr); }
.auth-card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
}
.miniapp-brand-logo {
  display: block;
  position: relative;
  overflow: hidden;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 0;
  background: transparent;
}
.miniapp-brand-logo .p24-site-brand-image {
  position: absolute;
  left: -24.4%;
  top: -21.3%;
  width: 138.5%;
  height: 138.5%;
  max-width: none;
  object-fit: contain;
  object-position: center;
}
.client-topbar .miniapp-brand-logo {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}
.login-brand {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.login-brand .miniapp-auth-logo {
  width: 96px;
  height: 96px;
  flex-basis: 96px;
}
.login-brand .brand-copy strong { font-size: 20px; }
.login-brand .brand-copy span { margin-top: 5px; }
.auth-logo:not(.login-brand) .miniapp-auth-logo {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
}
@media (max-width: 430px) {
  .client-topbar .miniapp-brand-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
  .login-brand .miniapp-auth-logo {
    width: 84px;
    height: 84px;
    flex-basis: 84px;
  }
}
