/* ====================================================================
 * DIARIO DE ESQUEMAS - ESTILOS MOBILE-FIRST & ZEN V2.1
 * Arquitectura 100% Mobile-First, acordeones táctiles de dominios,
 * micro-interacciones suaves con Anime.js y ergonomía para smartphone.
 * ==================================================================== */

:root {
  /* Maderas Nobles, Teca y Nogal */
  --wood-950: #1F120A;
  --wood-900: #331F14;
  --wood-800: #4D3222;
  --wood-700: #6B4731;
  --wood-600: #8C5E43;
  --wood-500: #AB7958;
  --wood-400: #C99B7D;
  --wood-300: #DFC0AA;
  --wood-200: #EFE2D6;
  --wood-100: #F7F1EB;
  --wood-50:  #FCFAF7;

  /* Fondos Zen, Lino y Blancos Cálidos */
  --bg-app: #F6F1EC;
  --bg-card: #FFFFFF;
  --bg-input: #FCFBF9;
  --bg-sand: #EAE1D7;
  --bg-zen-soft: #F9F6F1;
  --bg-zen-highlight: #F3ECE3;

  /* Tonos Salvia, Bambú y Serenidad */
  --zen-sage-dark: #2F4C42;
  --zen-sage: #4E7064;
  --zen-sage-light: #6D9285;
  --zen-sage-bg: #EAF1EE;
  --zen-sage-border: #BCD0C7;

  /* Tonos Ámbar y Miel Calma */
  --amber-warm: #B87333;
  --amber-bg: #FDF7ED;
  --amber-border: #F3DCB8;

  /* Notificaciones y Estados */
  --status-success: #2F6F48;
  --status-success-bg: #EAF5EE;
  --status-success-border: #BCE2C7;
  --status-warning: #945B0A;
  --status-warning-bg: #FDF6E9;
  --status-warning-border: #F8D9A8;
  --status-error: #9E2B2B;
  --status-error-bg: #FDF1F1;
  --status-error-border: #F7C5C5;

  /* Tipografía y Contrastes */
  --text-main: #2B211B;
  --text-secondary: #5C4B40;
  --text-muted: #827267;
  --text-inverse: #FFFFFF;

  /* Radios y Sombras */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-subtle: 0 2px 8px rgba(51, 31, 20, 0.04);
  --shadow-card: 0 4px 18px rgba(51, 31, 20, 0.06), 0 1px 3px rgba(51, 31, 20, 0.03);
  --shadow-elevated: 0 10px 32px rgba(51, 31, 20, 0.12), 0 2px 6px rgba(51, 31, 20, 0.04);
  --shadow-focus: 0 0 0 3px rgba(140, 94, 67, 0.22);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-serif: "Georgia", "Cambria", "Times New Roman", serif;
  --transition-fast: 0.18s ease;
  --transition-smooth: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================================
 * BASE Y RESET (MOBILE-FIRST)
 * ==================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-main);
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(ellipse at 10% 5%, rgba(171, 121, 88, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 95%, rgba(78, 112, 100, 0.07) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

:focus-visible {
  outline: 3px solid var(--wood-600);
  outline-offset: 2px;
}

.app-container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0.75rem 0.65rem calc(2.5rem + env(safe-area-inset-bottom));
  flex: 1 0 auto;
}

@media (min-width: 640px) {
  .app-container {
    padding: 1.5rem 1.25rem 3.5rem;
  }
}

@media (min-width: 768px) {
  .app-container {
    padding: 2rem 1.5rem 4.5rem;
  }
}

/* ====================================================================
 * BARRA SUPERIOR MINIMALISTA & SUTIL
 * ==================================================================== */
.minimal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.25rem 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(140, 94, 67, 0.14);
}

.minimal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.minimal-brand-icon {
  width: 32px;
  height: 32px;
  color: var(--wood-700);
  background: var(--wood-100);
  border: 1px solid var(--wood-300);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-subtle);
}

.minimal-brand-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--wood-900);
  letter-spacing: -0.01em;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hamburger-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--wood-300);
  color: var(--wood-800);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-subtle);
}

.hamburger-btn:active {
  background-color: var(--wood-100);
  transform: scale(0.95);
}

@media (hover: hover) {
  .hamburger-btn:hover {
    background-color: var(--wood-100);
    border-color: var(--wood-700);
    color: var(--wood-950);
  }
}

.header-menu-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--status-warning);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ====================================================================
 * AVISOS DE REANUDACIÓN Y PENDIENTES (MOBILE-FIRST)
 * ==================================================================== */
.resume-banner,
.pending-alert-banner {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-subtle);
  font-size: 0.86rem;
}

@media (min-width: 580px) {
  .resume-banner,
  .pending-alert-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    font-size: 0.9rem;
  }
}

.resume-banner {
  background-color: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-left: 4px solid var(--amber-warm);
  color: var(--wood-900);
}

.pending-alert-banner {
  background-color: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-left: 4px solid var(--status-warning);
  color: var(--status-warning);
}

.resume-banner-content,
.pending-alert-content {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
}

/* ====================================================================
 * NAVEGADOR DE PASOS (STEPPER) MOBILE-FIRST
 * ==================================================================== */
.stepper-nav-card {
  background: var(--bg-card);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-subtle);
}

@media (min-width: 640px) {
  .stepper-nav-card {
    padding: 0.75rem 1rem;
    margin-bottom: 1.35rem;
  }
}

.stepper-list {
  display: flex;
  list-style: none;
  justify-content: space-between;
  align-items: center;
  gap: 0.2rem;
}

.stepper-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  padding: 0.35rem 0.15rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.stepper-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--wood-100);
  border: 1.5px solid var(--wood-300);
  color: var(--wood-700);
  font-weight: 700;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.2rem;
  transition: all var(--transition-smooth);
}

@media (min-width: 640px) {
  .stepper-icon-wrap {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    border-width: 2px;
    margin-bottom: 0.3rem;
  }
}

.stepper-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .stepper-label {
    font-size: 0.78rem;
  }
}

.stepper-item.active .stepper-icon-wrap {
  background: var(--wood-700);
  border-color: var(--wood-900);
  color: #FFFFFF;
  box-shadow: 0 0 0 3.5px rgba(107, 71, 49, 0.15);
  transform: scale(1.06);
}

.stepper-item.active .stepper-label {
  color: var(--wood-900);
  font-weight: 700;
}

.stepper-item.completed .stepper-icon-wrap {
  background: var(--zen-sage);
  border-color: var(--zen-sage-dark);
  color: #FFFFFF;
}

.stepper-item.completed .stepper-label {
  color: var(--zen-sage-dark);
}

/* ====================================================================
 * PANELES Y TARJETAS DE PASO
 * ==================================================================== */
.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-lg);
  padding: 1.1rem 0.95rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.15rem;
}

@media (min-width: 640px) {
  .step-card {
    padding: 1.85rem 2rem;
    margin-bottom: 1.5rem;
  }
}

.step-intro-header {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--wood-100);
}

@media (min-width: 640px) {
  .step-intro-header {
    gap: 1rem;
    margin-bottom: 1.35rem;
    padding-bottom: 1.15rem;
  }
}

.step-icon-badge {
  width: 36px;
  height: 36px;
  background: var(--wood-100);
  border: 1.5px solid var(--wood-300);
  border-radius: var(--radius-md);
  color: var(--wood-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .step-icon-badge {
    width: 44px;
    height: 44px;
  }
}

.step-header-text {
  flex: 1;
}

.step-badge-counter {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wood-600);
  margin-bottom: 0.1rem;
}

.step-title {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 700;
  color: var(--wood-900);
  line-height: 1.25;
}

.step-description {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.35;
}

@media (min-width: 640px) {
  .step-description {
    font-size: 0.9rem;
    margin-top: 0.35rem;
  }
}

.zen-mindful-box {
  background: var(--bg-zen-soft);
  border: 1px solid var(--wood-200);
  border-left: 3.5px solid var(--zen-sage);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--wood-800);
  line-height: 1.38;
}

@media (min-width: 640px) {
  .zen-mindful-box {
    padding: 0.85rem 1.15rem;
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
  }
}

.zen-mindful-box svg {
  color: var(--zen-sage);
  flex-shrink: 0;
}

/* ====================================================================
 * FORMULARIOS, INPUTS Y TEXTAREAS (MOBILE-FIRST)
 * ==================================================================== */
.form-group {
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--wood-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.req-marker {
  color: var(--status-error);
  margin-left: 0.25rem;
}

.field-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

input[type="text"],
input[type="date"],
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-main);
  background-color: #FFFFFF;
  border: 1.5px solid var(--wood-300);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  min-height: 48px;
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--wood-700);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3.5px rgba(107, 71, 49, 0.16);
  outline: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
  border-radius: var(--radius-md);
}

textarea::placeholder,
input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
  font-size: 0.88rem;
  line-height: 1.4;
}

/* ====================================================================
 * PASO 3: TU RESPUESTA INTERIOR (MOBILE-FIRST)
 * ==================================================================== */
.step3-subblock {
  background: var(--bg-zen-soft);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.95rem 0.8rem;
  margin-bottom: 1.15rem;
}

@media (min-width: 640px) {
  .step3-subblock {
    padding: 1.5rem 1.65rem;
    margin-bottom: 1.65rem;
  }
}

.subblock-header {
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid var(--wood-200);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.subblock-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.subblock-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--wood-900);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.subblock-title svg {
  color: var(--wood-600);
}

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

.emotion-quick-selector {
  margin-bottom: 0.95rem;
}

.quick-selector-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wood-800);
  margin-bottom: 0.4rem;
  display: block;
}

.emotion-chips-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.emotion-chip-btn {
  background: #FFFFFF;
  border: 1.5px solid var(--wood-300);
  color: var(--wood-900);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 38px;
  transition: all var(--transition-fast);
}

.emotion-chip-btn:active {
  transform: scale(0.94);
}

@media (hover: hover) {
  .emotion-chip-btn:hover {
    background: var(--wood-100);
    border-color: var(--wood-600);
    transform: translateY(-1px);
  }
}

.emotions-active-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.emotion-active-card {
  background: #FFFFFF;
  border: 1.5px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.emotion-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.emotion-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wood-900);
}

.emotion-custom-input {
  font-size: 16px;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  min-height: 42px;
  flex: 1;
}

/* Slider de Intensidad 0 a 10 (Touch-Friendly) */
.intensity-scale-box {
  background: var(--bg-zen-soft);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.intensity-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wood-800);
}

.intensity-badge-10 {
  font-size: 0.86rem;
  font-weight: 800;
  background: var(--wood-700);
  color: #FFFFFF;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.slider-container-10 {
  position: relative;
  margin: 0.35rem 0;
  padding: 0.2rem 0;
}

.range-slider-10 {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #6D9285 0%, #D4A373 50%, #C86D51 80%, #9E2B2B 100%);
  outline: none;
  margin: 0;
  padding: 0;
  min-height: auto;
  border: none;
}

.range-slider-10::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--wood-800);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.range-slider-10::-webkit-slider-thumb:active {
  transform: scale(1.18);
}

.intensity-markers-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.thought-behavior-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dynamic-card-item {
  background: #FFFFFF;
  border: 1.5px solid var(--wood-300);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.45rem 0.45rem 0.85rem;
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dynamic-card-item:focus-within {
  border-color: var(--wood-700);
  box-shadow: 0 0 0 3.5px rgba(107, 71, 49, 0.16);
}

.dynamic-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
}

.dynamic-card-item textarea {
  width: 100%;
  border: none !important;
  background: transparent !important;
  padding: 0.35rem 0.15rem !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: var(--text-main);
  box-shadow: none !important;
  outline: none !important;
  min-height: 60px !important;
  resize: none;
  overflow-y: hidden;
  border-radius: 0 !important;
}

.dynamic-card-item textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
  font-size: 0.88rem;
  line-height: 1.4;
}

.dynamic-card-item .btn-remove-card {
  background: transparent;
  border: 1px solid transparent;
  color: var(--wood-400);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.25rem;
  transition: all var(--transition-fast);
}

.dynamic-card-item .btn-remove-card:hover,
.dynamic-card-item .btn-remove-card:active {
  background-color: var(--status-error-bg);
  color: var(--status-error);
}

.dynamic-card-item .btn-remove-card:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Botón Añadir Mobile-First */
.btn-add-item {
  width: 100%;
  background: #FFFFFF;
  border: 1.5px dashed var(--wood-400);
  border-radius: var(--radius-md);
  color: var(--wood-800);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 0.95rem;
  min-height: 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-smooth);
  margin-top: 0.75rem;
  box-shadow: var(--shadow-subtle);
}

.btn-add-item:active {
  transform: scale(0.98);
  background: var(--wood-100);
}

@media (hover: hover) {
  .btn-add-item:hover {
    background: var(--wood-100);
    border-color: var(--wood-700);
    border-style: solid;
    color: var(--wood-950);
    transform: translateY(-1px);
  }
}

.btn-add-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wood-100);
  border: 1px solid var(--wood-300);
  color: var(--wood-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

/* ====================================================================
 * PASO 4: ACORDEONES DE DOMINIOS Y TARJETAS COMPACTAS (MOBILE-FIRST)
 * ==================================================================== */
.schemas-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.schema-count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--wood-900);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* Acordeón de Dominio Clínico */
.schema-domain-accordion {
  background: var(--bg-zen-soft);
  border: 1.5px solid var(--wood-200);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.schema-domain-accordion.has-selections {
  border-color: var(--zen-sage-border);
  background: #F4F8F6;
}

.schema-domain-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  text-align: left;
  font-family: inherit;
  transition: background-color var(--transition-fast);
}

.schema-domain-trigger:active {
  background-color: rgba(140, 94, 67, 0.06);
}

.domain-trigger-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
}

.domain-badge-num {
  width: 28px;
  height: 28px;
  background: var(--wood-700);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.78rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.schema-domain-accordion.has-selections .domain-badge-num {
  background: var(--zen-sage);
}

.domain-header-content {
  flex: 1;
}

.domain-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wood-900);
  line-height: 1.25;
}

.domain-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
  line-height: 1.3;
}

.domain-trigger-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.domain-selection-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #FFFFFF;
  border: 1px solid var(--wood-300);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.domain-selection-pill.active {
  background: var(--zen-sage-bg);
  border-color: var(--zen-sage-border);
  color: var(--zen-sage-dark);
  font-weight: 700;
}

.domain-chevron {
  color: var(--wood-600);
  transition: transform var(--transition-smooth);
}

.schema-domain-trigger.open .domain-chevron {
  transform: rotate(180deg);
}

.schema-domain-body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px dashed var(--wood-200);
  padding-top: 0.75rem;
}

.domain-schemas-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 680px) {
  .domain-schemas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* Tarjeta individual de esquema móvil */
.friendly-schema-card {
  background: #FFFFFF;
  border: 1.5px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
  position: relative;
  text-align: left;
  user-select: none;
}

.friendly-schema-card:active {
  transform: scale(0.98);
}

.friendly-schema-card[aria-pressed="true"] {
  background: var(--wood-800);
  border-color: var(--wood-950);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(51, 31, 20, 0.16);
}

.schema-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

.schema-friendly-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--wood-900);
  line-height: 1.25;
}

.friendly-schema-card[aria-pressed="true"] .schema-friendly-title {
  color: #FFFFFF;
}

.schema-check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--wood-300);
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all var(--transition-fast);
}

.friendly-schema-card[aria-pressed="true"] .schema-check-circle {
  background: var(--zen-sage);
  border-color: var(--zen-sage-light);
  color: #FFFFFF;
}

.schema-friendly-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.friendly-schema-card[aria-pressed="true"] .schema-friendly-desc {
  color: var(--wood-100);
}

.schema-note-box {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
}

.schema-note-box label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--wood-200);
  display: block;
  margin-bottom: 0.25rem;
}

.schema-note-box input {
  font-size: 16px;
  padding: 0.45rem 0.65rem;
  min-height: 40px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--wood-300);
}

.analysis-questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px dashed var(--wood-200);
}

.analysis-question-card {
  background: var(--bg-zen-soft);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.95rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.analysis-quote-pill {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--wood-800);
  background: rgba(140, 94, 67, 0.08);
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--wood-600);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-bottom: 0.2rem;
}

/* ====================================================================
 * BOTONES Y NAVEGACIÓN MOBILE-FIRST
 * ==================================================================== */
.wizard-nav-bar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--wood-200);
}

@media (min-width: 580px) {
  .wizard-nav-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
  }
}

.nav-actions-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  width: 100%;
}

@media (min-width: 580px) {
  .nav-actions-right {
    width: auto;
    justify-content: flex-end;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.75rem 1.15rem;
  min-height: 48px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
}

@media (min-width: 580px) {
  .btn {
    width: auto;
  }
}

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

.btn-primary {
  background-color: var(--wood-800);
  color: var(--text-inverse);
  border-color: var(--wood-900);
  box-shadow: 0 3px 12px rgba(51, 31, 20, 0.14);
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    background-color: var(--wood-950);
    box-shadow: 0 6px 18px rgba(51, 31, 20, 0.22);
    transform: translateY(-1px);
  }
}

.btn-secondary {
  background-color: var(--wood-100);
  color: var(--wood-900);
  border-color: var(--wood-300);
}

.btn-save-later {
  background-color: var(--amber-bg);
  color: var(--wood-900);
  border: 1.5px solid var(--amber-border);
  font-size: 0.86rem;
  min-height: 44px;
}

.btn-danger {
  background-color: var(--status-error-bg);
  color: var(--status-error);
  border-color: var(--status-error-border);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--wood-300);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  min-height: 40px;
  border-radius: var(--radius-sm);
  width: auto;
}

.icon-action-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.icon-action-btn:active {
  transform: scale(0.92);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.draft-toast {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  right: 1rem;
  left: 1rem;
  max-width: 380px;
  margin: 0 auto;
  background: var(--wood-900);
  color: var(--text-inverse);
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  box-shadow: var(--shadow-elevated);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.draft-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================================
 * PANTALLA DE ÉXITO Y PAUSA
 * ==================================================================== */
.success-screen-card {
  background: var(--bg-card);
  border: 1px solid var(--status-success-border);
  border-top: 5px solid var(--zen-sage);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.15rem;
  box-shadow: var(--shadow-elevated);
  text-align: center;
}

@media (min-width: 640px) {
  .success-screen-card {
    padding: 2.5rem 2rem;
  }
}

.success-icon-wrap {
  width: 64px;
  height: 64px;
  background-color: var(--zen-sage-bg);
  color: var(--zen-sage-dark);
  border: 2px solid var(--zen-sage-border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--wood-900);
  margin-bottom: 0.25rem;
}

.success-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 1.35rem;
}

.submission-summary-box {
  background: var(--bg-zen-soft);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  margin-bottom: 1.35rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--wood-200);
  font-size: 0.84rem;
}

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

.summary-label {
  color: var(--text-muted);
  font-weight: 500;
}

.summary-value {
  color: var(--wood-900);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.success-actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 540px) {
  .success-actions-row {
    flex-direction: row;
    justify-content: center;
  }
}

/* ====================================================================
 * MODALES (MOBILE-FIRST)
 * ==================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(31, 18, 10, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.35rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-elevated);
}

@media (min-width: 580px) {
  .modal-window {
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    max-height: 85vh;
  }
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--wood-900);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  min-height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Menú Drawer / Hamburguesa */
.drawer-window {
  max-width: 460px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--wood-100);
}

.drawer-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.drawer-menu-item {
  width: 100%;
  background: var(--bg-zen-soft);
  border: 1.5px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.drawer-menu-item:active {
  background-color: var(--wood-100);
  transform: scale(0.98);
}

@media (hover: hover) {
  .drawer-menu-item:hover {
    background-color: #FFFFFF;
    border-color: var(--wood-700);
    box-shadow: var(--shadow-subtle);
  }
}

.drawer-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px solid var(--wood-300);
  color: var(--wood-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.drawer-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.drawer-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--wood-900);
}

.drawer-item-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.drawer-item-badge {
  background: var(--status-warning);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.drawer-item-chevron {
  color: var(--wood-400);
  flex-shrink: 0;
}

.drawer-env-box {
  background: var(--bg-card);
  border: 1.5px solid var(--wood-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  margin-top: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.drawer-env-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--wood-800);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.drawer-env-label svg {
  color: var(--zen-sage);
}

.env-toggle-group {
  display: flex;
  background: var(--wood-100);
  border: 1px solid var(--wood-300);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-env-opt {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-env-opt.active {
  background: var(--wood-800);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.save-modal-icon-wrap {
  width: 54px;
  height: 54px;
  background: var(--amber-bg);
  border: 2px solid var(--amber-border);
  border-radius: 50%;
  color: var(--amber-warm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem auto 0.85rem;
}

.save-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--wood-900);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--status-success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(47, 111, 72, 0.7);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 72, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(47, 111, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 111, 72, 0); }
}

.save-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

@media (min-width: 480px) {
  .save-modal-actions {
    flex-direction: row;
  }
}

.btn-text-dismiss {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 40px;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.85rem 0;
}

.pending-item {
  background: var(--wood-50);
  border: 1px solid var(--wood-200);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pending-actions-group {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.btn-edit-single {
  color: var(--wood-800);
}

.btn-edit-single:hover,
.btn-edit-single:active {
  background-color: var(--wood-100);
  border-color: var(--wood-300);
  color: var(--wood-950);
}

.btn-retry-single {
  color: var(--zen-sage-dark);
}

.btn-retry-single:hover,
.btn-retry-single:active {
  background-color: var(--zen-sage-bg);
  border-color: var(--zen-sage-border);
}

.btn-download-single {
  color: var(--wood-700);
}

.btn-download-single:hover,
.btn-download-single:active {
  background-color: var(--wood-100);
  border-color: var(--wood-300);
}

.btn-delete-single {
  color: var(--wood-400);
}

.btn-delete-single:hover,
.btn-delete-single:active {
  background-color: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error);
}
