.quest-app {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, #edf3ea 0%, #dde8da 34%, #c9dbcb 100%);
  color: #1f2d22;
}

.quest-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.quest-header {
  background: rgba(243, 247, 241, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(71, 95, 76, 0.12);
}

.quest-header__bar {
  min-height: 44px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.quest-header__copy {
  text-align: center;
}

.quest-header__copy h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  color: #203124;
  letter-spacing: -0.02em;
}

.quest-header__copy p {
  margin: 3px 0 0;
  font-size: 11px;
  color: #667467;
}

.quest-header__back,
.quest-header__close {
  border: none;
  background: none;
  color: #2d6a4f;
  font-size: 14px;
  font-weight: 600;
  padding: 0;
}

.quest-header__back[disabled] {
  visibility: hidden;
}

.quest-status {
  display: none;
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(64, 110, 84, 0.1);
  color: #29523c;
  font-size: 13px;
  line-height: 1.5;
}

.quest-status.is-visible {
  display: block;
}

.quest-status.is-error {
  background: rgba(176, 83, 54, 0.12);
  color: #8a3f23;
}

.quest-content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-area-bottom));
  overflow-y: auto;
}

.quest-hero,
.quest-panel,
.quest-detail-card,
.quest-section {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(74, 96, 78, 0.1);
  box-shadow: 0 18px 36px rgba(46, 63, 44, 0.08);
}

.quest-hero,
.quest-panel,
.quest-detail-card {
  padding: 20px;
}

.quest-section {
  margin-top: 16px;
  padding: 18px;
}

.quest-section--compact {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.quest-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7b6e;
  margin-bottom: 10px;
}

.quest-hero__copy strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: #203124;
  letter-spacing: -0.04em;
}

.quest-hero__copy p,
.quest-panel p,
.quest-detail-card p,
.quest-empty-state,
.quest-panel__hint {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: #627164;
}

.quest-hero__actions,
.quest-inline-actions,
.quest-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quest-primary-btn,
.quest-secondary-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}

.quest-primary-btn {
  background: linear-gradient(135deg, #527b5d, #7da26f);
  color: #fff;
}

.quest-secondary-btn {
  background: rgba(255, 255, 255, 0.82);
  color: #2f4e39;
  border-color: rgba(74, 96, 78, 0.14);
}

.quest-secondary-btn--muted {
  color: #6f7b70;
}

.quest-primary-btn[disabled],
.quest-secondary-btn[disabled] {
  opacity: 0.52;
}

.quest-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quest-section__head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quest-section__action {
  border: none;
  background: rgba(47, 78, 57, 0.08);
  color: #31533d;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.quest-section__head h2 {
  margin: 0;
  font-size: 17px;
  color: #203124;
}

.quest-section__head span {
  font-size: 12px;
  color: #708072;
}

.quest-task-card,
.quest-step-card {
  width: 100%;
  border: none;
  text-align: left;
  background: #f8fbf6;
  border-radius: 18px;
  padding: 16px;
}

.quest-task-card + .quest-task-card,
.quest-step-card + .quest-step-card,
.quest-plan-step-editor + .quest-plan-step-editor {
  margin-top: 12px;
}

.quest-task-card__meta,
.quest-task-card__footer,
.quest-detail-card__meta,
.quest-plan-step-editor__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quest-task-card__meta,
.quest-task-card__footer,
.quest-detail-card__meta,
.quest-plan-step-editor__meta,
.quest-step-card__copy span {
  font-size: 12px;
  color: #728174;
}

.quest-task-card strong,
.quest-step-card__copy strong,
.quest-detail-card h2 {
  display: block;
  margin: 10px 0 6px;
  font-size: 17px;
  line-height: 1.35;
  color: #1f3023;
}

.quest-task-card p,
.quest-step-card__copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #5f6f63;
}

.quest-empty-state {
  padding: 16px;
  border-radius: 16px;
  background: rgba(241, 245, 239, 0.92);
}

.quest-chat-thread {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-chat-bubble {
  padding: 14px 16px;
  border-radius: 18px;
  max-width: 100%;
}

.quest-chat-bubble--assistant {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(74, 96, 78, 0.08);
}

.quest-chat-bubble--user {
  margin-left: auto;
  background: linear-gradient(135deg, #5f8268, #76956d);
  color: #fff;
}

.quest-chat-bubble span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  opacity: 0.76;
}

.quest-chat-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.quest-detail-stats,
.quest-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.quest-detail-stat,
.quest-readonly-card {
  padding: 14px;
  border-radius: 16px;
  background: #f7faf4;
}

.quest-detail-stat span,
.quest-readonly-card span,
.quest-field span {
  display: block;
  font-size: 12px;
  color: #728174;
  margin-bottom: 6px;
}

.quest-detail-stat strong,
.quest-readonly-card strong {
  display: block;
  font-size: 16px;
  color: #1f3023;
}

.quest-step-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.quest-step-card.is-completed {
  background: #eef6ec;
}

.quest-step-card__copy {
  min-width: 0;
  flex: 1;
}

.quest-step-card__action {
  flex-shrink: 0;
  min-width: 72px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  background: #2f6a4d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.quest-step-card__action[disabled] {
  background: #90a996;
}

.quest-panel--warning {
  background: rgba(255, 248, 236, 0.9);
  border-color: rgba(195, 150, 82, 0.24);
}

.quest-panel strong {
  display: block;
  font-size: 18px;
  color: #203124;
}

.quest-field {
  display: block;
  margin-top: 16px;
}

.quest-field input,
.quest-field textarea,
.quest-field select {
  width: 100%;
  border: 1px solid rgba(90, 113, 94, 0.14);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 14px 15px;
  font-size: 15px;
  color: #223225;
  resize: vertical;
}

.quest-field textarea {
  min-height: 112px;
}

.quest-field select {
  min-height: 48px;
}

.quest-plan-step-editor {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(90, 113, 94, 0.12);
}

@media (max-width: 360px) {
  .quest-content {
    padding-inline: 12px;
  }

  .quest-detail-stats,
  .quest-readonly-grid {
    grid-template-columns: 1fr;
  }
}
