/* ==========================================================================
   CSS STYLESHEET: ЭКО-ЦИКЛ (СВЕТЛАЯ ТЕМА + АНИМИРОВАННАЯ ЛАВА-ЛАМПА)
   ========================================================================== */

:root {
  /* Базовая светлая палитра */
  --bg-primary: #ffffff;
  --bg-secondary: #fef2f2;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-surface-hover: rgba(255, 255, 255, 0.98);
  --bg-surface-active: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.84);
  --border-glass: rgba(220, 38, 38, 0.12);
  --border-glass-bright: rgba(220, 38, 38, 0.22);

  /* Типографика */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-white: #ffffff;

  /* Акцентные цвета: алый, рубиновый, изумрудный, янтарный */
  --accent-primary: #dc2626;
  --accent-primary-hover: #b91c1c;
  --accent-ruby: #991b1b;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-indigo: #be123c;

  /* Мягкие тени с легким рубиновым отсветом */
  --shadow-subtle: 0 4px 24px rgba(220, 38, 38, 0.08);
  --shadow-card: 0 2px 12px rgba(185, 28, 28, 0.06);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --transition-fast: 0.16s ease;
  --transition-normal: 0.25s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ==========================================================================
   АНИМИРОВАННЫЙ ФОН: ЭФФЕКТ ЛАВА-ЛАМПЫ (LAVA LAMP)
   ========================================================================== */
.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: #ffffff;
}

.lava-lamp {
  position: absolute;
  inset: -15%;
  width: 130%;
  height: 130%;
  filter: blur(85px);
  opacity: 0.75;
}

.lava-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform, border-radius;
}

.blob-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 40% 40%, rgba(225, 29, 72, 0.55), rgba(190, 18, 60, 0.3) 60%, transparent 80%);
  top: 5%;
  left: 8%;
  animation: lavaFlow1 22s infinite ease-in-out alternate;
}

.blob-2 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle at 60% 60%, rgba(220, 38, 38, 0.5), rgba(153, 27, 27, 0.25) 65%, transparent 85%);
  top: 45%;
  right: 5%;
  animation: lavaFlow2 26s infinite ease-in-out alternate;
}

.blob-3 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle at 50% 50%, rgba(244, 63, 94, 0.45), rgba(225, 29, 72, 0.2) 60%, transparent 80%);
  bottom: 5%;
  left: 20%;
  animation: lavaFlow3 20s infinite ease-in-out alternate;
}

.blob-4 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at 45% 45%, rgba(185, 28, 28, 0.4), rgba(136, 19, 55, 0.2) 60%, transparent 80%);
  top: 25%;
  right: 32%;
  animation: lavaFlow4 24s infinite ease-in-out alternate;
}

.blob-5 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle at 55% 55%, rgba(251, 113, 133, 0.42), rgba(225, 29, 72, 0.2) 60%, transparent 80%);
  bottom: 22%;
  right: 22%;
  animation: lavaFlow5 28s infinite ease-in-out alternate;
}

@keyframes lavaFlow1 {
  0% { transform: translate(0, 0) scale(1); border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
  33% { transform: translate(110px, 70px) scale(1.14); border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  66% { transform: translate(-70px, 130px) scale(0.92); border-radius: 30% 70% 70% 30% / 50% 60% 40% 50%; }
  100% { transform: translate(70px, -50px) scale(1.08); border-radius: 58% 42% 38% 62% / 42% 58% 42% 58%; }
}

@keyframes lavaFlow2 {
  0% { transform: translate(0, 0) scale(1); border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  33% { transform: translate(-130px, -80px) scale(1.12); border-radius: 38% 62% 63% 37% / 70% 33% 67% 30%; }
  66% { transform: translate(80px, -100px) scale(0.95); border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%; }
  100% { transform: translate(-50px, 90px) scale(1.06); border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
}

@keyframes lavaFlow3 {
  0% { transform: translate(0, 0) scale(1); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { transform: translate(90px, -110px) scale(1.18); border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { transform: translate(-40px, 60px) scale(0.9); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes lavaFlow4 {
  0% { transform: translate(0, 0) scale(0.92); border-radius: 35% 65% 60% 40% / 45% 55% 45% 55%; }
  50% { transform: translate(-100px, 80px) scale(1.15); border-radius: 65% 35% 40% 60% / 55% 45% 55% 45%; }
  100% { transform: translate(80px, -60px) scale(1); border-radius: 35% 65% 60% 40% / 45% 55% 45% 55%; }
}

@keyframes lavaFlow5 {
  0% { transform: translate(0, 0) scale(1); border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%; }
  50% { transform: translate(70px, 100px) scale(1.16); border-radius: 60% 40% 45% 55% / 40% 60% 40% 60%; }
  100% { transform: translate(-80px, -70px) scale(0.94); border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%; }
}

/* Микропаттерн dot matrix */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(220, 38, 38, 0.12) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  opacity: 0.55;
}

/* ==========================================================================
   КОНТЕЙНЕР И КАРТОЧКИ
   ========================================================================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0.85rem 0.85rem 2.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-subtle);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0 1rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #dc2626, #991b1b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

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

.badge-inst {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-title span {
  background: linear-gradient(90deg, #dc2626, #e11d48);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass-bright);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

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

/* Screen Management */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   1. INTRO SCREEN
   ========================================================================== */
.hero-card {
  padding: 1.25rem;
}

.intro-headline-wrap {
  margin-bottom: 1rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(220, 38, 38, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(220, 38, 38, 0.22);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.hero-desc strong {
  color: var(--text-primary);
}

.dossier-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(254, 242, 242, 0.85));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.dossier-header {
  margin-bottom: 0.5rem;
}

.dossier-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--accent-amber);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.dossier-header h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.mini-stat {
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.mini-stat .label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.mini-stat .val {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-stat .val.highlight {
  color: var(--accent-emerald);
}

.setup-controls {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-field-group label, .mode-select-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input-field-group input {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-glass-bright);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}

.input-field-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.mode-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.mode-card {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.mode-card.selected {
  border-color: var(--accent-primary);
  background: rgba(220, 38, 38, 0.06);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.mode-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.mode-details strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.mode-details span {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
}

/* ==========================================================================
   КНОПКИ
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-size: 0.92rem;
  min-height: 46px;
  transition: all var(--transition-fast);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: white;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-block-mobile {
  width: 100%;
}

/* ==========================================================================
   2. GAMEPLAY & HUD
   ========================================================================== */
.hud-phase-bar {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}

.phase-progress-indicators {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.hud-step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-glass);
  padding: 0.35rem 0.2rem;
  border-radius: var(--radius-md);
  opacity: 0.55;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.hud-step-pill.active {
  opacity: 1;
  border-color: var(--accent-primary);
  background: rgba(220, 38, 38, 0.08);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.hud-step-pill.completed {
  opacity: 1;
  border-color: var(--accent-emerald);
  background: rgba(5, 150, 105, 0.08);
}

.hud-phase-idx {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-ruby);
  flex-shrink: 0;
}

.hud-step-pill.active .hud-phase-idx {
  background: var(--accent-primary);
  color: white;
}

.hud-step-pill.completed .hud-phase-idx {
  background: var(--accent-emerald);
  color: white;
}

.hud-phase-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  white-space: nowrap;
}

.financial-hud-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.hud-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.hud-metric-card.capital-card {
  border-color: rgba(220, 38, 38, 0.25);
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(254, 242, 242, 0.9));
}

.hud-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}

.hud-metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.hud-metric-delta {
  font-size: 0.72rem;
  font-weight: 700;
}

.hud-metric-delta.positive { color: var(--accent-emerald); }
.hud-metric-delta.negative { color: var(--accent-rose); }

.hud-metric-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.capital-card .hud-metric-value {
  font-size: 1.35rem;
}

.hud-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(220, 38, 38, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.2rem;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f43f5e);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.hud-subtext {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.stage-container {
  padding: 1.1rem;
}

.phase-briefing-banner {
  background: linear-gradient(135deg, rgba(255, 245, 245, 0.95), rgba(254, 226, 226, 0.7));
  border: 1px solid var(--border-glass-bright);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.phase-badge-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  margin-bottom: 0.2rem;
}

.phase-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.phase-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.macro-indicators-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
}

.macro-tag {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-glass);
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.macro-tag strong {
  color: var(--text-primary);
}

.text-green { color: var(--accent-emerald) !important; }
.text-red { color: var(--accent-rose) !important; }

.decision-section {
  margin-bottom: 1rem;
}

.section-title-row {
  margin-bottom: 0.65rem;
}

.section-title-row h4 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.questions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: var(--shadow-card);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.category-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.category-header h5 {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-btn {
  background: rgba(255, 255, 255, 0.78);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  transition: all var(--transition-fast);
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.option-btn:hover {
  background: rgba(220, 38, 38, 0.04);
  border-color: rgba(220, 38, 38, 0.25);
}

.option-btn:active {
  transform: scale(0.99);
}

.option-btn.selected {
  background: rgba(220, 38, 38, 0.08);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.opt-title {
  font-weight: 700;
  margin-bottom: 0.1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.opt-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.opt-impact-tag {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: var(--radius-sm);
  align-self: flex-start;
}

.opt-impact-tag.tag-low-risk { background: rgba(5, 150, 105, 0.12); color: var(--accent-emerald); }
.opt-impact-tag.tag-med-risk { background: rgba(217, 119, 6, 0.12); color: var(--accent-amber); }
.opt-impact-tag.tag-high-risk { background: rgba(225, 29, 72, 0.12); color: var(--accent-rose); }

.textarea-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: var(--shadow-card);
}

textarea#user-free-text-input {
  width: 100%;
  background: rgba(255, 250, 250, 0.95);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: all var(--transition-fast);
}

textarea#user-free-text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
}

.char-counter {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-sample-fill {
  background: none;
  border: 1px dashed var(--border-glass-bright);
  color: var(--accent-primary);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sample-fill:hover {
  background: rgba(220, 38, 38, 0.08);
}

.decision-submit-bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-glass);
}

.warning-alert {
  font-size: 0.78rem;
  color: var(--accent-amber);
  font-weight: 600;
  text-align: center;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   3. MODAL FEEDBACK
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 600px) {
  .modal-backdrop {
    align-items: center;
    padding: 1rem;
  }
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  border: 1px solid var(--border-glass-bright);
  border-top: 4px solid var(--accent-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.15rem 1.15rem 1.35rem;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(220, 38, 38, 0.15);
}

@media (min-width: 600px) {
  .modal-card {
    border-radius: var(--radius-xl);
    border-top: 1px solid var(--border-glass-bright);
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.15);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
}

.modal-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.1rem;
}

.badge-mini {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-full);
}

.badge-mini.green { background: rgba(5, 150, 105, 0.12); color: var(--accent-emerald); }

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  transition: color var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--accent-primary);
}

.phase-impact-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.impact-stat-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(254, 242, 242, 0.85));
  border: 1px solid var(--border-glass);
  padding: 0.55rem 0.45rem;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.impact-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
}

.impact-val {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.ai-critique-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(254, 245, 245, 0.9));
  border: 1px solid var(--border-glass-bright);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-card);
}

.ai-critique-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.ai-avatar {
  font-size: 1.15rem;
}

.ai-critique-content {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.ai-critique-content ul {
  padding-left: 1rem;
  margin-top: 0.35rem;
}

/* ==========================================================================
   4. FINAL RESULTS SCREEN
   ========================================================================== */
.results-container {
  padding: 1.25rem;
}

.results-header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
}

@media (min-width: 550px) {
  .results-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.results-main-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.1rem 0 0.2rem;
}

.student-meta-info {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.final-grade-badge {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(220, 38, 38, 0.08));
  border: 2px solid var(--accent-emerald);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  text-align: center;
  align-self: flex-start;
  box-shadow: var(--shadow-card);
}

@media (min-width: 550px) {
  .final-grade-badge {
    align-self: auto;
  }
}

.grade-letter {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-emerald);
}

.grade-score {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.grade-status {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.results-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.kpi-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.kpi-box.highlight {
  border-color: rgba(5, 150, 105, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(5, 150, 105, 0.08));
}

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.15rem 0;
}

.kpi-sub {
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.chart-card-header h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.chart-wrapper {
  height: 200px;
  position: relative;
}

.phase-reviews-section {
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.review-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.review-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-card);
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.review-card-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.review-card-impact {
  font-size: 0.82rem;
  font-weight: 700;
}

.review-card-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.review-decisions-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.dec-tag {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid var(--border-glass);
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.results-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
}

@media (min-width: 550px) {
  .results-actions-bar {
    flex-direction: row;
    justify-content: space-between;
  }
}

.app-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   ПЕЧАТЬ (PRINT)
   ========================================================================== */
@media print {
  body { background: #ffffff !important; color: #000000 !important; }
  .app-background, .main-header .btn-icon, .results-actions-bar, .app-footer, .btn { display: none !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .glass-panel, .dossier-card, .chart-card, .review-card, .kpi-box { background: #ffffff !important; border: 1px solid #ccc !important; box-shadow: none !important; color: #000 !important; }
  .kpi-value, .results-main-title, .hero-title, .review-card-title, .brand-title { color: #000 !important; }
}
