/* The support page, in the docs site's tokens (twin-memory-docs/app/globals.css): its paper white and soft black, a
   step softer than pure white and near-black, its warm lines, and the four pastels, used only for each topic's glyph. */

:root {
  --background: #fafaf8;
  --foreground: #1d1d1f;
  --muted: #6b6b70;
  --faint: #86868b;
  --surface: #f2f2ef;
  --line: #e5e4df;
  --line-strong: color-mix(in oklab, var(--foreground) 16%, var(--background));
  --hover: color-mix(in oklab, var(--foreground) 4%, transparent);
  --raised: color-mix(in oklab, var(--foreground) 5%, var(--background));
  --primary: #1d1d1f;
  --primary-foreground: #fafaf8;
  --bad: #c8312b;
  --ring: color-mix(in oklab, var(--foreground) 14%, transparent);
  --pastel-peach: #ffd2bc;
  --pastel-lilac: #dccaf5;
  --pastel-blue: #c3ceff;
  --pastel-mint: #bfe7d2;
  --tint-amount: 36%;
  --elev-card: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px -12px rgb(0 0 0 / 0.1);
  --radius-control: 0.75rem;
  --radius-panel: 1rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* The page's side margin: 16px on a phone, 24px from a small tablet up. */
  --gutter: clamp(16px, 4vw, 24px);
  /* A form section's inner padding: tighter on a phone. */
  --pad: clamp(16px, 3.5vw, 20px);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --background: #0a0a0a;
  --foreground: #f5f5f5;
  --muted: #8e8e93;
  --faint: #6c6c71;
  --surface: #141414;
  --line: #242424;
  --primary: #f5f5f5;
  --primary-foreground: #0a0a0a;
  --bad: #ff6b61;
  --tint-amount: 12%;
  --elev-card: 0 0 0 1px rgb(255 255 255 / 0.04), 0 12px 32px -12px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}
[data-tone='peach'] {
  --tone: var(--pastel-peach);
}
[data-tone='lilac'] {
  --tone: var(--pastel-lilac);
}
[data-tone='blue'] {
  --tone: var(--pastel-blue);
}
[data-tone='mint'] {
  --tone: var(--pastel-mint);
}
[data-tone] {
  --tone-tint: color-mix(in oklab, var(--tone) var(--tint-amount), var(--background));
  --tone-ink: color-mix(in oklab, var(--tone) 30%, var(--foreground));
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  overflow-wrap: break-word;
  background: var(--background);
  color: var(--foreground);
  font:
    15px/1.55 'Google Sans Flex',
    system-ui,
    sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
.mono {
  font-family: 'Google Sans Code', ui-monospace, monospace;
  font-size: 0.92em;
}
.muted {
  color: var(--muted);
}
kbd {
  font:
    500 11px 'Google Sans Code',
    monospace;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  background: var(--background);
}
:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* header */
.top {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px max(var(--gutter), env(safe-area-inset-right)) 14px
    max(var(--gutter), env(safe-area-inset-left));
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-sub {
  color: var(--muted);
  font-weight: 400;
  padding-left: 9px;
  border-left: 1px solid var(--line-strong);
}
nav {
  display: flex;
  gap: 2px;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}
nav a:hover {
  color: var(--foreground);
  background: var(--hover);
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px max(var(--gutter), env(safe-area-inset-right))
    calc(64px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.view {
  animation: enter 0.35s var(--ease);
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

h1 {
  font-size: clamp(24px, 5.5vw, 28px);
  text-wrap: balance;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0 0 8px;
}
h2 {
  font-size: clamp(19px, 4.5vw, 22px);
  text-wrap: balance;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 6px;
}
.lede {
  color: var(--muted);
  margin: 0;
}

/* glyphs: a topic's pastel square */
.glyph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--tone-tint, var(--raised));
  color: var(--tone-ink, var(--muted));
}
.glyph svg {
  width: 19px;
  height: 19px;
}
.glyph-lg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.glyph-lg svg {
  width: 22px;
  height: 22px;
}
.glyph-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

/* step 1 */
.intro {
  max-width: 560px;
  margin: clamp(16px, 6vw, 48px) auto clamp(20px, 4vw, 28px);
  text-align: center;
}
.as {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}
@media (max-width: 620px) {
  .tiles {
    grid-template-columns: 1fr;
  }
}
.tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--background);
  border-radius: var(--radius-panel);
  padding: 16px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.tile:hover {
  border-color: var(--line-strong);
}
.tile-text {
  flex: 1;
  min-width: 0;
}
.tile b {
  display: block;
  font-weight: 500;
}
.tile-text > span {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}
.tile kbd {
  margin-top: 2px;
}
.alt {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 24px;
}
.alt a {
  color: var(--foreground);
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

/* step 2 */
.compose {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 24px;
}
@media (max-width: 820px) {
  .compose {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .rail {
    position: static !important;
  }
  .next {
    display: none;
  }
}
.rail {
  position: sticky;
  top: 24px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 5px 8px 5px 4px;
  margin-left: -4px;
  border-radius: 8px;
}
.back:hover {
  color: var(--foreground);
  background: var(--hover);
}
.rail .glyph {
  margin: 20px 0 14px;
}
.rail-lede {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.next {
  list-style: none;
  counter-reset: n;
  margin: 28px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.next li {
  counter-increment: n;
  display: flex;
  gap: 10px;
  padding: 4px 0;
}
.next li::before {
  content: '0' counter(n);
  font:
    12px 'Google Sans Code',
    monospace;
  color: var(--faint);
  padding-top: 1px;
}

.sheet {
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--elev-card);
  overflow: hidden;
}
.who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--pad);
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.who b {
  color: var(--foreground);
  font-weight: 500;
}
.who-text {
  flex: 1;
  min-width: 0;
}
.who-reply {
  font-size: 13px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--pastel-blue);
  color: #23305f;
}
.inline-input {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--background);
  width: min(260px, 100%);
  outline: none;
}
.inline-input:focus {
  border-color: var(--foreground);
}
.text-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 7px;
}
.text-btn:hover {
  color: var(--foreground);
  background: var(--hover);
}

.q {
  padding: var(--pad);
  border-bottom: 1px solid var(--line);
}
.q:last-of-type {
  border-bottom: 0;
}
.q-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.q-label {
  display: block;
  font-weight: 500;
  font-size: 14.5px;
}
.pair .q-label {
  margin-bottom: 8px;
}
.tag {
  font-size: 12.5px;
  color: var(--faint);
}
.help {
  color: var(--muted);
  font-size: 13.5px;
  margin: -2px 0 10px;
}
.field {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--background);
  border-radius: var(--radius-control);
  padding: 9px 12px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field::placeholder {
  color: var(--faint);
}
.field:hover {
  border-color: var(--line-strong);
}
.field:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px var(--ring);
}
.field[aria-invalid='true'] {
  border-color: var(--bad);
}
.field-lg {
  font-size: 17px;
  padding: 10px 12px;
  letter-spacing: -0.01em;
}
textarea.field {
  resize: vertical;
  min-height: 88px;
  line-height: 1.55;
  field-sizing: content;
  max-height: 360px;
}
.count {
  text-align: right;
  font:
    11.5px 'Google Sans Code',
    monospace;
  color: var(--faint);
  margin-top: 4px;
}
.err {
  color: var(--bad);
  font-size: 13px;
  margin: 8px 0 0;
}

.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 620px) {
  .options {
    grid-template-columns: 1fr;
  }
}
.option {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--background);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.option:hover {
  border-color: var(--line-strong);
}
.option b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
}
.option small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}
.option[aria-checked='true'] {
  border-color: var(--foreground);
  background: var(--raised);
}
.option .radio {
  margin-left: auto;
  width: 14px;
  height: 14px;
  border-radius: 99px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  transition:
    border-width 0.15s,
    border-color 0.15s;
}
.option[aria-checked='true'] .radio {
  border: 4.5px solid var(--foreground);
}
.sev-blocking {
  background: #e5484d;
}
.sev-slowing {
  background: #f5a524;
}
.sev-minor {
  background: #a1a1a6;
}
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sev {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  flex: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--background);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  transition: all 0.15s;
}
.chip:hover {
  border-color: var(--line-strong);
}
.chip[aria-checked='true'] {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

.steps {
  display: grid;
  gap: 6px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-n {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--raised);
  font:
    500 12px 'Google Sans Code',
    monospace;
  color: var(--muted);
}
.step .field {
  padding: 7px 10px;
}
.icon-btn {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: none;
  color: var(--faint);
  display: grid;
  place-items: center;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--foreground);
}
.add-step {
  margin: 6px 0 0 32px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  padding: 5px 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.add-step:hover {
  color: var(--foreground);
  background: var(--hover);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 620px) {
  .pair {
    grid-template-columns: 1fr;
  }
}

.context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--raised);
  border-radius: 999px;
  padding: 3px 10px;
  max-width: 100%;
}
.pill .mono {
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  overflow: hidden;
}
.suggest-head {
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--raised);
}
.suggest a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px;
}
.suggest a:hover {
  background: var(--hover);
}
.suggest a span {
  color: var(--faint);
}

.drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 14px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.drop:hover {
  border-color: var(--foreground);
  background: var(--hover);
}
.drop b {
  display: block;
  font-weight: 500;
}
.drop .muted {
  font-size: 13px;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(110px, 40%), 1fr));
  gap: 8px;
  margin-top: 10px;
}
.thumbs:empty {
  display: none;
}
.thumb {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--raised);
}
.thumb img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
}
.thumb-cap {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--muted);
}
.thumb-cap span:first-child {
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb .icon-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.drop-overlay.on {
  opacity: 1;
}
.drop-overlay div {
  border: 1.5px dashed var(--foreground);
  border-radius: var(--radius-panel);
  padding: 36px 56px;
  background: var(--background);
  font-size: 17px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px var(--pad);
  border-top: 1px solid var(--line);
  background: var(--raised);
}
.actions .err {
  flex-basis: 100%;
  margin: 0 0 4px;
}
.saved {
  flex: 1;
  font-size: 13px;
  color: var(--faint);
}
.kbd-hint {
  display: inline-flex;
  gap: 3px;
}
@media (max-width: 620px) {
  .kbd-hint {
    display: none;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition:
    opacity 0.15s,
    transform 0.1s;
}
.btn:hover {
  opacity: 0.85;
}
.btn:active {
  transform: scale(0.98);
}
.btn[aria-busy='true'] {
  cursor: progress;
  opacity: 0.7;
}
.btn-ghost {
  background: none;
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--foreground);
  background: var(--hover);
  opacity: 1;
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* step 3 */
.sent {
  max-width: 460px;
  margin: clamp(24px, 8vw, 56px) auto 0;
  text-align: center;
}
.sent .glyph {
  margin: 0 auto 18px;
}
.ticket-id {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 18px 0 28px;
  padding: 3px 3px 3px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--background);
  font-size: 15px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 4px 20px;
  text-align: left;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.timeline li {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child {
  border: 0;
}
.timeline li::before {
  content: '';
  grid-row: span 2;
  width: 22px;
  height: 22px;
  border-radius: 99px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
}
.timeline li.done::before {
  border: 0;
  background: var(--foreground)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}
:root[data-theme='dark'] .timeline li.done::before {
  filter: invert(1);
}
.timeline b {
  font-weight: 500;
}
.timeline span {
  color: var(--muted);
  font-size: 13.5px;
}
.sent-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ---- Touch and small screens ----------------------------------------------------------------------------------- */

/* Keyboard hints only where there's a keyboard; the drop zone speaks to the device in hand. */
.only-touch {
  display: none;
}
@media (hover: none) {
  kbd,
  .kbd-hint,
  .only-pointer {
    display: none !important;
  }
  .only-touch {
    display: block;
  }
}

/* Fingers: 16px text in every field (smaller, and iOS zooms the page on focus), and room to tap. */
@media (pointer: coarse) {
  .field,
  .field-lg,
  .inline-input {
    font-size: 16px;
  }
  .chip {
    padding: 9px 14px;
  }
  .option {
    padding: 12px 14px;
  }
  .text-btn {
    padding: 8px 10px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  .thumb .icon-btn {
    width: 30px;
    height: 30px;
  }
  .btn {
    height: 44px;
  }
  nav a,
  .back,
  .add-step {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

/* A long address or URL wraps rather than pushing the page sideways. */
.who-text,
.lede,
.rail-lede,
.timeline span {
  overflow-wrap: anywhere;
}

/* Below two columns the rail becomes a compact head over the form: back, then the topic's glyph beside its title. */
@media (max-width: 820px) {
  .rail {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
  }
  .rail .back {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .rail .glyph {
    margin: 12px 0 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .rail h2 {
    margin: 12px 0 0;
  }
  .rail-lede {
    grid-column: 1 / -1;
    margin-top: 6px;
  }
}

/* Phones. */
@media (max-width: 520px) {
  .brand-sub {
    padding-left: 7px;
  }
  .tile {
    padding: 14px;
    gap: 12px;
  }
  .who {
    align-items: flex-start;
  }
  .who-change,
  #who-change {
    margin: -4px -6px 0 0;
  }
  .q-head {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .actions .btn {
    flex: 1 1 100%;
  }
  .saved:empty {
    display: none;
  }
  .sent-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ticket-id {
    margin: 14px 0 22px;
  }
  .timeline {
    padding: 4px 16px;
  }
}
