/* ============================================================
   PRODUCTION STYLESHEET — MARKETS GROUP density pass.
   Pages: news, macro, dividends, calendar, astro, market (left-menu order).

   The container outline (border weight/colour) and the 14px tile inset
   are DEFINED desk-wide by pages.css, and this sheet does not
   redefine them — it applies them to the containers that sheet's
   selectors cannot reach, which is every page-specific class in this
   group (.facts, .timing, .gstrip, the whole .ar-* family). The rest of
   the file addresses the other half of the owner's complaint: "too many
   tiles... confusing". Loaded after pages.css under the same
   `body[data-theme=gemini] #view <selector>` convention, so it wins on
   source order with no !important.
   ============================================================ */

/* ------------------------------------------------------------
   NEWS — no rule needed.
   pageNews (app.js:3491) is already a single .card with the wire feed
   as hairline-divided rows (themes.css .wire p{border-bottom:1px dotted
   var(--hair)}), not a stack of boxed items. That is the exact pattern
   the rest of this file is pushing other pages toward, so news is left
   alone.
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   MACRO — collapse the individually-boxed instrument tiles into one
   bordered strip per group, matching this same page's own .facts
   pattern lower down.
   pageMacro (app.js:727) renders five groups (.gband) of instrument
   tiles (.gtile), and every .gtile carries its own full border —
   15-20 separately outlined boxes stacked in five bands is exactly the
   "too many tiles" the owner is pointing at, on a page that already
   proves the calmer alternative works (macroCard's .facts grid: one
   bordered wrapper, hairline dividers, no per-cell border). Reusing
   that pattern here turns five walls of boxes into five bordered
   strips with internal hairlines.
   ------------------------------------------------------------ */
body[data-theme=gemini] #view .gtiles {
  gap: 1px;
  border: 1px solid var(--rhair);
  background: var(--rhair);
}
body[data-theme=gemini] #view .gtiles .gtile {
  border: none;
  background: var(--paper-2);
}
/* .facts is the pattern the fix above is copied from, but it was never
   retuned itself: themes.css:394 still draws it as `border:1px solid
   var(--line)`, so the fact grid sits inside a --rhair card wearing the
   older, darker outline. On Macro (app.js:777) the page is almost
   nothing but .facts, which makes it the loudest remaining mismatch in
   this group; the ticker detail panel (app.js:3338) renders the same
   grid and gets the same correction for free. Same idiom
   pages-workspace.css:66-72 used for .statgrid/.stat — recolour the
   wrapper's border and let the 1px gaps show as hairlines. */
body[data-theme=gemini] #view .facts {
  border-color: var(--rhair);
  background: var(--rhair);
}
body[data-theme=gemini] #view .facts > * {
  background: var(--paper-2);
}
/* The geo-risk tape (app.js:504) is Macro's own summary bar — clicking it
   opens this page — but it renders into #gstripHost, a SIBLING of #view
   (index.html:267, kept outside so a page render never restarts the
   marquee). That is why it was missed: no `#view` selector can reach it.
   It is still a container in the main column, so themes.css:1594's
   1.5px --line moves to the hairline like everything else. Only the
   outline changes — the dark --ink1 ground, the per-item dividers that
   are tuned against it, and the marquee animation are all untouched. */
body[data-theme=gemini] #gstripHost .gstrip {
  border-width: 1px;
  border-color: var(--rhair);
}

/* ------------------------------------------------------------
   DIVIDENDS — the tile COUNT here was already lean (pageDividends,
   app.js:3427: one .timing strip, then at most two table cards — no
   wall of boxes), and an earlier pass read that as "no rule needed".
   That was only half the page: the strip's own outline is still
   themes.css:1582's 1.5px --line. Because .timing renders as a direct
   child of #view rather than inside a .card (app.js:3448), nothing in
   pages.css reaches it either — it is the one container on the
   page still wearing the old tone, sitting directly above two cards
   that wear the new one.
   ------------------------------------------------------------ */
body[data-theme=gemini] #view .timing {
  border-width: 1px;
  border-color: var(--rhair);
}
/* the strip pads through its cells rather than itself, and they were
   drawn at 12/14 — so the cells take the desk inset, and the strip's
   first word lines up with the card text below it. */
body[data-theme=gemini] #view .timing > div {
  padding: var(--tile-pad);
}
/* stacked, themes.css:1752 swaps the cell divider from --hair to the
   heavier --line, which would put the old tone back on mobile only. */
@media (max-width: 720px) {
  body[data-theme=gemini] #view .timing > div { border-bottom-color: var(--rhair); }
}

/* ------------------------------------------------------------
   CALENDAR — left as-is; noting why rather than forcing a fix.
   pageCalendar (app.js:3468) renders one .card per month, and a
   subscribed reader can see many stacked. The month heading is set
   with an inline `style="font-size:13px"` (app.js:3479), which no
   selector here can override without !important, so its type can't be
   normalised to Board's head-band size from this file. Merging the
   stacked month cards into one hairline-divided block would need a
   sibling selector like `#view .card + .card`, but .card is the desk's
   generic container class used by every other group's pages too —
   that selector would reach far outside the Markets pages this file
   owns. Each month card already carries the lighter 1px --rhair
   outline from pages.css, which is the safe part of this fix;
   the rest needs a markup change (a shared wrapper class or a
   `.cal-month` hook), which is out of scope for a CSS-only pass.
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   ASTRO — de-nest "Your charts": a grid of individually-boxed tiles
   sitting inside an already-boxed card is two border layers doing one
   job.
   pageAstro's "Your charts" card (app.js ~2513-2560) wraps .sb-grid, a
   grid of .sb-tile boxes (themes.css:1462-1471) each with its own full
   border — a boxed grid nested inside a boxed card. Same fix as macro:
   the grid wrapper takes one border and a hairline background, the
   tiles lose their own border and just sit on --paper-2. The dashed
   "add a chart" tile keeps a border so it still reads as an action
   slot rather than a data cell.
   ------------------------------------------------------------ */
body[data-theme=gemini] #view .sb-grid {
  gap: 1px;
  border: 1px solid var(--rhair);
  background: var(--rhair);
}
body[data-theme=gemini] #view .sb-tile {
  border: none;
  background: var(--paper-2);
}
body[data-theme=gemini] #view .sb-add {
  border: 1px dashed var(--rhair);
  background: var(--paper-2);
}
/* ------------------------------------------------------------
   ASTRO — the reading itself. Its tile COUNT is fine (each .ar-card is
   one substantial written reading, not a decorative tile), but the
   whole `.ar-*` container family below it was never retuned, and it is
   the densest stack of containers on any page: per stock the reading
   nests an .ar-grid of four cells and four .ar-block slabs (the dasha
   ladder, the falsification receipt, today's sky, the two reference
   charts), and three of those slabs contain a further bordered list.
   Every one of them is still themes.css's 1.5px/1px --line on --panel,
   inside an --rhair card — so on Astro the old design language is not a
   leftover edge, it is most of the page.
   ------------------------------------------------------------ */

/* .ar-card carries a 3px inline-start rail (themes.css:1394). It is the
   same colour on every reading, so it marks emphasis rather than state —
   the .legal-intro case in pages.css:99-104, not the .disclaimer
   case: it keeps its width and moves to the hairline tone. Restating it
   also puts the rail BACK: pages.css:30's `border:1px solid` is a
   physical shorthand at (1,2,1), and border-inline-start resolves to the
   same left longhand, so the higher-specificity shorthand has been
   flattening the rail to 1px since that sheet landed. */
body[data-theme=gemini] #view .ar-card { border-inline-start: 3px solid var(--rhair); }

/* the four "cells over a hair ground" wrappers: the fact grid, the dasha
   ladder, today's live conditions, and the Pakistan/KSE-100 pair. Each
   draws its internal dividers from its own background, so the ground has
   to move with the border or the cells stay outlined in the old tone —
   the same coupling pages.css:83-95 documents. */
body[data-theme=gemini] #view .ar-grid,
body[data-theme=gemini] #view .ar-dl-wrap,
body[data-theme=gemini] #view .ar-live,
body[data-theme=gemini] #view .ar-cmpg {
  border-width: 1px;
  border-color: var(--rhair);
  background: var(--rhair);
}
body[data-theme=gemini] #view .ar-cell,
body[data-theme=gemini] #view .ar-drow,
body[data-theme=gemini] #view .ar-lrow,
body[data-theme=gemini] #view .ar-cmp { background: var(--paper-2); }

/* a dasha row's 3px rail DOES encode a reading — benefic/malefic is the
   tradition's own verdict on the period lord — so only the neutral
   "neither" tone moves. The two coloured cases are restated because the
   neutral rule above carries an id and would otherwise outweigh
   themes.css:1419-1420 at (0,3,1). */
body[data-theme=gemini] #view .ar-drow { border-inline-start-color: var(--rhair); }
body[data-theme=gemini] #view .ar-drow.benefic { border-inline-start-color: var(--up); }
body[data-theme=gemini] #view .ar-drow.malefic { border-inline-start-color: var(--dn); }

/* the four value slabs (themes.css:1410) pad themselves at 12/14/13, so
   they take the desk inset directly the way pages.css:228-234
   does for the other self-padding containers. */
body[data-theme=gemini] #view .ar-block {
  border-width: 1px;
  border-color: var(--rhair);
  background: var(--paper-2);
  padding: var(--tile-pad);
}

/* the receipt table's header rule is drawn a weight heavier than the slab
   holding it — the same mismatch pages.css:43-54 corrected on the
   card head band. */
body[data-theme=gemini] #view .ar-tt th { border-bottom: 1px solid var(--rhair); }

/* ------------------------------------------------------------
   MARKET — no rule needed.
   pageMarket's browse grid (app.js:5748, .mkt-grid of .mkt-card) is a
   deliberate item grid — a marketplace listing, the same job Board's
   own tile grid does — and every .mkt-card carries the class `card`,
   so it already inherits Board's 1px --rhair outline and --paper-2
   fill from pages.css with no extra work here. Its internal
   sections (.mkt-top, .mkt-spec, .mkt-meta) are plain flex rows with
   no nested borders to strip out.
   ------------------------------------------------------------ */
