/* Calculators (money worth + gold price) — builds on styles.css tokens */
.cc-body { background: var(--bg); }
.cc-nav a.on { color: var(--accent); font-weight: 800; }
.cc-lang { display: inline-flex; gap: 4px; }
.cc-lang a { padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); text-decoration: none; color: var(--text-dim); font-size: .8rem; }
.cc-lang a.on { background: var(--green); color: #1B1E15; border-color: transparent; font-weight: 800; }

.cc-hero { padding: 22px 0 8px; background: var(--glow); }
.cc-hero h1 { margin: 6px 0 6px; font-size: clamp(1.4rem, 3.2vw, 2.2rem); font-weight: 800; line-height: 1.4; }
.cc-lede { margin: 0 0 14px; color: var(--text-dim); font-size: .98rem; max-width: 70ch; }
.cc-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--inset); border: 1px solid var(--border); border-radius: 99px; padding: 3px; }
.cc-tabs a { text-decoration: none; color: var(--text-dim); font-size: .85rem; font-weight: 600; padding: 7px 16px; border-radius: 99px; }
.cc-tabs a.on { background: var(--green); color: #1B1E15; font-weight: 800; }
.cc-stale { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--live-tint); border: 1px solid var(--live-tint-border); font-size: .85rem; }

.cc-sec { padding-block: 12px; }
.cc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.cc-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; min-width: 0; box-shadow: var(--shadow); }
.cc-h2 { margin: 18px 0 10px; font-size: 1.02rem; font-weight: 800; }
.cc-panel > .cc-h2:first-child { margin-top: 0; }

.cc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-f { display: grid; gap: 4px; font-size: .78rem; color: var(--text-mute); min-width: 0; }
.cc-f-amt, .cc-f-wide { grid-column: 1 / -1; }
.cc-f em { font-style: normal; color: var(--accent); font-weight: 700; }
.cc-f input, .cc-f select {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--inset); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; width: 100%; box-sizing: border-box;
}
.cc-f input { font-weight: 800; direction: ltr; text-align: center; font-size: 1.15rem; }
.cc-f input:focus, .cc-f select:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.cc-sum { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--chip-fill); border: 1px solid var(--chip-border); line-height: 1.9; font-size: .95rem; }
.cc-err { margin: 12px 0 0; color: var(--mk-bad); font-weight: 700; }
.cc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.cc-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-kpi { padding: 12px 14px; border-radius: var(--r); background: var(--inset); min-width: 0; }
.cc-kpi span { display: block; font-size: .76rem; color: var(--text-mute); }
.cc-kpi b { display: block; margin-top: 4px; font-size: clamp(1.15rem, 2.6vw, 1.6rem); font-weight: 800; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.cc-meter { height: 12px; border-radius: 99px; background: var(--live-tint); border: 1px solid var(--live-tint-border); margin-top: 14px; overflow: hidden; }
.cc-meter > i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.cc-loss { margin: 8px 0 0; font-size: .95rem; color: var(--text-dim); }
.cc-loss b { color: var(--mk-bad); font-size: 1.6rem; font-weight: 800; }
.cc-loss.gain b { color: var(--mk-good); }
.cc-rates { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 0; font-size: .82rem; color: var(--text-mute); }
.cc-rates div { display: flex; gap: 6px; } .cc-rates dt { margin: 0; } .cc-rates dd { margin: 0; color: var(--text-dim); font-weight: 700; }
.cc-gold { display: grid; gap: 8px; }
.cc-gold .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: var(--r-sm); background: var(--inset); font-size: .88rem; }
.cc-gold .row b { font-weight: 800; }
.cc-gold .row small { color: var(--text-mute); display: block; font-size: .72rem; }
.cc-chart svg { display: block; width: 100%; height: 180px; }
.cc-chart .ch-line { fill: none; stroke: var(--mk-bad); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.cc-chart .ch-area { fill: var(--mk-bad); opacity: .1; }
.cc-chart .ch-dot { fill: var(--surface); stroke: var(--mk-bad); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.cc-chart .ch-grid { stroke: var(--border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* gold calculator */
.cc-lines { list-style: none; margin: 0; padding: 0; }
.cc-lines li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.cc-lines b { display: block; font-weight: 700; font-size: .95rem; }
.cc-lines small { display: block; color: var(--text-mute); font-size: .72rem; }
.cc-lines em { font-style: normal; font-weight: 800; font-size: 1.05rem; unicode-bidi: plaintext; }
.cc-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--chip-fill); border: 1px solid var(--chip-border); }
.cc-total span { font-weight: 700; flex: 1 0 100%; font-size: .85rem; color: var(--text-dim); }
.cc-total b { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.2; unicode-bidi: plaintext; }
.cc-total small { color: var(--text-mute); font-size: .85rem; }
.cc-sub { margin: 10px 0 0; font-size: .85rem; color: var(--text-dim); }
.cc-stack { display: flex; background: var(--inset); border: 1px solid var(--border); }
.cc-stack i { height: 100%; border-radius: 0; }
.cc-stack i:nth-child(1) { background: #D9A81E; } .cc-stack i:nth-child(2) { background: var(--green); } .cc-stack i:nth-child(3) { background: #5F8F14; } .cc-stack i:nth-child(4) { background: var(--text-mute); }
.cc-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cc-table td { padding: 9px 4px; border-bottom: 1px solid var(--border-soft); }
.cc-table td:last-child { text-align: end; font-weight: 800; unicode-bidi: plaintext; }
.cc-table tr.cur td { color: var(--accent); font-weight: 800; }
.cc-coinrow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: .92rem; }
.cc-coinrow span { color: var(--text-dim); } .cc-coinrow b { font-weight: 800; unicode-bidi: plaintext; text-align: end; }
.cc-prem { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--inset); font-weight: 700; }
.cc-prem b { color: var(--mk-bad); font-size: 1.15rem; }

.cc-about { margin: 0 0 10px; color: var(--text-dim); line-height: 1.9; max-width: 80ch; }
.cc-fine { margin: 8px 0 0; font-size: .76rem; color: var(--text-mute); line-height: 1.8; }
.cc-example p { margin: 0; line-height: 1.9; }
.cc-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 16px; margin-bottom: 8px; }
.cc-faq summary { cursor: pointer; font-weight: 700; }
.cc-faq p { margin: 10px 0 0; color: var(--text-dim); line-height: 1.9; }

@media (max-width: 860px) {
  .cc-grid { grid-template-columns: minmax(0, 1fr); }
  .cc-nav { display: none; }
}
@media (max-width: 440px) {
  .cc-form, .cc-kpis { grid-template-columns: minmax(0, 1fr); }
  .cc-panel { padding: 16px 14px; }
}

/* ---- zakat + inheritance ---- */
.cc-tabs { max-width: 100%; }
.cc-chk { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .88rem; line-height: 1.7; cursor: pointer; }
.cc-chk input { margin-top: 5px; accent-color: var(--green-deep); width: 18px; height: 18px; flex: none; }
.cc-fx { display: grid; gap: 8px; margin-bottom: 10px; }
.cc-fxrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; }
.cc-fxrow select, .cc-fxrow input { font: inherit; background: var(--inset); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 10px; min-width: 0; direction: ltr; }
.cc-fxrow select { direction: inherit; }
.cc-x { border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); border-radius: var(--r-sm); width: 38px; cursor: pointer; font-size: 1.2rem; }
.cc-warn { margin: 0; padding: 14px 16px; border-radius: var(--r); background: var(--live-tint); border: 1px solid var(--live-tint-border); line-height: 1.9; font-size: .9rem; }
.cc-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cc-rule { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.cc-rule h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 800; color: var(--accent); }
.cc-rule p { margin: 0 0 8px; color: var(--text-dim); line-height: 1.9; font-size: .92rem; }
.cc-rule small { display: block; color: var(--text-mute); font-size: .76rem; line-height: 1.7; direction: ltr; unicode-bidi: plaintext; }
.cc-grid-inh { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.cc-hgroup { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cc-hgroup:last-child { border-bottom: 0; }
.cc-heir { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); font-size: .9rem; }
.cc-heir.on { background: var(--chip-fill); }
.cc-heir.off { opacity: .35; }
.cc-step { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.cc-step button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.15rem; cursor: pointer; line-height: 1; }
.cc-step button:disabled { cursor: not-allowed; }
.cc-step output { min-width: 28px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.cc-tablewrap { overflow-x: auto; }
.cc-itable { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 520px; }
.cc-itable th, .cc-itable td { padding: 9px 8px; border-bottom: 1px solid var(--border-soft); text-align: start; vertical-align: top; }
.cc-itable thead th { font-size: .74rem; color: var(--text-mute); font-weight: 600; }
.cc-itable tbody th { font-weight: 700; min-width: 150px; }
.cc-itable th small { display: block; font-weight: 400; color: var(--text-mute); font-size: .72rem; line-height: 1.6; }
.cc-itable td { font-weight: 700; unicode-bidi: plaintext; }
.cc-itable td small { font-weight: 400; color: var(--text-mute); }
.cc-itable tr.dim { opacity: .55; }
.cc-bars { display: grid; gap: 7px; margin-top: 14px; }
.cc-bar { display: grid; grid-template-columns: minmax(80px, 1.1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; font-size: .8rem; }
.cc-bar i { height: 10px; border-radius: 99px; background: linear-gradient(to var(--bar-dir, right), var(--green) var(--w), var(--inset) var(--w)); }
[dir="rtl"] .cc-bar i { --bar-dir: left; }
.cc-bar b { min-width: 48px; text-align: end; }
.cc-notes { margin: 12px 0 0; padding-inline-start: 18px; color: var(--text-dim); font-size: .85rem; line-height: 1.9; }
@media (max-width: 860px) { .cc-grid-inh { grid-template-columns: minmax(0, 1fr); } .cc-rule-grid { grid-template-columns: minmax(0, 1fr); } }
