:root {
  --paper: #f3f1ec;
  --panel: #fbfbf8;
  --ink: #1c1917;
  --muted: #6f6a64;
  --line: #d9d3cb;
  --rail: #e8e4dc;
  --well: #f7f4ef;
  --good: #215c3a;
  --bad: #7a332c;
  --button-border: #8a847c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.4 "Segoe UI", sans-serif;
}

.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: var(--panel);
  color: var(--ink);
  padding: 4px 8px;
  z-index: 2;
}

.skip:focus {
  top: 8px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
}

.sheet {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 332px;
  min-height: 0;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--panel);
  border-bottom: 3px solid var(--bad);
  padding: 14px 16px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: 18px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  padding-bottom: 2px;
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--bad);
}

.desktop-link {
  margin-left: auto;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.limit {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  margin: 0;
}

.limit input {
  width: 5.5rem;
  min-width: 5.5rem;
  flex: 0 0 5.5rem;
  padding: 4px 6px;
  border: 1px solid var(--button-border);
  background: var(--panel);
  color: var(--ink);
  font: 14px "Segoe UI", sans-serif;
  text-align: right;
}

.limit span {
  color: var(--muted);
}

.main {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 24px;
  min-width: 0;
  min-height: 0;
}

#compress-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.toolbar {
  margin-bottom: 8px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--button-border);
  background: var(--panel);
  color: var(--ink);
  font: 14px "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  color: var(--muted);
  cursor: default;
}

.file-control {
  position: relative;
  display: inline-block;
}

.file-control:focus-within .button {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.table-wrap {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 240px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 6px 8px;
  border-bottom: 1px solid #e7e2da;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}

th {
  font-size: 12px;
  background: var(--paper);
  position: sticky;
  top: 0;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.good {
  color: var(--good);
}

.bad {
  color: var(--bad);
}

.muted {
  color: var(--muted);
}

td a {
  color: var(--ink);
}

.rail {
  grid-column: 2;
  grid-row: 1;
  background: var(--rail);
  border-left: 1px solid var(--line);
  padding: 16px;
}

.ad-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ad-well {
  width: 300px;
  height: 250px;
  background: var(--well);
  border: 1px solid var(--line);
}

.ad-well .adsbygoogle {
  display: inline-block;
  width: 300px;
  height: 250px;
}

.status-bar {
  background: var(--rail);
  border-top: 1px solid var(--line);
  padding: 6px 16px;
}

.status-bar p {
  margin: 0;
  font-size: 12px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 16px 10px;
  background: var(--rail);
  font-size: 12px;
}

.footer-nav a {
  color: var(--ink);
}

.hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.table-caption {
  caption-side: top;
  text-align: left;
  padding: 6px 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.empty td {
  color: var(--muted);
}

.bench-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.bench-head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.prose {
  max-width: 38rem;
}

.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose h1 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 28px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
}

.lead {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.45;
}

.prose p {
  margin: 0 0 12px;
}

.pair {
  position: relative;
  height: 168px;
  margin: 28px 0 8px;
}

.frame {
  position: absolute;
  background: var(--panel);
  border: 2px solid var(--ink);
}

.frame-large {
  width: 210px;
  height: 132px;
  left: 0;
  top: 0;
}

.frame-small {
  width: 132px;
  height: 88px;
  left: 128px;
  top: 64px;
}

.sun {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bad);
}

.frame-small .sun {
  top: 10px;
  left: 10px;
  width: 14px;
  height: 14px;
}

.ground {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 28px;
  height: 2px;
  background: var(--line);
}

.frame-small .ground {
  bottom: 18px;
}

.pair figcaption {
  position: absolute;
  left: 280px;
  top: 72px;
  max-width: 16rem;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.routes {
  margin: 28px 0 8px;
}

.routes div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.routes div:last-child {
  border-bottom: 1px solid var(--line);
}

.routes dt {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.routes a {
  color: var(--ink);
}

.routes dd {
  margin: 0;
}

.steps {
  margin: 8px 0 16px;
  padding-left: 1.2rem;
}

.steps li {
  margin: 0 0 8px;
  padding-left: 4px;
}

.sample {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .masthead {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .site-nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .desktop-link {
    margin-left: 0;
  }

  .table-wrap {
    min-height: 160px;
  }

  .rail {
    grid-column: 1;
    grid-row: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .pair {
    height: 220px;
  }

  .pair figcaption {
    left: 0;
    top: 168px;
    max-width: none;
  }
}
