

:root {
  /* نموذج تلوين واحد فقط — مستوحى من Labebo */
  --ink: #1e2a1e;
  --muted: #5f6b5f;
  --line: #dce6d4;
  --paper: #fbfef8;
  --paper-deep: #f3f8ec;
  --leaf: #88C540;
  --leaf-dark: #5d9a2c;
  --leaf-deep: #236324;
  --leaf-soft: #eaf6dc;
  --ask-soft: #ddeff8;
  --ask-line: #c5dde9;
  --ask-ink: #1a4a5c;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(35, 99, 36, 0.08);
  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --reader-width: 38rem;
  /* Explain Visual — 3 دلالات ثابتة (مرحلة B) */
  --ev-concept: #236324;
  --ev-concept-bg: #e5f3d8;
  --ev-relation: #1f6f6a;
  --ev-relation-bg: #e4f3f1;
  --ev-caution: #9a6b16;
  --ev-caution-bg: #fbf1d8;
}

















/* لا تسمح لفقاعات الرسائل بالانكماش داخل flex — وإلا يُقصّ المحتوى وoverflow:hidden يمنع السكرول */
.messages > .msg {
  flex: 0 0 auto;
}

/* دخول نص خفيف جدًا: انزلاق + شفافية + ease-in */
@keyframes msgTextIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.messages .msg {
  animation: msgTextIn 0.58s ease-in both;
}

.messages .msg.bot .reader-head,
.messages .msg.bot .reader-greeting,
.messages .msg.bot .reader-body > *,
.messages .msg.bot .reader-body p,
.messages .msg.bot .reader-body h2,
.messages .msg.bot .reader-body h3,
.messages .msg.bot .reader-body h4,
.messages .msg.bot .reader-body li,
.messages .msg.bot .reader-body .ev-flow,
.messages .msg.bot .reader-body .ev-node,
.messages .msg.bot .reader-body .ev-arrow,
.messages .msg.bot .reader-body .station-block,
.messages .msg.bot .reader-body .visual-flow,
.messages .msg.bot .reader-foot,
.messages .msg.bot .greeting-line,
.messages .msg.bot strong,
.messages .msg.bot .ev-concept,
.messages .msg.bot .ev-relation,
.messages .msg.bot .ev-caution,
.messages .msg.system {
  animation: msgTextIn 0.62s ease-in both;
}

.messages .msg.bot .reader-body > *:nth-child(1) { animation-delay: 0.05s; }
.messages .msg.bot .reader-body > *:nth-child(2) { animation-delay: 0.1s; }
.messages .msg.bot .reader-body > *:nth-child(3) { animation-delay: 0.15s; }
.messages .msg.bot .reader-body > *:nth-child(4) { animation-delay: 0.2s; }
.messages .msg.bot .reader-body > *:nth-child(5) { animation-delay: 0.25s; }
.messages .msg.bot .reader-body > *:nth-child(6) { animation-delay: 0.3s; }
.messages .msg.bot .reader-body > *:nth-child(7) { animation-delay: 0.35s; }
.messages .msg.bot .reader-body > *:nth-child(8) { animation-delay: 0.4s; }
.messages .msg.bot .reader-body > *:nth-child(n+9) { animation-delay: 0.45s; }

.messages .msg.bot .ev-node:nth-child(1) { animation-delay: 0.12s; }
.messages .msg.bot .ev-node:nth-child(2) { animation-delay: 0.2s; }
.messages .msg.bot .ev-node:nth-child(3) { animation-delay: 0.28s; }
.messages .msg.bot .ev-arrow:nth-child(1) { animation-delay: 0.16s; }
.messages .msg.bot .ev-arrow:nth-child(2) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .messages .msg,
  .messages .msg.bot .reader-head,
  .messages .msg.bot .reader-greeting,
  .messages .msg.bot .reader-body > *,
  .messages .msg.bot .reader-body p,
  .messages .msg.bot .reader-body h2,
  .messages .msg.bot .reader-body h3,
  .messages .msg.bot .reader-body h4,
  .messages .msg.bot .reader-body li,
  .messages .msg.bot .reader-body .ev-flow,
  .messages .msg.bot .reader-body .ev-node,
  .messages .msg.bot .reader-body .ev-arrow,
  .messages .msg.bot .reader-body .station-block,
  .messages .msg.bot .reader-body .visual-flow,
  .messages .msg.bot .reader-foot,
  .messages .msg.bot .greeting-line,
  .messages .msg.bot strong,
  .messages .msg.bot .ev-concept,
  .messages .msg.bot .ev-relation,
  .messages .msg.bot .ev-caution,
  .messages .msg.system {
    animation: none !important;
  }}

/* —— فقاعات —— */
.msg {
  max-width: min(92%, var(--reader-width));
  border-radius: 16px;
  line-height: 1.75;
  direction: rtl;
  unicode-bidi: plaintext;
}
.msg.user {
  align-self: flex-start;
  background: var(--ask-soft);
  border: 1px solid var(--ask-line);
  color: var(--ask-ink);
  padding: 12px 14px;
}
.msg-edit {
  display: inline-block;
  margin-inline-start: 8px;
  border: 0;
  background: transparent;
  color: var(--leaf-deep, #167466);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.msg.system {
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: transparent;
  padding: 4px 8px;
}
.msg.bot {
  align-self: stretch;
  max-width: min(100%, var(--reader-width));
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0;
  /* يقتصّ أبناء الفقاعة (مثل reader-foot) على الزوايا الدائرية */
  overflow: hidden;
  border-radius: var(--radius, 16px);
  position: relative;
}
.msg.thinking {
  align-self: flex-start;
  background: var(--white);
  border: 1px dashed var(--leaf);
  padding: 12px 14px;
  color: var(--leaf-deep);
  font-weight: 700;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* —— Kindle-like reader —— */

/* علامة محطة مدمجة مع خط الفقرة (السكة داخل القسم) */
.reader-section {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  column-gap: 12px;
  align-items: stretch;
  position: relative;
  padding: 10px 8px;
  margin-bottom: 0.85rem;
  scroll-margin-top: 72px;
  border-radius: 12px;
  transition: background 0.25s ease;
}
.reader-section .section-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0;
  min-height: 100%;
  width: 1.55rem;
}
/* الخط الطولي يمتد على ارتفاع الفقرة ويمرّ بمركز العلامة (دمج بصري) */
.reader-section .section-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  transform: none;
  background: var(--leaf-deep);
  opacity: 0.55;
  border-radius: 2px;
  z-index: 0;
  pointer-events: none;
}
.reader-section .station-mark {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--leaf);
  color: #fff;
  /* نفس قصة المربع المقصوص — يغطي الخط فيمرّ منه فوق/تحت */
  border-radius: 0;
  clip-path: polygon(
    18% 0, 82% 0, 100% 18%, 100% 82%,
    82% 100%, 18% 100%, 0 82%, 0 18%
  );
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.reader-section .station-mark .station-num {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reader-section .station-mark:hover,
.reader-section .station-mark.active,
.reader-section .station-mark:focus-visible {
  filter: brightness(1.06);
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(136, 197, 64, 0.22);
  outline: none;
}
.reader-section .station-mark .station-tip {
  position: absolute;
  inset-inline-end: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(30, 42, 30, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.reader-section .station-mark:hover .station-tip {
  opacity: 1;
}

/* —— قائمة تنقّل عمودية بين المحطات —— */

.station-jump-menu {
  position: fixed;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 188px;
  max-width: min(290px, calc(100vw - 24px));
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 254, 248, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.station-jump-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.station-jump-menu.is-leaving {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
.station-jump-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.station-jump-item:hover,
.station-jump-item:focus-visible {
  background: var(--leaf-soft);
  border-color: rgba(136, 197, 64, 0.28);
  color: var(--leaf-deep);
  transform: translateX(-1px);
  outline: none;
  box-shadow: none;
}
.station-jump-item.is-current {
  background: var(--leaf-soft);
  border-color: rgba(136, 197, 64, 0.45);
  color: var(--leaf-deep);
  font-weight: 800;
  animation: none;
  z-index: 1;
  box-shadow: none;
}
.station-jump-item.is-current:hover,
.station-jump-item.is-current:focus-visible {
  background: #e0f2c8;
  color: var(--leaf-deep);
}
.station-jump-item .jump-num {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0;
  background: var(--leaf);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  clip-path: polygon(
    18% 0, 82% 0, 100% 18%, 100% 82%,
    82% 100%, 18% 100%, 0 82%, 0 18%
  );
}
.station-jump-item.is-current .jump-num {
  background: var(--leaf-dark);
  color: #fff;
  box-shadow: none;
}
.station-jump-item .jump-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.station-mark.is-menu-open .station-tip {
  opacity: 0 !important;
}
.station-mark.is-menu-open {
  filter: brightness(1.04);
  box-shadow: 0 0 0 3px rgba(136, 197, 64, 0.22);
}
@media (prefers-reduced-motion: reduce) {
  .station-jump-menu,
  .station-jump-menu.is-open,
  .station-jump-menu.is-leaving,
  .station-jump-item {
    transition: none !important;
  }
  .station-jump-item.is-current {
    animation: none !important;
    box-shadow: none;
  }}

.reader-section .station-end-arrow {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: 2px;
  color: var(--leaf-deep);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.75;
  /* السهم يجلس على نفس محور الخط */
  width: 1.55rem;
  text-align: center;
}
.reader-section .section-content {
  min-width: 0;
}
/* خلفية 10% عند المرور/التمييز المؤقت فقط — لا تعتمد على :active/:focus العالق */
.reader-section.is-hot,
.reader-section:has(.station-mark:hover) {
  background: rgba(136, 197, 64, 0.10);
  transition: background 0.2s ease;
}
.reader-section.is-hot-flash {
  animation: stationHotFlash 0.85s ease;
}

@media (prefers-reduced-motion: reduce) {
  .reader-section.is-hot-flash { animation: none; }}
.reader-section.is-active:not(.is-hot):not(:has(.station-mark:hover)) {
  background: transparent;
}

.reader-greeting {
  margin: 0;
  padding: 14px 16px 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  font-weight: 500;
  border-bottom: 1px dashed var(--line);
}

.reader-body {
  position: relative;
  padding: 20px 36px 12px 20px; /* نهاية أوسع لسكة المحطات فوق الغسلة */
  font-size: 1.08rem;
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: var(--ink);
  transition: background 0.6s ease;
}
/* غسلة انتباه خفيفة جدًا عند توقّف التمرير — خلف النص فقط، مرة/محطة */
.reader-section .section-content {
  position: relative;
}
.reader-section.is-washing .section-content::before {
  content: '';
  position: absolute;
  inset: -4px -8px;
  pointer-events: none;
  border-radius: 10px;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(107, 159, 60, 0.045) 38%,
    rgba(232, 245, 224, 0.42) 50%,
    rgba(107, 159, 60, 0.045) 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  background-position: 100% 0;
  animation: attention-wash-sweep 1.05s ease-out forwards;
  z-index: 0;
}
.reader-section.is-washing .section-content > * {
  position: relative;
  z-index: 1;
}
@keyframes attention-wash-sweep {
  0% { background-position: 100% 0; opacity: 0; }
  18% { opacity: 1; }
  100% { background-position: -100% 0; opacity: 0; }
}
.reader-body.attention-wash {
  background: transparent;
}
.reader-body p { margin: 0 0 1rem; max-width: 36em; }
.reader-section.is-active > .section-content > h3 {
  border-inline-start-color: var(--leaf-dark);
}
.reader-section + .reader-section {
  border-top: 1px dashed var(--line);
  padding-top: 1.1rem;
}
.reader-section .section-content > h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  line-height: 1.55rem; /* ارتفاع علامة المحطة — محاذاة رأسية */
  color: var(--leaf-deep);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  min-height: 1.55rem;
}

/* علامات تسلسل القراءة — ليست بطاقات لوحة معلومات */
.seq-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: transparent;
  border: 0;
  border-inline-start: 3px solid var(--ev-concept);
  border-radius: 0;
  padding: 6px 4px 6px 10px;
  margin: 0 0 0.55rem;
}
.seq-box.role-relation { border-inline-start-color: var(--ev-relation); }
.seq-box.role-caution { border-inline-start-color: var(--ev-caution); }
.seq-box .seq-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  margin-top: 0.12em; /* بمحاذاة سطر النص الأول */
  padding: 0 0.2rem;
  /* مربع مقصوص الحواف بدل الدائرة */
  border-radius: 0;
  clip-path: polygon(
    18% 0, 82% 0, 100% 18%, 100% 82%,
    82% 100%, 18% 100%, 0 82%, 0 18%
  );
  background: var(--leaf);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.seq-box.role-relation .seq-num { background: var(--ev-relation); color: #fff; }
.seq-box.role-caution .seq-num { background: var(--ev-caution); color: #fff; }
.seq-box .seq-text {
  flex: 1 1 auto;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.75;
}

/* شريط دلالي داخل المحطة — إطار واحد فقط */
.ev-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0 0 0.85rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  border-inline-start-width: 3px;
  font-size: 0.95rem;
  line-height: 1.7;
}
.ev-callout.role-concept {
  background: var(--ev-concept-bg);
  border-color: #cfe8b8;
  color: var(--ev-concept);
}
.ev-callout.role-relation {
  background: var(--ev-relation-bg);
  border-color: #c5ddd8;
  color: var(--ev-relation);
}
.ev-callout.role-caution {
  background: var(--ev-caution-bg);
  border-color: #edd9a4;
  color: var(--ev-caution);
}
.ev-callout-label {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.8;
  letter-spacing: 0.02em;
}
.ev-callout-title { font-weight: 800; }
.ev-callout-text { color: var(--ink); font-weight: 500; }

/* —— Explain Visual —— */
.ev-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0.35rem 0 1rem;
  padding: 10px 8px;
  background: transparent;
  border: 0;
  border-block: 1px dashed var(--line);
  border-radius: 0;
  animation: ev-in 0.45s ease both;
}
.ev-flow-inline, .ev-flow-in-station { margin-top: 0.75rem; }
.ev-flow-title {
  flex: 0 0 100%;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 2px;
}
.ev-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  border: 1px solid transparent;
  animation: ev-pop 0.4s ease both;
}
.ev-node.concept { background: var(--ev-concept-bg); color: var(--ev-concept); border-color: #cfe8b8; }
.ev-node.relation { background: var(--ev-relation-bg); color: var(--ev-relation); border-color: #c5ddd8; }
.ev-node.caution { background: var(--ev-caution-bg); color: var(--ev-caution); border-color: #edd9a4; }
.ev-arrow {
  color: var(--leaf-dark);
  font-weight: 800;
  opacity: 0.75;
  animation: ev-fade 0.5s ease both;
}
.ev-concept { color: var(--ev-concept); font-weight: 800; }
.ev-relation { color: var(--ev-relation); font-weight: 700; }
.ev-caution {
  display: inline;
  color: var(--ev-caution);
  background: var(--ev-caution-bg);
  border-radius: 6px;
  padding: 0 5px;
  font-weight: 700;
}
.ev-bold { font-weight: 800; color: var(--leaf-deep); }
.ev-italic { font-style: italic; color: var(--muted); }
.ev-strike { text-decoration: line-through; color: var(--muted); opacity: 0.85; }





.reader-foot {
  display: flex; justify-content: flex-start; align-items: center;
  gap: 8px; padding: 8px 14px 12px; border-top: 1px solid var(--line);
  background: var(--paper-deep);
  /* يطابق زوايا أسفل فقاعة الرسالة */
  border-bottom-left-radius: calc(var(--radius, 16px) - 1px);
  border-bottom-right-radius: calc(var(--radius, 16px) - 1px);
}
.reader-foot .support-report { margin: 0; margin-inline-start: auto; }

/* Info فقط */
.source-info { position: relative; display: inline-flex; }
.info-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); color: var(--leaf-deep); cursor: pointer;
  display: grid; place-items: center; font-weight: 800; font-style: italic;
}
.info-btn:hover,
.info-btn[aria-expanded="true"] { background: var(--leaf-soft); }
.info-tooltip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0;
  width: min(320px, 80vw); max-height: min(50vh, 360px); overflow: auto;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 10px; z-index: 6;
}
.source-info.open .info-tooltip { display: block; }
.tip-book {
  font-size: 0.72rem; font-weight: 700; color: var(--leaf-deep);
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line);
}
.tip-item + .tip-item { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.tip-item strong { display: block; color: var(--leaf-deep); font-size: 0.8rem; margin-bottom: 4px; }
.tip-item p { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }


@media (max-width: 860px) {
  .reader-body { font-size: 1rem; /* no white gutter for rail */ }
  .msg.bot { padding-inline-end: 0; }
  .reader-section.is-active {
    margin-inline: 0;
    background: transparent;
  }
  .reader-section.is-active.is-hot,
  .reader-section.is-active:has(.station-mark:hover) {
    background: rgba(136, 197, 64, 0.10);
  }
  /* station-rail removed — marks live in section */
  .reader-section .station-mark .station-tip { display: none; }}
.station-mark.active .station-tip { opacity: 0 !important; }
.station-mark:hover .station-tip,
.station-end:hover .station-tip { opacity: 1 !important; }
/* لا تفرض خلفية شفافة على is-active — تغسل is-hot / hover يجب أن تظهر */
.reader-section.is-active {
  margin-inline: 0 !important;
  box-shadow: none !important;
}
.msg.bot { padding-inline-end: 0 !important; }
/* السكة داخل القسم — لا حاجة لهامش نهاية واسع للسكة المطلقة القديمة */
.reader-body { padding-inline-end: 20px !important; }





/* Moderate answer indent: markers align with the welcome text,
   with one compact gutter before headings and point text. */
.msg.bot { --reader-text-inset: 32px; }
.reader-greeting { padding-inline: var(--reader-text-inset) 16px; }
.reader-body { padding-inline: var(--reader-text-inset) 16px !important; }
.reader-section { grid-template-columns: minmax(0, 1fr); column-gap: 0; padding-inline: 0; }
.reader-section .section-rail { position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; min-height: 0; }
.reader-section .section-content { grid-column: 1; min-width: 0; padding-inline-start: calc(1.55rem + 5px); }
.reader-body .seq-box { position: relative; display: block; border-inline-start: 0; padding-inline: 0; }
.reader-body .seq-box .seq-num { position: absolute; inset-inline-start: calc(-1.55rem - 5px); }
.reader-body .seq-box .seq-text { display: block; }

/* Inline illustrations keep controls and credits on the image itself. */
.answer-image{position:relative;margin:1.25rem 0 1.5rem;max-width:600px;min-width:0;isolation:isolate;break-inside:avoid;border:1px solid rgba(68,92,63,.12);border-radius:14px;background:#fff;overflow:hidden}
.answer-image-preview{display:block;width:100%;padding:0;border:0;border-radius:inherit;background:#fff;color:var(--ink,#304b36);cursor:pointer}
.answer-image-preview img{display:block;width:100%;height:auto;max-height:380px;object-fit:contain}
.answer-image-tools{position:absolute;inset-block-start:8px;inset-inline-end:8px;display:flex;gap:4px;z-index:2}
.answer-image-control{display:inline-flex;align-items:center;justify-content:center;flex:0 0 36px;width:36px;height:36px;padding:7px;border:1px solid rgba(68,92,63,.15);border-radius:50%;background:rgba(248,251,245,.96);color:#36542e;cursor:pointer;-webkit-tap-highlight-color:transparent;box-shadow:0 2px 8px #243b2010;text-decoration:none}
.answer-image-control svg{width:20px;height:20px;fill:currentColor;pointer-events:none}
.answer-image-control:hover{background:#eaf1e3}
.answer-image-tools .answer-image-expand{opacity:0;pointer-events:none;transition:opacity .15s}
.answer-image:hover .answer-image-tools .answer-image-control,.answer-image:focus-within .answer-image-tools .answer-image-control,.answer-image.details-pinned .answer-image-tools .answer-image-control{opacity:1;pointer-events:auto}
.answer-image-info{opacity:.8}
.answer-image figcaption{position:absolute;inset: auto 0 0;margin:0;padding:12px 14px;padding-inline-end:62px;background:rgba(247,250,243,.97);border-top:1px solid #dde5d5;text-align:start;line-height:1.5;max-height:52%;overflow:auto;opacity:0;visibility:hidden;transition:opacity .15s;z-index:1}
.answer-image:hover figcaption,.answer-image:focus-within figcaption,.answer-image.details-pinned figcaption{opacity:1;visibility:visible}
.answer-image-caption{display:block;font-size:13px;color:var(--ink,#304b36)}
.answer-image-credit{display:block;margin-top:4px;font-size:11px;color:#52634b;overflow-wrap:anywhere}
.answer-image-credit a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.answer-image :is(a,button):focus-visible{outline:2px solid #456a3a;outline-offset:-3px}
.answer-image-viewer{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:clamp(12px,3vw,40px);border:0;background:rgba(239,245,231,.98);color:#304b36;overflow:auto;z-index:10000}
.answer-image-viewer::backdrop{background:#14240fcc}
.answer-image-viewer[open]{display:grid;place-items:center}
.answer-image-viewer .answer-image{width:100%;height:100%;max-width:1500px;max-height:100%;margin:0;border-radius:18px}
.answer-image-viewer .answer-image-preview{height:100%}
.answer-image-viewer img{width:100%;height:100%;max-height:100%;object-fit:contain}
.answer-image-viewer .answer-image-tools .answer-image-expand{opacity:1;pointer-events:auto}
@media(hover:none),(pointer:coarse){.answer-image-tools .answer-image-control{opacity:1;pointer-events:auto}.answer-image-control{width:44px;height:44px;flex-basis:44px}.answer-image:not(.details-pinned) figcaption{opacity:0;visibility:hidden}.answer-image.details-pinned figcaption{opacity:1;visibility:visible}}
@media(max-width:600px){.answer-image{margin-block:1rem;max-width:100%}.answer-image-preview img{max-height:300px}.answer-image-viewer img{max-height:100%}}
@media(prefers-reduced-motion:reduce){.answer-image figcaption,.answer-image-control{transition:none}}
@media print{.answer-image{overflow:visible}.answer-image figcaption{position:static;opacity:1;visibility:visible;max-height:none}.answer-image-tools,.answer-image-viewer{display:none!important}}

.answer-image figcaption .answer-image-source{position:absolute;inset-inline-end:10px;inset-block-start:10px}
.answer-image.is-expanded .answer-image-preview{cursor:zoom-out}
@keyframes stationHotFlash {
  0% { background: transparent; }
  22% { background: rgba(136, 197, 64, 0.16); }
  44% { background: rgba(136, 197, 64, 0.06); }
  66% { background: rgba(136, 197, 64, 0.14); }
  100% { background: rgba(136, 197, 64, 0.10); }
}
@keyframes ev-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes ev-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes ev-fade {
  from { opacity: 0; }
  to { opacity: 0.75; }
}
