/*
  Colors are shadcn/ui's neutral theme (https://ui.shadcn.com/docs/theming) and
  components follow its default "Nova" style. Icons are from Lucide (ISC license).
*/
:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --destructive-text: color-mix(in oklch, var(--destructive) 65%, var(--foreground));
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -2px rgb(0 0 0 / 10%);
  --ok: #157f4f;
  --warn: #b45309;
  --info: #2563eb;
  --m-get: #15803d;
  --m-post: #2563eb;
  --m-put: #b45309;
  --m-patch: #a16207;
  --m-delete: #be123c;
  --m-head: #0e7490;
  --m-options: #6d28d9;
  --m-other: #52525b;
  --m-dns: #0f766e;
  --m-smtp: #a21caf;
  --j-key: #7c3aed;
  --j-str: #047857;
  --j-num: #b45309;
  --j-lit: #be123c;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.205 0 0);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.556 0 0);
    --destructive-text: color-mix(in oklch, var(--destructive) 50%, var(--foreground));
    --ok: #4ade80;
    --warn: #fbbf24;
    --info: #60a5fa;
    --j-key: #c4b5fd;
    --j-str: #6ee7b7;
    --j-num: #fcd34d;
    --j-lit: #fda4af;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* A column, so the footer stays at the bottom of short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary);
  font-weight: 500;
  text-underline-offset: 4px;
}

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

:not(pre) > code {
  background: var(--muted);
  padding: 0.2em 0.3em;
  border-radius: 4px;
}

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

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

/* As tall as a button, so the header keeps its height when the inbox switcher appears. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 2rem;
  color: var(--foreground);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 0.875rem;
}

.site-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 150ms;
}

.site-nav a:hover {
  color: var(--foreground);
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.dashboard-page .site-main {
  max-width: none;
  padding: 16px 20px 24px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--foreground);
}

/* Buttons are outline by default, .primary is shadcn's default variant and .danger its destructive one. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 2rem;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
  background-clip: padding-box;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}

.button:hover,
details[open] > summary.button {
  background-color: var(--muted);
}

.button:not(summary):active {
  translate: 0 1px;
}

/* Pressed controls, and menu buttons while open, shade with the control's own text color so every variant shows the click in both themes. */
:is(.button, .chip, .icon, .copy, .filter, .menu-items button):active,
details[open] > summary.button {
  box-shadow: inset 0 0 0 999px color-mix(in oklch, currentColor 15%, transparent);
}

.button.primary {
  border-color: transparent;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.button.primary:hover,
details[open] > summary.button.primary {
  background-color: color-mix(in oklch, var(--primary) 80%, transparent);
}

.button.danger {
  border-color: transparent;
  background-color: color-mix(in oklch, var(--destructive) 10%, transparent);
  color: var(--destructive-text);
}

.button.danger:hover {
  background-color: color-mix(in oklch, var(--destructive) 20%, transparent);
}

.button:disabled {
  opacity: 0.5;
  cursor: progress;
}

@media (prefers-color-scheme: dark) {
  .button {
    border-color: var(--input);
    background-color: color-mix(in oklch, var(--input) 30%, transparent);
  }

  .button:hover,
  details[open] > summary.button {
    background-color: color-mix(in oklch, var(--input) 50%, transparent);
  }

  .button.danger {
    background-color: color-mix(in oklch, var(--destructive) 20%, transparent);
  }

  .button.danger:hover {
    background-color: color-mix(in oklch, var(--destructive) 30%, transparent);
  }
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 500;
  text-underline-offset: 4px;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

/* Toggle, outline variant, small size. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.chip:hover {
  background: var(--muted);
}

/* A chip that is on is filled with the primary color, which shadcn uses for selected states. */
.chip[aria-pressed="true"] {
  border-color: transparent;
  background: var(--primary) padding-box;
  color: var(--primary-foreground);
}

.chip[aria-pressed="true"]:hover {
  background: color-mix(in oklch, var(--primary) 80%, transparent) padding-box;
}

/* Button, ghost variant, small icon size. */
.icon {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--muted-foreground);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.icon:hover {
  background: var(--muted);
  color: var(--foreground);
}

:is(.button, .chip, .link, .icon, .copy, .filter, .capture-button, summary):focus-visible,
:is(input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in oklch, var(--ring) 50%, transparent);
  outline-offset: 0;
}

:is(.button, .chip, .copy, .filter, input, select, textarea):focus-visible {
  border-color: var(--ring);
}

.button.danger:focus-visible {
  border-color: color-mix(in oklch, var(--destructive) 40%, transparent);
  outline-color: color-mix(in oklch, var(--destructive) 20%, transparent);
}

.muted {
  color: var(--muted-foreground);
}

.note {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Badge, secondary variant. */
.badge {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Card. */
.summary {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
}

/* The operator's notice about a restriction, with the warning color. */
.operator-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklch, var(--warn) 45%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--warn) 8%, var(--card));
  font-size: 0.875rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.summary-grid > * {
  grid-column: 1 / -1;
  margin: 0;
}

/* The inbox actions sit at the right of the first label's row, so every URL field gets the full width. */
.summary-grid > .label:first-child {
  grid-column: 1;
  grid-row: 1;
}

.summary-grid > .summary-actions {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 6px;
}

.summary-grid > .label ~ .label {
  margin-top: 10px;
}

/* Input group with the copy buttons inside. */
.url-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0 3px 0 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
}

.url-field code.url {
  flex: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  line-height: 1.5;
}

.copy-split {
  display: flex;
  flex: none;
}

.copy-split .button {
  height: 1.75rem;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.copy-split > .button {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.copy-split summary.button {
  padding-inline: 6px;
  border-left-color: color-mix(in oklch, var(--primary-foreground) 30%, transparent);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.label {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.url-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Read-only input. */
code.url {
  flex: 1 1 320px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.875rem;
  white-space: nowrap;
  overflow-x: auto;
}

@media (prefers-color-scheme: dark) {
  .url-field,
  code.url {
    background-color: color-mix(in oklch, var(--input) 30%, transparent);
  }
}

.alt-url {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.alt-url code,
.start p code {
  overflow-wrap: anywhere;
}

.facts-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

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

/* Dropdown menu. */
.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-items {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 240px;
  max-width: calc(100vw - 16px);
  padding: 4px;
  border-radius: var(--radius);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
  animation: menu-in 100ms ease-out;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.switcher-menu .menu-items {
  right: auto;
  left: 0;
}

.menu-items button {
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
  cursor: default;
}

.menu-items button:hover,
.menu-items button:focus-visible {
  outline: none;
  background: var(--accent);
  color: var(--accent-foreground);
}

.menu-items button[aria-current="true"] {
  font-weight: 600;
}

/* Private link menu item: Lucide's lock icon in the warning color, with a hint line, so it stands apart from the plain actions. */
.menu-items .menu-private {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 8px;
  padding-block: 6px;
  font-weight: 500;
}

.menu-private::before {
  content: "";
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background-color: var(--warn);
  mask: center / contain no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.menu-hint {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1rem;
}

.menu-items .danger,
.menu-items .danger:hover,
.menu-items .danger:focus-visible {
  color: var(--destructive-text);
}

.menu-items .danger:hover,
.menu-items .danger:focus-visible {
  background: color-mix(in oklch, var(--destructive) 10%, transparent);
}

@media (prefers-color-scheme: dark) {
  .menu-items .danger:hover,
  .menu-items .danger:focus-visible {
    background: color-mix(in oklch, var(--destructive) 20%, transparent);
  }
}

/* Dropdown menu shortcut. */
.menu-key {
  float: right;
  margin-left: 16px;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.menu-row {
  display: flex;
  gap: 2px;
}

.menu-row > button:first-child {
  flex: 1;
  min-width: 0;
}

.menu-items .menu-icon {
  display: grid;
  flex: none;
  place-items: center;
  padding: 0 7px;
  color: var(--muted-foreground);
}

.menu-items .menu-icon:hover {
  color: var(--accent-foreground);
}

.menu-label {
  margin: 0;
  padding: 4px 6px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Dropdown menu warning, with Lucide's triangle-alert icon. */
.menu-warning {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 4px 6px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1rem;
}

.menu-warning::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-block: 1px;
  background-color: var(--warn);
  mask: center / contain no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.list-pane,
.detail-pane {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
}

.list-pane {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.list-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.live-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
}

.live-status[data-state="live"]::before {
  background: var(--ok);
}

.list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.capture-list {
  flex: 1;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.capture {
  border-bottom: 1px solid var(--border);
}

.capture-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms;
}

.capture-button:hover {
  background: color-mix(in oklch, var(--muted) 50%, transparent);
}

.capture-button:focus-visible {
  outline-offset: -3px;
}

.capture.is-active .capture-button {
  border-left-color: var(--primary);
  background: var(--muted);
}

.capture-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.capture.is-unread .capture-line::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--info);
}

.capture-path {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture.is-unread .capture-path {
  font-weight: 600;
}

.capture-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

/* An email's sender can be long, so it takes the room left and is cut short. */
.capture-sender {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-mark {
  margin-left: 5px;
}

svg.address-mark {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  fill: currentColor;
}

.address-mark-text {
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 600 0.8em var(--mono);
  text-decoration: none;
  white-space: nowrap;
  cursor: help;
}

.method {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--m-other);
  color: #fff;
  font: 600 0.7rem var(--mono);
}

.m-get { background: var(--m-get); }
.m-post { background: var(--m-post); }
.m-put { background: var(--m-put); }
.m-patch { background: var(--m-patch); }
.m-delete { background: var(--m-delete); }
.m-head { background: var(--m-head); }
.m-options { background: var(--m-options); }
.m-dns { background: var(--m-dns); }
.m-smtp { background: var(--m-smtp); }

.status {
  font-weight: 600;
}

.s-2xx { color: var(--ok); }
.s-3xx { color: var(--info); }
.s-4xx { color: var(--warn); }
.s-5xx { color: var(--destructive); }

.list-more {
  padding: 6px 14px;
}

.list-more:has(> [hidden]) {
  display: none;
}

.list-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 14px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-foreground);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.detail-pane {
  min-width: 0;
  min-height: 320px;
  padding: 16px;
}

.detail-pane[aria-busy="true"] {
  opacity: 0.6;
}

.start h2 {
  margin-top: 0;
  letter-spacing: -0.025em;
}

.start-facts {
  padding-left: 1.2em;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.snippets {
  margin: 18px 0;
}

.snippets summary {
  font-weight: 500;
  cursor: pointer;
}

.snippets summary:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.snippets .snippet {
  margin-top: 10px;
}

/* The code scrolls in its own column, so a long line never runs under the Copy button. */
.snippet {
  display: flex;
  align-items: flex-start;
  border-radius: var(--radius);
  background: var(--muted);
}

.snippet pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 14px;
  overflow-x: auto;
}

/* Button, outline variant, extra small size. */
.copy {
  flex: none;
  margin: 8px 8px 0 0;
  height: 1.5rem;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms;
}

.copy:hover {
  background: var(--muted);
}

@media (prefers-color-scheme: dark) {
  .copy {
    border-color: var(--input);
    background: color-mix(in oklch, var(--input) 30%, transparent);
  }

  .copy:hover {
    background: color-mix(in oklch, var(--input) 50%, transparent);
  }
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-title {
  display: flex;
  flex: 1 1 360px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.detail-url {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.detail-subject {
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 16px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--muted);
}

.facts dt {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.facts dd {
  margin: 2px 0 0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.block {
  margin-bottom: 18px;
}

.block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.95rem;
}

/* Table. */
.pairs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.pairs tr {
  transition: background-color 150ms;
}

.pairs tr:hover {
  background: color-mix(in oklch, var(--muted) 50%, transparent);
}

.pairs th,
.pairs td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.pairs tr:last-child > * {
  border-bottom: 0;
}

.pairs th {
  width: 32%;
  color: var(--muted-foreground);
  font-family: var(--mono);
  font-weight: 500;
}

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

.file-name {
  font-weight: 500;
}

.body-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.body-head h3 {
  margin: 0;
}

.body-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

pre.code {
  max-height: 70vh;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

pre.code.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mail-preview {
  display: grid;
  gap: 8px;
}

.mail-images {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.8rem;
}

/* An email is drawn as its sender designed it, on white whatever the theme. Its height
   follows the content, which the frame reports. */
.mail-frame {
  display: block;
  width: 100%;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.j-key { color: var(--j-key); }
.j-str { color: var(--j-str); }
.j-num { color: var(--j-num); }
.j-lit { color: var(--j-lit); }

/* Dialog. */
.dialog {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 0.875rem;
}

.dialog[open] {
  animation: dialog-in 100ms ease-out;
}

/* Alert dialog for short confirmations and the rename form. */
.dialog:has(> .confirm, > .rename-form) {
  width: min(24rem, calc(100vw - 32px));
}

.dialog::backdrop {
  background: rgb(0 0 0 / 10%);
  backdrop-filter: blur(4px);
}

.dialog[open]::backdrop {
  animation: fade-in 100ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.dialog-body,
.settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.dialog-body h2 {
  margin: 0;
  font-size: 1rem;
}

.dialog-body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1rem;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 -16px -16px;
  padding: 16px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: color-mix(in oklch, var(--muted) 50%, transparent);
}

.settings fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Field label above its control. */
.settings label,
.form-builder .grid > label,
.fb-form label,
.rename-form label,
.forward label,
.script label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.375;
}

.settings label .muted,
.rename-form label .muted,
.script label .muted {
  font-weight: 400;
}

.settings label.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings p {
  margin: 0;
  font-size: 0.875rem;
}

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

/* Input, textarea and native select. */
input,
select,
textarea {
  padding: 4px 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: border-color 150ms;
}

input:not([type="checkbox"]),
select {
  height: 2rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-foreground);
}

select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
  appearance: none;
}

/* Checkbox. */
input[type="checkbox"] {
  display: inline-grid;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
}

input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fafafa' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

@media (prefers-color-scheme: dark) {
  input,
  select,
  textarea {
    background-color: color-mix(in oklch, var(--input) 30%, transparent);
  }

  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }

  select:hover {
    background-color: color-mix(in oklch, var(--input) 50%, transparent);
  }

  input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23171717' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  }
}

textarea {
  min-height: 4rem;
  padding-block: 8px;
  font-family: var(--mono);
  resize: vertical;
}

/* Alert, destructive variant. */
.form-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--destructive);
  font-weight: 500;
}

/* Sonner toasts. */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(356px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
  font-size: 0.8125rem;
  animation: toast-in 0.3s ease-out;
}

.toast::before {
  content: "";
  flex: none;
  align-self: flex-start;
  width: 16px;
  height: 16px;
  margin-block: 1px;
  background-color: currentColor;
  mask: center / contain no-repeat;
}

.toast-info::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.toast-ok::before {
  background-color: var(--ok);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16 9-5.5 5.5L8 12'/%3E%3C/svg%3E");
}

.toast-error::before {
  background-color: var(--destructive);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
}

.toast.leaving {
  opacity: 0;
  transition: opacity 0.3s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

.boot,
.gone {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--muted-foreground);
  text-align: center;
}

.gone :is(h1, h2) {
  margin: 0;
  color: var(--foreground);
  font-size: 2rem;
  letter-spacing: -0.025em;
}

.boot p,
.gone p {
  margin: 0;
}

/* The not-found page's status code, colored as the inbox colors 4xx answers. */
.gone-code {
  color: var(--warn);
  font: 600 clamp(4.5rem, 16vw, 7rem)/1 var(--mono);
  letter-spacing: -0.05em;
}

.gone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

/* The not-found page's message sits in the middle of the space between header and footer. */
.not-found-page .site-main {
  display: grid;
  align-content: center;
}

/* Dashboard heading, a compact line above the inbox. */
.page-title {
  margin: 0 0 12px;
  color: var(--muted-foreground);
  font-size: 1rem;
  font-weight: 500;
}

/* The dashboard fills the screen below its heading, whether it shows the inbox, the
   spinner before it or a message, so what follows starts below the fold and doesn't move
   when the inbox loads. Moving it would count against the page's layout shift score. The
   cap keeps crawlers that render with a very tall window from pushing it far down. */
.app {
  display: grid;
  min-height: min(calc(100vh - 7rem), 56rem);
  min-height: min(calc(100svh - 7rem), 56rem);
}

@media (scripting: none) {
  .app {
    min-height: 0;
  }

  .boot {
    display: none;
  }
}

/* What the home page says below the dashboard, for new visitors and search engines: a
   centered column of sections, each under a heading. */
.about {
  display: grid;
  gap: 96px;
  max-width: 68rem;
  margin: 0 auto;
  padding: 96px 0 48px;
}

.about-head {
  max-width: 40rem;
  margin: 0 auto 48px;
  text-align: center;
}

.about-head h2 {
  margin: 0;
  font-size: 1.875rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.about-head p {
  margin: 16px 0 0;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

.about h3 {
  margin: 0;
  font-size: 1rem;
}

.steps p,
.features p {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Steps side by side, numbered in circles that a line joins. */
.steps {
  --dot: 2.5rem;
  --gap: 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
  counter-reset: step;
}

.steps li {
  position: relative;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: var(--dot);
  height: var(--dot);
  margin: 0 auto 20px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--muted);
  font: 500 0.9375rem/1 var(--mono);
}

/* The line runs across the gap from one circle to the next, 12px clear of each. */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--dot) / 2);
  left: calc(50% + var(--dot) / 2 + 12px);
  width: calc(100% + var(--gap) - var(--dot) - 24px);
  border-top: 1px solid var(--border);
}

.steps p {
  max-width: 21rem;
  margin-inline: auto;
}

/* Feature cards three to a row. Without DNS lookups there are five, and the first two
   share the top row. */
.features {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  grid-column: span 2;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
}

.features li:first-child:nth-last-child(5),
.features li:first-child:nth-last-child(5) + li {
  grid-column: span 3;
}

/* A Lucide icon on a tile, which its padding draws around the icon's own 20px. */
.feature-icon {
  display: block;
  box-sizing: content-box;
  margin-bottom: 20px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Questions as an accordion, opened with Lucide's chevron-down. */
.faq {
  max-width: 48rem;
  margin: 0 auto;
  interpolate-size: allow-keywords;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-radius: var(--radius-md);
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background-color: var(--muted-foreground);
  mask: center / contain no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  transition: rotate 200ms;
}

.faq [open] > summary::after {
  rotate: 180deg;
}

.faq h3 {
  font-weight: 500;
}

.faq summary:hover h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.faq details p {
  margin: 0;
  padding: 0 32px 20px 0;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Answers slide open where browsers can animate to an automatic height. */
.faq details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 200ms ease-out, content-visibility 200ms allow-discrete;
}

.faq details[open]::details-content {
  block-size: auto;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Alert. */
.notice {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.875rem;
}

.prose h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.prose h2 {
  margin: 28px 0 10px;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
}

.prose h2,
.prose h3 {
  scroll-margin-top: 16px;
}

.prose h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
}

.prose li + li {
  margin-top: 4px;
}

/* The long-form pages justify their text, hyphenated so justified lines don't gape. Code
   keeps its words whole. */
.prose :is(p, li) {
  text-align: justify;
  hyphens: auto;
}

.prose code {
  hyphens: manual;
}

.prose .snippet {
  margin: 10px 0;
}

.prose .table {
  margin: 12px 0 16px;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.prose th,
.prose td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--muted-foreground);
  font-weight: 500;
}

.docs-page .site-main {
  max-width: 1120px;
}

.docs {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-size: 0.875rem;
}

.toc-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li a {
  display: block;
  padding: 3px 0;
  color: var(--muted-foreground);
  font-weight: 400;
  text-decoration: none;
}

.toc li a:hover {
  color: var(--foreground);
}

.toc-alt {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
}

.lead {
  margin: 0 0 24px;
  color: var(--muted-foreground);
  font-size: 1.1rem;
}

/* Dropdown menu separator. */
.menu-items hr {
  margin: 4px -4px;
  border: 0;
  border-top: 1px solid var(--border);
}

.search {
  display: flex;
  gap: 6px;
  padding: 10px 14px 0;
}

.search-field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  padding-right: 30px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.search .chip {
  width: 2rem;
  height: 2rem;
  padding: 0;
}

/* Kbd. */
.search-key,
.shortcut-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--muted-foreground);
  font: 500 0.75rem/1 var(--font);
}

.search-key {
  position: absolute;
  top: 50%;
  right: 6px;
  translate: 0 -50%;
  pointer-events: none;
}

.search input:focus + .search-key,
.search input:not(:placeholder-shown) + .search-key {
  display: none;
}

.list-note {
  margin: 0;
  padding: 6px 14px 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.list-note.error {
  color: var(--destructive);
  font-weight: 500;
}

.list-note .link {
  font-size: inherit;
}

.link.danger {
  color: var(--destructive);
}

#capture-list {
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.list-empty[data-mode="search"] .pulse,
.list-empty[data-mode="search"] .empty-wait,
.list-empty:not([data-mode="search"]) .empty-search {
  display: none;
}

/* Badge, outline variant. */
.note-mark {
  flex: none;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-weight: 500;
}

.filter {
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-family: var(--font);
  cursor: pointer;
  opacity: 0;
}

tr:hover .filter,
dd:hover .filter,
.filter:focus-visible {
  opacity: 1;
}

.filter:hover {
  background: var(--muted);
  color: var(--foreground);
}

.event-docs {
  margin-left: 6px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.event-docs:hover {
  color: var(--foreground);
}

.note-form {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.note-form label {
  font-size: 0.875rem;
  font-weight: 500;
}

.note-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.note-row textarea {
  flex: 1;
  min-height: 2rem;
  padding-block: 5px;
  font-family: var(--font);
  field-sizing: content;
}

.help .pairs th {
  width: 46%;
}

.capture-label {
  overflow: hidden;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warn-text {
  color: var(--warn);
}

.time-hint {
  margin-left: 6px;
  color: var(--muted-foreground);
  font-family: var(--font);
  font-size: 0.75rem;
}

.j-num[title] {
  text-decoration: underline dotted;
  cursor: help;
}

.j-num.j-big {
  color: var(--destructive-text);
  text-decoration: underline wavy;
}

.secret-warning {
  border-color: color-mix(in oklch, var(--destructive) 45%, var(--border));
  background: color-mix(in oklch, var(--destructive) 6%, var(--card));
}

.secret-list {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 0.875rem;
}

.replay-note,
.replay-badge {
  border-color: color-mix(in oklch, var(--warn) 45%, var(--border));
}

.replay-badge {
  color: var(--warn);
}

/* What a remembered secret says of a listed request's signature, how forwarding a request
   to the owner's app went, what the owner's script marked it with or how it failed, and
   an email that failed its From domain's DMARC policy. */
.sig-mark[data-state="ok"],
.fwd-mark[data-state="ok"] {
  border-color: color-mix(in oklch, var(--ok) 50%, transparent);
  color: var(--ok);
}

.sig-mark[data-state="bad"],
.fwd-mark[data-state="bad"],
.script-mark[data-state="bad"],
.warn-mark {
  border-color: color-mix(in oklch, var(--warn) 50%, transparent);
  color: var(--warn);
}

/* An email's SPF, DKIM or DMARC result: pass in green, failures and errors as warnings,
   and results that say nothing either way left plain. */
.auth-badge[data-state="ok"] {
  background: color-mix(in oklch, var(--ok) 15%, transparent);
  color: var(--ok);
}

.auth-badge[data-state="bad"] {
  background: color-mix(in oklch, var(--warn) 15%, transparent);
  color: var(--warn);
}

.script-mark {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script textarea {
  min-height: 14rem;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}

.script pre.code {
  min-height: 3rem;
  max-height: 12rem;
}

.script-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
}

.diff .diff-old {
  color: var(--destructive-text);
  text-decoration: line-through;
}

.diff .diff-new {
  color: var(--ok);
}

.diff-removed .diff-old {
  text-decoration: none;
}

.diff .diff-mark {
  color: var(--muted-foreground);
  font-family: var(--font);
  font-size: 0.75rem;
}

.diff td {
  overflow-wrap: anywhere;
}

code.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.callout {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.callout p {
  margin: 0 0 8px;
  font-size: 0.875rem;
}

.attempts tr.is-current > * {
  background: var(--muted);
}

.verify-form,
.hmac-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.verify-form > label {
  font-size: 0.875rem;
  font-weight: 500;
}

.verify-form > label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.verify-form .note-row input {
  flex: 1;
  min-width: 0;
}

.hmac-form label {
  display: grid;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.verify-form .note,
.hmac-form .note,
.verify-result {
  margin: 0;
}

.verify-result {
  font-size: 0.875rem;
  font-weight: 500;
}

.verify-result[data-state="ok"],
.hmac-out[data-state="ok"] .note {
  color: var(--ok);
}

.verify-result[data-state="bad"] {
  color: var(--warn);
}

.hmac-tool {
  margin-top: 12px;
}

.hmac-tool summary,
.script-help summary {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  cursor: pointer;
}

.hmac-out code {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-size: 0.8rem;
}

.layer {
  margin-bottom: 14px;
}

.layer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.shortcut-list td {
  font-family: var(--font);
}

.form-builder h3 {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.form-builder p {
  margin: 0;
}

.fb-fields {
  display: grid;
  gap: 8px;
}

.fb-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
}

.fb-row .check,
.fb-form .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.fb-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}

.fb-form .button {
  justify-self: start;
}

/* Too narrow to share a row with the label: the actions head the card, keeping each label beside its field. */
@media (max-width: 560px) {
  .summary-grid > .summary-actions {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 8px;
  }

  .summary-grid > .label:first-child {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .list-pane {
    position: static;
    max-height: 55vh;
  }

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

  .toc {
    position: static;
    max-height: none;
  }

  .about {
    gap: 72px;
    padding-top: 72px;
  }

  .about-head {
    margin-bottom: 32px;
  }

  .about-head h2 {
    font-size: 1.625rem;
  }

  /* Steps stack, with their circles in a column that the line runs down. */
  .steps {
    --gap: 28px;
    grid-template-columns: minmax(0, 1fr);
    max-width: 36rem;
    margin-inline: auto;
    text-align: left;
  }

  .steps li {
    display: grid;
    grid-template-columns: var(--dot) minmax(0, 1fr);
    column-gap: 16px;
  }

  .steps li::before {
    grid-row: span 2;
    margin: 0;
  }

  .steps li:not(:last-child)::after {
    top: calc(var(--dot) + 8px);
    bottom: calc(8px - var(--gap));
    left: calc(var(--dot) / 2);
    width: 0;
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  .steps h3 {
    margin-top: 8px;
  }

  .steps p {
    max-width: none;
    margin-inline: 0;
  }

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

  .features li,
  .features li:first-child:nth-last-child(5),
  .features li:first-child:nth-last-child(5) + li {
    grid-column: auto;
  }

  .features li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  /* The links get a row of their own, under the brand rather than pushed right. */
  .site-header {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .site-nav {
    flex-basis: 100%;
    margin-left: 0;
  }

  .summary-actions .button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .fb-fields {
    gap: 14px;
  }

  .fb-row {
    display: flex;
    flex-wrap: wrap;
  }

  .fb-row > input {
    flex: 1 1 40%;
    min-width: 0;
  }

  .about-head h2 {
    font-size: 1.5rem;
  }

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

  .features li {
    padding: 20px;
  }

  .toasts {
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse,
  .spinner,
  .toast,
  .menu-items,
  .dialog[open],
  .dialog[open]::backdrop {
    animation: none;
  }

  .faq summary::after {
    transition: none;
  }

  .faq details::details-content {
    transition: none;
  }
}
