/* ── Base ── */
#lullaby-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #1a202c;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 100px;
  min-height: 100vh;
}
#lullaby-app h1,
#lullaby-app h2,
#lullaby-app h3,
#lullaby-app h4 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  line-height: 1.25;
}

/* ── Mobile overlay ── */
#lullaby-mobile-block {
  display: none;
  position: fixed; inset: 0;
  background: #fff;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

/* ── Screen transitions ── */
.ll-screen { animation: ll-fade 0.35s ease; }
@keyframes ll-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Institution badge ── */
.ll-logo-bar { margin-bottom: 28px; }
.ll-institution {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(26,58,92,.07);
  border: 1px solid rgba(26,58,92,.15);
  color: #1a3a5c;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: .75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}

/* ── Cover ── */
.ll-cover h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  color: #0d1f3c;
  margin-bottom: 18px;
}
.ll-cover p {
  color: #4a5568;
  margin-bottom: 14px;
  max-width: 640px;
}
.ll-cover-body { max-width: 640px; }

/* ── Info grid (cover) ── */
.ll-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0 32px;
}
.ll-info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f4f7fb;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
}
.ll-info-item svg { flex-shrink: 0; color: #1a3a5c; }
.ll-info-item strong {
  display: block;
  font-size: .95rem;
  color: #0d1f3c;
  margin-bottom: 2px;
}
.ll-info-item span { font-size: .8rem; color: #64748b; }

/* ── Buttons ── */
.ll-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px;
  border: none; border-radius: 6px;
  font-size: 1rem; cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 600;
}
.ll-btn-primary  { background: #059669; color: #fff; box-shadow: 0 2px 12px rgba(5,150,105,.3); }
.ll-btn-primary:hover  { background: #047857; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(5,150,105,.4); }
.ll-btn-primary:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; transform: none; }
.ll-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.ll-btn-secondary:hover { background: #e2e8f0; }
.ll-btn-ghost {
  background: transparent; color: #94a3b8;
  font-size: .9rem; padding: 0; border: none;
  cursor: pointer; font-family: inherit; font-weight: 400;
  text-decoration: underline; text-underline-offset: 3px;
}
.ll-btn-ghost:hover { color: #64748b; }

/* ── Forms ── */
.ll-form-section {
  margin-bottom: 40px;
  border-top: 1px solid #e2e8f0;
  padding-top: 28px;
}
.ll-form-section:first-of-type { border-top: none; padding-top: 0; }
.ll-form-section h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: .75rem; color: #64748b;
  text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; margin-bottom: 20px;
}
.ll-field { margin-bottom: 20px; }
.ll-field label {
  display: block; font-size: .9rem;
  margin-bottom: 7px; font-weight: 600; color: #1a202c;
}
.ll-field input[type=text],
.ll-field input[type=email],
.ll-field select,
.ll-field textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: .95rem; font-family: inherit;
  box-sizing: border-box; color: #1a202c;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.ll-field input[type=text]:focus,
.ll-field input[type=email]:focus,
.ll-field select:focus,
.ll-field textarea:focus {
  outline: none;
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.ll-field select { background: #fff; }
.ll-field-row { display: grid; grid-template-columns: 1fr 100px; gap: 12px; }

.ll-radio-group label {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; cursor: pointer; font-size: .95rem; color: #374151;
}
.ll-radio-group input[type=radio] { accent-color: #059669; width: 16px; height: 16px; cursor: pointer; }

.ll-radio-stacked label {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all .15s;
  cursor: pointer;
  font-size: .95rem; color: #374151;
}
.ll-radio-stacked label:hover { background: #f8faff; border-color: #c7d7f0; }
.ll-radio-stacked input[type=radio] { accent-color: #059669; width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }

.ll-subtitle { color: #64748b; margin-top: -8px; margin-bottom: 28px; font-size: .9rem; }
.ll-form-actions { padding-top: 28px; border-top: 1px solid #f1f5f9; }

/* ── Likert ── */
.ll-likert-row {
  display: flex; gap: 6px; align-items: center;
  margin-top: 10px; flex-wrap: wrap;
}
.ll-likert-opt {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
}
.ll-likert-opt input[type=radio] { accent-color: #059669; width: 18px; height: 18px; cursor: pointer; }
.ll-likert-opt span { font-size: .8rem; color: #64748b; }
.ll-likert-labeled { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.ll-likert-anchor-left, .ll-likert-anchor-right { font-size: .82rem; color: #94a3b8; white-space: nowrap; }
.ll-likert-label { font-weight: normal; color: #64748b; font-size: .88rem; }

/* ── Question blocks ── */
.ll-question-block {
  margin-bottom: 28px; padding: 22px 24px;
  background: #fafbfc;
  border-left: 3px solid #1a3a5c;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ll-q-number {
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: #94a3b8; margin: 0 0 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ll-q-text {
  font-family: Georgia, serif;
  font-size: 1rem; margin: 0 0 18px; color: #0d1f3c; line-height: 1.6;
}
.ll-optional { border-left-color: #cbd5e1; background: #f9fafb; }
.ll-optional-label { font-weight: normal; color: #94a3b8; font-size: .88rem; }
.ll-optional textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 6px;
  font-family: inherit; font-size: .95rem;
  resize: vertical; transition: border-color .15s, box-shadow .15s;
}
.ll-optional textarea:focus {
  outline: none; border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}

/* ── CIM Reader ── */
.ll-cim-reader { border: 1px solid #dde3ea; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 16px rgba(0,0,0,.07); }
.ll-cim-header {
  display: flex; justify-content: space-between; align-items: center;
  background: #0d1f3c; color: #fff; padding: 14px 22px; font-size: .88rem;
}
.ll-cim-confidential {
  font-size: .75rem; opacity: .7;
  border: 1px solid rgba(255,255,255,.25); padding: 3px 9px; border-radius: 4px;
  letter-spacing: .04em;
}
.ll-tabs-nav {
  display: flex; background: #f4f7fb;
  border-bottom: 1px solid #dde3ea; overflow-x: auto;
}
.ll-tab-btn {
  padding: 13px 20px; border: none; background: transparent; cursor: pointer;
  font-size: .88rem; color: #64748b; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  font-family: inherit; transition: all .15s; font-weight: 500;
}
.ll-tab-btn:hover  { color: #1a3a5c; background: #eaf0f8; }
.ll-tab-btn.active { color: #1a3a5c; font-weight: 700; border-bottom-color: #1a3a5c; background: #fff; }
.ll-tab-alpha        { color: #1a3a5c !important; }
.ll-tab-alpha.active { border-bottom-color: #2563eb !important; }
.ll-tabs-content { background: #fff; }
.ll-tab-panel { display: none; padding: 32px 40px; max-height: 580px; overflow-y: auto; }
.ll-tab-panel.active { display: block; }
.ll-cim-footer {
  padding: 18px 40px; background: #f7f9fc;
  border-top: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 20px;
}
.ll-footer-note { font-size: .82rem; color: #94a3b8; margin: 0; }

/* ── Financial tables ── */
.ll-financial-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: .88rem; }
.ll-financial-table th { background: #1a3a5c; color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.ll-financial-table th:not(:first-child) { text-align: right; }
.ll-financial-table td { padding: 8px 14px; border-bottom: 1px solid #f0f4f8; }
.ll-financial-table td:not(:first-child) { text-align: right; font-family: 'Courier New', monospace; }
.ll-row-subtotal td { font-weight: 700; background: #eef3ff; border-top: 2px solid #1a3a5c; }
.ll-row-total    td { font-weight: 700; background: #1a3a5c; color: #fff; }
.ll-row-header   td { background: #e8edf5; font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #1a3a5c; }
.ll-row-indent td:first-child { padding-left: 28px; color: #64748b; font-size: .86rem; }
.ll-row-spacer td { height: 14px; background: #fff; border: none; }
.ll-table-unit { font-size: .82rem; color: #94a3b8; margin: 0 0 4px; }
.ll-margins-box {
  background: #f7f9fc; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 14px 18px; margin-top: 16px;
}
.ll-margins-box ul { margin: 6px 0 0; padding-left: 20px; }
.ll-audit-signature { margin-top: 32px; padding-top: 20px; border-top: 1px solid #e2e8f0; font-size: .88rem; }

/* ── Document sections ── */
.ll-doc-section h2 { font-size: 1.15rem; color: #1a3a5c; margin-top: 32px; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; }
.ll-doc-section h3 { font-size: .98rem; color: #1a3a5c; margin-top: 22px; }
.ll-doc-section h4 { font-size: .93rem; margin-top: 18px; color: #374151; }
.ll-doc-cover    { text-align: center; padding: 24px 0 32px; }
.ll-doc-cover h1 { font-size: 1.35rem; margin-bottom: 12px; }

/* ── AlphaInvest AI panel ── */
.ll-alpha-section { background: #f8faff; }
.ll-alpha-header  {
  background: #0a1628; color: #fff;
  padding: 20px 24px; margin: -32px -40px 24px;
}
.ll-alpha-brand { font-size: 1.25rem; font-weight: 700; letter-spacing: .05em; margin-bottom: 10px; }
.ll-alpha-meta p { margin: 4px 0; font-size: .86rem; opacity: .85; }
.ll-alpha-accuracy { opacity: 1 !important; color: #7dd3fc; }
.ll-alpha-disclaimer { font-size: .78rem !important; opacity: .6 !important; border-top: 1px solid rgba(255,255,255,.15); padding-top: 8px; margin-top: 8px; }
.ll-alpha-recommendation {
  display: flex; align-items: center; gap: 16px;
  background: #1a3a5c; color: #fff;
  padding: 14px 20px; border-radius: 6px; margin-bottom: 24px;
}
.ll-rec-label  { font-size: .78rem; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.ll-rec-value  { font-size: 1.15rem; font-weight: 700; background: #059669; padding: 4px 14px; border-radius: 4px; }
.ll-rec-horizon { font-size: .83rem; opacity: .8; margin-left: auto; }

/* ── TCLE ── */
.ll-tcle-body {
  max-height: 52vh; overflow-y: auto; padding: 20px 24px;
  border: 1px solid #e2e8f0; border-radius: 8px; margin: 20px 0;
  background: #fafbfc; font-size: .93rem; line-height: 1.75;
}
.ll-tcle-body h3 { font-size: .95rem; margin-top: 22px; color: #1a3a5c; }
.ll-tcle-body p, .ll-tcle-body ul { margin-bottom: 10px; }
.ll-tcle-body ul { padding-left: 22px; }
.ll-tcle-consent { margin: 24px 0 20px; }
.ll-tcle-actions { display: flex; align-items: center; gap: 20px; }
.ll-checkbox-label {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 18px; background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: 8px;
  font-size: .93rem; color: #166534;
}
.ll-checkbox-label input {
  margin-top: 2px; flex-shrink: 0;
  accent-color: #059669; width: 16px; height: 16px;
}

/* ── Screener fail ── */
.ll-screener-fail { text-align: center; padding: 48px 20px; }
.ll-fail-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #f0f4f8; border: 2px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  color: #64748b;
}
.ll-optional-email { margin: 28px auto; max-width: 420px; text-align: left; }
.ll-optional-email input {
  width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0;
  border-radius: 6px; margin-top: 8px; font-size: .95rem;
  box-sizing: border-box; transition: border-color .15s;
}
.ll-optional-email input:focus { outline: none; border-color: #1a3a5c; box-shadow: 0 0 0 3px rgba(26,58,92,.1); }

/* ── Instructions ── */
.ll-instructions-block {
  background: #f4f7fb;
  border-left: 3px solid #1a3a5c;
  padding: 24px 28px; border-radius: 0 8px 8px 0;
  margin: 24px 0;
}
.ll-instructions-block h3 { font-size: .97rem; margin-top: 20px; color: #1a3a5c; }
.ll-instructions-block h3:first-child { margin-top: 0; }
.ll-instructions-block ul, .ll-instructions-block ol { padding-left: 22px; }
.ll-instructions-block li { margin-bottom: 6px; }

/* ── Debriefing ── */
.ll-debriefing h2 { margin-bottom: 10px; }
.ll-debriefing h3 { margin-top: 28px; font-size: .98rem; color: #1a3a5c; }
.ll-debriefing p { color: #374151; margin-bottom: 12px; }

/* ── Final / thank you ── */
.ll-final { text-align: center; padding: 16px 0; }
.ll-final-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #059669, #10b981);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  color: white;
  box-shadow: 0 4px 20px rgba(5,150,105,.35);
}
.ll-final h2 { color: #0d1f3c; margin-bottom: 14px; font-size: 1.8rem; }
.ll-final p { color: #4a5568; max-width: 560px; margin: 0 auto 14px; }
.ll-final-info {
  background: #f4f7fb; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 18px 24px;
  margin: 24px auto; max-width: 560px; text-align: left;
}
.ll-final-info p { margin-bottom: 8px; font-size: .93rem; }
.ll-final-info p:last-child { margin-bottom: 0; }
.ll-final-info a { color: #1a3a5c; }
.ll-final-signature { color: #94a3b8; font-size: .85rem; margin-top: 36px; }
.ll-consent-note { font-size: .85rem; color: #94a3b8; margin-top: 16px; line-height: 1.6; }

/* ── Already done / error screens ── */
.ll-already-done { text-align: center; padding: 60px 20px; }
.ll-already-done h2 { color: #0d1f3c; margin-bottom: 14px; }
.ll-already-done p { color: #64748b; max-width: 480px; margin: 0 auto 12px; }
.ll-already-done a { color: #1a3a5c; }

/* ── Progress bar ── */
.ll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: #e2e8f0; z-index: 9999; }
.ll-progress-bar { height: 100%; background: linear-gradient(90deg, #1a3a5c, #2563eb); transition: width 0.5s ease; }

/* ── Loading ── */
.ll-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 40px; color: #94a3b8; font-size: .93rem;
}
.ll-loading::before {
  content: '';
  width: 22px; height: 22px;
  border: 2px solid #e2e8f0; border-top-color: #1a3a5c;
  border-radius: 50%;
  animation: ll-spin 0.75s linear infinite;
  margin-right: 14px; flex-shrink: 0;
}
@keyframes ll-spin { to { transform: rotate(360deg); } }

/* ── Section titles (decision, attention etc.) ── */
.ll-screen > h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: #0d1f3c; margin-bottom: 10px;
}
.ll-screen > p { color: #4a5568; margin-bottom: 20px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  #lullaby-app { padding: 24px 16px 80px; }
  .ll-info-grid { grid-template-columns: 1fr; }
  .ll-tab-panel { padding: 20px 16px; }
  .ll-cim-footer { padding: 16px 20px; flex-direction: column; align-items: flex-start; }
}
