/* ============================================================
   likos ai — App CSS
   Воронка генерации + Admin Panel
   Подключается после style.css
   ============================================================ */


/* ============================================================
   APP HEADER (шапка внутри воронки, не лендинг)
   ============================================================ */

/* На app-страницах шапка всегда с blur (не зависит от скролла) */
.app-body .header {
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 12, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 12px;
}

.app-logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.app-logo .logo-main { color: var(--text-primary); }
.app-logo .logo-ai   { color: var(--accent); }

.app-header-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}

.app-header-balance svg { color: var(--accent); flex-shrink: 0; }

.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ============================================================
   STEP PROGRESS BAR
   ============================================================ */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 20px 0;
  max-width: 680px;
  margin: 0 auto 16px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}

.step-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.step-dot.done {
  background: var(--accent);
  opacity: 0.45;
}

.step-connector {
  flex: 1;
  max-width: 48px;
  height: 1px;
  background: var(--border);
}

.step-connector.done {
  background: var(--accent);
  opacity: 0.3;
}

.step-connector.loading {
  position: relative;
  overflow: hidden;
  background: var(--border);
  opacity: 1;
}
.step-connector.loading::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: step-connector-sweep 1.4s ease-in-out infinite;
}
@keyframes step-connector-sweep {
  0%   { left: -100%; }
  50%  { left: 0%; }
  100% { left: 100%; }
}


/* ============================================================
   PAGE WRAP — контейнер страниц воронки
   ============================================================ */
.app-page {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}


.app-content {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 20px 40px; /* Reduced top padding */
}

.app-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.app-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}


/* ============================================================
   APP NAV (Назад / Продолжить)
   ============================================================ */
.app-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  max-width: 680px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.app-nav .btn-ghost { flex-shrink: 0; }

.btn-primary-app {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #0D0C0F;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  text-decoration: none;
}
.btn-primary-app:hover { background: var(--accent-hover); }
.btn-primary-app:disabled,
.btn-primary-app.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}


/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

.upload-zone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-zone-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-tips-trigger {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.upload-tips-trigger:hover {
  color: var(--accent);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 100%;
  max-width: 860px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  max-height: calc(100vh - 32px); /* полный экран минус padding */
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* не скроллим сам контейнер */
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

/* Скроллируемое тело модала */
.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.modal-content {
  padding: 32px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
}

.photo-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.photo-example-item {
  text-align: center;
}

.photo-example-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}

.photo-example-item.good .photo-example-img {
  border-color: var(--success);
}

.photo-example-item.bad .photo-example-img {
  border-color: var(--error);
}

.photo-example-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.photo-example-item.good .photo-example-label { color: var(--success); }
.photo-example-item.bad .photo-example-label { color: var(--error); }

.modal-tips-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-preview {
  display: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-change {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(13,12,15,.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.upload-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.upload-tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.upload-tip-item svg { color: var(--accent); flex-shrink: 0; margin-top: 1px; }

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.tip-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tip-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tip-item-icon svg {
  width: 20px;
  height: 20px;
}


/* ============================================================
   CONFIRM SCREEN
   ============================================================ */
.confirm-photo-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  max-height: 320px;
  background: var(--bg-card);
  position: relative;
  margin-bottom: 20px;
}

.confirm-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.confirm-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13,12,15,.88);
  border: 1px solid var(--success);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

.confirm-debit-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.confirm-debit-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.confirm-debit-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.confirm-debit-balance {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}


/* ============================================================
   ANALYSIS TABLE
   ============================================================ */
.analysis-table {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.analysis-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

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

.analysis-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.analysis-key {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.analysis-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.analysis-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.analysis-summary-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Analysis Parameters List (Rows) */
.analysis-param-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.param-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.param-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(201, 169, 110, 0.3);
  transform: translateX(6px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.param-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.param-value {
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
  text-align: right;
}

/* Analysis Status Overlay on Photo */
.analysis-status-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 15, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  z-index: 20;
  transition: opacity 0.8s ease, visibility 0.8s;
  border-radius: inherit;
}

.analysis-status-overlay.is-complete {
  background: rgba(13, 12, 15, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: all 0.4s ease;
}

.analysis-status-overlay.is-complete .analysis-circle-progress {
  transform: scale(1);
}

.analysis-status-overlay.is-complete .analysis-circle-bg {
  display: none;
}

.analysis-status-overlay.is-complete .analysis-status-title {
  font-size: 18px;
}

.analysis-status-overlay.is-complete .analysis-status-sub {
  opacity: 1;
  max-height: 100px;
}

.analysis-circle-progress {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}

.analysis-circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.analysis-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.analysis-circle-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear, stroke 0.5s ease;
}

.analysis-circle-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.analysis-status-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.analysis-status-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.5;
}

/* Right Side Content */
.analysis-subtitle {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.analysis-full-version {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.analysis-full-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.analysis-full-item {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.analysis-full-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.full-item-label {
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.full-item-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Recommendations Block */
.analysis-footer-rec {
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.1) 0%, rgba(201, 169, 110, 0.03) 100%);
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: 24px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.analysis-footer-rec::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}

.analysis-rec-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 20px;
}

.analysis-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.rec-item {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.rec-item span {
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}

.analysis-rec-why {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(201, 169, 110, 0.1);
}

.rec-why-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.rec-why-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-why-list li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.rec-why-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A96E' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 4px rgba(201, 169, 110, 0.4));
}

.analysis-rec-note {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.5;
}


/* ============================================================
   QUESTIONS SCREEN
   ============================================================ */
.question-block {
  margin-bottom: 28px;
}

.question-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.q-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.q-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.q-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}


/* ============================================================
   REFERENCE GRID
   ============================================================ */
.reference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.ref-card {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ref-card:hover { border-color: var(--border-accent); }

.ref-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(201,169,110,.18);
}

.ref-card-photo {
  aspect-ratio: 3/4;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  position: relative;
}

.ref-card.selected .ref-card-photo::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #0D0C0F;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-card-info {
  padding: 10px 12px;
}

.ref-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ref-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ref-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: 4px;
  padding: 2px 6px;
}


/* ============================================================
   GENERATING SCREEN
   ============================================================ */
.generating-visual {
  border-radius: var(--radius-lg);
  aspect-ratio: 3/4;
  max-height: 360px;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
  margin-bottom: 24px;
}

/* Shimmer */
.shimmer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(201,169,110,.07) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.generating-progress-wrap {
  margin-bottom: 20px;
}

.generating-progress-bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.generating-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s ease;
}

.generating-progress-label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.generating-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  min-height: 20px;
  transition: opacity 0.4s;
}


/* ============================================================
   RESULT SCREEN
   ============================================================ */
.result-photo-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  max-height: 400px;
  background: var(--bg-card);
  position: relative;
  margin-bottom: 16px;
}

.result-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(13,12,15,.88);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.result-consultation {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.result-consultation-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.result-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-decoration: none;
}

.result-action-btn:hover {
  border-color: var(--border-accent);
  background: var(--bg-card);
}

.result-action-btn svg { color: var(--accent); }

.result-action-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.result-action-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Оценка */
.rating-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.rating-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.rating-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rating-star {
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--border);
  transition: color var(--transition), transform var(--transition);
}

.rating-star:hover,
.rating-star.active {
  color: var(--accent);
  transform: scale(1.15);
}

.rating-skip {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ============================================================
   PURCHASE SCREEN
   ============================================================ */
.purchase-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.purchase-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition);
  position: relative;
}

.purchase-card:hover { border-color: var(--border-accent); }

.purchase-card.selected {
  border-color: var(--accent);
  background: var(--bg-card);
}

.purchase-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
}

.purchase-card.selected .purchase-radio {
  border-color: var(--accent);
}

.purchase-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.purchase-card.selected .purchase-radio-dot { opacity: 1; }

.purchase-info { flex: 1; }

.purchase-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.purchase-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.purchase-price-col { text-align: right; flex-shrink: 0; }

.purchase-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.purchase-discount {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-dim);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
  margin-top: 2px;
}

.purchase-badge-popular {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent);
  color: #0D0C0F;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .04em;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.payment-method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color var(--transition);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.payment-method-btn:hover,
.payment-method-btn.selected,
.payment-method-btn.active { border-color: var(--accent); }

.payment-methods-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.payment-methods-row {
  display: flex;
  gap: 8px;
}

.payment-methods-row .payment-method-btn {
  flex: 1;
  justify-content: center;
  padding: 12px 14px;
}

.purchase-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.full-width { width: 100%; }

.purchase-legal {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.payment-method-icon {
  width: 36px;
  height: 24px;
  background: var(--bg-card);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}


/* ============================================================
   ACCOUNT SCREEN
   ============================================================ */
.account-header-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.account-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.account-since {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-balance-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.account-balance-val span { color: var(--accent); font-size: 16px; }

.account-balance-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.account-actions .btn-primary-app {
  flex: none;
  font-size: 13px;
  padding: 10px 18px;
}

.account-actions .btn-ghost {
  font-size: 13px;
}

/* История */
.history-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child { border-bottom: none; }

.history-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-info { flex: 1; min-width: 0; }

.history-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.history-amount {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.history-amount.debit  { color: var(--error); }
.history-amount.credit { color: var(--success); }

.history-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.history-status.done    { background: var(--success-dim); color: var(--success); }
.history-status.pending { background: rgba(201,169,110,.12); color: var(--accent); }
.history-status.error   { background: rgba(224,90,90,.12);   color: var(--error); }


/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  max-width: 420px;
  margin: 0 auto;
}

.auth-step { display: none; }
.auth-step.active { display: block; }

.auth-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 24px;
}

.auth-logo .logo-ai { color: var(--accent); }

.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
}

.otp-input:focus { border-color: var(--accent); }

.auth-resend {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.auth-resend a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}

.admin-sidebar-logo {
  padding: 20px 20px 16px;
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-sidebar-logo .logo-ai { color: var(--accent); }
.admin-sidebar-logo small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.admin-nav {
  padding: 12px 0;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  user-select: none;
  text-decoration: none;
}

.admin-nav-item svg { flex-shrink: 0; }

.admin-nav-item:hover { background: var(--bg-card); color: var(--text-primary); }

.admin-nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-right: 2px solid var(--accent);
}

.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.admin-main {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(13,12,15,.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-content {
  flex: 1;
  padding: 28px;
  overflow: auto;
}

/* Вкладки */
.admin-tab { display: none; }
.admin-tab.active { display: block; }

/* Метрика-карточки */
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.admin-metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.admin-metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.admin-metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.admin-metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-metric-card.accent-border { border-color: var(--border-accent); }

/* Период-переключатель */
.period-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
  margin-bottom: 20px;
}

.period-tab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.period-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.period-tab-btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.period-tab-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.period-tab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(201,169,110,0.08);
}

/* Столбчатый график */
.admin-chart-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.bar-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--bg-card);
  transition: height .3s;
  flex-shrink: 0;
  margin-top: auto;
}

.bar-fill.today { background: var(--accent); }
.bar-fill.other { background: var(--border); }

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
}

/* Круговая диаграмма */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Таблица admin */
.admin-table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-table-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-table-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-card); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.status-badge.done    { background: var(--success-dim); color: var(--success); }
.status-badge.error   { background: rgba(224,90,90,.12); color: var(--error); }
.status-badge.pending { background: rgba(201,169,110,.12); color: var(--accent); }

/* Промты */
.prompt-blocks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.prompt-block-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.prompt-block-card:hover { border-color: var(--border-accent); }

.prompt-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.prompt-block-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.prompt-block-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 4px;
  padding: 2px 7px;
}

.prompt-fill-bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.prompt-fill-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.prompt-fill-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Промт-редактор */
.prompt-editor {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.prompt-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.prompt-editor-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.prompt-editor-body {
  padding: 20px;
}

.prompt-field {
  margin-bottom: 14px;
}

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

.prompt-field textarea,
.prompt-field input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', monospace;
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.prompt-field textarea:focus,
.prompt-field input:focus { border-color: var(--accent); }

.neg-field textarea { color: var(--error); }

.prompt-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Поиск */
.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 16px;
  max-width: 320px;
}

.admin-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  flex: 1;
}

/* Настройки */
.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

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

.settings-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-row-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-row input[type="text"],
.settings-row input[type="number"] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 12px;
  width: 160px;
  outline: none;
  text-align: right;
}

.settings-row input:focus { border-color: var(--accent); }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform var(--transition), background var(--transition);
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent-dim); border-color: var(--border-accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--accent); }

/* Visibility toggle в отзывах */
.visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
}

.visibility-toggle.visible   { background: var(--success-dim); color: var(--success); }
.visibility-toggle.hidden-vis { background: var(--bg-card);    color: var(--text-muted); }

/* Admin login */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
}

/* Responsive admin */
@media (max-width: 900px) {
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .prompt-blocks-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   1366×768 — app pages без прокрутки
   ============================================================ */
@media (max-height: 820px) and (min-width: 1024px) {
  .app-header {
    height: 48px;
  }

  .app-page {
    min-height: calc(100vh - 48px);
  }

  /* Прогресс-бар */
  .step-progress {
    padding: 10px 20px 0;
    margin-bottom: 6px;
  }

  /* Заголовки страниц воронки */
  .app-title {
    font-size: 17px;
    margin-bottom: 3px;
  }

  .app-subtitle {
    font-size: 12px;
    margin-bottom: 14px;
  }

  /* Основной контент */
  .app-content {
    padding: 8px 20px 20px;
  }

  /* Нижняя навигация */
  .app-nav {
    padding: 10px 20px;
  }

  .btn-primary-app {
    padding: 11px 20px;
    font-size: 14px;
  }

  /* Split layout */
  .app-split {
    padding: 28px 20px 32px;
    gap: 40px;
  }

  /* Upload zone */
  .upload-zone {
    padding: 24px 20px;
  }

  .upload-zone .upload-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
  }

  .upload-zone-title {
    font-size: 13px;
  }

  /* Preview wrap в воронке */
  .funnel-preview-wrap {
    aspect-ratio: 4/5;
  }

  /* Confirm screen */
  .confirm-photo-wrap {
    max-height: 220px;
    margin-bottom: 12px;
  }

  /* Generating screen */
  .generating-visual {
    max-height: 240px;
    margin-bottom: 14px;
  }

  /* Result screen */
  .result-photo-wrap {
    max-height: 260px;
    margin-bottom: 10px;
  }

  .result-consultation {
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
  }

  .result-actions {
    margin-bottom: 14px;
  }

  .result-action-btn {
    padding: 10px 8px;
  }

  .rating-block {
    padding: 12px;
  }

  .rating-stars {
    margin-bottom: 8px;
  }

  .rating-star {
    width: 28px;
    height: 28px;
  }

  /* Reference grid */
  .ref-card-photo {
    aspect-ratio: 2/3;
  }

  /* Questions */
  .question-block {
    margin-bottom: 16px;
  }

  .question-text {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .q-btn {
    padding: 7px 14px;
    font-size: 12px;
  }

  /* Analysis */
  .analysis-row {
    padding: 10px 16px;
  }

  .param-item {
    padding: 10px 16px;
  }

  .analysis-summary {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Purchase */
  .purchase-card {
    padding: 11px 16px;
  }

  .purchase-name {
    font-size: 13px;
  }

  .purchase-price {
    font-size: 15px;
  }

  .payment-method-btn {
    padding: 10px 14px;
  }

  /* app-page-header-centered — меньше отступ от прогресс-бара */
  .app-page-header-centered {
    margin-bottom: 0;
  }

  .app-page-header-centered .app-title {
    font-size: 17px;
    margin-bottom: 3px;
  }

  .app-page-header-centered .app-subtitle {
    font-size: 12px;
    margin-bottom: 0;
  }

  /* questions — компактные кнопки выбора */
  .q-opt-btn {
    padding: 14px 16px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
  }

  /* questions — app-nav-actions отступ */
  .app-nav-actions {
    margin-top: 20px !important;
  }

  /* generating — уменьшаем preview */
  .generating-body .funnel-preview-wrap {
    aspect-ratio: 16/9;
    margin-bottom: 18px !important;
  }

  /* result — компактнее */
  .result-title {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .result-consultation-card {
    padding: 14px 16px;
    margin-bottom: 14px;
  }

  .result-consultation-text {
    font-size: 13px;
  }

  .result-btns-grid {
    margin-bottom: 14px;
    gap: 8px;
  }

  .result-action-btn {
    height: 60px;
    font-size: 11px;
  }

  .result-primary-btn {
    height: 46px;
    font-size: 14px;
    margin-top: 16px;
  }

  .result-rating-wrap {
    margin-top: 14px;
  }

  .result-rating-title {
    font-size: 13px;
  }

  /* app-page--has-header для result.html */
  .app-page--has-header .app-split {
    padding: 20px 20px 24px;
  }
}

@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
}

/* Общий responsive для воронки */
@media (max-width: 480px) {
  .app-content { padding: 24px 16px 32px; }
  .reference-grid { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 24px 20px; }
}

/* ============================================================
   ACCOUNT PAGE ADDITIONS
   ============================================================ */
.account-tabs {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.account-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.account-tab:hover {
  color: var(--text-secondary);
}

.account-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.account-tab-content {
  display: none;
  width: 100%;
  box-sizing: border-box;
}

.account-tab-content.active {
  display: block;
  width: 100%;
  animation: fade-in 0.3s ease;
}

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

/* History Grid */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.history-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
}

.history-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.history-card-thumb {
  aspect-ratio: 3/4;
  background: var(--bg-card);
  overflow: hidden;
}

.history-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-card-info {
  padding: 12px;
}

.history-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.history-card-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Transaction List */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.tx-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.tx-info {
  flex: 1;
}

.tx-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.tx-amount {
  font-size: 14px;
  font-weight: 700;
}

.tx-amount.plus { color: var(--success); }
.tx-amount.minus { color: var(--text-secondary); }

/* ============================================================
   NEW FUNNEL UI (SPLIT LAYOUT & COMPONENTS)
   ============================================================ */

/* 1. Global Reset for Funnel pages */
.app-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 2. Split Layout */
.app-split {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 20px;
}

@media (min-width: 1024px) {
  .app-split {
    flex-direction: row;
    align-items: flex-start;
    gap: 60px;
    padding: 20px 20px;
  }
}

.app-side-visual {
  flex: 1;
  position: relative;
  min-width: 0;
}

.app-side-content {
  flex: 1;
  max-width: 440px;
}

/* 3. Visual Components */
.funnel-preview-wrap {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  position: relative;
}

.funnel-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.funnel-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #10B981;
  color: #0D0C0F;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
}

/* 4. Action Cards */
.cost-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cost-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cost-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #C9A96E;
  color: #0D0C0F;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.cost-text {
  display: flex;
  flex-direction: column;
}

.cost-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.cost-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.cost-value {
  font-size: 20px;
  font-weight: 800;
  color: #FBBF24;
}

.tip-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(201,169,110,0.05);
  border: 1px solid rgba(201,169,110,0.15);
  border-radius: 12px;
  color: #C9A96E;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 32px;
}

.tip-box svg { flex-shrink: 0; margin-top: 2px; }

/* 5. Analysis Progress */
.analysis-status-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}

.analysis-circle-progress {
  width: 120px;
  height: 120px;
  position: relative;
  margin-bottom: 24px;
}

.analysis-circle-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.analysis-circle-bg {
  stroke: var(--border);
  stroke-width: 4;
  fill: none;
}

.analysis-circle-fill {
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.5s ease;
  animation: analysis-fill 4s linear infinite;
}

@keyframes analysis-fill {
  0% { stroke-dashoffset: 283; }
  100% { stroke-dashoffset: 0; }
}

.analysis-circle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
}

.analysis-status-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.analysis-status-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Skeleton Screens */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-item {
  height: 48px;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.skeleton-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 6. Questions Screen */
.question-item {
  margin-bottom: 32px;
}

.question-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.question-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.q-opt-btn {
  padding: 10px 18px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.q-opt-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.q-opt-btn.active {
  background: rgba(201,169,110,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* 7. Reference Grid Styles */
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.style-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.style-card:hover { transform: translateY(-4px); border-color: var(--text-muted); }
.style-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.style-card-img {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
}

.style-card-body {
  padding: 16px 18px;
}

.style-card-placeholder {
  aspect-ratio: 4/3;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.style-card:hover .style-card-placeholder {
  background: rgba(255,255,255,0.06);
}

.style-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 24px rgba(0,0,0,0.3);
  transform: translateY(-4px);
}

.btn-ghost-subtle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost-subtle:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.style-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.style-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.style-card-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  padding: 2px 8px;
  border-radius: 4px;
}

/* 8. Result Actions */
.result-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.result-consultation-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.result-consultation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.result-consultation-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.result-btns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.result-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  height: 80px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.result-action-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.result-action-btn svg { width: 18px; height: 18px; }

.result-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  padding: 11px 24px;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.result-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.result-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  padding: 12px 4px;
  border-top: 1px solid var(--border);
  margin-bottom: 4px;
}

.result-primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0D0C0F;
  height: 56px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.2s;
  margin-top: 32px;
}

.result-primary-btn:hover { transform: scale(1.02); }

.result-rating-wrap {
  text-align: center;
}

.result-rating-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.result-rating-star {
  color: rgba(255,255,255,0.1);
  cursor: pointer;
  transition: color 0.2s;
}

.result-rating-star:hover { color: var(--accent); }

.result-expand-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(13,12,15,0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background var(--transition);
}
.result-expand-btn:hover { background: rgba(13,12,15,0.9); }

.result-image-label {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 14px;
  background: rgba(13,12,15,0.8);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(201,169,110,0.3);
}

.result-image-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 32px;
  height: 32px;
  background: rgba(13,12,15,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}/* ============================================================
   ADMIN PANEL REFINEMENTS (Nano Banana Style)
   ============================================================ */

.admin-body {
  background: #0D0C0F;
  color: #E0E0E0;
}

.admin-badge-new {
  background: rgba(201,169,110,0.15);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-prompt-grid-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-pg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.admin-pg-label {
  min-width: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-pg-opts {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-pg-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-pg-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--text-muted);
}

.admin-pg-btn.active {
  background: rgba(201,169,110,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.admin-pg-toggle {
  display: flex;
  align-items: center;
}

.toggle-mini {
  width: 24px;
  height: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative;
}

.toggle-mini::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.toggle-mini.active::after {
  background: var(--accent);
  transform: translateX(10px);
}

/* Table Polish */
.admin-table th {
  background: rgba(255,255,255,0.02);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.admin-table td {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.done {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.status-badge.pending {
  background: rgba(234, 179, 8, 0.1);
  color: #fde047;
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.admin-metric-val {
  font-family: var(--font-header);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.user-balance-val, .admin-tx-amount {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   PHOTO VERIFICATION SIMULATION
   ============================================================ */
.upload-verify-status {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  margin-top: 15px;
  text-align: left;
}
.upload-verify-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.upload-verify-title.complete {
  color: var(--success);
}
.verify-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.verify-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.verify-step-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  opacity: 0.3;
}
.verify-step.active .verify-step-dot {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.5s infinite;
}
.verify-step-check {
  display: none;
  font-size: 14px;
}
.verify-step.done {
  color: #fff;
}
.verify-step.done .verify-step-dot {
  display: none;
}
.verify-step.done .verify-step-check {
  display: inline;
  animation: check-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes check-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ============================================================
   GLOBAL FUNNEL POLISH
   ============================================================ */
.app-page-header-centered {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 0px auto;
  position: relative;
  z-index: 10;
}

.app-content-footer {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.analysis-action-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.analysis-action-btns .btn-ghost,
.analysis-action-btns .btn-primary-app {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.analysis-action-btns .btn-primary-app {
  width: 100%;
  border-radius: 12px;
}

.upload-input-hidden {
  display: none !important;
}

.btn-upload-styled {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
}
.btn-upload-styled:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.generating-icon-animate {
  animation: gen-pulse-rotate 3s infinite ease-in-out;
}

@keyframes gen-pulse-rotate {
  0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.1) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 0.8; }
}

/* ============================================================
   FUNNEL STATUS OVERLAY
   ============================================================ */
.funnel-preview-wrap {
  position: relative;
  overflow: hidden;
}

.upload-verify-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 12, 15, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  border-radius: inherit;
  padding: 24px;
}

.upload-verify-inner {
  text-align: left;
  max-width: 240px;
}

.upload-verify-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  margin-bottom: 20px;
  text-transform: uppercase;
}

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

.verify-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.verify-step.done { color: #fff; }
.verify-step.active { color: #fff; }

.verify-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.verify-step.active .verify-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.verify-step.done .verify-dot {
  background: #22c55e;
  box-shadow: none;
}

/* ============================================================
   ANALYSIS PARAMETERS REVEAL
   ============================================================ */
.param-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px !important;
  position: relative;
}

.param-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.5s ease;
}

.param-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.5s ease;
}

.revealed .param-label,
.revealed .param-value {
  opacity: 1;
  transform: translateX(0);
}

.revealed .param-item::after {
  display: none; /* Hide skeleton shimmer on reveal */
}

/* ============================================================
   RATING & FEEDBACK
   ============================================================ */
.result-rating-wrap {
  margin: 32px 0;
  text-align: center;
}

.result-rating-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.result-rating-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.result-rating-star {
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.result-rating-star:hover,
.result-rating-star.hover {
  color: var(--accent);
  transform: scale(1.1);
}

.result-rating-star.active {
  color: var(--accent);
  fill: var(--accent);
  stroke: var(--accent);
}

.rating-feedback-form {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.feedback-question {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-family: inherit;
}

.feedback-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px !important;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
  resize: none;
  transition: border-color 0.2s ease;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   MODERN AUTH LAYOUT (DKS Style)
   ============================================================ */

.auth-page-centered {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(circle at center, rgba(20, 20, 22, 0.8) 0%, #0D0C0F 100%);
}

.auth-logo-top {
  margin-bottom: 40px;
}

.auth-card-modern {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.auth-title-modern {
  font-family: var(--font-header);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  margin: 0;
}

.auth-subtitle-modern {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.auth-input-modern {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  height: 56px !important;
  padding: 0 20px !important;
  font-size: 15px !important;
  border-radius: 12px !important;
  text-align: center;
}

.auth-input-modern:focus {
  border-color: var(--accent) !important;
  background: rgba(0, 0, 0, 0.3) !important;
}

.auth-consent-label {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  cursor: pointer;
}

.auth-checkbox-hidden {
  display: none;
}

.auth-custom-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.auth-checkbox-hidden:checked + .auth-custom-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.auth-checkbox-hidden:checked + .auth-custom-checkbox::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-consent-text {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.auth-btn-modern {
  height: 56px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 12px;
  background: #555 !important;
  color: #fff;
}

.auth-btn-modern:hover {
  background: #666 !important;
  transform: translateY(-2px);
}

.auth-bottom-actions {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.auth-bottom-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

.auth-tariff-btn {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 14px 28px;
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-back-link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-back-link:hover {
  color: var(--accent);
}
/* ============================================================
   INFO CARDS & TIPS (Upload Page Guide)
   ============================================================ */
.info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.info-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.tip-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.tip-item:last-child {
  margin-bottom: 0;
}

.tip-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.tip-item-content {
  flex: 1;
}

.tip-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-item-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   ADMIN PRO - STRUCTURAL OVERHAUL
   ============================================================ */
.admin-logo-unified {
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 24px 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.admin-logo-unified .logo-main {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}
.admin-logo-unified .logo-ai {
  font-size: 24px;
  font-weight: 400;
  color: var(--accent);
}

.admin-topbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
}

.admin-search-input {
  background: transparent;
  border: none;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

.admin-avatar-circle {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.admin-theme-btn:hover { color: var(--text-primary); background: var(--bg-card); }

.admin-topbar-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.admin-topbar-logout:hover { color: #F87171; background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }

/* Metrics Row */
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.admin-metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.admin-metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.admin-metric-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.admin-metric-trend {
  font-size: 12px;
  margin-top: 8px;
  font-weight: 700;
}
.admin-metric-trend.positive { color: #4ADE80; }
.admin-metric-trend.negative { color: #F87171; }

/* Dashboard Grid (Charts) */
.admin-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.admin-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Modern Charts */
.bar-chart-modern {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 10px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bar-fill {
  width: 30px;
  height: var(--h);
  background: linear-gradient(180deg, var(--accent) 0%, rgba(252,163,17,0.2) 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.bar-label {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.donut-chart-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.donut-svg-modern {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.donut-base {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 12;
}

.donut-active {
  fill: none;
  stroke: var(--color);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 251; 
  stroke-dashoffset: calc(251 - (251 * var(--offset)) / 100);
  transform: rotate(calc(var(--shift, 0) * 3.6deg));
  transform-origin: center;
}

.donut-legend-modern {
  margin-top: 24px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
}

/* Prompt Status Grid */
.prompt-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.prompt-status-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.p-status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.p-status-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.p-status-indicator {
  width: 24px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 10px;
}

.p-status-indicator.active { background: #4ADE80; }

.p-status-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Prompt Grid Editor */
.admin-prompt-grid {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-prompt-thead {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr 50px;
  background: var(--bg-tertiary);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-prompt-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr 50px;
  padding: 8px 12px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.admin-select-modern, .admin-input-modern {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.btn-action-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.btn-action-delete:hover { color: #F87171; }

.btn-primary-admin-action {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* References Grid */
.admin-tab-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-reference-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.admin-ref-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.admin-ref-item-card:hover { transform: translateY(-4px); }

.admin-ref-thumb {
  aspect-ratio: 3/4;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.admin-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-ref-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.admin-ref-item-card:hover .admin-ref-delete-btn { opacity: 1; }
.admin-ref-delete-btn:hover { background: #F87171; }

.admin-ref-edit-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.65);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.admin-ref-item-card:hover .admin-ref-edit-btn { opacity: 1; }
.admin-ref-edit-btn:hover { background: var(--accent); }

.admin-ref-info {
  padding: 12px;
}

.admin-ref-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.admin-ref-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ref-tag-pill {
  font-size: 10px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 100px;
}

.admin-ref-test-btn {
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.admin-ref-test-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Prompt blur/reveal ── */
.prompt-body-wrap {
  position: relative;
}

.prompt-body-wrap.is-hidden .prompt-blur-content {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.prompt-body-wrap.is-hidden .prompt-reveal-overlay {
  display: flex;
}

.prompt-reveal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.prompt-reveal-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.prompt-reveal-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
}

/* Simple Table */
.admin-table-simple {
  width: 100%;
  border-collapse: collapse;
}

.admin-table-simple th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-table-simple td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.status-pill {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.success { background: rgba(74,222,128,0.1); color: #4ADE80; }
.status-pill.pending { background: rgba(251,191,36,0.1); color: #FBBF24; }
.status-pill.abandoned { background: rgba(148,163,184,0.1); color: #94A3B8; }

/* ============================================================
   ACCOUNT PAGE
   ============================================================ */
.account-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.account-actions .btn-primary-app {
  flex: 1;
  min-width: 160px;
  font-size: 13px;
  padding: 11px 18px;
}
.account-actions .btn-ghost {
  font-size: 13px;
  padding: 11px 18px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.tx-info { flex: 1; min-width: 0; }
.tx-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tx-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 800; white-space: nowrap; }
.tx-amount.plus { color: var(--success); }
.tx-amount.minus { color: var(--text-muted); }

.account-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 32px auto 0;
  color: var(--error) !important;
  border-color: transparent !important;
  font-size: 13px;
}
.account-logout:hover { border-color: var(--error) !important; }

@media (max-width: 600px) {
  .history-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   ACCOUNT — новый дизайн личного кабинета
   ================================================================ */

/* Обёртка страницы */
.account-wrap {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ── Профильная шапка ── */
.account-profile-bar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.account-profile-info { flex: 1; min-width: 0; }

.account-greeting {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.account-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-uid {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.6;
}
.account-uid span {
  font-family: monospace;
  letter-spacing: 0.04em;
}

.account-profile-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.account-balance-display {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.account-balance-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.account-balance-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.account-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.account-balance-pill:hover { background: rgba(201,169,110,0.18); }

/* ── Баланс inline под email ── */
.account-balance-inline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 15px;
}
.account-balance-inline span {
  color: var(--accent);
  font-weight: 700;
}

/* ── Название прически в карточке анализа ── */
.dash-analysis-haircut-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.dash-tag-group {
  background: rgba(201,169,110,0.12);
  border-color: rgba(201,169,110,0.25);
  color: var(--accent);
}

/* ── Вкладки ── */
.account-tabs {
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.account-tabs::-webkit-scrollbar { display: none; }
.account-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 16px;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}
@media (max-width: 500px) {
  .account-tab {
    flex: 0 0 auto;
    padding: 9px 20px;
  }
}

/* ── Dashboard ── */
.dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.dash-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.dash-action-btn.primary { background: var(--accent); border-color: var(--accent); color: #0D0C0F; }
.dash-action-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.dash-action-btn.danger { border-color: rgba(224,90,90,0.4); color: var(--error); }
.dash-action-btn.danger:hover { border-color: var(--error); background: rgba(224,90,90,0.06); }

.dash-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 12px;
}

/* Карточка последнего анализа */
.dash-analysis-card {
  display: flex;
  gap: 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 4px;
  transition: border-color var(--transition);
}
.dash-analysis-card:hover { border-color: var(--border-accent); }

.dash-analysis-photo {
  width: 110px;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
}
.dash-analysis-photo img { width: 100%; height: 100%; object-fit: cover; }

.dash-analysis-info { flex: 1; min-width: 0; }

.dash-analysis-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.dash-analysis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.dash-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
}

.dash-analysis-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.dash-analysis-link:hover { text-decoration: underline; }

/* ── Паспорт внешности ── */
.passport-photo-card {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
}

.passport-photo-img {
  width: 88px;
  height: 108px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  flex-shrink: 0;
}

.passport-photo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.passport-photo-date {
  font-size: 12px;
  color: var(--text-muted);
}

.passport-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.passport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.passport-param-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.passport-param-card:hover { border-color: var(--border-accent); }

.passport-param-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.passport-param-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Сохранённые образы ── */
.saved-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.saved-filter {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.saved-filter.active,
.saved-filter:hover { border-color: var(--accent); color: var(--accent); }

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.saved-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.saved-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.saved-card-thumb {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg-card);
}
.saved-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.saved-card-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 10px;
  line-height: 1.4;
}

.saved-export-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── История анализов ── */
.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.history-tl-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.history-tl-item:hover { border-color: var(--border-accent); }

.history-tl-date {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 82px;
  flex-shrink: 0;
}

.history-tl-thumb {
  width: 44px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
}
.history-tl-thumb img { width: 100%; height: 100%; object-fit: cover; }

.history-tl-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.history-compare-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.history-compare-selects {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.history-compare-select {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.history-compare-select:focus { border-color: var(--accent); outline: none; }

.history-rec-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.history-rec-card a { color: var(--accent); font-weight: 600; text-decoration: none; }
.history-rec-card a:hover { text-decoration: underline; }

/* ── Настройки ── */
.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 4px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-danger-row { padding: 12px 0; }
.settings-account-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 0; }

/* Toggle-переключатель */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.settings-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  transition: background var(--transition);
}
.settings-toggle-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.settings-toggle input:checked + .settings-toggle-track { background: var(--accent); }
.settings-toggle input:checked + .settings-toggle-track::after { transform: translateX(20px); }

/* Кнопка выхода */
.account-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.account-logout-btn:hover { opacity: 1; }

/* ── Адаптив ── */
@media (max-width: 480px) {
  .account-profile-bar { gap: 10px; flex-wrap: wrap; }
  .account-greeting { font-size: 16px; }
  .account-profile-right { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 0; }
  .passport-grid { grid-template-columns: 1fr 1fr; }
  .saved-grid { grid-template-columns: repeat(2, 1fr); }
  .history-tl-date { min-width: 64px; font-size: 11px; }
  .dash-analysis-card { flex-direction: column; }
  .dash-analysis-photo { width: 100%; height: 160px; border-radius: var(--radius-md); }
}

/* ── История — название образа в таймлайне ── */
.history-tl-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ── Photo Lightbox ── */
.lightbox-container {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 94vw;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fade-in 0.2s ease;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.lightbox-content {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-content svg {
  width: 80px;
  height: 80px;
}

.lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.lightbox-close:hover { background: var(--bg-secondary); color: var(--text-primary); }

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.lightbox-note {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition);
  flex-shrink: 0;
}
.lightbox-download-btn:hover { background: rgba(201,169,110,0.18); }

/* ── Save Note Modal ── */
.save-note-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--transition);
  margin-bottom: 12px;
}
.save-note-input:focus { outline: none; border-color: var(--accent); }
.save-note-input::placeholder { color: var(--text-muted); }

.save-note-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.save-note-chip {
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.save-note-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
