.question-preview-entry {
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.question-preview-entry:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(13, 148, 136, 0.2);
  outline-offset: -3px;
}

.question-preview-page {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px 44px;
  color: #17233b;
}

#questionPreviewView {
  width: calc(100% + 36px);
  margin: -24px -18px 0;
}

#appShell.question-preview-active .bottom-app-nav {
  display: none;
}

#appShell.question-preview-active .content {
  padding-bottom: 0;
}

.question-preview-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 -20px 18px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #bfe8e2;
  background: #f9fffd;
  box-shadow: 0 8px 20px rgba(20, 92, 82, 0.05);
}

.question-preview-back {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #c8e8e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(13, 122, 107, 0.1);
  cursor: pointer;
}

.question-preview-back img {
  display: none;
}

.question-preview-back::before {
  width: 19px;
  height: 19px;
  content: "";
  background: #0b9383;
  mask: url("../../assets/icons/icon-arrow-right.svg") center / contain no-repeat;
  transform: rotate(180deg);
}

.question-preview-back:active {
  background: #eefaf7;
}

.question-preview-back:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.18);
  outline-offset: 2px;
}

.question-preview-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.question-preview-header p {
  margin: 4px 0 0;
  color: #6b7a90;
  font-size: 14px;
  letter-spacing: 0;
}

.question-preview-books {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.question-preview-book-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #cceae4;
  border-radius: 6px;
  color: #08796c;
  background: #effaf7;
  font-size: 14px;
  font-weight: 700;
}

.question-preview-book-chip small {
  color: #6d7d8e;
  font-size: 12px;
  font-weight: 500;
}

.question-preview-filters {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid #dfe8ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 55, 73, 0.06);
}

.question-preview-field {
  display: grid;
  position: relative;
  gap: 7px;
  min-width: 0;
}

.question-preview-field::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 34px;
  height: 34px;
  border-left: 1px solid #cce8e3;
  border-radius: 6px;
  content: "";
  pointer-events: none;
  background-color: #eefaf7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23087f74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.question-preview-field > span {
  color: #5f6f84;
  font-size: 13px;
  font-weight: 700;
}

.question-preview-field select {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 54px 0 14px;
  border: 1px solid #cfe4e1;
  border-radius: 8px;
  color: #17233b;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 3px 9px rgba(21, 76, 69, 0.04);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.question-preview-field select:focus-visible {
  border-color: #0d9488;
  outline: 3px solid rgba(13, 148, 136, 0.15);
}

.question-preview-field:focus-within::after {
  border-left-color: #a8dcd4;
  background-color: #e3f7f2;
}

.question-preview-content {
  min-height: 300px;
  margin-top: 16px;
}

.question-preview-loading,
.question-preview-state {
  display: grid;
  min-height: 160px;
  padding: 24px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid #dfe8ed;
  border-radius: 8px;
  color: #68788d;
  text-align: center;
  background: #fff;
}

.question-preview-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d6efeb;
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: question-preview-spin 0.8s linear infinite;
}

.question-preview-skeleton {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.question-preview-skeleton i {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: #edf3f4;
}

.question-preview-skeleton i:nth-child(2) { width: 82%; }
.question-preview-skeleton i:nth-child(3) { width: 68%; }

.question-preview-state strong {
  color: #28364b;
  font-size: 17px;
}

.question-preview-state p {
  margin: 0;
  font-size: 14px;
}

.question-preview-error button {
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #0d9488;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

@media (max-width: 620px) {
  .question-preview-page {
    min-height: 100vh;
    padding: 0 14px 36px;
  }

  .question-preview-header {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .question-preview-header h1 {
    font-size: 22px;
  }

  .question-preview-filters {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  .question-preview-spinner { animation: none; }
}
