/* Amaar: dark blue, gold and silver, in light and dark themes that follow the
   device setting. FigSight's colours and system (tokens per theme, panels, framed
   and striped tables). Self-hosted fonts only, both OFL:
   IBM Plex Sans and IBM Plex Sans Arabic. 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+FB50-FDFF, U+FE70-FEFF;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-400-normal.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+FB50-FDFF, U+FE70-FEFF;
  src: url('/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
}

/* Brand colours, the same in both themes. */
: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); }

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);
}

/* ---- 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; on a narrow screen, under them. ---- */

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin-block: -2.25rem 2.5rem;
  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; letter-spacing: 0.04em; }
[dir='rtl'] .hero-brand { text-align: end; }
.hero-band h1 { margin-block: 0 0.9rem; color: var(--header-fg); font-size: clamp(2.1rem, 5.5vw, 3.1rem); line-height: 1.12; }
.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; }
.button.secondary { background: transparent; color: var(--header-fg); box-shadow: inset 0 0 0 1px var(--header-muted); }
.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 { position: relative; min-width: 0; color: var(--fg); }
.hero-preview .sample-tag { position: absolute; inset-block-start: 1rem; inset-inline-end: 1rem; }
.hero-preview .chart-card { margin: 0; box-shadow: 0 12px 32px rgb(0 0 0 / 0.28); }
.hero-preview .chart-card h2 { padding-inline-end: 5rem; }
/* Beside the words the card is narrow, so the bars keep their room from the labels. */
@media (min-width: 60rem) {
  .hero-preview .bridge-step { grid-template-columns: minmax(0, 9.5rem) 1fr max-content; gap: 0.15rem 0.75rem; font-size: 0.9rem; }
}
.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-end: 2.5rem; scroll-margin-block-start: 1rem; }
.landing-section > h2 { margin-block: 0 0.5rem; font-size: 1.6rem; }
.landing-months { margin-block-start: 1rem; }
.landing-months .chart-card { margin: 0; }
.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); }

/* ---- 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; }

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

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; }
.donut-card { margin: 0; }
.donut-card h2 { margin-block: 0 0.75rem; font-size: 1.05rem; }
.donut-body { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.donut { inline-size: 9rem; block-size: 9rem; flex: none; }
.donut-part { fill: none; stroke-width: 5.5; }
.donut-part.tone-1 { stroke: var(--tone-1); }
.donut-part.tone-2 { stroke: var(--tone-2); }
.donut-part.tone-3 { stroke: var(--tone-3); }
.donut-figure { fill: var(--fg); font-size: 4.7px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.donut-legend { flex: 1 1 13rem; display: grid; grid-template-columns: 1fr max-content; gap: 0.3rem 0; margin: 0; font-size: 0.95rem; }
.donut-legend dt { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.donut-legend dd { margin: 0; padding-inline-start: 1rem; font-variant-numeric: tabular-nums; text-align: end; }
.donut-legend .donut-whole { color: var(--fg); font-weight: 600; }
.donut-legend .donut-aside { margin-block-start: 0.3rem; padding-block-start: 0.5rem; border-block-start: 1px solid var(--line); }
.chart-card { margin-block: 1rem; }
.chart-card h2 { margin-block: 0 0.5rem; font-size: 1.05rem; }
.chart-card .note { margin-block: 0 0.5rem; max-width: none; }
/* Coordinates are absolute: the page's direction must not flip how text anchors. */
.month-chart, .donut { direction: ltr; }
.month-chart { display: block; inline-size: 100%; block-size: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-base { stroke: var(--muted); }
.chart-axis { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Drawn 640 wide and scaled to fit, so its labels need to grow on a narrow screen. */
@media (max-width: 48rem) { .chart-axis { font-size: 15px; } }
@media (max-width: 30rem) { .chart-axis { font-size: 19px; } }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: var(--row-alt); }
.chart-fill.tone-1, .chart-fill.total { fill: var(--tone-1); }
.chart-fill.tone-2, .chart-fill.down { fill: var(--tone-2); }
.chart-fill.tone-3, .chart-fill.up { fill: var(--tone-3); }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.tone-1 { stroke: var(--tone-1); }
.chart-line.tone-2 { stroke: var(--tone-2); }
.chart-dot { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.chart-dot.tone-1 { fill: var(--tone-1); }
.chart-dot.tone-2 { fill: var(--tone-2); }
.chart-fill { pointer-events: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 0.45rem; max-width: none; }
.chart-legend-total { color: var(--fg); font-variant-numeric: tabular-nums; }
.bridge { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.bridge-step { display: grid; grid-template-columns: minmax(0, 15rem) 1fr 7.5rem; gap: 0.15rem 1rem; align-items: center; max-width: none; font-size: 0.95rem; }
.bridge-label { color: var(--muted); }
.bridge-amount { text-align: end; font-variant-numeric: tabular-nums; }
.bridge-total .bridge-label, .bridge-total .bridge-amount { color: var(--fg); font-weight: 600; }
.bridge-unknown { text-align: end; color: var(--muted); }
.chart-card .bridge-note { margin-block: 0.75rem 0; }
.bridge-bar { display: block; inline-size: 100%; block-size: 1.1rem; }
/* On a phone the bar takes its own line, under its label and figure. */
@media (max-width: 36rem) {
  .bridge-step { grid-template-columns: 1fr max-content; }
  .bridge-bar { grid-row: 2; grid-column: 1 / -1; }
}
.swatch { flex: none; inline-size: 0.7rem; block-size: 0.7rem; border-radius: 2px; }
.swatch.tone-1 { background: var(--tone-1); }
.swatch.tone-2 { background: var(--tone-2); }
.swatch.tone-3 { background: var(--tone-3); }

/* ---- Tables: FigSight's frame, a panel with a gold edge on the leading side. A
   heading directly above a table joins the frame, over a thin line; a table with no
   heading of its own is framed alone. A table inside a panel or form is not framed
   twice. Body rows alternate, plain then tinted, so a row is easy to follow across. ---- */

.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; }
