/* Field Guide to Trading Terms — encyclopaedia skin
   Layout and typography follow the conventions readers know from large reference
   wikis: a fixed left rail of contents, a narrow measure, serif headings over a
   sans body, hairline rules, an infobox floated to the end side, hatnotes in
   italic, and tabular data in bordered tables.
   No third-party marks, wordmarks or taglines are reproduced.
   All spacing is logical so pages mirror under dir="rtl". */

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;

  /* Values below are the actual Vector 2022 (Codex) tokens, read from
     en.wikipedia.org/w/load.php?modules=skins.vector.styles on 03.10.2026 —
     not eyeballed. Light value first, dark second. */
  --paper:   light-dark(#ffffff, #101418);   /* background-color-base */
  --paper-2: light-dark(#f8f9fa, #202122);   /* interactive-subtle: infobox, table head */
  --paper-3: light-dark(#eaecf0, #27292d);   /* rails, hover */
  --ink:     light-dark(#202122, #eaecf0);   /* color-base */
  --ink-2:   light-dark(#54595d, #a2a9b1);   /* color-subtle */
  --rule:    light-dark(#c8ccd1, #54595d);   /* border-color-subtle */
  --rule-2:  light-dark(#a2a9b1, #72777d);   /* border-color-base */
  --link:    light-dark(#3366cc, #88a3e8);   /* color-progressive */
  --link-visited: light-dark(#6a60b0, #a799cd);
  --link-new: light-dark(#d73333, #ff8080);
  /* The one departure: a figure colour, for the worked example's result.
     The reference skin has no such role because it has no worked examples. */
  --accent:  light-dark(#b32d00, #ff9166);

  --serif: 'Linux Libertine', 'Georgia', 'Times New Roman', 'Noto Naskh Arabic', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'IBM Plex Sans Arabic',
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'IBM Plex Mono', Menlo, Consolas, monospace;

  --measure: 45em;
  --content: 1120px;     /* Vector 2022 limited-width column */
  --rail: 232px;         /* contents rail */
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.4px;
  line-height: 1.65;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }
a.new, a.new:visited { color: var(--link-new); }
button { font: inherit; }
p { margin: 0.5em 0 0.9em; }

/* ---------- chrome ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 6px 16px; border-block-end: 1px solid var(--rule); background: var(--paper);
  position: sticky; inset-block-start: 0; z-index: 5;
}
.topbar__mark { font-family: var(--serif); font-size: 17px; white-space: nowrap; color: var(--ink); }
.topbar__mark i { color: var(--ink-2); font-size: 14px; }
.topbar__search {
  flex: 1 1 14rem; min-width: 0; max-width: 32rem;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: 2px;
  padding: 5px 10px;
}
.topbar button {
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule-2);
  border-radius: 2px; padding: 4px 10px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.topbar button:hover { background: var(--paper-3); }

.shell {
  display: grid; gap: 0 24px; align-items: start;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  max-width: calc(var(--content) + var(--rail) + 72px);
  margin-inline: auto; padding: 16px;
}
@media (max-width: 860px) { .shell { grid-template-columns: minmax(0, 1fr); } }

/* ---------- contents rail ---------- */
.toc { position: sticky; inset-block-start: 56px; font-size: 14px; max-height: calc(100vh - 72px);
       overflow-y: auto; padding-inline-end: 8px; border-inline-end: 1px solid var(--rule); }
.toc h2 { font-family: var(--sans); font-size: 14px; font-weight: 600; margin: 0 0 6px;
          border: 0; padding: 0; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-inline-start: 14px; }
.toc li { margin-block: 1px; }
.toc a { display: block; padding: 4px 8px; border-radius: 2px; color: var(--ink); }
.toc a:hover { background: var(--paper-3); text-decoration: none; }
.toc a.is-current { background: var(--paper-3); font-weight: 600;
                    box-shadow: inset 2px 0 0 var(--link); }
@media (max-width: 860px) {
  .toc { position: static; max-height: none; border-inline-end: 0;
         border: 1px solid var(--rule-2); background: var(--paper-2); padding: 10px 12px;
         margin-block-end: 16px; }
}

/* ---------- article ---------- */
.article { min-width: 0; }
.title { font-family: var(--serif); font-size: 28px; line-height: 1.3; font-weight: 400;
         margin: 0 0 4px; }
.title-rule { border: 0; border-block-start: 1px solid var(--rule); margin: 0 0 12px; }
.subtitle { color: var(--ink-2); font-size: 14px; margin: -2px 0 12px; }
.hatnote { font-style: italic; color: var(--ink); margin: 0 0 10px; padding-inline-start: 1.6em;
           font-size: 14px; }
.article h2 { font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.3;
              margin: 24px 0 8px; padding-block-end: 4px; border-block-end: 1px solid var(--rule); }
.article h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; margin: 18px 0 6px; }
.article p, .article li { max-width: var(--measure); }
.article ul, .article ol { margin: 0.4em 0 0.9em; padding-inline-start: 1.6em; }
.lead { font-size: 15.2px; }
.lead b:first-child { font-weight: 700; }

/* ---------- infobox ---------- */
.infobox {
  float: inline-end; inline-size: 300px; max-inline-size: 100%;
  margin: 0 0 16px 20px; border: 1px solid var(--rule-2); background: var(--paper-2);
  font-size: 13px; line-height: 1.5;
}
.infobox__title { text-align: center; font-weight: 600; padding: 8px 10px;
                  border-block-end: 1px solid var(--rule-2); background: var(--paper-3); }
.infobox table { inline-size: 100%; border-collapse: collapse; }
.infobox th { text-align: start; vertical-align: top; font-weight: 600; color: var(--ink-2);
              padding: 6px 10px; inline-size: 40%; }
.infobox td { padding: 6px 10px; }
.infobox tr + tr th, .infobox tr + tr td { border-block-start: 1px solid var(--rule); }
@media (max-width: 620px) { .infobox { float: none; inline-size: 100%; margin-inline: 0; } }

/* ---------- tables ---------- */
.data-wrap { overflow-x: auto; margin-block: 12px 16px; }
table.data { border-collapse: collapse; border: 1px solid var(--rule-2);
             background: var(--paper-2); font-size: 13.6px; min-inline-size: 420px; }
table.data caption { caption-side: top; text-align: start; font-weight: 600;
                     padding: 0 0 6px; font-size: 14px; }
table.data th, table.data td { border: 1px solid var(--rule); padding: 6px 10px;
                               vertical-align: top; }
table.data thead th { background: var(--paper-3); text-align: start; }
table.data td.num { text-align: end; font-variant-numeric: tabular-nums lining-nums; }
table.data tr.is-key td { font-weight: 700; color: var(--accent); }

/* ---------- worked example ---------- */
/* Kept from the field-guide system: it is the one thing general dictionaries lack. */
.worked { border: 1px solid var(--rule-2); background: var(--paper-2); margin-block: 14px 18px; }
.worked__head { padding: 7px 12px; border-block-end: 1px solid var(--rule-2);
                background: var(--paper-3); font-weight: 600; font-size: 13.6px; }
.worked__body { overflow-x: auto; padding: 4px 12px 10px; }
.worked__rows { min-inline-size: 420px; font-variant-numeric: tabular-nums lining-nums; }
.worked__row { display: grid; grid-template-columns: 1.4fr 1.4fr auto; gap: 0 14px;
               padding-block: 7px; border-block-end: 1px solid var(--rule); font-size: 13.8px; }
.worked__row:last-child { border-block-end: 0; }
.worked__row span:last-child { text-align: end; }
.worked__row.is-key { font-weight: 700; color: var(--accent); }

/* ---------- confused-with ---------- */
/* Required on every entry. Rendered as a plain definition list, wiki-style. */
.distinguish { margin-block: 10px 18px; }
.distinguish dt { font-weight: 600; margin-block-start: 10px; }
.distinguish dt a { font-weight: 600; }
.distinguish dd { margin: 2px 0 0; max-width: var(--measure); }
.distinguish .mark { color: var(--ink-2); font-style: italic; }

/* ---------- see also / navigation ---------- */
.seealso { columns: 16rem; column-gap: 32px; list-style: none; margin: 8px 0 0; padding: 0; }
.seealso li { break-inside: avoid; padding-block: 3px; }
.catlinks { margin-block-start: 28px; padding: 8px 12px; border: 1px solid var(--rule);
            background: var(--paper-2); font-size: 13.4px; }
.catlinks b { font-weight: 600; }
.catlinks a + a::before { content: " · "; color: var(--ink-2); }

/* ---------- A-Z index ---------- */
.az-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(2rem, 1fr));
           border: 1px solid var(--rule-2); background: var(--paper-2); margin-block-end: 14px; }
.az-rail a, .az-rail span { display: flex; align-items: center; justify-content: center;
           min-height: 44px; font-family: var(--serif); font-size: 17px; }
.az-rail .is-empty { color: var(--rule-2); }
.az-list { columns: 14rem; column-gap: 32px; list-style: none; margin: 0; padding: 0; }
.az-list li { break-inside: avoid; padding-block: 3px; }

/* ---------- footer ---------- */
.site-foot { border-block-start: 1px solid var(--rule); margin-block-start: 32px;
             padding-block: 16px 32px; color: var(--ink-2); font-size: 13px; }
.site-foot__inner { max-width: calc(var(--content) + var(--rail) + 72px); margin-inline: auto;
                    padding-inline: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px;
                    justify-content: space-between; }

/* ---------- arabic ---------- */
[lang="ar"] { line-height: 1.85; }
.ltr { direction: ltr; }

/* ---------- references ---------- */
/* Superscript markers in the text, a numbered list at the end, and a back-link
   from each note to where it was cited — the convention readers expect. */
sup.reference { font-size: 11px; line-height: 1; vertical-align: super; }
sup.reference a { text-decoration: none; }
sup.reference a:hover { text-decoration: underline; }
.references { font-size: 13px; line-height: 1.6; margin: 8px 0 0; padding-inline-start: 2em;
              columns: 28rem; column-gap: 32px; }
.references li { break-inside: avoid; padding-block: 2px; max-width: var(--measure); }
.references li:target { background: var(--paper-3); }
.backlink { font-weight: 700; margin-inline-end: 4px; }
.backlink a { text-decoration: none; }
.ref-src { font-style: italic; color: var(--ink-2); }
/* A cited line flashes when you jump back to it. */
:target { scroll-margin-block-start: 64px; }
