/* Ink + highlighter: black/white like the logo, amber marks what matters, red only means it costs you. */
:root {
  --bg: #f4f5f4;
  --card: #ffffff;
  --text: #111312;
  --muted: #5a605c;
  --line: #e1e4e2;
  --ink: #111312;
  --hi: #ffc21a;
  --hi-soft: #fff3cc;
  --warn: #b3261e;
  --warn-bg: #fdf0ee;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a605c' stroke-width='2'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e100f;
    --card: #181b19;
    --text: #f1f3f2;
    --muted: #a2a9a5;
    --line: #2a2e2c;
    --ink: #000000;
    --hi-soft: #2a2208;
    --warn: #ff7b6b;
    --warn-bg: #2a1716;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a2a9a5' stroke-width='2'/%3E%3C/svg%3E");
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body:has(.ad-sticky) { padding-bottom: 72px; }
a { color: var(--text); text-decoration-color: var(--hi); text-decoration-thickness: 2px; text-underline-offset: 3px; }
main { max-width: 640px; margin: 0 auto; padding: 8px 16px 48px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Header and footer: black bars, like the favicon tile */
.top { background: var(--ink); border-bottom: 3px solid var(--hi); }
.top-in { max-width: 640px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; }
.brand img { height: 28px; width: auto; display: block; }
.top nav { display: flex; gap: 18px; font-size: 15px; font-weight: 600; }
.top nav a { color: #fff; text-decoration: none; padding: 10px 0; }
.top nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--hi); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.foot { background: var(--ink); color: #a2a9a5; font-size: 14px; margin-top: 24px; }
.foot-in { max-width: 640px; margin: 0 auto; padding: 28px 16px 40px; }
.foot img { height: 22px; width: auto; display: block; margin-bottom: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; }
.foot nav a { color: #f1f3f2; padding: 6px 0; }
.foot p { margin: 0 0 8px; }

/* Type and rhythm */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; margin: 24px 0 12px; }
main > h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; margin: 40px 0 10px; }
p { margin: 0 0 16px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.lede { font-size: 19px; line-height: 1.5; margin: 0 0 20px; }
.byline { color: var(--muted); font-size: 14px; margin: -4px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
ul { margin: 0 0 20px; padding-left: 20px; }
li { margin: 0; }
li + li { margin-top: 8px; }
li::marker { color: var(--muted); }
strong { font-weight: 650; }
.tip { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; margin: 24px 0; font-size: 16px; }
.insider { background: var(--hi-soft); border-left: 4px solid var(--text); padding: 14px 16px; margin: 24px 0; font-size: 16px; }
.insider strong:first-child { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.disclaimer { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* Cards */
section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
section > :last-child { margin-bottom: 0; }

/* Guide lists with the four-square quadrant icon */
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 22px 1fr; gap: 0 10px; }
.guide-list li:last-child { border-bottom: none; }
.guide-list svg { margin-top: 4px; }
.guide-list a { font-weight: 650; font-size: 17px; line-height: 1.3; text-decoration: none; }
.guide-list span { grid-column: 2; color: var(--muted); font-size: 15px; line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q { color: var(--text); flex: none; }
.q .on { fill: var(--hi); }
.next { margin-top: 32px; }

/* Home hero: the four-square itself */
.fsq { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--text); background: var(--card); margin: 4px 0 20px; }
.fsq div { padding: 12px 14px; border: 1px solid var(--line); }
.fsq small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.fsq b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fsq .pay b { background: var(--hi); color: #111312; padding: 0 4px; }
.features { list-style: none; padding: 0; }
.features li + li { margin-top: 14px; }
.features strong { display: block; }
.alt-link { text-align: center; font-size: 15px; margin-top: 12px; }

/* Ads: space is reserved so content never jumps. */
.ad { min-height: 280px; margin: 32px 0; }
.ad small { display: block; text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ad-sticky { position: fixed; left: 0; right: 0; bottom: 0; min-height: 60px; background: var(--card); border-top: 1px solid var(--line); z-index: 10; }
.ad-sticky button { position: absolute; top: -32px; right: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; background: var(--card); color: var(--muted); font-size: 13px; }

/* Buttons: amber fill with the logo's 45 degree cut */
.actions { display: flex; gap: 10px; margin-top: 4px; align-items: center; }
.btn {
  flex: 1;
  display: block;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 16px;
  border: none;
  background: var(--hi);
  color: #111312;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.btn.alt { background: transparent; color: var(--text); border: 2px solid var(--text); clip-path: none; padding: 10px 16px; }
.btn:disabled { opacity: 0.5; }
.text-btn { background: none; border: none; font: inherit; font-size: 15px; color: var(--muted); text-decoration: underline; padding: 12px; min-height: 44px; }

/* Worksheet */
.deal { padding-top: 14px; scroll-margin-top: 12px; }
.deal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.deal-head h3 { margin: 0; font-size: 19px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-name { font-weight: 500; color: var(--muted); }
.remove { background: none; border: none; color: var(--muted); font: inherit; font-size: 15px; min-height: 44px; padding: 0 0 0 12px; flex: none; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.badges:not(:has(.badge:not([hidden]))) { display: none; }
.badge { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 2px; }
.badge.cost { background: var(--hi); color: #111312; }
.badge.top { background: var(--text); color: var(--card); }
.badge.trade { border: 1.5px solid var(--text); padding: 1.5px 8.5px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid > div { display: flex; flex-direction: column; justify-content: flex-end; }
.grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
select { -webkit-appearance: none; appearance: none; background: var(--bg) var(--chev) no-repeat right 10px center; padding-right: 28px; }
input:focus, select:focus { outline: 2px solid var(--text); outline-offset: -1px; }
input:disabled, select:disabled { opacity: 1; -webkit-text-fill-color: var(--text); }
.u { position: relative; }
.u::before, .u::after { position: absolute; bottom: 0; height: 44px; line-height: 44px; color: var(--muted); font-size: 15px; pointer-events: none; }
.u[data-pre]::before { content: attr(data-pre); left: 10px; }
.u[data-pre] input { padding-left: 24px; }
.u[data-suf]::after { content: attr(data-suf); right: 10px; }
.u[data-suf] input { padding-right: 44px; }
.results { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 15px; }
.row span:first-child { color: var(--muted); }
.row span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.row.key { flex-direction: column; gap: 2px; background: var(--bg); border-radius: 4px; padding: 10px 12px; }
.row.key span:first-child { font-size: 13px; }
.row.key span:last-child { font-size: 26px; font-weight: 800; text-align: left; line-height: 1.2; }
.warn { color: var(--text); background: var(--warn-bg); border-left: 3px solid var(--warn); padding: 8px 12px; font-size: 14px; margin: 8px 0; }
.ok { color: var(--muted); border: 1px dashed var(--line); padding: 8px 12px; font-size: 14px; margin: 8px 0; }
.best { outline: 3px solid var(--hi); outline-offset: -1px; }
.score-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: none; }
.pnum { width: 28px; height: 28px; background: var(--hi); color: #111312; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.pname { flex: 1; font-weight: 650; }
.pw { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pbtn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); font-size: 14px; }
.pbtn:disabled { opacity: 0.3; }
.seg { display: flex; border: 2px solid var(--text); margin-bottom: 14px; }
.seg button { flex: 1; font: inherit; font-size: 15px; font-weight: 700; min-height: 44px; border: none; background: transparent; color: var(--text); }
.seg button.on { background: var(--text); color: var(--card); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; margin: 1px 0 0; accent-color: var(--text); }
details summary { cursor: pointer; font-weight: 650; padding: 10px 0; min-height: 44px; }
details[open] summary { margin-bottom: 6px; }
.sum-row, .sum-head { display: grid; grid-template-columns: 26px minmax(0, 1fr) 84px 50px; gap: 12px; align-items: center; }
.sum-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sum-row { min-height: 52px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: none; }
.chip { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--text); color: var(--card); font-weight: 800; font-size: 14px; }
.sum-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sum-num, .sum-head span:nth-child(n+3) { text-align: right; }
.sum-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-num.win span { background: var(--hi); color: #111312; padding: 0 4px; }
.share-box { margin-top: 14px; }
.share-box .check { margin-top: 12px; }
.share-msg { font-size: 15px; margin-top: 10px; word-break: break-all; }
.share-msg:not(:empty) { background: var(--bg); border: 1px solid var(--line); padding: 10px 12px; }
.shared-banner { border: 2px solid var(--text); }
.readonly .ro-hide { display: none !important; }
.readonly input, .readonly select { background: transparent; border-color: transparent; padding-left: 0; background-image: none; }
.readonly .u[data-pre] input { padding-left: 14px; }
.readonly .u::before { left: 0; }

/* Search and glossary */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { margin: 0 0 20px; }
.search input { -webkit-appearance: none; appearance: none; background: var(--card); border: 2px solid var(--text); min-height: 48px; padding: 10px 12px 10px 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235a605c' stroke-width='2'%3E%3Ccircle cx='7.5' cy='7.5' r='6'/%3E%3Cpath d='M12 12l5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li + li { margin-top: 10px; }
.plain-list a { font-weight: 650; }
.hits { list-style: none; padding: 0; margin: 0; }
.hits li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.hits a { font-weight: 650; font-size: 17px; }
.hits small { margin-left: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.hits p { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.az { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 0 0 24px; }
.az a, .az span { display: flex; align-items: center; justify-content: center; height: 40px; font-weight: 800; font-size: 16px; }
.az a { background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.az a:active { background: var(--hi); color: #111312; }
.az span { color: var(--line); }
.gl { scroll-margin-top: 12px; }
.gl h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: 0; text-transform: none; border-bottom: 3px solid var(--hi); padding-bottom: 4px; }
.gl h2 a { font-size: 13px; font-weight: 600; color: var(--muted); }
.gl dl { margin: 0; }
.term { padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.term:last-child { border-bottom: none; }
.term:target { background: var(--hi-soft); margin: 0 -18px; padding: 12px 18px; }
.term dt { font-weight: 750; font-size: 17px; }
.term dd { margin: 4px 0 0; font-size: 16px; }
.term dd a { font-size: 15px; }
@media (max-width: 360px) {
  .brand img { height: 22px; }
  .top nav { gap: 12px; font-size: 14px; }
}
