.faq-page .page-shell {
  min-height: 100vh;
}

.faq-header {
  position: relative;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
}

.back-home {
  position: absolute;
  right: max(24px, calc((100% - 920px) / 2));
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
}

.back-home:hover {
  background: rgba(255, 255, 255, 0.2);
}

.faq-main {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 28px;
}

.faq-hero {
  color: var(--plum-dark);
  text-align: center;
}

.faq-hero h1 {
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.faq-hero p {
  margin: 10px 0 0;
  color: rgba(80, 55, 68, 0.82);
}

.faq-tools {
  margin-top: 26px;
  padding: 20px;
  background: rgba(255, 251, 253, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.faq-search {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 10px 0 13px;
  background: #fff;
  border: 1px solid rgba(104, 76, 92, 0.16);
  border-radius: 13px;
}

.faq-search:focus-within {
  border-color: rgba(22, 139, 208, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 139, 208, 0.12);
}

.faq-search > span {
  color: var(--blue-dark);
  font-size: 1.45rem;
  line-height: 1;
}

.faq-search input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  background: transparent;
  border: 0;
  outline: 0;
}

.faq-search input::placeholder {
  color: #9a8e95;
}

.faq-search button {
  padding: 6px 9px;
  color: var(--blue-dark);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  background: #edf8fe;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.category-button {
  min-height: 36px;
  padding: 7px 13px;
  color: #675a62;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid rgba(104, 76, 92, 0.13);
  border-radius: 999px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.category-button:hover,
.category-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-color: transparent;
}

.category-button:focus-visible {
  outline: 3px solid rgba(15, 111, 169, 0.28);
  outline-offset: 2px;
}

.result-count {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.knowledge-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.knowledge-card {
  display: grid;
  min-height: 76px;
  grid-template-columns: 38px 1fr 22px;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 251, 253, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 15px;
  box-shadow: 0 9px 24px rgba(84, 52, 67, 0.09);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.knowledge-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 139, 208, 0.32);
  box-shadow: 0 13px 28px rgba(84, 52, 67, 0.14);
}

.knowledge-card:focus-visible {
  outline: 3px solid rgba(15, 111, 169, 0.32);
  outline-offset: 3px;
}

.knowledge-order {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 800;
}

.knowledge-copy {
  min-width: 0;
}

.knowledge-copy strong,
.knowledge-copy small {
  display: block;
}

.knowledge-copy strong {
  color: #433941;
  font-size: 0.88rem;
  line-height: 1.45;
}

.knowledge-copy small {
  margin-top: 4px;
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 700;
}

.knowledge-arrow {
  color: var(--blue-dark);
  font-size: 1.45rem;
  font-weight: 400;
  text-align: right;
}

.faq-loading-error {
  margin-top: 18px;
  padding: 28px 20px;
  color: #8a3c55;
  text-align: center;
  background: rgba(255, 248, 250, 0.93);
  border: 1px solid rgba(138, 60, 85, 0.16);
  border-radius: 18px;
}

.faq-loading-error p {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

.faq-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 18px;
}

.faq-item {
  overflow: hidden;
  background: rgba(255, 251, 253, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(84, 52, 67, 0.1);
}

.faq-item[hidden] {
  display: none;
}

.faq-item details summary {
  position: relative;
  display: grid;
  min-height: 76px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 44px 16px 17px;
  color: #433941;
  cursor: pointer;
  list-style: none;
}

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

.faq-item details summary::after {
  position: absolute;
  right: 17px;
  color: var(--blue-dark);
  content: "+";
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 160ms ease;
}

.faq-item details[open] summary::after {
  transform: rotate(45deg);
}

.faq-item details[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-item details summary:focus-visible {
  outline: 3px solid rgba(15, 111, 169, 0.28);
  outline-offset: -3px;
}

.faq-item summary span {
  font-size: 0.93rem;
  font-weight: 800;
  line-height: 1.45;
}

.faq-item summary small {
  padding: 4px 7px;
  color: var(--blue-dark);
  font-size: 0.65rem;
  font-weight: 700;
  background: #eaf7fe;
  border-radius: 7px;
  white-space: nowrap;
}

.faq-answer {
  padding: 15px 17px 18px;
}

.faq-answer p {
  margin: 0;
  color: #62565e;
  font-size: 0.84rem;
  line-height: 1.75;
}

.faq-empty {
  margin-top: 18px;
  padding: 34px 20px;
  color: var(--plum-dark);
  text-align: center;
  background: rgba(255, 251, 253, 0.9);
  border-radius: 18px;
}

.faq-empty p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.faq-note {
  margin-top: 18px;
  padding: 16px 18px;
  color: #604f58;
  background: rgba(255, 255, 255, 0.57);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 15px;
  font-size: 0.8rem;
  line-height: 1.65;
}

.faq-note p {
  margin: 4px 0 0;
}

@media (max-width: 680px) {
  .faq-main {
    width: min(100% - 24px, 540px);
    padding-top: 34px;
  }

  .faq-results {
    grid-template-columns: 1fr;
  }

  .knowledge-list {
    grid-template-columns: 1fr;
  }

  .back-home {
    right: 14px;
  }

  .faq-header .brand {
    margin-right: 82px;
  }
}

@media (max-width: 420px) {
  .faq-header {
    justify-content: flex-start;
    padding-left: 18px;
  }

  .faq-header .brand {
    gap: 8px;
    margin-right: 72px;
    font-size: 1.08rem;
  }

  .faq-header .brand-mark {
    width: 28px;
    height: 28px;
  }

  .back-home {
    right: 10px;
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  .faq-tools {
    padding: 15px;
  }

  .category-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-button {
    padding-inline: 6px;
  }

  .faq-item details summary {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .faq-item summary small {
    justify-self: start;
  }
}
