.ask-page .section:last-of-type {
  padding-bottom: 28px;
}

.ask-page .brand {
  color: var(--text-secondary);
  font-weight: 600;
}

.ask-hero {
  padding-bottom: 6px;
}

.ask-hero-copy {
  max-width: 620px;
  margin-bottom: 12px;
}

.ask-hero-eyebrow {
  display: inline-flex;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(125, 74, 43, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.ask-composer-panel,
.ask-thread-panel {
  display: grid;
  gap: 14px;
}

.ask-composer-panel {
  padding: 16px;
  border-radius: 16px;
}

.ask-thread-panel {
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(71, 50, 34, 0.06);
}

.ask-composer {
  display: grid;
  gap: 10px;
}

.ask-composer-label {
  font-weight: 600;
}

.ask-composer-label--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ask-composer-input {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-base);
  color: var(--text-primary);
  font: inherit;
  resize: vertical;
}

.ask-composer-input:focus-visible,
.ask-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ask-composer-actions {
  display: grid;
  gap: 10px;
}

.ask-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ask-submit-btn {
  min-width: 280px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 12px;
}

.ask-submit-btn.ask-submit-btn--loading {
  position: relative;
  opacity: 0.96;
}

.ask-submit-btn.ask-submit-btn--loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  display: inline-block;
  vertical-align: -2px;
  animation: ask-button-spin 0.9s linear infinite;
}

.ask-composer-note,
.ask-status {
  margin: 0;
}

.ask-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.ask-inline-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(125, 74, 43, 0.3);
  animation: ask-inline-pulse 1.4s ease-out infinite;
}

.ask-clear-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ask-clear-link:hover,
.ask-clear-link:focus-visible {
  color: var(--accent);
}

.ask-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ask-chip {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
}

.ask-thread {
  display: grid;
  gap: 14px;
}

.ask-thread-section {
  padding-top: 6px;
}

.ask-secondary-stack {
  display: grid;
  gap: 12px;
}

.ask-secondary-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.ask-secondary-panel summary {
  position: relative;
  padding: 16px 44px 16px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.ask-secondary-panel summary::-webkit-details-marker {
  display: none;
}

.ask-secondary-panel summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}

.ask-secondary-panel[open] summary::after {
  content: "−";
}

.ask-secondary-panel-body {
  padding: 0 16px 16px;
}

.ask-secondary-grid {
  gap: 12px;
}

.ask-secondary-grid .card,
.ask-secondary-panel .release-card {
  box-shadow: none;
  background: var(--bg-base);
}

.ask-thread-topline {
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: rgba(125, 74, 43, 0.24);
}

.ask-message {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  transition: box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ask-message--user {
  background: rgba(125, 74, 43, 0.08);
}

.ask-message--assistant {
  background: linear-gradient(180deg, #fffdfb 0%, var(--surface) 100%);
  border-left: 4px solid var(--accent);
  box-shadow: 0 10px 24px rgba(71, 50, 34, 0.06);
}

.ask-message--latest {
  border-color: rgba(125, 74, 43, 0.32);
  box-shadow: 0 14px 30px rgba(71, 50, 34, 0.1);
  animation: ask-message-flash 2.4s ease-out 1;
}

.ask-message-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ask-message-role::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(125, 74, 43, 0.34);
}

.ask-message--assistant .ask-message-role::before {
  background: var(--accent);
}

.ask-message-summary {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(125, 74, 43, 0.08);
  border: 1px solid rgba(125, 74, 43, 0.12);
  font-weight: 500;
  line-height: 1.7;
}

.ask-message-body {
  max-width: 74ch;
}

.ask-message-body p {
  margin-bottom: 14px;
  line-height: 1.78;
}

.ask-message-body p:last-child {
  margin-bottom: 0;
}

.ask-status--error {
  color: #9f2f2f;
}

.ask-status--success {
  color: var(--text-secondary);
}

.ask-status[hidden],
.ask-inline-status[hidden],
.ask-thread-panel[hidden] {
  display: none;
}

@keyframes ask-button-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ask-inline-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(125, 74, 43, 0.3);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(125, 74, 43, 0);
  }
}

@keyframes ask-message-flash {
  0% {
    transform: translateY(8px);
    box-shadow: 0 20px 36px rgba(71, 50, 34, 0.16);
    background: linear-gradient(180deg, #fffaf3 0%, #fffdfb 100%);
  }
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .ask-page .brand {
    font-size: 15px;
  }

  .ask-hero {
    padding-top: 4px;
  }

  .ask-hero h1 {
    font-size: 22px;
    line-height: 1.12;
    margin-bottom: 10px;
  }

  .ask-hero-copy {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.55;
  }

  .ask-composer-panel {
    padding: 14px;
    gap: 12px;
  }

  .ask-submit-btn,
  .ask-composer-actions .download-btn {
    width: 100%;
  }

  .ask-inline-status {
    font-size: 13px;
  }

  .ask-composer-meta {
    align-items: flex-start;
  }

  .ask-chip-row {
    grid-template-columns: 1fr;
  }

  .ask-chip {
    white-space: normal;
  }

  .ask-thread-section {
    padding-top: 0;
  }

  .ask-thread-topline {
    display: none;
  }

  .ask-thread-panel {
    padding: 14px;
  }

  .ask-secondary-stack {
    gap: 10px;
  }

  .ask-secondary-panel summary {
    padding: 14px 42px 14px 14px;
    font-size: 15px;
  }

  .ask-secondary-panel-body {
    padding: 0 14px 14px;
  }

  .ask-message {
    padding: 14px 14px 16px;
  }
}
