/* Public viewer for AI Cross-Check / debate share links (#1784 U2) — loaded by the worker's /c/:id shell. */
:root {
  --bg: #f6f6f8; --card: #ffffff; --subtle: #f4f4f6; --line: #e5e7eb; --line-strong: #d1d5db;
  --fg: #1e1b4b; --fg2: #5b6472; --fg3: #9ca3af; --accent: #4f46e5; --accent-fg: #ffffff; --accent-soft: #eef2ff;
  --code-bg: #f3f4f6; --danger: #b91c1c; --focus: #f59e0b; --focus-soft: #fff7e6;
  --me-bg: #4f46e5; --me-fg: #ffffff;
  --room-bg: #b2c7d9; --room-fg: #2b3a48; --bubble-bg: #ffffff; --bubble-fg: #1a1a1a; --room-me-bg: #fee500; --room-me-fg: #1a1a1a;
  --notice-bg: #d6e0ea; --notice-fg: #1a1a1a;
  --promo-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #c026d3 100%); --promo-fg: #ffffff;
  --p-claude: #d97757; --p-chatgpt: #10a37f; --p-gemini: #4285f4;
  /* Service marks + debate avatars — the extension's compare.css tokens (--debate-ava-*, --debate-logo-*). */
  --ava-claude: #fbe9e1; --ava-chatgpt: #dcf5ec; --ava-gemini: #e3ecfd; --logo-bg: #ffffff; --logo-fg: #1a1a1a;
  /* Attachment kinds (viewer.js attachRow) — the colours people know each format by. */
  --att-image: #7c3aed; --att-pdf: #dc2626; --att-docx: #2563eb; --att-sheet: #15803d; --att-slides: #c2410c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --card: #1a1f2e; --subtle: #222937; --line: #2d3748; --line-strong: #3b4557;
    --fg: #f0f0f0; --fg2: #a0aec0; --fg3: #718096; --accent: #818cf8; --accent-fg: #0f1419; --accent-soft: #1e1b4b;
    --code-bg: #222937; --danger: #f87171; --focus: #fbbf24; --focus-soft: #2a2415;
    --me-bg: #4338ca; --me-fg: #ffffff;
    --room-bg: #19202b; --room-fg: #b9c4d2; --bubble-bg: #232b38; --bubble-fg: #eef1f5; --room-me-bg: #fee500; --room-me-fg: #1a1a1a;
    --notice-bg: #2a3444; --notice-fg: #e4e9f0;
    --promo-bg: linear-gradient(135deg, #3730a3 0%, #5b21b6 55%, #86198f 100%); --promo-fg: #ffffff;
    --ava-claude: #3a2a24; --ava-chatgpt: #1e3a31; --ava-gemini: #22304a; --logo-bg: #f4f6f8; --logo-fg: #1a1a1a;
    --att-image: #a78bfa; --att-pdf: #f87171; --att-docx: #60a5fa; --att-sheet: #4ade80; --att-slides: #fb923c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
/* The shell sets viewport-fit=cover: keep text clear of a notch / rounded corners in landscape. */
#cs-root { max-width: 1120px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

/* top bar — logo (→ home #debate) + copy/share */
.cs-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 22px; }
.cs-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 750; font-size: 16px; letter-spacing: -.01em; border-radius: 10px; padding: 4px 6px 4px 2px; }
.cs-logo img { width: 28px; height: 28px; border-radius: 8px; }
.cs-logo:hover span { color: var(--accent); }
.cs-top-btn, .cs-top-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.cs-top-btn:hover, .cs-top-link:hover { color: var(--fg); border-color: var(--accent); }
.cs-top-btn svg, .cs-top-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cs-top-actions { display: flex; align-items: center; gap: 8px; }
.cs-top-link { border-color: transparent; background: transparent; text-decoration: none; }
.cs-top-link svg { stroke-width: 2; }
.cs-logo, .cs-top-btn, .cs-top-link { white-space: nowrap; }
/* The copy split button (viewer.js copyMenu): 「전체 복사」 + ▾, one pill split in two; the menu drops below. */
.cs-split { position: relative; display: inline-flex; }
.cs-split-main { border-radius: 999px 0 0 999px; padding-right: 12px; }
.cs-split-more { border-radius: 0 999px 999px 0; margin-left: -1px; padding: 0 12px 0 10px; }
.cs-split-more:hover, .cs-split-main:hover { position: relative; z-index: 1; }
.cs-split-more[aria-expanded="true"] { color: var(--fg); border-color: var(--accent); position: relative; z-index: 1; }
.cs-chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.cs-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 236px; padding: 6px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
.cs-menu[hidden] { display: none; }
.cs-menu-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); font: inherit; font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap; }
.cs-menu-item:hover, .cs-menu-item:focus-visible { background: var(--subtle); outline: none; }
.cs-menu-item > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--fg2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-menu-item > .cs-pmark { width: 20px; height: 20px; }
/* A short status line (viewer.js toast) — above the fixed continue bar. */
.cs-toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); text-align: center; }
/* A phone: the dashboard link keeps its icon only (aria-label names it) so the bar stays on one line. */
@media (max-width: 480px) { .cs-top-link span { display: none; } .cs-top-link { padding: 0 11px; } .cs-split-main { padding: 0 10px 0 12px; } .cs-split-more { padding: 0 10px 0 8px; } }

/* header — the page heading, the topic, then the folded settings */
.cs-head { max-width: 820px; margin: 0 0 22px; }
.cs-head.is-debate { margin-inline: auto; }
.cs-heading { font-size: 14px; font-weight: 750; color: var(--accent); margin: 0 0 10px; letter-spacing: .01em; }
.cs-topic { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.cs-topic-label { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--fg3); letter-spacing: .04em; margin-bottom: 4px; }
.cs-title { font-size: 21px; font-weight: 700; line-height: 1.4; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.cs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--fg3); font-size: 13px; margin: 10px 2px 12px; }
.cs-by { display: inline-flex; align-items: center; gap: 6px; color: var(--fg2); }

/* settings — a <details> whose summary already shows who took part */
.cs-opts { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.cs-opts[open] { border-color: var(--line-strong); }
.cs-opts-sum { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; border-radius: 14px; min-height: 48px; }
.cs-opts-sum::-webkit-details-marker { display: none; }
.cs-opts-sum:hover { background: var(--subtle); }
.cs-opts-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cs-opts-stack { display: inline-flex; flex: none; }
.cs-opts-stack > * { box-shadow: 0 0 0 2px var(--card); }
.cs-opts-stack > * + * { margin-left: -8px; }
.cs-opts-stack .cs-dava { width: 28px; height: 28px; font-size: 15px; border-radius: 50%; }
/* Overlapping avatars: the service badge would sit on the next avatar — the list below shows it. */
.cs-opts-stack .cs-dava-badge { display: none; }
.cs-opts-stack .cs-pmark { width: 28px; height: 28px; }
.cs-opts-sum-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; }
.cs-opts-sum-names { color: var(--fg2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-opts-chev { flex: none; width: 9px; height: 9px; border-right: 2px solid var(--fg3); border-bottom: 2px solid var(--fg3); margin: 0 4px 4px; transform: rotate(45deg); transition: transform .15s; }
.cs-opts[open] .cs-opts-chev { transform: rotate(-135deg); margin: 4px 4px 0; }
.cs-opts-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.cs-opts-label { margin: 12px 0 8px; font-size: 12px; font-weight: 700; color: var(--fg3); }
.cs-opts-ais { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cs-opts-ai { display: flex; align-items: center; gap: 10px; }
.cs-opts-ai .cs-dava { width: 32px; height: 32px; font-size: 17px; }
.cs-opts-ai .cs-dava-badge { box-shadow: 0 0 0 2px var(--card); }
.cs-opts-ai .cs-pmark { width: 28px; height: 28px; }
.cs-opts-ai-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.cs-opts-ai-model { color: var(--fg2); font-size: 13px; }
.cs-opts-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.cs-opts-facts dt { color: var(--fg3); font-weight: 600; }
.cs-opts-facts dd { margin: 0; color: var(--fg); }

/* provider marks + avatars */
/* A service mark on a light disc (viewer.js brandGlyph): the mark in its brand colour, ChatGPT's in ink
   (the extension's badge rule); `is-word` = the letter tile of a service without a usable mark. */
.cs-pmark, .cs-dava-badge, .cs-dava-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--logo-bg); color: var(--logo-fg); font-weight: 800; letter-spacing: -.03em; }
.cs-pmark { width: 22px; height: 22px; box-shadow: inset 0 0 0 1px var(--line); font-size: 8px; }
.cs-pmark svg { width: 13px; height: 13px; }
[data-provider="claude"] > svg { fill: var(--p-claude); } [data-provider="gemini"] > svg { fill: var(--p-gemini); } [data-provider="chatgpt"] > svg { fill: var(--logo-fg); }
.cs-pmark.is-word, .cs-dava-badge.is-word, .cs-dava-mark.is-word { box-shadow: inset 0 0 0 1.5px var(--p-chatgpt); }
/* Debate speaker (the extension's .cmp-debate-ava): emoji on the service tint + the mark as a corner badge. */
.cs-dava { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 35%; background: var(--subtle); font-size: 19px; line-height: 1; }
.cs-dava[data-provider="claude"] { background: var(--ava-claude); } .cs-dava[data-provider="chatgpt"] { background: var(--ava-chatgpt); } .cs-dava[data-provider="gemini"] { background: var(--ava-gemini); }
.cs-dava-badge { position: absolute; right: -4px; bottom: -4px; width: 17px; height: 17px; font-size: 5.5px; box-shadow: 0 0 0 2px var(--room-bg); }
.cs-dava-badge.is-word { box-shadow: inset 0 0 0 1.5px var(--p-chatgpt), 0 0 0 2px var(--room-bg); }
.cs-dava-badge svg { width: 11px; height: 11px; }
.cs-dava-mark { width: 24px; height: 24px; font-size: 8px; }
.cs-dava-mark svg { width: 15px; height: 15px; }
.cs-ava { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--subtle); border: 1px solid var(--line); object-fit: cover; }
.cs-ava-person { position: relative; overflow: hidden; }
.cs-ava-person::before { content: ''; position: absolute; left: 50%; top: 7px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--fg3); }
.cs-ava-person::after { content: ''; position: absolute; left: 50%; top: 20px; width: 20px; height: 14px; margin-left: -10px; border-radius: 10px 10px 0 0; background: var(--fg3); }
.cs-by .cs-ava { width: 22px; height: 22px; }
.cs-by .cs-ava-person::before { top: 5px; width: 8px; height: 8px; margin-left: -4px; }
.cs-by .cs-ava-person::after { top: 15px; width: 14px; height: 10px; margin-left: -7px; }

/* compare */
.cs-round { margin: 0 0 28px; scroll-margin-top: 16px; }
.cs-round-label { font-size: 12px; font-weight: 700; color: var(--fg3); letter-spacing: .02em; margin-bottom: 10px; }
.cs-round.is-summary .cs-round-label { color: var(--accent); }
.cs-q { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.cs-q-body { min-width: 0; max-width: 760px; }
.cs-q-who, .cs-msg-who { font-size: 12.5px; color: var(--fg2); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cs-bubble { border-radius: 14px; padding: 10px 14px; overflow-wrap: anywhere; }
.cs-bubble-me { background: var(--me-bg); color: var(--me-fg); white-space: pre-wrap; }
.cs-answers { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(280px, 1fr)); gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
/* Model tabs over a sideways-scrolling answer row (viewer.js answerTabs) — hidden while all answers fit. */
.cs-tabs { position: relative; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 8px; padding: 2px 0; }
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-tabs[hidden] { display: none; }
.cs-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cs-tab[aria-pressed="true"] { border-color: var(--accent); color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent); }
.cs-ans { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; scroll-snap-align: start; }
.cs-ans.is-error { background: var(--subtle); }
.cs-ans-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; margin-bottom: 8px; }
/* An answer's copy button (viewer.js copyButton): at the far end of its header, shown on hover or
   keyboard focus — always on a touch screen, which has no hover. */
.cs-copy { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; min-width: 28px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; color: var(--fg3); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; opacity: 0; transition: opacity .12s; }
.cs-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-copy:hover { color: var(--fg); background: var(--subtle); }
.cs-ans:hover .cs-copy, .cs-msg:hover .cs-copy, .cs-copy:focus-visible, .cs-copy.is-done { opacity: 1; }
.cs-copy.is-done { color: var(--accent); }
.cs-ans-head .cs-copy { margin-left: auto; }
.cs-ans-head .cs-took + .cs-copy { margin-left: 0; }
.cs-msg-who .cs-copy { height: 22px; color: var(--room-fg); }
.cs-msg-who .cs-copy:hover { background: rgba(0, 0, 0, .06); }
@media (hover: none) { .cs-copy { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cs-copy { transition: none; } }
/* How long the answer took — pushed to the head's far end, quiet next to the model name. */
.cs-took { margin-left: auto; flex: none; font-size: 12px; font-weight: 500; color: var(--fg2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-msg-who .cs-took { margin-left: 0; color: var(--room-fg); opacity: .75; }
.cs-note { font-size: 12.5px; color: var(--fg2); margin: 6px 0 0; font-style: italic; }
.cs-note-error { color: var(--danger); font-style: normal; }
/* A question's attachments (viewer.js attachRow): a chip per file kind, coloured by kind. */
.cs-att { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12.5px; color: var(--fg2); }
.cs-msg.is-me .cs-att { justify-content: flex-end; color: var(--room-fg); }
.cs-att-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--att-c, var(--fg2)); font-weight: 650; white-space: nowrap; }
.cs-att-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-att-n { color: var(--fg2); font-weight: 500; }
.cs-att-note { font-style: italic; }
.cs-att-chip[data-kind="image"] { --att-c: var(--att-image); }
.cs-att-chip[data-kind="pdf"] { --att-c: var(--att-pdf); }
.cs-att-chip[data-kind="docx"] { --att-c: var(--att-docx); }
.cs-att-chip[data-kind="xlsx"], .cs-att-chip[data-kind="csv"] { --att-c: var(--att-sheet); }
.cs-att-chip[data-kind="pptx"] { --att-c: var(--att-slides); }
@media (max-width: 720px) {
  /* One answer per swipe, each only as tall as its own text (a short answer next to a long one
     would otherwise stretch into a screen of blank card). */
  .cs-answers { grid-template-columns: repeat(var(--cols), 88%); align-items: start; scroll-snap-type: x mandatory; }
  .cs-md pre { font-size: 13px; }
  .cs-md pre, .cs-md .md-table-wrap { overscroll-behavior-x: contain; }
}

/* markdown (ported from the compare page's .cmp-turn-assistant rules) */
.cs-md { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.cs-md p { margin: 0 0 10px; }
.cs-md > :last-child { margin-bottom: 0; }
.cs-md h1, .cs-md h2, .cs-md h3, .cs-md h4, .cs-md h5, .cs-md h6 { margin: 16px 0 6px; line-height: 1.3; font-weight: 650; }
.cs-md > :first-child { margin-top: 0; }
.cs-md h1 { font-size: 17px; } .cs-md h2 { font-size: 16px; } .cs-md h3 { font-size: 15px; } .cs-md h4, .cs-md h5, .cs-md h6 { font-size: 14px; }
.cs-md ul, .cs-md ol { margin: 0 0 10px 22px; padding: 0; }
.cs-md li { margin: 3px 0; }
.cs-md li > ul, .cs-md li > ol { margin: 3px 0 0 16px; }
.cs-md pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
.cs-md code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--code-bg); border-radius: 4px; padding: 1px 5px; }
.cs-md pre code { background: none; padding: 0; font-size: inherit; }
.cs-md .md-directive { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 10px; }
.cs-md .md-directive-head { font-size: 12px; color: var(--fg2); margin: 0 0 6px; }
.cs-md .md-directive-body > :last-child { margin-bottom: 0; }
.cs-md blockquote { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px; color: var(--fg2); margin: 0 0 10px; }
.cs-md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.cs-md del { color: var(--fg2); }
.cs-md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cs-md .md-table-wrap { overflow-x: auto; margin: 0 0 10px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.cs-md table { border-collapse: collapse; font-size: 13px; line-height: 1.45; min-width: 100%; }
.cs-md th, .cs-md td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.cs-md td { min-width: 5.5em; }
.cs-md th + th, .cs-md td + td { border-left: 1px solid var(--line); }
.cs-md tr:last-child td { border-bottom: 0; }
.cs-md th { background: var(--subtle); font-weight: 600; white-space: nowrap; }
.cs-md th[data-align="center"], .cs-md td[data-align="center"] { text-align: center; }
.cs-md th[data-align="right"], .cs-md td[data-align="right"] { text-align: right; }

/* debate room */
.cs-room { background: var(--room-bg); border-radius: 16px; padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; max-width: 820px; margin: 0 auto 28px; }
.cs-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; scroll-margin-top: 16px; }
@media (max-width: 720px) {
  .cs-msg > .cs-dava { width: 30px; height: 30px; font-size: 16px; }
  .cs-msg > .cs-dava .cs-dava-badge { width: 15px; height: 15px; right: -3px; bottom: -3px; }
  .cs-msg > .cs-dava .cs-dava-badge svg { width: 10px; height: 10px; }
}
.cs-msg-body { min-width: 0; }
.cs-msg-who { color: var(--room-fg); }
.cs-msg-model { color: var(--room-fg); opacity: .75; font-size: 12px; }
.cs-tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 6px; background: var(--notice-bg); color: var(--notice-fg); }
.cs-msg .cs-bubble { background: var(--bubble-bg); color: var(--bubble-fg); box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.cs-msg.is-mod .cs-bubble { background: var(--notice-bg); color: var(--notice-fg); box-shadow: none; font-size: 14px; }
.cs-msg.is-me { align-self: flex-end; }
.cs-msg.is-me .cs-msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.cs-msg.is-me .cs-bubble { background: var(--room-me-bg); color: var(--room-me-fg); white-space: pre-wrap; }

/* focus — the bubble the share was made from */
.is-focus { position: relative; }
/* A card inside the horizontally scrolling row would have an outline clipped by the row, so cards
   use their own border; free-standing bubbles use an outline. */
.cs-ans.is-focus { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); background: var(--card); }
.cs-q.is-focus, .cs-msg.is-focus { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 14px; animation: cs-focus-in 1.6s ease-out 1; }
.cs-q.is-focus, .cs-msg.is-focus { flex-wrap: wrap; }
/* The note takes the first line; the avatar and the body must still share the second (a body sized
   to its text would wrap under the avatar — name and bubble dropped below a lone avatar). */
.cs-q.is-focus > .cs-q-body, .cs-msg.is-focus > .cs-msg-body { flex: 1 1 0; }
.cs-q.is-focus .cs-bubble, .cs-msg.is-focus .cs-bubble { width: fit-content; max-width: 100%; }
.cs-focus-note { flex-basis: 100%; font-size: 12px; font-weight: 650; color: var(--fg); background: var(--focus-soft); border: 1px solid var(--focus); border-radius: 8px; padding: 3px 8px; margin-bottom: 8px; width: fit-content; }
@keyframes cs-focus-in { 0% { outline-color: transparent; } 20% { outline-color: var(--focus); box-shadow: 0 0 0 8px color-mix(in srgb, var(--focus) 25%, transparent); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .is-focus { animation: none !important; } }

/* promo card — the end of a public share, in the flow (never fixed) */
.cs-promo { max-width: 820px; margin: 8px auto 20px; padding: 26px 24px 24px; background: radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .09) 0 130px, transparent 131px), var(--promo-bg); color: var(--promo-fg); border-radius: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; box-shadow: 0 10px 30px -12px rgba(79, 70, 229, .55); }
.cs-promo p { margin: 0; overflow-wrap: anywhere; word-break: keep-all; }
.cs-promo-marks { display: inline-flex; margin-bottom: 4px; }
.cs-promo-marks .cs-promo-mark { width: 38px; height: 38px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.cs-promo-marks .cs-promo-mark svg { width: 22px; height: 22px; }
.cs-promo-marks .cs-promo-mark + .cs-promo-mark { margin-left: -8px; }
.cs-promo-kicker { font-size: 14px; font-weight: 650; opacity: .85; }
.cs-promo-title { font-size: 22px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.cs-promo-desc { font-size: 14.5px; line-height: 1.55; opacity: .88; max-width: 520px; }
.cs-promo-exs { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cs-promo-ex { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); }
.cs-promo .cs-promo-cta { margin-top: 8px; max-width: 100%; height: auto; min-height: 46px; padding: 10px 26px; white-space: normal; text-align: center; font-size: 15.5px; border-radius: 12px; background: #ffffff; border-color: #ffffff; color: #3730a3; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); transition: transform .12s; }
.cs-promo .cs-promo-cta:hover { transform: translateY(-1px); }
.cs-promo-pc { font-size: 12.5px; opacity: .75; }
@media (max-width: 720px) {
  .cs-promo { padding: 22px 16px 20px; }
  .cs-promo-title { font-size: 19px; }
  .cs-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .cs-promo-cta, .cs-opts-chev { transition: none; } }

/* share bar — 「이 대화 공유하기」 under the conversation (viewer.js shareBar) */
.cs-share { max-width: 820px; margin: 8px auto 20px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.cs-share-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--fg2); }
.cs-share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cs-share-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg); font: inherit; font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap; }
.cs-share-btn:hover { border-color: var(--accent); }
.cs-share-btn svg { width: 15px; height: 15px; flex: none; }
.cs-share-copy svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* A phone: the five social buttons are icons (aria-label names them) so they and the copy fit one row. */
@media (max-width: 480px) { .cs-share-btn:not(.cs-share-copy) span { display: none; } .cs-share-btn:not(.cs-share-copy) { width: 44px; padding: 0; justify-content: center; } .cs-share-row { gap: 6px; } }

/* footer + continue bar */
.cs-foot { text-align: center; color: var(--fg3); font-size: 12.5px; padding: 12px 0 24px; }
.cs-foot a { color: var(--fg2); }
.cs-ask-wrap { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: linear-gradient(to top, var(--bg) 70%, transparent); display: flex; justify-content: center; }
.cs-ask { width: 100%; max-width: 760px; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg2); border-radius: 16px; padding: 12px 12px 12px 18px; font: inherit; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); }
.cs-ask:hover { border-color: var(--accent); }
.cs-ask-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-ask-go { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.cs-ask.is-installed { color: var(--fg); font-weight: 600; }

/* buttons + modal + empty */
.cs-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.cs-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.cs-btn-ghost { background: transparent; }
.cs-modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.cs-modal { background: var(--card); color: var(--fg); border-radius: 16px; padding: 24px; max-width: 420px; width: 100%; }
.cs-modal h2 { font-size: 18px; margin: 0 0 8px; }
.cs-modal p { color: var(--fg2); margin: 0 0 18px; font-size: 14px; }
.cs-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-empty { text-align: center; padding: 80px 16px; color: var(--fg2); }
.cs-empty p { font-size: 17px; margin-bottom: 20px; }
/* Password-protected share (U5): the form in place of the conversation. */
.cs-lock { max-width: 420px; margin: 64px auto; padding: 24px; display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.cs-lock-title { margin: 0; font-size: 18px; }
.cs-lock-body { margin: 0; color: var(--fg2); font-size: 14px; }
.cs-lock-row { display: flex; gap: 8px; }
.cs-lock-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; font-size: 15px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--subtle); color: var(--fg); }
/* Touch screens: 44px targets (Apple HIG / WCAG 2.5.5) for the controls a visitor must hit. */
@media (pointer: coarse), (max-width: 720px) {
  .cs-btn, .cs-lock-input { min-height: 44px; }
  .cs-tab { min-height: 44px; }
  .cs-top-btn, .cs-top-link { min-height: 44px; }
  .cs-share-btn, .cs-menu-item { min-height: 44px; }
  .cs-copy { min-height: 32px; min-width: 32px; }
}
.cs-lock-note { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--danger); }
