/* The Death Calculator (theme "remaining-years") — "First light" design system, v1.3.
   Cool morning paper, night-ink text, pine for action, marigold for time lived.
   Literata (headings, figures) + Atkinson Hyperlegible (interface, body). */

/* ---------- Tokens ---------- */
:root {
	color-scheme: light;
	--ry-bg: #F2F5F7;          /* Morning */
	--ry-surface: #FFFFFF;     /* Paper */
	--ry-surface-2: #E8EEF2;
	--ry-text: #14213D;        /* Night ink */
	--ry-muted: #56627A;       /* Slate */
	--ry-accent: #1D6B5F;      /* Pine */
	--ry-accent-hover: #155248;
	--ry-accent-soft: #E1EFEC;
	--ry-on-accent: #FFFFFF;
	--ry-marigold: #F0A202;    /* Lived time (fill only, never text) */
	--ry-marigold-soft: #FDF1D6;
	--ry-danger: #9B2C3F;
	--ry-danger-soft: #F9ECEF;
	--ry-border: #DCE3EA;
	--ry-border-strong: #C3CEDA;
	--ry-grid-lived: #F0A202;
	--ry-grid-now: #1D6B5F;
	--ry-grid-ahead: #DCE3EA;
	--ry-shadow: 0 1px 1px rgb(20 33 61 / 4%), 0 12px 32px -12px rgb(20 33 61 / 18%);
	--ry-display: "Literata", Georgia, "Times New Roman", serif;
	--ry-font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--ry-r-sm: 8px;   /* inputs, chips inside cards */
	--ry-r: 14px;     /* panels */
	--ry-r-lg: 22px;  /* the calculator */
	--ry-s1: 4px; --ry-s2: 8px; --ry-s3: 12px; --ry-s4: 16px; --ry-s5: 24px; --ry-s6: 32px; --ry-s7: 48px; --ry-s8: 72px; --ry-s9: 104px;
	--ry-wide: 1280px;
	--ry-gutter: 20px;
	--ry-measure: 68ch;
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--ry-bg: #0F1A2E;
	--ry-surface: #16233B;
	--ry-surface-2: #1D2C47;
	--ry-text: #EEF2F6;
	--ry-muted: #A9B4C6;
	--ry-accent: #6CC2B1;
	--ry-accent-hover: #8FD3C5;
	--ry-accent-soft: #1B3A3C;
	--ry-on-accent: #0F1A2E;
	--ry-marigold-soft: #3A3020;
	--ry-danger: #F0A3B1;
	--ry-danger-soft: #3A2030;
	--ry-border: #26375A;
	--ry-border-strong: #33476E;
	--ry-grid-now: #6CC2B1;
	--ry-grid-ahead: #26375A;
	--ry-shadow: 0 12px 32px -12px rgb(0 0 0 / 55%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; overflow-x: clip; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--ry-bg);
	color: var(--ry-text);
	font: 400 1.0625rem/1.6 var(--ry-font);
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}
img, svg, canvas, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--ry-display); font-weight: 650; line-height: 1.12; margin: 0 0 var(--ry-s4); color: var(--ry-text); font-optical-sizing: auto; }
h1 { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 4.25rem); letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.125rem); letter-spacing: -0.015em; margin-top: var(--ry-s7); text-wrap: balance; }
h3 { font-size: 1.25rem; margin-top: var(--ry-s5); }
p, ul, ol, table, details { margin: 0 0 var(--ry-s4); }
a { color: var(--ry-accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ry-accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ry-marigold); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { table:not(.data-table) { display: table; } }
th, td { text-align: left; padding: var(--ry-s2) var(--ry-s3); border-bottom: 1px solid var(--ry-border); vertical-align: top; }
th { font-weight: 700; }
code { font-size: 0.875em; background: var(--ry-surface-2); padding: 1px 6px; border-radius: 6px; }
.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--ry-s4); top: -100px; background: var(--ry-text); color: #fff; padding: var(--ry-s2) var(--ry-s4); border-radius: var(--ry-r-sm); z-index: 100; }
.skip-link:focus { top: var(--ry-s2); }
.muted { color: var(--ry-muted); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--ry-wide); margin: 0 auto; padding: 0 var(--ry-gutter); }
.site-main { padding: 0 0 var(--ry-s8); outline: 0; }
.prose { font-size: 1.0625rem; }
.prose > * { max-width: var(--ry-measure); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: var(--ry-s2); }
.prose li::marker { color: var(--ry-accent); }
.prose h2 { margin-top: var(--ry-s7); }
.prose h2:first-child { margin-top: 0; }
.section { padding: var(--ry-s8) 0 0; }
.section > h2:first-child, .section > header > h2 { margin-top: 0; }
.section-intro { color: var(--ry-muted); max-width: 60ch; font-size: 1.125rem; margin-bottom: var(--ry-s5); }
.grid { display: grid; gap: var(--ry-s4); }
.page-grid { display: grid; gap: var(--ry-s6); padding-top: var(--ry-s7); }
.page-grid > * { min-width: 0; }
.page-aside { display: grid; gap: var(--ry-s5); align-content: start; align-self: start; }
.page-body { padding-top: var(--ry-s7); }

/* ---------- Header ---------- */
.site-header { background: color-mix(in srgb, var(--ry-bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--ry-border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: var(--ry-s3); min-height: 68px; }
.brand { font-family: var(--ry-display); font-weight: 650; font-size: 1.25rem; color: var(--ry-text); text-decoration: none; display: flex; align-items: center; gap: 10px; margin-right: auto; letter-spacing: -0.01em; }
.brand:hover { color: var(--ry-text); text-decoration: none; }
.brand span:last-child { white-space: nowrap; }
/* Brand mark: a tiny life ribbon (lived years + this year). */
.brand-mark { display: inline-grid; grid-auto-flow: column; gap: 2px; align-items: end; height: 22px; flex: none; }
.brand-mark i { display: block; width: 4px; border-radius: 2px; background: var(--ry-marigold); }
.brand-mark i:nth-child(1) { height: 10px; } .brand-mark i:nth-child(2) { height: 14px; } .brand-mark i:nth-child(3) { height: 18px; }
.brand-mark i:nth-child(4) { height: 22px; background: var(--ry-accent); }
.brand-mark i:nth-child(5), .brand-mark i:nth-child(6) { height: 22px; background: var(--ry-border-strong); }
.brand img { height: 34px; width: auto; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: inline; }
.icon-btn { background: transparent; border: 1px solid var(--ry-border); border-radius: 999px; min-width: 42px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ry-text); }
.icon-btn:hover { background: var(--ry-surface); }
.icon-btn svg { width: 19px; height: 19px; }
.site-header .header-cta { display: none; }
.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ry-surface); border-bottom: 1px solid var(--ry-border); padding: var(--ry-s2) var(--ry-gutter) var(--ry-s5); max-height: calc(100vh - 68px); overflow-y: auto; box-shadow: var(--ry-shadow); }
.primary-nav.is-open { display: block; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: var(--ry-s3) 0; color: var(--ry-text); text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--ry-border); }
.primary-nav a:hover, .primary-nav [aria-current="page"] { color: var(--ry-accent); }
.primary-nav .sub-menu { padding-left: var(--ry-s4); }
.primary-nav .sub-menu a { font-weight: 400; }
.primary-nav .sub-toggle { display: none; }
.primary-nav .mega-heading { margin: var(--ry-s4) 0 var(--ry-s1); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ry-muted); }
.primary-nav .mega-col:first-child .mega-heading:first-child { margin-top: var(--ry-s2); }
.primary-nav .mega-all { font-weight: 700; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Page heads ---------- */
.hero-band { padding: var(--ry-s4) 0 var(--ry-s7); border-bottom: 1px solid var(--ry-border); background: linear-gradient(180deg, var(--ry-surface) 0%, var(--ry-bg) 100%); }
.hero-band--compact { padding-bottom: var(--ry-s6); }
.page-head { margin: var(--ry-s5) 0; max-width: 880px; }
.page-head h1 { margin-bottom: var(--ry-s4); }
.page-head .kicker { display: block; font-weight: 700; color: var(--ry-accent); margin-bottom: var(--ry-s2); font-size: 0.9375rem; }
.lede { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem); color: var(--ry-muted); max-width: 58ch; margin-bottom: var(--ry-s4); line-height: 1.55; }
.lede p { margin: 0; }
.notice-line { font-size: 0.9375rem; color: var(--ry-muted); margin: 0; padding-left: var(--ry-s3); border-left: 3px solid var(--ry-danger); }
.trust-row { display: flex; flex-wrap: wrap; gap: var(--ry-s2); margin: var(--ry-s5) 0 0; padding: 0; list-style: none; }
.trust-row li { font-size: 0.875rem; color: var(--ry-text); background: var(--ry-surface); border: 1px solid var(--ry-border); border-radius: 999px; padding: 5px 12px; }

/* Home hero: headline + ribbon beside the calculator. */
.home-hero { display: grid; gap: var(--ry-s5); padding-top: var(--ry-s4); grid-template-areas: "head" "tool" "ribbon"; }
.home-hero > * { min-width: 0; }
.home-hero .page-head { margin: 0; grid-area: head; }
.home-hero .home-tool { grid-area: tool; }
.home-hero .hero-ribbon { grid-area: ribbon; }
.home-hero .life-ribbon { margin-top: 0; }
@media (max-width: 1023px) {
	.home-hero .lede { font-size: 1.0625rem; margin-bottom: var(--ry-s3); }
	.home-hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 2.75rem); margin-bottom: var(--ry-s3); }
}

/* ---------- The life ribbon (the signature element) ---------- */
.life-ribbon { margin: var(--ry-s6) 0 0; }
.ribbon-bars { display: grid; grid-template-columns: repeat(100, minmax(0, 1fr)); gap: 2px; height: 72px; align-items: end; }
.ribbon-bars i { display: block; height: 55%; border-radius: 2px; background: var(--ry-border-strong); transition: background-color .35s ease, height .35s ease; transition-delay: calc(var(--i) * 6ms); }
.ribbon-bars i:nth-child(10n) { height: 75%; }
.ribbon-bars i.is-lived { background: var(--ry-marigold); height: 70%; }
.ribbon-bars i.is-lived:nth-child(10n) { height: 85%; }
.ribbon-bars i.is-now { background: var(--ry-accent); height: 100%; }
.ribbon-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ry-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.life-ribbon figcaption { margin-top: var(--ry-s3); color: var(--ry-muted); font-size: 0.9375rem; max-width: 52ch; min-height: 3em; }
.life-ribbon figcaption strong { color: var(--ry-text); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.875rem; color: var(--ry-muted); padding-top: var(--ry-s4); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--ry-s1); margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--ry-s1); opacity: .5; }
.breadcrumbs a { color: var(--ry-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ry-accent); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--ry-s2); min-height: 48px; padding: 0 var(--ry-s5); border-radius: 999px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.25; transition: background-color .15s, border-color .15s; }
.header-cta, .btn-sm { white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ry-accent); color: var(--ry-on-accent); }
.btn-primary:hover { background: var(--ry-accent-hover); color: var(--ry-on-accent); }
.btn-ghost { background: transparent; border-color: var(--ry-border-strong); color: var(--ry-text); }
.btn-ghost:hover { border-color: var(--ry-text); color: var(--ry-text); }
.btn-sm { min-height: 40px; padding: 0 var(--ry-s4); font-size: 0.9375rem; }

/* ---------- Calculator ---------- */
.ry-calc { background: var(--ry-surface); border: 1px solid var(--ry-border); border-radius: var(--ry-r-lg); box-shadow: var(--ry-shadow); padding: var(--ry-s5) var(--ry-s4); margin-bottom: var(--ry-s5); }
.ry-calc form { display: grid; gap: var(--ry-s5); }
.field-row { display: grid; gap: var(--ry-s4); }
.field { min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9375rem; }
.field .help { display: block; font-size: 0.8125rem; color: var(--ry-muted); margin-top: 6px; line-height: 1.45; }
.field input[type="date"], .field input[type="time"], .field input[type="number"], .field input[type="text"], .field select {
	width: 100%; min-height: 50px; padding: var(--ry-s2) var(--ry-s3); border: 1.5px solid var(--ry-border-strong); border-radius: 12px; background-color: var(--ry-surface); font-size: 1.0625rem; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover { border-color: var(--ry-muted); }
.field input:focus, .field select:focus { outline: none; border-color: var(--ry-accent); box-shadow: 0 0 0 3px var(--ry-accent-soft); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--ry-danger); box-shadow: 0 0 0 3px var(--ry-danger-soft); }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-group { display: flex; flex-wrap: wrap; gap: var(--ry-s2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 var(--ry-s4); border: 1.5px solid var(--ry-border-strong); border-radius: var(--ry-r-sm); background: var(--ry-surface); font-size: 0.9375rem; }
.choice:hover span { border-color: var(--ry-muted); }
.choice input:checked + span { background: var(--ry-text); color: var(--ry-surface); border-color: var(--ry-text); }
:root[data-theme="dark"] .choice input:checked + span { background: var(--ry-accent); color: var(--ry-on-accent); border-color: var(--ry-accent); }
.choice input:focus-visible + span { outline: 3px solid var(--ry-marigold); outline-offset: 2px; }
.check { display: flex; gap: var(--ry-s2); align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ry-accent); flex: none; }
.ry-calc details.panel { border-top: 1px solid var(--ry-border); padding: 0; }
.ry-calc details.panel > summary { cursor: pointer; font-weight: 700; padding: var(--ry-s4) 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--ry-s3); }
.ry-calc details.panel > summary::-webkit-details-marker { display: none; }
.ry-calc details.panel > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--ry-muted); border-bottom: 2px solid var(--ry-muted); transform: rotate(45deg); transition: transform .2s; flex: none; margin-right: 4px; }
.ry-calc details.panel[open] > summary::after { transform: rotate(-135deg); }
.ry-calc details.panel > .panel-body { display: grid; gap: var(--ry-s4); padding-bottom: var(--ry-s4); }
.panel-body .field-row.cols-3 > fieldset:first-child { grid-column: 1 / -1; }
.field .choice { margin: 0; }
/* Segmented control: equal halves, labels centred both ways. */
.mode-toggle { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; background: var(--ry-surface-2); border-radius: var(--ry-r); padding: 4px; gap: 4px; width: 100%; max-width: 440px; }
.mode-toggle .choice { display: flex; }
.mode-toggle .choice span { flex: 1; justify-content: center; text-align: center; line-height: 1.25; border: 0; background: transparent; min-height: 42px; padding: 6px var(--ry-s3); border-radius: 10px; transition: background-color .2s, box-shadow .2s; }
.mode-toggle .choice input:checked + span { background: var(--ry-surface); color: var(--ry-text); box-shadow: 0 1px 3px rgb(20 33 61 / 18%); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--ry-s3); align-items: center; }
.form-actions .btn-primary { min-width: 200px; }
.ry-errors { color: var(--ry-danger); font-weight: 700; margin: 0; }
.ry-errors:empty { display: none; }
.ry-errors:not(:empty) { background: var(--ry-danger-soft); padding: var(--ry-s3) var(--ry-s4); border-radius: var(--ry-r-sm); }
.noscript-msg { background: var(--ry-surface-2); padding: var(--ry-s4); border-radius: var(--ry-r-sm); }
.bmi-out { font-weight: 700; color: var(--ry-accent) !important; }

/* ---------- Results ---------- */
.ry-result { margin: var(--ry-s6) calc(-1 * var(--ry-s4)) 0; padding: var(--ry-s6) var(--ry-s4) 0; border-top: 1px solid var(--ry-border); outline: 0; }
.ry-result[hidden] { display: none; }
.ry-result h2 { margin-top: 0; font-size: 1.5rem; }
.ry-result h3 { font-size: 1.125rem; margin-top: var(--ry-s6); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-bottom: var(--ry-s4); border-top: 1px solid var(--ry-border); }
.stat { padding: var(--ry-s4) var(--ry-s3) var(--ry-s4) 0; border-bottom: 1px solid var(--ry-border); min-width: 0; }
.stat .k { display: block; font-size: 0.8125rem; color: var(--ry-muted); }
.stat .v { display: block; font-family: var(--ry-display); font-size: clamp(1.375rem, 1.2rem + .6vw, 1.75rem); font-weight: 650; font-variant-numeric: tabular-nums lining-nums; overflow-wrap: anywhere; }
.stat.big { grid-column: 1 / -1; padding: var(--ry-s5) 0; }
.stat.big .v { font-size: clamp(3rem, 2rem + 4.5vw, 5rem); line-height: 1; letter-spacing: -0.03em; }
.stat.big .k { font-size: 0.9375rem; margin-bottom: var(--ry-s2); }
.result-line { font-family: var(--ry-display); font-size: 1.375rem; font-weight: 650; line-height: 1.3; }
.result-note { font-size: 0.875rem; color: var(--ry-muted); }
.countdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: var(--ry-s3) 0; background: var(--ry-text); border-radius: var(--ry-r); overflow: hidden; border: 1px solid var(--ry-text); }
.countdown .cell { background: var(--ry-text); color: #fff; text-align: center; padding: var(--ry-s4) var(--ry-s1); box-shadow: inset -1px 0 0 rgb(255 255 255 / 10%); }
.countdown .num { display: block; font-family: var(--ry-display); font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem); font-weight: 650; font-variant-numeric: tabular-nums lining-nums; line-height: 1; }
.countdown .unit { display: block; font-size: 0.75rem; color: rgb(255 255 255 / 70%); margin-top: 6px; }
.countdown.is-fullscreen { position: fixed; inset: 0; z-index: 200; border-radius: 0; align-content: center; padding: var(--ry-s6); grid-template-columns: repeat(2, 1fr); margin: 0; }
.countdown.is-fullscreen .num { font-size: clamp(3rem, 12vw, 9rem); }
:root[data-theme="dark"] .countdown, :root[data-theme="dark"] .countdown .cell { background: #0A1222; border-color: #0A1222; }
.bar { height: 10px; background: var(--ry-grid-ahead); border-radius: 999px; overflow: hidden; margin: var(--ry-s3) 0; }
.bar > span { display: block; height: 100%; background: var(--ry-marigold); border-radius: 999px; }
.breakdown { list-style: none; padding: 0; border-top: 1px solid var(--ry-border); }
.breakdown li { display: flex; justify-content: space-between; gap: var(--ry-s3); padding: var(--ry-s3) 0; border-bottom: 1px solid var(--ry-border); font-size: 0.9375rem; }
.breakdown .delta { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.breakdown .cite { display: block; font-size: 0.75rem; color: var(--ry-muted); }
.weeks-wrap { overflow-x: auto; padding: var(--ry-s3) 0; }
.weeks-wrap canvas { display: block; min-width: 280px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--ry-s4); font-size: 0.8125rem; color: var(--ry-muted); margin: var(--ry-s2) 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.share-bar { display: flex; flex-wrap: wrap; gap: var(--ry-s2); margin-top: var(--ry-s4); }

/* ---------- Disclaimer ---------- */
.disclaimer-strip { border-left: 3px solid var(--ry-danger); background: var(--ry-surface); padding: var(--ry-s4) var(--ry-s5); border-radius: 0 var(--ry-r-sm) var(--ry-r-sm) 0; font-size: 0.9375rem; margin: var(--ry-s5) 0; }
.disclaimer-strip p { margin: 0 0 var(--ry-s2); }
.disclaimer-strip p:last-child { margin: 0; }
.disclaimer-strip strong { color: var(--ry-text); }

/* ---------- Embed box ---------- */
.embed-box { margin-bottom: var(--ry-s5); }
.home-tool { display: grid; gap: var(--ry-s5); }
.home-tool > * { margin: 0; }
.embed-box summary { cursor: pointer; font-weight: 700; color: var(--ry-accent); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--ry-s3); }
.embed-box summary::-webkit-details-marker { display: none; }
.embed-box summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .25s; flex: none; margin-right: 4px; }
.embed-box[open] summary::after { transform: rotate(-135deg); }
.home-content { max-width: var(--ry-measure); }
.home-content iframe { width: 100%; border: 0; }
.embed-box textarea { width: 100%; min-height: 96px; font-family: ui-monospace, Consolas, monospace; font-size: 0.8125rem; padding: var(--ry-s3); border: 1px solid var(--ry-border); border-radius: var(--ry-r-sm); background: var(--ry-bg); margin: var(--ry-s2) 0; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; column-gap: var(--ry-s7); border-top: 1px solid var(--ry-border); }
.faq details { border-bottom: 1px solid var(--ry-border); margin: 0; }
.faq summary { cursor: pointer; padding: var(--ry-s4) var(--ry-s7) var(--ry-s4) 0; font-weight: 700; list-style: none; position: relative; font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-family: var(--ry-display); font-size: 1.5rem; color: var(--ry-accent); line-height: 1; transition: transform .25s ease; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq summary { transition: color .15s; }
.faq summary:hover { color: var(--ry-accent); }
.faq .answer { padding: 0 0 var(--ry-s4); color: var(--ry-muted); max-width: 64ch; }
.faq .answer p { margin: 0; }

/* ---------- Tool index (rows, not cards) ---------- */
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; column-gap: var(--ry-s7); border-top: 1px solid var(--ry-border); }
.tool-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--ry-s4); align-items: start; padding: var(--ry-s4) 0; border-bottom: 1px solid var(--ry-border); text-decoration: none; color: var(--ry-text); height: 100%; }
.tool-row:hover { color: var(--ry-text); text-decoration: none; }
.tool-row:hover strong { color: var(--ry-accent); text-decoration: underline; text-underline-offset: 3px; }
.tool-row strong { display: block; font-family: var(--ry-display); font-size: 1.1875rem; font-weight: 650; line-height: 1.25; }
.tool-row span.desc { display: block; font-size: 0.9375rem; color: var(--ry-muted); line-height: 1.5; margin-top: 2px; }
.tool-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--ry-marigold-soft); color: var(--ry-text); display: grid; place-items: center; }
.tool-group { padding-top: var(--ry-s7); }
.tool-group > h2 { margin: 0 0 var(--ry-s4); font-size: 1.5rem; }

/* ---------- People, sources, steps ---------- */
.team-grid, .source-grid, .post-grid { display: grid; gap: var(--ry-s5); grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
.card { background: var(--ry-surface); border: 1px solid var(--ry-border); border-radius: var(--ry-r); padding: var(--ry-s5); }
.team-card { display: grid; grid-template-columns: 72px 1fr; gap: var(--ry-s4); align-items: start; }
.team-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.team-card .ph { width: 72px; height: 72px; border-radius: 50%; background: var(--ry-marigold-soft); display: flex; align-items: center; justify-content: center; font-family: var(--ry-display); font-size: 1.75rem; }
.team-card h3 { margin: 0 0 2px; font-size: 1.125rem; }
.team-card .role { font-size: 0.9375rem; color: var(--ry-muted); margin: 0; }
.team-card .creds { font-size: 0.875rem; margin: 2px 0 var(--ry-s2); }
.badge { display: inline-block; font-size: 0.8125rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--ry-accent-soft); color: var(--ry-accent); }
.source-grid { gap: 0; border-top: 1px solid var(--ry-border); }
.source-card { background: none; border: 0; border-bottom: 1px solid var(--ry-border); border-radius: 0; padding: var(--ry-s4) 0; display: grid; gap: 2px; }
.source-card h3 { font-size: 1.0625rem; margin: 0; }
.source-card img { max-height: 28px; width: auto; }
.source-card .year { font-size: 0.875rem; color: var(--ry-muted); margin: 0; font-variant-numeric: tabular-nums; }
.source-card p { margin: 0; color: var(--ry-muted); font-size: 0.9375rem; }
.source-card a { font-weight: 700; font-size: 0.9375rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 var(--ry-s5); display: grid; gap: 0; }
.steps li { counter-increment: step; position: relative; padding: var(--ry-s4) 0 var(--ry-s4) 64px; border-bottom: 1px solid var(--ry-border); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: var(--ry-s4); font-family: var(--ry-display); font-size: 2.25rem; font-weight: 650; line-height: 1; color: var(--ry-marigold); }
.steps h3 { margin: 0 0 2px; font-size: 1.125rem; }
.steps h3 a { color: var(--ry-text); }
.steps p { margin: 0; color: var(--ry-muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--ry-s5); }
.stat-row .fig { display: block; font-family: var(--ry-display); font-size: 2.5rem; font-weight: 650; color: var(--ry-text); }
.stat-row cite { font-size: 0.8125rem; color: var(--ry-muted); font-style: normal; }
.reviewed-by { display: flex; gap: var(--ry-s3); align-items: center; }
.reviewed-by img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.last-reviewed { display: inline-flex; flex-wrap: wrap; gap: var(--ry-s2) var(--ry-s5); font-size: 0.875rem; color: var(--ry-muted); margin: var(--ry-s4) 0 0; }
.last-reviewed strong { color: var(--ry-text); }
.disclosure { font-size: 0.9375rem; background: var(--ry-marigold-soft); border-radius: var(--ry-r-sm); padding: var(--ry-s4) var(--ry-s5); color: var(--ry-text); max-width: 72ch; }

/* ---------- Aside ---------- */
.side-card { padding: 0 0 var(--ry-s4); border-bottom: 1px solid var(--ry-border); }
.side-card .side-title { font-family: var(--ry-display); font-weight: 650; font-size: 1.0625rem; margin: 0 0 var(--ry-s2); color: var(--ry-text); }
.side-card ul, .side-card ol { list-style: none; margin: 0; padding: 0; }
.side-card li a { display: block; padding: 6px 0 6px var(--ry-s3); margin-left: -2px; border-left: 2px solid transparent; color: var(--ry-muted); text-decoration: none; font-size: 0.9375rem; line-height: 1.4; }
.side-card li a:hover { color: var(--ry-text); border-left-color: var(--ry-marigold); }
.side-card--accent { background: var(--ry-text); color: #fff; border: 0; border-radius: var(--ry-r); padding: var(--ry-s5); }
.side-card--accent .side-title { color: #fff; }
.side-card--accent p { margin: 0 0 var(--ry-s4); color: rgb(255 255 255 / 80%); font-size: 0.9375rem; }
.side-card--accent .btn { background: var(--ry-marigold); color: #14213D; border: 0; }
.toc ol { counter-reset: none; }
.toc summary { font-weight: 700; cursor: pointer; }

/* ---------- Ad slot ---------- */
.ad-slot { min-height: 250px; margin: var(--ry-s5) 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--ry-border-strong); border-radius: var(--ry-r-sm); color: var(--ry-muted); font-size: 0.75rem; }
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot__label { margin-bottom: var(--ry-s1); }

/* ---------- Blog ---------- */
.post-grid { gap: 0; border-top: 1px solid var(--ry-border); }
.post-card { background: none; border: 0; border-bottom: 1px solid var(--ry-border); border-radius: 0; padding: var(--ry-s5) 0; }
.post-card h2, .post-card h3 { font-size: 1.3125rem; margin: 0 0 var(--ry-s2); }
.post-card h2 a, .post-card h3 a { color: var(--ry-text); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--ry-accent); text-decoration: underline; }
.post-card p { margin: 0; }
.post-meta { font-size: 0.9375rem; color: var(--ry-muted); margin-bottom: var(--ry-s2); }
.post-meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--ry-border-strong); margin: 0 10px; vertical-align: middle; }
.author-box { display: flex; gap: var(--ry-s4); border-top: 1px solid var(--ry-border); padding-top: var(--ry-s5); margin-top: var(--ry-s7); max-width: var(--ry-measure); }
.author-box img { border-radius: 50%; flex: none; }
.pagination { display: flex; justify-content: space-between; margin-top: var(--ry-s6); }
.search-form { display: flex; gap: var(--ry-s2); max-width: 560px; margin-top: var(--ry-s4); }
.search-form input { flex: 1; min-width: 0; min-height: 50px; padding: 0 var(--ry-s4); border: 1.5px solid var(--ry-border-strong); border-radius: 999px; background: var(--ry-surface); }

/* ---------- Footer ---------- */
.site-footer { background: #14213D; color: #C9D2E0; padding: var(--ry-s8) 0 var(--ry-s5); font-size: 0.9375rem; margin-top: var(--ry-s8); }
.site-footer a { color: #FFFFFF; text-decoration: none; }
.site-footer a:hover { color: #FFFFFF; text-decoration: underline; }
.site-footer .brand { color: #fff; margin-bottom: var(--ry-s4); }
.site-footer .brand-mark i:nth-child(5), .site-footer .brand-mark i:nth-child(6) { background: #33476E; }
.site-footer .brand-mark i:nth-child(4) { background: #6CC2B1; }
.footer-grid { display: grid; gap: var(--ry-s6); }
.footer-brand p { color: #A9B4C6; max-width: 46ch; }
.footer-title { font-family: var(--ry-display); font-weight: 650; font-size: 1.0625rem; color: #fff; margin: 0 0 var(--ry-s3); }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px var(--ry-s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-help { color: #A9B4C6; }
.footer-help strong { color: #fff; }
.footer-help a { color: #F0A202; }
.footer-bottom { border-top: 1px solid #26375A; margin-top: var(--ry-s6); padding-top: var(--ry-s5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ry-s3); }
.copyright { color: #A9B4C6; font-size: 0.875rem; margin: 0; }

/* ---------- Embed mode ---------- */
body.ry-embed { background: transparent; }
body.ry-embed .ry-calc { margin: 0; box-shadow: none; }
.embed-attrib { font-size: 0.8125rem; color: var(--ry-muted); margin: var(--ry-s3) 0 0; }

/* ---------- Breakpoints ---------- */
@media (max-width: 420px) {
	.site-header .container { gap: var(--ry-s2); }
	.brand { font-size: 1.125rem; gap: 8px; }
	.icon-btn { min-width: 40px; min-height: 40px; }
	.ribbon-bars { gap: 1px; height: 56px; }
	.choice span { padding: 0 var(--ry-s3); }
	.form-actions .btn { flex: 1 1 auto; min-width: 0; }
}
@media (min-width: 640px) {
	:root { --ry-gutter: 28px; }
	.field-row.cols-2, .field-row.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.countdown { grid-template-columns: repeat(6, 1fr); }
	.countdown:has(.cell:nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
	.countdown.is-fullscreen { grid-template-columns: repeat(3, 1fr); }
	.tool-list, .team-grid, .post-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ry-s6); }
	.ry-calc { padding: var(--ry-s6); }
	.ry-result { margin-inline: calc(-1 * var(--ry-s6)); padding-inline: var(--ry-s6); }
	.footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
	.field-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.faq-list.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
	.faq-list.two-col details:nth-child(-n+2) { border-top: 0; }
	.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ry-s7); }
}
@media (min-width: 1024px) {
	:root { --ry-gutter: 40px; }
	.primary-nav { display: block; position: static; border: 0; padding: 0; background: transparent; box-shadow: none; max-height: none; overflow: visible; }
	.primary-nav > ul { display: flex; gap: var(--ry-s5); align-items: center; }
	.primary-nav li { position: relative; }
	.primary-nav a { border: 0; padding: var(--ry-s2) 0; }
	.primary-nav > ul > li > a[aria-current="page"],
	.primary-nav > ul > li.is-current > a { box-shadow: inset 0 -2px 0 var(--ry-marigold); }
	.primary-nav > ul > li.has-children { display: flex; align-items: center; gap: 2px; }
	.primary-nav .sub-toggle { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0; width: 28px; height: 28px; background: transparent; border: 0; border-radius: 6px; color: var(--ry-text); cursor: pointer; flex: none; }
	.primary-nav .sub-toggle:hover { background: var(--ry-surface-2); color: var(--ry-accent); }
	.primary-nav .sub-toggle svg { width: 14px; height: 14px; transition: transform .15s ease; }
	.primary-nav li.is-open > .sub-toggle svg { transform: rotate(180deg); }
	.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: -16px; min-width: 220px; background: var(--ry-surface); border: 1px solid var(--ry-border); border-radius: var(--ry-r); box-shadow: var(--ry-shadow); padding: var(--ry-s2) var(--ry-s4); margin-top: 6px; z-index: 60; }
	.primary-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
	.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
	html[data-ry-nav-js] .primary-nav li:hover > .sub-menu,
	html[data-ry-nav-js] .primary-nav li:focus-within > .sub-menu { display: none; }
	html[data-ry-nav-js] .primary-nav li.is-open > .sub-menu { display: block; }
	.primary-nav .sub-menu a { padding: 7px 0; font-weight: 400; }
	.primary-nav .sub-menu a[aria-current="page"] { font-weight: 700; }
	.primary-nav .has-mega > .sub-menu { width: min(720px, calc(100vw - 2 * var(--ry-gutter))); min-width: 0; padding: var(--ry-s5); left: 0; }
	.primary-nav .mega-cols { display: grid; grid-template-columns: repeat(var(--mega-cols, 3), minmax(0, 1fr)); gap: var(--ry-s4) var(--ry-s5); }
	.primary-nav .mega-col .mega-heading:first-child,
	.primary-nav .mega-col:first-child .mega-heading:first-child { margin-top: 0; }
	.primary-nav .mega-col .mega-heading { margin-bottom: var(--ry-s2); }
	.primary-nav .mega-col ul { margin: 0; }
	.primary-nav .has-mega .sub-menu a { padding: 6px 8px; margin: 0 -8px; border-radius: var(--ry-r-sm); }
	.primary-nav .has-mega .sub-menu a:hover,
	.primary-nav .has-mega .sub-menu a[aria-current="page"] { background: var(--ry-accent-soft); text-decoration: none; }
	.primary-nav .mega-all { display: block; margin-top: var(--ry-s4); padding-top: var(--ry-s3); border-top: 1px solid var(--ry-border); font-weight: 700; }
	.menu-toggle { display: none; }
	.site-header .header-cta { display: inline-flex; }
	.home-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "head tool" "ribbon tool"; grid-template-rows: auto 1fr; column-gap: var(--ry-s8); row-gap: var(--ry-s6); align-items: start; padding-top: var(--ry-s7); }
	.home-hero .ry-calc { margin-bottom: 0; }
	.page-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: var(--ry-s8); }
	.page-aside { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
	.ry-calc { padding: var(--ry-s7); }
	.ry-result { margin-inline: calc(-1 * var(--ry-s7)); padding-inline: var(--ry-s7); }
	.team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tool-list.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
	.hero-band { padding-bottom: var(--ry-s8); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .site-footer, .ad-slot, .share-bar, .embed-box, .form-actions, .breadcrumbs, .page-aside, .life-ribbon { display: none !important; }
	body { background: #fff; color: #000; }
	.hero-band { background: none; }
	.ry-calc { box-shadow: none; border: 0; }
	.page-grid, .home-hero { display: block; }
}


/* =====================================================================
   v1.3.0 refresh: info tips, select arrow, cards, icons, art, data tools.
   ===================================================================== */
:root {
	--ry-shadow-sm: 0 1px 2px rgb(20 33 61 / 6%), 0 2px 8px -2px rgb(20 33 61 / 8%);
	--ry-shadow-lg: 0 1px 2px rgb(20 33 61 / 5%), 0 24px 48px -20px rgb(20 33 61 / 28%);
	--ry-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356627A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	--ry-tint-life: #FDF1D6; --ry-ink-life: #8A5A00;
	--ry-tint-age: #E1EFEC; --ry-ink-age: #1D6B5F;
	--ry-tint-countdown: #E4ECF7; --ry-ink-countdown: #2D4B7A;
	--ry-tint-pets: #F6E7EA; --ry-ink-pets: #8B3448;
	--ry-tint-country: #E8EEF2; --ry-ink-country: #14213D;
}
:root[data-theme="dark"] {
	--ry-shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
	--ry-shadow-lg: 0 24px 48px -20px rgb(0 0 0 / 65%);
	--ry-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9B4C6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	--ry-tint-life: #3A3020; --ry-ink-life: #F5C35A;
	--ry-tint-age: #1B3A3C; --ry-ink-age: #8FD3C5;
	--ry-tint-countdown: #1F2F4D; --ry-ink-countdown: #A9C3EC;
	--ry-tint-pets: #3A2030; --ry-ink-pets: #F0A3B1;
	--ry-tint-country: #1D2C47; --ry-ink-country: #EEF2F6;
}

/* ---------- Select: custom arrow with breathing room (sitewide) ---------- */
select:not([multiple]):not([size]) {
	-webkit-appearance: none !important;
	appearance: none !important;
	background-image: var(--ry-chevron) !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	background-size: 16px 16px !important;
	padding-right: 44px !important;
	text-overflow: ellipsis;
	cursor: pointer;
}
select::-ms-expand { display: none; }

/* ---------- Labels + info tips ---------- */
.label-row { display: flex; align-items: center; gap: 6px; min-height: 24px; margin: 0 0 6px; position: relative; }
.field .label-row label, .field .label-row > span { margin: 0; font-weight: 700; font-size: 0.9375rem; line-height: 1.3; }
.field > label:first-child { min-height: 24px; display: flex; align-items: center; }
.field legend.label-row { display: flex; width: 100%; padding: 0; float: none; }
.field .hint { display: block; font-size: 0.8125rem; color: var(--ry-muted); margin-top: 6px; line-height: 1.4; }
.info-tip { display: inline-flex; flex: none; }
.info-tip__btn { position: relative; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1.5px solid var(--ry-border-strong); background: var(--ry-surface); color: var(--ry-muted); display: inline-grid; place-items: center; cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.info-tip__btn::before { content: ""; position: absolute; inset: -12px; } /* 44px touch target */
.info-tip__btn:hover, .info-tip.is-open .info-tip__btn { color: var(--ry-accent); border-color: var(--ry-accent); background: var(--ry-accent-soft); }
.info-tip__bubble { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: max-content; max-width: min(320px, calc(100vw - 48px)); transform: translateX(var(--tip-shift, 0)); background: var(--ry-text); color: var(--ry-surface); font-size: 0.8125rem; font-weight: 400; line-height: 1.5; padding: 10px 12px; border-radius: 10px; box-shadow: var(--ry-shadow-lg); text-align: left; white-space: normal; letter-spacing: 0; }
.info-tip.is-open .info-tip__bubble, .info-tip:focus-within .info-tip__bubble { display: block; }
@media (hover: hover) { .info-tip:hover .info-tip__bubble { display: block; } }
.panel-hint, .check-row { display: flex; align-items: center; gap: 8px; position: relative; margin: 0; font-size: 0.875rem; color: var(--ry-muted); }
.panel-hint .info-tip__bubble, .check-row .info-tip__bubble { top: calc(100% + 8px); }
.check-row .check { margin: 0; }

/* ---------- Inputs + buttons polish ---------- */
.field input:focus, .field select:focus, .search-form input:focus { box-shadow: 0 0 0 4px var(--ry-accent-soft); }
.choice span { border-radius: 12px; transition: border-color .15s, background-color .15s, color .15s; }
.btn { transition: background-color .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn-primary { box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--ry-accent) 80%, transparent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--ry-accent) 85%, transparent); }
.btn:active { transform: none; }

/* ---------- Hero ---------- */
.hero-band {
	background:
		radial-gradient(900px 420px at 92% -12%, color-mix(in srgb, var(--ry-accent) 12%, transparent), transparent 62%),
		radial-gradient(760px 360px at -6% -10%, color-mix(in srgb, var(--ry-marigold) 13%, transparent), transparent 60%),
		linear-gradient(180deg, var(--ry-surface) 0%, var(--ry-bg) 100%);
}
.trust-row li { display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--ry-shadow-sm); }
.trust-row li::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--ry-accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.page-head-wrap { display: grid; gap: var(--ry-s5); align-items: center; }
.ry-art--hero { display: none; }

/* ---------- Calculator card ---------- */
.ry-calc { position: relative; border-radius: 24px; box-shadow: var(--ry-shadow-lg); overflow: visible; }
.ry-calc::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--ry-marigold), var(--ry-accent)); }
.mode-toggle { border-radius: 14px; }

/* ---------- Illustrations ---------- */
.ry-art { margin: var(--ry-s5) 0 var(--ry-s6); }
.ry-art img { display: block; width: 100%; height: auto; border-radius: 20px; background: var(--ry-surface-2); }
.prose > .ry-art, .prose > table, .prose > .table-scroll { max-width: 100%; }
:root[data-theme="dark"] .ry-art img, :root[data-theme="dark"] .post-hero-figure img, :root[data-theme="dark"] .post-card__img, :root[data-theme="dark"] .prose figure img { filter: brightness(.86) saturate(.95); }
.post-hero-figure { margin: 0 0 var(--ry-s6); }
.post-hero-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; background: var(--ry-surface-2); }
.prose figure { margin: var(--ry-s6) 0; }
.prose figure img { display: block; width: 100%; height: auto; border-radius: 16px; }
.prose figcaption { font-size: 0.875rem; color: var(--ry-muted); margin-top: var(--ry-s2); }

/* ---------- Tool cards (icons) ---------- */
.tool-list { border-top: 0; gap: var(--ry-s3); }
.tool-row { position: relative; grid-template-columns: 44px minmax(0, 1fr) 16px; align-items: center; padding: var(--ry-s4); border: 1px solid var(--ry-border); border-radius: 16px; background: var(--ry-surface); box-shadow: var(--ry-shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tool-row:hover { transform: translateY(-2px); box-shadow: var(--ry-shadow-lg); border-color: color-mix(in srgb, var(--ry-accent) 45%, var(--ry-border)); }
.tool-row:hover strong { text-decoration: none; }
.tool-row strong { font-size: 1.0625rem; }
.tool-row .tool-go { color: var(--ry-muted); font-weight: 700; transition: transform .18s ease, color .18s ease; }
.tool-row:hover .tool-go { color: var(--ry-accent); transform: translateX(3px); }
.tool-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--ry-tint-age); color: var(--ry-ink-age); }
.tool-icon--life { background: var(--ry-tint-life); color: var(--ry-ink-life); }
.tool-icon--countdown { background: var(--ry-tint-countdown); color: var(--ry-ink-countdown); }
.tool-icon--pets { background: var(--ry-tint-pets); color: var(--ry-ink-pets); }
.tool-icon--country { background: var(--ry-tint-country); color: var(--ry-ink-country); }
.tool-group > h2 { display: flex; align-items: center; gap: var(--ry-s3); }

/* Mega menu + mobile menu icons */
.primary-nav .sub-menu a { display: flex; align-items: center; gap: 10px; }
.primary-nav .sub-menu .tool-icon { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.primary-nav .sub-menu .tool-icon svg { width: 16px; height: 16px; }

/* ---------- Cards, FAQ, tables ---------- */
.card { border-radius: 18px; }
.faq-list { border-top: 0; gap: var(--ry-s3); row-gap: var(--ry-s3); }
.faq details { border: 1px solid var(--ry-border); border-radius: 14px; background: var(--ry-surface); padding: 0 var(--ry-s4); transition: border-color .15s, box-shadow .15s; }
.faq-list.two-col details:nth-child(-n+2) { border-top: 1px solid var(--ry-border); }
.faq details[open] { box-shadow: var(--ry-shadow-sm); border-color: var(--ry-border-strong); }
.faq summary { padding-right: var(--ry-s6); }
.prose table, .data-table { border: 1px solid var(--ry-border); border-radius: 14px; background: var(--ry-surface); font-size: 0.9375rem; }
.prose th, .data-table thead th { background: var(--ry-surface-2); }
.prose thead th:first-child { border-top-left-radius: 13px; }
.prose thead th:last-child { border-top-right-radius: 13px; }
.prose tbody tr:last-child td, .prose tbody tr:last-child th { border-bottom: 0; }
.prose tbody tr:nth-child(even) td, .prose tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--ry-surface-2) 40%, transparent); }

/* ---------- Blog cards ---------- */
.post-grid--cards { border-top: 0; gap: var(--ry-s5); }
.post-grid--cards .post-card { display: flex; flex-direction: column; border: 1px solid var(--ry-border); border-radius: 18px; background: var(--ry-surface); padding: 0; overflow: hidden; box-shadow: var(--ry-shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.post-grid--cards .post-card:hover { transform: translateY(-2px); box-shadow: var(--ry-shadow-lg); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ry-surface-2); }
.post-card__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__img { transform: scale(1.03); }
.post-grid--cards .post-card__body { padding: var(--ry-s4) var(--ry-s5) var(--ry-s5); }
.post-grid--cards .post-card h2, .post-grid--cards .post-card h3 { font-size: 1.1875rem; line-height: 1.3; }

/* ---------- Data tools: country table + compare ---------- */
.data-tool { margin: var(--ry-s6) 0 0; padding: var(--ry-s5) var(--ry-s4); border-radius: 24px; box-shadow: var(--ry-shadow-lg); }
.data-tool__head { display: grid; gap: var(--ry-s3); margin-bottom: var(--ry-s4); }
.data-tool__head h2 { margin: 0 0 4px; font-size: 1.375rem; }
.data-tool__head p { margin: 0; font-size: 0.9375rem; }
.data-tool__search input { width: 100%; min-height: 48px; padding: 0 var(--ry-s4) 0 42px; border: 1.5px solid var(--ry-border-strong); border-radius: 999px; background: var(--ry-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356627A' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px; }
.data-tool__search input:focus { outline: none; border-color: var(--ry-accent); box-shadow: 0 0 0 4px var(--ry-accent-soft); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; max-height: 70vh; overflow-y: auto; }
.data-table { display: table; width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; overflow: visible; }
.compare-table { min-width: 640px; }
.data-table thead th { position: sticky; top: 0; z-index: 2; white-space: nowrap; font-size: 0.8125rem; padding: 0; }
.data-table thead th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; cursor: pointer; font-weight: 700; color: var(--ry-text); }
.data-table thead th button:focus-visible { outline: 3px solid var(--ry-marigold); outline-offset: -3px; }
.data-table thead th button::after { content: "↕"; opacity: .35; font-size: .9em; }
.data-table thead th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; color: var(--ry-accent); }
.data-table thead th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; color: var(--ry-accent); }
.compare-table thead th { padding: 10px 12px; white-space: normal; min-width: 90px; }
.data-table td, .data-table tbody th { padding: 9px 12px; border-bottom: 1px solid var(--ry-border); }
.data-table tbody th { font-weight: 700; white-space: nowrap; }
.data-table tbody tr:hover td, .data-table tbody tr:hover th { background: var(--ry-accent-soft); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .strong { font-weight: 700; }
.data-sources { margin-top: var(--ry-s4); font-size: 0.8125rem; color: var(--ry-muted); }
.data-sources p { margin: 0 0 6px; }
.data-sources strong { color: var(--ry-text); }
.compare-tool { margin-top: var(--ry-s6); }
.compare-form { display: grid; gap: var(--ry-s4); }
.compare-picks { display: grid; gap: var(--ry-s3); grid-template-columns: 1fr; }
.compare-remove { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ry-border); background: var(--ry-surface); color: var(--ry-muted); display: inline-grid; place-items: center; cursor: pointer; }
.compare-remove:hover { color: var(--ry-danger); border-color: var(--ry-danger); }
.compare-controls { display: flex; flex-wrap: wrap; align-items: end; gap: var(--ry-s4); justify-content: space-between; }
.compare-age { width: 160px; }
.compare-result { margin-top: var(--ry-s5); padding-top: var(--ry-s5); border-top: 1px solid var(--ry-border); }
.compare-bars { margin: var(--ry-s5) 0; }
.compare-bars figcaption { font-weight: 700; margin-bottom: var(--ry-s2); }
.cbar { display: grid; grid-template-columns: 1fr; gap: 4px; padding: var(--ry-s2) 0; border-bottom: 1px solid var(--ry-border); }
.cbar__name { font-weight: 700; font-size: 0.9375rem; }
.cbar__track { display: block; height: 22px; background: var(--ry-surface-2); border-radius: 999px; overflow: hidden; }
.cbar__fill { display: flex; align-items: center; justify-content: flex-end; height: 100%; min-width: 3.2em; border-radius: 999px; padding: 0 8px; transition: width .4s ease; }
.cbar__fill b { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.cbar__fill--f { background: var(--ry-accent); color: var(--ry-on-accent); }
.cbar__fill--m { background: var(--ry-marigold); color: #14213D; }

@media (min-width: 640px) {
	.data-tool { padding: var(--ry-s6); }
	.data-tool__head { grid-template-columns: minmax(0, 1fr) 300px; align-items: end; }
	.compare-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cbar { grid-template-columns: 180px 1fr 1fr; align-items: center; gap: var(--ry-s3); }
}
@media (min-width: 1024px) {
	.page-head-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); column-gap: var(--ry-s8); }
	.has-art .page-head { max-width: none; }
	.ry-art--hero { display: block; margin: var(--ry-s5) 0 0; }
	.ry-art--hero img { border-radius: 24px; box-shadow: var(--ry-shadow-lg); }
	.compare-picks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.post-grid--cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tool-list.three { gap: var(--ry-s4); }
}
@media (prefers-reduced-motion: reduce) {
	.tool-row:hover, .post-grid--cards .post-card:hover, .btn-primary:hover { transform: none; }
}

/* v1.3.3: "About This Death Calculator" block + reviewer byline. */
.disclosure.about-block { background: var(--ry-surface); border: 1px solid var(--ry-border); border-left: 4px solid var(--ry-accent); border-radius: 14px; padding: var(--ry-s4) var(--ry-s5); box-shadow: var(--ry-shadow-sm); max-width: 72ch; }
.disclosure.about-block p { margin: 0 0 var(--ry-s2); line-height: 1.6; }
.disclosure.about-block p:last-child { margin-bottom: 0; }
.disclosure.about-block a { color: var(--ry-accent); font-weight: 600; overflow-wrap: anywhere; }
.last-reviewed .byline { display: inline; }
.disclosure.about-block { margin: 0 0 var(--ry-s5); }
.last-reviewed .byline::before { content: ""; display: inline-block; vertical-align: -3px; margin-right: 6px; width: 16px; height: 16px; background: var(--ry-accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v6c0 4.2-3 7.6-7 9-4-1.4-7-4.8-7-9V6z'/%3E%3Cpath d='M8.5 12l2.5 2.5 4.5-5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v6c0 4.2-3 7.6-7 9-4-1.4-7-4.8-7-9V6z'/%3E%3Cpath d='M8.5 12l2.5 2.5 4.5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
