/* The pages: home, a tool's form, signing in, the task list and a task. */

/* ── home: the stage at the top ─────────────────────────────────────── */

.hero {
  padding-block: clamp(40px, 5.2vw, 76px) clamp(24px, 4vw, 56px);
  background: #f4f8e0;
}

.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  align-items: end;
  gap: 24px 56px;
  margin-bottom: clamp(28px, 4vw, 52px);
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

/* what a new account starts with, for a visitor who is not signed in */
.hero-welcome {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* the stroke under the word of the headline */
.mark-big {
  position: relative;
  isolation: isolate;
  white-space: nowrap;
}

.mark-big::before {
  content: "";
  position: absolute;
  inset: 0.16em -0.14em 0.02em -0.12em;
  z-index: -1;
  border-radius: 0.1em 0.26em 0.12em 0.3em / 0.3em 0.16em 0.34em 0.14em;
  background: linear-gradient(90deg, #d4ee3c, #e4f56f);
  transform: rotate(-1.6deg);
  transform-origin: left center;
  animation: mark-in 720ms 260ms var(--ease) both;
}

@keyframes mark-in {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 -10% 0 0);
  }
}

/* ── the examples (js/bench.js) ─────────────────────────────────────── */

.bench-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.segs {
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  border-radius: calc(16px * var(--sq));
  corner-shape: squircle;
  background: rgb(255 255 255 / 0.5);
  scrollbar-width: none;
}

.seg {
  position: relative;
  isolation: isolate;
  flex: none;
  overflow: hidden;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: calc(12px * var(--sq));
  corner-shape: squircle;
  background: none;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 160ms var(--ease);
}

.seg:hover {
  background: rgb(255 255 255 / 0.5);
}

.seg[aria-current="true"],
.seg[aria-pressed="true"] {
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

/* the lime behind the current tab fills from the left; the next slide comes when it is full */
.seg[aria-current="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
}

.bench.is-auto .seg[aria-current="true"]::before {
  animation: seg-time 9s linear forwards;
}

/* held while the slides are read; the row of tabs holds nothing, so the play button plays */
.bench.is-auto:is(.is-away, :has(.track:hover), :has(.track:focus-within)) .seg[aria-current="true"]::before {
  animation-play-state: paused;
}

@keyframes seg-time {
  to {
    transform: scaleX(1);
  }
}

.track {
  display: flex;
  align-items: flex-start;
  margin-inline: calc(-1 * var(--gutter));
  transition:
    transform 700ms var(--ease),
    height 700ms var(--ease);
}

.slide {
  position: relative;
  display: grid;
  flex: 0 0 100%;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  align-content: start;
  padding: 8px var(--gutter) 24px;
  transition: opacity 400ms var(--ease);
}

.slide[inert] {
  opacity: 0;
}

.sheet-page {
  grid-column: 1 / 6;
  grid-row: 1;
  height: 520px;
  padding: 24px 28px;
  overflow: hidden;
  background: #fffefb;
  transform: rotate(-1.4deg);
}

.sheet-page-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--ink-3);
}

.sheet-page-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100% - 40px);
  padding-right: 84px;
  overflow: hidden;
  font: 400 18px/29px var(--serif);
  mask: linear-gradient(#000 calc(100% - 88px), transparent);
}

.hit {
  padding-inline: 1px;
  border-radius: 0.16em 0.4em 0.22em 0.34em;
  background: linear-gradient(var(--lime), var(--lime)) no-repeat 0 0 / 100% 100%;
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.result {
  z-index: 1;
  grid-column: 5 / 13;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  margin: 40px 0 0 28px;
  padding: 28px 32px 26px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.result-head > div {
  min-width: 0;
}

.result-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.result-link {
  align-self: flex-start;
  margin-top: 20px;
  font-size: 15px;
}

.rank {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rank li {
  display: grid;
  grid-template-columns: minmax(110px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.rank-name {
  justify-self: start;
  font: 500 18px/26px var(--serif);
}

.bench-quotes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bench-quotes .quote {
  font-size: 16px;
  line-height: 24px;
}

.bench-quotes > * + * {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* a word on its way from the passage to the result */
.flyer {
  position: absolute;
  z-index: 5;
  margin: 0;
  padding-inline: 1px;
  font: 400 18px/29px var(--serif);
  white-space: nowrap;
  pointer-events: none;
  transform-origin: left center;
}

/* while a slide plays: what the words are still on their way to */
.bench-target,
.bench-rest {
  clip-path: inset(0);
  transition:
    opacity 420ms var(--ease),
    clip-path 620ms var(--ease);
}

.slide.is-set .bench-target {
  opacity: 0;
  transition: none;
}

.slide.is-set .bench-target.is-there {
  opacity: 1;
}

.slide.is-set .bench-rest {
  opacity: 0;
  clip-path: inset(0 60% 0 0);
  transition: none;
}

/* ── the path ───────────────────────────────────────────────────────── */

.path {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding-top: 128px;
}

.path-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  min-height: 440px;
  padding: 36px;
  border-radius: calc(28px * var(--sq));
  corner-shape: squircle;
  background: var(--wash);
}

.path-card.is-narrow {
  grid-column: span 5;
}

.path-card.is-wide {
  grid-column: span 7;
}

.path-card.is-full {
  grid-column: 1 / -1;
  min-height: 0;
}

.path-card.is-full .path-minis {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.path-card > header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 46ch;
}

.path-fill {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.path-fill > .card {
  padding: 22px 24px;
}

/* a card that runs out of the corner */
.path-fill > .path-cut {
  margin: 0 -36px -36px 0;
  padding: 24px 0 0 26px;
  overflow: hidden;
  border-radius: var(--q-l) 0 0 0;
}

.path-minis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.path-minis .mini {
  min-height: 58px;
  background: rgb(255 255 255 / 0.78);
}

.path-minis .mini:hover,
.path-minis .mini:focus-visible {
  background: var(--paper);
}

/* a table with three rules */
.three-lines {
  width: 100%;
  border-collapse: collapse;
  border-block: 2px solid var(--ink);
  font-size: 15px;
  line-height: 22px;
}

.three-lines caption {
  padding-bottom: 10px;
  font-weight: 600;
  text-align: left;
}

.three-lines th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.three-lines td {
  padding: 8px 10px;
  text-align: right;
}

.three-lines :is(th, td):first-child {
  padding-left: 0;
  text-align: left;
}

.three-lines td:first-child {
  font: 400 17px/22px var(--serif);
}

/* ── what comes back ────────────────────────────────────────────────── */

.back {
  padding-top: 128px;
}

.back-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 56px;
  margin-bottom: 40px;
}

.back-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.back-grid > .card {
  padding: 32px;
}

.back-title {
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.back-quote {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  grid-column: span 5;
  align-items: center;
  margin: 0;
  padding: 40px 36px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: #f4f8e0;
}

.back-quote p {
  font-size: 28px;
  line-height: 40px;
  letter-spacing: -0.01em;
}

.back-rank {
  grid-column: span 7;
}

.back-table {
  grid-column: span 7;
  overflow-x: auto;
}

.back-lines {
  display: flex;
  grid-column: span 5;
  flex-direction: column;
  gap: 14px;
}

.back-lines .back-title {
  margin-bottom: 4px;
}

/* ── every tool ─────────────────────────────────────────────────────── */

.directory {
  /* not laid out until it is near the screen; the room at its foot is for the shadows of the cards */
  content-visibility: auto;
  contain-intrinsic-block-size: auto 3600px;
  padding-block: 128px 48px;
  margin-bottom: -48px;
}

.directory-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 48px;
  margin-bottom: 44px;
}

.directory-head .title {
  max-width: 18ch;
}

.directory-segs {
  background: var(--paper-3);
}

.directory-part {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.directory-part + .directory-part {
  margin-top: 56px;
}

.audience {
  padding-block: 128px;
}

.audience .title {
  margin-bottom: 40px;
}

.audience-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.audience-cards .gcard {
  min-height: 340px;
  padding: 34px;
}

/* ── a tool ─────────────────────────────────────────────────────────── */

.tool-page {
  padding-bottom: 112px;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding-top: 24px;
}

.tool-grid.has-aside {
  grid-template-columns: minmax(0, 1fr) 372px;
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}

.form-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* each option is a card of its own */
.form-options .fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-options .fields > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.form-options .fields > * {
  min-width: 0;
  padding: 20px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--canvas);
}

.form-options .segments {
  background: var(--paper-3);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px 24px;
  font-size: 15px;
  line-height: 24px;
}

/* the button stays at hand while the options are gone through */
.form-submit {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  align-self: flex-end;
  padding: 10px;
  box-shadow: var(--shadow-3);
}

.tool-aside {
  position: sticky;
  top: calc(var(--header) + 20px);
}

.tool-aside .ledger {
  margin-block: -8px;
}

/* the sample reports of a tool, the one shown in the tool's colour */
.sample-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-inline: -12px;
}

.sample-row {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--q);
  corner-shape: squircle;
  background: none;
  text-align: left;
}

.sample-row:hover {
  background: var(--paper-2);
}

.sample-row[aria-pressed="true"] {
  background: var(--wash);
}

.sample-row-title {
  font-weight: 500;
  line-height: 24px;
}

.sample-segs {
  max-width: 100%;
  background: var(--paper-3);
}

/* the ways to add a text besides dropping a file, and the box to type one into */
.upload-more {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.upload-more > .link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.typed-text {
  min-height: 220px;
  font: 400 17px/27px var(--serif);
}

.typed .is-over {
  color: var(--red);
}

.dropzone {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 196px;
  padding: 24px 16px;
  border: 0;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--wash);
  color: var(--ink);
  text-align: center;
  transition: background-color 180ms var(--ease);
}

.dropzone > .icon {
  box-sizing: content-box;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--deep);
  transition: transform 300ms var(--spring);
}

.dropzone:hover,
.dropzone.is-over {
  background: var(--pen);
}

.dropzone:hover > .icon,
.dropzone.is-over > .icon {
  transform: translateY(-5px);
}

.dropzone:focus-visible {
  border-radius: var(--q-l);
}

.dropzone-title {
  font-weight: 500;
  line-height: 24px;
}

.dropzone-note {
  color: var(--deep);
  font-size: 14px;
  line-height: 20px;
}

.dropzone:hover .dropzone-note,
.dropzone.is-over .dropzone-note {
  color: var(--ink);
}

.form-card > .stack-s {
  flex: 1;
}

.stack-s > div > .link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 16px;
  border-radius: var(--q);
  corner-shape: squircle;
  background: var(--paper-2);
  font-size: 15px;
  line-height: 22px;
}

.form-options .file-item {
  background: var(--paper);
}

.file-item > .icon {
  color: var(--ink-3);
}

.file-meta {
  color: var(--ink-3);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* a tool's sample report, under the form and across the page */
.tool-sample {
  padding-top: 96px;
}

.tool-more {
  padding-top: 96px;
}

/* what the page says about the tool, under its form (js/about.js) */
.tool-about {
  padding-top: 96px;
}

.about-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: 24px 56px;
  padding: 44px;
}

.about-card > div {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 68ch;
}

.about-card h3 {
  margin-bottom: 8px;
}

.about-card p {
  color: var(--ink-2);
}

/* the other tools for the texts at hand (js/switcher.js): a row of them, the ticked ones in their pen */
.next {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-page .next {
  margin-top: 24px;
  padding: 24px 28px;
}

.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.picks-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 14px 4px 10px;
  border-radius: calc(12px * var(--sq));
  corner-shape: squircle;
  background: var(--paper-2);
  font-size: 15px;
  line-height: 19px;
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.pick:hover,
.pick:has(.check:checked) {
  background: var(--wash);
}

.pick > .icon {
  color: var(--ink-3);
}

.pick.is-finished > .icon {
  color: var(--green);
}

.pick.is-pending > .icon,
.pick.is-running > .icon {
  animation: spin 1.2s linear infinite;
}

.pick.is-current {
  background: var(--ink);
  color: var(--paper);
  cursor: default;
}

.next-foot {
  gap: 8px 16px;
}

/* a panel over the page (js/reuse.js): in from the right on a wide screen, up from the
   bottom on a narrow one; its middle scrolls between the title and the buttons */
.side-panel {
  position: fixed;
  inset: 12px 12px 12px auto;
  width: min(480px, calc(100vw - 24px));
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--q-xl);
  corner-shape: squircle;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  animation: side-in 360ms var(--ease);
}

.side-panel::backdrop {
  background: rgb(18 36 28 / 0.32);
}

.side-panel.is-leaving {
  animation: side-out 200ms var(--ease) forwards;
}

@keyframes side-in {
  from {
    transform: translateX(calc(100% + 12px));
  }
}

@keyframes side-out {
  to {
    transform: translateX(calc(100% + 12px));
  }
}

.side-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px 16px 28px;
}

.side-panel-title {
  font-size: 22px;
  line-height: 30px;
  letter-spacing: -0.01em;
}

.side-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 28px 28px;
}

.side-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--line);
}

/* an earlier text: its whole name, then its characters and lines; the remove button in its corner */
.pick-files {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pick-file {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--canvas);
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.pick-file:hover {
  background: var(--paper-2);
}

.pick-file:has(.check:checked) {
  background: var(--lime-soft);
}

.pick-file .check {
  margin-top: 2px;
}

.pick-file-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pick-file-name {
  font-weight: 500;
  line-height: 22px;
  overflow-wrap: anywhere;
}

.pick-file-meta {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.pick-file-item {
  position: relative;
}

.pick-file-item .pick-file {
  padding-right: 56px;
}

.pick-file-remove {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* another tool for some texts: the texts on top, then the tools */
.pick-for {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--canvas);
  font-size: 15px;
  line-height: 22px;
}

.pick-for li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pick-for .icon {
  margin-top: 2px;
  color: var(--ink-3);
}

.pick-tools {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-inline: -12px;
}

.tool-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  transition: background-color 140ms var(--ease);
}

.tool-row:hover {
  background: var(--wash);
}

.tool-row .tool-icon {
  transition: transform 300ms var(--ease);
}

.tool-row:hover .tool-icon {
  transform: scale(1.1) rotate(-5deg);
}

.tool-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tool-row-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.tool-row-intro {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}

/* ── signing in ─────────────────────────────────────────────────────── */

.signin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 24px;
  max-width: 1680px;
  min-height: calc(100svh - var(--header) - var(--inset));
  margin: 0 auto var(--inset);
  padding-inline: var(--inset);
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: center;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding: 44px 40px;
}

.signin-stage {
  display: grid;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: clamp(20px, 5vw, 72px);
  background: #eff3fb;
}

.signin-result {
  min-width: 0;
  padding: 28px 32px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.signin-others {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

/* a window over the page */
.dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 36px 32px 32px;
  border: 0;
  border-radius: var(--q-xl);
  corner-shape: squircle;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  text-align: center;
  animation: rise 320ms var(--spring);
}

.dialog::backdrop {
  background: rgb(18 36 28 / 0.32);
}

.dialog-title {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 30px;
}

.code-input {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 0.32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* ── account settings ───────────────────────────────────────────────── */

.settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 640px;
  margin-inline: auto;
}

.settings > .title {
  margin-bottom: 12px;
}

.settings-section {
  padding: 32px;
}

.settings-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 24px;
  margin: 0;
}

.settings-fact {
  display: contents;
}

.settings-fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.settings .input[readonly] {
  background: var(--paper-2);
  color: var(--ink-2);
}

/* the admin page: the events Stripe sends, and one row per plan */
.admin-events {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-events code {
  padding: 4px 8px;
  border-radius: var(--radius-s);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 13px;
}

.admin-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
}

.admin-plan .input {
  width: 100%;
}

/* ── credits ────────────────────────────────────────────────────────── */

.billing {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 980px;
  margin-inline: auto;
}

.credits-balance {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--q);
  corner-shape: squircle;
  background: var(--lime-soft);
  font-size: 15px;
  line-height: 24px;
}

.credits-balance .num {
  font-weight: 600;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.plan {
  gap: 12px;
  min-height: 236px;
  padding: 26px;
}

.plan-credits {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-number {
  font-size: 30px;
  font-weight: 500;
  line-height: 36px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.plan-bonus {
  min-height: 24px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.plan .mark {
  background: var(--paper);
}

.plan .btn {
  margin-top: auto;
}

.credit-list {
  padding: 8px;
}

.credit-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 168px 72px;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-radius: calc(16px * var(--sq));
  corner-shape: squircle;
  transition: background-color 140ms var(--ease);
}

a.credit-row:hover {
  background: var(--paper-2);
}

.credit-mark {
  display: flex;
  justify-content: center;
  color: var(--ink-3);
}

.credit-amount {
  font-weight: 500;
  text-align: right;
}

.credit-amount.is-in {
  color: var(--green);
}

/* ── tasks ──────────────────────────────────────────────────────────── */

.task-list,
.file-cards {
  margin-top: 32px;
}

.task-list {
  padding: 8px;
}

.task-list.is-empty {
  padding: 0;
}

.task-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 168px 18px;
  align-items: center;
  gap: 20px;
  padding: 14px 18px 14px 16px;
  border-radius: calc(16px * var(--sq));
  corner-shape: squircle;
  transition: background-color 140ms var(--ease);
}

.task-row:hover,
.task-row:focus-visible {
  background: var(--paper-2);
}

.task-row > .icon {
  color: var(--ink-3);
  transition: transform 240ms var(--ease);
}

.task-row:hover > .icon {
  transform: translateX(4px);
}

.task-row .tool-icon {
  transition: transform 300ms var(--ease);
}

.task-row:hover .tool-icon {
  transform: scale(1.08) rotate(-4deg);
}

.task-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.task-name {
  font-weight: 500;
  line-height: 24px;
}

.task-time {
  text-align: right;
}

.more-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ── one task: the cover of its report ──────────────────────────────── */

.cover {
  padding-block: 48px;
}

.cover-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  align-items: center;
  gap: 32px 64px;
}

.cover-about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.cover-about > .stage-pic {
  width: 112px;
  height: 112px;
}

.cover-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: -8px;
}

.cover-facts .badge-finished {
  background: rgb(255 255 255 / 0.72);
}

/* the record of the run: the files it read, then its figures line by line */
.slip {
  min-width: 0;
  padding: 30px 34px 18px;
}

.slip-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
  font-size: 15px;
  line-height: 24px;
}

.slip-files:last-child {
  padding-bottom: 14px;
  border-bottom: 0;
}

.slip-files li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.slip-files .icon {
  margin-top: 3px;
  color: var(--ink-3);
}

.slip-file {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-body {
  display: flex;
  flex-direction: column;
  gap: 112px;
  padding-block: 24px 112px;
}

.waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 96px 24px;
  text-align: center;
}

.waiting p {
  max-width: 44ch;
}

.waiting strong {
  font-size: 22px;
  font-weight: 500;
  line-height: 30px;
}

/* My tasks by file: each text, the tasks run on it, and another tool for it */
.file-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  align-items: start;
  gap: 20px;
}

.file-cards > .empty {
  grid-column: 1 / -1;
}

.file-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.file-card-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 2px 10px;
}

.file-card-head > time {
  grid-column: 2;
}

.file-card-head > .icon {
  margin-top: 2px;
  color: var(--ink-3);
}

.file-card-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.file-card-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-inline: -10px;
}

.file-task {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: calc(12px * var(--sq));
  corner-shape: squircle;
  font-size: 15px;
  line-height: 22px;
  transition: background-color 140ms var(--ease);
}

.file-task:hover {
  background: var(--paper-2);
}

/* ── running text ───────────────────────────────────────────────────── */

.prose {
  max-width: calc(760px + 2 * var(--gutter));
}

.prose-card {
  margin-top: 32px;
  padding: 16px 40px 40px;
}

.prose-card h2 {
  margin: 28px 0 8px;
}

.prose-card p {
  color: var(--ink-2);
}

/* ── narrower screens ───────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .hero-head,
  .back-head,
  .audience-cards,
  .signin,
  .cover-in,
  .about-card,
  .tool-grid.has-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .slide {
    grid-template-columns: minmax(0, 1fr);
  }

  .sheet-page {
    grid-column: 1;
    height: 300px;
  }

  .sheet-page-text {
    padding-right: 0;
  }

  .result {
    grid-column: 1;
    grid-row: 2;
    margin: -56px 0 0;
  }

  .path-card.is-narrow,
  .path-card.is-wide,
  .back-quote,
  .back-rank,
  .back-table,
  .back-lines {
    grid-column: 1 / -1;
  }

  .audience-cards .gcard {
    min-height: 220px;
  }

  .tool-aside {
    position: static;
  }

  .signin {
    min-height: 0;
  }

  .signin-stage {
    order: 1;
  }
}

@media (max-width: 640px) {
  .path,
  .back,
  .directory,
  .tool-sample,
  .tool-about,
  .tool-more {
    padding-top: 72px;
  }

  .about-card {
    padding: 24px 20px 28px;
  }

  .path,
  .back-grid {
    gap: 12px;
  }

  .path-card {
    min-height: 0;
    padding: 24px 20px;
  }

  .path-fill > .path-cut {
    margin: 0 -20px -24px 0;
  }

  .back-grid > .card {
    padding: 22px 18px;
  }

  .back-quote {
    padding: 28px 22px;
  }

  .back-quote p {
    font-size: 22px;
    line-height: 32px;
  }

  .audience {
    padding-block: 72px;
  }

  .audience-cards {
    gap: 12px;
  }

  .result {
    padding: 20px 18px;
  }

  .rank li {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
  }

  .tool-page {
    padding-bottom: 72px;
  }

  .tool-form,
  .form-slots {
    gap: 12px;
  }

  .form-card {
    padding: 20px 16px;
  }

  .form-options .fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-options .fields > * {
    padding: 16px;
  }

  .form-submit {
    align-self: stretch;
  }

  .form-submit .btn {
    width: 100%;
  }

  .cover {
    padding-block: 28px;
  }

  .task-page .next {
    padding: 20px 18px;
  }

  .cover-about > .stage-pic {
    width: 84px;
    height: 84px;
  }

  .slip {
    padding: 20px 18px 10px;
  }

  .task-body {
    gap: 72px;
    padding-bottom: 72px;
  }

  .task-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 12px;
  }

  .task-time,
  .task-row > .icon {
    display: none;
  }

  .credit-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 12px;
  }

  .credit-row time {
    display: none;
  }

  .settings-section {
    padding: 22px 18px;
  }

  .signin-form {
    padding: 28px 20px;
  }

  .signin-result {
    padding: 18px 16px;
  }

  .prose-card {
    padding: 4px 20px 28px;
  }

  .side-panel {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--q-l) var(--q-l) 0 0;
    animation-name: sheet-in;
  }

  .side-panel.is-leaving {
    animation-name: sheet-out;
  }

  .side-panel-inner {
    max-height: 88dvh;
  }

  .side-panel-head,
  .side-panel-body,
  .side-panel-foot {
    padding-inline: 18px;
  }
}

@media print {
  .cover {
    padding: 0 0 16px;
  }

  .cover-in {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .cover-about > .stage-pic {
    display: none;
  }

  .task-body {
    padding: 0;
  }
}
