/* Expense Health Calculator — scoped under .ehc-wrap, follows theme identity (dark/gold) */
.ehc-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  font-family: inherit;
  color: #e8e8ea;
  direction: rtl;
  box-sizing: border-box;
}
.ehc-wrap *, .ehc-wrap *::before, .ehc-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }
.ehc-hero { text-align: center; margin-bottom: 26px; }
.ehc-kicker { display:inline-block; font-size:.78rem; letter-spacing:1px; color:#C5A880; background:rgba(197,168,128,.1); border:1px solid rgba(197,168,128,.3); padding:4px 12px; border-radius:14px; margin-bottom:10px; }
.ehc-h { font-size: clamp(1.5rem, 4.5vw, 2.1rem); color:#fff; margin-bottom:10px; line-height:1.35; }
.ehc-sub { color:#9aa0ab; font-size:.95rem; line-height:1.9; max-width:620px; margin-inline:auto; }

.ehc-card, .ehc-results > * { background:#181c22; border:1px solid #262b33; border-radius:14px; padding:22px; margin-bottom:18px; }

.ehc-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
.ehc-mt { margin-top:16px; }
.ehc-lb { display:block; font-size:.86rem; font-weight:700; color:#dfe2e7; margin-bottom:6px; }
.ehc-soft { color:#7d838d; font-weight:400; font-size:.76rem; }
.ehc-hint { font-size:.74rem; color:#7d838d; margin-top:6px; line-height:1.6; }
.ehc-cats { display:grid; grid-template-columns:repeat(2, 1fr); gap:10px 14px; }
.ehc-cat { display:flex; flex-direction:column; gap:4px; }
.ehc-cat .catlb { font-size:.78rem; color:#aeb3bc; }
.ehc-wrap input[type=text], .ehc-wrap input[type=email], .ehc-wrap select {
  width:100%; padding:11px 13px; background:#101216; color:#fff;
  border:1px solid #2c333d; border-radius:9px; font-size:.95rem; font-family:inherit;
}
.ehc-wrap input:focus, .ehc-wrap select:focus { outline:none; border-color:#C5A880; }

.ehc-reset { margin-top:18px; width:100%; background:transparent; border:1px dashed #3a424d; color:#9aa0ab; padding:10px; border-radius:9px; cursor:pointer; font-size:.82rem; font-family:inherit; }
.ehc-reset:hover { color:#C5A880; border-color:#C5A880; }
.ehc-privacy { margin-top:10px; font-size:.72rem; color:#7d838d; line-height:1.7; text-align:center; }
.ehc-foot { text-align:center; font-size:.7rem; color:#666c75; margin-top:8px; }

/* ===== results ===== */
.ehc-status { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.gauge { position:relative; width:190px; min-width:150px; }
.gauge svg { display:block; inline-size:100%; }
.gauge-val { position:absolute; inset-inline:0; top:52%; text-align:center; }
.gauge-val b { font-size:1.7rem; color:#fff; display:block; line-height:1; }
.gauge-val span { font-size:.68rem; color:#9aa0ab; }
.st-badge { display:inline-flex; align-items:center; gap:8px; padding:9px 16px; border-radius:10px; font-weight:800; font-size:.95rem; }
.st-healthy { background:rgba(102,187,106,.14); color:#81c784; border:1px solid rgba(102,187,106,.45); }
.st-watch   { background:rgba(255,167,38,.12); color:#ffa726; border:1px solid rgba(255,167,38,.45); }
.st-critical{ background:rgba(239,83,80,.12); color:#ef5350; border:1px solid rgba(239,83,80,.5); }
.st-line { flex:1 1 260px; font-size:.92rem; line-height:1.85; color:#e8e8ea; }
.st-bench { font-size:.75rem; color:#9aa0ab; margin-top:6px; }

.verdict { margin-top:14px; padding:13px 15px; border-radius:10px; font-size:.88rem; line-height:1.85; background:rgba(255,255,255,.03); border:1px solid #2c333d; }

.kpis { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:16px; }
.kpi { background:#101216; border:1px solid #262b33; border-radius:11px; padding:14px; text-align:center; }
.kpi .l { font-size:.72rem; color:#9aa0ab; }
.kpi .v { font-size:1.25rem; font-weight:800; margin-top:6px; color:#fff; }
.kpi.good .v { color:#81c784; } .kpi.bad .v { color:#ef5350; }

.sec-t { display:flex; align-items:center; gap:8px; font-weight:800; color:#fff; font-size:.98rem; margin-bottom:12px; }
.bars { display:flex; flex-direction:column; gap:9px; }
.bar-row { display:grid; grid-template-columns:130px 1fr 84px; gap:10px; align-items:center; font-size:.78rem; }
.bar-name { color:#cfd3da; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-track { height:16px; background:#101216; border-radius:8px; overflow:hidden; }
.bar-fill { height:100%; border-radius:8px; background:linear-gradient(135deg,#d9bc8f,#C5A880); transition:inline-size .4s ease; }
.bar-meta { color:#9aa0ab; text-align:end; white-space:nowrap; }
.bar-row:first-child .bar-name { color:#fff; font-weight:700; }

.subs-line { margin-top:12px; font-size:.83rem; color:#cfd3da; line-height:1.8; background:#101216; border:1px solid #262b33; border-radius:10px; padding:11px 13px; }

.empty-note { color:#9aa0ab; font-size:.9rem; text-align:center; padding:18px 0 6px; }

/* email box */
.ehc-mailbox { background:#181c22; border:1px solid #262b33; border-radius:14px; padding:16px 20px; margin-bottom:18px; }
.ehc-mailbox summary { cursor:pointer; font-size:.9rem; color:#dfe2e7; font-weight:600; }
.ehc-mailbox form { margin-top:14px; }
.ehc-btn { padding:12px 22px; border:none; border-radius:9px; font-weight:800; cursor:pointer; background:linear-gradient(135deg,#d9bc8f,#C5A880); color:#17140e; font-family:inherit; font-size:.9rem; }
.ehc-btn:hover { filter:brightness(1.07); }
.ehc-formmsg { margin-top:10px; font-size:.8rem; line-height:1.7; }
.ehc-formmsg.ok { color:#81c784; } .ehc-formmsg.err { color:#ef5350; }

@media (max-width: 640px) {
  .ehc-grid2 { grid-template-columns:1fr; }
  .ehc-cats { grid-template-columns:1fr; }
  .kpis { grid-template-columns:1fr; }
  .bar-row { grid-template-columns:96px 1fr 70px; }
  .ehc-status { justify-content:center; text-align:center; }
}

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

/* ---------- اسأل تقريرك ---------- */
.ehc-wrap .ask-log { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; margin-bottom: 14px; padding-inline-end: 4px; }
.ehc-wrap .bub { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: .86rem; line-height: 1.8; white-space: pre-wrap; animation: ehcFadeIn .25s ease; }
@keyframes ehcFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ehc-wrap .bub.user { align-self: flex-start; background: linear-gradient(135deg, #d9bc8f, #C5A880); color: #17140e; font-weight: 600; border-end-start-radius: 5px; }
.ehc-wrap .bub.ai { align-self: flex-end; background: #101216; border: 1px solid #2c333d; color: #e8e8ea; border-end-end-radius: 5px; }
.ehc-wrap .ask-row { display: flex; gap: 10px; align-items: stretch; }
.ehc-wrap .ask-row input { flex: 1; }
