:root {
  color-scheme: light dark;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
  --page: light-dark(#ffffff, #171717);
  --ink: light-dark(#202020, #eeeeee);
  --muted: light-dark(#636363, #acacac);
  --field: light-dark(#fafafa, #202020);
  --line: light-dark(#8a8a8a, #656565);
  --link: light-dark(#2457a7, #92b9ff);
  --error: light-dark(#ae2525, #ffabab);
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  padding: 2rem 1.25rem;
  background: var(--page);
  color: var(--ink);
}
main {
  flex: none;
  width: min(38rem, 100%);
  margin: auto;
}
header {
  margin-bottom: 1.25rem;
}
h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}
button,
textarea {
  font: inherit;
}
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
a:hover {
  text-decoration-thickness: 2px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}
.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
}
label {
  font-size: 0.9375rem;
  font-weight: 500;
}
.field-heading a,
.text-button {
  font-size: 0.875rem;
}
.text-button {
  padding: 0.5rem 0.125rem 0.5rem 0.5rem;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.text-button:hover:not(:disabled) {
  color: var(--ink);
}
.text-button:disabled {
  visibility: hidden;
}
textarea {
  display: block;
  width: 100%;
  min-height: 6rem;
  max-height: 20rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--field);
  color: var(--ink);
  font: 1rem/1.5 var(--mono);
  overflow-wrap: anywhere;
}
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea[aria-invalid='true'] {
  border-color: var(--error);
}
.output-heading {
  margin-top: 1rem;
}
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.875rem;
  min-height: 2.75rem;
}
.status {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 6.6rem;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--page);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.copy-button:hover:not(:disabled) {
  opacity: 0.85;
}
.copy-button:active:not(:disabled) {
  opacity: 0.75;
}
.copy-button:disabled {
  background: var(--field);
  color: var(--muted);
  border-color: light-dark(#d5d5d5, #454545);
}
.error {
  color: var(--error);
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}
details {
  margin-top: 1rem;
  font-size: 0.875rem;
}
summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  padding-block: 0.5rem;
}
summary:hover {
  color: var(--ink);
}
details p {
  margin: 0.75rem 0 0;
  max-width: 65ch;
}
.format-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  cursor: pointer;
}
.format-option input {
  flex: 0 0 1rem;
  margin: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--link);
}
.format-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  row-gap: 0.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  border: 0;
  font-size: 0.875rem;
}
.format-switch legend {
  float: left;
  margin-right: 1.25rem;
  color: var(--muted);
  line-height: 1.75rem;
}
.format-switch .format-option {
  min-height: 1.75rem;
}
.extra-option {
  margin: 1rem 0 0;
}
.confirmation-page {
  width: min(32rem, 100%);
}
.error-page {
  text-align: center;
}
.brand {
  display: block;
  width: min(20rem, 75%);
  margin: 0 auto 3rem;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
}
.confirmation-page .brand {
  margin: 0 0 2rem;
}
.confirmation-page h1,
.error-page h1 {
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.confirmation-page h1 {
  font-size: 2rem;
}
.destination-url {
  max-height: 12rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--field);
  overflow: auto;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.destination-url strong {
  color: var(--ink);
  font-weight: 600;
}
.confirmation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.confirmation-actions .copy-button {
  min-width: 10rem;
}
.confirmation-back {
  padding: 0.75rem 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.credits {
  color: var(--muted);
  font-size: 0.8125rem;
}
.maker {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 1.75rem;
}

details:not([open]) + .maker {
  margin-top: 1.25rem;
}
.maker .brand {
  width: min(14rem, calc(100% - 9.5rem));
  margin: 0;
}
.footer-links {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}
.footer-links a {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.footer-links a:hover {
  color: var(--ink);
}
.policy-page {
  width: min(40rem, 100%);
}
.policy-page header {
  margin: 1.25rem 0 2rem;
}
.policy-page h1 {
  font-size: clamp(2rem, 7vw, 2.5rem);
}
.policy-page h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.125rem;
}
.policy-page section p {
  margin: 0.75rem 0 0;
  max-width: 65ch;
}
.policy-page .brand {
  width: 11rem;
  margin: 2.5rem 0 0;
}
.back-link {
  color: var(--muted);
  font-size: 0.875rem;
}
@media (prefers-color-scheme: dark) {
  .brand img {
    filter: brightness(0) invert(1);
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.error-page p {
  max-width: 52ch;
  margin: 0.75rem auto 1.75rem;
  color: var(--muted);
}
@media (max-width: 420px) {
  body {
    padding: 1.5rem 1rem;
  }
  header p {
    max-width: 28ch;
  }
  .result-row {
    gap: 0.75rem;
  }
  .status {
    max-width: 22ch;
  }
}
