/* ==========================================================================
   Sharelink v1: prototype styles
   Tokens are named here once and reused everywhere. See docs/design-sharelink-v1.md
   for the rationale behind each token.

   Direction: "Achromatic ledger" (taste skill, seed 58262485), adopted whole.
   The chrome carries no brand colour: the one primary action is ink, surfaces are
   separated by one tone step, and colour is reserved for state.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono"; /* taste-skill-ignore mono: ID/key face from the sheet */
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ground and surfaces ------------------------------------------------ */
  --ground: #f1f2f0;        /* page ground: neutral stone, low chroma (sheet's face) */
  --surface: #ffffff;       /* cards, fields */
  --surface-2: #ebebe7;     /* one tone step down: sunken fields, inert rows */
  --surface-3: #e1e1dc;     /* hover / pressed step */

  /* Ink ----------------------------------------------------------------- */
  --ink: #141312;           /* primary text, primary action fill */
  --ink-2: #3f3c37;         /* secondary text still at body size */
  --muted: #5c5850;         /* captions, helper text; 6.3:1 on ground */
  --ink-inverse: #ffffff;

  /* Lines --------------------------------------------------------------- */
  --line: #d8d8d2;          /* 1px separation; elevation is a tone step */
  --line-strong: #b7b7b0;   /* interactive outlines */

  /* State (the only colour in the product) ----------------------------- */
  --positive: #1a6b3c;      /* matched; 6.5:1 on white */
  --positive-bg: #e7f2ea;
  --warning: #8a5200;       /* transient failure; 6.4:1 on white */
  --warning-bg: #fbf0dc;
  --negative: #a8241c;      /* invalid input; 6.1:1 on white */
  --negative-bg: #fbe9e7;
  --neutral-state: #56524b; /* not found; 6.5:1 on its field */
  --neutral-bg: #ebebe6;

  /* Focus --------------------------------------------------------------- */
  --focus: #1d5fbf;         /* 6.1:1 on white, 5.4:1 on ground */

  /* Radius (the sheet's tight pair) ------------------------------------ */
  --radius-card: 8px;
  --radius-control: 6px;
  --radius-round: 999px;

  /* Type ---------------------------------------------------------------- */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, /* taste-skill-ignore mono: ID/key face */
    monospace; /* taste-skill-ignore mono: share URL is an ID, sheet allows Geist Mono for keys */
  --fs-display: 56px;       /* desktop h1 */
  --fs-display-m: 38px;     /* phone h1 */
  --fs-title: 40px;         /* recipient release title, desktop */
  --fs-title-m: 30px;
  --fs-section: 18px;       /* panel headings */
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-micro: 13px;
  --lh-display: 1.02;
  --lh-body: 1.5;

  /* Space (one scale, reused) ------------------------------------------ */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;

  /* Motion -------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --dur-press: 120ms;
  --dur-state: 220ms;

  --frame: 1184px;
  --gutter: 32px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

::selection {
  background: var(--ink);
  color: var(--ink-inverse);
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
}

/* ==========================================================================
   Shell
   ========================================================================== */

.frame {
  width: 100%;
  max-width: var(--frame);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-6);
  min-height: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.topbar-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
}

.topbar a.quiet-link {
  color: var(--muted);
  font-size: var(--fs-small);
  text-decoration: none;
}

.topbar a.quiet-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ==========================================================================
   Sender page
   ========================================================================== */

.sender-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: var(--s-16);
  align-items: start;
  padding-top: var(--s-12);
  padding-bottom: var(--s-12);
}

.sender-col {
  min-width: 0;
}

.sender-intro {
  max-width: 620px;
}

h1.display {
  margin: 0;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}

.lede {
  margin: var(--s-5) 0 0;
  max-width: 540px;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.45;
}

.console-stack {
  margin-top: var(--s-8);
  max-width: 620px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.console-card {
  padding: var(--s-5);
}

.console-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}

.console-head label {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
}

.console-hint {
  color: var(--muted);
  font-size: var(--fs-micro);
}

.field {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 14px var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  transition: border-color var(--dur-press) var(--ease-out),
    background-color var(--dur-press) var(--ease-out);
}

.field::placeholder {
  color: var(--muted);
}

.field:hover {
  border-color: var(--line-strong);
}

.field:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--ink);
  background: var(--surface);
}

.field[aria-invalid="true"] {
  border-color: var(--negative);
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-press) var(--ease-out),
    border-color var(--dur-press) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--ink-inverse);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #2a2724;
  border-color: #2a2724;
}

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

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

.btn-block {
  width: 100%;
  margin-top: var(--s-3);
}

.console-foot {
  margin: var(--s-3) 0 0;
  color: var(--muted);
  font-size: var(--fs-micro);
}

/* Inline error, inside the form --------------------------------------- */

.error {
  display: none;
  align-items: flex-start;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: 12px 14px;
  background: var(--negative-bg);
  border-radius: var(--radius-control);
  color: var(--negative);
  font-size: var(--fs-small);
  line-height: 1.4;
}

body[data-state="error"] .error,
body[data-state="error-provider"] .error {
  display: flex;
}

.error svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

.error strong {
  display: block;
  font-weight: 600;
}

.error span {
  display: block;
  color: var(--ink-2);
  font-weight: 400;
}

body[data-state="success"] .console-form,
body[data-state="degraded"] .console-form {
  display: none;
}

body[data-state="success"] .console-card,
body[data-state="degraded"] .console-card {
  display: none;
}

/* Success panel -------------------------------------------------------- */

.success-panel {
  display: none;
  padding: var(--s-5);
}

body[data-state="success"] .success-panel[data-variant="success"],
body[data-state="degraded"] .success-panel[data-variant="degraded"] {
  display: block;
}

.success-top {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--positive);
}

body[data-state="degraded"] .success-top {
  color: var(--warning);
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.success-note {
  margin: var(--s-2) 0 0;
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.45;
}

body[data-state="degraded"] .success-note {
  color: var(--warning);
  font-weight: 500;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.url-field {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-family: var(--font-mono); /* taste-skill-ignore mono: share URL identifier */
  font-size: 15px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.success-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-3);
  font-size: var(--fs-small);
}

.success-links a {
  color: var(--muted);
  text-decoration: none;
}

.success-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.success-links .reset {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  cursor: pointer;
}

.success-links .reset:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Preview strip inside the success panel ------------------------------ */

.preview-strip {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.preview-strip img {
  width: 56px;
  height: 56px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.preview-strip .strip-title {
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.3;
}

.preview-strip .strip-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-micro);
}

/* ==========================================================================
   Shortcut panel
   ========================================================================== */

.shortcut-panel {
  margin-top: var(--s-6);
  max-width: 620px;
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.shortcut-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}

.shortcut-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.shortcut-mark svg {
  width: 20px;
  height: 20px;
}

.shortcut-head h2 {
  margin: 0;
  font-size: var(--fs-section);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.shortcut-head p {
  margin: var(--s-1) 0 0;
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.45;
}

.install-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-top: var(--s-4);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.slot-label {
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--ink);
}

.slot-state {
  font-size: var(--fs-micro);
  color: var(--muted);
}

.install-slot a {
  margin-left: auto;
  color: var(--ink-2);
  font-size: var(--fs-micro);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.install-slot a:hover {
  color: var(--ink);
}

.shortcut-fallback {
  display: none;
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-strong);
}

body[data-state="shortcut"] .shortcut-fallback {
  display: block;
}

.shortcut-fallback h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-small);
  font-weight: 600;
}

.shortcut-fallback ol {
  margin: 0;
  padding-left: 1.15em;
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.6;
}

.backline {
  display: none;
}

body[data-state="shortcut"] .backline {
  display: block;
  margin-bottom: var(--s-4);
}

body[data-state="shortcut"] .sender-intro,
body[data-state="shortcut"] .console-card,
body[data-state="shortcut"] .aside {
  display: none;
}

body[data-state="shortcut"] .shortcut-panel {
  margin-top: var(--s-8);
  max-width: 680px;
}

body[data-state="shortcut"] .shortcut-head h2 {
  font-size: 26px;
}

body[data-state="shortcut"] .shortcut-head p {
  font-size: var(--fs-body);
}

/* ==========================================================================
   Aside: what the recipient sees
   ========================================================================== */

.aside {
  position: sticky;
  top: var(--s-8);
}

.aside-caption {
  margin: 0 0 var(--s-3);
  color: var(--muted);
  font-size: var(--fs-micro);
}

.sleeve-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: var(--s-3) var(--s-4);
  align-items: start;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.sleeve-card > img {
  grid-row: 1 / span 3;
  width: 148px;
  height: 148px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line);
}

.sleeve-title {
  margin: var(--s-1) 0 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.sleeve-artist {
  margin: var(--s-1) 0 0;
  color: var(--ink-2);
  font-size: var(--fs-small);
}

.sleeve-meta {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: var(--fs-micro);
}

.mini-services {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.mini-service {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: var(--fs-small);
  font-weight: 500;
}

.mini-service.primary {
  background: var(--ink);
  color: var(--ink-inverse);
}

.mini-service.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.mini-service .arrow {
  margin-left: auto;
}

.promise-card {
  margin-top: var(--s-5);
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.promise-card h2 {
  margin: 0;
  font-size: var(--fs-section);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.promise-card ul {
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
}

.promise-card li {
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.45;
}

.promise-card li + li {
  margin-top: var(--s-3);
}

.promise-card strong {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   Loading veil (sender)
   ========================================================================== */

.loading-veil {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--ground);
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
}

body[data-state="loading"] .loading-veil {
  display: flex;
}

body[data-state="loading"] {
  overflow: hidden;
}

.loading-card {
  width: min(360px, 100%);
  text-align: center;
}

.loading-sleeve {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto var(--s-6);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.loading-ring {
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
}

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

.disc {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--ink);
  display: grid;
  place-items: center;
}

.disc::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface-2);
}

.spinner {
  display: none;
}

.loading-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.loading-sub {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: var(--fs-small);
}

.skeleton-lines {
  display: grid;
  gap: var(--s-2);
  width: 180px;
  margin: var(--s-6) auto 0;
  justify-items: center;
}

.skeleton-lines span {
  display: block;
  height: 8px;
  border-radius: var(--radius-round);
  background: var(--surface-3);
}

.skeleton-lines span:nth-child(1) {
  width: 180px;
}

.skeleton-lines span:nth-child(2) {
  width: 120px;
}

/* ==========================================================================
   Recipient page
   ========================================================================== */

.recipient-main {
  display: grid;
  grid-template-columns: 480px minmax(0, 1fr);
  gap: var(--s-16);
  align-items: center;
  padding-top: var(--s-10);
  padding-bottom: var(--s-12);
}

.sleeve-large {
  position: relative;
}

.sleeve-large img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
}

.release {
  max-width: 480px;
}

.release-meta {
  margin: 0 0 var(--s-3);
  color: var(--muted);
  font-size: var(--fs-small);
}

.release h1 {
  margin: 0;
  font-size: var(--fs-title);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}

.release-artist {
  margin: var(--s-3) 0 0;
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1.3;
}

.preferred-note {
  display: none;
  margin: var(--s-3) 0 0;
  color: var(--muted);
  font-size: var(--fs-micro);
}

body[data-state="preferred"] .preferred-note {
  display: block;
}

.services {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

/* Preferred ordering: the remembered service first, every alternative still
   visible, nothing auto-opens. */
body[data-state="preferred"] .service-source {
  order: 2;
}

body[data-state="preferred"] .service-apple {
  order: 1;
}

.service-btn {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dur-press) var(--ease-out),
    border-color var(--dur-press) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}

.service-btn:active {
  transform: translateY(1px);
}

.service-btn.primary {
  background: var(--ink);
  color: var(--ink-inverse);
  border: 1px solid var(--ink);
}

.service-btn.primary:hover {
  background: #2a2724;
}

.service-btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.service-btn.secondary:hover {
  background: var(--surface-2);
}

/* Preferred ordering also makes the first button the primary one, so order and
   visual weight agree. The source stays present and usable as the second. */
body[data-state="preferred"] .service-source {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

body[data-state="preferred"] .service-source:hover {
  background: var(--surface-2);
}

body[data-state="preferred"] .service-apple .service-btn {
  background: var(--ink);
  color: var(--ink-inverse);
  border-color: var(--ink);
}

body[data-state="preferred"] .service-apple .service-btn:hover {
  background: #2a2724;
}

.service-btn .glyph {
  width: 20px;
  height: 20px;
  flex: none;
}

.service-btn .arrow {
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex: none;
}

/* Service glyphs are neutral geometry keyed to each service, not brand marks. */
.glyph-spotify {
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}

.glyph-spotify::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: currentColor;
}

.glyph-apple {
  border-radius: 4px;
  border: 2px solid currentColor;
  position: relative;
}

.glyph-apple::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.glyph-youtube {
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}

.glyph-youtube::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 10px;
  transform: translate(-50%, -50%);
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Pending / not found / transient slots ------------------------------- */

.service-slot {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: 500;
}

.service-slot .glyph {
  width: 20px;
  height: 20px;
  flex: none;
  opacity: 0.7;
}

.service-slot .slot-status {
  margin-left: auto;
  font-size: var(--fs-micro);
  color: inherit;
}

.dots {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
}

.dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot-pulse 1.1s var(--ease-out) infinite;
}

.dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.slot-extra {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: var(--fs-micro);
  line-height: 1.4;
}

/* not found */

.service-slot.notfound {
  background: var(--neutral-bg);
  border-color: transparent;
  color: var(--neutral-state);
}

.service-slot.notfound .slot-status {
  color: var(--neutral-state);
  font-weight: 600;
}

/* couldn't check */

.service-slot.transient {
  background: var(--warning-bg);
  border-color: transparent;
  color: var(--warning);
  font-size: 15px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.transient-label {
  font-weight: 600;
}

.retry {
  margin-left: auto;
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
}

.retry:hover {
  background: var(--surface-2);
}

/* The other service shows exactly one of these per state. With JavaScript
   off, body has no data-state and the pending variant is what renders: the
   spec's required initial-HTML state. */
.other-variant {
  display: none;
}

body:not([data-state]) [data-other="pending"],
body[data-state="pending"] [data-other="pending"],
body[data-state="matched"] [data-other="matched"],
body[data-state="preferred"] [data-other="matched"],
body[data-state="notfound"] [data-other="notfound"],
body[data-state="transient"] [data-other="transient"] {
  display: block;
}

/* The source row is always usable, in every state. */

.recipient-foot {
  margin-top: var(--s-6);
  color: var(--muted);
  font-size: var(--fs-micro);
}

.noscript-note {
  margin-top: var(--s-4);
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-control);
  color: var(--ink-2);
  font-size: var(--fs-micro);
  line-height: 1.45;
}

/* ==========================================================================
   Not-found page (unknown slug)
   ========================================================================== */

.notfound-page {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--s-24) 0 var(--s-12);
  text-align: center;
}

.notfound-page h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.notfound-page p {
  margin: var(--s-3) auto 0;
  max-width: 38ch;
  color: var(--ink-2);
}

.notfound-page .btn {
  margin-top: var(--s-6);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-6);
  padding-top: var(--s-5);
  padding-bottom: var(--s-8);
  color: var(--muted);
  font-size: var(--fs-micro);
}

.site-foot p {
  margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  :root {
    --fs-display: 48px;
    --fs-title: 36px;
  }

  .sender-main {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--s-10);
  }

  .recipient-main {
    grid-template-columns: 400px minmax(0, 1fr);
    gap: var(--s-10);
  }
}

@media (max-width: 860px) {
  .sender-main {
    grid-template-columns: minmax(0, 1fr);
    padding-top: var(--s-8);
  }

  .aside {
    display: none;
  }

  .recipient-main {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-8);
    padding-top: var(--s-6);
  }

  .release {
    max-width: none;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 20px;
    --fs-display: var(--fs-display-m);
    --fs-title: var(--fs-title-m);
  }

  .topbar {
    padding-top: var(--s-4);
    min-height: 44px;
  }

  .topbar-note {
    display: none;
  }

  .sender-main {
    padding-top: var(--s-5);
    padding-bottom: var(--s-6);
  }

  .lede {
    margin-top: var(--s-4);
    font-size: 16px;
    line-height: 1.5;
  }

  .console-stack {
    margin-top: var(--s-5);
  }

  .shortcut-panel {
    margin-top: var(--s-5);
  }

  .console-card,
  .success-panel,
  .shortcut-panel {
    padding: var(--s-4);
  }

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

  .url-field {
    min-height: 48px;
    font-size: 13px;
    padding: 0 12px;
  }

  .shortcut-head h2 {
    font-size: 16px;
  }

  .shortcut-head p {
    font-size: var(--fs-micro);
  }

  .install-slot a {
    margin-left: 0;
  }

  .sleeve-large {
    max-width: 300px;
  }

  .recipient-main {
    padding-top: var(--s-4);
    padding-bottom: var(--s-6);
  }

  .release h1 {
    font-size: var(--fs-title-m);
  }

  .release-artist {
    font-size: 18px;
  }

  .services {
    margin-top: var(--s-5);
    gap: 10px;
  }

  .site-foot {
    padding-bottom: var(--s-6);
  }

  /* Every interactive element keeps a 44px tap target on the phone. */
  .topbar a.quiet-link,
  .success-links a,
  .success-links .reset,
  .install-slot a,
  body[data-state="shortcut"] .backline {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body[data-state="shortcut"] .shortcut-panel {
    margin-top: var(--s-4);
  }
}

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

  .dots span {
    opacity: 1;
    transform: none;
  }

  .spinner,
  .loading-ring {
    display: none !important;
  }
}

/* Production service blocks: one server-rendered state per block. */
.service-block {
  display: block;
  width: 100%;
}

.preferred-note.visible {
  display: block;
}

.install-slot .install-link {
  font-size: var(--fs-micro);
  font-weight: 600;
}
