/* ============================================================
   KAEDRIA PROMPT MAKER — Onyx & Or
   Layout glassmorphism plein ecran, Naya en background
============================================================ */

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

:root {
  --onyx:        #0E0E10;
  --onyx-soft:   #1a1a1d;
  --graphite:    #3D3D40;
  --gold:        #B08D57;
  --gold-bright: #d4a96d;
  --gold-deep:   #8a6d40;
  --ivoire:      #F4EDE4;
  --bordeaux:    #6B1D2A;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--onyx);
  color: var(--ivoire);
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYER 1 — NAYA PLEIN ECRAN (16:9)
============================================================ */
.naya-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  transition: transform 700ms cubic-bezier(.4, 0, .2, 1), opacity 600ms;
  transform-origin: center bottom;
  will-change: transform;
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 6%,
    black 18%,
    black 82%,
    rgba(0, 0, 0, 0.6) 94%,
    transparent 100%
  );
  mask-image: linear-gradient(to right,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 6%,
    black 18%,
    black 82%,
    rgba(0, 0, 0, 0.6) 94%,
    transparent 100%
  );
}

/* Positions de Naya selon la vue
   - home : Naya legerement a gauche, accueille les cards a droite
   - wizard : Naya a droite, listening, cards a gauche
   - result : Naya legerement a gauche, presente vers la droite
   - library : Naya a son bureau a gauche, cards a droite */
/* Naya : positions revisitees pour que les poses 16:9 restent dans le cadre
   et ne soient pas masquees par les cards UI.
   Les poses ont deja la composition intrinseque (left/right/center),
   on ajuste juste finement ici. */
body.view-home    .naya-stage { transform: translateX(0%); }
body.view-wizard  .naya-stage { transform: translateX(0%); }
/* naya-pose5-presente.png (photo refaite) est deja cadree a GAUCHE comme
   les autres poses : l'ancien decalage -18% (pour une pose autrefois cadree
   a droite) la poussait hors champ. */
body.view-result  .naya-stage { transform: translateX(0%); }
body.view-library .naya-stage { transform: translateX(0%); }

.naya-pose {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(.4, 0, .2, 1);
  animation: naya-breathe 5s ease-in-out infinite;
}
.naya-pose-active { opacity: 1; }

@keyframes naya-breathe {
  0%, 100% { transform: scale(1.0); }
  50%      { transform: scale(1.012); }
}

/* ============================================================
   LAYER 2 — MESH GRADIENT ANIME
============================================================ */
.mesh-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 28%, rgba(176, 141, 87, 0.13) 0%, transparent 42%),
    radial-gradient(ellipse at 78% 72%, rgba(107, 29, 42, 0.11) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 105%, rgba(176, 141, 87, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 10%, rgba(212, 169, 109, 0.06) 0%, transparent 35%);
  animation: mesh-drift 22s ease-in-out infinite alternate;
  will-change: transform, background-position;
}

@keyframes mesh-drift {
  0%   { transform: scale(1)    translate(0,   0);   }
  50%  { transform: scale(1.04) translate(2%,  -1%); }
  100% { transform: scale(1.02) translate(-2%, 2%);  }
}

/* ============================================================
   LAYER 3 — PARTICULES DOREES
============================================================ */
.particles {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-bright);
  opacity: 0;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 0px)); opacity: 0; }
}

/* ============================================================
   LAYER 4 — UI GLASSMORPHISM
============================================================ */
.ui-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 28px 44px;
  pointer-events: none;
}

.ui-layer > *,
.ui-layer button,
.ui-layer .glass,
.ui-layer .back-btn {
  pointer-events: auto;
}

/* ---------- En-tete brand ---------- */
.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.brand-mark    { font-size: 22px; color: var(--gold-bright); text-shadow: 0 0 16px rgba(212, 169, 109, 0.55); }
.brand-name    { color: var(--gold-bright); }
.brand-sep     { color: var(--graphite); margin: 0 2px; font-size: 24px; }
.brand-product {
  color: var(--ivoire);
  font-style: italic;
  letter-spacing: 0.05em;
  text-transform: none;
  font-size: 26px;
  font-weight: 400;
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: rgba(14, 14, 16, 0.55);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  border: 1px solid rgba(176, 141, 87, 0.22);
  border-radius: 20px;
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(244, 237, 228, 0.06);
  transition: border-color 300ms, box-shadow 300ms;
}
.glass:hover {
  border-color: rgba(176, 141, 87, 0.5);
  box-shadow:
    0 28px 70px -18px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(176, 141, 87, 0.25),
    inset 0 1px 0 rgba(244, 237, 228, 0.10);
}

/* ============================================================
   VUES
============================================================ */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding-top: 28px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms, transform 400ms;
}
.view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  animation: view-fade-in 600ms cubic-bezier(.4, 0, .2, 1);
}
@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   VUE HOME — Welcome card + grille 8 usages
   Cards a DROITE (Naya est a gauche), grille compacte
============================================================ */
.view-home {
  align-items: flex-end;
  padding-right: 20px;
}

.welcome-card {
  max-width: 540px;
  padding: 36px 40px 30px;
  margin-bottom: 22px;
}

.greeting-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--gold-bright);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.greeting-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.1;
  color: var(--ivoire);
  margin-bottom: 14px;
}
.greeting-sub {
  font-size: 14px;
  font-weight: 300;
  color: rgba(244, 237, 228, 0.75);
  line-height: 1.55;
  max-width: 480px;
}

/* ---------- Grille des 8 usages ---------- */
.usages-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin-bottom: 18px;
}

.usage-card {
  background: rgba(14, 14, 16, 0.55);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(176, 141, 87, 0.22);
  border-radius: 14px;
  padding: 16px 14px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: all 250ms;
  min-height: 130px;
}
.usage-card:hover {
  border-color: rgba(212, 169, 109, 0.55);
  background: rgba(14, 14, 16, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -10px rgba(176, 141, 87, 0.25);
}
.usage-icon {
  font-size: 24px;
  color: var(--gold-bright);
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(212, 169, 109, 0.35);
  line-height: 1;
}
.usage-label {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--ivoire);
  line-height: 1.2;
  margin-bottom: 5px;
}
.usage-desc {
  font-size: 11px;
  color: rgba(244, 237, 228, 0.6);
  line-height: 1.4;
}

.home-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 720px;
}
.llm-status {
  font-size: 11px;
  font-style: italic;
  color: rgba(244, 237, 228, 0.45);
  letter-spacing: 0.05em;
}
.llm-status.on  { color: var(--gold-bright); }
.llm-status.off { color: rgba(244, 237, 228, 0.45); }

/* ============================================================
   VUE WIZARD — questionnaire etape par etape
============================================================ */
.view-wizard {
  align-items: flex-start;
  padding-left: 20px;
}

.wizard-card {
  width: 540px;
  max-width: 92vw;
  max-height: 84vh;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 12px;
}
.wizard-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
}
.wizard-progress {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 237, 228, 0.5);
  margin-top: 3px;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 18px;
}
.wizard-body::-webkit-scrollbar { width: 5px; }
.wizard-body::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, 0.3); border-radius: 3px; }

.step-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ivoire);
  margin-bottom: 10px;
  line-height: 1.15;
}
.step-question {
  font-size: 14px;
  color: rgba(244, 237, 228, 0.8);
  line-height: 1.5;
  margin-bottom: 18px;
}

/* ---------- Options select ---------- */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.option-item {
  background: rgba(244, 237, 228, 0.03);
  border: 1px solid rgba(176, 141, 87, 0.16);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 200ms;
}
.option-item:hover {
  background: rgba(176, 141, 87, 0.1);
  border-color: rgba(176, 141, 87, 0.45);
}
.option-item.selected {
  background: rgba(176, 141, 87, 0.16);
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(176, 141, 87, 0.3);
}
.option-label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ivoire);
  display: block;
  margin-bottom: 3px;
}
.option-desc {
  font-size: 12px;
  color: rgba(244, 237, 228, 0.6);
  line-height: 1.4;
}

/* Champ "autre" custom */
.other-input-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 6px;
}
.other-input-wrap .form-input { flex: 1; }

/* ---------- Bouton "suggere via Claude" ---------- */
.btn-llm-suggest {
  background: transparent;
  border: 1px dashed rgba(212, 169, 109, 0.5);
  border-radius: 100px;
  padding: 8px 16px;
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 200ms;
  margin-bottom: 12px;
}
.btn-llm-suggest:hover:not(:disabled) {
  background: rgba(176, 141, 87, 0.12);
  border-style: solid;
  border-color: var(--gold-bright);
}
.btn-llm-suggest:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-llm-suggest .spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   FORMULAIRE FIELDS
============================================================ */
.form-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 237, 228, 0.55);
  margin-bottom: 7px;
  font-weight: 400;
}

.form-input,
.form-textarea {
  width: 100%;
  background: rgba(14, 14, 16, 0.5);
  border: 1px solid rgba(176, 141, 87, 0.28);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--ivoire);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 200ms, background 200ms, box-shadow 200ms;
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font-body);
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--gold-bright);
  background: rgba(14, 14, 16, 0.7);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.12);
}

/* ============================================================
   BOUTONS
============================================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold-bright));
  color: var(--onyx);
  border: none;
  border-radius: 100px;
  padding: 12px 26px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
  box-shadow: 0 6px 20px -8px rgba(176, 141, 87, 0.6);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -8px rgba(212, 169, 109, 0.8);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 100px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-bright);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 200ms;
  white-space: nowrap;
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(176, 141, 87, 0.12);
  border-color: var(--gold-bright);
}
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.back-btn {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 100px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--gold-bright);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 200ms;
}
.back-btn:hover {
  border-color: var(--gold-bright);
  background: rgba(176, 141, 87, 0.12);
  color: var(--ivoire);
}

.btn-icon {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--gold-bright);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms;
}
.btn-icon:hover {
  background: rgba(176, 141, 87, 0.15);
  border-color: var(--gold-bright);
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(176, 141, 87, 0.15);
}

/* ============================================================
   VUE RESULT — prompt fini
============================================================ */
.view-result {
  align-items: flex-end;
  padding-right: 20px;
}

.result-card {
  width: 640px;
  max-width: 92vw;
  max-height: 86vh;
  padding: 28px 32px 22px;
  display: flex;
  flex-direction: column;
}

.result-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 8px;
  margin-right: -8px;
}
.result-body::-webkit-scrollbar { width: 8px; }
.result-body::-webkit-scrollbar-track { background: rgba(176, 141, 87, 0.05); border-radius: 4px; }
.result-body::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, 0.4); border-radius: 4px; }
.result-body::-webkit-scrollbar-thumb:hover { background: var(--gold-bright); }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}
.result-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--gold-bright);
}
.result-subtitle {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 237, 228, 0.5);
  margin-top: 3px;
}

.result-prompt {
  width: 100%;
  min-height: 160px;
  max-height: 280px;
  background: rgba(14, 14, 16, 0.6);
  border: 1px solid rgba(176, 141, 87, 0.28);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--ivoire);
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  overflow-y: auto;
}
.result-prompt:focus {
  border-color: var(--gold-bright);
  background: rgba(14, 14, 16, 0.8);
}

/* ============================================================
   BLOCS COPIABLES individuellement (kaedria-agent + multi-prompts)
============================================================ */
.result-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.result-block {
  background: rgba(14, 14, 16, 0.7);
  border: 1px solid rgba(176, 141, 87, 0.32);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 200ms, box-shadow 200ms;
}
.result-block:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 6px 20px -8px rgba(176, 141, 87, 0.35);
}
.result-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}
.result-block-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.result-block-file {
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 11px;
  color: rgba(244, 237, 228, 0.6);
  letter-spacing: 0.04em;
  display: block;
  margin-top: 2px;
}
.result-block-preview {
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(244, 237, 228, 0.6);
  max-height: 90px;
  overflow: hidden;
  position: relative;
  white-space: pre-wrap;
}
.result-block-preview::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 32px;
  background: linear-gradient(to bottom, transparent, rgba(14, 14, 16, 0.7));
  pointer-events: none;
}
.result-block-copy {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold-bright));
  color: var(--onyx);
  border: none;
  border-radius: 100px;
  padding: 7px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 150ms, box-shadow 150ms;
  white-space: nowrap;
}
.result-block-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px rgba(212, 169, 109, 0.6);
}
.result-block-copy.copied {
  background: var(--gold-bright);
  color: var(--onyx);
}

.result-meta-row {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}
.result-meta-row .form-label {
  flex: 1;
  margin: 0;
}
.result-meta-row .form-input { margin-top: 4px; }

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(176, 141, 87, 0.15);
}
.result-actions > div { display: flex; gap: 10px; }
.result-status {
  font-size: 12px;
  font-style: italic;
  color: var(--gold-bright);
  margin-top: 10px;
  min-height: 18px;
}

/* ============================================================
   VUE LIBRARY — prompts sauvegardes
============================================================ */
.view-library {
  align-items: flex-end;
  padding-right: 20px;
}

.lib-card {
  width: 640px;
  max-width: 92vw;
  max-height: 84vh;
  padding: 26px 0 18px;
  display: flex;
  flex-direction: column;
}

.lib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px 16px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.14);
  gap: 14px;
}
.lib-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--gold-bright);
}
.lib-header-actions { display: flex; gap: 10px; align-items: center; }

.lib-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 32px 0;
}
.lib-content::-webkit-scrollbar { width: 6px; }
.lib-content::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, 0.3); border-radius: 3px; }

.lib-empty {
  text-align: center;
  font-style: italic;
  color: rgba(244, 237, 228, 0.55);
  padding: 32px 16px;
  font-size: 14px;
  line-height: 1.6;
}

.lib-usage-group { margin-bottom: 22px; }
.lib-usage-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ivoire);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.lib-count {
  font-size: 11px;
  font-style: italic;
  color: rgba(244, 237, 228, 0.4);
  letter-spacing: 0.05em;
}

.lib-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(244, 237, 228, 0.03);
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 200ms;
  margin-bottom: 6px;
}
.lib-entry:hover {
  background: rgba(244, 237, 228, 0.06);
  border-color: rgba(176, 141, 87, 0.2);
}
.lib-entry-info { flex: 1; min-width: 0; }
.lib-entry-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ivoire);
  font-style: italic;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-entry-meta {
  font-size: 11px;
  color: rgba(244, 237, 228, 0.5);
  letter-spacing: 0.04em;
}

/* ============================================================
   MODAL preview
============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: fade-in 200ms;
}
.modal-backdrop[hidden] { display: none; }
.modal-content {
  width: 720px;
  max-width: 96vw;
  max-height: 88vh;
  padding: 24px 28px 20px;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-bright);
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1400px) {
  body.view-home    .naya-stage { opacity: 0.78; }
  body.view-wizard  .naya-stage { opacity: 0.78; }
  body.view-result  .naya-stage { transform: translateX(0%); opacity: 0.78; }
  body.view-library .naya-stage { opacity: 0.78; }
}

@media (max-width: 1100px) {
  .brand-header   { font-size: 22px; gap: 10px; }
  .brand-product  { font-size: 20px; }
  .greeting-title { font-size: 34px; }
  .welcome-card   { padding: 28px 28px 24px; max-width: 460px; }
  .usages-grid    { grid-template-columns: repeat(2, 1fr); max-width: 460px; }
  .wizard-card, .result-card, .lib-card { width: 460px; }

  body.view-home    .naya-stage,
  body.view-wizard  .naya-stage,
  body.view-result  .naya-stage,
  body.view-library .naya-stage {
    transform: scale(0.85);
    transform-origin: center bottom;
    opacity: 0.6;
  }
}

@media (max-width: 720px) {
  .brand-header {
    font-size: 16px;
    gap: 6px;
    letter-spacing: 0.08em;
    justify-content: center;
    width: 100%;
  }
  .brand-mark    { font-size: 13px; }
  .brand-product { font-size: 15px; }
  .brand-sep     { font-size: 14px; }

  .naya-stage {
    transform: none !important;
    opacity: 0.3;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
  }

  html, body { overflow-y: auto; height: auto; min-height: 100%; }
  .ui-layer {
    position: relative;
    padding: 16px 12px 22px;
    min-height: 100vh;
  }
  .view {
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    align-items: stretch !important;
  }
  .welcome-card, .usages-grid, .wizard-card, .result-card, .lib-card {
    width: 100%;
    max-width: none;
  }
  .welcome-card  { margin: 14px 0 18px; padding: 22px 18px; }
  .greeting-title { font-size: 26px; line-height: 1.15; }
  .greeting-eyebrow { font-size: 16px; }
  .usages-grid   { grid-template-columns: 1fr; }
  .usage-card    { min-height: auto; padding: 14px 16px; }

  .wizard-card, .result-card { padding: 22px 18px; max-height: none; overflow-y: visible; }
  .wizard-body { padding-right: 0; }
  .wizard-footer { flex-direction: column-reverse; gap: 8px; align-items: stretch; }
  .wizard-footer > * { width: 100%; }

  .result-meta-row { flex-direction: column; gap: 12px; }
  .result-actions  { flex-direction: column; align-items: stretch; }
  .result-actions .btn-primary,
  .result-actions .btn-secondary,
  .result-actions .back-btn { width: 100%; }

  .lib-card { padding: 20px 0 16px; max-height: 80vh; }
  .lib-header { padding: 0 18px 12px; }
  .lib-content { padding: 12px 18px 0; }

  .form-input, .form-textarea { font-size: 16px; }
}

@media (max-width: 380px) {
  .greeting-title { font-size: 22px; }
  .result-title, .lib-title { font-size: 22px; }
  .brand-product { font-size: 13px; }
}
