/* Edit the variables below to change the look; no fonts are downloaded. */
:root {
  --paper: #ffffff;
  --white: #ffffff;
  --ink: #20252b;
  --muted: #626b75;
  --accent: #254c70;
  --accent-dark: #18334e;
  --line: #dfe3e8;
  --wash: #f5f6f8;
  --edge: #a6afb8;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --width: 1136px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: .23em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
button { font: inherit; }
[hidden] { display: none !important; }
p { margin: 0 0 1.1rem; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 400; line-height: 1.2; }
h1, h2, h3 { font-family: var(--sans); font-weight: 500; }
h1 { font-size: clamp(2.5rem, 4.3vw, 3.8rem); letter-spacing: -.045em; margin: .6rem 0 1.1rem; }
h2 { font-size: clamp(1.75rem, 2.5vw, 2.25rem); letter-spacing: -.025em; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.45rem; margin: .8rem 0 .65rem; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }
.skip-link { position: fixed; left: 1rem; top: -6rem; z-index: 999; padding: .6rem 1rem; color: var(--white); background: var(--accent-dark); }
.skip-link:focus { top: 1rem; }
.site-header { border-top: 3px solid var(--accent-dark); border-bottom: 1px solid var(--line); background: var(--white); }
.nav-shell { width: min(var(--width), calc(100% - 80px)); margin: 0 auto; min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.wordmark { display: flex; align-items: center; gap: 15px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.monogram { width: 45px; height: 45px; border: 1px solid var(--edge); border-radius: 3px; background: var(--white); display: grid; place-items: center; color: var(--accent-dark); font: 23px var(--serif); letter-spacing: -1px; }
.wordmark-text { font: 500 23px/1.25 var(--sans); }
.wordmark small { display: block; margin-top: 5px; font: 9px/1.4 var(--sans); letter-spacing: 1.65px; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 29px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 10px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--accent-dark); border-color: var(--accent); }
.site-nav a[aria-current='page'] { font-weight: 600; }
.menu-toggle { display: none; background: transparent; border: 1px solid var(--line); padding: 7px 12px; color: var(--ink); }
.menu-toggle span { margin-left: 8px; }
.page-shell { width: min(var(--width), calc(100% - 80px)); margin: 0 auto; min-height: 58vh; padding: 65px 0 88px; }
.page-shell:focus { outline: none; }
.eyebrow, .eyebrow p { font: 11px/1.7 var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: 2.1px; color: var(--accent); margin: 0 0 1.3rem; }
.page-heading { max-width: 870px; margin-bottom: 45px; }
.page-heading h1 { max-width: 860px; }
.page-subtitle { color: var(--muted); font-size: 19px; line-height: 1.65; max-width: 800px; margin-top: 1.3rem; }
.landscape-banner { margin: 0 0 38px; }
.landscape-banner img { display: block; width: 100%; height: clamp(170px, 26vw, 300px); object-fit: cover; object-position: center 60%; border: 1px solid var(--line); border-radius: 8px; }
body[data-page='home'] .page-shell { padding-top: 32px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 76px; align-items: start; padding: 5px 0 48px; }
.hero h1 { font-size: clamp(2.7rem, 4.2vw, 3.8rem); white-space: normal; margin: .8rem 0 1.2rem; }
.hero .eyebrow { margin-top: 0; }
.role { font-size: 19px; margin-bottom: 1.3rem; }
.role p { margin: 0; }
.affiliation { color: var(--muted); font-size: 16px; line-height: 1.6; }
.hero-bio { max-width: 695px; margin-top: 27px; font-size: 18px; line-height: 1.8; }
.link-row { display: flex; flex-wrap: wrap; gap: 13px 27px; align-items: center; margin-top: 24px; font-size: 14px; font-weight: 600; }
.link-row p { margin: 0; }
.action-link { text-decoration: none; border-bottom: 1px solid var(--accent); padding: 5px 0; }
.profile-aside { padding: 28px 27px 23px; background: var(--wash); border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; margin-top: 7px; }
.profile-aside h2 { font: 11px var(--sans); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 0 23px; }
.profile-aside .contact-email { font-size: 15px; overflow-wrap: anywhere; }
.profile-aside .contact-address { font-size: 14px; line-height: 1.9; color: var(--muted); margin: 22px 0; }
.profile-aside .contact-address p { margin: 0; }
.profile-links { border-top: 1px solid var(--line); padding-top: 19px; }
.profile-links p { margin: 0 0 9px; font-size: 14px; }
.section-top { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 3px 0 23px; }
.section-top h2 { margin: 0; }
.section-top p { margin: 0; font-size: 14px; }
.theme-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 30px; border-top: 1px solid var(--line); padding-top: 25px; margin: 0 0 58px; }
.theme-number { color: var(--accent); font: 11px var(--sans); font-weight: 600; letter-spacing: 1px; margin-bottom: 17px; }
.theme-number p { margin: 0; }
.theme h3 { font-size: 23px; line-height: 1.2; margin: 0 0 12px; }
.theme h3 a { color: var(--ink); text-decoration: none; }
.theme h3 a:hover { color: var(--accent); text-decoration: underline; }
.theme p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 0; }
.siam-bibliography { list-style: none; margin: 0; padding: 0; font: 17px/1.7 var(--serif); }
.siam-reference { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: .75rem; margin: 0 0 1.1rem; break-inside: avoid; }
.reference-number { color: var(--muted); text-align: right; }
.reference-text { min-width: 0; overflow-wrap: break-word; }
.reference-authors { font-variant: small-caps; }
.reference-text em a { color: inherit; text-decoration-color: var(--line); }
.reference-text em a:hover { color: var(--accent); text-decoration-color: currentColor; }
.reference-links { font: 12px/1.7 var(--sans); }
.same-authors { display: inline-block; width: 23pt; border-top: 1px solid currentColor; vertical-align: .25em; }
.publication-category-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 2rem; list-style: none; padding: 0; margin: 0 0 2.5rem; font-size: 14px; }
.publication-section { margin-top: 2.75rem; }
.publication-section h3 { border-top: 1px solid var(--line); padding-top: 1.3rem; margin: 0 0 1.3rem; font-size: clamp(1.35rem, 2vw, 1.65rem); }
.page-intro { max-width: 900px; color: var(--muted); margin: 0 0 26px; }
.page-intro p { margin-bottom: 1rem; }
.note { padding: 20px 24px; background: var(--wash); border-left: 3px solid var(--accent); font-size: 15px; color: var(--muted); margin: 32px 0; }
.note p:last-child { margin-bottom: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 12px 27px; font-size: 14px; margin: 15px 0 38px; }
.page-actions p { margin: 0; }
.research-block { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 20px; border-top: 1px solid var(--line); padding: 33px 0 34px; }
.research-block h2 { margin: 0 0 15px; font-size: 29px; }
.research-block .section-number { color: var(--accent); font-size: 12px; padding-top: 5px; }
.research-block p { max-width: 860px; }
.research-block .paper-reference { font-size: 14px; color: var(--muted); margin-top: 18px; }
.research-block .paper-reference p { margin-bottom: .3rem; }
.math-note { margin: 15px 0 35px; padding: 27px 30px; background: var(--wash); }
.math-note h2 { font-size: 25px; margin-top: 0; }
.math-note p { max-width: 850px; }
.math { font-size: 1.05em; }
.math.display { display: block; max-width: 100%; overflow-x: auto; padding: 16px 0; }
math { font-family: 'Cambria Math', 'STIX Two Math', math; }
.split-content { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 70px; }
.split-content h2 { margin-top: 0; }
.side-note { border-top: 3px solid var(--accent); padding: 25px 26px; background: var(--wash); font-size: 15px; }
.side-note h2 { font-size: 25px; }
.side-note p:last-child { margin-bottom: 0; }
.topic-list { padding-left: 21px; margin: 22px 0 32px; }
.topic-list li { padding-left: 6px; margin-bottom: 9px; }
.course { display: grid; grid-template-columns: 175px minmax(0,1fr); gap: 28px; padding: 31px 0; border-top: 1px solid var(--line); }
.course-code { font: 12px/1.7 var(--sans); letter-spacing: 1px; color: var(--accent); padding-top: 3px; }
.course h2 { margin: 0 0 9px; font-size: 27px; }
.course p { margin-bottom: 0; color: var(--muted); }
.cv-row { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 35px; border-top: 1px solid var(--line); padding: 29px 0; }
.cv-row h2 { margin: 3px 0 0; font: 12px/1.5 var(--sans); text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); }
.cv-row h3 { margin-top: 0; }
.cv-row p:last-child { margin-bottom: 0; }
.bottom-callout { display: flex; justify-content: space-between; align-items: center; gap: 35px; border-top: 1px solid var(--line); padding-top: 29px; margin-top: 51px; }
.bottom-callout p { margin: 0; font-size: 15px; color: var(--muted); }
.bottom-callout a { white-space: nowrap; font-size: 14px; }
.site-footer { background: var(--wash); border-top: 1px solid var(--line); }
.footer-shell { width: min(var(--width), calc(100% - 80px)); margin: 0 auto; padding: 29px 0; display: flex; justify-content: space-between; gap: 25px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.footer-shell p { margin: 0; }
.footer-shell strong { color: var(--ink); font-weight: 600; }
.footer-links { text-align: right; }
.footer-links span[aria-hidden] { margin: 0 10px; }
.copyright { font-size: 11px; }
@media (max-width: 1040px) {
  .site-nav { gap: 21px; }
  .nav-shell, .page-shell, .footer-shell { width: calc(100% - 56px); }
  .hero { gap: 40px; grid-template-columns: minmax(0,1fr) 280px; }
  .theme-grid { gap: 24px; }
  .theme h3 { font-size: 21px; }
}
@media (max-width: 820px) {
  .nav-shell { min-height: 90px; flex-wrap: wrap; gap: 0; padding: 18px 0; }
  .site-nav { width: 100%; padding: 22px 0 4px; gap: 8px 24px; }
  .site-nav a { font-size: 15px; }
  .js .menu-toggle { display: block; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: flex; }
  .page-shell { padding-top: 45px; }
  .hero { grid-template-columns: minmax(0,1fr) 255px; gap: 27px; }
  .hero h1 { font-size: 43px; }
  .hero-bio { font-size: 16px; }
  .profile-aside { padding: 24px 20px; }
  .profile-aside .contact-email { font-size: 14px; }
  .theme-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; }
  .split-content { gap: 30px; }
  .section-top { align-items: start; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav-shell, .page-shell, .footer-shell { width: calc(100% - 40px); }
  .wordmark-text { font-size: 22px; }
  .wordmark small { font-size: 8px; letter-spacing: 1.4px; }
  .monogram { width: 40px; height: 40px; font-size: 21px; }
  .wordmark { gap: 11px; }
  .hero { display: block; padding-bottom: 37px; }
  .hero h1 { font-size: clamp(38px, 9vw, 49px); letter-spacing: -.05em; }
  .hero-bio { font-size: 17px; margin-top: 23px; }
  .profile-aside { margin-top: 32px; padding: 25px; }
  .profile-aside h2 { margin-bottom: 17px; }
  .profile-aside .contact-email { font-size: 16px; }
  .profile-aside .contact-address { margin: 15px 0; }
  .theme-grid { gap: 28px 24px; margin-bottom: 43px; }
  .theme h3 { font-size: 22px; }
  .theme p { font-size: 14px; }
  .section-top { display: block; }
  .section-top p { margin-top: 10px; }
  .siam-bibliography { font-size: 16px; }
  .publication-category-links { grid-template-columns: 1fr; }
  .siam-reference { grid-template-columns: 2rem minmax(0, 1fr); column-gap: .6rem; }
  .page-heading { margin-bottom: 34px; }
  .page-subtitle { font-size: 17px; }
  .research-block { grid-template-columns: 1fr; gap: 7px; padding: 26px 0; }
  .research-block h2 { font-size: 27px; }
  .math-note { padding: 23px 20px; }
  .math-note .math { font-size: 14px; }
  .split-content { display: block; }
  .side-note { margin-top: 32px; }
  .course, .cv-row { grid-template-columns: 1fr; gap: 9px; }
  .course h2 { font-size: 25px; }
  .bottom-callout { display: block; }
  .bottom-callout a { display: inline-block; margin-top: 14px; }
  .footer-shell { display: block; padding: 25px 0; }
  .footer-links { text-align: left; margin-top: 18px !important; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { background: white; font-size: 11pt; }
  .site-header, .site-footer, .menu-toggle, .skip-link { display: none !important; }
  .landscape-banner { display: none; }
  .page-shell { width: 100%; padding: 0; }
  a { color: black; text-decoration: none; }
  .course, .cv-row, .research-block { break-inside: avoid; }
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.section-body { min-width: 0; }
h1, h2, h3, h4 { overflow-wrap: break-word; }

.compact-heading { margin-bottom: 28px; }
.academic-intro { max-width: 880px; }
.student-guidance { max-width: 880px; margin-bottom: 2.75rem; }
.publication-intro { color: var(--muted); }
body[data-page='home'] .hero { padding-bottom: 0; }

.equation { max-width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 5px; }
.equation:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* A local interactive globe enhances the native, no-JavaScript SVG views. */
.collaborator-map { border-top: 1px solid var(--line); padding-top: 28px; }
.collaborator-map h2 { margin-top: 0; }
.globe-figure { margin: 24px 0 0; }
.globe-views { position: relative; border: 0; padding: 0; margin: 0; min-width: 0; text-align: center; }
.globe-views legend { display: block; width: 100%; padding: 0; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.globe-choice { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.globe-choice + label { display: inline-block; cursor: pointer; margin: 0 3px 8px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.globe-choice + label:hover { color: var(--accent-dark); border-color: var(--accent); }
.globe-choice:checked + label { color: var(--white); background: var(--accent-dark); border-color: var(--accent-dark); }
.globe-choice:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 4px; }
.globe-stage { width: min(100%, 700px); margin: 0 auto; }
.globe-ready .globe-stage { display: none; }
#interactive-globe { width: min(100%, 700px); margin: 0 auto; }
#world-globe { display: block; width: 100%; max-width: 100%; margin: 0 auto; aspect-ratio: 660 / 550; cursor: grab; touch-action: none; }
#world-globe.is-dragging { cursor: grabbing; }
#world-globe:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.globe-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin: 4px 0 18px; }
.globe-controls p { color: var(--muted); font-size: 13px; margin: 0; }
#globe-reset { cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--accent-dark); font-size: 13px; }
#globe-reset:hover { border-color: var(--accent); }
.globe-panel { display: none; width: 100%; height: auto; }
#globe-americas:checked ~ .globe-stage .globe-panel-americas,
#globe-europe:checked ~ .globe-stage .globe-panel-europe,
#globe-asia:checked ~ .globe-stage .globe-panel-asia { display: block; }
.globe-caption { text-align: center; color: var(--muted); font-size: 14px; }
.globe-caption p { margin-bottom: 7px; }
.map-credit { font-size: 12px; }
@media (max-width: 620px) {
  .globe-choice + label { padding: 7px 10px; margin: 0 1px 8px; font-size: 12px; }
}
@media print {
  .globe-views legend, .globe-choice, .globe-choice + label { display: none; }
  #interactive-globe { display: none; }
  .globe-ready .globe-stage { display: block; }
  .globe-stage { width: 60%; }
  .globe-figure { break-inside: avoid; }
}

/* Puzzle boards are ordinary local HTML and SVG, enhanced by puzzles.js. */
body[data-page='puzzles'] .site-nav a[aria-current='location'] { color: var(--accent-dark); border-color: var(--accent); font-weight: 600; }
.puzzles-page { min-width: 0; }
.puzzles-intro { max-width: 780px; }
.puzzles-intro > p:not(.eyebrow):not(.page-subtitle):not(.puzzle-back) { max-width: 720px; }
.puzzle-back { font-size: 14px; margin-bottom: 2rem; }
.puzzle-jump-links { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 19px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.puzzle-jump-links a { padding: 4px 0; font-weight: 600; }
.puzzle-section { margin-top: 3.25rem; }
.puzzle-section > h2 { margin: 0 0 1.5rem; }
.puzzle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.puzzle-card { min-width: 0; padding: 27px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); font-size: 16px; line-height: 1.65; scroll-margin-top: 24px; }
.puzzle-card.is-solved { border-color: var(--accent); }
.puzzle-card h3 { margin: 0 0 1rem; font-size: 24px; letter-spacing: -.025em; }
.puzzle-card > p, .puzzle-help p { overflow-wrap: anywhere; }
.puzzle-meta { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; margin: 0 0 .65rem; }
.puzzle-card .puzzle-instruction { color: var(--muted); font-size: 14px; line-height: 1.6; margin: .85rem 0 1rem; }
.puzzle-rules { padding-left: 1.25rem; margin: 0 0 1.2rem; }
.puzzle-rules li + li { margin-top: .35rem; }
.puzzle-card button, .puzzle-card input, .puzzle-card select { min-width: 0; max-width: 100%; font: inherit; }
.puzzle-card button { cursor: pointer; touch-action: manipulation; }
.puzzle-card button:disabled { cursor: default; opacity: 1; }
.puzzle-card input:not([type='radio']), .puzzle-card select { color: var(--accent-dark); background: var(--white); border: 1px solid var(--edge); border-radius: 3px; min-height: 44px; padding: 7px 9px; font-size: 16px; }
.puzzle-card select { width: 100%; }
.puzzle-card input:focus-visible, .puzzle-card select:focus-visible, .puzzle-card button:focus-visible, .puzzle-help summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; position: relative; z-index: 2; }
.puzzle-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 1.4rem 0 1rem; }
.puzzle-controls button, .puzzle-move, .puzzle-jug-actions button { padding: 9px 14px; min-height: 44px; border: 1px solid var(--edge); border-radius: 3px; background: var(--white); color: var(--accent-dark); font-size: 14px; font-weight: 600; line-height: 1.5; }
.puzzle-controls button[data-action='check'], .puzzle-move { border-color: var(--accent); background: var(--accent); color: var(--white); }
.puzzle-controls button:hover:not(:disabled), .puzzle-move:hover:not(:disabled), .puzzle-jug-actions button:hover:not(:disabled) { background: var(--wash); color: var(--accent-dark); border-color: var(--accent); }
.puzzle-controls button[data-action='check']:hover:not(:disabled), .puzzle-move:hover:not(:disabled) { background: var(--accent-dark); color: var(--white); }
.puzzle-status { flex-basis: 100%; margin: .35rem 0 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.puzzle-status:empty { display: none; }
.puzzle-status[data-state='success'] { color: var(--accent-dark); }
.puzzle-status[data-state='error'] { color: #92362c; }
.puzzle-help { border-top: 1px solid var(--line); margin-top: .8rem; font-size: 15px; }
.puzzle-help summary { padding: 12px 0; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.puzzle-help summary:hover { color: var(--accent-dark); }
.puzzle-help > p:last-child, .puzzle-help > ol:last-child { margin-bottom: .4rem; }
.puzzle-answer-grid { max-width: 100%; margin: .25rem 0 1rem; padding: 16px; overflow-x: auto; color: var(--accent-dark); background: var(--wash); border-radius: 3px; font: 16px/1.8 ui-monospace, 'SFMono-Regular', Consolas, monospace; }
.puzzle-board { display: grid; grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr)); width: min(100%, 264px); gap: 5px; margin: 1.4rem auto; }
.puzzle-card .puzzle-cell { display: grid; place-items: center; width: 100%; min-width: 0; aspect-ratio: 1; padding: 0; border: 1px solid var(--edge); border-radius: 3px; color: var(--accent-dark); background: var(--wash); font-size: 20px; font-weight: 600; line-height: 1; }
.puzzle-card .puzzle-cell:hover:not(:disabled) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.puzzle-card .puzzle-cell.is-active { background: var(--accent); border-color: var(--accent); color: var(--white); }
.puzzle-card .puzzle-cell.is-blocked { border-style: dashed; background: #e4e7eb; color: var(--muted); }
.puzzle-seats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, 264px); margin: 1.4rem auto; }
.puzzle-card .puzzle-number-input { display: block; width: 100%; padding: 0; height: 52px; text-align: center; font-size: 22px; line-height: 1; }
.puzzle-clue { display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.4; text-align: center; }
.puzzle-count-grid { display: grid; grid-template-columns: .65fr repeat(5, minmax(0, 1fr)); gap: 4px; width: min(100%, 320px); margin: 1.4rem auto; }
.puzzle-count-grid > .puzzle-clue { min-height: 24px; }
.puzzle-triangle { position: relative; width: min(100%, 320px); aspect-ratio: 300 / 220; margin: 1.5rem auto; }
.puzzle-triangle svg, .puzzle-house svg { display: block; width: 100%; height: 100%; overflow: visible; }
.puzzle-triangle path { fill: none; stroke: var(--edge); stroke-width: 2; }
.triangle-slot { position: absolute; left: var(--x); top: var(--y); width: 44px; transform: translate(-50%, -50%); }
.puzzle-card .triangle-slot .puzzle-number-input { height: 44px; border-radius: 50%; }
.puzzle-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; margin: 1.3rem 0; }
.puzzle-fields label, .puzzle-answer-field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.puzzle-answer-field { max-width: 270px; margin: 1.1rem 0; }
.puzzle-answer-field input { width: 100%; }
.puzzle-sudoku { width: min(100%, 260px); margin: 1.4rem auto; table-layout: fixed; border-collapse: collapse; border: 3px solid var(--accent-dark); }
.puzzle-sudoku caption { padding: 0 0 10px; color: var(--muted); font-size: 13px; }
.puzzle-sudoku td { width: 25%; height: 58px; padding: 0; border: 1px solid var(--edge); text-align: center; vertical-align: middle; }
.puzzle-sudoku td:nth-child(2) { border-right: 3px solid var(--accent-dark); }
.puzzle-sudoku tr:nth-child(2) td { border-bottom: 3px solid var(--accent-dark); }
.puzzle-sudoku [data-given] { display: grid; place-items: center; height: 100%; min-height: 56px; background: var(--wash); color: var(--ink); font-size: 22px; font-weight: 600; }
.puzzle-card .puzzle-sudoku .puzzle-number-input { height: 56px; border: 0; border-radius: 0; background: var(--white); }
.puzzle-card .puzzle-sudoku input:focus-visible { outline-offset: -4px; }
.puzzle-bowls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: min(100%, 320px); margin: 1.4rem auto; }
.puzzle-bowls p { margin: 0; padding: 7px 4px 13px; border: 2px solid var(--edge); border-top: 0; border-radius: 0 0 30px 30px; text-align: center; color: var(--muted); font-size: 13px; }
.puzzle-bowls strong { display: block; color: var(--accent-dark); font-size: 27px; }
.puzzle-jugs { display: flex; justify-content: center; align-items: end; gap: 35px; margin: 1.4rem 0; }
.puzzle-jugs > div { width: min(38%, 110px); text-align: center; }
.puzzle-jugs p { margin: .5rem 0 0; color: var(--muted); font-size: 13px; }
.puzzle-jug { position: relative; display: grid; place-items: center; height: calc(50px + var(--capacity) * 20px); overflow: hidden; border: 2px solid var(--accent); border-top: 0; border-radius: 0 0 12px 12px; background: var(--wash); }
.jug-water { position: absolute; bottom: 0; left: 0; width: 100%; background: #c4d9e7; }
.puzzle-jug > span { position: relative; color: var(--accent-dark); font-size: 23px; font-weight: 600; }
.puzzle-jug-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.puzzle-jug-actions button { padding: 9px 6px; }
.puzzle-route-map { display: block; width: min(100%, 330px); height: auto; margin: 1.4rem auto; overflow: visible; }
.puzzle-route-map path { fill: none; stroke: var(--edge); stroke-width: 3; }
.puzzle-route-map circle { fill: var(--accent); }
.puzzle-route-map .map-blocked { fill: var(--wash); stroke: var(--accent-dark); stroke-width: 2; }
.puzzle-route-map text { fill: var(--accent-dark); font: 16px var(--sans); font-weight: 600; }
.puzzle-house { position: relative; width: min(100%, 280px); aspect-ratio: 240 / 220; margin: 1.4rem auto; }
.puzzle-house path { fill: none; stroke: var(--edge); stroke-width: 3; }
.puzzle-house path.is-used { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 6 3; }
.puzzle-house button { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-dark); background: var(--white); font-weight: 600; }
.puzzle-house button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--accent); }
.puzzle-house button.is-current { background: var(--accent); color: var(--white); }
.puzzle-card .puzzle-house button:focus-visible { position: absolute; }
.puzzle-route-readout, .puzzle-sequence { padding: 10px 13px; border-left: 2px solid var(--edge); background: var(--wash); color: var(--accent-dark); font-size: 14px; overflow-wrap: anywhere; }
.puzzle-sticks { position: relative; width: min(100%, 280px); aspect-ratio: 1; margin: 1.4rem auto; }
.stick-dot { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--accent-dark); z-index: 1; pointer-events: none; }
.puzzle-sticks button { position: absolute; left: var(--x); top: var(--y); padding: 0; border: 0; border-radius: 3px; background: transparent; }
.puzzle-sticks .stick-horizontal { width: 42%; height: 30px; transform: translateY(-50%); }
.puzzle-sticks .stick-vertical { width: 30px; height: 42%; transform: translateX(-50%); }
.puzzle-sticks button::before { content: ''; position: absolute; display: block; border: 3px solid var(--accent); border-radius: 3px; }
.puzzle-sticks .stick-horizontal::before { left: 5px; right: 5px; top: 12px; }
.puzzle-sticks .stick-vertical::before { top: 5px; bottom: 5px; left: 12px; }
.puzzle-sticks button:hover:not(:disabled) { background: var(--wash); }
.puzzle-sticks button.is-removed::before { opacity: .45; border-style: dashed; }
.puzzle-card .puzzle-sticks button:focus-visible { position: absolute; }
.puzzle-pebbles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 10px; margin: 1.4rem 0; }
.puzzle-pebbles label { display: grid; gap: 7px; justify-items: center; min-width: 0; }
.pebble-number { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--edge); border-radius: 48% 52% 46% 54%; background: var(--wash); color: var(--accent-dark); font-weight: 600; }
.puzzle-card .puzzle-pebbles select { padding: 7px 4px; font-size: 14px; }
.puzzle-weighings { margin: .8rem 0 1rem; padding-left: 1.25rem; font-size: 14px; overflow-wrap: anywhere; }
.puzzle-weighings:empty { display: none; }
.puzzle-weighings li + li { margin-top: .4rem; }
.puzzle-arrows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 1.4rem 0; }
.puzzle-arrows button { height: 48px; padding: 0; border: 1px solid var(--edge); border-radius: 3px; color: var(--accent-dark); background: var(--wash); font-size: 20px; line-height: 1; }
.puzzle-arrows button:hover:not(:disabled) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.puzzle-checkerboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 256px); margin: 1.4rem auto; border: 1px solid var(--edge); }
.puzzle-checkerboard span { display: grid; place-items: center; aspect-ratio: 1; }
.puzzle-checkerboard .light { background: var(--wash); }
.puzzle-checkerboard .dark { background: var(--accent); }
.puzzle-checkerboard .missing { border: 1px dashed var(--edge); color: var(--muted); background: var(--white); font-size: 25px; }
.puzzle-choice { display: flex; flex-wrap: wrap; gap: 10px 26px; min-width: 0; margin: 1.2rem 0; padding: 0; border: 0; }
.puzzle-choice legend { margin-bottom: 7px; color: var(--muted); font-size: 14px; }
.puzzle-choice label { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; }
.puzzle-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.puzzle-end { margin: 3rem 0 0; }
.puzzle-pagination { align-items: center; }
.puzzle-pagination span[aria-current='page'] { padding: 4px 0; color: var(--ink); font-weight: 600; }
.puzzle-pagination + .puzzle-jump-links { border-top: 0; }
.puzzle-end + .puzzle-pagination { margin-top: 1.5rem; }

/* The encrypted page shell and the local, dependency-free export utility. */
body[data-page='puzzles-locked'] .site-nav a[aria-current='location'] { color: var(--accent-dark); border-color: var(--accent); font-weight: 600; }
.puzzle-lock-panel { max-width: 620px; padding: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--wash); margin-bottom: 1.75rem; }
.puzzle-lock-panel h2 { margin: 0 0 1.25rem; font-size: 1.55rem; }
.puzzle-lock-form { display: grid; gap: 10px; max-width: 540px; }
.puzzle-lock-form label { font-size: 15px; font-weight: 600; }
.puzzle-lock-form input { width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--edge); border-radius: 3px; padding: 10px 12px; min-height: 46px; background: var(--white); color: var(--ink); font: 16px/1.5 var(--sans); }
.puzzle-lock-form input[aria-invalid='true'] { border-color: #92362c; }
.puzzle-lock-form button, .puzzle-lock-panel button { justify-self: start; max-width: 100%; min-height: 44px; margin-top: 6px; padding: 9px 16px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: var(--white); font: 600 14px/1.5 var(--sans); cursor: pointer; }
.puzzle-lock-form button:hover:not(:disabled), .puzzle-lock-panel button:hover:not(:disabled) { background: var(--accent-dark); }
.puzzle-lock-form button:disabled, .puzzle-lock-panel button:disabled { opacity: .7; cursor: wait; }
.puzzle-lock-status { max-width: 620px; margin: 1rem 0; font-size: 15px; overflow-wrap: anywhere; }
.puzzle-lock-status:empty { display: none; }
.puzzle-lock-notice { font-size: 15px; margin: 1rem 0 0; }
.puzzle-lock-help { font-size: 14px; color: var(--muted); margin: 0 0 1rem; }
.puzzle-lock-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1rem; }
.puzzle-lock-actions button { background: var(--white); color: var(--accent-dark); }
.puzzle-lock-actions button:hover:not(:disabled) { background: var(--wash); }
.puzzle-lock-back { margin-top: 1.75rem; font-size: 14px; }
.puzzle-lock-tool { margin: 2rem 0; max-width: 620px; }
.puzzle-lock-tool input[type='file'] { font-size: 14px; }
.puzzle-lock-tool input[type='file']::file-selector-button { font: inherit; margin-right: 8px; padding: 5px; }
@media (max-width: 380px) { .puzzle-lock-panel { padding: 18px; } }
@media (max-width: 1000px) {
  .puzzle-grid { grid-template-columns: minmax(0, 1fr); }
  .puzzle-card { padding: 28px; }
}
@media (max-width: 620px) {
  .puzzle-card { padding: 20px; }
  .puzzle-card h3 { font-size: 23px; }
  .puzzle-section { margin-top: 2.5rem; }
  .puzzle-jump-links { gap: 7px 20px; }
  .puzzle-grid { gap: 20px; }
}
@media (max-width: 380px) {
  .puzzle-card { padding: 15px; }
  .puzzle-card h3 { font-size: 22px; }
  .puzzle-pebbles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .puzzle-arrows button { font-size: 17px; }
  .puzzle-answer-grid { padding: 12px; font-size: 14px; }
}
@media print {
  .puzzle-grid { display: block; }
  .puzzle-section { margin-top: 1.5rem; }
  .puzzle-card { margin-bottom: 1rem; padding: 16px; break-inside: avoid; font-size: 11pt; }
  .puzzle-card h3 { font-size: 15pt; }
  .puzzle-board, .puzzle-seats, .puzzle-sudoku, .puzzle-checkerboard { max-width: 210px; }
  .puzzle-triangle, .puzzle-house, .puzzle-sticks { max-width: 240px; }
  .puzzle-card, .puzzle-checkerboard, .puzzle-cell, .puzzle-jug { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
