/* =========================================================================
   GENERERT av scripts/landing-shots.mjs --chat-replay (2026-09-08).
   Ekte CSS for chat-panelet, hentet fra assets/css/styles.css, slik at
   avspillingen på /omvisning ser nøyaktig ut som chatten i appen.
   Ikke rediger for hånd: kjør skriptet på nytt når appen endres.
   ========================================================================= */
.chat-replay {
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text-secondary: #5f6d7e;
    --color-primary-bg: #e0f2f1;
    --color-primary-dark: #004d40;
    --color-primary: #26a69a;
    --color-primary-light: #4db6ac;
}
.health-chat-drawer-panel { position: relative; width: min(480px, 100%); height: 100dvh; max-height: 100dvh; min-height: 0px; background: var(--color-surface, #ffffff); display: flex; flex-direction: column; box-shadow: rgba(0, 0, 0, 0.18) -8px 0px 32px; animation: 300ms cubic-bezier(0.16, 1, 0.3, 1) 0s 1 normal none running healthChatSlideIn; padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
.health-chat-header { display: flex; align-items: center; gap: 8px; padding: max(14px, env(safe-area-inset-top, 0px)) 16px 14px; border-bottom: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff); flex-shrink: 0; }
.health-chat-title { flex: 1 1 0%; margin: 0px; font-size: 1rem; font-weight: 600; color: var(--color-text-primary, #111827); text-align: center; }
.health-chat-iconbtn { width: 40px; height: 40px; min-width: 40px; border-radius: 10px; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; background: transparent; color: var(--color-text-secondary, #6b7280); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 150ms, color 150ms; }
.health-chat-iconbtn:hover { background: var(--color-primary-bg, #e0f2f1); color: var(--color-primary-dark, #004d40); }
.health-chat-iconbtn:focus-visible { outline: 2px solid var(--color-primary, #26a69a); outline-offset: 2px; }
.health-chat-quota-bar { padding: 10px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff); flex-shrink: 0; }
.health-chat-quota-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--color-primary-bg, #e0f2f1); color: var(--color-primary-dark, #004d40); font-size: 0.75rem; font-weight: 600; }
.health-chat-quota-pill.is-empty { background: rgb(254, 242, 242); color: rgb(153, 27, 27); }
.health-chat-quota-info { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--color-primary-light, #4db6ac); background: transparent; color: var(--color-primary-dark, #004d40); font-size: 0.75rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; line-height: 1; transition: background 150ms, transform 100ms; flex-shrink: 0; }
.health-chat-quota-info:hover { background: var(--color-primary-bg, #e0f2f1); }
.health-chat-quota-info:active { transform: scale(0.92); }
.health-chat-quota-progress { flex: 1 1 0%; height: 4px; background: rgb(229, 231, 235); border-radius: 999px; overflow: hidden; }
.health-chat-quota-progress span { display: block; height: 100%; background: var(--color-primary, #26a69a); transition: width 200ms ease-out; }
.health-chat-disclaimer { padding: 8px 16px; background: rgb(255, 251, 235); color: rgb(146, 64, 14); font-size: 0.7rem; text-align: center; border-bottom: 1px solid rgb(254, 243, 199); line-height: 1.4; flex-shrink: 0; }
.health-chat-pane { flex: 1 1 0%; min-height: 0px; overflow-y: auto; position: relative; overscroll-behavior: contain; }
.health-chat-pane.hidden { display: none; }
.health-chat-pane-chat { display: flex; flex-direction: column; min-height: 0px; }
.health-chat-messages { flex: 1 1 0%; min-height: 0px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.health-chat-msg { display: flex; flex-direction: column; max-width: 92%; animation: 200ms ease-out 0s 1 normal none running healthChatMsgIn; }
.health-chat-msg-user { align-self: flex-end; align-items: flex-end; }
.health-chat-msg-assistant { align-self: flex-start; align-items: flex-start; max-width: 96%; }
.health-chat-bubble { padding: 12px 16px; border-radius: 18px; font-size: 0.92rem; line-height: 1.6; overflow-wrap: anywhere; }
.health-chat-msg-user .health-chat-bubble { background: var(--color-primary, #26a69a); color: rgb(255, 255, 255); border-bottom-right-radius: 4px; }
.health-chat-msg-assistant .health-chat-bubble { background: var(--color-primary-bg, #e0f2f1); color: var(--color-text-primary, #111827); border-bottom-left-radius: 4px; }
.health-chat-bubble p { margin: 0px 0px 10px; }
.health-chat-bubble p:last-child { margin-bottom: 0px; }
.health-chat-bubble ul, .health-chat-bubble ol { margin: 10px 0px; padding-left: 22px; }
.health-chat-bubble li { margin-bottom: 6px; }
.health-chat-bubble li:last-child { margin-bottom: 0px; }
.health-chat-bubble li > ul, .health-chat-bubble li > ol { margin: 6px 0px; }
.health-chat-bubble strong { font-weight: 700; }
.health-chat-bubble em { font-style: italic; }
.health-chat-bubble s { text-decoration: line-through; opacity: 0.7; }
.health-chat-bubble h3 { margin: 16px 0px 8px; font-size: 1.02rem; font-weight: 700; line-height: 1.35; color: var(--color-primary-dark, #004d40); }
.health-chat-bubble h4 { margin: 14px 0px 6px; font-size: 0.96rem; font-weight: 700; line-height: 1.4; color: var(--color-text-primary, #111827); }
.health-chat-bubble h3:first-child, .health-chat-bubble h4:first-child { margin-top: 0px; }
.health-chat-bubble hr { border-width: 1px 0px 0px; border-style: solid none none; border-color: rgba(0, 0, 0, 0.08) currentcolor currentcolor; border-image: none; margin: 14px 0px; }
.health-chat-msg-user .health-chat-bubble hr { border-top-color: rgba(255, 255, 255, 0.25); }
.health-chat-bubble code { background: rgba(0, 0, 0, 0.08); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
.health-chat-msg-user .health-chat-bubble code { background: rgba(255, 255, 255, 0.2); }
.health-chat-bubble blockquote { border-left: 3px solid var(--color-primary, #26a69a); padding: 4px 0px 4px 12px; margin: 10px 0px; color: var(--color-text-secondary, #6b7280); font-style: italic; background: rgba(38, 166, 154, 0.05); border-radius: 0px 6px 6px 0px; }
.health-chat-bubble a { color: var(--color-primary-dark, #004d40); text-decoration: underline; }
.health-chat-msg-user .health-chat-bubble a { color: rgb(255, 255, 255); text-decoration: underline; }
.health-chat-bubble .health-chat-table-wrap { margin: 12px 0px; width: 100%; overflow: visible; }
.health-chat-bubble .health-chat-table { width: 100%; max-width: 100%; border-collapse: separate; border-spacing: 0px; font-size: 0.85rem; line-height: 1.45; table-layout: auto; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 10px; overflow: hidden; }
.health-chat-bubble .health-chat-table th, .health-chat-bubble .health-chat-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, 0.06); vertical-align: top; white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.health-chat-bubble .health-chat-table th { background: var(--color-primary-bg, #e0f2f1); color: var(--color-primary-dark, #004d40); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.health-chat-bubble .health-chat-table td { color: var(--color-text-primary, #111827); }
.health-chat-bubble .health-chat-table th.num, .health-chat-bubble .health-chat-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
.health-chat-bubble .health-chat-table tbody tr:nth-child(2n) td { background: rgba(38, 166, 154, 0.04); }
.health-chat-bubble .health-chat-table tbody tr:hover td { background: rgba(38, 166, 154, 0.09); }
.health-chat-bubble .health-chat-table tbody tr:last-child td { border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; }
@media (max-width: 599px) { .health-chat-bubble .health-chat-table { font-size: 0.8rem; } }
@media (max-width: 599px) { .health-chat-bubble .health-chat-table th, .health-chat-bubble .health-chat-table td { padding: 7px 8px; } }
@media (max-width: 599px) { .health-chat-bubble .health-chat-table th { font-size: 0.68rem; letter-spacing: 0.3px; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table-wrap { background: transparent; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table { display: block; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; border-radius: 0px; background: transparent; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table thead { display: none; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table tbody { display: block; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table tr { display: block; background: var(--color-surface, #fff); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table tr:last-child { margin-bottom: 0px; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table tbody tr:nth-child(2n) td, .health-chat-bubble .health-chat-table tbody tr:hover td { background: transparent; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); text-align: left; white-space: normal; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table td:last-child { border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table td::before { content: attr(data-label); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--color-text-secondary, #6b7280); font-weight: 600; flex-shrink: 0; min-width: 70px; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table td[data-label=""]::before, .health-chat-bubble .health-chat-table td[data-label="&nbsp;"]::before { content: ""; min-width: 0px; } }
@media (max-width: 480px) { .health-chat-bubble .health-chat-table td.num { text-align: right; font-variant-numeric: tabular-nums; } }
.health-chat-msg-user .health-chat-bubble .health-chat-table { border-color: rgba(255, 255, 255, 0.15); }
.health-chat-msg-user .health-chat-bubble .health-chat-table th { background: rgba(255, 255, 255, 0.18); color: rgb(255, 255, 255); }
.health-chat-msg-user .health-chat-bubble .health-chat-table td { color: rgb(255, 255, 255); }
.health-chat-msg[data-msg-state="sending"] .health-chat-bubble { opacity: 0.7; }
.health-chat-msg[data-msg-state="error"] .health-chat-bubble { background: rgb(254, 242, 242); color: rgb(153, 27, 27); }
.health-chat-msg[data-msg-state="cancelled"] .health-chat-bubble { background: rgb(243, 244, 246); color: rgb(107, 114, 128); font-style: italic; }
.health-chat-typing { display: inline-flex; align-items: center; gap: 10px; }
.health-chat-typing-status { font-size: 0.88rem; color: var(--color-primary-dark, #004d40); font-weight: 500; transition: opacity 0.25s; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0px; }
.health-chat-typing-status.is-fading { opacity: 0; }
@media (max-width: 380px) { .health-chat-typing-status { white-space: normal; overflow: visible; text-overflow: clip; } }
@media (prefers-reduced-motion: reduce) { .health-chat-typing-status { transition: none; } }
.health-chat-typing-dots { display: inline-flex; align-items: center; gap: 5px; }
.health-chat-typing-dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary-dark, #004d40); opacity: 0.3; animation: 1.4s ease-in-out 0s infinite normal none running healthChatTypingPulse; }
.health-chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.health-chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
.health-chat-msg-streaming .health-chat-bubble { line-height: 1.55; }
.health-chat-stream-text { text-wrap: pretty; overflow-wrap: break-word; }
.health-chat-stream-cursor { display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: text-bottom; background: var(--color-primary-dark, #004d40); border-radius: 1px; animation: 1.05s steps(2) 0s infinite normal none running healthChatStreamCursor; pointer-events: none; transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .health-chat-stream-cursor { animation: auto ease 0s 1 normal none running none; opacity: 0.6; } }
.health-chat-msg-streaming { position: relative; }
.health-chat-msg[data-msg-state="replaced"] .health-chat-bubble { position: relative; }
.health-chat-followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 4px 0px 8px; }
.health-chat-followup-chip { padding: 8px 14px; border-radius: 999px; background: var(--color-surface, #fff); border: 1px solid var(--color-primary, #26a69a); color: var(--color-primary-dark, #004d40); font-size: 0.82rem; cursor: pointer; font-weight: 500; line-height: 1.3; text-align: left; transition: background 150ms, transform 100ms; min-height: 36px; }
.health-chat-followup-chip:hover { background: var(--color-primary-bg, #e0f2f1); }
.health-chat-followup-chip:active { transform: scale(0.98); }
.health-chat-followup-chip { background: rgba(38, 166, 154, 0.04); border-color: var(--color-primary-light, #4db6ac); }
.health-chat-input-bar { padding: 20px 22px calc(25px + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff); flex-shrink: 0; }
.health-chat-input-bar.hidden { display: none; }
.health-chat-input-bar form { display: flex; align-items: flex-end; gap: 8px; }
.health-chat-input { flex: 1 1 0%; min-height: 44px; max-height: 200px; padding: 11px 14px; border: 1px solid var(--color-border, #e5e7eb); border-radius: 22px; font-family: inherit; font-size: 16px; line-height: 1.4; resize: none; outline: none; background: var(--color-surface, #fff); color: var(--color-text-primary, #111827); transition: border-color 150ms; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.18) transparent; }
.health-chat-input::-webkit-scrollbar { width: 6px; }
.health-chat-input::-webkit-scrollbar-track { background: transparent; }
.health-chat-input::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 3px; }
.health-chat-input::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.32); }
.health-chat-input:focus { border-color: var(--color-primary, #26a69a); }
.health-chat-input:disabled { background: rgb(243, 244, 246); color: rgb(107, 114, 128); cursor: not-allowed; }
.health-chat-input::placeholder { text-wrap: pretty; opacity: 0.85; }
.health-chat-input.is-quota-empty { min-height: 72px; field-sizing: content; }
.health-chat-send { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; background: var(--color-primary, #26a69a); color: rgb(255, 255, 255); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 150ms, transform 100ms; flex-shrink: 0; }
svg.health-chat-send-icon { margin-left: -2px; }
.health-chat-send:hover { background: var(--color-primary-dark, #004d40); }
.health-chat-send:active { transform: scale(0.94); }
.health-chat-send:disabled { background: rgb(203, 213, 225); cursor: not-allowed; }
.health-chat-send.is-stop { background: rgb(239, 68, 68); }
.health-chat-send.is-stop:hover { background: rgb(220, 38, 38); }
.visually-hidden { width: 1px; height: 1px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border: 0px; position: absolute !important; }
@media (max-width: 768px) { .health-chat-drawer-panel { width: 100%; height: 100dvh; max-height: 100dvh; box-shadow: none; } }
@media (max-width: 768px) { .health-chat-msg-user, .health-chat-msg-assistant { max-width: 92%; } }
@media (max-width: 480px) { .health-chat-header { padding: max(12px, env(safe-area-inset-top, 0px)) 12px 12px; } }
@media (max-width: 480px) { .health-chat-title { font-size: 0.95rem; } }
@media (max-width: 480px) { .health-chat-messages { padding: 12px; } }
@media (max-width: 480px) { .health-chat-bubble { font-size: 0.9rem; padding: 9px 12px; } }
@media (max-width: 480px) { .health-chat-input-bar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); } }
@media (max-width: 360px) { .health-chat-iconbtn { width: 36px; height: 36px; min-width: 36px; } }
@media (max-width: 360px) { .health-chat-title { font-size: 0.9rem; } }
@media (max-width: 360px) { .health-chat-quota-pill { font-size: 0.7rem; padding: 3px 8px; } }
@media (prefers-reduced-motion: reduce) { .health-chat-drawer-panel, .health-chat-msg { animation: auto ease 0s 1 normal none running none !important; transition: none !important; } }
@media (prefers-reduced-motion: reduce) { .health-chat-messages { scroll-behavior: auto; } }
@keyframes healthChatSlideIn { 
  0% { transform: translateX(100%); }
  100% { transform: translateX(0px); }
}
@keyframes healthChatMsgIn { 
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0px); }
}
@keyframes healthChatTypingPulse { 
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}
@keyframes healthChatStreamCursor { 
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* --- Ramme for avspillingen (fast del, skrives av skriptet) --- */
.chat-replay { position: relative; height: 100%; min-height: 0; }
.chat-replay .hidden { display: none !important; }
/* landing.css nullstiller lister; appen bruker nettleserens standard kulepunkter */
.chat-replay .health-chat-bubble ul { list-style: disc; }
.chat-replay .health-chat-bubble ol { list-style: decimal; }
.chat-replay .health-chat-drawer-panel { position: relative; width: 100%; height: 100%; max-height: none; animation: none; box-shadow: none; padding-bottom: 0; pointer-events: none; user-select: none; -webkit-user-select: none; }
.chat-replay .health-chat-pane-chat { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.chat-replay .health-chat-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; scroll-behavior: smooth; }
.chat-replay .health-chat-messages::-webkit-scrollbar { display: none; }
/* Kort tråd sitter over feltet, som i en ekte chat, i stedet for øverst med tom flate under. */
.chat-replay .health-chat-messages::before { content: ''; flex: 1 0 0; min-height: 0; }
.chat-replay .health-chat-input { resize: none; overflow: hidden; }
.chat-replay .health-chat-msg { animation: healthChatMsgIn 260ms ease-out both; }
.chat-replay .health-chat-msg[data-replay="history"] { animation: none; }
.chat-replay .health-chat-caret { display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: currentColor; animation: chatReplayCaret 1s steps(1) infinite; }
@keyframes chatReplayCaret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.chat-replay.is-resetting [data-replay="live"],
.chat-replay.is-resetting .health-chat-followups { transition: opacity 0.35s ease; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .chat-replay .health-chat-msg, .chat-replay .health-chat-caret { animation: none; }
}
