.faq-code__head .section__title { font-size: clamp(1.5rem, 2.4vw, 2.125rem); }
.faq-code__head .section__lead { font-size: 1rem; }
.faq-code {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.faq-code__head { grid-column: 1; grid-row: 1; max-width: none; margin: 0; text-align: right; }
.faq-count { grid-column: 1; grid-row: 2; margin: 0.6rem 0 0; text-align: right; }
.faq-picks { grid-column: 1; grid-row: 3; margin-top: clamp(0.75rem, 2.4svh, 1.5rem); }
.faq-code .code-pad { grid-column: 2; grid-row: 1 / 4; align-self: center; }
.faq-count {
  font: 600 0.75rem/1.2 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.faq-picks {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(0.35rem, 1.1svh, 0.65rem);
}
.faq-pick {
  flex: 0 0 auto;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(255, 0, 0, 0.35);
  border-radius: 18px;
  border-bottom-right-radius: 4px;   
  background-color: var(--color-surface);
  color: var(--color-text-strong);
  font: 600 0.9375rem/1.3 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), transform 0.35s var(--ease-out);
}
.faq-pick:hover { background-color: var(--color-primary); border-color: var(--color-primary); color: var(--color-text-strong); transform: translateX(6px); }
.faq-pick:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.faq-pick.is-asked {
  border-color: transparent;
  background-color: rgba(255, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.6);
}
.faq-pick.is-asked::after { content: " ✓"; font-weight: 800; color: var(--color-primary); }
.faq-pick.is-asked:hover { background-color: var(--color-primary); color: var(--color-text-strong); }
.faq-pick.is-asked:hover::after { color: var(--color-text-strong); }
.faq-pick.is-current { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.25); }
.code-pad {
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --code-line: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: clamp(460px, calc(100svh - 88px - 4rem), 700px);   
  overflow: hidden;
  border: 1px solid #2f2f2f;
  border-radius: 14px;
  background-color: #0d0d0d;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 60px -20px rgba(255, 0, 0, 0.25);
}
.code-pad__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  height: 42px;
  padding-inline: 16px;
  border-bottom: 1px solid #222;
  background-color: #161616;
}
.code-pad__bar i { width: 11px; height: 11px; border-radius: 50%; background-color: #3a3a3a; }
.code-pad__bar i:first-child { background-color: var(--color-primary); }
.code-pad__tab {
  margin-left: 12px;
  padding: 0.3rem 0.8rem;
  border-radius: 6px 6px 0 0;
  background-color: #0d0d0d;
  font: 500 0.75rem/1 var(--mono);
  color: var(--color-text-strong);
}
.code-pad__url {
  margin-left: auto;
  font: 500 0.6875rem/1 var(--mono);
  color: #6b6b6b;
}
.code-pad__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  flex: 1;
  min-height: 0;
}
.code-pad__code {
  position: relative;
  padding: 1rem 1rem 1rem 0;
  overflow: hidden;
  counter-reset: code;
  border-right: 1px solid #222;
  font: 400 clamp(0.75rem, 1.9svh, 0.875rem)/var(--code-line) var(--mono);
  color: #cfcfcf;
  contain: paint;   
}
.code-pad__fixed,
.code-pad__item,
.code-pad__empty {
  counter-increment: code;
  position: relative;
  margin: 0;
  padding-left: 3.4rem;
  white-space: nowrap;
}
.code-pad__fixed::before,
.code-pad__item::before,
.code-pad__empty::before {
  content: counter(code);
  position: absolute;
  left: 0;
  width: 2.4rem;
  text-align: right;
  color: #4d4d4d;
}
.code-pad__fixed b { font-weight: 400; color: var(--color-primary); }
.code-pad__close { counter-increment: none; }
.code-pad__close::before { content: none; }
.code-pad__lines { margin: 0; padding: 0; list-style: none; }
.code-pad__item {
  display: block;
  padding-left: 4.6rem;   
  animation: codeType 0.6s steps(18, end) both;   
}
.code-pad__item .k { color: #ffffff; }
.code-pad__item .v { color: #ff6b6b; }
.code-pad__item small { display: block; font-size: 1em; line-height: 1.2; margin: -0.35rem 0 0.25rem; color: #6b6b6b; }
.code-pad__item.is-again { animation: codeAgain 1s var(--ease-out); }
@keyframes codeType { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes codeAgain { 0%, 100% { background-color: transparent; } 30% { background-color: rgba(255, 0, 0, 0.22); } }
.code-pad__empty { padding-left: 4.6rem; color: #6b6b6b; font-style: italic; }
.code-pad__caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.2em;
  vertical-align: -0.2em;
  background-color: var(--color-primary);
  animation: codeCaret 1s steps(1) infinite;
}
@keyframes codeCaret { 50% { opacity: 0; } }
.code-pad__note {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.1rem clamp(1rem, 2vw, 1.6rem);
  overflow: hidden;
  background: radial-gradient(circle at 80% 0%, rgba(255, 0, 0, 0.08), transparent 60%);
  contain: paint;
}
.code-pad__note-label {
  margin: 0 0 0.6rem;
  font: 700 0.625rem/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.code-pad__q { margin: 0 0 0.5rem; font: 800 clamp(1.05rem, 2.6svh, 1.35rem)/1.25 var(--font-display); color: var(--color-text-strong); }
.code-pad__a { margin: 0; font-size: clamp(0.9375rem, 2.2svh, 1.0625rem); line-height: 1.6; color: var(--color-text-subtle); }
.code-pad__a.is-writing { animation: codeWriteDown 0.75s steps(12, end) both; }   
@keyframes codeWriteDown { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.code-pad__foot {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: clamp(3.4rem, 9svh, 4.6rem);
  padding: 0.6rem 1.2rem;
  border-top: 1px solid #222;
  background-color: #111;
}
.code-pad__deploy { display: flex; flex-direction: column; gap: 0.45rem; width: min(70%, 360px); }
.code-pad__status {
  font: 600 0.6875rem/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a8a;
  transition: color 0.3s var(--ease-out);
}
.code-pad__progress { display: block; height: 6px; overflow: hidden; border-radius: 6px; background-color: #262626; }
.code-pad__progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary-hover), var(--color-primary));
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
  transform: scaleX(var(--done, 0));
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
.code-pad.is-done .code-pad__status { color: var(--color-text-strong); }
.code-pad__deploy { transition: opacity 0.3s var(--ease-out) 0.6s, transform 0.3s var(--ease-out) 0.6s; }
.code-pad.is-done .code-pad__deploy { opacity: 0; transform: translateY(-6px); }
.code-pad__term {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.4rem 1.2rem;
  font: 500 clamp(0.6875rem, 1.6svh, 0.8125rem)/1.55 var(--mono);
  color: #cfcfcf;
  visibility: hidden;
  pointer-events: none;
}
.code-pad.is-done .code-pad__term { visibility: visible; }
.code-pad__term p {
  margin: 0;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
}
.code-pad__term b { font-weight: 700; color: var(--color-primary); }
.code-pad__term p + p b { color: #3ddc84; }   
.code-pad.is-done .code-pad__term p { animation: codeType 0.55s steps(22, end) both; }
.code-pad.is-done .code-pad__term p:nth-child(1) { animation-delay: 0.9s; }
.code-pad.is-done .code-pad__term p:nth-child(2) { animation-delay: 1.6s; }
.code-pad__toast {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: fit-content;   
  max-width: calc(100% - 1.8rem);
  margin-block: auto;
  padding: 0.55rem 0.9rem 0.55rem 0.7rem;
  border: 1px solid #2f2f2f;
  border-left: 3px solid #3ddc84;
  border-radius: 8px;
  background-color: #1b1b1b;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom right;
  pointer-events: none;
}
.code-pad.is-done .code-pad__toast { animation: codeToast 0.25s var(--ease-out) 2.25s both; }
.code-pad__toast p { margin: 0; line-height: 1.3; }
.code-pad__toast b { display: block; font: 700 0.8125rem/1.3 var(--font-body); color: var(--color-text-strong); }
.code-pad__toast span { display: block; font-size: 0.75rem; color: var(--color-text-subtle); }
.code-pad__check { flex-shrink: 0; width: 26px; height: 26px; fill: none; stroke: #3ddc84; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.code-pad__check circle { opacity: 0.35; }
.code-pad__check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.code-pad.is-done .code-pad__check path { animation: codeCheck 0.3s var(--ease-out) 2.4s both; }
@keyframes codeToast {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes codeCheck { to { stroke-dashoffset: 0; } }
@media (min-width: 769px) and (max-width: 1100px) {
  .faq-pick { white-space: normal; }   
  .code-pad__main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }   
  .code-pad__code { max-height: 15rem; border-right: 0; border-bottom: 1px solid #222; }
}
@media (prefers-reduced-motion: reduce) {
  .code-pad__item,
  .code-pad__item.is-again,
  .code-pad__a.is-writing,
  .code-pad__caret,
  .code-pad.is-done .code-pad__term p,
  .code-pad.is-done .code-pad__check path { animation: none; }
  .code-pad.is-done .code-pad__term p { clip-path: none; }
  .code-pad.is-done .code-pad__check path { stroke-dashoffset: 0; }
  .code-pad.is-done .code-pad__toast { animation: codeFade 0.2s ease both; }   
  @keyframes codeFade { from { opacity: 0; } to { opacity: 1; transform: none; } }
  .code-pad__progress i,
  .code-pad__deploy { transition: none; }
}
.faq-data { margin: 1rem 1.2rem; overflow: auto; }
.faq-data dt { font-weight: 700; color: var(--color-text-strong); }
.faq-data dd { margin: 0 0 0.75rem; color: var(--color-text-subtle); }
.code-pad.is-ready .faq-data { display: none; }
.code-pad:not(.is-ready) .code-pad__main,
.code-pad:not(.is-ready) .code-pad__foot { display: none; }
@media (max-width: 768px) {
  .faq-code { display: flex; flex-direction: column; }
  .faq-code__head,
  .faq-count { text-align: center; }
  .faq-count { margin: 0.35rem 0 0; font-size: 0.6875rem; }
  .faq-picks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.3rem;
    width: 100%;
    margin-top: 0.55rem;
  }
  .faq-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 34px;
    padding: 0.28rem 0.5rem;
    border-radius: 16px;
    font-size: 0.6875rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;   
  }
  .faq-pick:hover { transform: none; }
  .faq-pick.is-asked::after { white-space: nowrap; }
  .faq-code .code-pad {
    height: clamp(340px, calc(100svh - 88px - 0px - 12.5rem), 520px);
    margin-top: 0.75rem;
    border-radius: 12px;
  }
  .code-pad__bar { height: 34px; gap: 6px; padding-inline: 12px; }
  .code-pad__bar i { width: 9px; height: 9px; }
  .code-pad__url { display: none; }
  .code-pad__main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .code-pad__code { display: none; }
  .code-pad__note { padding: 0.75rem 0.9rem; }
  .code-pad__q { font-size: 1rem; }
  .code-pad__a { font-size: 0.875rem; line-height: 1.5; }
  .code-pad__foot { min-height: 3.2rem; padding: 0.5rem 0.9rem; }
  .code-pad__term { display: none; }
  .code-pad__toast { left: 0.6rem; right: 0.6rem; max-width: none; padding-block: 0.45rem; }
  .code-pad.is-done .code-pad__toast { animation-delay: 0.7s; }
  .code-pad.is-done .code-pad__check path { animation-delay: 0.85s; }
}
