/*
 * SCRHUB Design System V2 -- base.css
 *
 * THE SHARED LAYER. Every rule here describes something that exists in more
 * than one SCRHUB product, so it is part of the design language rather than
 * part of any one product. This file is generated by `scrhub-design-sync` from
 * the canonical source and must be BYTE-IDENTICAL everywhere it is deployed;
 * `scrhub-verify-design-system` fails if it is not.
 *
 * Do not edit a deployed copy. Edit the canonical source in
 * /opt/scrhub/design-system/v2/ and re-sync, or the fork this file exists to
 * close reopens immediately.
 *
 * Product-specific components -- Paste's editor, Links' slug field -- live in
 * the product's own stylesheet, where they are ALLOWED to differ because they
 * describe something the other product does not have.
 */

/*
 * SCR component layer.
 *
 * Depends on tokens.css and nothing else. No framework, no CDN, no build step
 * beyond fingerprinting.
 *
 * Accessibility is built into the components rather than bolted on, because the
 * audit's measurements were not marginal: across the 53 recovered templates
 * there was no ARIA at all, no programmatic label association, 28 of 34 images
 * had no alt text, focus indicators were removed on 21 controls, 196 of 280
 * inputs had neither an id nor an aria-label, modals had no dialog semantics or
 * focus trap, and all 16 target="_blank" links lacked rel="noopener".
 *
 * The rule here: a component either carries its own semantics or it does not
 * exist. `.scr-modal` is a <dialog>. `.scr-field` requires a <label for>.
 * `.scr-btn` is a <button> or an <a>, never a <div>.
 */
/* ============================================================ reset + base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--scr-bg);
  color: var(--scr-text);
  font-family: var(--scr-font-sans);
  font-size: var(--scr-text-base);
  line-height: var(--scr-leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--scr-weight-semibold);
  line-height: var(--scr-leading-tight);
  letter-spacing: var(--scr-tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--scr-text-2xl);
}

h2 {
  font-size: var(--scr-text-xl);
}

h3 {
  font-size: var(--scr-text-lg);
}

h4 {
  font-size: var(--scr-text-md);
}

p {
  margin: 0 0 var(--scr-space-4);
  text-wrap: pretty;
}

a {
  color: var(--scr-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--scr-accent-strong);
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

code,
kbd,
samp,
pre {
  font-family: var(--scr-font-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--scr-space-4);
  background: var(--scr-surface-sunken);
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
}

hr {
  border: 0;
  border-top: 1px solid var(--scr-border);
  margin: var(--scr-space-6) 0;
}

/* One focus treatment. Never removed, only replaced. */
:focus-visible {
  outline: none;
  box-shadow: var(--scr-focus-ring);
  border-radius: var(--scr-radius-sm);
}

/* Screen-reader-only text, for the labels the recovered templates omitted. */
.scr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: the first thing in the tab order on every page. */
.scr-skip-link {
  position: absolute;
  left: var(--scr-space-3);
  top: calc(var(--scr-space-3) * -6);
  z-index: 100;
  padding: var(--scr-space-2) var(--scr-space-4);
  background: var(--scr-accent);
  color: var(--scr-text-on-accent);
  border-radius: var(--scr-radius);
  transition: top var(--scr-duration) var(--scr-ease);
}

.scr-skip-link:focus {
  top: var(--scr-space-3);
}

/* ================================================================= layout */
.scr-container {
  width: 100%;
  max-width: var(--scr-container);
  margin-inline: auto;
  padding-inline: var(--scr-space-4);
}

.scr-container--narrow {
  max-width: var(--scr-container-narrow);
}

.scr-container--wide {
  max-width: var(--scr-container-wide);
}

.scr-main {
  flex: 1 0 auto;
  padding-block: var(--scr-space-6) var(--scr-space-8);
}

.scr-stack {
  display: flex;
  flex-direction: column;
  gap: var(--scr-space-4);
}

.scr-stack--tight {
  gap: var(--scr-space-2);
}

.scr-stack--loose {
  gap: var(--scr-space-6);
}

.scr-row {
  display: flex;
  align-items: center;
  gap: var(--scr-space-3);
  flex-wrap: wrap;
}

.scr-row--between {
  justify-content: space-between;
}

.scr-row--end {
  justify-content: flex-end;
}

.scr-grid {
  display: grid;
  gap: var(--scr-space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
}

.scr-page-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--scr-space-4);
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--scr-space-6);
  padding-bottom: var(--scr-space-4);
  border-bottom: 1px solid var(--scr-border);
}

.scr-page-header__lead {
  margin: var(--scr-space-2) 0 0;
  color: var(--scr-text-muted);
  max-width: 60ch;
}

/* ================================================================ header */
.scr-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /*
   * Translucent over the page rather than a solid slab, so long paste content
   * scrolling underneath reads as one surface. Falls back to the flat colour
   * where backdrop-filter is unsupported.
   */
  background: var(--scr-bg);
  border-bottom: 1px solid var(--scr-border);
}

@supports (backdrop-filter: blur(1px)) {
  .scr-header {
    background: color-mix(in srgb, var(--scr-bg) 82%, transparent);
    backdrop-filter: saturate(140%) blur(12px);
  }
}

.scr-header__inner {
  display: flex;
  align-items: center;
  gap: var(--scr-space-4);
  min-height: var(--scr-header-height);
}

.scr-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--scr-space-2);
  font-weight: var(--scr-weight-semibold);
  font-size: var(--scr-text-md);
  color: var(--scr-text);
  text-decoration: none;
  letter-spacing: var(--scr-tracking-tight);
}

.scr-nav {
  display: flex;
  align-items: center;
  gap: var(--scr-space-1);
  margin-left: auto;
}

/*
 * `min-height` rather than padding alone: a text link that is only as tall as
 * its text is a 22px touch target, which is under every published minimum. The
 * visual weight is unchanged; the hit area is not.
 */
.scr-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 var(--scr-space-3);
  border-radius: var(--scr-radius);
  color: var(--scr-text-muted);
  text-decoration: none;
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-medium);
}

.scr-nav__link:hover {
  background: var(--scr-surface-sunken);
  color: var(--scr-text);
}

.scr-nav__link[aria-current='page'] {
  color: var(--scr-accent);
  background: var(--scr-accent-soft);
}

/* Mobile navigation is a details/summary disclosure, so it works with no JS. */
.scr-nav-toggle {
  display: none;
}

/* ================================================================ buttons */
.scr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--scr-space-2);
  /*
   * 36px tall, radius 10px, weight 600. Measured on shop.scrhub.net's primary
   * button and the main site's "Visit" button, which agree exactly.
   */
  padding: 0 var(--scr-space-4);
  min-height: 2.25rem;
  border: 1px solid transparent;
  border-radius: var(--scr-radius-lg);
  background: var(--scr-accent);
  color: var(--scr-text-on-accent);
  font: inherit;
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--scr-duration-fast) var(--scr-ease),
    border-color var(--scr-duration-fast) var(--scr-ease);
}

.scr-btn:hover:not(:disabled) {
  background: var(--scr-accent-strong);
  color: var(--scr-text-on-accent);
}

.scr-btn:disabled,
.scr-btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.scr-btn--secondary {
  background: var(--scr-surface);
  color: var(--scr-text);
  border-color: var(--scr-border-strong);
}

.scr-btn--secondary:hover:not(:disabled) {
  background: var(--scr-surface-sunken);
  color: var(--scr-text);
}

/*
 * The ghost button carries a border on a dark ground.
 *
 * Transparent with no outline, it was indistinguishable from a label: in the
 * links table a "Copy" ghost sat next to a bordered "Open" and read as static
 * text rather than a control, which is the affordance failing outright. The
 * estate's own ghost is bordered (`account.scrhub.net`:
 * `button.ghost{background:transparent;border:1px solid var(--scr-border-strong)}`).
 */
.scr-btn--ghost {
  background: transparent;
  color: var(--scr-text-muted);
  border-color: var(--scr-border-strong);
}

.scr-btn--ghost:hover:not(:disabled) {
  background: var(--scr-surface-sunken);
  color: var(--scr-text);
}

.scr-btn--danger {
  background: var(--scr-danger);
}

.scr-btn--danger:hover:not(:disabled) {
  filter: brightness(0.92);
}

.scr-btn--sm {
  min-height: 2rem;
  padding: var(--scr-space-1) var(--scr-space-3);
  font-size: var(--scr-text-xs);
}

.scr-btn--lg {
  min-height: 3rem;
  padding: var(--scr-space-3) var(--scr-space-5);
  font-size: var(--scr-text-base);
}

.scr-btn--block {
  width: 100%;
}

/*
 * Pending state, driven by a data attribute the shared script sets on submit.
 * The audit found no loading, disabled or double-submit protection on any form
 * in the recovered product, including the three multipart uploads and checkout.
 */
.scr-btn[data-scr-pending='true'] {
  pointer-events: none;
  opacity: 0.7;
}

.scr-btn[data-scr-pending='true']::before {
  content: '';
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: scr-spin 0.7s linear infinite;
}

@keyframes scr-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================================================================== forms */
.scr-field {
  display: flex;
  flex-direction: column;
  gap: var(--scr-space-2);
}

.scr-label {
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-medium);
  color: var(--scr-text);
}

.scr-label__optional {
  font-weight: var(--scr-weight-normal);
  color: var(--scr-text-subtle);
}

.scr-input,
.scr-select,
.scr-textarea {
  width: 100%;
  padding: var(--scr-space-2) var(--scr-space-3);
  min-height: 2.5rem;
  border: 1px solid var(--scr-border-strong);
  border-radius: var(--scr-radius);
  background: var(--scr-surface);
  color: var(--scr-text);
  font: inherit;
  font-size: var(--scr-text-sm);
}

.scr-textarea {
  min-height: 8rem;
  resize: vertical;
  line-height: var(--scr-leading-normal);
}

.scr-input::placeholder,
.scr-textarea::placeholder {
  color: var(--scr-text-subtle);
}

.scr-input:disabled,
.scr-select:disabled,
.scr-textarea:disabled {
  background: var(--scr-surface-sunken);
  color: var(--scr-text-subtle);
  cursor: not-allowed;
}

.scr-input[aria-invalid='true'],
.scr-select[aria-invalid='true'],
.scr-textarea[aria-invalid='true'] {
  border-color: var(--scr-danger);
}

.scr-hint {
  font-size: var(--scr-text-xs);
  color: var(--scr-text-muted);
}

.scr-error {
  font-size: var(--scr-text-xs);
  color: var(--scr-danger);
  font-weight: var(--scr-weight-medium);
}

.scr-checkbox,
.scr-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--scr-space-2);
  font-size: var(--scr-text-sm);
  cursor: pointer;
}

.scr-checkbox input,
.scr-radio input {
  margin: 0;
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  accent-color: var(--scr-accent);
  margin-top: 0.15em;
}

/*
 * A grouped section of a form.
 *
 * Rendered as a card with the legend as its heading rather than as a browser
 * fieldset with the legend notched into the border. The notched form is a
 * default nobody chose: it dates the page, it breaks the card's corner radius,
 * and on a narrow screen a long legend wraps through the border. The element
 * stays a real <fieldset> with a real <legend>, so the grouping is still
 * announced -- only the painting changed.
 */
.scr-fieldset {
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  padding: var(--scr-space-5);
  margin: 0;
  background: var(--scr-surface);
  /* `min-width: 0` because a fieldset's default min-content sizing lets a wide
     child (a long <select>, a code block) push the page sideways. */
  min-width: 0;
}

.scr-fieldset > legend {
  /* `float` takes the legend out of the border-notch layout so it sits as an
     ordinary heading; the padding below then belongs to the group, not to it. */
  float: left;
  width: 100%;
  padding: 0 0 var(--scr-space-4);
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-semibold);
  color: var(--scr-text);
}

/* =================================================================== card */
.scr-card {
  background: var(--scr-surface);
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius-lg);
  overflow: hidden;
}

/*
 * A card with its own padding, for content that is not wrapped in
 * `.scr-card__body`. Links styled the base card with padding and then had to
 * pull `.scr-card__media` back out again with negative margins; that is the
 * shape of a rule that is doing two jobs. The base card is a surface, the
 * modifier adds inset, and the media element needs no correction in either.
 */
.scr-card--pad {
  padding: var(--scr-space-5);
}

.scr-card__media {
  aspect-ratio: 16 / 9;
  background: var(--scr-surface-sunken);
  object-fit: cover;
  width: 100%;
  display: block;
}

.scr-card__body {
  padding: var(--scr-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--scr-space-2);
}

.scr-card__title {
  font-size: var(--scr-text-md);
  margin: 0;
}

.scr-card__meta {
  font-size: var(--scr-text-sm);
  color: var(--scr-text-muted);
}

.scr-card__footer {
  padding: var(--scr-space-3) var(--scr-space-4);
  border-top: 1px solid var(--scr-border);
  background: var(--scr-surface-sunken);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--scr-space-3);
}

.scr-price {
  font-size: var(--scr-text-lg);
  font-weight: var(--scr-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.scr-price__was {
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-normal);
  color: var(--scr-text-subtle);
  text-decoration: line-through;
  margin-right: var(--scr-space-2);
}

/* ================================================================== table */
.scr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius-lg);
  background: var(--scr-surface);
}

.scr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--scr-text-sm);
}

.scr-table caption {
  text-align: left;
  padding: var(--scr-space-3) var(--scr-space-4);
  color: var(--scr-text-muted);
  font-size: var(--scr-text-xs);
}

.scr-table th,
.scr-table td {
  padding: var(--scr-space-3) var(--scr-space-4);
  text-align: left;
  border-bottom: 1px solid var(--scr-border);
  vertical-align: top;
}

.scr-table thead th {
  background: var(--scr-surface-sunken);
  font-size: var(--scr-text-xs);
  font-weight: var(--scr-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--scr-tracking-wide);
  color: var(--scr-text-muted);
  white-space: nowrap;
}

.scr-table tbody tr:last-child td {
  border-bottom: 0;
}

.scr-table td.scr-num,
.scr-table th.scr-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ================================================================= badges */
/*
 * The estate's pill, measured on scrhub.net's "ALL SYSTEMS OPERATIONAL":
 * radius 1000px, 11px / weight 700, uppercase, .25px tracking, padding 0 10px,
 * and the colour at full strength on the same colour at 10% alpha.
 */
.scr-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--scr-space-1);
  padding: 0.28rem 0.625rem;
  border: 1px solid transparent;
  border-radius: var(--scr-radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  background: var(--scr-surface-raised);
  color: var(--scr-text-muted);
  white-space: nowrap;
  line-height: 1.2;
}

.scr-badge--success {
  background: var(--scr-success-soft);
  color: var(--scr-success);
}

.scr-badge--warning {
  background: var(--scr-warning-soft);
  color: var(--scr-warning);
}

.scr-badge--danger {
  background: var(--scr-danger-soft);
  color: var(--scr-danger);
}

.scr-badge--info {
  background: var(--scr-info-soft);
  color: var(--scr-info);
}

.scr-badge--accent {
  background: var(--scr-accent-soft);
  color: var(--scr-accent);
}

/*
 * Status dot, so an order state is legible without relying on colour alone.
 * Colour is never the only signal: every badge also carries its label.
 */
.scr-badge__dot {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ================================================================= alerts */
.scr-alert {
  display: flex;
  gap: var(--scr-space-3);
  padding: var(--scr-space-3) var(--scr-space-4);
  border: 1px solid var(--scr-border);
  border-left-width: 3px;
  border-radius: var(--scr-radius);
  background: var(--scr-surface);
  font-size: var(--scr-text-sm);
}

.scr-alert__body {
  flex: 1;
}

.scr-alert__title {
  font-weight: var(--scr-weight-semibold);
  margin: 0 0 var(--scr-space-1);
}

.scr-alert p:last-child {
  margin-bottom: 0;
}

.scr-alert--success {
  border-left-color: var(--scr-success);
  background: var(--scr-success-soft);
}

.scr-alert--warning {
  border-left-color: var(--scr-warning);
  background: var(--scr-warning-soft);
}

.scr-alert--danger {
  border-left-color: var(--scr-danger);
  background: var(--scr-danger-soft);
}

.scr-alert--info {
  border-left-color: var(--scr-info);
  background: var(--scr-info-soft);
}

/* ================================================================== modal */
/*
 * A real <dialog>. The browser gives us the focus trap, the escape handler, the
 * inert background and the correct role for free, all of which the recovered
 * hand-rolled modals lacked.
 */
.scr-modal {
  width: min(32rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius-lg);
  background: var(--scr-surface);
  color: var(--scr-text);
  box-shadow: var(--scr-shadow-lg);
}

.scr-modal::backdrop {
  background: var(--scr-overlay);
}

.scr-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--scr-space-3);
  padding: var(--scr-space-4);
  border-bottom: 1px solid var(--scr-border);
}

.scr-modal__title {
  font-size: var(--scr-text-md);
  margin: 0;
}

.scr-modal__body {
  padding: var(--scr-space-4);
}

.scr-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--scr-space-2);
  padding: var(--scr-space-3) var(--scr-space-4);
  border-top: 1px solid var(--scr-border);
  background: var(--scr-surface-sunken);
}

/* ================================================== empty / error / loading */
.scr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--scr-space-3);
  padding: var(--scr-space-8) var(--scr-space-4);
  text-align: center;
  border: 1px dashed var(--scr-border-strong);
  border-radius: var(--scr-radius-lg);
  background: var(--scr-surface);
}

.scr-empty__title {
  font-size: var(--scr-text-md);
  margin: 0;
}

.scr-empty__body {
  color: var(--scr-text-muted);
  max-width: 44ch;
  margin: 0;
}

.scr-skeleton {
  background: linear-gradient(
    90deg,
    var(--scr-surface-sunken) 25%,
    var(--scr-border) 37%,
    var(--scr-surface-sunken) 63%
  );
  background-size: 400% 100%;
  animation: scr-shimmer 1.4s ease infinite;
  border-radius: var(--scr-radius-sm);
  min-height: 1em;
}

@keyframes scr-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ============================================================== pagination */
.scr-pagination {
  display: flex;
  gap: var(--scr-space-1);
  align-items: center;
  justify-content: center;
  margin-top: var(--scr-space-6);
  flex-wrap: wrap;
}

.scr-pagination__link {
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding-inline: var(--scr-space-2);
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  color: var(--scr-text-muted);
  text-decoration: none;
  font-size: var(--scr-text-sm);
  font-variant-numeric: tabular-nums;
}

.scr-pagination__link:hover {
  background: var(--scr-surface-sunken);
  color: var(--scr-text);
}

.scr-pagination__link[aria-current='page'] {
  background: var(--scr-accent);
  border-color: var(--scr-accent);
  color: var(--scr-text-on-accent);
}

/* ================================================================== footer */
.scr-footer {
  flex: none;
  border-top: 1px solid var(--scr-border);
  background: transparent;
  padding-block: var(--scr-space-5);
  font-size: var(--scr-text-sm);
  color: var(--scr-text-subtle);
}

.scr-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--scr-space-4);
  align-items: center;
  justify-content: space-between;
}

.scr-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  color: var(--scr-text-muted);
  text-decoration: none;
}

.scr-footer a:hover {
  color: var(--scr-text);
  text-decoration: underline;
}

/* =============================================================== utilities */
.scr-muted {
  color: var(--scr-text-muted);
}

.scr-subtle {
  color: var(--scr-text-subtle);
}

.scr-mono {
  font-family: var(--scr-font-mono);
}

.scr-nums {
  font-variant-numeric: tabular-nums;
}

.scr-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scr-break {
  overflow-wrap: anywhere;
}

.scr-text-sm {
  font-size: var(--scr-text-sm);
}

.scr-text-xs {
  font-size: var(--scr-text-xs);
}

.scr-hidden {
  display: none !important;
}

.scr-prose {
  max-width: 68ch;
}

.scr-prose > :last-child {
  margin-bottom: 0;
}

.scr-prose h2,
.scr-prose h3 {
  margin-top: var(--scr-space-6);
  margin-bottom: var(--scr-space-3);
}

.scr-prose ul,
.scr-prose ol {
  margin: 0 0 var(--scr-space-4);
  padding-left: var(--scr-space-5);
}

.scr-prose li {
  margin-bottom: var(--scr-space-2);
}

.scr-prose img {
  border-radius: var(--scr-radius);
}

.scr-prose blockquote {
  margin: 0 0 var(--scr-space-4);
  padding-left: var(--scr-space-4);
  border-left: 3px solid var(--scr-border-strong);
  color: var(--scr-text-muted);
}

/* ------------------------------------------------------- spacing utilities */
/*
 * These exist so no template needs a `style` attribute.
 *
 * A Content-Security-Policy nonce covers a <style> ELEMENT, not a style
 * ATTRIBUTE. `style-src 'self' 'nonce-...'` with no 'unsafe-inline' therefore
 * blocks every inline style attribute, and the pages rendered with their
 * spacing silently missing. The choice was to weaken style-src or to stop
 * writing inline styles; weakening a policy to accommodate markup is the wrong
 * way round, so here are the utilities the markup actually needed.
 */
.scr-m-0 {
  margin: 0;
}

.scr-mt-4 {
  margin-top: var(--scr-space-4);
}

.scr-mt-5 {
  margin-top: var(--scr-space-5);
}

.scr-mt-6 {
  margin-top: var(--scr-space-6);
}

.scr-mb-4 {
  margin-bottom: var(--scr-space-4);
}

.scr-mb-5 {
  margin-bottom: var(--scr-space-5);
}

.scr-mb-6 {
  margin-bottom: var(--scr-space-6);
}

.scr-text-center {
  text-align: center;
}

.scr-items-start {
  align-items: start;
}

.scr-list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scr-w-20 {
  width: 5rem;
}

.scr-min-w-lg {
  min-width: 18rem;
}

.scr-max-w-sm {
  max-width: 22rem;
}

/* Print: an invoice or an order page should print cleanly. */
@media print {
  .scr-header,
  .scr-footer,
  .scr-skip-link,
  .scr-no-print {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .scr-table-wrap,
  .scr-card {
    border-color: #999;
  }
}

/* ==================================================== SCRHUB Paste surfaces */
/*
 * Added for the SCRHUB productization. Everything below is composed from the
 * same tokens as the rest of the file, so a theme change reaches it without
 * any of it knowing a theme exists.
 */
.scr-hero {
  margin-block-end: var(--scr-space-6);
}

/* A centred hero, for a landing page rather than an application page. */
.scr-hero--centred {
  padding: var(--scr-space-8) 0 var(--scr-space-7);
  text-align: center;
  margin-block-end: var(--scr-space-6);
}

.scr-hero--centred .scr-hero__lead {
  margin-inline: auto;
  max-width: 34rem;
  font-size: var(--scr-text-md);
}

.scr-hero__title {
  margin: 0 0 var(--scr-space-2);
  font-size: var(--scr-text-2xl);
  /* 700, not 600: the Shop, Status, Guard, Links and Account h1 all measure 700.
     Paste was the only surface at 600. The margin is Paste's and is kept, because
     a title with no gap under it is a defect the others work around per page. */
  font-weight: var(--scr-weight-bold);
  letter-spacing: var(--scr-tracking-tight);
  line-height: var(--scr-leading-tight);
}

.scr-hero__lead {
  margin: 0;
  max-width: 52ch;
  color: var(--scr-text-muted);
}

/* ---------------------------------------------------------- disclosure ---- */
/*
 * A real <details>. It opens with no JavaScript, it is keyboard operable for
 * free, and a screen reader announces its expanded state without any ARIA
 * being written by hand.
 */
.scr-disclosure {
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  background: var(--scr-surface);
}

/* A disclosure with no chrome: a rule above it and nothing else. */
.scr-disclosure--plain {
  border: 0;
  border-top: 1px solid var(--scr-border);
  border-radius: 0;
  background: transparent;
  padding-top: var(--scr-space-3);
}

.scr-disclosure__summary {
  display: flex;
  align-items: baseline;
  gap: var(--scr-space-3);
  min-height: 2.75rem;
  padding: var(--scr-space-3) var(--scr-space-4);
  cursor: pointer;
  list-style: none;
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-medium);
  border-radius: var(--scr-radius);
}

.scr-disclosure__summary::-webkit-details-marker {
  display: none;
}

/* A disclosure triangle, drawn rather than imported. */
.scr-disclosure__summary::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: rotate(-45deg);
  transition: transform var(--scr-duration-fast) var(--scr-ease);
  flex: none;
  align-self: center;
}

.scr-disclosure[open] > .scr-disclosure__summary::before {
  transform: rotate(45deg);
}

.scr-disclosure__summary:hover {
  background: var(--scr-surface-raised);
}

/* ------------------------------------------------------------ danger zone */
.scr-danger-zone {
  margin-block-start: var(--scr-space-7);
  padding: var(--scr-space-5);
  border: 1px solid color-mix(in srgb, var(--scr-danger) 35%, var(--scr-border));
  border-radius: var(--scr-radius);
  background: var(--scr-danger-soft);
}

/* ------------------------------------------------------------- stat tiles */
/*
 * The dashboard's headline numbers.
 *
 * `auto-fit` with a `minmax` floor rather than a fixed column count, so the row
 * reflows from four across to two to one without a breakpoint per step.
 */
.scr-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--scr-space-4);
  margin-bottom: var(--scr-space-6);
}

.scr-stat {
  background: var(--scr-surface);
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  padding: var(--scr-space-4) var(--scr-space-5);
}

.scr-stat__value {
  display: block;
  font-size: var(--scr-text-xl);
  font-weight: var(--scr-weight-semibold);
  line-height: var(--scr-leading-tight);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--scr-tracking-tight);
}

.scr-stat__label {
  display: block;
  margin-top: var(--scr-space-1);
  color: var(--scr-text-muted);
  font-size: var(--scr-text-sm);
}

/* --------------------------------------------------------- narrow screens */
/*
 * A data table cannot be made narrow, so on a phone it scrolls inside its own
 * box rather than widening the document. `-webkit-overflow-scrolling` gives it
 * momentum on iOS, and the caption stays outside the scroller so the table is
 * still announced with its description.
 */
@media (max-width: 48rem) {
  .scr-table-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

  .scr-table {
      min-width: 34rem;
    }

  .scr-page-header {
      flex-direction: column;
      align-items: flex-start;
    }

  .scr-nav {
      display: none;
    }

  .scr-nav-toggle {
      display: block;
      margin-left: auto;
    }

  .scr-nav-toggle[open] .scr-nav-toggle__panel {
      display: flex;
    }

  .scr-nav-toggle__panel {
      display: none;
      position: absolute;
      right: var(--scr-space-4);
      left: var(--scr-space-4);
      flex-direction: column;
      gap: var(--scr-space-1);
      margin-top: var(--scr-space-2);
      padding: var(--scr-space-2);
      background: var(--scr-surface-raised);
      border: 1px solid var(--scr-border);
      border-radius: var(--scr-radius-lg);
      box-shadow: var(--scr-shadow-lg);
    }

  .scr-nav-toggle__summary {
      list-style: none;
      cursor: pointer;
    }

  .scr-nav-toggle__summary::-webkit-details-marker {
      display: none;
    }
}

@media (max-width: 40rem) {
  .scr-card {
    padding: var(--scr-space-4);
  }
}

/*
 * SCRHUB Paste -- product stylesheet.
 *
 * Only what Paste has and the rest of the estate does not: the compose area,
 * the code viewer, the copy row, the created-paste panel. Everything shared
 * lives in base.css and is identical in every product.
 */

/*
 * The approved SCR mark. It is already a dark rounded tile with the amber
 * letterform baked in, so it needs no plate behind it -- just the estate's
 * radius, so it sits on the same grid as everything else.
 */
.scr-brand__logo {
  display: block;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: var(--scr-radius-sm);
  flex: none;
}

.scr-brand__name {
  font-weight: var(--scr-weight-semibold);
}

/* Kept for any caller still passing a letter rather than the asset. */
.scr-brand__mark {
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: var(--scr-radius-sm);
  background: var(--scr-accent);
  color: var(--scr-text-on-accent);
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-semibold);
}

@media (max-width: 48rem) {
  .scr-nav {
    display: none;
  }
  .scr-nav-toggle {
    display: block;
    margin-left: auto;
  }
  .scr-nav-toggle[open] .scr-nav-toggle__panel {
    display: flex;
  }
  .scr-nav-toggle__panel {
    display: none;
    position: absolute;
    right: var(--scr-space-4);
    left: var(--scr-space-4);
    flex-direction: column;
    gap: var(--scr-space-1);
    margin-top: var(--scr-space-2);
    padding: var(--scr-space-2);
    background: var(--scr-surface-raised);
    border: 1px solid var(--scr-border);
    border-radius: var(--scr-radius-lg);
    box-shadow: var(--scr-shadow-lg);
  }
  .scr-nav-toggle__summary {
    display: inline-flex;
    align-items: center;
    gap: var(--scr-space-2);
    min-height: 2.25rem;
    padding: 0 var(--scr-space-3);
    border: 1px solid var(--scr-border);
    border-radius: var(--scr-radius);
    background: var(--scr-surface);
    color: var(--scr-text);
    font-size: var(--scr-text-sm);
    font-weight: var(--scr-weight-medium);
    list-style: none;
    cursor: pointer;
  }
  .scr-nav-toggle__summary::-webkit-details-marker {
    display: none;
  }
  /* Three bars, drawn in CSS so the menu needs no icon font and no SVG. */
  .scr-nav-toggle__bars,
  .scr-nav-toggle__bars::before,
  .scr-nav-toggle__bars::after {
    display: block;
    width: 14px;
    height: 1.5px;
    border-radius: 1px;
    background: currentcolor;
  }
  .scr-nav-toggle__bars {
    position: relative;
  }
  .scr-nav-toggle__bars::before,
  .scr-nav-toggle__bars::after {
    content: '';
    position: absolute;
    left: 0;
  }
  .scr-nav-toggle__bars::before {
    top: -4.5px;
  }
  .scr-nav-toggle__bars::after {
    top: 4.5px;
  }
}

/* The float has to be cleared or the first field sits beside the legend. */
.scr-fieldset > legend + * {
  clear: both;
}

.scr-footer__legal {
  color: var(--scr-text-subtle);
}

.scr-footer__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--scr-space-5);
}

.scr-footer__links {
  display: flex;
  gap: var(--scr-space-4);
}

/*
 * Theme switch: one segmented control rather than three loose buttons, which
 * is what it behaves like. `aria-pressed` is set by the shared script, so the
 * active segment is announced and not merely coloured.
 */
.scr-theme-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  background: var(--scr-surface);
}

.scr-theme-switch button {
  min-height: 1.75rem;
  padding: 0 var(--scr-space-3);
  border: 0;
  border-radius: var(--scr-radius-sm);
  background: transparent;
  color: var(--scr-text-muted);
  font: inherit;
  font-size: var(--scr-text-xs);
  font-weight: var(--scr-weight-medium);
  cursor: pointer;
}

.scr-theme-switch button:hover {
  color: var(--scr-text);
}

.scr-theme-switch button[aria-pressed='true'] {
  background: var(--scr-surface-raised);
  color: var(--scr-text);
}

/* ------------------------------------------------------------- the compose */
.scr-compose {
  display: flex;
  flex-direction: column;
  gap: var(--scr-space-4);
}

/*
 * The paste body is monospace and its own sunken surface, so it reads as the
 * thing being written rather than as one more form field. `field-sizing` lets
 * it grow with the content where supported; `rows` is the floor everywhere
 * else.
 */
.scr-compose__area {
  min-height: 18rem;
  font-family: var(--scr-font-mono);
  font-size: var(--scr-text-sm);
  line-height: var(--scr-leading-normal);
  background: var(--scr-surface-sunken);
  resize: vertical;
  tab-size: 2;
}

.scr-compose__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--scr-space-4);
}

.scr-disclosure__hint {
  color: var(--scr-text-subtle);
  font-size: var(--scr-text-xs);
  font-weight: var(--scr-weight-normal);
}

.scr-disclosure__body {
  display: flex;
  flex-direction: column;
  gap: var(--scr-space-5);
  padding: var(--scr-space-2) var(--scr-space-4) var(--scr-space-5);
  border-top: 1px solid var(--scr-border);
}

/* ------------------------------------------------------------------ layout */
.scr-grid-2 {
  display: grid;
  gap: var(--scr-space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .scr-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------------- checkbox */
.scr-check {
  display: flex;
  align-items: flex-start;
  gap: var(--scr-space-3);
}

/*
 * 24px, unconditionally.
 *
 * WCAG 2.2 Target Size (Minimum) asks for 24 CSS pixels. A measuring pass
 * found this at 18px, then 22px, then 20px as successive corrections chased it
 * through a `pointer: coarse` media query -- which only helps if the browser
 * reports a coarse pointer, and a desktop with a touchscreen does not. Sizing
 * it once, for everyone, is both simpler and correct on more devices; a 24px
 * checkbox is not too large for a mouse. The label beside it is a target too
 * and is padded to match.
 */
.scr-check__input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0 0 0;
  accent-color: var(--scr-accent);
  flex: none;
}

.scr-check__label {
  display: block;
  font-size: var(--scr-text-sm);
  font-weight: var(--scr-weight-medium);
  cursor: pointer;
}

/* ------------------------------------------------------- the created panel */
.scr-created {
  margin-block-end: var(--scr-space-5);
  padding: var(--scr-space-4);
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  background: var(--scr-surface);
}

.scr-created__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--scr-space-3);
  margin-block-end: var(--scr-space-3);
}

.scr-created__note {
  color: var(--scr-text-muted);
  font-size: var(--scr-text-sm);
}

.scr-copyrow {
  display: flex;
  gap: var(--scr-space-2);
}

/*
 * The URL field is monospace and grows; the button never shrinks below its
 * label. On a narrow screen the row wraps rather than squeezing the button
 * into an unreadable sliver.
 */
.scr-copyrow__url {
  flex: 1 1 12rem;
  min-width: 0;
  font-family: var(--scr-font-mono);
  font-size: var(--scr-text-sm);
}

.scr-copyrow .scr-btn {
  flex: none;
}

@media (max-width: 30rem) {
  .scr-copyrow {
    flex-wrap: wrap;
  }
  .scr-copyrow .scr-btn {
    width: 100%;
  }
}

/* -------------------------------------------------------- the paste header */
.scr-paste-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--scr-space-4);
  margin-block-end: var(--scr-space-4);
}

.scr-paste-head__main {
  min-width: 0;
}

.scr-paste-head__title {
  margin: 0 0 var(--scr-space-1);
  font-size: var(--scr-text-lg);
  font-weight: var(--scr-weight-semibold);
  /* A long title wraps instead of pushing the actions off the screen. */
  overflow-wrap: anywhere;
}

.scr-paste-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--scr-space-2);
  margin: 0;
  color: var(--scr-text-muted);
  font-size: var(--scr-text-sm);
}

.scr-paste-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--scr-space-2);
}

/* A separator that is decoration, so it is never read aloud. */
.scr-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentcolor;
  opacity: 0.5;
}

/* --------------------------------------------------------------- the code */
/*
 * The paste body.
 *
 * `overflow-x: auto` on the container is what keeps a 4000-character single
 * line from widening the document and giving the whole page a horizontal
 * scrollbar. The pre does NOT wrap: code that is wrapped silently is code that
 * has been altered on screen, and someone copying it out should get what was
 * pasted in. The scroll is the honest answer, and it is scoped to this box.
 */
.scr-code {
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  background: var(--scr-surface-sunken);
  overflow: hidden;
}

.scr-code__body {
  margin: 0;
  padding: var(--scr-space-4);
  overflow-x: auto;
  font-family: var(--scr-font-mono);
  font-size: var(--scr-text-sm);
  line-height: var(--scr-leading-normal);
  tab-size: 2;
  /* -webkit-overflow-scrolling gives momentum scrolling inside the box on iOS. */
  -webkit-overflow-scrolling: touch;
}

.scr-code__body code {
  display: block;
  min-width: max-content;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

/* ------------------------------------------------- centred single-purpose */
/*
 * The password gate and the empty/error states. One narrow column, centred,
 * because each is a single decision with nothing else on the page.
 */
.scr-gate,
.scr-empty {
  max-width: 26rem;
  margin-inline: auto;
  padding-block: var(--scr-space-7);
  text-align: center;
}

.scr-gate__icon,
.scr-empty__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--scr-space-4);
  border: 1px solid var(--scr-border);
  border-radius: var(--scr-radius);
  background: var(--scr-surface);
  color: var(--scr-text-muted);
}

.scr-gate__title,
.scr-empty__title {
  margin: 0 0 var(--scr-space-2);
  font-size: var(--scr-text-lg);
  font-weight: var(--scr-weight-semibold);
}

.scr-gate__lead,
.scr-empty__lead {
  margin: 0 0 var(--scr-space-5);
  color: var(--scr-text-muted);
}

/* The form inside the gate is left-aligned: a centred label above a field
   reads badly and a centred error message is hard to associate with it. */
.scr-gate__form {
  text-align: start;
}

.scr-gate__actions,
.scr-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--scr-space-3);
  margin-block-start: var(--scr-space-5);
}

.scr-gate__actions {
  justify-content: flex-start;
}

.scr-empty__actions {
  justify-content: center;
}

.scr-empty__ref {
  margin-block-start: var(--scr-space-6);
  color: var(--scr-text-subtle);
  font-size: var(--scr-text-xs);
}

.scr-danger-zone__head {
  margin-block-end: var(--scr-space-4);
}

.scr-danger-zone__title {
  margin: 0 0 var(--scr-space-1);
  font-size: var(--scr-text-md);
  font-weight: var(--scr-weight-semibold);
  color: var(--scr-danger);
}

.scr-danger-zone__lead {
  color: var(--scr-text-muted);
  font-size: var(--scr-text-sm);
  max-width: 60ch;
}

/* --------------------------------------------------------- touch targets */
/*
 * Measured, not guessed. A rendering pass at 390px reported the footer links
 * at 22px tall, the theme buttons at 28px and the brand at 29px. WCAG 2.2
 * Target Size (Minimum) asks for 24px; the platform guidance most people
 * follow asks for more. These are raised to at least 32px without changing how
 * any of them looks, because the padding grows around the text rather than the
 * text growing.
 *
 * The checkbox is left at its native size and given a padded label instead:
 * enlarging the control itself makes it look like a toggle, and the whole
 * label is already clickable.
 */
.scr-footer__links a,
.scr-brand {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
}

.scr-theme-switch button {
  min-height: 2rem;
}

.scr-check__label {
  padding-block: var(--scr-space-1);
}

/*
 * Coarse pointers get more room again. A mouse can hit a 32px target; a thumb
 * on a phone is working with about 9mm of contact patch.
 */
@media (pointer: coarse) {
  .scr-footer__links a,
  .scr-theme-switch button,
  .scr-nav__link {
    min-height: 2.75rem;
  }

}

/*
 * The settings form's own checkbox class and the slug links in the moderation
 * table. Both were measured under the 24px minimum on the rendered staff
 * pages -- 17px and 16px -- and both are corrected the same way the rest were:
 * the target grows, the type does not.
 */
.scr-checkbox input[type='checkbox'] {
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--scr-accent);
  flex: none;
}

.scr-table a {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
}

@media (pointer: coarse) {
  .scr-table a {
    min-height: 2.25rem;
  }
}

/* ==================================================== flow rhythm (content) */
/*
 * Headings reset to `margin: 0` at the top of this file, which is right for a
 * component that controls its own spacing and wrong for a page that just puts
 * a heading after a paragraph. The staff settings page rendered "Settings"
 * flush against the tiles above it and "API key" flush against the button
 * before it.
 *
 * This restores rhythm for content in the main column only, and only for an
 * element that FOLLOWS something. It is written with :where() so it carries
 * zero specificity: any component rule or spacing utility still wins without
 * needing !important.
 */
:where(.scr-main) :where(h1, h2, h3):not(:first-child) {
  margin-block-start: var(--scr-space-7);
}

:where(.scr-main) :where(h1, h2, h3) + * {
  margin-block-start: var(--scr-space-4);
}

:where(.scr-main) :where(form, fieldset, section, table, .scr-table-wrap) + :where(h2, h3) {
  margin-block-start: var(--scr-space-7);
}

/*
 * A form of stacked fieldsets needs air between them. The settings form is one
 * <form> containing four groups with no gap declared anywhere.
 */
:where(.scr-main) .scr-fieldset + .scr-fieldset {
  margin-block-start: var(--scr-space-5);
}

:where(.scr-main) .scr-fieldset + :where(.scr-row, .scr-stack, button, .scr-btn) {
  margin-block-start: var(--scr-space-5);
}
