/* =========================================================================
   ЭндоЧат — тема "скетч" (тёплый кремовый фон, чёрная line-art графика,
   яркий розовый акцент — по референсу пользователя)

   Токены:
   bg-deep    #FAF3EA  фон приложения — тёплый кремовый
   bg-panel   #FFFCF8  поверхность карточек
   bg-raised  #F2E4D6  строки вариантов ответа / плитки
   line       чёрная тонкая линия малой прозрачности — "скетч"-обводка
   text       #201A1A  основной текст, почти чёрный
   muted      #8B7873  вторичный текст, тёплый серо-коричневый
   accent     #C9447A  яркий розовый — единственный насыщенный акцент
   warn       #C08A2E  предупреждения
   danger     #B33B3B  противоречия / неопределённость
   ========================================================================= */

:root {
  --bg-deep: #FAF3EA;
  --bg-panel: #FFFCF8;
  --bg-raised: #F2E4D6;
  --bg-raised-hover: #EAD8C6;
  --line: rgba(32, 26, 26, 0.15);
  --text: #201A1A;
  --muted: #8B7873;
  --accent: #C9447A;
  --accent-dim: rgba(201, 68, 122, 0.10);
  --accent-line: rgba(201, 68, 122, 0.35);
  --warn: #C08A2E;
  --warn-dim: rgba(192, 138, 46, 0.12);
  --danger: #B33B3B;
  --danger-dim: rgba(179, 59, 59, 0.10);
  --accent-amber: #C08A2E;
  --accent-amber-dim: rgba(192, 138, 46, 0.14);
  --accent-mint: #7A5FA0;
  --accent-mint-dim: rgba(122, 95, 160, 0.14);
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- Фоновая скетч-графика (декоративная, некликабельная) ---------- */

.bg-sketch {
  position: fixed;
  color: var(--text);
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

.bg-sketch-tooth {
  width: 260px;
  height: auto;
  right: -70px;
  bottom: -30px;
  transform-origin: 60% 40%;
  animation: bg-sketch-breathe 9s ease-in-out infinite;
}

@keyframes bg-sketch-breathe {
  0%, 100% { transform: rotate(8deg) scale(1); }
  50% { transform: rotate(5deg) scale(1.03); }
}

.bg-sketch-file {
  width: 46px;
  height: auto;
  left: -6px;
  top: 90px;
  transform-origin: 50% 50%;
  animation: bg-sketch-sway 7s ease-in-out infinite;
}

@keyframes bg-sketch-sway {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(-9deg); }
}

.topbar, .stage, .menu-overlay {
  position: relative;
  z-index: 1;
}

/* ---------- Верхняя панель ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}

.wordmark-block {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.wordmark-endo {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  transform: scaleY(1.22) scaleX(0.94);
  transform-origin: left center;
  opacity: 0;
  animation: wordmark-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.wordmark-sub {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  opacity: 0;
  animation: wordmark-sub-in 0.5s ease 0.4s forwards;
}

@keyframes wordmark-in {
  from { opacity: 0; transform: scaleY(1.22) scaleX(0.94) translateY(-6px); }
  to { opacity: 1; transform: scaleY(1.22) scaleX(0.94) translateY(0); }
}

@keyframes wordmark-sub-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

.topbar-counter {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.menu-toggle svg {
  width: 16px;
  height: 16px;
  stroke: var(--text);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.menu-toggle:active { background: var(--bg-raised); }

/* ---------- Выдвижное меню ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 11, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 40;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(84%, 320px);
  background: var(--bg-panel);
  border-left: 1px solid var(--line);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.menu-overlay.open .menu-drawer {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.menu-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.menu-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-close svg {
  width: 13px;
  height: 13px;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.menu-greeting {
  font-size: 13px;
  color: var(--muted);
  margin: -8px 0 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 6px;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  opacity: 0;
  transform: translateX(14px);
  transition: background 0.15s ease;
}

.menu-overlay.open .menu-item {
  animation: menu-item-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.menu-overlay.open .menu-item:nth-of-type(1) { animation-delay: 0.06s; }
.menu-overlay.open .menu-item:nth-of-type(2) { animation-delay: 0.11s; }
.menu-overlay.open .menu-item:nth-of-type(3) { animation-delay: 0.16s; }

@keyframes menu-item-in {
  to { opacity: 1; transform: translateX(0); }
}

.menu-item:last-of-type { border-bottom: 1px solid var(--line); }

.menu-item:active { background: var(--bg-raised); }

.menu-item-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item-icon svg {
  width: 17px;
  height: 17px;
  stroke: var(--accent);
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-item-icon-amber { background: var(--accent-amber-dim); }
.menu-item-icon-amber svg { stroke: var(--accent-amber); }

.menu-item-icon-mint { background: var(--accent-mint-dim); }
.menu-item-icon-mint svg { stroke: var(--accent-mint); }

.menu-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.menu-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.menu-item-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.menu-title-icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex: none;
}

.menu-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.menu-footer-icon {
  width: 12px;
  height: 16px;
  color: var(--accent);
}

.menu-bg-sketch {
  position: absolute;
  width: 260px;
  height: auto;
  right: -70px;
  bottom: -30px;
  color: var(--accent);
  opacity: 0.16;
  transform-origin: 60% 45%;
  animation: menu-sketch-breathe 6s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes menu-sketch-breathe {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  50% { transform: rotate(-2deg) scale(1.06); }
}

.stage {
  flex: 1;
  padding: 8px 20px 28px;
  display: flex;
  flex-direction: column;
}

.home-tiles {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.tile {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  opacity: 0;
  transform: translateY(8px);
  animation: tile-rise 0.5s ease forwards;
}

.tile:nth-of-type(1) { animation-delay: 0.25s; }
.tile:nth-of-type(2) { animation-delay: 0.34s; }

@keyframes tile-rise {
  to { opacity: 1; transform: translateY(0); }
}

.tile:hover {
  transform: translateY(-2px);
}

.tile:active {
  background: var(--bg-raised);
  border-color: var(--accent-line);
}

.tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-amber-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-amber);
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-icon-mint { background: var(--accent-mint-dim); }
.tile-icon-mint svg { stroke: var(--accent-mint); }

.tile-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ---------- Иллюстрация зуба / прогресс ---------- */

.tooth-progress {
  display: flex;
  justify-content: center;
  margin: 6px 0 22px;
}

/* ---------- Декоративные иллюстрации на главном экране ---------- */

.home-deco-float {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  animation: deco-float 5.5s ease-in-out infinite;
}

.home-deco-float-1 { top: 128px; right: 28px; animation-duration: 5.2s; }
.home-deco-float-2 { top: 28px; left: 92px; animation-duration: 6s; animation-delay: 0.25s; }
.home-deco-float-3 { bottom: 146px; right: 22px; animation-duration: 4.7s; animation-delay: 0.5s; }

@keyframes deco-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.home-deco {
  display: block;
  filter: drop-shadow(0 3px 6px rgba(32, 26, 26, 0.16));
  opacity: 0;
}

.home-deco-1 {
  width: 64px;
  animation: deco-pop-1 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s forwards;
}

.home-deco-2 {
  width: 56px;
  animation: deco-pop-2 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s forwards;
}

.home-deco-3 {
  width: 74px;
  animation: deco-pop-3 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s forwards;
}

@keyframes deco-pop-1 {
  from { opacity: 0; transform: scale(0.6) rotate(-6deg); }
  to { opacity: 0.96; transform: scale(1) rotate(12deg); }
}

@keyframes deco-pop-2 {
  from { opacity: 0; transform: scale(0.6) rotate(4deg); }
  to { opacity: 0.94; transform: scale(1) rotate(-11deg); }
}

@keyframes deco-pop-3 {
  from { opacity: 0; transform: scale(0.6) rotate(-4deg); }
  to { opacity: 0.97; transform: scale(1) rotate(9deg); }
}

.home-avatar-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 10px 0 20px;
}

.home-avatar-frame {
  position: relative;
  z-index: 1;
  width: 210px;
}

.home-avatar {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0;
}

.tooth-progress svg {
  width: 92px;
  height: 107px;
  overflow: visible;
}

.tooth-outline {
  fill: var(--bg-raised);
  stroke: var(--line);
  stroke-width: 1.6;
}

.tooth-bg {
  fill: var(--bg-raised);
  stroke: none;
}

.tooth-outline-neon {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(201, 68, 122, 0.55));
  animation: tooth-glow-pulse 3.2s ease-in-out infinite;
}

@keyframes tooth-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(201, 68, 122, 0.45)); }
  50% { filter: drop-shadow(0 0 7px rgba(201, 68, 122, 0.8)); }
}

.tooth-fill {
  transition: y 0.65s cubic-bezier(0.34, 1.1, 0.4, 1), height 0.65s cubic-bezier(0.34, 1.1, 0.4, 1);
}

.tooth-wave {
  fill: var(--accent);
  opacity: 0.85;
  transition: y 0.65s cubic-bezier(0.34, 1.1, 0.4, 1);
  animation: tooth-wave-bob 2.2s ease-in-out infinite;
}

@keyframes tooth-wave-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.4px); }
}

/* ---------- Экран завершения осмотра ---------- */

.completion-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62vh;
  text-align: center;
}

.completion-tooth svg {
  width: 150px;
  height: auto;
  animation: completion-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes completion-pop {
  0% { transform: scale(0.82); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.completion-text {
  margin-top: 20px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  animation: completion-text-in 0.5s ease 0.35s forwards;
}

@keyframes completion-text-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Общие блоки экрана ---------- */

.screen {
  animation: rise 0.38s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 14px;
  cursor: pointer;
}

.back-link:active { color: var(--accent); }

h1.q-text {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 25px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0 0 22px;
  max-width: 340px;
}

.helper-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.flourish {
  display: block;
  width: 56px;
  height: 10px;
  color: var(--accent);
  margin: -8px 0 18px;
}

.flourish path {
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  animation: flourish-draw 0.9s ease 0.15s forwards;
}

@keyframes flourish-draw {
  to { stroke-dashoffset: 0; }
}

.signature {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--accent);
  margin: -12px 0 22px;
}

/* ---------- Варианты ответов ---------- */

.options {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 4px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.option-row:active,
.option-row.flash {
  background: var(--accent-dim);
}

.option-row:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.option-row:disabled:active {
  background: transparent;
}

.option-row .check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.6px solid var(--line);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option-row.checked .check {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.option-row .check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.option-row.checked .check svg { opacity: 1; }

.option-row .label { flex: 1; }

/* ---------- Нижняя закреплённая панель (кнопки) ---------- */

.bottom-bar {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding: 16px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--text);
  color: var(--bg-panel);
}

.btn-primary:hover { background: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Поле ввода метки пациента ---------- */

.text-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  margin-bottom: 6px;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-line);
}

.field-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ---------- Отзыв: звёзды и текстовое поле ---------- */

.star-row {
  display: flex;
  gap: 8px;
  margin: 4px 0 18px;
}

.star-btn {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--line);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.star-btn:active { transform: scale(0.92); }

.star-btn.filled {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.feedback-textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 6px;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent-line);
}

/* ---------- Результат ---------- */

.result-header {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.005em;
  margin: 4px 0 18px;
}

.report-block {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.report-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.report-value {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.report-value.dim { color: var(--muted); font-weight: 500; }

.findings-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.findings-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--text);
  padding: 6px 0;
}

.findings-list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.panel {
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.55;
  border-left: 3px solid var(--warn);
  background: var(--warn-dim);
}

.panel.danger {
  border-left-color: var(--danger);
  background: var(--danger-dim);
}

.panel-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.disclaimer {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin-top: 20px;
  font-style: italic;
}

/* ---------- История ---------- */

.history-item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.history-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.history-label {
  font-size: 15.5px;
  font-weight: 700;
  margin: 4px 0 8px;
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 100px;
  background: var(--bg-raised);
  color: var(--muted);
  border: 1px solid var(--line);
}

.chip.chip-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-line);
}

.chip.chip-warn {
  background: var(--warn-dim);
  color: var(--warn);
  border-color: rgba(255, 180, 84, 0.35);
}

.info-block {
  border-top: 1px solid var(--line);
  padding: 15px 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
}

.info-block:first-of-type { border-top: none; }

.info-block strong { color: var(--text); }

/* ---------- МКБ-10 ---------- */

.icd-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.icd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.icd-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.icd-code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.icd-label {
  font-size: 12.5px;
  color: var(--muted);
}

.btn-icd-confirm {
  flex: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
}

.btn-icd-confirm:active { opacity: 0.7; }

.icd-confirmed {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

.icd-note {
  color: var(--muted);
  font-size: 11.5px;
  font-style: italic;
  margin: 8px 0 0;
}

/* ---------- Шкала интенсивности боли ---------- */

.scale-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 4px 0 10px;
}

.scale-btn {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.scale-btn:active,
.scale-btn.flash {
  background: var(--accent-dim);
  border-color: var(--accent-line);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 6px;
}

/* ---------- Таблица «характер и корреляция боли» ---------- */

.pain-profile-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 14px;
  margin-top: 4px;
}

.pain-profile-grid span:nth-child(odd) {
  font-size: 13px;
  color: var(--muted);
}

.pain-profile-grid span:nth-child(even) {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.empty-state {
  color: var(--muted);
  font-size: 14.5px;
  padding: 30px 0;
  text-align: center;
}
