/* U plan site shell styles (spec 8.6 and 8.9; A3 spec 3.3, 4.2-4.4).
   Site pages only, layout contract v2: article body after the intro, figure
   panels and charts, why it matters, the numbers, Also today, sources, the
   investment note, Up next, feed cards and card figures, end of feed,
   footer, the reward entry and panel (kept for when rewards reopen), info,
   language and not-found pages. Colours come only from the contract
   variables. iOS 14 floor: no logical shorthands, no inset, no flex gap
   (grid gaps are fine); the logical longhands used here work from iOS 12.2. */

/* Article body */
.a-body { margin-top: 24px; }
.a-body p { margin: 0 0 18px; }
.a-h { margin: 32px 0 12px; font-size: 21px; line-height: 1.35; font-weight: 700; }
.a-list { margin: 0 0 18px; padding-inline-start: 24px; }
.a-list li { margin: 0 0 8px; }
.a-chart { margin: 24px 0; }

/* Figure panels: one chart, one complete small answer */
.a-fig { margin: 24px 0 0; padding: 16px 16px 14px; border-radius: 16px; background: var(--u-panel); }
.a-body .a-fig { margin-bottom: 24px; }
.a-fig-k {
  margin: 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--u-muted);
}
:lang(ja) .a-fig-k, :lang(ko) .a-fig-k { text-transform: none; letter-spacing: 0; }
.a-fig-t { margin: 6px 0 14px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.a-fig-cap { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--u-muted); }
.a-hook {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--u-line);
  font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--u-muted);
}

/* Bars, columns and dots */
.a-bar { display: block; width: 100%; height: 14px; overflow: visible; }
.a-m { fill: var(--u-chart-rest); }
.a-k .a-m { fill: var(--u-chart-key); }
.a-z { fill: var(--u-grid); }
.a-p { font-weight: 600; }
.a-p small { font-size: inherit; font-weight: 400; color: var(--u-muted); }
.a-v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }

/* Old pages can still fetch this shell: keep their four-cell grid until
   a fresh page brings the shared-column marker and the two inner wrappers. */
.a-rk { margin: 0; padding: 0; list-style: none; }
.a-rk li {
  display: grid; grid-template-columns: 1.5em minmax(0, 8em) minmax(0, 1fr) 4.4em; column-gap: 8px;
  align-items: center; min-height: 40px; font-size: 15px; line-height: 18px;
}
.a-rk .a-n { color: var(--u-muted); font-variant-numeric: tabular-nums; text-align: end; }
.a-rk .a-p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.a-rk .a-bar { height: 16px; }

/* Ranked bars share their columns across every row: longer values must not
   shrink just one row's plot and make a smaller number look larger. Table
   layout works without script on iOS 14; the label still gets two lines in
   up to 8em, and the value column grows to fit its longest number and unit. */
.a-rk-shared { display: table; table-layout: auto; width: 100%; border-spacing: 0; }
.a-rk-shared li { display: table-row; }
.a-rk-shared li > span { display: table-cell; vertical-align: middle; height: 40px; }
.a-rk-shared .a-n { width: 1.5em; padding-inline-end: 8px; }
.a-rk-shared .a-rk-name { width: 8em; max-width: 8em; padding-inline-end: 8px; }
.a-rk-shared .a-rk-plot { padding-inline-end: 8px; }
.a-rk-shared .a-v { width: 4.4em; }
.a-rk-shared .a-bar { min-width: 4px; }

.a-sb { margin: 0; padding: 0; list-style: none; }
.a-sb li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; margin: 0 0 12px; }
.a-sb li:last-child { margin-bottom: 0; }
.a-sb .a-p { font-size: 14px; line-height: 20px; }
.a-sb .a-p small { display: block; font-size: 13px; line-height: 18px; }
.a-sb .a-v { font-size: 15px; line-height: 20px; }
.a-sb .a-bar { grid-column: 1 / -1; margin-top: 6px; }

.a-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; align-items: end; }
.a-col { display: block; width: 100%; max-width: 120px; height: 150px; margin: 0 auto; overflow: visible; }
.a-cv {
  display: block; margin-top: 8px; text-align: center; font-size: 15px; line-height: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.a-yl { display: block; text-align: center; font-size: 13px; line-height: 18px; color: var(--u-muted); }
.a-cols .a-k .a-yl { color: var(--u-fg); font-weight: 700; }

.a-db { margin: 0 0 18px; }
.a-db:last-child { margin-bottom: 0; }
.a-db-n { margin: 0 0 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
.a-db-g { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 10px; align-items: end; }
.a-db-v {
  display: block; font: 800 30px/1 var(--u-sans); letter-spacing: -.03em; color: var(--u-muted);
  font-variant-numeric: lining-nums proportional-nums; direction: ltr; unicode-bidi: isolate;
}
.a-db .a-k .a-db-v { color: var(--u-fg); }
.a-db-d { display: block; margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--u-muted); }
.a-db-ar { display: inline-block; font-size: 22px; line-height: 30px; color: var(--u-muted); }
.a-db-s { display: block; width: 100%; height: 26px; margin-top: 14px; overflow: visible; }
.a-seg { fill: var(--u-chart-key); }
.a-dot { fill: var(--u-chart-rest); stroke: var(--u-panel); stroke-width: 2; }
.a-dot.a-k { fill: var(--u-chart-key); }

.a-tl { margin: 0; padding: 0; list-style: none; }
.a-tl li {
  position: relative; margin: 0 0 0 6px; padding: 0 0 14px 20px; border-left: 2px solid var(--u-chart-rest);
}
.a-tl li:last-child { padding-bottom: 0; border-left-color: transparent; }
.a-tl li::before {
  content: ""; position: absolute; top: 4px; left: -8px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--u-chart-rest);
}
.a-tl .a-k::before { background: var(--u-chart-key); }
.a-tl-d { display: block; font-size: 14px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.a-tl-l { display: block; font-size: 15px; line-height: 1.4; }

.a-cal { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 16px; align-items: start; }
.a-calb, .fc-cal { display: block; padding: 10px 0 12px; border-radius: 14px; text-align: center; }
.a-calb { background: var(--u-bg); }
.fc-cal { background: var(--u-panel); }
.a-calb-m, .fc-cal-m {
  display: block; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--u-muted);
}
.a-calb-d, .fc-cal-d { display: block; margin-top: 2px; font: 800 36px/1 var(--u-sans); letter-spacing: -.03em; }
.a-cal-e { margin: 4px 0 0; font-size: 17px; line-height: 1.35; font-weight: 700; }
.a-cal-n { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--u-muted); }

.a-vn-n {
  margin: 0; font: 800 56px/.95 var(--u-sans); letter-spacing: -.04em; white-space: nowrap;
  font-variant-numeric: lining-nums proportional-nums; direction: ltr; unicode-bidi: isolate;
}
.a-vn-u { font-size: .5em; letter-spacing: -.01em; }
.a-vn-l { margin: 8px 0 0; font-size: 14px; line-height: 1.3; font-weight: 600; }

.a-txt { margin: 0; font: 600 21px/1.35 var(--u-serif); }
:lang(ja) .a-txt, :lang(ko) .a-txt { font-family: var(--u-sans); }
.a-txt-a { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--u-muted); }

/* Bars grow once when they come into view (the shell adds the classes;
   reduced motion and pages without scripts keep them still) */
.a-anim .a-bar { transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.22, 1, .36, 1); }
.a-anim .a-col { transform: scaleY(0); transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.22, 1, .36, 1); }
.a-anim.a-in .a-bar, .a-anim.a-in .a-col { transform: none; }

/* Why it matters, the numbers, Also today */
.a-why { margin: 32px 0 0; padding: 2px 0 2px 16px; border-left: 4px solid var(--u-fg); }
.a-why p:last-child { margin: 6px 0 0; font-size: 18px; line-height: 1.5; font-weight: 600; }

.a-nums { margin: 28px 0 0; padding-top: 12px; border-top: 2px solid var(--u-fg); }
.a-nums-l { margin: 4px 0 0; padding: 0; list-style: none; }
.a-nums-l li {
  display: grid; grid-template-columns: minmax(0, 6.6em) minmax(0, 1fr); column-gap: 14px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--u-line);
}
.a-nums-v {
  font: 800 28px/1.05 var(--u-sans); letter-spacing: -.03em; white-space: nowrap;
  font-variant-numeric: lining-nums proportional-nums; direction: ltr; unicode-bidi: isolate;
}
.a-nums-u { font-size: .6em; letter-spacing: 0; }
.a-nums-t { font-size: 15px; line-height: 1.4; }

.a-also { margin: 24px 0 0; }
.a-also-l { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.a-also-l.a-also-one { grid-template-columns: minmax(0, 1fr); }
.a-also-a {
  display: block; height: 100%; min-height: 44px; padding: 12px 14px; border-radius: 14px;
  background: var(--u-panel); color: var(--u-fg); text-decoration: none;
}
.a-also-a:visited { color: var(--u-fg); }
.a-also-a:active { background: var(--u-line); }
.a-also-a b {
  display: block; font: 800 24px/1.05 var(--u-sans); letter-spacing: -.03em;
  font-variant-numeric: lining-nums proportional-nums; direction: ltr; unicode-bidi: isolate;
}
.a-also-u { font-size: .6em; letter-spacing: 0; }
.a-also-t { display: block; margin-top: 6px; font-size: 14px; line-height: 1.35; font-weight: 600; }

/* Sources and the investment note */
.a-src { margin: 32px 0 0; padding-top: 12px; border-top: 1px solid var(--u-line); font-size: 14px; line-height: 1.5; color: var(--u-muted); }
.a-src-h { margin: 0 0 8px; font-size: 14px; line-height: 1.5; font-weight: 700; color: var(--u-fg); }
.a-src ol { margin: 0; padding: 0; padding-inline-start: 20px; }
.a-src li { margin: 0; }
.a-src li a { display: block; min-height: 44px; padding: 11px 0; line-height: 1.4; color: var(--u-muted); word-break: break-word; }
.a-src b { font-weight: 600; color: var(--u-accent); }
.a-note { margin: 16px 0 0; font-size: 13px; line-height: 1.45; color: var(--u-muted); }
.a-note b { color: var(--u-fg); }

/* Up next and feed cards: every card gives a number or a figure first, then
   the title, one summary line and the update time */
.a-next { margin: 44px 0 0; padding-top: 12px; border-top: 2px solid var(--u-fg); }
.a-next .fc { padding: 16px 0 24px; }
.feed { margin: 0; padding: 0; list-style: none; }
.fc { margin: 0; padding: 24px 0; border-bottom: 1px solid var(--u-line); }
.fc-link { display: block; color: var(--u-fg); text-decoration: none; }
.fc-link:visited { color: var(--u-fg); }
.fc-link:active .fc-t { color: var(--u-muted); }
/* Pressed look on iPhone (the shell's touchstart listener turns :active on):
   the card panel takes the line colour, plain links dim. */
.fc-link:active .fc-viz { background: var(--u-line); }
.a-body a:active, .a-src li a:active, .end a:active, .foot a:active { opacity: .6; }
.fc-viz { margin: 0 0 14px; padding: 16px; border-radius: 16px; background: var(--u-panel); overflow: hidden; }
.fc-viz .a-fig-k { margin-bottom: 12px; }
.fc-cap { margin: 12px 0 0; font-size: 12px; line-height: 1.4; color: var(--u-muted); }
.fc-k { margin: 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
:lang(ja) .fc-k, :lang(ko) .fc-k { text-transform: none; letter-spacing: 0; }
.fc-t { margin: 8px 0 0; font: 600 21px/1.22 var(--u-serif); letter-spacing: -.005em; }
:lang(ja) .fc-t, :lang(ko) .fc-t { font-family: var(--u-sans); font-weight: 700; letter-spacing: 0; }
.fc-d {
  margin: 6px 0 0; overflow: hidden; font-size: 15px; line-height: 1.45; color: var(--u-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.fc-m { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--u-muted); }
.fc-u { color: var(--u-accent); font-weight: 600; }
.fc-lead { padding-top: 16px; }
.fc-lead .fc-viz { padding: 20px 20px 18px; }
.fc-lead .a-vn-n { font-size: 64px; }
.fc-lead .fc-t { font-size: 26px; line-height: 1.12; }
.fc-lead .fc-d { font-size: 16px; color: var(--u-fg); -webkit-line-clamp: 3; }
.fc-cal-card .fc-link { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 16px; align-items: start; }
.fc-cal-card .fc-t { margin-top: 4px; }
.fc-c .fc-link { display: grid; grid-template-columns: minmax(0, 1fr) 108px; column-gap: 16px; align-items: start; }
.fc-c .fc-t { margin: 4px 0 0; font-size: 18px; line-height: 1.25; }
.fc-th {
  display: flex; flex-direction: column; justify-content: center; height: 84px; padding: 0 8px;
  border-radius: 12px; background: var(--u-panel); text-align: center;
}
.fc-th b {
  display: block; font: 800 24px/1 var(--u-sans); letter-spacing: -.03em; white-space: nowrap;
  font-variant-numeric: lining-nums proportional-nums; direction: ltr; unicode-bidi: isolate;
}
.fc-th-u { font-size: .6em; letter-spacing: 0; }
.fc-th > span { display: block; margin-top: 5px; font-size: 11px; line-height: 1.25; color: var(--u-muted); }
@media (hover: hover) {
  .fc-link:hover .fc-t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
}

/* End of feed and footer: the page bottom keeps 88 px clear of the X post
   bar; the safe area is kept once, by the body */
.end { margin: 28px 0; font-size: 14px; line-height: 1.5; text-align: center; color: var(--u-muted); }
.end a { color: var(--u-muted); }
.foot {
  max-width: calc(var(--u-w) + 2 * var(--u-pad)); margin: 40px auto 0;
  padding: 12px var(--u-pr) calc(16px + var(--u-xbar)) var(--u-pl);
  font-size: 14px; line-height: 1.5; color: var(--u-muted);
}
.foot p { margin: 0; padding-top: 12px; border-top: 1px solid var(--u-line); }
.foot a { display: inline-block; min-height: 44px; line-height: 44px; color: var(--u-muted); }
[data-page="home"] .foot { max-width: calc(var(--u-wide) + 2 * var(--u-pad)); }

/* Reward entry and panel (only while rewards are open) */
.rw { min-height: var(--u-rs-h); }
.rw [hidden] { display: none !important; }
.rw-toggle {
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box; width: 100%; min-height: var(--u-rs-h); margin: 0; padding: 0;
  border: 0; border-top: 1px solid var(--u-line); border-bottom: 1px solid var(--u-line);
  background: transparent; color: var(--u-fg); font: inherit; font-size: 17px; line-height: 1.35; font-weight: 600;
  text-align: start; cursor: pointer;
}
.rw-entry { min-width: 0; margin-inline-end: 12px; }
.rw-chev {
  flex: none; width: 8px; height: 8px; margin-block-start: -4px;
  border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg);
}
.rw-toggle[aria-expanded="true"] .rw-chev { margin-block-start: 4px; transform: rotate(225deg); }
.rw-panel { padding: 16px 0 24px; border-block-end: 1px solid var(--u-line); font-size: 17px; line-height: 1.6; }
.rw-rules { margin: 0 0 16px; }
.rw-label { display: block; margin: 0 0 8px; font-weight: 600; }
.rw-input {
  display: block; box-sizing: border-box; width: 100%; min-height: 48px; margin: 0; padding: 0 12px;
  border: 1px solid var(--u-muted); border-radius: 8px; background: var(--u-bg); color: var(--u-fg);
  font: inherit; font-size: 16px; line-height: 1.4; word-break: break-all;
}
.rw-hint { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; color: var(--u-muted); }
.rw-btn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 44px; min-height: 48px; margin: 0 8px 8px 0; padding: 0 20px;
  border: 1px solid var(--u-fg); border-radius: 8px; background: transparent; color: var(--u-fg);
  font: inherit; font-size: 16px; line-height: 1.2; font-weight: 600; text-decoration: none; cursor: pointer;
}
.rw-btn:visited { color: var(--u-fg); }
.rw-primary { background: var(--u-fg); color: var(--u-bg); }
.rw-secondary { background: transparent; color: var(--u-fg); }
.rw-progress {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px;
  margin: 16px 0; font-size: 14px; line-height: 1.5;
}
.rw-progress dt { color: var(--u-muted); }
.rw-progress dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-all; }
.rw-share { margin: 16px 0 0; }
.rw-out { margin: 8px 0 0; }
.rw-out .rw-input { margin-block-start: 8px; }
.rw-disclosure { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-muted); }
.rw-status { min-height: 21px; margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-fg); }

/* Info, language and not-found pages */
.info { font-size: 17px; line-height: 1.6; }
.info h1 { margin: 24px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 700; }
.info h2 { margin: 32px 0 12px; font-size: 21px; line-height: 1.35; font-weight: 700; }
.info p, .info ul, .info ol { margin: 0 0 16px; }
.info ul, .info ol { padding-inline-start: 24px; }
.langs { font-size: 17px; line-height: 1.6; }
.langs h1 { margin: 24px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 700; }
.langs ul { margin: 0; padding: 0; list-style: none; }
.langs li { border-block-end: 1px solid var(--u-line); }
.langs a { display: block; min-height: 44px; padding: 12px 0; font-size: 18px; line-height: 1.35; }
/* No padding on .nf: it is #u-main, whose side padding comes from the contract
   (an id rule a class rule cannot override); the title keeps its own space. */
.nf { font-size: 17px; line-height: 1.6; }
.nf h1 { margin: 24px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 700; }

/* Widths (A3 spec 3.1 F6): iPad portrait and split view from 700, landscape
   from 1024; by width only, never by browser name */
@media (min-width: 700px) {
  .a-fig { margin-left: -40px; margin-right: -40px; padding: 20px 24px 18px; }
  .gs .a-fig, .a-body .gs .a-fig { margin-left: 0; margin-right: 0; }
  .a-nums-l { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
  .a-nums-l li { display: block; padding: 8px 0 0; border-bottom: 0; }
  .a-nums-v { font-size: 34px; }
  .a-nums-t { display: block; margin-top: 6px; }
  .fc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .fc-lead .fc-link { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 32px; align-items: center; }
  .fc-lead .fc-viz { margin: 0; }
  .fc-lead .a-vn-n { font-size: 96px; }
  .fc-lead .fc-t { font-size: 34px; }
  .fc-c .fc-link { grid-template-columns: minmax(0, 1fr) 132px; }
  .fc-th { height: 96px; }
}
/* 700-759: the column is not yet at its widest, so the panels reach out
   less and never leave the screen */
@media (min-width: 700px) and (max-width: 759px) {
  .a-fig { margin-left: -24px; margin-right: -24px; }
}
@media (min-width: 1024px) {
  .a-fig { margin-left: -80px; margin-right: -80px; padding: 24px 32px 20px; }
  .fc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fc-lead .fc-link { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .fc-lead .a-vn-n { font-size: 112px; }
  .fc-lead .fc-t { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .a-anim .a-bar, .a-anim .a-col { transform: none !important; transition: none !important; }
}
