/* kw-business: the design system of FigSight and Amaar (docs/03 Areas/design.md):
   design tokens per theme, light and dark following the device, panels, framed
   and striped tables. Taken from Amaar's stylesheet, which is FigSight's made
   Arabic and right to left. Self-hosted fonts only, both SIL OFL: IBM Plex Sans
   (fonts/IBM-Plex-Sans-OFL.txt) and IBM Plex Sans Arabic
   (fonts/IBM-Plex-Sans-Arabic-OFL.txt). Logical properties only, so a page
   flips right to left by its dir attribute alone. Every text colour below is
   at least 4.5:1 on its background. */

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-600.woff2') format('woff2');
}

:root {
  --navy: #061936;
  --gold: #f5ca2a;
  --gold-hover: #e3b714;
  --header-bg: #061936;
  --header-fg: #e8ebed;
  --header-muted: #b7bcbf;
}

/* Light theme: the default, and what a device without a preference gets. */
:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-sunk: #eef0f2;
  --fg: #061936;
  --muted: #4e5a64;
  --line: #d5dadf;
  --row-alt: rgb(6 25 54 / 0.04);
  --link: #7a5c00;
  --focus: #061936;
  --accent-line: #f5ca2a;
  --danger: #b3261e;
  --danger-fill: #b3261e;
  --danger-fill-fg: #ffffff;
  --error-bg: #fdecea;
  --notice-bg: #fdf6d8;
  --shadow: 0 1px 2px rgb(6 25 54 / 0.06), 0 2px 8px rgb(6 25 54 / 0.05);
  /* FigSight's chart colours, checked for colour-blind separation and contrast. */
  --tone-1: #2f5f9e;
  --tone-2: #a67c00;
  --tone-3: #7b5ea7;
  color-scheme: light;
}

/* Dark when the device asks for it, unless the viewer chose light with the
   header's button (js/theme.js sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #061936;
    --surface: #0e2547;
    --surface-sunk: #0a1f3e;
    --fg: #e8ebed;
    --muted: #b7bcbf;
    --line: #23406b;
    --row-alt: rgb(255 255 255 / 0.05);
    --link: #f5ca2a;
    --focus: #f5ca2a;
    --accent-line: #f5ca2a;
    --danger: #ff8a80;
    --danger-fill: #ff8a80;
    --danger-fill-fg: #061936;
    --error-bg: #3a1626;
    --notice-bg: #1a3157;
    --shadow: none;
    --tone-1: #5b8fd6;
    --tone-2: #b08918;
    --tone-3: #9a7fd0;
    --header-bg: #041127;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #061936;
  --surface: #0e2547;
  --surface-sunk: #0a1f3e;
  --fg: #e8ebed;
  --muted: #b7bcbf;
  --line: #23406b;
  --row-alt: rgb(255 255 255 / 0.05);
  --link: #f5ca2a;
  --focus: #f5ca2a;
  --accent-line: #f5ca2a;
  --danger: #ff8a80;
  --danger-fill: #ff8a80;
  --danger-fill-fg: #061936;
  --error-bg: #3a1626;
  --notice-bg: #1a3157;
  --shadow: none;
  --tone-1: #5b8fd6;
  --tone-2: #b08918;
  --tone-3: #9a7fd0;
  --header-bg: #041127;
  color-scheme: dark;
}

html {
  font-family: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
/* Arabic first in an Arabic page, so shared marks and digits sit with its text. */
html[lang='ar'] {
  font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.75;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  --page: 64rem;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.25rem;
  box-sizing: border-box;
}

main { flex: 1; padding-block: 2.25rem 3rem; }
main :where(p, li) { max-width: 42rem; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--fg); line-height: 1.25; }
h1 { font-size: 2rem; font-weight: 600; margin-block: 0 1rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-block: 2.25rem 0.75rem; }

/* ---- Header and footer ---- */

.site-header {
  position: relative;
  background: var(--header-bg);
  color: var(--header-fg);
  border-block-end: 3px solid var(--gold);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}
.brand {
  color: var(--header-fg);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--gold); }
html[lang='ar'] .brand { font-family: inherit; letter-spacing: normal; }

nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; align-items: center; }
nav form { margin: 0; }
@media (max-width: 26rem) {
  .wrap { padding-inline: 1rem; }
  nav { column-gap: 1rem; }
}
.site-header nav a,
.site-header nav button.link {
  color: var(--header-fg);
  text-decoration: none;
  font-weight: 500;
  padding-block: 0.25rem;
  border-block-end: 2px solid transparent;
}
.site-header nav a:hover,
.site-header nav button.link:hover { border-block-end-color: var(--gold); }
.site-header :focus-visible { outline-color: var(--gold); }

/* The current page and the menu that holds it. */
.site-header nav > a[aria-current='page'] { color: var(--gold); }

/* The menus: <details>, so they open without JavaScript. Each panel sits under its label,
   over the page. FigSight's, with one open at a time. */
.menu { position: relative; }
.menu summary {
  display: flex;
  align-items: center;
  gap: 0.45em;
  cursor: pointer;
  list-style: none;
  color: var(--header-fg);
  font-weight: 500;
  padding-block: 0.25rem;
  border-block-end: 2px solid transparent;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after {
  content: '';
  width: 0.4em;
  height: 0.4em;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
  transition: transform 0.15s;
}
.menu[open] summary::after { transform: translateY(0.1em) rotate(225deg); }
/* The corner's borders are logical, so they swap sides in Arabic; the turn swaps with them. */
[dir='rtl'] .menu summary::after { transform: translateY(-0.15em) rotate(-45deg); }
[dir='rtl'] .menu[open] summary::after { transform: translateY(0.1em) rotate(-225deg); }
.menu summary:hover,
.menu summary.current { border-block-end-color: var(--gold); }
.menu > ul {
  position: absolute;
  inset-inline-start: -0.75rem;
  inset-block-start: calc(100% + 0.6rem);
  z-index: 10;
  min-width: 12rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--header-bg);
  border: 1px solid var(--header-muted);
  border-block-start: 3px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);
}
.menu ul ul { margin: 0; padding: 0; list-style: none; }
.menu li { max-width: none; }
.menu > ul > li:has(> .menu-heading) + li { margin-block-start: 0.35rem; border-block-start: 1px solid rgb(255 255 255 / 0.12); padding-block-start: 0.35rem; }
.menu-heading {
  display: block;
  padding: 0.35rem 1rem 0.1rem;
  color: var(--header-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Spacing out letters breaks Arabic's joined script. */
html[lang='ar'] .menu-heading { letter-spacing: normal; font-size: 0.8rem; }
.site-header nav .menu a {
  display: block;
  padding: 0.5rem 1rem;
  border: 0;
}
.site-header nav .menu a:hover { background: rgb(255 255 255 / 0.08); color: var(--gold); }
.site-header nav .menu a[aria-current='page'] { color: var(--gold); font-weight: 600; }
/* On a phone a panel takes the header's width, so the last menu stays on the screen. */
@media (max-width: 36rem) {
  .menu { position: static; }
  .menu > ul { inset-inline: 1rem; inset-block-start: auto; margin-block-start: 0.4rem; }
}

.site-header button.theme-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem;
  background: transparent;
  color: var(--header-fg);
  border-radius: 6px;
}
.site-header button.theme-toggle[hidden] { display: none; }
.site-header button.theme-toggle:hover { background: rgb(255 255 255 / 0.1); color: var(--gold); }
.theme-toggle svg { inline-size: 1.15rem; block-size: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

.site-footer { border-block-start: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding-block: 1.25rem 1.75rem;
}

/* ---- Text ---- */

.lead { font-size: 1.15rem; color: var(--muted); max-width: 42rem; margin-block: 0 1rem; }
.note { color: var(--muted); font-size: 0.9rem; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; margin: 0; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; text-align: start; }
.plain { margin: 0 0 1rem; padding: 0; list-style: none; }
.plain li { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; padding-block: 0.25rem; }
.secret {
  max-width: none;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-sunk);
  overflow-wrap: anywhere;
  text-align: left;
}
.secret code { font-size: 0.9rem; }
/* A record's own text is wrapped in <bdi>, so a phone number or a Latin name keeps
   its own order inside a right-to-left page. */

/* ---- Forms and buttons ---- */

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack > :not(button, .button) { max-width: 24rem; }
.panel, .stack {
  margin-block: 1rem 1.5rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
form.inline { display: inline; margin: 0; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 400; padding-block: 0.15rem; }
fieldset { margin: 0; padding: 0.6rem 0.9rem 0.8rem; border: 1px solid var(--line); border-radius: 8px; }
legend { padding-inline: 0.35rem; font-weight: 600; }

input:not([type='checkbox'], [type='hidden']), select, textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); }
/* A left-to-right field in a right-to-left page keeps its text on the page's side. */
[dir='rtl'] input[dir='ltr'] { text-align: right; }

button, .button {
  font: inherit;
  font-weight: 600;
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  cursor: pointer;
  align-self: flex-start;
}
button:hover, .button:hover { background: var(--gold-hover); }
button.danger { background: var(--danger-fill); color: var(--danger-fill-fg); }
button.danger:hover { background: var(--danger-fill); filter: brightness(0.93); }
button.link {
  padding: 0;
  background: none;
  color: var(--link);
  font-weight: 400;
  text-decoration: underline;
}
.site-header nav button.link { text-decoration: none; }

.errors, .notice {
  margin: 0 0 1rem;
  padding-block: 0.75rem;
  border-radius: 8px;
  max-width: none;
}
.errors {
  padding-inline: 2rem 1rem;
  border-inline-start: 4px solid var(--danger);
  background: var(--error-bg);
  color: var(--danger);
}
.notice {
  padding-inline: 1rem;
  border-inline-start: 4px solid var(--link);
  background: var(--notice-bg);
}

/* A second action beside the main one, on the page (FigSight's). */
button.secondary, .button.secondary { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 2px var(--gold); }
button.secondary:hover, .button.secondary:hover { background: var(--surface); }

/* ---- Cards ---- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.card {
  display: block;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--fg);
  text-decoration: none;
}
.card:hover { border-color: var(--accent-line); }
.card h2 { margin: 0; font-size: 1rem; color: var(--muted); }
.card .figure { margin: 0.25rem 0 0; font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- The landing page: a band in the header's dark blue the full width of the
   window (painted past the page's edges by a shadow, clipped to the band, so
   nothing scrolls sideways), with a chart beside the words. Amaar's. ---- */

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin-block: -2.25rem 2rem;
  padding-block: 3rem;
  background: var(--header-bg);
  box-shadow: 0 0 0 100vmax var(--header-bg);
  clip-path: inset(0 -100vmax);
  color: var(--header-fg);
}
@media (min-width: 60rem) {
  .hero-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
}
.hero-band :focus-visible { outline-color: var(--gold); }
.hero-brand { margin: 0 0 0.5rem; color: var(--gold); font-weight: 600; }
.hero-band h1 { margin-block: 0 0.9rem; color: var(--header-fg); font-size: clamp(2.1rem, 5.5vw, 3.1rem); line-height: 1.15; }
.hero-band h1::after { content: ''; display: block; inline-size: 3.5rem; block-size: 4px; margin-block-start: 1rem; border-radius: 2px; background: var(--gold); }
.hero-band .lead { color: var(--header-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 1.5rem 1rem; }
.hero-band .button.secondary { color: var(--header-fg); box-shadow: inset 0 0 0 1px var(--header-muted); }
.hero-band .button.secondary:hover { background: rgb(255 255 255 / 0.08); }
.hero-points { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.hero-points li::before { content: '✓'; margin-inline-end: 0.4rem; color: var(--gold); font-weight: 700; }
.hero-preview { min-width: 0; color: var(--fg); }
.hero-preview .chart-card { margin: 0; box-shadow: 0 12px 32px rgb(0 0 0 / 0.28); }
.sample-tag { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 0.75rem; font-weight: 600; vertical-align: middle; }
.landing-section { margin-block: 2.5rem; scroll-margin-block-start: 1rem; }
.landing-section > h2 { margin-block: 0 0.5rem; font-size: 1.6rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin: 1rem 0; padding: 0; list-style: none; }
.features .card { max-width: none; }
.features .card:hover { border-color: var(--line); }
.features h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.features p { margin: 0; color: var(--muted); }
.kuwait-band { padding: 1.5rem 1.6rem; border: 1px solid var(--line); border-inline-start: 6px solid var(--accent-line); border-radius: 12px; background: var(--surface); }
.kuwait-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0.75rem 1.5rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.kuwait-points li { max-width: none; }
.kuwait-points strong { display: block; }
.button.secondary.on-page { color: var(--fg); }
.demo-banner { margin: 0; padding: 0.4rem 1rem; background: var(--gold); color: var(--navy); font-weight: 600; text-align: center; }

/* ---- Charts: drawn on the server as SVG. The legend gives every figure in words, so
   no colour stands alone. ---- */


/* ---- Tables ---- */

.table-wrap {
  overflow-x: auto;
  margin-block: 1rem 1.5rem;
  padding: 0.75rem 1.3rem 1.1rem;
  border: 1px solid var(--line);
  border-inline-start: 6px solid var(--accent-line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
h2:has(+ .table-wrap) {
  margin-block-end: 0;
  padding: 1.1rem 1.3rem 0.5rem;
  border: 1px solid var(--line);
  border-block-end: 0;
  border-inline-start: 6px solid var(--accent-line);
  border-start-start-radius: 12px;
  border-start-end-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  /* Each part's shadow stops at the join, so none falls across the frame. */
  clip-path: inset(-1rem -1rem 0 -1rem);
  font-size: 1.15rem;
}
h2 + .table-wrap {
  clip-path: inset(0 -1rem -1rem -1rem);
  margin-block-start: 0;
  border-block-start: 0;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
  padding-block-start: 0;
}
h2 + .table-wrap .daily { border-block-start: 1px solid var(--line); }
:is(.panel, .stack, .card) .table-wrap {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
/* On a phone the frame leaves a table too little room. */
@media (max-width: 30rem) {
  .table-wrap { padding-inline: 0.85rem; }
  h2:has(+ .table-wrap) { padding-inline: 0.85rem; }
}
.daily { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.daily th, .daily td {
  padding-block: 0.55rem;
  padding-inline: 0 0.75rem;
  text-align: start;
  white-space: nowrap;
}
.daily :is(th, td):first-child { padding-inline-start: 0.5rem; }
.daily :is(th, td):last-child { padding-inline-end: 0.5rem; }
.daily thead th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; border-block-end: 1px solid var(--line); }
/* Spacing out letters breaks Arabic's joined script. */
html[lang='ar'] .daily thead th { letter-spacing: normal; }
.daily tbody tr:last-child :is(th, td) { border-block-end: 1px solid var(--line); }
.daily tbody tr:nth-child(even) { background: var(--row-alt); }
.daily form { margin: 0; }
/* A total row (FigSight's): never tinted, set off by a firmer line above it. */
.daily tbody tr.sum { background: none; }
.daily tr.sum :is(th, td) { font-weight: 600; border-block-start: 2px solid var(--line); }

/* Read by a screen reader, not shown. */
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- The books ---- */

/* The chart's tree: each level set in from the page's start. */
.chart .depth-1 { padding-inline-start: 1.25rem; }
.chart .depth-2 { padding-inline-start: 2.5rem; }
.chart .depth-3 { padding-inline-start: 3.75rem; }
.chart tr.heading td { color: var(--muted); }
.chart tr.archived td { opacity: 0.6; }
/* The entry's lines: fields that fit their columns. */
.entry-lines select { max-inline-size: 18rem; }
.entry-lines input { inline-size: 100%; min-inline-size: 7rem; }
.entry-lines td { white-space: normal; vertical-align: top; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.overdue { color: var(--danger); }
textarea { font: inherit; padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }

/* ---- Charts: drawn on the server as SVG (src/charts/svg.ts); every figure
   also in words beside them, so no colour stands alone. ---- */

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; margin-block: 1.5rem; }
.chart-card { padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.chart-card h2 { margin-block: 0 0.75rem; font-size: 1rem; }
.chart-card details { margin-block-start: 0.5rem; }
.chart { display: block; inline-size: 100%; block-size: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-bar.tone-1, .swatch.tone-1, .donut-part.tone-1 { fill: var(--tone-1); stroke: var(--tone-1); }
.chart-bar.tone-2, .swatch.tone-2, .donut-part.tone-2 { fill: var(--tone-2); stroke: var(--tone-2); }
.chart-bar.tone-3, .swatch.tone-3, .donut-part.tone-3 { fill: var(--tone-3); stroke: var(--tone-3); }
.swatch.tone-4, .donut-part.tone-4 { fill: var(--muted); stroke: var(--muted); }
.swatch.tone-5, .donut-part.tone-5 { fill: var(--accent-line); stroke: var(--accent-line); }
.swatch.tone-6, .donut-part.tone-6 { fill: var(--line); stroke: var(--line); }
.chart-line { fill: none; stroke: var(--tone-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--surface); stroke: var(--tone-1); stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.chart-legend.vertical { flex-direction: column; }
.chart-legend li { max-width: none; display: flex; align-items: center; gap: 0.4rem; }
.swatch { display: inline-block; inline-size: 0.8rem; block-size: 0.8rem; border-radius: 3px; }
.swatch.tone-1 { background: var(--tone-1); }
.swatch.tone-2 { background: var(--tone-2); }
.swatch.tone-3 { background: var(--tone-3); }
.swatch.tone-4 { background: var(--muted); }
.swatch.tone-5 { background: var(--accent-line); }
.swatch.tone-6 { background: var(--line); }
.donut-body { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.donut { inline-size: 11rem; block-size: 11rem; flex: none; }
/* Rings, never discs: above the tones' fills, which the bars and swatches need. */
svg.donut .donut-part { fill: none; stroke-width: 26; }
.donut-total { fill: var(--fg); font-size: 22px; font-weight: 600; font-family: inherit; }
.card .figure { margin: 0.25rem 0 0; font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
fieldset label { margin-block-end: 0.5rem; }
.bank-lines td { white-space: normal; }

/* ---- Figures ---- */

/* An amount reads left to right inside Arabic text, in Western digits
   (1,234.500; the owner's choice): an inline .number, isolated, so its minus
   and separators keep their order without turning the block around it. */
.number { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
/* A column of amounts lines up at the units, so the decimal points do. Digits
   run left to right in both languages, so that is the right edge in both: the
   one physical side in this stylesheet, on purpose. */
.daily :is(td, th).amount { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- The style guide (/style-guide): the tokens as swatches. ---- */

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.swatch-chip { display: block; block-size: 3rem; border: 1px solid var(--line); border-radius: 8px; }
.swatches li { max-width: none; font-size: 0.85rem; }
.swatches code { color: var(--muted); }
.sw-bg { background: var(--bg); }
.sw-surface { background: var(--surface); }
.sw-surface-sunk { background: var(--surface-sunk); }
.sw-fg { background: var(--fg); }
.sw-muted { background: var(--muted); }
.sw-line { background: var(--line); }
.sw-link { background: var(--link); }
.sw-accent-line { background: var(--accent-line); }
.sw-danger { background: var(--danger); }
.sw-navy { background: var(--navy); }
.sw-gold { background: var(--gold); }
