/* ============================================================================
   ALTAHA SCREENER — PREMIUM PLUS  v3  (stylesheet)
   ----------------------------------------------------------------------------
   Loads after premium.css. Styles only the components premium-plus.js creates;
   it touches nothing that already existed, so removing both files leaves the
   working v2 layer intact.
============================================================================ */

/* ── 1. COMPANY PROFILE ────────────────────────────────────────────────────
   Sits between the verdict and the trade plan. The score answers "is this
   good"; this answers "what is this", and a reader who cannot answer the
   second has no business acting on the first. */

.apf {
  margin: 22px 0 4px;
  padding: 22px 24px 20px;
  border: .5px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.apf-head { margin-bottom: 10px; }
.apf-text {
  margin: 0; font-size: 15.5px; line-height: 1.62;
  color: var(--ink-2); letter-spacing: -.008em; max-width: 74ch;
}
.apf-more {
  margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-dp);
  border-bottom: 1px solid var(--gold-lt);
}
.apf-more:hover { color: var(--ink); border-color: var(--ink); }

.apf-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px 22px; margin: 18px 0 0;
  padding-top: 16px; border-top: 1px solid var(--rule-2);
}
.apf-facts div { min-width: 0; }
.apf-facts dt {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mute);
}
.apf-facts dd {
  margin: 4px 0 0; font-size: 14px; font-weight: 500; color: var(--ink);
  letter-spacing: -.01em; overflow-wrap: break-word;
}
.apf-src {
  margin: 16px 0 0; font-family: var(--mono); font-size: 10px;
  color: var(--mute); letter-spacing: .02em;
}
.apf-src a { color: var(--gold-dp); }

/* ── 2. TYPEAHEAD ──────────────────────────────────────────────────────────
   The product was gated behind knowing an exact NSE symbol. This is the
   single largest usability gap the site had. */

.tah {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70;
  max-height: 330px; overflow-y: auto;
  background: var(--surface);
  border: .5px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--sh-3);
  padding: 5px;
}
.tah-item {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 13px; border-radius: 9px; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.tah-item:hover, .tah-item.on { background: var(--paper-2); }
.tah-sym {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: var(--ink); letter-spacing: .02em; flex: 0 0 auto; min-width: 88px;
}
.tah-name {
  font-size: 13px; color: var(--mute); letter-spacing: -.008em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tah b { color: var(--gold-dp); font-weight: 600; }
html[data-theme="dark"] .tah b { color: var(--gold); }

@media (max-width: 560px) {
  .tah-sym { min-width: 74px; font-size: 12px; }
  .tah-name { font-size: 12px; }
}

/* ── 3. RECENT STOCKS ──────────────────────────────────────────────────── */

.recents {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  justify-content: center; margin: 14px auto 0; max-width: 660px;
}
.recents .sk { margin-right: 3px; }
.rc {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  padding: 6px 12px; border-radius: var(--r-pill);
  border: .5px solid var(--hairline); background: var(--surface);
  color: var(--ink-2); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.rc:hover { color: var(--ink); border-color: var(--rule); transform: translateY(-1px); }
.rc i { font-style: normal; color: var(--mute); font-size: 10px; }
.rc-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.rc-dot.b-strong { background: var(--pass); }
.rc-dot.b-good   { background: var(--gold); }
.rc-dot.b-mixed  { background: var(--part); }
.rc-dot.b-weak   { background: var(--fail); }
.rc-clear { color: var(--mute); border-style: dashed; }

/* ── 4. STICKY CONTEXT BAR ─────────────────────────────────────────────────
   The result page runs long. By the ledger you have lost the score, the
   price, and often which company you were reading about. */

.ctxbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 75;
  background: var(--glass); border-bottom: .5px solid var(--glass-line);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  transform: translateY(-100%); opacity: 0; cursor: pointer;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.ctxbar.on { transform: none; opacity: 1; }
.ctx-in {
  max-width: var(--maxw); margin-inline: auto;
  padding: 11px var(--gut);
  display: flex; align-items: center; gap: 14px;
}
.ctx-spacer { flex: 1 1 auto; }
.ctx-sym {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: var(--ink); letter-spacing: .04em;
}
.ctx-px { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.ctx-lbl {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mute);
}
.ctx-score {
  font-size: 17px; font-weight: 600; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; min-width: 26px; text-align: right;
}
.ctx-score.b-strong { color: var(--pass); }
.ctx-score.b-good   { color: var(--gold-dp); }
.ctx-score.b-mixed  { color: var(--part); }
.ctx-score.b-weak   { color: var(--fail); }
@media (max-width: 620px) { .ctx-px, .ctx-lbl { display: none; } }

/* ── 5. INLINE VOCABULARY ──────────────────────────────────────────────────
   A glossary tab is where definitions go to be ignored. The definition
   belongs where the confusion happens. */

.vterm {
  border: 0; background: none; padding: 0; font: inherit; color: inherit;
  cursor: help; border-bottom: 1px dotted var(--gold-lt);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.vterm:hover { color: var(--gold-dp); border-bottom-style: solid; }

.vpop {
  position: absolute; z-index: 95;
  background: var(--surface); color: var(--ink-2);
  border: .5px solid var(--hairline); border-radius: 12px;
  box-shadow: var(--sh-3); padding: 15px 17px;
  animation: riseIn 220ms var(--ease-soft) both;
}
.vpop-t {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold-dp);
  margin-bottom: 7px;
}
.vpop-d { display: block; font-size: 13.5px; line-height: 1.55; letter-spacing: -.008em; }

/* ── 6. LEDGER — HEAT STRIP AND GROUPS ─────────────────────────────────────
   Twenty-five collapsed rows is a wall. The strip shows the balance of
   evidence in one glance; the groups replace computation order with an order
   a person would read in. */

.heat {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  margin: 4px 0 18px;
}
.hseg {
  flex: 1 1 14px; min-width: 12px; height: 26px;
  border: 0; border-radius: 3px; cursor: pointer; padding: 0;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.hseg:hover { transform: scaleY(1.22); filter: brightness(1.1); }
.hseg:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.h-pass { background: var(--pass); }
.h-part { background: var(--part); }
.h-fail { background: var(--fail); }
.heat .h-pass, .heat .h-part, .heat .h-fail { opacity: .82; }

.heat-key {
  flex: 0 0 auto; margin-left: 10px;
  font-family: var(--mono); font-size: 10px; color: var(--mute);
  display: inline-flex; align-items: center; gap: 5px;
}
.heat-key i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.lgroup {
  display: flex; align-items: baseline; gap: 12px;
  margin: 26px 0 8px; padding-bottom: 7px;
  border-bottom: 1px solid var(--rule-2);
}
.lgroup:first-child { margin-top: 6px; }
.lgroup-n {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-2); flex: 1 1 auto;
}
.lgroup-s {
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.lgroup-s i { font-style: normal; color: var(--mute); font-weight: 400; }

details.row.flash {
  animation: flashRow 1400ms var(--ease) both;
}
@keyframes flashRow {
  0%, 70% { background: rgba(196,166,97,.14); }
  100%    { background: transparent; }
}

/* ── 7. MOBILE TABLES TO CARDS ─────────────────────────────────────────────
   Below 700px a wide table becomes labelled rows. The label comes from the
   column header, stamped onto each cell by the script. */

@media (max-width: 700px) {
  .mtable, .mtable tbody, .mtable tr, .mtable td { display: block; width: 100%; }
  .mtable thead { display: none; }
  .mtable tr {
    margin-bottom: 10px; padding: 12px 14px;
    border: .5px solid var(--hairline); border-radius: 10px;
    background: var(--surface);
  }
  .mtable td {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; padding: 5px 0; border: 0; text-align: right;
  }
  .mtable td::before {
    content: attr(data-label);
    font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--mute);
    text-align: left; flex: 0 0 auto;
  }
  .mtable td:empty { display: none; }
}

/* ── 8. SUGGESTIONS ON A FAILED LOOKUP ─────────────────────────────────── */

.st-sugg {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 7px; justify-content: center; margin-top: 16px;
}
.st-sugg .rc i { max-width: 160px; overflow: hidden; text-overflow: ellipsis;
                 white-space: nowrap; }

/* ── 9. SKIP LINK ──────────────────────────────────────────────────────── */

.skiplink {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: 0 0 10px 0;
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.skiplink:focus { left: 0; }

/* ── 10. COMPARE ───────────────────────────────────────────────────────────
   The engine's real advantage here is that it can show WHICH check differs,
   not merely which total is larger. */

.cmp { margin: 26px 0 6px; text-align: center; }
.cmp-panel {
  margin-top: 14px; padding: 20px;
  border: .5px solid var(--hairline); border-radius: var(--r-card);
  background: var(--surface-2); text-align: left;
}
.cmp-bar { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.cmp-input {
  flex: 1 1 220px; min-width: 0;
  padding: 11px 16px; border-radius: var(--r-pill);
  border: .5px solid var(--hairline); background: var(--surface);
  color: var(--ink); font-family: var(--sans); font-size: 14.5px;
  letter-spacing: -.01em;
}
.cmp-input::placeholder { color: var(--mute); }
.cmp-msg { font-size: 14px; color: var(--mute); margin: 18px 0 0; line-height: 1.55; }

.cmp-heads {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 14px; align-items: center; margin-top: 22px;
}
.cmp-col { text-align: center; min-width: 0; }
.cmp-name {
  font-size: 15px; font-weight: 600; letter-spacing: -.018em; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmp-sym { font-family: var(--mono); font-size: 10.5px; color: var(--mute); margin-top: 3px; }
.cmp-score {
  font-size: 46px; font-weight: 600; letter-spacing: -.045em;
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 8px;
}
.cmp-score.b-strong { color: var(--pass); }
.cmp-score.b-good   { color: var(--gold-dp); }
.cmp-score.b-mixed  { color: var(--part); }
.cmp-score.b-weak   { color: var(--fail); }
.cmp-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mute); margin-top: 2px;
}
.cmp-sub {
  display: flex; justify-content: center; gap: 16px; margin-top: 10px;
  font-family: var(--mono); font-size: 10.5px; color: var(--mute);
}
.cmp-sub b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.cmp-v {
  font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--mute);
}

.cmp-diff { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule-2); }
.cmp-diff .sk { display: block; margin-bottom: 10px; }
.cmp-row {
  display: grid; grid-template-columns: 58px 1fr 58px;
  gap: 12px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--rule-2);
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-a, .cmp-b {
  font-family: var(--mono); font-size: 11.5px; color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.cmp-a { text-align: right; }
.cmp-b { text-align: left; }
.cmp-a.win, .cmp-b.win { color: var(--pass); font-weight: 600; }
.cmp-k { font-size: 13px; color: var(--ink-2); text-align: center; letter-spacing: -.008em; }
.cmp-note {
  margin: 18px 0 0; font-size: 12px; line-height: 1.55; color: var(--mute);
  letter-spacing: -.005em;
}

@media (max-width: 560px) {
  .cmp-heads { grid-template-columns: 1fr; gap: 18px; }
  .cmp-v { display: none; }
  .cmp-score { font-size: 38px; }
  .cmp-row { grid-template-columns: 48px 1fr 48px; gap: 8px; }
  .cmp-k { font-size: 12px; }
}

/* ── 11. PRINT ─────────────────────────────────────────────────────────────
   A CA's audience keeps records and sends documents to other people. The
   script opens every ledger row before printing; this makes the result look
   like a document rather than a screenshot of a website. */

@media print {
  @page { margin: 16mm 14mm; }

  .tickerbar, .tabnav, .mobnav, .themebtn, .ctxbar, .hero-candles,
  .searchrow, .hint, .recents, .badges, .brandsw, .modebar, .drawbar,
  .tfbar, .cmp, .prbtn, .cardbtn, .auditbtn, .showfull, .skiplink,
  #chartbox, .charthint, .tah, .vpop, .heat { display: none !important; }

  html, body { background: #fff !important; color: #000 !important; }
  body { padding: 0 !important; font-size: 10.5pt; }

  header.wrap { padding: 0 0 12pt !important; text-align: left; }
  header.wrap::before, header.wrap::after { display: none !important; }
  .brand { font-size: 20pt !important; text-align: left; }
  .brand i { -webkit-text-fill-color: #000 !important; color: #000 !important; }
  .tag, .pitch, .eyebrow { display: none !important; }

  .verdict, .apf, #setupwrap, #planwrap, #lvlwrap, #volwrap, #shwrap,
  .audit, details.row {
    box-shadow: none !important; background: #fff !important;
    border-color: #ccc !important; break-inside: avoid;
  }
  .verdict { border: 0 !important; border-bottom: 1pt solid #000 !important;
             border-radius: 0 !important; padding: 0 0 12pt !important; }
  .seal svg { filter: none !important; }

  details.row { break-inside: avoid; }
  details.row > summary { list-style: none; }
  .lgroup { break-after: avoid; }
  .vterm { border: 0 !important; }

  a[href]::after { content: ""; }
  .apf-src a::after { content: " (" attr(href) ")"; font-size: 8pt; }

  /* Every printed page states where it came from and when */
  #result::after {
    content: "Altaha Screener \00b7 altahascreener.in \00b7 Educational use only";
    display: block; margin-top: 14pt; padding-top: 8pt;
    border-top: .5pt solid #999; font-size: 8pt; color: #555;
  }
}
