/* MeroKalam.com official nepse-share-calculator styles. Unauthorized copying or republication is not permitted. */
/* ═══════════════════════════════════════════════════
   NEPSE Share Calculator - tool-specific CSS only
   Base tokens, nav, footer, accordion, share-bar
   are handled by main.css + mk-shared.css.
═══════════════════════════════════════════════════ */

/* ── Warm cream override (mk-shared sets cold blue-grey body) ── */
body { background: linear-gradient(160deg, #faf8f4 0%, #f3efe8 100%) !important; min-height: 100vh; }

/* ── Page container ── */
.page { max-width: 1100px !important; padding-top: 0 !important; }

/* ── Page header ── */
.header {
  text-align: center;
  margin-bottom: .75rem;
  padding: 1.1rem 1rem .6rem;
  background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, transparent 100%);
  border-bottom: 1px solid rgba(37,99,235,.08);
  margin-left: -1rem; margin-right: -1rem;
  padding-left: 2rem; padding-right: 2rem;
}
.header h1 {
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
  background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}
.header p {
  font-size: .93rem;
  color: #64748b;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}
.ne { font-family: 'Noto Sans Devanagari', sans-serif; }
.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* ── Two-column calc layout ── */
.calc-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.75rem;
}
@media (max-width: 800px) { .calc-grid { grid-template-columns: 1fr; } }

.input-col  { display: flex; flex-direction: column; gap: 1rem; }
.result-col { display: flex; flex-direction: column; gap: 1rem; }

/* ── Segment toggle buttons ── */
.seg-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #e2e8f0;
  border: 1.5px solid #e2e8f0;
  border-radius: .75rem;
  overflow: hidden;
}
.seg-btn {
  padding: .6rem .75rem;
  background: #f8fafc;
  border: none;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  color: #64748b;
  text-align: center;
  line-height: 1.35;
  transition: background .15s, color .15s;
}
.seg-btn small { display: block; font-size: .67rem; font-weight: 400; color: #94a3b8; margin-top: 1px; }
/* mk-shared.css handles button.on → blue; no duplication needed */
.seg-btn:not(.on):hover { background: #e2e8f0; }

/* ── Action row ── */
.action-row { display: flex; gap: .6rem; margin-top: .25rem; }
.btn-reset {
  padding: .7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: .75rem;
  background: #f8fafc;
  color: #374151;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
.btn-reset:hover { background: #e2e8f0; }
.btn-copy {
  flex: 1;
  padding: .7rem 1rem;
  border: none;
  border-radius: .75rem;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.btn-copy:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.btn-copy.ok { background: #16a34a; box-shadow: 0 2px 8px rgba(22,163,74,.25); }

/* ── Rate reference card ── */
.rate-card {
  background: #fffdf8;
  border: 1px solid #e8e0d0;
  border-radius: .75rem;
  padding: .9rem 1rem;
}
.rate-title {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .65rem;
}
.rate-grid { display: flex; flex-direction: column; }
.rate-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  font-size: .77rem;
  padding: .3rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.rate-row:last-child { border-bottom: none; }
.rate-name { color: #64748b; white-space: nowrap; }
.rate-val  { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #2563eb; }

/* ═══ P&L Hero - explicit colours (NOT css vars, mk-shared overrides --forest to blue) ═══ */
.pnl-card {
  background: #fff;
  border: 1.5px solid #e8e2d8;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(120,90,40,.09), 0 1px 4px rgba(0,0,0,.04);
}
.pnl-top {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background .3s;
}
.pnl-top.is-profit { background: #e8f5ee; border-bottom-color: #b8dfc9; }
.pnl-top.is-loss   { background: #fdf1f0; border-bottom-color: #fca5a5; }

.pnl-lbl {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .4rem;
}
.pnl-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: #94a3b8;
  transition: color .3s;
  -webkit-text-fill-color: currentColor !important;
  background: none !important;
  -webkit-background-clip: unset !important;
}
.pnl-amount.is-profit { color: #0f7b3e; }
.pnl-amount.is-loss   { color: #c0392b; }
@keyframes numPop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.03)} }
.pop { animation: numPop .22s ease; }

.pnl-pct {
  font-size: .85rem;
  font-weight: 700;
  margin-top: .4rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  -webkit-text-fill-color: currentColor !important;
}
.pnl-pct.is-profit { color: #0f7b3e; }
.pnl-pct.is-loss   { color: #c0392b; }

.pnl-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pnl-stat {
  padding: .85rem 1.1rem;
  border-right: 1px solid #e2e8f0;
}
.pnl-stat:nth-child(2)  { border-right: none; }
.pnl-stat:nth-child(3),
.pnl-stat:nth-child(4)  { border-top: 1px solid #e2e8f0; }
.pnl-stat:nth-child(4)  { border-right: none; }
.ps-lbl {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .2rem;
}
.ps-val {
  font-size: .88rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #1e293b;
  -webkit-text-fill-color: currentColor !important;
}
.ps-val.neg { color: #c0392b; }
.ps-val.pos { color: #0f7b3e; }

/* ── Break-even card ── */
.be-card {
  background: #fefcf8;
  border: 1.5px solid #e8e2d8;
  border-left: 4px solid #2563eb;
  border-radius: 1.25rem;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 10px rgba(120,90,40,.07);
}
.be-lbl {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .25rem;
}
.be-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.9rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1;
  margin-bottom: .3rem;
  -webkit-text-fill-color: #2563eb !important;
  background: none !important;
  -webkit-background-clip: unset !important;
}
.be-sub { font-size: .78rem; color: #64748b; line-height: 1.5; }

/* ── Price visual ── */
.price-visual {
  background: #fefcf8;
  border: 1.5px solid #e8e2d8;
  border-radius: 1.25rem;
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: 0 2px 10px rgba(120,90,40,.07);
}
.pv-title {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 1.1rem;
}
.pv-track {
  position: relative;
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  margin-bottom: .6rem;
}
.pv-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 99px;
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
}
.pv-fill.profit { background: #0f7b3e; opacity: .25; }
.pv-fill.loss   { background: #c0392b; opacity: .25; }

/* Dots only - no floating labels (prevents overlap) */
.pv-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
.pv-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: block;
  box-shadow: 0 0 0 1.5px currentColor;
}
.pv-pin.buy  .pv-dot { background: #2563eb; color: #2563eb; }
.pv-pin.be   .pv-dot { background: #d97706; color: #d97706; }
.pv-pin.sell.profit .pv-dot { background: #0f7b3e; color: #0f7b3e; }
.pv-pin.sell.loss   .pv-dot { background: #c0392b; color: #c0392b; }

/* Range min/max labels */
.pv-range {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: #94a3b8;
  margin-bottom: .5rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Values row - replaces overlapping pin labels */
.pv-values {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px solid #e2e8f0;
}
.pv-val-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  color: #374151;
}
.pv-val-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pv-val-price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.pv-val-item.buy  .pv-val-price { color: #2563eb; }
.pv-val-item.be   .pv-val-price { color: #d97706; }
.pv-val-item.sell.profit .pv-val-price { color: #0f7b3e; }
.pv-val-item.sell.loss   .pv-val-price { color: #c0392b; }

/* ── Breakdown card ── */
.breakdown-card {
  background: #fff;
  border: 1.5px solid #e8e2d8;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(120,90,40,.07);
}
.bk-head {
  padding: .65rem 1.1rem;
  background: #faf7f2;
  border-bottom: 1px solid #e2e8f0;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748b;
}
.bk-section { padding: .7rem 1.1rem; border-bottom: 1px solid #e2e8f0; }
.bk-section:last-child { border-bottom: none; }
.bk-section-title {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .4rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #e2e8f0;
}
.bk-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  font-size: .82rem;
  padding: .25rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.bk-row:last-child { border-bottom: none; }
.bk-name { color: #64748b; flex: 1; }
.bk-val  { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: #1e293b; white-space: nowrap; -webkit-text-fill-color: currentColor !important; }
.bk-val.neg { color: #c0392b; }
.bk-val.pos { color: #0f7b3e; }
.bk-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  font-weight: 800;
  padding: .45rem 0 .1rem;
  border-top: 2px solid #e2e8f0;
  margin-top: .3rem;
}
.bk-total .bt-name { color: #1e293b; }
.bk-total .bt-val  { font-family: 'JetBrains Mono', monospace; -webkit-text-fill-color: currentColor !important; }
.bt-val.neg { color: #c0392b; }
.bt-val.pos { color: #0f7b3e; }

/* ── Disclaimer ── */
.disclaimer {
  font-size: .72rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.7;
}

/* ═══ Article chart components ═══ */
.art-chart { margin: 1.25rem 0; }
.art-chart-title {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .8rem;
}
.chart-bar-group { margin-bottom: .65rem; }
.chart-bar-label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  justify-content: space-between;
  margin-bottom: .2rem;
}
.chart-bar-label .val { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #2563eb; }
.chart-track { background: #e2e8f0; border-radius: 99px; height: 10px; overflow: hidden; }
.chart-fill  { height: 100%; border-radius: 99px; background: #2563eb; transition: width .5s ease; }
.chart-fill.green  { background: #0f7b3e; }
.chart-fill.red    { background: #c0392b; }
.chart-fill.amber  { background: #d97706; }
.chart-fill.slate  { background: #94a3b8; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  margin: 1.25rem 0;
}
/* Override mk-shared .stat-box to keep custom number colors */
.stat-grid .stat-box { background: #fffdf8; border: 1px solid #e8e0d0; border-radius: .85rem; padding: .9rem; text-align: center; box-shadow: 0 1px 4px rgba(120,90,40,.06); }
.stat-grid .sn { font-family: 'JetBrains Mono', monospace; font-size: 1.45rem; font-weight: 800; color: #2563eb; line-height: 1.1; -webkit-text-fill-color: #2563eb !important; display: block; }
.stat-grid .sl { font-size: .72rem; color: #64748b; margin-top: .2rem; line-height: 1.4; display: block; }

.callout-box {
  border-radius: .75rem;
  padding: .85rem 1.1rem;
  margin: 1rem 0;
  font-size: .88rem;
  display: flex;
  gap: .6rem;
  align-items: flex-start;
}
.callout-box.info    { background: #eff6ff; border-left: 3px solid #2563eb; color: #1e40af; }
.callout-box.success { background: #f0fdf4; border-left: 3px solid #16a34a; color: #14532d; }
.callout-box.warn    { background: #fffbeb; border-left: 3px solid #d97706; color: #78350f; }
.callout-box p { margin: 0; color: inherit !important; font-size: .88rem; line-height: 1.7 !important; }
.callout-box strong { color: inherit !important; }
.callout-icon { font-size: 1.1rem; flex-shrink: 0; }

.tbl-scroll { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: .75rem; margin: .75rem 0; -webkit-overflow-scrolling: touch; }
.example-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.example-table th {
  background: #f8fafc;
  padding: .42rem .75rem;
  text-align: left;
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}
.example-table td {
  padding: .38rem .75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  font-family: 'JetBrains Mono', monospace;
  font-size: .81rem;
  -webkit-text-fill-color: currentColor !important;
}
.example-table td:first-child { font-family: inherit; font-weight: 600; color: #1e293b; }
.example-table tr:last-child td { border-bottom: none; }
.example-table .section-row td { background: #f8fafc; font-family: inherit; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; padding: .32rem .75rem; }
.example-table .total-row td { border-top: 2px solid #e2e8f0; font-weight: 800; color: #1e293b; background: #fff; }
.example-table .neg td:last-child { color: #c0392b; }
.example-table .pos td:last-child { color: #0f7b3e; }
