.fa-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: #e8e8ea;
  direction: rtl;
  box-sizing: border-box;
}
.fa-wrap *, .fa-wrap *::before, .fa-wrap *::after { box-sizing: border-box; }

/* Placeholder styling — Phase 1 (brand pass comes in Phase 2 per spec §12) */
.fa-wrap { max-width: 860px; margin: 0 auto; }
.fa-wrap .fa-hero { text-align: center; margin-bottom: 28px; }
.fa-wrap .fa-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #fff; margin-bottom: 10px; }
.fa-wrap .fa-hero p { color: #9aa0ab; font-size: 1rem; line-height: 1.8; }

/* progress */
.fa-wrap .fa-progress { display: flex; gap: 6px; margin-bottom: 24px; }
.fa-wrap .fa-progress span { flex: 1; height: 5px; border-radius: 3px; background: #262b33; transition: background .25s; }
.fa-wrap .fa-progress span.on { background: #C5A880; }

/* screens */
.fa-wrap .fa-screen { display: none; animation: fade .35s ease; }
.fa-wrap .fa-screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.fa-wrap .card { background: #181c22; border: 1px solid #262b33; border-radius: 14px; padding: 24px; margin-bottom: 18px; }
.fa-wrap .card h2 { font-size: 1.15rem; color: #fff; margin-bottom: 6px; }
.fa-wrap .hint { font-size: .82rem; color: #9aa0ab; line-height: 1.7; margin-bottom: 14px; }

.fa-wrap label.fl { display: block; font-size: .85rem; color: #cfd3da; margin: 14px 0 6px; font-weight: 600; }
.fa-wrap input[type=text], .fa-wrap input[type=number], .fa-wrap select {
  width: 100%; padding: 11px 13px; background: #101216; color: #fff;
  border: 1px solid #2c333d; border-radius: 9px; font-size: .95rem;
}
.fa-wrap input:focus, .fa-wrap select:focus { outline: none; border-color: #C5A880; }
.fa-wrap input.warn { border-color: #e53935; }
.fa-wrap .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fa-wrap .field-err { display: none; color: #ef5350; font-size: .8rem; margin-top: 8px; }
.fa-wrap .field-err.show { display: block; }
.fa-wrap .pair-warn { display: none; color: #ffb74d; font-size: .78rem; margin-top: 10px; line-height: 1.6; }
.fa-wrap .pair-warn.show { display: block; }

/* stages / segments rows */
.fa-wrap .row-grid { display: grid; grid-template-columns: 1.4fr 1fr 34px; gap: 10px; align-items: center; margin-bottom: 10px; }
.fa-wrap .seg-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 34px; gap: 8px; align-items: center; margin-bottom: 10px; }
.fa-wrap .icon-btn { width: 34px; height: 38px; border: 1px solid #2c333d; background: transparent; color: #9aa0ab; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.fa-wrap .icon-btn:hover { color: #ef5350; border-color: #ef5350; }
.fa-wrap .ghost-btn { background: transparent; border: 1px dashed #3a424d; color: #9aa0ab; padding: 10px 16px; border-radius: 9px; cursor: pointer; width: 100%; margin-top: 4px; font-size: .88rem; }
.fa-wrap .ghost-btn:hover { color: #C5A880; border-color: #C5A880; }

/* slider rows */
.fa-wrap .tgt-row { display: grid; grid-template-columns: 1.2fr 1fr 90px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #20252c; }
.fa-wrap .tgt-row:last-child { border-bottom: none; }
.fa-wrap .tgt-label { font-size: .88rem; color: #cfd3da; }
.fa-wrap .tgt-label small { display: block; color: #7d838d; font-size: .74rem; margin-top: 3px; }
.fa-wrap input[type=range] { width: 100%; accent-color: #C5A880; }

/* nav */
.fa-wrap .nav-btns { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.fa-wrap .btn { padding: 13px 30px; border: none; border-radius: 9px; font-size: .95rem; font-weight: 700; cursor: pointer; background: linear-gradient(135deg,#d9bc8f,#C5A880); color: #17140e; }
.fa-wrap .btn:hover { filter: brightness(1.07); }
.fa-wrap .btn.ghost { background: transparent; color: #e8e8ea; border: 1px solid #3a424d; }
.fa-wrap .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== results ===== */
.fa-wrap .res-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.fa-wrap .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.fa-wrap .kpi { background: #181c22; border: 1px solid #262b33; border-radius: 12px; padding: 16px; text-align: center; }
.fa-wrap .kpi .v { font-size: 1.45rem; font-weight: 800; color: #fff; margin: 6px 0 4px; }
.fa-wrap .kpi.good .v { color: #66bb6a; } .kpi.bad .v { color: #ef5350; }
.fa-wrap .kpi .l { font-size: .76rem; color: #9aa0ab; }

.fa-wrap .sec-title { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; color: #fff; margin: 26px 0 12px; }

/* funnel viz */
.fa-wrap .funnel-stage { margin-bottom: 4px; }
.fa-wrap .fs-bar { height: 44px; border-radius: 8px; background: linear-gradient(135deg, rgba(197,168,128,.85), rgba(197,168,128,.55)); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; min-width: 120px; }
.fa-wrap .funnel-stage.leak .fs-bar { background: linear-gradient(135deg, rgba(229,57,53,.75), rgba(229,57,53,.45)); outline: 1px solid #ef5350; }
.fa-wrap .fs-bar b { color: #17140e; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.fa-wrap .fs-bar span { color: #17140e; font-weight: 800; font-size: .95rem; }
.fa-wrap .fs-between { display: flex; gap: 14px; color: #9aa0ab; font-size: .76rem; padding: 5px 14px 9px; }
.fa-wrap .leak-badge { font-size: .68rem; background: rgba(229,57,53,.15); color: #ef5350; border: 1px solid rgba(229,57,53,.4); padding: 2px 8px; border-radius: 10px; }

/* tables */
.fa-wrap table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.fa-wrap th { color: #9aa0ab; font-weight: 600; text-align: right; padding: 8px 10px; border-bottom: 1px solid #262b33; font-size: .76rem; }
.fa-wrap td { padding: 9px 10px; border-bottom: 1px solid #20252c; color: #dfe2e7; }
.fa-wrap tr.top-fix td { background: rgba(197,168,128,.08); }
.fa-wrap tr.top-fix td:first-child { border-right: 3px solid #C5A880; }
.fa-wrap .tag { font-size: .66rem; padding: 2px 8px; border-radius: 9px; white-space: nowrap; }
.fa-wrap .tag.best { background: rgba(102,187,106,.15); color: #81c784; border: 1px solid rgba(102,187,106,.4); }
.fa-wrap .tag.worst { background: rgba(239,83,80,.12); color: #ef5350; border: 1px solid rgba(239,83,80,.4); }
.fa-wrap td input[type=number] { width: 86px; padding: 6px 8px; font-size: .84rem; }

.fa-wrap .verdict { font-size: .72rem; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
.fa-wrap .v-elite { background: rgba(102,187,106,.18); color: #81c784; }
.fa-wrap .v-on_target { background: rgba(197,168,128,.15); color: #d9bc8f; }
.fa-wrap .v-below_target { background: rgba(255,167,38,.14); color: #ffa726; }
.fa-wrap .v-off_target { background: rgba(239,83,80,.14); color: #ef5350; }

.fa-wrap .score-big { font-size: 2rem; font-weight: 800; color: #C5A880; }

/* diagnostics */
.fa-wrap .diag { display: flex; flex-direction: column; gap: 10px; }
.fa-wrap .diag-item { display: flex; gap: 12px; padding: 13px 15px; border-radius: 10px; font-size: .87rem; line-height: 1.7; align-items: flex-start; }
.fa-wrap .d-strength { background: rgba(102,187,106,.07); border: 1px solid rgba(102,187,106,.3); }
.fa-wrap .d-watch { background: rgba(255,167,38,.06); border: 1px solid rgba(255,167,38,.3); }
.fa-wrap .d-risk { background: rgba(239,83,80,.07); border: 1px solid rgba(239,83,80,.35); }

/* glossary */
.fa-wrap .gq { display: inline-flex; width: 17px; height: 17px; border-radius: 50%; border: 1px solid #4a525d; color: #9aa0ab; background: transparent; font-size: .68rem; align-items: center; justify-content: center; cursor: help; vertical-align: middle; margin-inline-start: 5px; }
.fa-wrap .gq:hover { color: #C5A880; border-color: #C5A880; }
.fa-wrap #glossPop { position: fixed; z-index: 50; max-width: 280px; background: #22272f; border: 1px solid #3a424d; color: #e8e8ea; padding: 12px 14px; border-radius: 10px; font-size: .8rem; line-height: 1.7; display: none; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

.fa-wrap .summary-line { background: #181c22; border: 1px solid #262b33; border-radius: 10px; padding: 13px 16px; font-size: .86rem; color: #cfd3da; line-height: 1.8; margin-top: 12px; }
.fa-wrap .fix-beats { color: #81c784; font-weight: 700; }
.fa-wrap .traffic-beats { color: #ffa726; font-weight: 700; }

@media (max-width: 700px) {
.fa-wrap .kpis { grid-template-columns: repeat(2, 1fr); }
.fa-wrap .grid2 { grid-template-columns: 1fr; }
.fa-wrap .seg-row { grid-template-columns: 1fr 1fr; }
.fa-wrap .tgt-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- AI reading ---------- */
.ai-card { background: linear-gradient(135deg, rgba(197,168,128,.10), rgba(197,168,128,.02)) !important; border: 1px solid rgba(197,168,128,.35) !important; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 700; color: #d9bc8f; font-size: .95rem; }
.ai-text { line-height: 1.95; font-size: .9rem; color: #e8e8ea; white-space: pre-wrap; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: #9aa0ab; font-size: .85rem; padding: 6px 0; }
.ai-dots span { width: 7px; height: 7px; border-radius: 50%; background: #C5A880; display: inline-block; margin-inline-end: 4px; animation: faBlink 1.2s infinite ease-in-out; }
.ai-dots span:nth-child(2) { animation-delay: .2s; }
.ai-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes faBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-retry { background: none; border: none; color: #C5A880; cursor: pointer; text-decoration: underline; font-size: .85rem; padding: 0; font-family: inherit; }
.ai-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.ai-wa { display: inline-flex; align-items: center; gap: 8px; background: #25D366; color: #0f1512; padding: 11px 20px; border-radius: 9px; font-weight: 800; text-decoration: none; font-size: .88rem; transition: filter .2s, transform .2s; }
.ai-wa:hover { filter: brightness(1.07); transform: translateY(-1px); color: #0f1512; }
.ai-note { font-size: .75rem; color: #9aa0ab; margin-top: 12px; line-height: 1.6; }
