/* ==========================================================
   ФОТИКА — design system + app styles
   ========================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F7F5F0;
  --bg-card: #FFFFFF;
  --bg-tint: #EFEBE3;
  --bg-warm: #F5EFE4;
  --ink: #0A0A0A;
  --ink-1: #1F1B16;
  --ink-soft: #5A5A55;
  --ink-mute: #9A958C;
  --line: #E6E1D7;
  --line-hard: #D4CEBE;
  --accent: #FF4D2E;
  --accent-hover: #E83D1F;
  --accent-soft: #FFE8E1;
  --lime: #D4F24A;
  --success: #2E9E5E;
  --warn: #E8A54A;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(10,10,10,.04);
  --shadow: 0 4px 16px rgba(10,10,10,.06);
  --shadow-lg: 0 16px 48px rgba(10,10,10,.1);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  /* iOS safe-area для нижнего sticky CTA */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.display { font-family: 'Unbounded', sans-serif; letter-spacing: -0.02em; }

/* ==========================================================
   APP SHELL — sidebar + main
   ========================================================== */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--line);
  padding: 24px 20px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700; font-size: 20px;
  color: var(--ink); text-decoration: none;
  margin-bottom: 32px;
  letter-spacing: -0.03em;
}
.sb-logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sb-balance-card {
  background: var(--ink); color: var(--bg);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.sb-balance-card::before {
  content: ""; position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.4;
}
.sb-balance-label {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}
.sb-balance-value {
  font-family: 'Unbounded', sans-serif;
  font-size: 28px; font-weight: 600;
  line-height: 1;
  margin-bottom: 14px;
}
.sb-progress {
  height: 4px; background: rgba(255,255,255,0.15);
  border-radius: var(--radius-pill); overflow: hidden;
  margin-bottom: 8px;
}
.sb-progress-bar {
  height: 100%; background: var(--lime);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}
.sb-progress-label {
  font-size: 11px; color: rgba(255,255,255,0.55);
}
.sb-cta {
  margin-top: 14px;
  width: 100%;
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 10px; border-radius: var(--radius-pill);
  background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600; font-size: 13px;
  transition: background 0.2s;
}
.sb-cta:hover { background: var(--accent-hover); }

/* балансовая карточка: состояния */
.sb-balance-card.is-low  .sb-balance-value { color: #FFD77A; }
.sb-balance-card.is-empty {
  background: #2A1A14;
  box-shadow: inset 0 0 0 1px #6B2A1A;
}
.sb-balance-card.is-empty .sb-balance-value { color: #FF8A6A; }
.sb-balance-card.is-empty .sb-cta {
  background: #FF8A6A; color: #1F1B16;
}
.sb-balance-card.is-empty .sb-cta:hover { background: #FFA88C; }

.sb-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1;
}
.sb-section {
  font-size: 11px; font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 18px 12px 8px;
}
.sb-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sb-link:hover { background: var(--bg-tint); color: var(--ink); }
.sb-link.active { background: var(--ink); color: var(--bg); }
.sb-link.active .sb-icon { color: var(--lime); }
.sb-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--ink-mute);
}
.sb-link.active .sb-icon { color: var(--lime); }

.sb-user {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  flex-shrink: 0;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-user-email {
  font-size: 11px; color: var(--ink-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-logout {
  background: none; border: none; cursor: pointer;
  color: var(--ink-mute); font-size: 16px;
  padding: 6px; border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.sb-logout:hover { background: var(--bg-tint); color: var(--ink); }

.main {
  padding: 36px 48px;
  max-width: 1400px;
  width: 100%;
}

/* ==========================================================
   TYPOGRAPHY
   ========================================================== */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 32px; gap: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.05;
}
.page-subtitle {
  font-size: 15px; color: var(--ink-soft);
  margin-top: 8px;
}
.section-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 14px;
}
h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.015em;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 14px;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: #1a1a1a; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-tint); border-color: var(--line-hard); }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-icon-only {
  padding: 10px; width: 40px; height: 40px;
}

/* ==========================================================
   CARDS
   ========================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s, box-shadow .2s;
}
.card-hover:hover { border-color: var(--line-hard); box-shadow: var(--shadow); }
.card-dark {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.card-accent-bg {
  background: var(--accent-soft);
  border-color: transparent;
}

/* ==========================================================
   DASHBOARD — stats grid
   ========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.stat-card { padding: 24px; position: relative; overflow: hidden; }
.stat-card-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.stat-card-icon {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  background: var(--bg-tint);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.stat-card-value {
  font-family: 'Unbounded', sans-serif;
  font-size: 42px; font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card-value small { font-size: 18px; color: var(--ink-mute); font-weight: 400; margin-left: 4px; }
.stat-card-sub {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 16px;
}
.stat-progress {
  height: 6px; background: var(--bg-tint);
  border-radius: var(--radius-pill); overflow: hidden;
}
.stat-progress-bar {
  height: 100%; background: var(--ink);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}
.stat-progress-bar.accent { background: var(--accent); }

.stat-delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.stat-delta.up { background: #E9F6EF; color: var(--success); }
.stat-delta.down { background: #FDEBEA; color: #C73A1C; }

/* ==========================================================
   SPARKLINE / CHART
   ========================================================== */
.chart-card { padding: 28px; margin-bottom: 32px; }
.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.chart-tabs { display: flex; gap: 4px; background: var(--bg-tint); padding: 4px; border-radius: var(--radius-pill); }
.chart-tab {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.chart-tab.active { background: var(--bg-card); color: var(--ink); }

.chart-svg { width: 100%; height: 200px; }
.chart-legend { display: flex; gap: 20px; margin-top: 16px; font-size: 12px; color: var(--ink-soft); }
.chart-legend-item { display: flex; align-items: center; gap: 6px; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ==========================================================
   TABLE / HISTORY LIST
   ========================================================== */
.hist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.hist-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
}
.hist-card:hover { transform: translateY(-2px); border-color: var(--line-hard); }
.hist-card-img {
  aspect-ratio: 1/1;
  background: var(--bg-tint);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.hist-card-meta { padding: 14px; }
.hist-card-title {
  font-size: 13px; font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-card-date {
  font-size: 11px; color: var(--ink-mute);
}

.hist-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.hist-chip {
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--bg-card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--ink-soft);
  transition: all .15s;
}
.hist-chip:hover { border-color: var(--line-hard); }
.hist-chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ==========================================================
   DROPZONE
   ========================================================== */
.dropzone {
  border: 2px dashed var(--line-hard);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.dropzone:hover { border-color: var(--ink); }
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
}
.dz-icon {
  font-size: 56px; margin-bottom: 16px;
  opacity: 0.8;
}
.dz-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.dz-sub { font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.dz-formats {
  font-size: 12px; color: var(--ink-mute);
  margin-top: 16px;
}
.dz-formats strong { color: var(--ink-soft); }

.dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

.dz-preview {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; gap: 20px; align-items: center;
}
.dz-preview-img {
  width: 120px; height: 120px;
  border-radius: var(--radius);
  background: var(--bg-tint);
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.dz-preview-info { flex: 1; min-width: 0; }
.dz-preview-name {
  font-weight: 600; font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dz-preview-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }

.dz-converting {
  display: flex; align-items: center; gap: 12px;
  padding: 20px; background: var(--bg-warm);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line-hard);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================
   WIZARD STEPS
   ========================================================== */
.wizard {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 24px;
}
.wizard-steps {
  display: flex; gap: 4px;
  padding: 14px 24px;
  background: var(--bg-tint);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.wiz-step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  color: var(--ink-mute);
  white-space: nowrap;
}
.wiz-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.wiz-step.done { color: var(--success); }
.wiz-step.done .wiz-step-num { background: var(--success); color: #fff; }
.wiz-step.active { color: var(--ink); }
.wiz-step.active .wiz-step-num { background: var(--ink); color: var(--bg); }

.wiz-panel { padding: 32px; }
.wiz-panel-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.wiz-panel-sub { font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; }

.wiz-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* Category grid */
.cat-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cat-picker-item {
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center; cursor: pointer;
  background: var(--bg-card);
  transition: all .15s;
}
.cat-picker-item:hover { border-color: var(--line-hard); }
.cat-picker-item.selected { border-color: var(--ink); background: var(--bg-warm); }
.cat-picker-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.cat-picker-label { font-weight: 600; font-size: 14px; }
.cat-picker-sub { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* Composition type radio cards */
.type-picker { display: grid; gap: 10px; }
.type-card {
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  background: var(--bg-card);
  display: flex; align-items: center; gap: 16px;
  transition: all .15s;
}
.type-card:hover { border-color: var(--line-hard); }
.type-card.selected { border-color: var(--ink); background: var(--bg-warm); }
.type-card-visual {
  width: 64px; height: 64px; border-radius: var(--radius);
  background: var(--bg-tint);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.type-card-info { flex: 1; }
.type-card-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.type-card-sub { font-size: 13px; color: var(--ink-soft); }
.type-card-price { font-weight: 700; font-size: 15px; color: var(--accent); flex-shrink: 0; }

/* ==========================================================
   FORM CONTROLS
   ========================================================== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--ink); margin-bottom: 8px;
}
.form-label small { font-weight: 400; color: var(--ink-mute); margin-left: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--ink);
}
.form-textarea { resize: vertical; min-height: 100px; font-size: 15px; line-height: 1.5; }
.form-help { font-size: 12px; color: var(--ink-mute); margin-top: 6px; }

.suggest-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggest-chip {
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--bg-tint); border: none; cursor: pointer;
  font-size: 12px; color: var(--ink-soft);
  transition: background .15s;
}
.suggest-chip:hover { background: var(--line); color: var(--ink); }

/* ==========================================================
   GENERATION PROGRESS
   ========================================================== */
.gen-progress {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  min-height: 400px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.gen-progress-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
  margin-bottom: 28px;
}
.gen-progress-stage {
  font-family: 'Unbounded', sans-serif;
  font-size: 22px; font-weight: 600;
  margin-bottom: 8px;
  min-height: 30px;
  letter-spacing: -0.01em;
}
.gen-progress-sub { font-size: 14px; color: var(--ink-soft); margin-bottom: 28px; }
.gen-progress-steps {
  display: flex; gap: 6px;
  margin-bottom: 8px;
}
.gen-progress-step {
  width: 40px; height: 4px;
  background: var(--bg-tint);
  border-radius: var(--radius-pill);
  transition: background .3s;
}
.gen-progress-step.active { background: var(--accent); }
.gen-progress-step.done { background: var(--ink); }

/* ==========================================================
   RESULT VIEW
   ========================================================== */
.result-wrap {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.result-preview {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.result-preview img { max-width: 100%; max-height: 100%; border-radius: var(--radius); }
.result-toggle {
  position: absolute; top: 20px; left: 20px;
  display: flex; gap: 2px;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  padding: 4px; border-radius: var(--radius-pill);
  z-index: 2;
}
.result-toggle-btn {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: transparent; border: none; cursor: pointer;
  color: rgba(255,255,255,0.65);
  font-size: 12px; font-weight: 600;
  transition: all .15s;
}
.result-toggle-btn.active { background: #fff; color: var(--ink); }

.result-actions {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.result-meta-row {
  display: flex; justify-content: space-between;
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.result-meta-row:last-of-type { border-bottom: none; }
.result-meta-label { color: var(--ink-soft); }
.result-meta-value { font-weight: 600; }

/* ==========================================================
   PRICING
   ========================================================== */
.pricing-toggle {
  display: inline-flex; background: var(--bg-tint);
  padding: 4px; border-radius: var(--radius-pill);
  margin: 0 auto 32px; gap: 2px;
}
.pricing-toggle-btn {
  padding: 10px 24px; border-radius: var(--radius-pill);
  background: transparent; border: none; cursor: pointer;
  font-weight: 600; font-size: 14px;
  color: var(--ink-soft);
  transition: all .15s;
}
.pricing-toggle-btn.active {
  background: var(--bg-card); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.pricing-toggle-btn .save-badge {
  background: var(--lime); color: var(--ink-1);
  padding: 2px 7px; border-radius: var(--radius-pill);
  font-size: 10px; margin-left: 6px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.price-card-full {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .2s, border-color .2s;
}
.price-card-full.popular {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.price-card-full.popular .price-name { color: rgba(255,255,255,0.6); }
.price-card-full.popular .price-per { color: rgba(255,255,255,0.6); }
.price-card-full.popular .price-feat li { border-color: rgba(255,255,255,0.1); }
.price-name {
  font-family: 'Unbounded', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 16px;
}
.price-amount {
  font-family: 'Unbounded', sans-serif;
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 4px;
}
.price-amount .cur { font-size: 22px; font-weight: 500; }
.price-per { font-size: 12px; color: var(--ink-soft); margin-bottom: 20px; }
.price-feat { list-style: none; margin-bottom: 20px; flex: 1; }
.price-feat li {
  padding: 8px 0; font-size: 13px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.price-feat li::before { content: "→"; color: var(--accent); font-weight: 600; }
.price-card-full.popular .price-feat li::before { color: var(--lime); }
.price-pop-badge {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--lime); color: var(--ink-1);
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* ==========================================================
   MODAL
   ========================================================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.55);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in .25s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.modal-sub { font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 20px; right: 20px;
  background: var(--bg-tint); border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ink-soft);
  transition: background .15s;
}
.modal-close:hover { background: var(--line); }

/* Payment methods */
.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.pay-method {
  padding: 12px; border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--bg-card);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.pay-method:hover { border-color: var(--line-hard); }
.pay-method.selected { border-color: var(--ink); background: var(--bg-warm); }
.pay-method-logo {
  width: 32px; height: 24px;
  background: var(--bg-tint);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

.pay-summary {
  background: var(--bg-warm);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.pay-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.pay-summary-row.total {
  border-top: 1px dashed var(--line-hard);
  padding-top: 10px; margin-top: 8px;
  font-weight: 700; font-size: 15px;
}

/* Success state */
.pay-success {
  text-align: center;
  padding: 20px 0;
}
.pay-success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--success); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 40px; margin-bottom: 20px;
  animation: bounce-in .5s ease-out;
}
@keyframes bounce-in {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--line-hard);
  border-radius: var(--radius-lg);
}
.empty-icon { font-size: 64px; opacity: 0.4; margin-bottom: 16px; }
.empty-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 20px; font-weight: 600;
  margin-bottom: 8px;
}
.empty-sub { font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ==========================================================
   TOAST
   ========================================================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in .25s ease-out;
  max-width: 340px;
}
.toast.success { background: var(--success); }
.toast.error { background: #C73A1C; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================
   AUTH PAGE (login)
   ========================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-visual {
  background: var(--ink); color: var(--bg);
  padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-visual::before {
  content: ""; position: absolute; top: 10%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.3;
}
.auth-visual-content { position: relative; z-index: 1; }
.auth-visual h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 48px; font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.auth-visual p { font-size: 17px; color: rgba(255,255,255,0.7); max-width: 400px; }
.auth-testimonials { position: relative; z-index: 1; }
.auth-testi-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 18px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 10px;
}
.auth-testi-author { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 8px; }

.auth-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.auth-form {
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700; font-size: 22px;
  color: var(--ink); text-decoration: none;
  margin-bottom: 40px;
  letter-spacing: -0.03em;
}
.auth-form h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: 34px; font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.auth-form p { color: var(--ink-soft); font-size: 15px; margin-bottom: 28px; }
.auth-check-hint {
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px; text-align: center;
}

/* ==========================================================
   MOBILE NAV (top bar + drawer) — генерируется в app.js
   ========================================================== */
.m-topbar { display: none; }
.m-drawer { display: none; }
.m-drawer-bg { display: none; }

@media (max-width: 820px) {
  .m-topbar {
    display: flex;
    position: fixed; top: 0; left: 0; right: 0; z-index: 90;
    align-items: center; justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(247, 245, 240, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    /* безопасная зона iPhone notch сверху */
    padding-top: calc(10px + env(safe-area-inset-top, 0));
  }
  /* компенсируем фиксированный топбар (только на страницах кабинета) */
  body.has-mtopbar { padding-top: calc(64px + env(safe-area-inset-top, 0)); }
  .m-topbar-logo {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700; font-size: 17px;
    color: var(--ink); text-decoration: none;
    letter-spacing: -0.03em;
  }
  .m-topbar-mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--ink); color: var(--bg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px;
  }
  .m-topbar-balance {
    display: inline-flex; align-items: baseline; gap: 5px;
    padding: 7px 12px; border-radius: var(--radius-pill);
    background: var(--ink); color: var(--bg);
    font-weight: 600; font-size: 14px;
    text-decoration: none;
    transition: background .15s;
  }
  .m-topbar-balance.is-low { background: #B25222; }
  .m-topbar-balance.is-empty { background: var(--accent); }
  .m-topbar-balance-num { font-family: 'Unbounded', sans-serif; }
  .m-topbar-balance-label { font-size: 11px; opacity: 0.8; font-weight: 500; }
  .m-topbar-burger {
    width: 44px; height: 44px;
    border: 2px solid var(--ink);
    background: var(--ink);
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.16);
  }
  .m-topbar-burger:active { transform: scale(0.94); }
  .m-topbar-burger span {
    display: block;
    width: 20px; height: 2.5px;
    background: var(--lime);
    border-radius: 2px;
    transition: transform .18s, opacity .18s;
  }
  .m-topbar-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .m-topbar-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .m-topbar-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .m-drawer-bg {
    display: block !important;
    position: fixed; inset: 0;
    background: rgba(10,10,10,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .m-drawer-bg.is-open { opacity: 1; pointer-events: auto; }
  .m-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 100vw; max-width: 380px;
    height: 100vh; height: 100dvh;
    background: var(--bg-card);
    z-index: 100;
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.32,.72,0,1), visibility 0s linear .28s;
    box-shadow: -10px 0 40px rgba(0,0,0,0.18);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
  }
  .m-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .28s cubic-bezier(.32,.72,0,1), visibility 0s linear 0s;
  }
  /* отменяем атрибут [hidden], пользуемся только классом is-open */
  .m-drawer[hidden] { display: flex !important; }
  .m-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--line);
  }
  .m-drawer-user { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
  .m-drawer-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 16px;
    flex-shrink: 0;
  }
  .m-drawer-user-info { min-width: 0; }
  .m-drawer-user-name {
    font-size: 14px; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-drawer-user-email {
    font-size: 12px; color: var(--ink-mute);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-drawer-close {
    width: 36px; height: 36px;
    border: none; background: var(--bg-tint);
    border-radius: 50%;
    font-size: 16px; color: var(--ink-soft);
    cursor: pointer;
    flex-shrink: 0;
  }
  .m-drawer-balance-card {
    margin: 16px 18px 4px;
    background: var(--ink); color: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative; overflow: hidden;
  }
  .m-drawer-balance-card.is-low .m-drawer-balance-value { color: #FFD77A; }
  .m-drawer-balance-card.is-empty {
    background: #2A1A14;
    box-shadow: inset 0 0 0 1px #6B2A1A;
  }
  .m-drawer-balance-card.is-empty .m-drawer-balance-value { color: #FF8A6A; }
  .m-drawer-balance-label {
    font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
  }
  .m-drawer-balance-value {
    font-family: 'Unbounded', sans-serif;
    font-size: 26px; font-weight: 600;
    line-height: 1;
    margin-bottom: 12px;
  }
  .m-drawer-balance-cta {
    display: inline-flex; align-items: center; gap: 6px;
    width: 100%; justify-content: center;
    padding: 9px 12px; border-radius: var(--radius-pill);
    background: var(--accent); color: #fff;
    text-decoration: none; font-weight: 600; font-size: 13px;
  }
  .m-drawer-balance-card.is-empty .m-drawer-balance-cta {
    background: #FF8A6A; color: #1F1B16;
  }
  .m-drawer-nav {
    display: flex; flex-direction: column;
    padding: 14px 12px;
    gap: 2px;
  }
  .m-drawer-link {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 12px; border-radius: var(--radius);
    color: var(--ink-soft); text-decoration: none;
    font-size: 15px; font-weight: 500;
  }
  .m-drawer-link:active { background: var(--bg-tint); color: var(--ink); }
  .m-drawer-link.active { background: var(--ink); color: var(--bg); }
  .m-drawer-link.active .m-drawer-icon { color: var(--lime); }
  .m-drawer-icon {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    color: var(--ink-mute);
  }
  .m-drawer-logout {
    margin: 8px 18px 24px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--bg-card);
    border-radius: var(--radius-pill);
    color: var(--ink-soft);
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    font-family: inherit;
  }
}

/* ==========================================================
   RESPONSIVE — общие сетки
   ========================================================== */
@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .result-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 80px; }
  .page-header { gap: 12px; margin-bottom: 22px; align-items: flex-start; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 14px; }
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }
  .stats-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 22px; }
  .stat-card { padding: 18px; }
  .stat-card-value { font-size: 32px; }
  .stat-card-value small { font-size: 14px; }
  .cat-picker { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cat-picker-item { padding: 16px 12px; }
  .cat-picker-icon { font-size: 28px; margin-bottom: 6px; }
  .cat-picker-label { font-size: 13px; }
  .pricing-grid { grid-template-columns: 1fr; gap: 12px; }
  .price-card-full { padding: 22px 18px; }
  .price-amount { font-size: 32px; }
  .price-amount .cur { font-size: 18px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-wrap { padding: 24px 18px; }
  .auth-form h1 { font-size: 26px; }

  .wiz-panel { padding: 22px 18px; }
  .wiz-panel-title { font-size: 20px; }
  .wiz-footer { padding: 14px 18px; flex-direction: column; gap: 10px; }
  .wiz-footer .btn { width: 100%; }

  .dropzone { padding: 36px 18px; }
  .dz-icon { font-size: 44px; margin-bottom: 12px; }
  .dz-title { font-size: 17px; }
  .dz-sub { font-size: 13px; }
  .dz-preview { flex-direction: column; gap: 14px; padding: 16px; align-items: stretch; }
  .dz-preview-img { width: 100%; height: 200px; border-radius: var(--radius); }

  .modal { padding: 22px 18px; max-width: 100%; border-radius: var(--radius-md); }
  .modal-title { font-size: 18px; }
  .modal-close { top: 14px; right: 14px; }
  .pay-methods { grid-template-columns: 1fr; }

  .gen-progress { padding: 28px 18px; min-height: 320px; }
  .gen-progress-ring { width: 90px; height: 90px; margin-bottom: 22px; }
  .gen-progress-stage { font-size: 18px; }

  .result-actions { padding: 18px; }

  .hist-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hist-card-meta { padding: 10px; }
  .hist-card-title { font-size: 12px; }

  .hist-filters { gap: 6px; margin-bottom: 18px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hist-filters::-webkit-scrollbar { display: none; }
  .hist-chip { padding: 7px 13px; font-size: 12px; flex-shrink: 0; }

  .toast-container { right: 12px; left: 12px; bottom: 14px; }
  .toast { max-width: none; }

  .form-input, .form-textarea, .form-select { font-size: 16px; padding: 14px 14px; } /* iOS не зумит при focus, если шрифт >=16px */
  .btn-lg { padding: 14px 22px; font-size: 14.5px; }
}
@media (max-width: 420px) {
  .main { padding: 14px 12px 80px; }
  .page-title { font-size: 22px; }
  .cat-picker { grid-template-columns: 1fr; }
  .hist-grid { grid-template-columns: 1fr; }
  .hist-card-img { aspect-ratio: 16/10; }
}

/* ==========================================================
   UTILITIES
   ========================================================== */
.hidden { display: none !important; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.text-mute { color: var(--ink-mute); }
.text-soft { color: var(--ink-soft); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mobile-nav {
  display: none;
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  justify-content: space-between; align-items: center;
}
@media (max-width: 820px) { .mobile-nav { display: flex; } }

/* ==========================================================
   LANDING PAGE
   ========================================================== */
.land-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px;
  max-width: 1400px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700; font-size: 18px;
  color: var(--ink); text-decoration: none;
  letter-spacing: -0.03em;
}
.brand-dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); position: relative;
  flex-shrink: 0;
}
.brand-dot::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--lime));
}
.land-nav { display: flex; gap: 28px; }
.land-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  font-weight: 500; transition: color 0.15s;
}
.land-nav a:hover { color: var(--ink); }
.land-cta { display: flex; gap: 10px; }
@media (max-width: 820px) {
  .land-header { padding: 16px 20px; }
  .land-nav { display: none; }
}

.hero {
  padding: 60px 48px 80px;
  max-width: 1400px; margin: 0 auto;
}
.hero-inner { max-width: 900px; }
.hero-pill {
  display: inline-block;
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; color: var(--ink-soft);
  margin-bottom: 28px;
}
.hero-title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 24px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent) 60%, var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-soft);
  max-width: 640px;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-proof {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-mute);
}
.dot-lime {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(212, 242, 74, 0.25);
}

.section {
  padding: 80px 48px;
  max-width: 1400px; margin: 0 auto;
}
.section-head { margin-bottom: 48px; max-width: 640px; }
.section-head h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.section-head p { font-size: 16px; color: var(--ink-soft); }
@media (max-width: 820px) {
  .hero { padding: 40px 20px 60px; }
  .section { padding: 60px 20px; }
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.how-step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform .2s, box-shadow .2s;
}
.how-step:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.how-num {
  font-family: 'Unbounded', sans-serif;
  font-size: 42px; font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.how-step h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 20px; font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.how-step p { color: var(--ink-soft); font-size: 14px; }
@media (max-width: 820px) { .how-grid { grid-template-columns: 1fr; } }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 280px 280px;
  gap: 12px;
}
.bento-cell {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .2s, box-shadow .2s;
}
.bento-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bento-tag {
  display: inline-block; align-self: flex-start;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bg-tint);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
}
.bento-placeholder {
  font-size: 13px; color: var(--ink-mute);
  font-family: 'Unbounded', sans-serif;
  letter-spacing: -0.01em;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-tint);
  text-align: center;
  margin-top: auto;
}
.bento-a { grid-column: span 2; grid-row: span 2; background: linear-gradient(135deg, #FFE8E1 0%, #FFF 60%); }
.bento-b { background: linear-gradient(135deg, #E8F1DB 0%, #FFF 80%); }
.bento-c { background: linear-gradient(135deg, #FFF4DA 0%, #FFF 80%); }
.bento-d { background: linear-gradient(135deg, #F2EAFE 0%, #FFF 80%); }
.bento-e { background: linear-gradient(135deg, #E5F3F7 0%, #FFF 80%); }
.bento-f { grid-column: span 2; background: linear-gradient(135deg, #FFF 0%, var(--bg-tint) 100%); }
@media (max-width: 1100px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 240px); }
  .bento-a, .bento-f { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 820px) {
  .bento-grid { grid-template-columns: 1fr; grid-template-rows: repeat(6, 220px); }
  .bento-a, .bento-f { grid-column: auto; }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tariff {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex; flex-direction: column;
  position: relative;
}
.tariff-pop {
  border-color: var(--ink);
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}
.tariff-badge {
  position: absolute; top: -12px; left: 28px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}
.tariff-name {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.tariff-price {
  font-family: 'Unbounded', sans-serif;
  font-size: 36px; font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  line-height: 1;
}
.tariff-price span {
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 400;
  color: var(--ink-mute);
  letter-spacing: 0;
}
.tariff-feats {
  list-style: none; padding: 0;
  margin-bottom: 28px;
  flex: 1;
}
.tariff-feats li {
  padding: 8px 0; padding-left: 22px;
  font-size: 14px; color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.tariff-feats li::before {
  content: "✓"; position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}
.tariff-feats li:last-child { border-bottom: none; }
.tariff-cta { width: 100%; justify-content: center; }
@media (max-width: 820px) { .pricing-grid { grid-template-columns: 1fr; } }

.faq {
  max-width: 820px;
  display: flex; flex-direction: column; gap: 8px;
}
.faq details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  transition: border-color .15s;
}
.faq details[open] { border-color: var(--line-hard); }
.faq summary {
  font-weight: 600; font-size: 15px;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::after {
  content: "+"; font-size: 22px; color: var(--ink-mute);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin-top: 10px; color: var(--ink-soft); font-size: 14px;
}

.land-footer {
  padding: 40px 48px;
  max-width: 1400px; margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px;
}
.foot-copy { color: var(--ink-mute); font-size: 13px; margin-top: 8px; }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 13px;
}
.foot-links a:hover { color: var(--ink); }
@media (max-width: 820px) { .land-footer { padding: 30px 20px; } }

/* ==========================================================
   AUTH PAGE
   ========================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-visual {
  background: var(--ink); color: var(--bg);
  padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-visual::before {
  content: ""; position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.35;
}
.auth-visual::after {
  content: ""; position: absolute;
  bottom: -100px; left: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--lime) 0%, transparent 70%);
  opacity: 0.2;
}
.auth-visual .brand { color: var(--bg); position: relative; z-index: 1; }
.auth-visual .brand-dot { background: var(--bg); }
.auth-visual .brand-dot::after { background: linear-gradient(135deg, var(--accent), var(--lime)); }
.auth-quote {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 480px;
  position: relative; z-index: 1;
}
.auth-meta {
  font-size: 13px; color: rgba(255,255,255,0.5);
  position: relative; z-index: 1;
}
.auth-form-wrap {
  padding: 48px;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 560px; margin: 0 auto; width: 100%;
}
.auth-form-wrap h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: 36px; font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.auth-form-wrap .auth-sub {
  color: var(--ink-soft); font-size: 15px;
  margin-bottom: 32px;
}
.auth-sent {
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}
.auth-sent strong { display: block; margin-bottom: 8px; }
.auth-sent p { color: var(--ink-soft); font-size: 14px; }
.auth-demo-note {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(212, 242, 74, 0.25);
  border-radius: var(--radius);
  font-size: 13px; color: var(--ink-1);
}
.auth-small-link {
  display: inline-block; margin-top: 20px;
  color: var(--ink-mute); font-size: 13px;
  text-decoration: none;
}
.auth-small-link:hover { color: var(--ink); }
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { min-height: 240px; padding: 32px 24px; }
  .auth-form-wrap { padding: 32px 24px; }
}

/* ==========================================================
   TOAST
   ========================================================== */
.toast-host {
  position: fixed; top: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transition: opacity .28s, transform .28s;
  max-width: 340px;
}
.toast-success { background: var(--success); }
.toast-error { background: #C73A1C; }
.toast-info { background: var(--ink); }

/* ==========================================================
   MODAL
   ========================================================== */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,10,10,.4);
  backdrop-filter: blur(8px);
  z-index: 500;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  animation: modal-in .24s ease;
  position: relative;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.modal-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--ink-mute);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--ink); background: var(--bg-tint); }

/* ==========================================================
   PAYMENT
   ========================================================== */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.pay-method {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pay-method:hover { border-color: var(--line-hard); }
.pay-method.selected { border-color: var(--ink); background: var(--bg-warm); }
.pay-method-icon {
  width: 36px; height: 28px; border-radius: 4px;
  background: var(--bg-tint);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: var(--ink-soft);
  flex-shrink: 0;
}
.pay-method-label { font-weight: 500; font-size: 14px; }

.pay-summary {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: 20px;
}
.pay-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.pay-row.total {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px; font-weight: 600;
  border-top: 1px solid var(--line);
  margin-top: 8px; padding-top: 14px;
}
.pay-success {
  text-align: center;
  padding: 40px 20px;
}
.pay-success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  animation: bounce-in .5s ease;
}
@keyframes bounce-in {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.pay-success h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 22px; margin-bottom: 8px;
}
.pay-success p { color: var(--ink-soft); font-size: 14px; }

/* ==========================================================
   MOBILE
   ========================================================== */
@media (max-width: 1100px) {
  .app { grid-template-columns: 220px 1fr; }
  .main { padding: 28px 28px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
