@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/noto-serif-sc/NotoSerifSC-300.ttf') format('truetype');
}

@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-sc/NotoSerifSC-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans/PlusJakartaSans-300.ttf') format('truetype');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans/PlusJakartaSans-500.ttf') format('truetype');
}

.help-page {
  --help-bg: #ffffff;
  --help-grid: rgba(15, 23, 42, 0.025);
  --help-heading: #17191d;
  --help-text: #555a63;
  --help-muted: #9298a2;
  --help-placeholder: #b7bcc4;
  --help-border: rgba(23, 25, 29, 0.12);
  --help-border-strong: #22252a;
  --help-accent: #008b9b;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--help-text);
  background-color: var(--help-bg);
  background-image:
    linear-gradient(to right, var(--help-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--help-grid) 1px, transparent 1px);
  background-size: 60px 60px;
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  font-weight: 300;
}

html[data-theme='dark'] .help-page {
  --help-bg: #090a0d;
  --help-grid: rgba(226, 232, 240, 0.025);
  --help-heading: #f3f5f7;
  --help-text: #b8bec8;
  --help-muted: #737b88;
  --help-placeholder: #5f6671;
  --help-border: rgba(226, 232, 240, 0.12);
  --help-border-strong: #dce2e9;
  --help-accent: #55d8e5;
}

.help-footer {
  color: var(--help-text);
  background-color: var(--help-bg);
  border-top-color: var(--help-border);
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

.help-footer a {
  color: var(--help-text);
}

.help-footer .text-gray-500 {
  color: var(--help-muted) !important;
}

.help-footer a:hover {
  color: var(--help-heading) !important;
}

html[data-theme='light'] .help-main {
  --help-heading: #111318;
  --help-text: #414751;
  --help-muted: #737b87;
  --help-placeholder: #858d99;
  --help-border: rgba(23, 25, 29, 0.2);
  --help-border-strong: #17191d;
  color: var(--help-text);
}

.help-page ::selection {
  color: var(--help-heading);
  background: rgba(0, 240, 255, 0.2);
}

.help-main {
  box-sizing: border-box;
  width: min(100% - 48px, 896px);
  min-height: calc(100svh - 74px);
  margin: 0 auto;
  padding: 120px 0 48px;
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
  gap: 44px;
  flex: 1;
}

.help-dialogue {
  min-height: 0;
  display: flex;
  align-items: center;
}

.help-dialogue__scroll {
  width: 100%;
}

.help-page.has-help-conversation .help-main {
  min-height: calc(100svh - 70px);
  padding-top: 88px;
  padding-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.help-page.has-help-conversation .help-dialogue {
  flex: 1 0 auto;
  align-items: flex-start;
}

.help-page.has-help-conversation .help-inquiry {
  flex: 0 0 auto;
  gap: 12px;
}

.help-welcome {
  transition: opacity 360ms ease, transform 360ms ease;
}

.help-welcome.is-leaving {
  opacity: 0;
  transform: translateY(12px);
}

.help-eyebrow,
.help-index__label,
.help-question__label,
.help-answer__label {
  margin: 0;
  color: var(--help-muted);
  font-size: 10px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.mosaic-container {
  position: relative;
  display: inline-block;
  margin: 22px 0 0;
  cursor: pointer;
}

#mosaicCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.clear-text {
  display: inline-block;
  padding: 0 20px;
  color: #ffffff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 7.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.help-intro {
  max-width: 570px;
  margin: 22px 0 0;
  color: var(--help-text);
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0;
}

.help-qa-flow[hidden],
.help-welcome[hidden] {
  display: none;
}

.help-qa-flow {
  display: grid;
  gap: 42px;
}

.help-exchange {
  display: grid;
  gap: 24px;
  animation: help-rise 400ms ease both;
}

.help-question,
.help-answer {
  display: grid;
  gap: 9px;
}

.help-question__text {
  margin: 0;
  color: var(--help-heading);
  font-family: 'Noto Serif SC', serif;
  font-size: 21px;
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.help-answer {
  margin-left: 22px;
  padding-left: 22px;
  border-left: 1px solid var(--help-border);
}

.help-answer__label {
  color: var(--help-accent);
}

.help-answer__content {
  display: block;
  color: var(--help-text);
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.help-answer__content--streaming {
  min-height: 1.95em;
}

.help-answer__content.is-error {
  color: #b45353;
}

.help-answer__content strong {
  display: inline;
  color: var(--help-heading);
  font-weight: 700;
}

.help-answer__state {
  margin: 0;
  color: var(--help-muted);
  font-family: 'Noto Serif SC', serif;
  font-size: 12px;
  line-height: 1.7;
}

.help-answer__state:not([hidden])::after {
  content: '';
  width: 4px;
  height: 4px;
  margin-left: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--help-accent);
  animation: help-pulse 1.1s ease-in-out infinite;
}

.help-answer__actions {
  margin-top: 2px;
}

.help-answer__actions[hidden] {
  display: none;
}

.help-answer__retry {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--help-border);
  color: var(--help-muted);
  background: transparent;
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  line-height: 1.8;
  cursor: pointer;
}

.help-answer__retry:hover {
  color: var(--help-heading);
  border-color: var(--help-border-strong);
}

.help-related-topics {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--help-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.help-related-topics__label {
  color: var(--help-muted);
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 12px;
}

.help-related-topic {
  padding: 5px 12px;
  border: 1px solid var(--help-border);
  border-radius: 0;
  background: color-mix(in srgb, var(--help-bg) 82%, transparent);
  color: var(--help-text);
  font-family: 'Noto Serif SC', serif;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  transition: border-color 220ms ease, color 220ms ease;
}

.help-related-topic:hover {
  border-color: var(--help-border-strong);
  color: var(--help-heading);
}

.help-related-topic:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.45);
  outline-offset: 2px;
}

.help-inquiry {
  display: grid;
  gap: 28px;
}

.help-index {
  display: grid;
  gap: 12px;
}

.help-index[hidden] {
  display: none;
}

.help-index__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.help-index-card {
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--help-border);
  border-radius: 0;
  color: inherit;
  background: color-mix(in srgb, var(--help-bg) 82%, transparent);
  text-align: left;
  cursor: pointer;
  transition: border-color 220ms ease, color 220ms ease, transform 220ms ease;
}

.help-index-card:hover {
  border-color: var(--help-border-strong);
  color: var(--help-heading);
  transform: translateY(-2px);
}

.help-index-card:focus-visible,
.help-form__submit:focus-visible,
.help-form__stop:focus-visible,
.help-answer__retry:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.45);
  outline-offset: 3px;
}

.help-index-card:disabled,
.help-form__submit:disabled,
.help-form__input:disabled {
  cursor: wait;
  opacity: 0.55;
}

.help-index-card__title {
  color: currentColor;
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
}

.help-form {
  min-height: 53px;
  padding-top: 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 36px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--help-border);
}

.help-form__label {
  color: var(--help-muted);
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
}

.help-form__input {
  min-width: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: var(--help-heading);
  background: transparent;
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
}

.help-form__input::placeholder {
  color: var(--help-placeholder);
  opacity: 1;
}

.help-form__submit,
.help-form__stop {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--help-muted);
  background: transparent;
  cursor: pointer;
  transition: color 200ms ease, background-color 200ms ease;
}

.help-form__submit:hover,
.help-form__stop:hover {
  color: var(--help-heading);
  background: var(--help-border);
}

.help-form__submit svg,
.help-form__stop svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.4;
}

.help-form__stop {
  color: var(--help-accent);
}

.help-form__submit[hidden],
.help-form__stop[hidden] {
  display: none;
}

.help-form__meta {
  min-height: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--help-muted);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.help-form__status {
  margin: 0;
}

.help-form__status[data-tone='working'] {
  color: var(--help-accent);
}

.help-form__status[data-tone='success'] {
  color: var(--help-text);
}

.help-form__status[data-tone='error'] {
  color: #b45353;
}

.help-form__counter {
  flex: 0 0 auto;
  font-family: 'JetBrains Mono', monospace;
}

@keyframes help-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 767px) {
  .help-main {
    width: min(100% - 36px, 896px);
    min-height: calc(100svh - 66px);
    padding: 102px 0 34px;
    grid-template-rows: minmax(290px, 1fr) auto;
    gap: 34px;
  }

  .help-page.has-help-conversation .help-main {
    min-height: calc(100svh - 62px);
    padding-top: 82px;
    padding-bottom: 20px;
    gap: 20px;
  }

  .help-page.has-help-conversation .help-inquiry {
    gap: 10px;
  }

  .mosaic-container {
    margin-top: 17px;
  }

  .clear-text {
    padding: 0 10px;
    font-size: 3.5rem;
  }

  .help-intro {
    margin-top: 17px;
    font-size: 13px;
    line-height: 1.9;
  }

  .help-qa-flow {
    gap: 34px;
  }

  .help-question__text {
    font-size: 19px;
  }

  .help-answer {
    margin-left: 8px;
    padding-left: 16px;
  }

  .help-index__grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .help-index-card {
    min-height: 66px;
    padding: 11px 14px;
  }

  .help-inquiry {
    gap: 22px;
  }

  .help-form__meta {
    gap: 10px;
    font-size: 10px;
  }

}

@media (max-width: 380px) {
  .help-main {
    width: min(100% - 28px, 896px);
  }

  .help-form {
    grid-template-columns: auto minmax(0, 1fr) 32px;
    gap: 9px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .help-welcome,
  .help-exchange,
  .help-index-card,
  .help-form__submit,
  .help-form__stop,
  .help-answer__state:not([hidden])::after {
    animation: none;
    scroll-behavior: auto;
    transition: none;
  }
}
