/* Unbundling Labor — web companion
   Palette and type follow the PDF: Palatino, dark-blue headings,
   medium-blue links, light-grey shaded theorem boxes with sharp corners. */

:root {
  --ink: #1b1b1b;
  --muted: #5c5c5c;
  --darkblue: #003366;
  --mediumblue: #336699;
  --darkgreen: #007800;
  --shade: #f5f5f5;
  --rule: #646464;
  --hairline: #d5d5d5;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L",
           "TeX Gyre Pagella", "Palatino LT STD", Georgia, serif;
  --measure: 40rem;
  --toc-width: 19.5rem;
}

html {
  font-family: var(--serif);
  font-size: 106.25%;                 /* 17px */
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

*, *::before, *::after { box-sizing: border-box; }

a { color: var(--mediumblue); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible { outline: 2px solid var(--mediumblue); outline-offset: 2px; }

/* ---------------------------------------------------------------- layout */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 1rem 4rem;
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
}

main { min-width: 0; }

@media (min-width: 66rem) {
  .page {
    grid-template-columns: var(--toc-width) minmax(0, var(--measure));
    column-gap: 3rem;
    max-width: calc(var(--toc-width) + 3rem + var(--measure) + 2rem);
  }
  .toc {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    padding: 2.5rem 1rem 2rem 0;
    font-size: 0.8rem;
    line-height: 1.3;
  }
  .toc summary { pointer-events: none; list-style: none; }
  .toc summary::-webkit-details-marker { display: none; }
}

/* ---------------------------------------------------------------- banner */

#version-banner {
  background: #fff6d6;
  border-bottom: 1px solid #e3cf86;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.9rem;
}
#version-banner[hidden] { display: none; }

/* ---------------------------------------------------------------- header */

.paper-header { margin: 2.5rem 0 3rem; }
.toc .site-link { font-size: 0.8rem; margin: 0 0 1rem; }
.toc .site-link a { color: var(--muted); }
.toc .site-link a:hover { color: var(--mediumblue); }
@media (max-width: 66rem) { .toc .site-link { display: none; } }

.paper-header .title {
  font-variant: small-caps;
  font-weight: normal;
  letter-spacing: 0.02em;
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 1.2rem;
  color: var(--ink);
}

.paper-header .authors { font-size: 1.25rem; margin: 0 0 0.3rem; }
.paper-header .author + .author::before { content: ", "; }
.paper-header .author + .author:last-child::before { content: " and "; color: var(--muted); }
.paper-header .date { color: var(--muted); margin: 0 0 1.2rem; }

.published { font-size: 1rem; color: var(--muted); margin: 0 0 1.2rem; }
.formats { font-size: 0.9rem; margin: 0 0 2rem; }
.authornotes { font-size: 0.85rem; color: var(--muted); margin: 1rem 0 0; }
.authornotes p { margin: 0 0 0.5rem; }
.appendix-start.online-appendix-start::after { content: "Supplementary Online Appendix"; }
.formats a + a::before { content: "·"; color: var(--muted); margin: 0 0.6em; }

.abstract {
  font-size: 0.95rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 1rem 0 0.4rem;
}
.abstract h2 {
  font-variant: small-caps;
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.abstract p { margin: 0 0 0.8rem; }

/* ---------------------------------------------------------------- text */

article p { margin: 0 0 1em; }
article p + p { text-indent: 0; }

h1, h2, h3, h4 { font-weight: normal; line-height: 1.2; color: var(--darkblue); }

article h1 {                       /* \section */
  font-size: 1.6rem;
  font-weight: bold;
  margin: 3rem 0 1rem;
}
article h2 {                       /* \subsection */
  font-size: 1.25rem;
  font-style: italic;
  margin: 2.2rem 0 0.8rem;
}
article h3 {                       /* \subsubsection */
  font-size: 1.05rem;
  font-style: italic;
  margin: 1.8rem 0 0.6rem;
}
.secnum { display: inline-block; min-width: 1.6em; }
article h2 .secnum, article h3 .secnum { min-width: 2.6em; }
article h3 .secnum { min-width: 3.4em; }
h1.unnumbered, h3.unnumbered { margin-top: 2.2rem; }

.runin { font-weight: bold; color: var(--darkblue); }

.appendix-start {
  margin: 4rem 0 0;
  border-top: 2px solid var(--darkblue);
}
.appendix-start::after {
  content: "Appendix";
  display: block;
  font-variant: small-caps;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: var(--darkblue);
  padding-top: 1.2rem;
}

em em { font-style: normal; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }

ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.35em; }

/* ---------------------------------------------------------------- math */

.math.display { display: block; margin: 0.6em 0; }
mjx-container[display="true"] { margin: 0.4em 0 !important; }
.eqn { display: block; }
.eqn:target mjx-container, .eqn-anchor:target + .eqn mjx-container { background: #fff6d6; }

/* ---------------------------------------------------------------- theorem-like boxes */

.thm {
  background: var(--shade);
  border: 0.5px solid var(--rule);
  padding: 0.6rem 0.8rem;
  margin: 1.2rem 0;
}
.thm > :last-child { margin-bottom: 0; }
.thm-head { font-weight: bold; color: var(--darkblue); }
.symmetry .thm-head, .dpp .thm-head, .ipp .thm-head { font-variant: small-caps; letter-spacing: 0.03em; }
.thm:target { outline: 2px solid var(--mediumblue); }

.proof { margin: 1rem 0 1.5rem; }
.proof > p:first-child > em:first-child { color: var(--darkblue); }

/* ---------------------------------------------------------------- figures */

figure.paper-figure {
  display: flex;
  flex-direction: column;
  margin: 2rem 0 2.2rem;
  padding: 0;
}
figure.paper-figure figcaption {
  order: -1;
  text-align: center;
  color: var(--darkblue);
  margin: 0 0 0.6rem;
}
figure.paper-figure figcaption p { margin: 0; }
.caplabel strong { font-weight: bold; }
.figure-body img { width: 100%; height: auto; display: block; }
.figure-body img[hidden] { display: none; }
.figure-body svg { width: 100%; height: auto; display: block; }
.figure-body.interactive { position: relative; }

.notes {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 0.7rem;
  text-align: left;
}
.notes p { margin: 0 0 0.5em; }

figure:target figcaption, .paper-table:target caption { background: #fff6d6; }

/* ---------------------------------------------------------------- tables */

.paper-table { margin: 2rem 0 2.2rem; overflow-x: auto; }
.paper-table table {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 0.92rem;
  border-top: 1.2px solid var(--ink);
  border-bottom: 1.2px solid var(--ink);
  font-variant-numeric: tabular-nums;
}
.paper-table caption {
  caption-side: top;
  color: var(--darkblue);
  padding: 0 0 0.6rem;
  text-align: center;
}
.paper-table thead { border-bottom: 0.6px solid var(--ink); }
.paper-table th, .paper-table td { padding: 0.1rem 0.7rem; vertical-align: baseline; line-height: 1.35; }
.paper-table th { font-weight: normal; }
.paper-table tbody tr:first-child td { padding-top: 0.45rem; }
.paper-table tbody tr:last-child td { padding-bottom: 0.45rem; }
.paper-table thead th { padding-top: 0.35rem; padding-bottom: 0.35rem; }
.paper-table tr.panel td { padding-top: 0.7rem; font-style: normal; }
.paper-table tr.panel:first-child td { padding-top: 0.45rem; }
.paper-table tr.header th:not(:first-child) { text-align: center; }

@media (max-width: 40rem) {
  .paper-table table { font-size: 0.82rem; }
  .paper-table th, .paper-table td { padding: 0.2rem 0.45rem; }
}

/* ---------------------------------------------------------------- contents */

.toc summary { cursor: pointer; color: var(--darkblue); font-weight: bold; margin-bottom: 0.4rem; }
.toc ul { list-style: none; padding-left: 0; margin: 0; }
.toc ul ul { padding-left: 1.1em; }
.toc li { margin: 0.25em 0; }
.toc > details > ul > li { margin-top: 0.5em; }
.toc ul ul li { padding-left: 0.6em; text-indent: 0; }
.toc a { color: var(--ink); }
.toc a:hover { color: var(--mediumblue); }
.toc .secnum { min-width: 0; margin-right: 0.35em; color: var(--muted); }
.toc-extra { margin: 0.6rem 0 0; font-size: 0.9em; }
@media (max-width: 66rem) {
  .toc { margin: 1.5rem 0 0; font-size: 0.9rem; }
  .toc details { border: 1px solid var(--hairline); padding: 0.5rem 0.9rem; }
  .toc ul ul ul { display: none; }
}

/* ---------------------------------------------------------------- references, footnotes */

#refs { margin-top: 1rem; }
.csl-entry { margin: 0 0 0.6em; padding-left: 1.5em; text-indent: -1.5em; font-size: 0.95rem; }
.citation a { color: var(--mediumblue); }
.csl-entry:target { background: #fff6d6; }

.footnotes { font-size: 0.85rem; color: var(--muted); margin-top: 3rem; }
.footnotes hr { border: 0; border-top: 1px solid var(--hairline); }
.footnotes li:target { background: #fff6d6; }
.footnote-ref sup { font-size: 0.7em; }

.colophon { margin-top: 4rem; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--hairline); padding-top: 1rem; }

/* ---------------------------------------------------------------- misc */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
:target { scroll-margin-top: 1rem; }

@media print {
  .toc, #version-banner, .formats { display: none; }
  .page { display: block; max-width: none; }
}

/* ---------------------------------------------------------------- interactive charts */

.chart { position: relative; font-size: 0.85rem; }
.chart-svg { width: 100%; height: auto; display: block; font-family: var(--serif); }
.chart-svg .grid line { stroke: #e4e4e4; stroke-width: 0.6; }
.chart-svg .tick { font-size: 11px; fill: var(--muted); }
.chart-svg .axis-label { font-size: 12.5px; fill: var(--ink); }
.chart-svg .axis-label .sym { font-style: italic; }
.chart-svg .plot-frame { fill: none; stroke: var(--ink); stroke-width: 0.6; }
.chart-svg .printed-frame { fill: none; stroke: var(--muted); stroke-width: 0.6; stroke-dasharray: 3 3; }
.chart-svg .inset-title { font-size: 10px; fill: var(--muted); }
.chart-svg .inset-row { font-size: 10.5px; }
.chart-svg .occ { cursor: pointer; transition: opacity 120ms; }
.chart-svg .occ.dim { opacity: 0.18; }
.chart-svg .occ.hover path:not(.hit), .chart-svg .occ.selected path:not(.hit) { stroke-width: 3.2px; }
.chart-svg .occ.selected circle:not(.hit) { stroke: var(--ink); stroke-width: 1.5; }
.chart-svg .layer-grey .occ.hover path:not(.hit) { stroke: #888; }

.chart-controls, .chart-foot {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center;
  margin: 0.2rem 0 0.5rem;
}
.chart-foot { margin: 0.4rem 0 0; }
.control-group { display: inline-flex; gap: 0.6rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; white-space: nowrap; }
.chip input { margin: 0; }
.swatch { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; }
.seg button {
  font: inherit; font-size: 0.8rem; background: #fff; color: var(--ink);
  border: 1px solid var(--hairline); padding: 0.15rem 0.55rem; margin: 0; cursor: pointer;
}
.seg button + button { border-left: 0; }
.seg button:first-child { border-radius: 3px 0 0 3px; }
.seg button:last-child { border-radius: 0 3px 3px 0; }
.seg button[aria-pressed="true"] { background: var(--darkblue); color: #fff; border-color: var(--darkblue); }
.chart-search {
  font: inherit; font-size: 0.8rem; padding: 0.2rem 0.5rem; border: 1px solid var(--hairline);
  border-radius: 3px; min-width: 12rem; flex: 1 1 10rem;
}
.static-link { margin-left: auto; }
.chart-warning { color: #8a5a00; font-size: 0.78rem; }

.chart-tip {
  position: absolute; z-index: 2; pointer-events: none;
  background: #fff; border: 1px solid var(--rule); box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  padding: 0.45rem 0.6rem; width: 17rem; font-size: 0.78rem; line-height: 1.35; color: var(--ink);
}
.chart-tip.side-right { left: calc(100% + 0.8rem); }
.chart-tip.docked { position: static; width: auto; margin-top: 0.4rem; pointer-events: auto; }
.chart-tip[hidden] { display: none; }
.chart-tip table { border-collapse: collapse; margin: 0.3rem 0; font-variant-numeric: tabular-nums; }
.chart-tip th { font-weight: normal; color: var(--muted); text-align: right; padding: 0 0 0 0.6rem; }
.chart-tip td { padding: 0.05rem 0 0.05rem 0.6rem; text-align: right; }
.chart-tip td:first-child, .chart-tip th:first-child { text-align: left; padding-left: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.78rem; }

.chart-table { margin-top: 0.8rem; font-size: 0.8rem; }
.chart-table summary { cursor: pointer; color: var(--mediumblue); }
.chart-table > div { overflow-x: auto; margin-top: 0.4rem; }
.chart-table table { border-collapse: collapse; font-variant-numeric: tabular-nums; width: 100%; }
.chart-table th { text-align: right; font-weight: normal; color: var(--muted); cursor: pointer; padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.chart-table th:first-child, .chart-table td.t { text-align: left; }
.chart-table th.sorted { color: var(--darkblue); }
.chart-table th.sorted.asc::after { content: " ▲"; font-size: 0.7em; }
.chart-table th.sorted.desc::after { content: " ▼"; font-size: 0.7em; }
.chart-table td { padding: 0.15rem 0.4rem; border-bottom: 1px solid #eee; cursor: pointer; }
.chart-table td.num { text-align: right; }
.chart-table tr.selected td { background: #fff6d6; }
.chart-table tr:hover td { background: #f5f5f5; }

@media (max-width: 40rem) {
  .static-link { margin-left: 0; }
}

[hidden] { display: none !important; }

/* narrow containers: the SVG is scaled down, so scale its text up */
.chart-trajectories.narrow .chart-svg .tick { font-size: 17px; }
.chart-trajectories.narrow .chart-svg .axis-label { font-size: 19px; }
.chart-trajectories.narrow .chart-svg .inset { display: none; }

/* ---------------------------------------------------------------- standalone figure pages */

.figure-links { font-size: 0.8rem; margin: 0.5rem 0 0; }
.figure-links p { margin: 0; }
.paper-header.compact { margin: 1.5rem 0 1rem; }
.kicker { font-size: 0.9rem; color: var(--muted); margin: 0; }
.title.small { font-size: 1.8rem; margin-top: 0.4rem; }
.figure-page .page { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--measure) + 2rem); }
.figure-page figure.paper-figure { margin-top: 1rem; }
.figure-index { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.figure-index li { font-size: 0.85rem; }
.figure-index img { width: 100%; height: auto; border: 1px solid var(--hairline); margin-bottom: 0.3rem; }
.figure-index a { color: var(--ink); display: block; }
.figure-index a:hover .figure-index-caption { color: var(--mediumblue); }
.figure-index-caption { display: block; }
.tag { font-size: 0.7rem; color: var(--darkgreen); border: 1px solid var(--darkgreen); padding: 0 0.3em; border-radius: 3px; margin-left: 0.3em; }

/* Figure 1 panels */
.chart-svg .panel-title { font-size: 12px; fill: var(--darkblue); font-style: italic; }
.chart-svg .gradient-label { font-size: 10.5px; fill: var(--muted); }
.chart-svg .zero { stroke: #888; stroke-width: 0.6; stroke-dasharray: 4 3; }
.chart-svg .occ.hover circle:not(.hit), .chart-svg .occ.selected circle:not(.hit) { fill-opacity: 0.95; stroke: var(--ink); stroke-width: 1.2; }
.chart-panels.narrow .chart-svg .panel-title { font-size: 13px; }
.chart-panels.narrow .chart-svg .gradient-label { font-size: 11px; }
.chart .panels { display: flex; gap: 0.6rem; align-items: flex-start; }
.chart .panels .chart-svg { flex: 1 1 0; min-width: 0; }
.chart.narrow .panels { flex-direction: column; gap: 0.2rem; }
.chart.narrow .panels .chart-svg { flex: none; width: 100%; }
.chart .panels.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.6rem; }
.chart.narrow .panels.cols-2 { grid-template-columns: 1fr; }

/* interactive tables */
.paper-table table[hidden] { display: none; }
.group-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; font-variant-numeric: tabular-nums; border-top: 1.2px solid var(--ink); border-bottom: 1.2px solid var(--ink); }
.group-table caption { caption-side: top; text-align: left; padding: 0 0 0.4rem; color: var(--darkblue); font-size: 0.85rem; }
.group-table th { font-weight: normal; color: var(--muted); text-align: right; padding: 0.25rem 0.5rem; border-bottom: 0.6px solid var(--ink); cursor: pointer; white-space: nowrap; }
.group-table th.t { text-align: left; }
.group-table th.sorted { color: var(--darkblue); }
.group-table th.sorted.asc::after { content: " ▲"; font-size: 0.7em; }
.group-table th.sorted.desc::after { content: " ▼"; font-size: 0.7em; }
.group-table td { padding: 0.25rem 0.5rem; }
.group-table td.num { text-align: right; }
.group-table tr.group { cursor: pointer; }
.group-table tr.group:hover td { background: #f5f5f5; }
.group-table tr.group td.t::before { content: "▸ "; color: var(--muted); font-size: 0.8em; }
.group-table tr.group.open td.t::before { content: "▾ "; }
.group-table tr.members td { padding: 0.2rem 0.5rem 0.8rem 1.6rem; background: #fafafa; }
.member-table { border-collapse: collapse; width: 100%; font-size: 0.8rem; margin: 0.3rem 0; }
.member-table th { border-bottom: 0.6px solid var(--hairline); cursor: default; }
.member-table td { padding: 0.1rem 0.5rem; border-bottom: 1px solid #eee; }
.group-table tr.total td { border-top: 0.6px solid var(--ink); padding-top: 0.5rem; }
.group-table tr.panel td { padding-top: 0.8rem; }
.quad-table { width: auto; margin: 0.3rem auto; }
.quad-table th, .quad-table td { padding: 0.2rem 0.9rem; }
.chart-quadtable input[type=range] { flex: 1 1 8rem; max-width: 16rem; }
.chip.clear-highlight { font: inherit; font-size: 0.8rem; border: 1px solid var(--hairline); background: #fff; padding: 0.15rem 0.55rem; border-radius: 3px; }

/* line charts */
.chart-svg .cursor-line { stroke: var(--muted); stroke-width: 0.8; stroke-dasharray: 3 3; }
.chart-svg .series-label { font-size: 12px; font-style: italic; }
.chart-tip .swatch { width: 0.7em; height: 0.7em; }
