/* Новый экран ответа (прототип 04.10). Только простой вид. */
.answer-view {
  --a-bg: #F5F6F3;
  --a-surface: #FFFFFF;
  --a-ink: #17201C;
  --a-ink-2: #2E3A34;
  --a-muted: #55625B;
  --a-line: #DDE2DC;
  --a-line-2: #C9D1CA;
  --a-accent: #1E6A50;
  --a-accent-ink: #134634;
  --a-accent-soft: #E6F0EB;
  --a-neutral-soft: #EEF0ED;
  --a-q-bg: #FBF1E4;
  --a-q-ink: #6E3C0C;
  --a-q-line: #C9A77F;
  --a-violet-soft: #EFECF7;
  --a-violet-ink: #45377A;
  background: var(--a-bg);
  color: var(--a-ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  border-radius: 14px;
  padding: 24px;
  margin: 16px 0;
}
.answer-view { scroll-margin-top: 84px; }
.answer-view[hidden] { display: none; }
body.view-detailed .answer-view { display: none; }
body.view-simple.has-answer:not(.is-authenticated) #caseSummary { display: none; }

.answer-view h2, .answer-view h3, .answer-view h4, .answer-view p { margin: 0; }
.answer-view button { font-family: inherit; cursor: pointer; }
.answer-view button:focus-visible, .answer-view a:focus-visible { outline: 3px solid #8CC2AC; outline-offset: 2px; }
.answer-view a { color: var(--a-accent); }
.answer-view a:hover { color: var(--a-accent-ink); }
.answer-muted { color: var(--a-muted); font-size: 14px; }

.answer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 20px; }
.answer-title { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 30px; line-height: 1.15; flex: 1 1 240px; }
.answer-btn { padding: 10px 16px; border: 1px solid var(--a-line-2); border-radius: 8px; background: var(--a-surface); color: var(--a-ink); font-size: 15px; }
.answer-btn:hover { border-color: var(--a-accent); }

.answer-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.answer-remedies { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.answer-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.answer-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.answer-section-head h3 { font-size: 18px; }

.answer-card { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 12px; }
.answer-card.is-open { border-color: var(--a-accent); }
.answer-card-head { width: 100%; text-align: left; background: transparent; border: 0; padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; color: var(--a-ink); }
.answer-rank { width: 32px; height: 32px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 600; background: var(--a-neutral-soft); color: #3F4B45; }
.answer-rank.is-first { background: var(--a-accent); color: #FFFFFF; }
.answer-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.answer-card-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.answer-name { font-family: "Source Serif 4", Georgia, serif; font-size: 22px; font-weight: 600; line-height: 1.2; }
.answer-badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.answer-badge-strong { background: var(--a-accent-soft); color: var(--a-accent-ink); }
.answer-badge-rubric { background: var(--a-neutral-soft); color: #3F4B45; }
.answer-badge-witness { background: var(--a-violet-soft); color: var(--a-violet-ink); }
.answer-why { color: var(--a-ink-2); }
.answer-counts { color: var(--a-muted); font-size: 13px; }
.answer-chevron { color: var(--a-muted); font-size: 20px; line-height: 1; }

.answer-card-body { padding: 0 20px 20px 68px; display: flex; flex-direction: column; gap: 16px; }
.answer-kicker { margin-bottom: 8px !important; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--a-muted); }
.answer-quotes { display: flex; flex-direction: column; gap: 8px; }
.answer-quote { margin: 0; padding: 10px 14px; background: var(--a-bg); border-radius: 8px; }
.answer-quote p { margin-bottom: 4px; }
.answer-quote cite { font-style: normal; color: var(--a-muted); font-size: 13px; }
.answer-rubrics { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.answer-note { color: var(--a-ink-2); }
.answer-questions { background: var(--a-q-bg); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.answer-questions h4 { font-size: 15px; color: var(--a-q-ink); }
.answer-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.answer-question > span { flex: 1 1 240px; }
.answer-pill { padding: 8px 14px; min-height: 40px; border-radius: 8px; font-size: 14px; background: var(--a-surface); color: var(--a-ink); border: 1px solid var(--a-q-line); }
.answer-pill.is-yes { background: var(--a-accent); border-color: var(--a-accent); color: #FFFFFF; }
.answer-pill.is-no { background: var(--a-q-ink); border-color: var(--a-q-ink); color: #FFFFFF; }
.answer-link { font-weight: 500; }
.answer-disclaimer { margin-top: 8px !important; color: var(--a-muted); font-size: 13px; }

.answer-panel { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.answer-panel h3 { font-size: 17px; }
.answer-fragments { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.answer-fragments > li { border-top: 1px solid #EDF0EC; }
.answer-fragment { width: 100%; background: transparent; border: 0; padding: 10px 0; text-align: left; display: flex; flex-direction: column; gap: 2px; color: var(--a-ink); }
.answer-fragment:disabled { cursor: default; }
.answer-fragment-text { font-weight: 500; }
.answer-fragment-type { font-size: 12px; color: var(--a-accent-ink); }
.answer-fragment-type.is-mind { color: var(--a-violet-ink); }
.answer-fragment-type.is-modality { color: var(--a-q-ink); }
.answer-fragment-rubrics { margin: 0 0 12px; padding: 0 0 0 12px; list-style: none; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid #CFE2D8; font-size: 14px; }
.answer-fragment-rubrics span { display: block; color: var(--a-muted); font-size: 12px; }

/* Главный экран: примеры случаев */
.home-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 14px; color: #55625B; }
.home-examples button { padding: 6px 12px; border: 1px solid #CFE2D8; border-radius: 999px; background: #F3F8F5; color: #1F6B4F; font: inherit; font-size: 14px; cursor: pointer; min-height: 32px; }
.home-examples button:hover { background: #E4F0EA; }
.home-examples button:focus-visible { outline: 2px solid #1F6B4F; outline-offset: 2px; }

/* Экран ожидания */
.answer-wait { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.answer-wait .answer-top { margin-bottom: 0; }
.answer-wait-clock { font-variant-numeric: tabular-nums; color: var(--a-muted); font-size: 15px; }
.answer-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.answer-step { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 12px; }
.answer-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.answer-step-text b { font-weight: 600; }
.answer-step-text span { color: var(--a-muted); font-size: 14px; }
.answer-step-time { color: var(--a-muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.answer-step-mark { width: 22px; height: 22px; flex: none; margin-top: 1px; border-radius: 50%; border: 2px solid var(--a-line-2); box-sizing: border-box; }
.answer-step.is-done .answer-step-mark { background: var(--a-accent); border-color: var(--a-accent); position: relative; }
.answer-step.is-done .answer-step-mark::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.answer-step.is-run { border-color: var(--a-accent); }
.answer-step.is-run .answer-step-mark { border-color: var(--a-accent-soft); border-top-color: var(--a-accent); animation: answer-spin 0.9s linear infinite; }
.answer-step.is-todo .answer-step-text b { color: var(--a-muted); font-weight: 500; }
.answer-substeps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.answer-step-text .answer-substep { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--a-muted); }
.answer-substep > span:first-child { flex: 1; min-width: 0; position: relative; padding-left: 18px; }
.answer-substep > span:first-child::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--a-line-2); box-sizing: border-box; }
.answer-substep.is-done > span:first-child::before { background: var(--a-accent); border-color: var(--a-accent); }
.answer-substep.is-run > span:first-child { color: var(--a-ink); font-weight: 500; }
.answer-substep.is-run > span:first-child::before { border-color: var(--a-accent); background: var(--a-accent-soft); animation: answer-pulse 1.2s ease-in-out infinite; }
@keyframes answer-pulse { 50% { opacity: 0.35; } }
@keyframes answer-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .answer-step.is-run .answer-step-mark { animation: none; border-color: var(--a-accent); }
  .answer-substep.is-run > span:first-child::before { animation: none; }
}

@media (max-width: 640px) {
  .answer-view { padding: 16px; margin: 12px -4px; border-radius: 10px; }
  .answer-step { padding: 12px; gap: 12px; }
  .answer-title { font-size: 24px; }
  .answer-card-head { padding: 14px 14px; gap: 12px; }
  .answer-card-body { padding: 0 14px 16px; }
  .answer-name { font-size: 20px; }
}

/* 274: ответы на вопросы-уточнения */
.answer-refine { background: var(--a-q-bg); border: 1px solid var(--a-q-line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.answer-refine p { margin: 0; }
.answer-btn-primary { background: var(--a-accent); border-color: var(--a-accent); color: #FFFFFF; font-weight: 600; }
.answer-btn-primary:hover { background: var(--a-accent-ink); border-color: var(--a-accent-ink); }
.answer-tally { color: var(--a-q-ink); font-weight: 600; }
.answer-card.is-down { opacity: 0.72; }
