/* Orivam — public surface.

   White and near-black, with two brand colours used sparingly: a warm yellow
   for the one action Orivam wants taken (the daily brief), and a signal orange
   for the active page, the heading rule and the focus ring. The only other
   colour is green and red, and only ever for the direction of a price.

   What must never be coloured is a house's stated rating. Orivam reports what
   a named research house published; a green BUY or an orange HOLD reads as
   Orivam's own recommendation, which it must never be. There is a test that
   no rating rule can reach for a brand or price colour.

   There is no dark theme. Dark appears as full-width bands -- the stats strip,
   the closing call-to-action and the footer -- on a page that is always white.

   One stylesheet, no framework, no build step. Loaded from a URL carrying a
   hash of its contents, so a change reaches a browser that is holding the old
   one and the file can still be cached for a year.

   Type is a system stack. Geist is the intended face and the @font-face rules
   below are ready for it: drop GeistVF.woff2 and GeistMonoVF.woff2 into
   static/fonts/ and it takes over with no other change. Until then nothing is
   fetched from a third party, which is faster than the Google Fonts link this
   replaces and cannot shift the layout when it arrives late. */

/* ---------------------------------------------------------------- fonts -- */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/GeistVF.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMonoVF.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens -- */

:root {
  color-scheme: light;          /* the page is always white; dark is a band, never a theme */

  /* Warm neutrals rather than cold greys: the page reads as printed and
     premium instead of as a developer tool. */
  --bg:             #ffffff;
  --bg-warm:        #f6f5f1;    /* alternate bands, cards, table headers */
  --bg-ink:         #141414;    /* dark bands: stats, closing call to action, footer */
  --surface:        var(--bg-warm);
  --surface-sunken: #eeece5;

  --fg:        #141414;         /* headings, primary text */
  --fg-body:   #3d3d3d;         /* body copy */
  --fg-muted:  #6b6a64;         /* meta, captions */
  /* The same grey as --fg-muted, on purpose. The one that clears AA on
     --surface-sunken is the one that clears it everywhere, and a second grey
     a hair lighter than the first fails it. The hierarchy between muted and
     subtle is carried by size, weight and case. */
  --fg-subtle: #6b6a64;

  /* Text and rules on a dark band. */
  --on-ink:          #ffffff;
  --fg-on-ink:       #f2f1ec;
  --fg-on-ink-muted: #a8a69d;
  --line-on-ink:     #2f2f2d;

  --line:        #e4e2da;
  --line-strong: #d2cfc4;       /* the header's divider */
  --border:        var(--line);
  --border-strong: var(--line-strong);

  /* A control's edge is the only thing that says where the control is, so
     WCAG 1.4.11 asks 3:1 of it. --line measures about 1.3:1 on white -- right
     for a divider, invisible on an input, and the email field on /signup was
     once a white box on a white page. Dividers keep --line; only controls get
     this. rgba black at .45 composites to a 3.35:1 grey on white. */
  --border-control: rgba(0, 0, 0, .45);

  /* The one loud colour. It fills the call to action and nothing else. */
  --brand:       #ffc928;
  --brand-hover: #f2b900;
  --on-brand:    #141414;

  /* Signal orange: the active-nav bar, the heading rule, the focus ring and a
     hover underline. Decoration. On white it is about 3.6:1, which is enough
     for a 3px bar and not enough for a word -- so --accent-text exists. */
  --accent:      #f0531c;
  --accent-text: #b8380c;

  /* Colour that means a direction, and only ever that. Never a stance. */
  --up:    #0b7a3e;
  --down:  #c4262e;
  /* The same two meanings, brighter, for the line a chart draws. A line is
     not text, so it needs 3:1 and not 4.5:1, and the deep greens and reds that
     are readable as figures look dull as a stroke. Still only ever the
     direction of a price. */
  --up-line:   #16a34a;
  --down-line: #dc2626;
  --focus: var(--accent);

  --radius-sm: 6px;             /* controls */
  --radius:    8px;             /* cards */
  --radius-pill: 9999px;

  /* Depth is a hairline, never a shadow. A drop shadow on a white editorial
     page reads as decoration; one hairline reads as structure. */
  --ring:        0 0 0 1px var(--border);
  --ring-strong: 0 0 0 1px var(--border-strong);
  --ring-control: 0 0 0 1px var(--border-control);

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
          Consolas, "Liberation Mono", monospace;

  /* 4px scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* The page was a 1080px strip: on a 1920px monitor that is about 420px of
     empty white down each side, and it read as unfinished. Bands run edge to
     edge; the content inside them sits in this wider container, and the
     gutter grows with the screen instead of stopping at a phone's 16px. */
  --container: 1440px;
  --gutter: clamp(16px, 4vw, 64px);
  --shell: var(--container);
  --read:    680px;             /* a short column: a lede, a form */
  --measure: 72ch;              /* running prose: long enough to fill a column, short enough to read */
}

/* ----------------------------------------------------------------- base -- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Every number in a finance product lines up in a column or it is noise.
   Applied by element so a price never has to remember to ask. */
.num, .mono, td.num, th.num,
.price, .ticker, .isin, time, .stat-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--s3); font-weight: 600; line-height: 1.2; color: var(--fg);
}
/* The brand gets more presence from weight than the last pass did, and a
   little less negative tracking: -.04em made 700 weight type clot. clamp()
   so the scale grows on a big monitor instead of stopping at a phone's. */
h1 {
  font-size: clamp(30px, 1.2rem + 2.2vw, 52px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.08;
}
h2 {
  font-size: clamp(20px, 1rem + .8vw, 28px);
  font-weight: 700; letter-spacing: -.02em;
}
h3 { font-size: 18px; letter-spacing: -.01em; }
p  { margin: 0 0 var(--s4); }

a { color: inherit; text-decoration: none; }
/* A link is ink; hovering it draws an orange underline. The colour is the
   brand's, the text stays readable. */
a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

small, .small { font-size: 14px; }
.caption, .fineprint, .hint, .stat-note { font-size: 12px; }
.muted  { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }

/* An eyebrow: the uppercase mono label above a heading. */
.eyebrow, .stat-label, .share-label, th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

hr, .rule { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--fg); color: var(--bg);
  padding: var(--s3) var(--s4); border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- layout -- */

main { max-width: var(--container); margin: 0 auto; padding: var(--s7) var(--gutter) var(--s9); }
/* A page whose content is all in full-width bands has nothing for <main>. */
main.is-empty { display: none; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
/* Prose keeps a readable line length wherever it sits. */
.wrap, .measure { max-width: var(--measure); }
/* Pages that are a column of prose or a short form -- an article, an account,
   an unsubscribe -- keep a readable line but sit on the left of the container.
   Centred in a wide page they were the narrow strip this redesign removed. */
main.reading > * { max-width: var(--measure); }
/* `.reading` used to cap the whole of <main> at 680px, which is why the brief,
   the notes and the report pages were a narrow column in a wide page. The
   line length now belongs to the prose (.measure), not to the page. */
.read { max-width: var(--read); }
.section { margin: var(--s7) 0 0; }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s4);
  padding-bottom: var(--s3); border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; }
/* One approach, used everywhere: a short orange rule above the H2. */
.section-head h2::before {
  content: ""; display: block;
  width: 32px; height: 4px; margin-bottom: var(--s3);
  background: var(--accent);
}

.stacked > * + * { margin-top: var(--s4); }

/* --------------------------------------------------------------- header -- */

header.site {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
}
.site-inner {
  max-width: var(--shell); margin: 0 auto;
  display: flex; align-items: center; gap: var(--s5);
  min-height: 68px; padding: 0 var(--gutter);
}

.brand-name {
  font-weight: 700; font-size: 20px; letter-spacing: -.02em;
}
.brand-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-subtle);
}
@media (max-width: 860px) { .brand-tag { display: none; } }

form.search { flex: 1; max-width: 560px; display: flex; position: relative; min-width: 0; }
form.search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 14px;
  padding: var(--s2) var(--s3);
  background: var(--surface);
  color: var(--fg);
  border: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  box-shadow: var(--ring-control);
}
form.search input::placeholder { color: var(--fg-subtle); }
form.search input:focus { background: var(--bg); }
form.search button {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: var(--s2) var(--s4);
  background: var(--surface); color: var(--fg);
  border: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--ring-control); cursor: pointer;
}
form.search button:hover { background: var(--surface-sunken); }

.public-nav {
  display: flex; align-items: stretch; align-self: stretch; margin-left: auto;
  gap: var(--s5); font-size: 15px; font-weight: 600;
}
.public-nav a {
  position: relative; display: flex; align-items: center;
  color: var(--fg); white-space: nowrap;
}
/* The active page is a 3px orange bar flush with the header's bottom
   border, not a pill and not a change of text colour. The bar overlaps the
   1px divider so the two read as one edge. */
.public-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; background: var(--accent);
}
/* The one filled thing in the header. */
.public-nav a.cta {
  align-self: center;
  background: var(--brand); color: var(--on-brand);
  padding: 10px var(--s4); border-radius: var(--radius-sm);
  font-weight: 600;
}
.public-nav a.cta:hover { background: var(--brand-hover); text-decoration: none; }

/* 899, not 720: at a tablet's portrait width the search field was squeezed
   to about 120px beside the nav. The collapsed header holds until the
   900px breakpoint where the page grows sidebars. */
@media (max-width: 899px) {
  .site-inner { flex-wrap: wrap; min-height: 0; padding: var(--s3) var(--s4); gap: var(--s3); }
  form.search { order: 3; width: 100%; flex-basis: 100%; }
  .public-nav { margin-left: auto; align-self: center; gap: var(--s4); }
  .public-nav a:not(.cta) { padding: 6px 0; }
  .public-nav a[aria-current="page"]::after { bottom: 0; }
}

/* --------------------------------------------------------------- footer -- */

footer.site {
  background: var(--bg-ink); color: var(--fg-on-ink);
  border-top: 1px solid var(--line-on-ink);
}
.foot-inner { max-width: var(--shell); margin: 0 auto; padding: var(--s8) var(--gutter) var(--s6); }
.foot-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s4); padding-bottom: var(--s6);
  border-bottom: 1px solid var(--line-on-ink);
}
footer .brand-name { color: var(--on-ink); font-size: 24px; }
.foot-cols { display: grid; grid-template-columns: 1fr; gap: var(--s6); padding: var(--s6) 0; }
@media (min-width: 640px) { .foot-cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .foot-cols { grid-template-columns: repeat(4, 1fr); } }
.foot-col h2 {
  margin: 0 0 var(--s3);
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-on-ink-muted);
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: 15px; }
.foot-col a { color: var(--fg-on-ink); }
.foot-col p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--fg-on-ink-muted); }
.foot-bottom { padding-top: var(--s5); border-top: 1px solid var(--line-on-ink); }
.disclaimer {
  max-width: var(--read); font-size: 13px; color: var(--fg-muted);
  line-height: 1.6;
}
.disclaimer strong { color: var(--fg); }
footer .disclaimer { color: var(--fg-on-ink-muted); }
footer .disclaimer strong { color: var(--fg-on-ink); }
footer .meta { font-family: var(--mono); font-size: 12px; color: var(--fg-on-ink-muted); margin: var(--s4) 0 0; }

/* The closing call to action, above the footer: dark, with the yellow button
   at its strongest. */
.closing-band { background: var(--bg-ink); color: var(--fg-on-ink); }
.closing-inner {
  max-width: var(--shell); margin: 0 auto; padding: var(--s8) var(--gutter);
  display: grid; gap: var(--s5); align-items: center;
}
@media (min-width: 760px) { .closing-inner { grid-template-columns: minmax(0, 1fr) auto; } }
.closing-band h2 { margin: 0 0 var(--s2); color: var(--on-ink); font-size: clamp(24px, 1rem + 1.4vw, 36px); }
.closing-band p { margin: 0; max-width: 56ch; color: var(--fg-on-ink-muted); }

/* ------------------------------------------------------------- controls -- */

.btn, button.primary, .btn-primary, .btn-light {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 10px var(--s4);
  border: 0; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap;
  /* A label can carry the name of the site hosting the PDF. "Open the
     original PDF on Colombo Stock Exchange" wants 373px, measured, against
     the 328px a 360px screen has after its gutters, and nowrap took the
     report page 29px sideways. It stays on one line while it fits. */
  max-width: 100%;
}
@media (max-width: 560px) {
  .btn, button.primary, .btn-primary, .btn-light { white-space: normal; }
}
/* Yellow, near-black text, no shadow: the one action Orivam wants taken. */
.btn-primary, button.primary, .btn-light, .btn.primary {
  background: var(--brand); color: var(--on-brand);
}
.btn-primary:hover, button.primary:hover, .btn-light:hover, .btn.primary:hover {
  background: var(--brand-hover); text-decoration: none;
}
/* The exclusions matter. Two spellings of the filled button are in use,
   `btn primary` and `btn btn-primary`, and this rule comes after the one
   that fills them -- so without naming both spellings it quietly turned
   every `btn btn-primary` and `btn btn-light` back into an outline. That
   was seven call-to-action buttons: the homepage capture, the brief's gate,
   both blog CTAs, the stock page and the note page. */
.btn.secondary,
.btn:not(.primary):not(.ghost):not(.btn-primary):not(.btn-light) {
  background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg);
}
.btn.secondary:hover,
.btn:not(.primary):not(.ghost):not(.btn-primary):not(.btn-light):hover {
  background: var(--bg-warm); text-decoration: none;
}
.btn.ghost {
  background: transparent; color: var(--fg-muted); padding: var(--s2) var(--s3);
}
.btn.ghost:hover { color: var(--fg); background: var(--surface); text-decoration: none; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

input[type="email"], input[type="text"], input[type="search"],
input[type="password"], select, textarea {
  font: inherit; font-size: 15px;
  padding: 10px var(--s3);
  background: var(--bg); color: var(--fg);
  border: 0; border-radius: var(--radius-sm); box-shadow: var(--ring-control);
  width: 100%;
}


/* ----------------------------------------------------------------- pills -- */

/* A stated rating is a fact about what a house published, never Orivam's own
   call, so it is a grey outline like every other label. A green BUY would be
   this product changing what it is. */
.badge, .pill, .tag, .rating, .house-tag {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: 12px; line-height: 1;
  padding: 5px var(--s2);
  border-radius: var(--radius-pill);
  background: var(--bg); color: var(--fg-muted);
  box-shadow: var(--ring);
  white-space: nowrap;
}
.badge.exchange, .badge.nse, .badge.bse, .isin, .ticker {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.rating, .badge.rating {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg);
}
.house-tag { color: var(--fg); font-weight: 500; }
.badge.flagged, .badge.pending { color: var(--fg); box-shadow: var(--ring-strong); }

/* ----------------------------------------------------- page grids -- */

/* A main column and a rail, or a filter column and its results. Breakpoints
   are mobile first: nothing here applies below 900px, where it is one column
   in reading order. */
.layout { display: grid; gap: var(--s6) var(--s7); }
.layout > * { min-width: 0; }
@media (min-width: 900px) {
  .layout.has-rail   { grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr); align-items: start; }
  .layout.has-filter { grid-template-columns: minmax(220px, 3fr) minmax(0, 9fr); align-items: start; }
}
@media (min-width: 1600px) {
  .layout { column-gap: var(--s8); }
}

.rail { display: grid; gap: var(--s5); align-content: start; }
.rail-pin { display: grid; gap: var(--s5); }
@media (min-width: 900px) {
  /* The rail is as tall as the article beside it, so that the short group at
     the bottom of it has room to follow the reader down. The whole rail used
     to be sticky and capped to the window, which put a scrollbar inside the
     page and clipped whatever did not fit. */
  .layout.has-rail > .rail { align-self: stretch; }
  .rail-pin { position: sticky; top: calc(68px + var(--s5)); }
}
.rail-box { background: var(--bg-warm); border-radius: var(--radius); padding: var(--s5); }
.rail-box.is-plain { background: transparent; padding: 0; }
.rail-title {
  margin: 0 0 var(--s3);
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-subtle);
}
.rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: 15px; }
.rail-list li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.rail-list .ticker { font-size: 12px; color: var(--fg-subtle); }
.rail dl { margin: 0; display: grid; gap: var(--s2); font-size: 14px; }
.rail dl > div { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.rail dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.rail dt { color: var(--fg-muted); }
.rail dd { margin: 0; font-weight: 600; text-align: right; }

@media (min-width: 1600px) {
  body { font-size: 17px; }
  .lede { font-size: 20px; }
}

/* ----------------------------------------------------------------- cards -- */

.card, .note-card, .report-card {
  background: var(--bg); border-radius: var(--radius);
  box-shadow: var(--ring); padding: var(--s5);
}
.card:hover, .note-card:hover { box-shadow: var(--ring-strong); }

/* The dense feed: time · house · title · companies. Reads like a terminal
   log, which is what a list of research arriving actually is. */
.feed { display: flex; flex-direction: column; }
.feed-row {
  display: grid;
  grid-template-columns: 92px 170px minmax(0, 1fr) 130px 110px;
  gap: var(--s4); align-items: baseline;
  padding: var(--s3) 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.feed-row:hover { background: var(--surface); }
.feed-when { font-family: var(--mono); font-size: 13px; color: var(--fg-subtle); }
.feed-house { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; }
.feed-title { color: var(--fg); font-weight: 500; }
.feed-count { font-family: var(--mono); font-size: 13px; color: var(--fg-subtle); text-align: right; }
.feed-kind { font-size: 13px; color: var(--fg-muted); }
@media (max-width: 720px) {
  .feed-row { grid-template-columns: 1fr auto; row-gap: var(--s1); }
  .feed-when { grid-column: 1; }
  .feed-count { grid-column: 2; }
  .feed-title, .feed-house { grid-column: 1 / -1; }
  /* The kind is already in the title on a phone, and a fifth line per row is a long page. */
  .feed-kind { display: none; }
}

/* A sticky day header over a grouped feed. */
.day-head {
  position: sticky; top: 68px; z-index: 5;
  background: var(--bg); padding: var(--s4) 0 var(--s2);
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-subtle);
}

/* ---------------------------------------------------------------- tables -- */

table, .grid {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
thead th {
  text-align: left; padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface); white-space: nowrap;
}
tbody td { padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: var(--surface); }
td.num, th.num { text-align: right; white-space: nowrap; }
/* A target is one figure -- "Rs 2,365" -- and the "Rs" wrapped onto a line of
   its own when the column was squeezed by a long company name. The columns that
   matter get a width, and the explanatory text takes whatever is left. */
@media (min-width: 900px) {
  .report-table th:nth-child(1) { width: 28%; }
  .report-table th:nth-child(2) { width: 11%; }
  .report-table th:nth-child(3) { width: 14%; }
}
.nowrap { white-space: nowrap; }

/* A table that becomes cards on a phone, so a price column never scrolls
   sideways out of view. Up to 899px, the same boundary as everything else that
   changes at a tablet: the calls table is eight columns of figures and was 882px
   wide at 768, which is not a phone and not a desktop either. */
@media (max-width: 899px) {
  .grid.stacks { display: block; }
  /* The header row goes; each cell carries its own label via data-label. */
  .grid.stacks thead { display: none; }
  .grid.stacks tbody, .grid.stacks tr, .grid.stacks td { display: block; width: 100%; }
  .grid.stacks tr {
    padding: var(--s3) 0; border-bottom: 1px solid var(--border);
  }
  .grid.stacks td { border: 0; padding: 2px 0; text-align: left; }
  .grid.stacks td[data-label]::before {
    content: attr(data-label) "  ";
    font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--fg-subtle);
  }
}

/* ---------------------------------------------------------------- prices -- */

/* The only colour on the page. */
.up, .change.up, .chart-change.up   { color: var(--up); }
.down, .change.down, .chart-change.down { color: var(--down); }

.price-big {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 34px; font-weight: 600; letter-spacing: -.02em;
}

/* Progress toward a stated target. Greyscale: how far a price has travelled
   is not a verdict on the call, and a green bar would read as one. */
.progress { height: 4px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--fg-muted); }

/* ----------------------------------------------------------------- stats -- */

.stat-band { background: var(--bg-ink); color: var(--fg-on-ink); }
.stat-band-inner {
  max-width: var(--shell); margin: 0 auto; padding: var(--s6) var(--gutter);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s5);
}
.stat { display: flex; flex-direction: column; gap: var(--s1); }
.stat-value {
  font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--fg);
}
.stat-band .stat-value { color: var(--on-ink); }
.stat-band .stat-label, .stat-band .stat-note { color: var(--fg-on-ink-muted); }
.stat-note { color: var(--fg-subtle); }

/* ------------------------------------------------------------------ misc -- */

.empty {
  padding: var(--s6); text-align: center; color: var(--fg-muted);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--ring);
}
.empty h3 { color: var(--fg); }

.lede { font-size: 18px; color: var(--fg-muted); max-width: var(--read); }

.flash {
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  box-shadow: var(--ring); background: var(--surface); font-size: 14px;
  margin-bottom: var(--s5);
}

.pager { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s5); }

/* The typeahead under the header search. */
.suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: var(--s1); list-style: none;
  background: var(--bg); border-radius: var(--radius);
  box-shadow: var(--ring-strong), 0 8px 24px -12px rgba(0, 0, 0, .25);
  max-height: 60vh; overflow-y: auto;
}
.suggestions li {
  display: flex; justify-content: space-between; gap: var(--s3);
  padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
  font-size: 14px; cursor: pointer;
}
.suggestions li.is-active, .suggestions li:hover { background: var(--surface); }
.suggest-sym { font-family: var(--mono); color: var(--fg-subtle); font-size: 13px; }

/* ----------------------------------------------------------------- chart -- */

.chart-panel { border-radius: var(--radius); box-shadow: var(--ring); padding: var(--s5); }
.chart-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s4);
  justify-content: space-between; margin-bottom: var(--s4);
}
.chart-price { display: flex; align-items: baseline; gap: var(--s3); }
.chart-span { color: var(--fg-subtle); font-size: 13px; }

/* Range tabs as a segmented control, with the active range unmistakable. */
.chart-ranges { display: flex; gap: 2px; padding: 3px; background: var(--surface); border-radius: var(--radius-sm); }
.chart-ranges a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  padding: 5px var(--s3); border-radius: 5px; color: var(--fg-muted);
}
.chart-ranges a:hover { color: var(--fg); text-decoration: none; }
.chart-ranges a.here {
  background: var(--bg); color: var(--fg); font-weight: 600;
  box-shadow: var(--ring);
}

.chart-frame { position: relative; cursor: crosshair; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .axis-x, .chart-svg .axis-y {
  font-family: var(--mono); font-size: 11px; fill: var(--fg-subtle);
}
.chart-svg .axis-y { text-anchor: start; }
.chart-svg .axis-x { text-anchor: middle; }
/* The line is ink. Only the period change figure above it carries colour. */
/* Green when the price ended the range higher than it began, red when lower --
   the colours an analyst already reads a chart in. The note markers stay
   orange: they say where a note sits, and nothing about what it said. */
.chart-svg .line { fill: none; stroke: var(--fg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-svg .line.up   { stroke: var(--up-line); }
.chart-svg .line.down { stroke: var(--down-line); }
.chart-svg .area { stroke: none; fill: var(--fg); opacity: .05; }
.chart-svg .area.up   { fill: var(--up-line);   opacity: .10; }
.chart-svg .area.down { fill: var(--down-line); opacity: .10; }

.marker-stem { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.marker-stem.dateonly { stroke-dasharray: 2 3; }
.marker-hit { fill: transparent; }
/* A numbered disc in the brand orange. A note is something to find, and the
   marker says which -- the same number is in the legend beneath the chart and on
   the note in the list. Solid is a note whose minute is known; hollow is one
   whose minute is not, drawn at that day's open. The shape carries that and the
   colour does not carry a stance: a marker is orange whatever the note said. */
.marker { fill: var(--accent); stroke: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.marker.dateonly { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; }
.marker-n {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  fill: var(--on-brand); text-anchor: middle; dominant-baseline: central;
  pointer-events: none;
}
.marker-group:hover .marker, .marker-group:focus-visible .marker { r: 13; }

.xh-line { stroke: var(--fg-subtle); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.xh-dot { fill: var(--bg); stroke: var(--fg); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-svg.is-up .xh-dot   { stroke: var(--up-line); }
.chart-svg.is-down .xh-dot { stroke: var(--down-line); }
.xh-band { fill: var(--fg); opacity: .05; pointer-events: none; }

.chart-tip, .chart-readout {
  position: absolute; z-index: 3; pointer-events: none;
  background: var(--bg); border-radius: var(--radius-sm);
  box-shadow: var(--ring-strong), 0 8px 24px -12px rgba(0, 0, 0, .25);
  padding: var(--s2) var(--s3); font-size: 13px; white-space: nowrap;
}
.chart-readout { top: var(--s1); display: flex; gap: var(--s2); align-items: baseline; }

/* `hidden` is only a UA rule of display:none, so it loses to any author
   display -- .chart-readout above sets display:flex -- and inside <svg> the
   attribute does not take effect at all. The result was on every stock page:
   an empty white card parked at the top-left of the chart and a dashed
   crosshair pinned to the y-axis, both of them the resting state of a hover
   that had not happened. On a phone, which never hovers, they never left.
   Measured on /stock/CIPLA: hidden=true, display=flex and display=inline. */
.chart-readout[hidden], .chart-tip[hidden],
.xh-line[hidden], .xh-dot[hidden], .xh-band[hidden] { display: none; }
.chart-tip { max-width: 22rem; white-space: normal; }
.tip-when, .ro-when { font-family: var(--mono); font-size: 11px; color: var(--fg-subtle); }
.tip-title { margin: 2px 0 0; font-weight: 600; font-size: 13px; }
.tip-meta { margin: 2px 0 0; font-size: 12px; color: var(--fg-muted); }
.tip-detail {
  margin: var(--s2) 0 0; padding-top: var(--s2);
  border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 12px;
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.ro-price, .ro-change {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600;
}
.ro-change.up { color: var(--up); }
.ro-change.down { color: var(--down); }

.chart-note { margin-top: var(--s3); font-size: 12px; color: var(--fg-subtle); }

/* The list under the chart, which doubles as the chart's text alternative. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- forms and the signup page ------------------------------------------- */

.auth-wrap { max-width: var(--read); }
.auth-wrap .card { margin-top: var(--s5); }

label { display: block; font-size: 14px; font-weight: 500; }
label + label { margin-top: var(--s4); }
label input[type="email"], label input[type="text"],
label input[type="password"] { margin-top: var(--s2); }
label .hint { font-weight: 400; margin-left: var(--s2); }

.check {
  display: flex; align-items: flex-start; gap: var(--s2);
  font-weight: 400; line-height: 1.4;
}
.check input { width: auto; margin: 2px 0 0; box-shadow: none; }

form.stacked .btn { margin-top: var(--s4); width: 100%; }

.signup-row { display: flex; gap: var(--s2); }
.signup-row input { flex: 1; min-width: 0; }
@media (max-width: 520px) {
  .signup-row { flex-direction: column; }
}

ul.plain { list-style: none; margin: var(--s5) 0 0; padding: 0; }
ul.plain li + li { margin-top: var(--s2); }
.promises li { padding-left: var(--s4); position: relative; }
.promises li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-subtle);
}

/* The locked panel over the per-stock detail. One panel, one button: the page
   used to peek, lock, and ask again in three separate places. */
/* The peek is the background layer and the body is in normal flow, not the
   other way round. With the body absolute at inset:0 the gate was only as
   tall as four peek rows -- 202px -- while the body needed far more, so it
   overflowed in both directions and printed its lock and heading 44px above
   the gate, straight over the "Today in detail" heading. */
.gate {
  position: relative; margin-top: var(--s5);
  overflow: hidden; border-radius: var(--radius);
}
.gate-peek {
  position: absolute; inset: 0;
  filter: blur(3px); opacity: .5; pointer-events: none; user-select: none;
}
.peek-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) 0; border-bottom: 1px solid var(--border);
}
.peek-bar { flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); }
.gate-body {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s3);
  text-align: center; padding: var(--s7) var(--s5);
  background: linear-gradient(to bottom, transparent, var(--bg) 45%);
}
.gate-body h2 { margin: 0; }

/* The brief itself, read as prose. */
.brief-head { margin-bottom: var(--s6); }
/* A headline that runs the whole width of a monitor is a line nobody reads. */
.brief-head h1 { margin: var(--s2) 0 var(--s3); max-width: 28ch; }
.brief-stats { margin: 0; }
.brief-main > .wrap { margin-bottom: var(--s6); }
/* Previous, all and next, as rows in the rail. */
.rail-nav { display: grid; }
.rail-nav a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  min-height: 44px; padding: var(--s2) 0;
  border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.rail-nav a:last-child { border-bottom: 0; }
.rail-signup h2 { font-size: 18px; margin: 0 0 var(--s2); }
.rail-signup p { font-size: 14px; color: var(--fg-muted); }
.entry { padding: var(--s5) 0; border-bottom: 1px solid var(--border); }
.entry h3 { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
ul.views { list-style: none; margin: var(--s3) 0 0; padding: 0; }
ul.views li { padding: var(--s2) 0; border-top: 1px solid var(--border); font-size: 14px; }

.share { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-width: 44px; min-height: 44px; padding: 0 var(--s3);
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--fg); box-shadow: var(--ring-control);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.share-btn:hover { background: var(--bg-warm); text-decoration: none; }
.share-btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* The research feed on the homepage keeps its day headers under the sticky
   header rather than behind it. */

/* ====================================================================== */
/*  Rules the stylesheet replacement dropped.                             */
/*                                                                        */
/*  Swapping a 40KB style.css for a 24KB orivam.css left 52 classes with  */
/*  no rules at all. Nothing errored -- the pages rendered, unstyled --    */
/*  and the homepage hero ran edge to edge at 1280px as well as 360,      */
/*  while every .sr-only label was simply visible text.                   */
/*                                                                        */
/*  These are written against the new tokens rather than ported: the old  */
/*  sheet referenced 22 custom properties that no longer exist, including */
/*  the coloured washes for positive, negative and high materiality. A    */
/*  rule that references a token nobody defines is a rule that does        */
/*  nothing, which is how this got missed the first time. Colour stays on */
/*  the direction of a price and nowhere else.                            */
/* ====================================================================== */

/* ------------------------------------------------------------ utility -- */

/* A label for a screen reader only. Without this rule "Email address" sat
   above the homepage email field as ordinary visible text. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* The quiet forward link: "All briefs", "Note", "Read this note". */
.more {
  font-size: 14px; color: var(--fg-muted); white-space: nowrap;
}
.more:hover { color: var(--fg); }

.btn-block { width: 100%; }
.btn-ghost, .btn-quiet {
  background: transparent; color: var(--fg-muted);
  padding: var(--s2) var(--s3);
}
.btn-ghost:hover, .btn-quiet:hover {
  color: var(--fg); background: var(--surface); text-decoration: none;
}

/* A timestamp, wherever one appears in a list. Tabular figures so a column
   of them lines up, and never wrapped between the date and the time. */
.when {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--fg-subtle); white-space: nowrap;
}

.sub { margin: var(--s2) 0 var(--s4); color: var(--fg-muted); font-size: 14px; }

/* open / hit / missed / void on a tracked call. A stated outcome is a fact
   about the price, not a verdict, so it is one grey weight. */
.state {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--fg-muted);
}
.state.hit, .state.missed, .state.void { color: var(--fg-muted); }

/* --------------------------------------------------------------- hero -- */

/* The hero and the sections beside it live in base.html's full_width block,
   outside <main>, so they inherit none of main's shell or gutter and have
   to carry their own. */
.hero { background: var(--bg-warm); border-bottom: 1px solid var(--line); }
.hero .eyebrow { color: var(--accent-text); }
.hero-inner {
  max-width: var(--shell); margin: 0 auto;
  padding: var(--s7) var(--gutter) var(--s8);
  display: grid; gap: var(--s7); align-items: start;
}
@media (min-width: 900px) {
  /* The copy leads, the capture card sits beside it. Below this width the
     card is too narrow to hold its button and fine print without looking
     cramped, so it goes under the copy instead. */
  .hero-inner {
    grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr);
    gap: var(--s8);
  }
}
.hero h1 { margin: var(--s3) 0 0; }
.hero-lede {
  margin: var(--s4) 0 0; max-width: var(--read);
  font-size: 17px; line-height: 1.6; color: var(--fg-muted);
}
.hero-points { margin: var(--s5) 0 0; padding: 0; list-style: none; }
.hero-points { display: grid; gap: var(--s3); }
.hero-points li {
  position: relative; padding-left: var(--s5);
  font-size: 15px; line-height: 1.5;
}
/* A rule, not a bullet: three claims about what the product does are not a
   shopping list. */
.hero-points li::before {
  content: ""; position: absolute; left: 0; top: .7em;
  width: 12px; height: 1px; background: var(--fg);
}

.capture {
  background: var(--bg); border-radius: var(--radius);
  box-shadow: var(--ring); padding: var(--s5);
}
.capture h2 { margin: 0; font-size: 19px; }
.capture form { display: grid; gap: var(--s3); }

/* How it works. The number is the ornament; nothing else needs to be. */
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s5); }
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
}
.step { display: grid; gap: var(--s2); }
.step-n {
  font-family: var(--mono); font-size: 12px; color: var(--fg-subtle);
  letter-spacing: .08em;
}
.step h3 { margin: 0; font-size: 16px; }
.step p { margin: 0; font-size: 15px; color: var(--fg-muted); line-height: 1.55; }

/* A section rendered outside <main> needs the shell main would have given. */
/* A section outside <main> has no bottom padding from it either. With a pale
   stats band below it nobody saw that; with a dark one the "Today's brief"
   card sat flush against the band's edge. */
body > .section { max-width: var(--shell); margin: var(--s7) auto var(--s8); padding: 0 var(--gutter); }

/* -------------------------------------------------------------- stock -- */

.stock-head { margin-bottom: var(--s6); }
.stock-head h1 { margin: 0; }
.stock-head-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--s5) var(--s7);
}
.stock-quote .stock-price { margin: 0; }
.stock-quote p { margin: 0 0 var(--s1); }
@media (min-width: 900px) { .stock-quote { text-align: right; } .stock-quote .stock-price { justify-content: flex-end; } }
.tickers {
  margin: var(--s3) 0 0; display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--s2);
}
.stock-price {
  margin: var(--s4) 0 0; display: flex; flex-wrap: wrap;
  align-items: baseline; gap: var(--s3);
}
.counts { margin: var(--s3) 0 0; font-size: 14px; color: var(--fg-muted); }
.counts strong { color: var(--fg); font-variant-numeric: tabular-nums; }

/* The note list on a stock page and on /notes are the same object. */
.timeline { display: grid; gap: var(--s5); }
.research-row { padding-top: var(--s5); border-top: 1px solid var(--border); }
.timeline > .research-row:first-child { padding-top: 0; border-top: 0; }
.research-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s2); margin-bottom: var(--s2);
}
.research-summary { margin: var(--s2) 0 0; line-height: 1.6; }
.research-link { display: inline-block; margin-top: var(--s3); font-size: 14px; }

/* -------------------------------------------------------------- notes -- */

.filters { display: grid; gap: var(--s3); margin-bottom: var(--s6); }
.filter-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* A filter is a control, so its edge has to be visible: see --border-control. */
.chip {
  font-size: 13px; line-height: 1; padding: 7px var(--s3);
  border-radius: var(--radius-pill);
  color: var(--fg-muted); box-shadow: var(--ring-control);
  white-space: nowrap;
}
.chip:hover { color: var(--fg); text-decoration: none; background: var(--surface); }
/* The selected filter is filled, not coloured: the state has to survive a
   monochrome page and a reader who cannot see a hue difference. */
.chip.is-on {
  background: var(--fg); color: var(--bg);
  box-shadow: none; font-weight: 500;
}
.chip.is-on:hover { background: var(--fg); color: var(--bg); }
.range-form {
  display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3);
}
.range-form label { font-size: 13px; }
.range-form input { width: auto; }
.result-count { margin: 0 0 var(--s5); font-size: 14px; color: var(--fg-muted); }
.results { display: grid; gap: var(--s5); }

/* -------------------------------------------------------------- brief -- */

/* The lock over the gated panel. Drawn rather than an icon file, because a
   missing icon file is an empty box and this sits on the page that asks for
   an account. */
.gate-lock {
  /* flex: none, because it is an empty box in a flex column: with nothing
     inside to hold it open it was shrunk to a height of 0, leaving only the
     ::before shackle floating on the page as a bare arch. */
  flex: none;
  width: 22px; height: 22px; margin-bottom: var(--s3);
  border-radius: 3px; background: var(--fg);
  position: relative;
}
.gate-lock::before {
  content: ""; position: absolute; left: 50%; top: -9px;
  width: 12px; height: 11px; transform: translateX(-50%);
  border: 2px solid var(--fg); border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.peek-name { font-weight: 500; }
/* The reader's own holdings, where a brief marks them. */
.own { font-weight: 600; }

/* --------------------------------------------------------------- blog -- */

.brief-list { display: grid; gap: var(--s5); margin: 0; padding: 0; list-style: none; }
.brief-date {
  font-family: var(--mono); font-size: 12px; color: var(--fg-subtle);
}
.cta-band {
  margin-top: var(--s8); padding: var(--s6) var(--s5);
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--ring); text-align: center;
}
.cta-band h2 { margin: 0 0 var(--s2); }
.copy-link { font-size: 13px; }

/* --------------------------------------------------------- one note -- */

.note-body { margin: 0 0 var(--s5); line-height: 1.7; font-size: 18px; }
.note-head { margin-bottom: var(--s5); }
.note-head h1 { margin: var(--s2) 0 var(--s2); }
/* Who, what they said, the target and when, in one strip before the prose. */
.facts {
  display: flex; flex-wrap: wrap; gap: var(--s4) var(--s7);
  margin: 0 0 var(--s6); padding: var(--s4) 0;
  border-block: 1px solid var(--line);
}
.facts > div { display: grid; gap: 2px; }
.facts dt {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-subtle);
}
.facts dd { margin: 0; font-weight: 600; }
.note-source {
  margin-top: var(--s6); padding-top: var(--s5);
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--fg-muted);
}
/* Whose view this is. It is the whole point of the page, so it is not small
   print. */
.attribution { font-size: 15px; color: var(--fg-muted); }
.attribution strong { color: var(--fg); }

/* ------------------------------------------------------ chart events -- */

/* How the price reacted. The only colour on the page is a direction. */
.reaction { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.reaction.up { color: var(--up); }
.reaction.down { color: var(--down); }
/* Materiality is Orivam's own read of how much a note matters, so it is a
   grey weight and never a red flag. */
.badge.materiality { color: var(--fg-muted); }
.badge.materiality.high { color: var(--fg); font-weight: 500; }

/* -------------------------------------------------------------- misc -- */

.brand { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.signup { display: grid; gap: var(--s3); }

/* ---------------------------------------------------------- spacing -- */

/* Named rather than inline. Twelve templates carried their own copy of a
   margin in a style attribute, which is a copy of the theme kept somewhere
   the theme cannot reach -- the dark-to-white change had to be made twice
   for exactly this reason. */
.no-gap-below { margin-bottom: 0; }
.no-gap-above { margin-top: 0; }
.gap-above    { margin-top: var(--s4); }
.gap-above-lg { margin-top: var(--s5); }
.gap-below    { margin-bottom: var(--s4); }
.centered     { text-align: center; }

/* The date sits above the headline it belongs to, not in front of it: on a
   phone "15 November 2026 Q2FY27 Earnings: Revenue Growth..." read as one
   run-on line. */
.brief-list li { display: grid; gap: var(--s1); }
.brief-list p { margin: var(--s1) 0 0; }

/* --------------------------------------------- the brief's own structure -- */

/* The digest generator marks its headings and lists; these render them. A
   brief is read on a phone, and one unbroken block of prose naming fourteen
   companies inside a single sentence is not read at all. */
.wrap-head {
  margin: var(--s6) 0 var(--s3);
  font-size: 17px; letter-spacing: -.01em;
}
.wrap-head:first-child { margin-top: 0; }
.wrap-list {
  margin: 0 0 var(--s4); padding-left: var(--s4);
  display: grid; gap: var(--s1);
}
.wrap-list li { line-height: 1.5; }
@media (min-width: 640px) {
  /* A column of single company names wastes most of a wide line. */
  .wrap-list { grid-template-columns: 1fr 1fr; column-gap: var(--s5); }
}

/* --------------------------------------------------------- page heads -- */

.page-head { margin-bottom: var(--s6); }
.page-head h1 { margin-bottom: var(--s3); }
.page-head .lede { margin: 0; }

/* ----------------------------------------------- the filter sidebar -- */

.filters-toggle { width: 100%; justify-content: space-between; }
.filter-group { margin-bottom: var(--s5); }
.filter-stack { display: grid; gap: 1px; }
.filter-stack.is-scroll { max-height: 320px; overflow-y: auto; margin-top: var(--s2); }
.filter-link {
  display: block; padding: 8px var(--s3); border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.35; color: var(--fg-body);
}
.filter-link:hover { background: var(--bg-warm); text-decoration: none; }
/* The chosen filter is marked the way the chosen page is: an orange bar. */
.filter-link.is-on {
  background: var(--bg-warm); color: var(--fg); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.filter-search { font-size: 14px; padding: 8px var(--s3); }
.notes-results .result-count { margin: 0 0 var(--s4); }

@media (min-width: 900px) {
  .filters-toggle { display: none; }
  .filter-col {
    position: sticky; top: calc(68px + var(--s5));
    max-height: calc(100vh - 68px - var(--s6)); overflow-y: auto;
  }
}
/* Collapsed only when JavaScript is there to open it again: with scripts off a
   phone gets the filters open, which is clumsy and works. */
@media (max-width: 899px) {
  .js .filters-panel { display: none; margin-top: var(--s3); }
  .js .filters-panel.is-open { display: block; }
}

/* ------------------------------------------------ the briefs archive -- */

.brief-grid { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.brief-grid .day-head { grid-column: 1 / -1; position: static; margin-top: var(--s4); }
.brief-grid .day-head:first-child { margin-top: 0; }
.brief-card {
  position: relative; display: grid; gap: var(--s2); align-content: start;
  padding: var(--s5); background: var(--bg);
  border-radius: var(--radius); box-shadow: var(--ring);
}
.brief-card:hover { box-shadow: var(--ring-strong); }
.brief-card-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--fg); }
/* The whole card is the link, so the target is the card and not one line of it. */
.brief-card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.brief-card-link:hover { text-decoration: none; }
.brief-card:hover .brief-card-link {
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}

/* --------------------------------------------------- the home brief -- */

/* One large card for today and a column of smaller ones for the days before. */
.brief-feature { display: grid; gap: var(--s4); }
@media (min-width: 900px) {
  .brief-feature { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: stretch; }
}
.feature-card { display: grid; gap: var(--s3); align-content: start; padding: var(--s6); }
.feature-card h3 { margin: 0; font-size: clamp(22px, 1rem + 1vw, 32px); line-height: 1.2; letter-spacing: -.02em; }
.feature-card p { margin: 0; max-width: var(--measure); }
.feature-card .btn { justify-self: start; }
.brief-side { display: grid; gap: var(--s4); align-content: start; }

/* ----------------------------------------- the single-purpose pages -- */

/* Search, sign-up and a missing page used to be a lone box in a white page.
   They are a warm band now: the thing you came to do on the left, a few lines
   about it on the right. */
.page-hero { background: var(--bg-warm); border-bottom: 1px solid var(--line); }
.page-hero-inner {
  max-width: var(--shell); margin: 0 auto; padding: var(--s8) var(--gutter);
  display: grid; gap: var(--s7); align-items: start;
}
@media (min-width: 900px) {
  .page-hero-inner { grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); gap: var(--s8); }
}
.page-hero h1 { margin: var(--s2) 0 var(--s3); }
.page-hero .lede { margin: 0 0 var(--s5); }
.hero-aside { display: grid; gap: var(--s4); align-content: start; }
.hero-aside h2 { margin: 0; font-size: 18px; }
.hero-aside .hero-points { margin: 0; }
.hero-aside .promises { margin: 0; display: grid; gap: var(--s1); }
.auth-card { max-width: 480px; }
form.search.is-large { max-width: 520px; }
form.search.is-large input { font-size: 16px; padding: 14px var(--s4); }
form.search.is-large button { font-size: 16px; padding: 14px var(--s5); }
.container > .flash { margin: var(--s4) 0 0; }

/* -------------------------------------------- the header on a phone -- */

.header-tools { display: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--fg); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-warm); }
.icon-btn svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: inline; }
html.menu-open { overflow: hidden; }
/* `hidden` loses to any author display rule, so a filtered-out link has to be
   said to be gone here -- the same lesson as the chart's resting hover state. */
.filter-link[hidden] { display: none; }

@media (max-width: 899px) {
  .js .header-tools { display: flex; margin-left: auto; gap: var(--s1); }
  .js form.search { display: none; order: 3; width: 100%; flex-basis: 100%; max-width: none; }
  .js form.search.is-open { display: flex; }

  /* The menu is a sheet over the page. It sits under the logo and the toggle
     (raised above it below) so the button that opens it is still the button
     that closes it. */
  .js .public-nav { display: none; }
  .js .public-nav.is-open {
    display: flex; position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: stretch; align-self: auto;
    gap: 0; margin: 0; padding: 84px var(--gutter) var(--s6);
    background: var(--bg); overflow-y: auto; font-size: 20px;
  }
  .js .public-nav.is-open a:not(.cta) {
    padding: 16px 0; border-bottom: 1px solid var(--line);
  }
  /* align-self: stretch, because the desktop rule centres the button in the
     header's row and that would leave it a narrow pill in a full-width sheet. */
  .js .public-nav.is-open a.cta {
    align-self: stretch; margin-top: var(--s5);
    justify-content: center; min-height: 52px; font-size: 17px;
  }
  .site-inner > .brand, .header-tools { position: relative; z-index: 2; }
}

/* ------------------------------------------------- touch targets -- */

/* 44px is the smallest thing a thumb can hit reliably. Applied to phones and
   to anything with a coarse pointer, so a tablet in landscape gets it too. */
@media (max-width: 720px), (pointer: coarse) {
  .btn, button.primary, .share-btn, form.search button { min-height: 44px; }
  input[type="email"], input[type="text"], input[type="search"],
  input[type="password"], select { min-height: 44px; }
  .filter-link { display: flex; align-items: center; min-height: 44px; }
  .filter-link[hidden] { display: none; }
  .public-nav a:not(.cta) { min-height: 44px; }
}

/* ----------------------------------------------------- page numbers -- */

.page-numbers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s6); }
.page-numbers ol { display: flex; flex-wrap: wrap; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.page-numbers li a, .page-gap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 40px; padding: 0 var(--s2);
  border-radius: var(--radius-sm); font-family: var(--mono); font-size: 14px;
}
.page-numbers li a:hover { background: var(--bg-warm); text-decoration: none; }
/* The page you are on: the same orange bar as the page you are on elsewhere. */
.page-numbers li a.is-on { background: var(--bg-warm); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.page-step { font-weight: 600; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; }
.page-count { margin: var(--s2) 0 0; }

/* ------------------------------------------- the chart's key, and notes -- */

/* The number on a note and in the key, matching the disc on the chart. */
.lg-n, .note-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px;
  background: var(--accent); color: var(--on-brand);
  font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.lg-n.dateonly, .note-n.dateonly {
  background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 2px var(--accent);
}
.chart-legend {
  list-style: none; margin: var(--s4) 0 0; padding: var(--s3) 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
}
.chart-legend a {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 32px; font-size: 13px; color: var(--fg-body);
}
.chart-legend time { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }
.chart-legend .lg-house { color: var(--fg-muted); }
.note-n { margin-right: var(--s1); }
.research-row { scroll-margin-top: calc(68px + var(--s5)); }
.research-row:target { background: var(--bg-warm); border-radius: var(--radius-sm); }

/* How far a price has travelled toward a target: a grey bar and a figure. */
.progress-cell { display: inline-flex; align-items: center; gap: var(--s2); justify-content: flex-end; }
progress.bar {
  appearance: none; -webkit-appearance: none;
  width: 72px; height: 4px; border: 0; border-radius: 2px; overflow: hidden;
  background: var(--surface-sunken); color: var(--fg-muted);
}
progress.bar::-webkit-progress-bar { background: var(--surface-sunken); }
progress.bar::-webkit-progress-value { background: var(--fg-muted); border-radius: 2px; }
progress.bar::-moz-progress-bar { background: var(--fg-muted); border-radius: 2px; }

/* On a phone the chart keeps a readable size and scrolls sideways. */
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .chart-frame { min-width: 640px; }
  /* A control that is wider than the screen scrolls inside its own row. */
  .chart-ranges { overflow-x: auto; max-width: 100%; }
  .chart-ranges a { white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; }
}

/* A note in a list: the company, then who said what, then what they said. */
.research-title { margin: 0 0 var(--s2); font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.research-title a:hover { text-decoration-color: var(--accent); }
.research-row .research-meta { margin-bottom: var(--s2); }

/* A link inside running text has to look like one. Links are ink everywhere else
   and underline on hover, which is right for a nav and wrong for a company name
   in a paragraph: a reader cannot find a link they cannot see. A quiet underline
   at rest, the orange one on hover. */
.wrap p a, .wrap-list a {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.wrap p a:hover, .wrap-list a:hover { text-decoration-color: var(--accent); }
