/* Dartabase: the register.
 *
 * Derived from the Claude Design "Dartabase" canvas. Two deliberate departures
 * from that file, both recorded in docs/interface-spec.md terms:
 *
 *  1. The wordmark carries the Nepal roundel and the flag crimson, at the
 *     owner's direction. The independence line is therefore given more weight
 *     than the canvas gave it: it sits in the masthead, not only the footer -
 *     so the page still states plainly that this is not a government register.
 *  2. Gregorian dates are primary everywhere, Bikram Sambat secondary, including
 *     at month precision, where the canvas had it the other way round.
 *
 * The accent (--steel) is reserved for provenance. It appears on rails, marks,
 * citations and nowhere else. Not on buttons, not on links, not on headings.
 * If you are reaching for it for anything else, reach for --ink instead.
 */

:root {
  --paper: #f4f5f6;
  --paper-deep: #e6e7e9;
  --ink: #1d1f20;
  --muted: #5d5d60;
  --faint: #7a7a7d;
  --ghost: #98989b;

  --crimson: #7d1122;     /* brand only: the wordmark. Never a UI signal. */
  --flag-red: #c8102e;    /* the mark itself, matching the flag */
  --steel: #416180;       /* provenance accent: reserved */
  --rail: #cddcea;        /* provenance rail */
  --tint: #eef3f8;        /* provenance panel ground */
  --mark-light: #94bce3;  /* provenance text on dark */

  --hairline: rgba(29, 31, 32, 0.16);
  --hairline-soft: rgba(29, 31, 32, 0.1);
  --hairline-strong: rgba(29, 31, 32, 0.3);

  --font-display: "Barlow Condensed", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Devanagari", system-ui, sans-serif;
  /* Mono carries no Devanagari. The bilingual face sits behind it so a
   * Devanagari amount renders instead of falling back to tofu, while Latin
   * digits keep their tabular alignment. */
  --font-mono: "IBM Plex Mono", "IBM Plex Sans Devanagari", ui-monospace, Menlo, monospace;

  --page: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #000; }

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

::selection { background: var(--rail); color: var(--ink); }

/* ---------------------------------------------------------------- chrome */

.masthead {
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; background: var(--paper); z-index: 20;
}
/* The rule spans the viewport, but its contents sit on the same column as the
   page body: otherwise the wordmark drifts to the far left on a wide screen
   while every entry below stays centred. */
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; height: 52px;
  max-width: var(--page); margin: 0 auto; padding: 0 30px;
}
.masthead-left { display: flex; align-items: center; gap: 26px; }

/* Brand crimson lives here and nowhere else. It is deliberately NOT used for
 * buttons, links, headings or any state, so it never competes with the steel
 * provenance accent for meaning. */
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 19px var(--font-display);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--crimson); text-decoration: none;
}
.wordmark:hover { color: #5e0c19; }
/* Two-tone on the morpheme boundary: crimson "Darta", ink "base". Two shades
 * of red were the other option and were rejected: at 19px under .14em tracking
 * they read as a printing fault rather than a decision, and a second red would
 * be a new brand colour. Crimson against ink is unmistakable and adds nothing
 * to the palette. */
/* The whole name is one flex item. It has to be: .wordmark is inline-flex with
 * a 9px gap for the mark, and a bare text node beside the coloured span made
 * them two items, so the gap opened up inside the word and it read "DARTA
 * BASE". Keep the name wrapped. */
.wordmark-text { white-space: nowrap; }
.wordmark-base { color: var(--ink); }
.wordmark:hover .wordmark-base { color: #000; }
/* Height only: the mark is not square and must keep its own aspect. */
.wordmark img { height: 20px; width: auto; display: block; }
.masthead-right { display: flex; align-items: center; gap: 16px; }

/* The name reads as official, so the masthead says outright that it isn't. */
.masthead-independence {
  font: 400 11px/1.3 var(--font-body); color: var(--faint);
  max-width: 21ch; text-align: right;
}

.nav { display: flex; gap: 18px; font: 400 13.5px var(--font-body); }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }

.searchbox {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline); padding: 5px 9px; width: 250px;
  background: var(--paper);
}
.searchbox input {
  border: 0; background: transparent; outline: none; width: 100%;
  font: 400 13.5px var(--font-body); color: var(--ink);
}
.searchbox input::placeholder { color: var(--ghost); }

.page { max-width: var(--page); margin: 0 auto; padding: 26px 30px 0; }

.footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 30px; margin-top: 40px;
  border-top: 1px solid var(--hairline);
  max-width: var(--page); margin-left: auto; margin-right: auto;
}
@media (max-width: 860px) { .masthead-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; } }
.independence {
  font: 400 12px/1.4 var(--font-body); color: var(--faint);
  max-width: 40ch;
}

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

.hero-title {
  margin: 0; font: 600 52px/1.02 var(--font-display);
  letter-spacing: -.015em; color: var(--ink); text-wrap: balance;
}
.hero-sub {
  font: 400 18.5px/1.5 var(--font-body); color: #424244;
  max-width: 54ch; margin: 14px 0 0; text-wrap: pretty;
}
.hero-sub strong { font-weight: 600; color: var(--ink); }

@media (max-width: 860px) { .hero-title { font-size: 36px; } .hero-sub { font-size: 16.5px; } }

/* ------------------------------------------------------------ typography */

h1.entry-name {
  margin: 0; font: 600 40px/1.05 var(--font-display);
  letter-spacing: -.01em; color: var(--ink);
}
.entry-name-ne { font: 500 30px/1.15 var(--font-body); color: var(--ink); }

h2.section {
  margin: 0; font: 600 15px var(--font-display);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 30px 0 0; padding-bottom: 9px; border-bottom: 1px solid var(--hairline);
}
.section-count { font: 400 11.5px var(--font-mono); color: var(--faint); }

.label {
  font: 600 10.5px var(--font-display); letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.eyebrow {
  font: 600 13.5px var(--font-display); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink);
}
.entry-ref {
  display: flex; align-items: baseline; gap: 14px;
  font: 400 11.5px var(--font-mono); color: var(--faint); margin-bottom: 12px;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lede { font: 400 15px/1.5 var(--font-body); color: #424244; max-width: 62ch; text-wrap: pretty; }
.note { font: 400 12.5px/1.45 var(--font-body); color: var(--faint); }

/* The company's own mark, from its own site. Small and square-framed like
   everything else here, never a hero image (interface-spec §9). */
.company-mark {
  width: 28px; height: 28px; object-fit: contain; flex: none;
  border: 1px solid var(--hairline); padding: 2px; background: #fff;
}
.homepage-link {
  font: 400 13px var(--font-mono); color: var(--muted);
  text-decoration: none; border-bottom: 1px solid var(--hairline-strong);
}
.homepage-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.homepage-link::after { content: " ↗"; color: var(--faint); }

/* ---------------------------------------------------------------- badges */

.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.badge {
  font: 500 11.5px var(--font-display); letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 8px;
  border: 1px solid rgba(29, 31, 32, .28); color: var(--ink);
}
.badge.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge.dashed { border-style: dashed; color: var(--muted); }
.badge.quiet { color: var(--muted); }
/* The only status colour in the system, and it earns its place: a company
 * that has stopped operating is the one fact on a page you should not have to
 * read prose to find. Kept as an outline rather than a fill so it does not
 * compete with the crimson wordmark, and a shade off it so the two never read
 * as the same thing. Never used for anything but this. */
.badge.defunct { border-color: #a3333d; color: #a3333d; }
/* The "?" superscript that used to sit here was removed: on a row of four
 * badges it read as four unanswered questions rather than four hints, and the
 * title attribute already does the work on hover and focus. */
.badge.explainer { cursor: help; text-decoration: none; }
a.badge.explainer:hover { border-color: var(--ink); }
/* A listing is a fact about the company, so the pill is ink like every other
   badge: the steel accent stays reserved for provenance. */
.badge.listing-pill {
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  border-color: var(--ink);
}
.badge.listing-pill::after { content: "↗"; font-size: 10px; color: var(--faint); }
.badge.listing-pill:hover { background: var(--ink); color: var(--paper); }
.badge.listing-pill:hover::after { color: var(--paper); }

/* ----------------------------------------------------------- blueprint */
/* From the Industry design system: square, hairline, corner registration
 * marks. Never rounded, never filled. */

.blueprint { position: relative; border: 1px solid var(--hairline); background: transparent; }
.blueprint .corner {
  position: absolute; width: 7px; height: 7px; opacity: .55;
  background:
    linear-gradient(var(--faint), var(--faint)) center/100% 1px no-repeat,
    linear-gradient(var(--faint), var(--faint)) center/1px 100% no-repeat;
}
.blueprint .corner.tl { top: -4px; left: -4px; }
.blueprint .corner.tr { top: -4px; right: -4px; }
.blueprint .corner.bl { bottom: -4px; left: -4px; }
.blueprint .corner.br { bottom: -4px; right: -4px; }

/* ------------------------------------------------------------- buttons */

.btn {
  font: 600 13.5px var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 0; cursor: pointer; text-decoration: none;
  display: inline-block;
  background: transparent; color: var(--ink); border: 1px solid var(--hairline-strong);
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }

/* ------------------------------------------------- the provenance rail */
/* The signature element. One mark per fact. A page densely marked "filing"
 * must look different from a page of half marks: confidence as texture. */

.entry {
  display: grid; grid-template-columns: 20px 128px 1fr;
  padding: 18px 0 20px; border-bottom: 1px solid var(--hairline-soft);
}
.entry:last-child { border-bottom: 0; }
.entry-rail { border-left: 2px solid var(--rail); height: 100%; position: relative; }

.mark {
  position: absolute; left: -6px; top: 3px;
  background: var(--paper); padding: 2px 0; cursor: help; display: block;
  border: 0; line-height: 0;
}
.mark svg { display: block; }

.date-cell { font: 400 13.5px/1.5 var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.date-ad { color: var(--ink); }        /* Gregorian, always primary */
.date-bs { color: var(--muted); }      /* Bikram Sambat, always secondary */
.date-fy { color: var(--ghost); font-size: 11.5px; }
.date-precision-note { color: var(--ghost); font-size: 11.5px; }

.entry-body { min-width: 0; }
.entry-detail {
  font: 400 15.5px/1.5 var(--font-body); color: var(--ink);
  margin-top: 5px; max-width: 62ch; text-wrap: pretty;
}
.amount-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px; margin-top: 8px; }
.amount { font: 500 18px var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.amount-raw { font: 400 13px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.amount-usd {
  font: 400 15px var(--font-mono); color: var(--muted);
  font-variant-numeric: tabular-nums; cursor: help;
  /* Dotted underline so it reads as "there is more here", which a bare
     number does not. The tooltip carries the rate and its date. */
  border-bottom: 1px dotted var(--hairline-strong);
}
.amount-usd:hover { color: var(--ink); border-bottom-color: var(--ink); }
.amount-published {
  /* The source's own wording, standing in for a figure we could not normalise.
     Body font, not mono: it is prose, and it can be Devanagari. */
  font: 500 17px/1.4 var(--font-body); color: var(--ink); max-width: 58ch;
}
.amount-detail {
  font: 400 12px/1.5 var(--font-mono); color: var(--faint);
  font-variant-numeric: tabular-nums; margin-top: 3px;
}
.participants {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px;
  font: 400 13.5px var(--font-body); color: #424244;
}
.participants .role { color: var(--faint); }
.participants a { text-decoration: none; border-bottom: 1px solid var(--hairline-strong); }

/* ----------------------------------------------------- conflict block */
/* Where two sources disagree, show both. Never pick a winner. */

.conflict { border: 1px solid var(--rail); margin-top: 12px; }
.conflict-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: var(--tint); border-bottom: 1px solid var(--rail);
  font: 600 10.5px var(--font-display); letter-spacing: .13em;
  text-transform: uppercase; color: var(--steel);
}
.conflict-pair { display: grid; grid-template-columns: 1fr 1fr; }
.conflict-side { padding: 11px 12px 12px; }
.conflict-side + .conflict-side { border-left: 1px solid var(--rail); }
.conflict-amount { font: 500 20px var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.conflict-norm { font: 400 12.5px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

.citation {
  display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font: 400 12.5px var(--font-body); color: var(--steel);
  cursor: help; text-decoration: none; background: none; border: 0; padding: 0;
  text-align: left;
}
.citation:hover { color: var(--steel); text-decoration: underline; }
.pubmark { width: 14px; height: 14px; object-fit: contain; flex: none; }

/* --------------------------------------------------------- source list */

.sources-list { display: grid; gap: 8px; font: 400 13px/1.45 var(--font-body); }
.source-row { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: start; }
.source-row svg { margin-top: 4px; }
.source-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--steel); }

/* -------------------------------------------------------- two-up panel */

.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--hairline); border-top: 1px solid var(--hairline);
  margin-top: 30px;
}
.split > div { background: var(--paper); padding: 22px 30px 24px; }

/* ------------------------------------------------------------- popover */

.pop {
  /* Interactive on purpose: the citation URL inside it has to be clickable. */
  position: fixed; z-index: 99;
  background: var(--ink); color: var(--paper); padding: 10px 12px; max-width: 320px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
  animation: popIn .12s ease-out;
}
.pop-kind {
  font: 600 9.5px var(--font-display); letter-spacing: .14em;
  text-transform: uppercase; color: var(--mark-light);
}
.pop-pub { font: 500 14px var(--font-body); margin-top: 3px; display: flex; align-items: center; gap: 7px; }
.pop-date { font: 400 12.5px var(--font-body); color: #b7b7ba; }
a.pop-url, .pop-url {
  display: block; font: 400 11px/1.4 var(--font-mono); color: var(--mark-light);
  margin-top: 6px; word-break: break-all; text-decoration: none;
}
a.pop-url:hover { color: #fff; text-decoration: underline; }
.pop-arch { font: 400 10.5px var(--font-mono); color: var(--ghost); margin-top: 3px; }

@keyframes popIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

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

.register { width: 100%; border-collapse: collapse; margin-top: 8px; }
.register th {
  text-align: left; font: 600 10.5px var(--font-display); letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--hairline);
}
.register td {
  padding: 11px 12px 11px 0; border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top; font-size: 14.5px;
}
.register tr:hover td { background: rgba(29, 31, 32, .02); }
.register a { text-decoration: none; }
.register a:hover { text-decoration: underline; }
.register .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ------------------------------------------------------------- filters */

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--hairline);
}
.filters .label { margin-right: 4px; }
.chip {
  font: 500 11.5px var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border: 1px solid var(--hairline); color: var(--muted);
  text-decoration: none;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --------------------------------------------------------- empty state */
/* An empty screen is an invitation to act, not an apology. */

.stub { margin: 22px 0 0; padding: 18px 18px 20px; }
.stub-headline { font: 400 16px/1.5 var(--font-body); color: var(--ink); text-wrap: pretty; }
.stub-note { font: 400 13.5px/1.5 var(--font-body); color: var(--muted); margin-top: 8px; text-wrap: pretty; }

/* ------------------------------------------------------- review queue */
/* Mobile-first. Used one-handed, on a phone, on a Sunday. */

.queue { max-width: 460px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.queue-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--hairline); }
.queue-progress { height: 3px; background: rgba(29, 31, 32, .12); margin-top: 9px; }
.queue-progress span { display: block; height: 3px; background: var(--ink); }
.queue-body { padding: 16px 18px 0; flex: 1; }
.snippet { margin-top: 14px; border: 1px solid var(--rail); }
.snippet-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 11px;
  background: var(--tint); border-bottom: 1px solid var(--rail);
  font: 600 10.5px var(--font-display); letter-spacing: .12em;
  text-transform: uppercase; color: var(--steel);
}
.snippet-text { padding: 11px; font: 400 15.5px/1.65 var(--font-body); color: var(--ink); }
.snippet-text mark { background: #d6ebff; color: var(--ink); }
.extracted { margin-top: 14px; border: 1px solid var(--hairline); }
.extracted-head {
  padding: 7px 11px; border-bottom: 1px solid var(--hairline);
  font: 600 10.5px var(--font-display); letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.extracted-grid {
  display: grid; grid-template-columns: 88px 1fr; gap: 8px 12px; padding: 12px 11px;
  font: 400 14.5px var(--font-body); color: var(--ink);
}
.extracted-grid .k { color: var(--faint); font-size: 13px; }
.queue-actions {
  position: sticky; bottom: 0; background: var(--paper);
  border-top: 1px solid var(--hairline); padding: 12px 18px 20px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px;
}
.queue-actions .btn { height: 56px; font-size: 15px; display: grid; place-items: center; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .identity { grid-template-columns: 1fr !important; }
  .split { grid-template-columns: 1fr; }
  .split > div { padding: 18px 16px 20px; }
  .conflict-pair { grid-template-columns: 1fr; }
  .conflict-side + .conflict-side { border-left: 0; border-top: 1px solid var(--rail); }
  .entry { grid-template-columns: 16px 1fr; }
  .entry .date-cell { grid-column: 2; margin-bottom: 6px; }
  .entry .entry-body { grid-column: 2; }
  .masthead { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .page { padding: 20px 16px 0; }
  h1.entry-name { font-size: 30px; }
  .entry-name-ne { font-size: 22px; }
  .register { display: block; overflow-x: auto; }

  /* Two full-width rows rather than one cramped one: search first because it
     is the thing a phone user reaches for, the independence line under it. */
  .masthead-right { width: 100%; flex-wrap: wrap; gap: 8px 12px; }
  .searchbox { order: 1; width: 100%; }
  .masthead-independence { order: 2; max-width: none; text-align: left; }
  /* Under 16px, iOS zooms the whole page on focus and never zooms back. */
  .searchbox input { font-size: 16px; }

  /* Side panels sit under the column they annotate instead of squeezing it. */
  .with-aside { grid-template-columns: 1fr !important; gap: 26px !important; }
  .field-pair { grid-template-columns: 1fr !important; }

  .footer { padding: 18px 16px; }
}

/* A source URL is one long unbreakable token and will push the page sideways
   on a narrow screen if it is allowed to. */
.source-row, .sources-list a, .entry-body { overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .hero-title { font-size: 31px; }
  .masthead-inner { gap: 10px; }
  .nav { gap: 14px; }
  .queue-actions { grid-template-columns: 1fr; }
  .queue-actions .btn { height: 48px; }
}

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

/* Self-reported portfolio holdings. Deliberately quieter than the sourced
   deals table above them: they are a weaker class of fact and should not
   read as equivalent. */
ul.holdings {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2px 18px;
}
ul.holdings li {
  font-size: 14.5px;
  padding: 5px 0 5px 13px;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
}
ul.holdings li a { color: var(--ink); }
