/* UnPHP site styles. Colours, type and spacing follow design/HANDOFF.md. */

:root {
  --navy: #13345f;
  --green: #2e7d32;
  --red: #b42318;
  --link: #2b6cb0;
  --link-hover: #1c4f86;
  --text: #1b2430;
  --text-secondary: #3d4857;
  --text-muted: #5c6878;
  --gutter-text: #6b7684;
  --php: #a13a12;
  --on-navy: #ffffff;
  --on-navy-muted: #cfdae8;
  --navy-rule: rgba(255, 255, 255, 0.16);
  --border-strong: #b8c3d1;
  --border: #dce2ea;
  --border-light: #e6eaf0;
  --surface: #fafbfc;
  --surface-alt: #f0f3f7;
  --surface-muted: #f5f7fa;

  --font-sans: "Public Sans", Helvetica, Arial, sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --page-padding: 32px;
  --code-size: 14px;
  /* The line-number gutters line up with the code only if both use this */
  --code-line: calc(14px * 1.65);
  --code-pad: 14px;
  --collapsed-lines: 15;
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html:has(.menu[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
pre {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
}

:where(a) {
  color: var(--link);
}

:where(a):hover {
  color: var(--link-hover);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

pre,
code {
  font-family: var(--font-mono);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 4px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--page-padding);
}

.site-main {
  flex-grow: 1;
}

/* Header and wordmark */

.site-header {
  background: var(--navy);
  color: var(--on-navy);
}

.site-header :focus-visible,
.menu :focus-visible {
  outline-color: #ffffff;
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0 40px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 68px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  text-decoration: none;
}

.wordmark:hover {
  color: #ffffff;
}

.wordmark__php {
  padding: 1px 6px 2px;
  border-radius: 2px;
  background: #ffffff;
  color: var(--navy);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
}

.site-nav a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 68px;
  color: var(--on-navy-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: #ffffff;
}

.site-nav a:focus-visible {
  outline-offset: -2px;
}

.site-nav a[aria-current="page"] {
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 -3px 0 #ffffff;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  align-self: center;
}

/* Mobile menu: a full-screen modal dialog */

.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
  background: var(--navy);
  color: var(--on-navy);
}

.menu[open] {
  display: flex;
  flex-direction: column;
}

.menu::backdrop {
  background: var(--navy);
}

.menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 8px 0 20px;
  border-bottom: 1px solid var(--navy-rule);
}

.menu__bar .wordmark {
  min-height: 0;
  font-size: 22px;
}

.menu__bar .wordmark__php {
  padding: 1px 5px 2px;
}

.menu__nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.menu__nav a {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 0 20px;
  font-size: 22px;
  font-weight: 500;
  color: var(--on-navy-muted);
  text-decoration: none;
}

.menu__nav a:focus-visible {
  outline-offset: -4px;
}

.menu__nav a[aria-current="page"] {
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 4px 0 0 #ffffff;
}

.menu__footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--navy-rule);
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-navy-muted);
}

.menu__footer a {
  color: #ffffff;
}

/* Title band */

.title-band__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 40px 0 44px;
  border-top: 1px solid var(--navy-rule);
}

.title-band h1 {
  font-size: 40px;
  line-height: 1.12;
}

.title-band__subtitle {
  font-size: 20px;
  line-height: 1.45;
  color: var(--on-navy-muted);
}

.title-band__subtitle--code {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.title-band--home .title-band__inner {
  padding: 48px 0 56px;
}

.title-band--home h1 {
  font-size: 44px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.site-footer p {
  padding: 22px 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font: 600 16px/1.2 var(--font-sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.btn--lg {
  min-height: 50px;
  padding: 0 24px;
  font-size: 17px;
}

.btn--green,
.btn--navy,
.btn--red {
  color: #ffffff;
}

.btn--green {
  background: var(--green);
}

.btn--navy {
  background: var(--navy);
}

.btn--red {
  background: var(--red);
}

.btn--green:hover:enabled,
.btn--navy:hover:enabled,
.btn--red:hover:enabled,
a.btn--green:hover,
a.btn--navy:hover {
  color: #ffffff;
  background-image: linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.14));
}

.btn--secondary {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font-weight: 500;
}

.btn--secondary:hover:enabled {
  background: var(--surface-muted);
}

.btn--outline {
  border-color: var(--link);
  background: transparent;
  color: var(--link);
}

.btn--outline:hover {
  border-color: var(--link-hover);
  background: var(--surface-alt);
  color: var(--link-hover);
}

.btn svg {
  flex: none;
}

/* Code boxes */

.code-box {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
}

.code-box--quiet {
  border-color: var(--border);
}

.code-gutter {
  flex: none;
  padding: 14px 12px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--gutter-text);
  font-family: var(--font-mono);
  font-size: var(--code-size);
  line-height: var(--code-line);
  text-align: right;
  white-space: pre;
  user-select: none;
}

.code-gutter:empty {
  display: none;
}

/* The textarea sets the height of the box; the gutter scrolls along with it */
.code-box--input {
  --input-height: calc(var(--code-line) * 12 + 28px);
}

.code-box--input .code-input,
.code-box--input .code-gutter {
  height: var(--input-height);
}

/* Room for the textarea's horizontal scrollbar when both scroll to the bottom */
.code-box--input .code-gutter {
  padding-bottom: 40px;
}

.code {
  flex-grow: 1;
  min-width: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--code-size);
  line-height: var(--code-line);
}

.code code {
  font: inherit;
}

.code--wrap {
  white-space: pre-wrap;
  word-break: break-all;
}

.code-input {
  flex-grow: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: var(--code-line);
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  resize: vertical;
}

.code-input:focus-visible {
  outline-offset: -2px;
}

/* Syntax highlighting, applied by highlight.js or written into the page */

.hljs-keyword {
  font-weight: 700;
}

.hljs-string,
.hljs-meta,
.hljs-attr {
  color: var(--php);
}

.hljs-comment,
.prompt {
  color: var(--gutter-text);
}

.prompt {
  user-select: none;
}

:not(pre) > code {
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 15px;
}

/* Column blocks */

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.column-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding-top: 20px;
  border-top: 3px solid var(--navy);
}

.column-block h2 {
  font-size: 21px;
}

.column-block p {
  flex-grow: 1;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.column-block .btn {
  align-self: flex-start;
}

/* Two-column page layout: wide content with a narrow side column */

.split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 48px 64px;
  padding-block: 56px 88px;
}

.split__wide {
  display: flex;
  flex: 999 1 540px;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.split__narrow {
  display: flex;
  flex: 1 1 300px;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel {
  padding: 24px;
  border-top: 3px solid var(--navy);
  background: var(--surface-muted);
}

.side-block {
  gap: 12px;
  padding-top: 20px;
  border-top: 3px solid var(--navy);
}

.side-block h2 {
  font-size: 19px;
}

.side-block p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.side-block a:not(.btn) {
  align-self: flex-start;
  padding: 6px 0;
  font-weight: 600;
}

/* Notices */

.notice {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--php);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.notice strong {
  color: var(--text);
}

.notice--info {
  border-left-color: var(--navy);
}

.notice--success {
  border-left-color: var(--green);
}

.notice > * + * {
  margin-top: 10px;
}

.notice ul {
  padding-left: 22px;
}

.notice pre {
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  font-size: 14px;
}

/* Home */

.decode-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 40px;
}

.intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.decode-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.decode-actions .btn--green {
  padding: 0 28px;
}

.file-picker:focus-visible + .btn {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.file-name {
  font-size: 15px;
  color: var(--text-muted);
}

.examples {
  padding-block: 72px 80px;
}

/* Decode results */

.results {
  display: flex;
  flex-direction: column;
  padding-block: 44px 80px;
}

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

.results__original {
  margin-top: 64px;
}

.results__section h2 {
  font-size: 24px;
}

.results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.results .columns {
  margin-top: 64px;
}

.results .column-block {
  padding-top: 18px;
}

.code-note {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.original-code {
  display: block;
}

/* Long code starts collapsed to its first lines (decode.js) */
.code-box.is-collapsed {
  position: relative;
  max-height: calc(var(--collapsed-lines) * var(--code-line) + var(--code-pad));
}

/* Clip rather than scroll; the horizontal scrollbar stays */
.code-box.is-collapsed .code {
  overflow-y: hidden;
}

.code-box.is-collapsed::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 56px;
  background: linear-gradient(rgba(250, 251, 252, 0), var(--surface));
  pointer-events: none;
}

.code-toggle {
  align-self: flex-start;
}

.code-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
}

.feedback h2 {
  flex-grow: 1;
  font-size: 17px;
  font-weight: 600;
}

.feedback p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.feedback__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback__buttons .btn {
  padding: 0 26px;
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.stat-table tr {
  border-bottom: 1px solid var(--border-light);
}

.stat-table th,
.stat-table td {
  padding: 11px 0;
  vertical-align: baseline;
}

.stat-table th {
  padding-right: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.stat-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stat-table .mono {
  font-family: var(--font-mono);
  font-weight: 500;
}

.stat-table .md5 {
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: break-word;
}

.stat-table .value {
  max-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-scroll {
  max-height: 531px;
  overflow-y: auto;
}

.stat-empty {
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 15px;
}

/* Recent */

.recent {
  padding-block: 24px 80px;
}

.recent-list {
  padding: 0;
  list-style: none;
}

.recent-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.recent-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.recent-item__time {
  font-weight: 600;
}

.recent-item__link {
  padding: 6px 0;
  font-size: 15px;
  font-weight: 600;
}

.recent-item .code {
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tags li {
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-secondary);
}

/* API docs */

.api-jump {
  display: none;
}

.api-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px 56px;
  padding-block: 48px 88px;
}

.toc {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  padding-top: 14px;
  border-top: 3px solid var(--navy);
  font-size: 15px;
}

.toc a {
  padding: 8px 0;
  text-decoration: none;
}

.toc a[aria-current="true"] {
  color: var(--text);
  font-weight: 600;
}

.api-content {
  display: flex;
  flex: 999 1 600px;
  flex-direction: column;
  gap: 56px;
  min-width: 0;
}

.api-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 24px;
}

.api-section h2 {
  font-size: 26px;
}

.api-section p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.api-section .code {
  padding: 16px 18px;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.param-table thead tr {
  border-bottom: 2px solid var(--text);
  text-align: left;
}

.param-table th {
  padding: 10px 24px 10px 0;
}

.param-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.param-table td {
  padding: 14px 0;
  line-height: 1.55;
  color: var(--text-secondary);
  vertical-align: baseline;
}

.param-table td:first-child {
  padding-right: 24px;
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .toc {
    position: sticky;
    top: 24px;
  }
}

/* Services */

.services h2 {
  font-size: 28px;
}

.services .split__wide > p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.steps {
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  line-height: 1.45;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

.panel p {
  font-size: 17px;
  line-height: 1.6;
}

.panel .btn {
  align-self: flex-start;
  min-height: 48px;
  padding: 0 20px;
}

/* Contact */

.contact-lead {
  font-size: 22px;
  line-height: 1.5;
}

.contact .split__wide > p:not(.contact-lead) {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.contact-actions .btn {
  gap: 10px;
  min-height: 50px;
}

/* 404 */

.not-found .code {
  padding: 16px 18px;
  font-size: 15px;
}

.not-found .btn {
  align-self: flex-start;
}

.not-found .split__wide {
  gap: 6px;
}

.not-found h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.link-list {
  padding: 0;
  border-top: 3px solid var(--navy);
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid var(--border);
}

.link-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  text-decoration: none;
}

.link-list__title {
  font-size: 17px;
  font-weight: 600;
}

.link-list__text {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.link-list a:hover .link-list__title {
  text-decoration: underline;
}

/* Text pages: terms, messages, forms */

.prose {
  padding-block: 56px 88px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.prose > * {
  max-width: 760px;
}

.prose > * + * {
  margin-top: 16px;
}

.prose h2,
.prose h3 {
  color: var(--text);
  line-height: 1.25;
}

.prose h2 {
  margin-top: 40px;
  font-size: 22px;
}

.prose h3 {
  margin-top: 36px;
  font-size: 20px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose ol,
.prose ul {
  padding-left: 24px;
}

.prose li + li,
.prose li > ol {
  margin-top: 8px;
}

.prose .btn {
  margin-top: 24px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
  padding-top: 8px;
}

.stack-form .btn {
  align-self: flex-start;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.form-field input {
  min-height: 48px;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline-offset: 0;
}

/* Small screens */

@media (max-width: 759px) {
  :root {
    --page-padding: 20px;
    --code-size: 13px;
    --code-line: calc(13px * 1.65);
    --code-pad: 12px;
  }

  .header-bar {
    align-items: center;
    gap: 0 16px;
  }

  .wordmark {
    min-height: 60px;
    font-size: 22px;
  }

  .wordmark__php {
    padding: 1px 5px 2px;
  }

  /* Without scripting the links stay in the header, wrapped below the wordmark */
  .site-nav a {
    min-height: 44px;
    padding: 0 12px;
  }

  .title-band {
    border-top: 1px solid var(--navy-rule);
  }

  .title-band__inner,
  .title-band--home .title-band__inner {
    gap: 10px;
    padding: 28px 0 30px;
    border-top: 0;
  }

  .title-band--home .title-band__inner {
    padding-bottom: 32px;
  }

  .title-band h1,
  .title-band--home h1 {
    font-size: 30px;
    line-height: 1.15;
  }

  .title-band__subtitle {
    font-size: 17px;
  }

  .title-band__subtitle--code {
    font-size: 14px;
  }

  .site-footer p {
    padding: 20px 0;
    font-size: 14px;
  }

  .code {
    padding: 12px 14px;
  }

  .code-gutter {
    padding: 12px 8px;
  }

  .code-gutter--wide {
    display: none;
  }

  .code-box--input {
    --input-height: calc(var(--code-line) * 10 + 24px);
  }

  .code-input {
    padding: 12px;
    font-size: 14px;
  }

  .btn--lg {
    min-height: 52px;
  }

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

  .column-block {
    gap: 10px;
    padding-top: 16px;
  }

  .column-block h2 {
    font-size: 20px;
  }

  .split {
    flex-direction: column;
    align-items: stretch;
    gap: 48px;
    padding-block: 32px 56px;
  }

  .split__wide,
  .split__narrow {
    flex-basis: auto;
    gap: 16px;
  }

  .panel {
    padding: 20px;
  }

  /* Home */

  .decode-form {
    gap: 14px;
    padding-top: 28px;
  }

  .intro {
    font-size: 16px;
  }

  .decode-actions .btn--green {
    flex-basis: 100%;
  }

  .decode-actions .btn--secondary {
    min-height: 48px;
    padding: 0 16px;
  }

  .examples {
    padding-block: 48px 56px;
  }

  /* Decode results */

  .results {
    padding-block: 28px 56px;
  }

  .results__section {
    gap: 12px;
  }

  .results__original,
  .results .columns {
    margin-top: 44px;
  }

  .results__section h2 {
    font-size: 21px;
  }

  .results__head {
    flex-wrap: nowrap;
  }

  .results__head .btn {
    padding: 0 12px;
    font-size: 15px;
  }

  .results .column-block {
    gap: 8px;
    padding-top: 14px;
  }

  .results .column-block h2 {
    font-size: 19px;
  }

  .original-code .code {
    line-height: 1.6;
  }

  .stat-table .md5 {
    font-size: 13px;
  }

  .feedback {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .feedback__buttons {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .feedback__buttons .btn {
    min-height: 48px;
    padding: 0 8px;
  }

  /* Recent */

  .recent {
    padding-block: 8px 48px;
  }

  .recent-item {
    gap: 10px;
    padding: 22px 0;
  }

  .recent-item__head {
    flex-wrap: nowrap;
    gap: 12px;
  }

  .recent-item__time {
    font-size: 15px;
  }

  .recent-item__link {
    padding: 8px 0;
    white-space: nowrap;
  }

  .recent-item .code {
    padding: 10px 12px;
    font-size: 13px;
  }

  .tags {
    font-size: 12.5px;
  }

  /* API docs */

  .api-jump {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px var(--page-padding);
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
  }

  .api-jump label {
    font-size: 14px;
    font-weight: 600;
  }

  .api-jump select {
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 16px;
    font-weight: 500;
  }

  .toc {
    display: none;
  }

  .api-layout {
    padding-block: 32px 56px;
  }

  .api-content {
    gap: 44px;
  }

  .api-section {
    gap: 12px;
  }

  .api-section h2 {
    font-size: 23px;
  }

  .api-section .code {
    padding: 12px 14px;
  }

  :not(pre) > code {
    padding: 2px 5px;
    font-size: 14px;
    word-break: break-all;
  }

  .param-table,
  .param-table tbody,
  .param-table tr,
  .param-table td {
    display: block;
  }

  .param-table {
    border-top: 2px solid var(--text);
  }

  .param-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .param-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 0;
  }

  .param-table td,
  .param-table td:first-child {
    padding: 0;
  }

  /* Services and contact */

  .services h2 {
    font-size: 24px;
  }

  .services .split__wide > p {
    font-size: 17px;
  }

  .steps li {
    gap: 14px;
    padding: 14px 0;
    font-size: 16px;
  }

  .panel p {
    font-size: 16px;
  }

  .contact-lead {
    font-size: 19px;
  }

  .contact .split__wide > p:not(.contact-lead) {
    font-size: 16px;
  }

  .contact-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
  }

  .side-block h2 {
    font-size: 18px;
  }

  .panel .btn,
  .not-found .btn {
    align-self: stretch;
  }

  .not-found .code {
    padding: 14px 16px;
    font-size: 14px;
  }

  .not-found h2 {
    margin-bottom: 4px;
    font-size: 18px;
  }

  .link-list a {
    padding: 14px 0;
  }

  .prose {
    padding-block: 32px 56px;
  }
}

/* With scripting the small-screen header links move into the menu dialog */
@media (max-width: 759px) and (scripting: enabled) {
  .header-bar {
    padding-right: 8px;
  }

  .header-bar .site-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}
