/* The Python guide: a notebook whose every output is made of people. Prize colors are one categorical set, checked for
   color-vision deficiencies in the order they stack (Physics, Chemistry, Medicine, Literature, Peace, Economics). */
.pg-python-guide { --p0: #2a78d6; --p1: #eb6834; --p2: #1baf7a; --p3: #eda100; --p4: #e87ba4; --p5: #008300; --n-ink: #1c3145; --n-soft: #51677a; --n-line: #dfe7ee; }
.pg-python-guide .p0 { --c: var(--p0); } .pg-python-guide .p1 { --c: var(--p1); } .pg-python-guide .p2 { --c: var(--p2); }
.pg-python-guide .p3 { --c: var(--p3); } .pg-python-guide .p4 { --c: var(--p4); } .pg-python-guide .p5 { --c: var(--p5); }
.pg-python-guide i[class^="p"], .pg-n-org { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.pg-python-guide i.pg-n-org { border-radius: 50%; background: #7d8fa0; }

.pg-notebook { position: relative; border: 1px solid #cfdbe6; border-radius: 12px; background: #fff; overflow: visible; }
.pg-notebook-title { display: flex; justify-content: space-between; gap: 10px; padding: 12px 26px; background: #eaf0f6; border-radius: 12px 12px 0 0; color: #3f5970; font: .78rem ui-monospace, monospace; }
.pg-notebook-cell { padding: 26px 30px 30px; border-top: 1px solid var(--n-line); }
.pg-notebook-cell h2 { font: .8rem ui-monospace, monospace; color: #496d87; margin: 0 0 12px; letter-spacing: 0; }
.pg-notebook-cell h2 span { font: 600 1.15rem var(--font-body, sans-serif); color: var(--n-ink); padding-left: 14px; }
.pg-notebook-cell pre { max-width: 800px; border: 0; background: #f4f7fa; border-left: 3px solid #c3d3df; margin: 0; padding: 14px 16px; font-size: .78rem; line-height: 1.55; overflow-x: auto; }
@media (min-width: 768px) { .pg-notebook-cell pre code { white-space: pre; } }
.pg-notebook-output { padding-top: 16px; min-width: 0; }
.pg-notebook-output > span, .pg-n-out-label { display: block; font: .75rem ui-monospace, monospace; color: #5b7284; margin-bottom: 12px; }
.pg-n-out-label { margin-top: 16px; }
.pg-notebook-output .project-caption { max-width: 760px; }

/* Out [1]: the counts, and the wall. */
.pg-n-stats { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.pg-n-stats div { display: flex; flex-direction: column-reverse; }
.pg-n-stats dt { font-size: .74rem; color: var(--n-soft); }
.pg-n-stats dd { margin: 0; font-size: 1.9rem; font-weight: 600; line-height: 1.15; color: var(--n-ink); font-variant-numeric: tabular-nums; }
.pg-n-note { margin: 12px 0 0; font-size: .8rem; line-height: 1.55; color: var(--n-soft); }
.pg-n-wall-title { margin: 0 0 10px; font-size: 1rem; line-height: 1.4; color: var(--n-ink); }
.pg-n-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: .8rem; }
.pg-n-find label { flex-basis: 100%; margin-bottom: -2px; }
.pg-n-find label { color: var(--n-soft); }
.pg-n-find input { width: 170px; min-height: 36px; padding: 6px 10px; border: 1px solid #b9c8d6; border-radius: 6px; font: inherit; color: var(--n-ink); background: #fff; }
.pg-n-find button, .pg-n-filter button { min-height: 36px; padding: 6px 12px; border: 1px solid #b9c8d6; border-radius: 6px; background: #fff; color: var(--n-ink); font: inherit; cursor: pointer; }
.pg-n-find button:hover, .pg-n-filter button:hover { background: #edf3f8; }
.pg-n-find-status { margin: 8px 0 0; font-size: .8rem; color: #8a3b12; }
.pg-n-find-status:empty { display: none; }
.pg-n-filter { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; font-size: .72rem; }
.pg-n-filter button { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 9px; border-radius: 14px; }
.pg-n-filter b { font-weight: 600; color: var(--n-soft); font-variant-numeric: tabular-nums; }
.pg-n-filter button[aria-pressed="true"] { background: var(--n-ink); border-color: var(--n-ink); color: #fff; }
.pg-n-filter button[aria-pressed="true"] b { color: #d5dfe8; }

.pg-n-wall { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 0 7px; align-items: end; }
.pg-n-decade { display: flex; flex-direction: column; min-width: 0; }
/* Five squares to a row, filled from the bottom: the grid is flipped, and a square looks the same either way up. */
.pg-n-stack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5px; transform: scaleY(-1); padding-top: 4px; border-top: 1px solid #9fb1c0; }
.pg-n-decade-label { padding-top: 6px; font-size: .68rem; color: var(--n-soft); text-align: center; white-space: nowrap; }
.pg-n-decade-label b { display: block; font-weight: 600; color: var(--n-ink); font-variant-numeric: tabular-nums; }
.pg-n-stack button, .pg-n-age button, .pg-n-track button { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 2px; background: var(--c); cursor: pointer; }
.pg-n-stack button.o, .pg-n-age button, .pg-n-track button { border-radius: 50%; }
.pg-n-stack button:hover, .pg-n-stack button:focus-visible, .pg-n-age button:hover, .pg-n-age button:focus-visible,
.pg-n-track button:hover, .pg-n-track button:focus-visible { box-shadow: inset 0 0 0 2px var(--n-ink); outline: none; }
.pg-notebook button[aria-expanded="true"]:is(.p0, .p1, .p2, .p3, .p4, .p5) { box-shadow: inset 0 0 0 2px var(--n-ink), 0 0 0 2px #fff, 0 0 0 4px var(--n-ink); position: relative; z-index: 2; }
.pg-n-wall[data-show="p0"] button:not(.p0), .pg-n-wall[data-show="p1"] button:not(.p1), .pg-n-wall[data-show="p2"] button:not(.p2),
.pg-n-wall[data-show="p3"] button:not(.p3), .pg-n-wall[data-show="p4"] button:not(.p4), .pg-n-wall[data-show="p5"] button:not(.p5),
.pg-n-wall[data-show="w"] button:not(.w), .pg-n-wall[data-show="o"] button:not(.o) { opacity: .14; }

/* Out [2]: the share of each prize. */
.pg-nobel-share { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 380px); gap: 40px; align-items: center; }
.pg-nobel-donut { width: 100%; }
.pg-nobel-donut path { fill: var(--c); cursor: pointer; stroke: #fff; stroke-width: 2; }
.pg-nobel-donut path:hover { filter: brightness(.9); }
.pg-nobel-donut path:focus-visible { outline: none; stroke: var(--n-ink); stroke-width: 4; }
.pg-nobel-donut text { font-size: 30px; font-weight: 600; fill: var(--n-ink); pointer-events: none; }
.pg-nobel-donut .pg-donut-unit { font-size: 12px; font-weight: 400; fill: var(--n-soft); }
.pg-nobel-share-labels { display: grid; }
.pg-nobel-share-labels button { display: flex; justify-content: space-between; align-items: center; gap: 15px; min-height: 44px; border: 0; border-bottom: 1px solid var(--n-line); background: transparent; color: var(--n-ink); text-align: left; font-size: .86rem; cursor: pointer; padding: 8px 6px; }
.pg-nobel-share-labels button span { display: flex; align-items: center; gap: 9px; }
.pg-nobel-share-labels button strong { font-variant-numeric: tabular-nums; }
.pg-nobel-share-labels button:hover { background: #edf3f7; }

/* Out [3]: honored more than once. */
.pg-n-repeat { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pg-n-repeat button { display: flex; flex-direction: column; gap: 5px; min-height: 44px; padding: 14px 16px; border: 1px solid #cfdbe6; border-radius: 9px; background: #fff; color: var(--n-ink); font: inherit; text-align: left; cursor: pointer; }
.pg-n-repeat button:hover { background: #f4f8fb; border-color: #8da6bb; }
.pg-n-repeat strong { font-size: .95rem; line-height: 1.35; margin-bottom: 2px; }
.pg-n-repeat span { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--n-soft); }

/* Out [4]: ages. One dot for each prize to a person. */
.pg-n-lede { max-width: 760px; margin: 0 0 18px; font-size: 1rem; line-height: 1.6; color: var(--n-ink); }
.pg-n-name { padding: 0; border: 0; border-bottom: 2px solid #9db9d6; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.pg-n-name:hover { border-bottom-color: var(--n-ink); }
.pg-n-scroll { max-width: 800px; }
.pg-notebook-cell:not(.pg-n-hero) > .pg-notebook-output > span { margin-top: 2px; }
.pg-n-ages { display: grid; grid-template-columns: repeat(var(--ages), minmax(0, 1fr)); gap: 0 1px; align-items: end; padding-bottom: 3px; border-bottom: 1px solid #9fb1c0; }
.pg-n-age { display: flex; flex-direction: column-reverse; gap: 1px; min-width: 0; }
.pg-n-age-axis { display: grid; grid-template-columns: repeat(var(--ages), minmax(0, 1fr)); gap: 0 1px; padding-top: 5px; font-size: .7rem; color: var(--n-soft); }
.pg-n-age-axis span { grid-row: 1; justify-self: center; white-space: nowrap; }
.pg-n-medians { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 4px; font-size: .8rem; color: var(--n-soft); }
.pg-n-medians span { display: inline-flex; align-items: center; gap: 6px; }
.pg-n-medians b { color: var(--n-ink); font-variant-numeric: tabular-nums; }
.pg-n-swipe { display: none; margin: 6px 0 0; font-size: .74rem; color: var(--n-soft); }

/* Out [5]: the women, one lane for each prize. */
.pg-n-lanes { display: grid; gap: 0; }
.pg-n-lane { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; }
.pg-n-lane-name { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--n-ink); }
.pg-n-lane-name b { color: var(--n-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.pg-n-track { position: relative; height: 40px; margin: 0 8px; border-bottom: 1px solid var(--n-line); }
.pg-n-track button { position: absolute; top: 20px; width: 13px; margin-left: -6.5px; }
.pg-n-track button.pg-n-second { top: 5px; }
.pg-n-lane-axis .pg-n-track { height: 22px; border-bottom: 0; }
.pg-n-lane-axis .pg-n-track span { position: absolute; top: 5px; transform: translateX(-50%); font-size: .7rem; color: var(--n-soft); }

/* Out [6]: birthplaces. */
.pg-n-map-scroll { max-width: none; }
.pg-n-map { display: block; width: 100%; height: auto; background: #eef3f8; border-radius: 10px; }
.pg-n-land { fill: #dbe3ec; }
.pg-n-map circle { fill: var(--p0); fill-opacity: .5; stroke: #fff; stroke-width: .5; cursor: pointer; }
.pg-n-map circle:hover, .pg-n-map circle:focus-visible { fill-opacity: .95; stroke: var(--n-ink); stroke-width: 1; outline: none; }
.pg-n-map circle[aria-expanded="true"] { fill: var(--n-ink); fill-opacity: 1; stroke: #fff; stroke-width: 1.2; }
.pg-n-born { width: 100%; max-width: 760px; margin-top: 26px; border-collapse: collapse; font-size: .84rem; color: var(--n-ink); }
.pg-n-born caption { text-align: left; font-weight: 600; font-size: .95rem; padding-bottom: 8px; }
.pg-n-born th, .pg-n-born td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--n-line); text-align: left; font-weight: 400; }
.pg-n-born thead th { font-size: .72rem; color: var(--n-soft); vertical-align: bottom; }
.pg-n-born td:nth-child(2), .pg-n-born td:nth-child(4), .pg-n-born thead th:nth-child(2), .pg-n-born thead th:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.pg-n-born td:nth-child(4), .pg-n-born thead th:nth-child(4) { padding-right: 0; width: 110px; }
.pg-n-bar { width: 46%; }
.pg-n-bar span { display: block; height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; background: #b9cfe8; overflow: hidden; }
.pg-n-bar i { display: block; height: 100%; background: var(--p0); border-radius: 0; }

/* The card that introduces a laureate, or lists a birthplace. */
.pg-n-card { width: 400px; }
.pg-n-card h3 { margin-bottom: 4px; }
.pg-n-card .pg-n-prize { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .84rem; font-weight: 600; color: var(--n-ink); }
.pg-n-card blockquote { margin: 0 0 12px; padding: 2px 0 2px 14px; border-left: 3px solid var(--c, #c3d3df); font-size: .95rem; line-height: 1.55; color: var(--n-ink); }
.pg-n-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px; margin: 0 0 12px; font-size: .82rem; line-height: 1.5; }
.pg-n-card dt { color: var(--n-soft); }
.pg-n-card dd { margin: 0; color: var(--n-ink); }
.pg-n-card .pg-n-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: .82rem; }
.pg-n-card .pg-n-people { display: grid; gap: 0; max-height: 300px; overflow-y: auto; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--n-line); }
.pg-n-card .pg-n-people button { display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--n-line); background: transparent; color: var(--n-ink); font: inherit; font-size: .84rem; text-align: left; cursor: pointer; }
.pg-n-card .pg-n-people button:hover { background: #edf3f8; }
.pg-n-card .pg-n-people span { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--n-soft); font-size: .76rem; }
.pg-n-card .pg-n-also { padding: 0; border: 0; border-bottom: 2px solid #9db9d6; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.pg-n-card .pg-n-also:hover { border-bottom-color: var(--n-ink); }

/* Below the notebook. */
.pg-python-guide .pg-n-actions { margin: 18px 0 14px; }
.pg-python-guide .pg-n-source { margin-bottom: 44px; }
.pg-python-guide .pg-guide-build > h2:not(:first-of-type) { margin-top: 8px; }
.pg-n-ideas { max-width: 820px; margin: 0 0 44px; padding-left: 20px; color: var(--ink-soft); font-size: .94rem; }
.pg-n-ideas li { margin-bottom: 10px; }
.pg-n-ideas strong { color: var(--n-ink); }
.pg-python-guide .project-steps { margin-bottom: 48px; }
.pg-python-guide .project-detail { margin-top: 0; }
.pg-python-guide .project-detail p { max-width: 860px; }

@media (max-width: 767px) {
    .pg-python-guide .pg-header { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 16px; padding: 20px 0 16px; }
    .pg-python-guide .pg-header-art { width: 64px; grid-row: 1 / 3; }
    .pg-python-guide .pg-header-copy { display: contents; }
    .pg-python-guide .pg-header .eyebrow, .pg-python-guide .pg-header h1 { grid-column: 2; margin: 0; }
    .pg-python-guide .pg-header h1 { font-size: 1.8rem; }
    .pg-python-guide .pg-header .eyebrow { font-size: .62rem; }
    .pg-python-guide .pg-header .lead, .pg-python-guide .pg-header .project-actions { grid-column: 1 / -1; }
    .pg-python-guide .pg-header .lead { font-size: .9rem; margin-top: 8px; }
    .pg-python-guide .pg-header .project-actions { margin-top: 8px; flex-direction: row; flex-wrap: nowrap; gap: 12px; font-size: .8rem; align-items: center; }
    .pg-python-guide .pg-header .project-actions .btn { font-size: .8rem; padding: 10px 14px; }
    .pg-notebook-title { padding: 10px 12px; flex-wrap: wrap; font-size: .68rem; }
    .pg-notebook-cell { padding: 18px 12px 22px; }
    .pg-notebook-cell h2 span { padding: 0 0 0 8px; font-size: 1rem; }
    .pg-notebook-cell pre { padding: 12px; font-size: .68rem; line-height: 1.5; }
    .pg-n-stats dd { font-size: 1.5rem; }
    .pg-n-find input { flex: 1; min-width: 0; min-height: 44px; }
    .pg-n-find button { min-height: 44px; }
    .pg-n-filter button { min-height: 40px; }
    /* On a phone each decade is a row of squares large enough to tap. */
    .pg-n-wall { display: block; }
    .pg-n-decade { flex-direction: column-reverse; margin-bottom: 9px; }
    .pg-n-stack { grid-template-columns: repeat(auto-fill, 13px); gap: 2px; transform: none; padding-top: 4px; border-top: 0; }
    .pg-n-decade-label { padding: 0; text-align: left; font-size: .76rem; }
    .pg-n-decade-label b { display: inline; margin-left: 6px; }
    .pg-nobel-share { grid-template-columns: 1fr; gap: 10px; }
    .pg-nobel-donut { max-width: 250px; margin: auto; }
    .pg-n-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .pg-n-ages, .pg-n-age-axis { min-width: 890px; }
    .pg-n-lanes { min-width: 760px; }
    .pg-n-lane { grid-template-columns: 110px minmax(0, 1fr); }
    .pg-n-track button { width: 16px; margin-left: -8px; }
    .pg-n-map { min-width: 760px; }
    .pg-n-swipe { display: block; }
    .pg-n-born { font-size: .78rem; }
    .pg-n-bar { width: 30%; }
    .pg-n-born td:nth-child(4), .pg-n-born thead th:nth-child(4) { width: 84px; }
    .pg-n-card { width: 100%; }
}
@media (min-width: 1024px) {
    .pg-python-guide .pg-header { grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; padding: 14px 0 8px; }
    .pg-python-guide .pg-header-art { padding: 10px 6px; }
    .pg-python-guide .pg-header .eyebrow { margin-bottom: 7px; }
    .pg-python-guide .pg-header h1 { margin-bottom: 8px; }
    /* The wall and its legend stay on the first screen. */
    .pg-python-guide .site-breadcrumb { margin-bottom: 14px; }
    .pg-python-guide .pg-header .lead { font-size: .95rem; max-width: none; }
    .pg-python-guide .pg-header .project-actions { margin-top: 12px; }
    .pg-python-guide .pg-header .project-actions .btn { min-height: 40px; padding: 8px 16px; }
    .pg-notebook-title { padding: 8px 20px; }
    /* The first cell puts its code beside the wall; the others read top to bottom, as a notebook does. */
    .pg-n-hero { display: grid; grid-template-columns: 424px minmax(0, 1fr); gap: 0 28px; padding: 8px 20px 18px; align-items: start; }
    /* Tight enough that the decade labels stay on an 800 px screen when the promotion strip is showing above the header. */
    .pg-n-hero .pg-n-filter { margin-bottom: 8px; }
    .pg-n-hero .pg-notebook-code > pre { padding: 10px 12px; font-size: .655rem; line-height: 1.5; }
    .pg-n-hero .pg-notebook-code h2 { margin-bottom: 8px; }
    .pg-n-hero .pg-notebook-output { padding-top: 0; }
    .pg-n-hero .pg-n-wall-title { font-size: .92rem; margin-bottom: 8px; }
    .pg-n-hero .project-caption { margin-bottom: 0; }
}
