/* Muse preview — three layouts, one functional chat engine.
 * V1: light, DeepSeek-like centered landing
 * V2: split studio, dark composer on warm paper
 * V3: dark focus, gold accent
 */
:root {
  --bg: #f7f8fa;
  --ink: #15161a;
  --muted: #747781;
  --faint: #a3a6ae;
  --card: #ffffff;
  --soft: #f2f4f8;
  --line: #e5e6ea;
  --line-strong: #d7d9df;
  --accent: #4d6bfe;
  --accent-deep: #3151e8;
  --accent-soft: #eef2ff;
  --gold: #c9a35c;
  --danger: #b75a4b;
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body.pv {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.pv.pv-v1 { background: #fbfbfc; }
body.pv.pv-v2 { background: #e9e5dc; }
body.pv.pv-v3 { --bg:#08080d; --ink:#f3f0e8; --muted:#948d7f; --faint:#686359; --card:#101015; --soft:#181820; --line:#2a2932; --line-strong:#3a3842; --accent:#e6bd66; --accent-deep:#d4af37; --accent-soft:#241e10; color-scheme: dark; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* top bar */
.pv-top {
  width: min(1240px, 100%);
  min-height: 76px; margin: 0 auto; padding: 0 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.pv-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.pv-logo { width: 34px; height: 34px; display: inline-flex; color: var(--ink); flex: 0 0 34px; }
.pv-logo svg { width: 100%; height: 100%; display: block; }
.pv-brandtext { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.pv-brandtext b { font-size: 15px; letter-spacing: .25px; font-weight: 750; }
.pv-brandtext small { font-size: 9.5px; color: var(--muted); margin-top: 4px; letter-spacing: .45px; white-space: nowrap; }
.pv-top-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.pv-top-link { color: var(--muted); text-decoration: none; font-size: 12px; white-space: nowrap; }
.pv-top-link:hover { color: var(--ink); }
.pv-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.pv-switch a { color: var(--muted); text-decoration: none; font-size: 9.5px; font-weight: 700; padding: 4px 6px; border-radius: 6px; letter-spacing: .4px; }
.pv-switch a.active { background: var(--ink); color: var(--bg); }
.pv-lang { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 9px; min-height: 32px; padding: 0 9px; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.pv-lang i { font-style: normal; color: var(--muted); font-size: 11px; }
.pv-lang:hover { border-color: var(--line-strong); }
.fn-wrap { position: relative; flex: 0 0 auto; }
.fn-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 9px; min-height: 32px; padding: 0 9px; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.fn-btn:hover { border-color: var(--line-strong); }
.fn-ico { color: var(--accent); font-size: 13px; line-height: 1; }
.fn-caret { color: var(--muted); font-size: 10px; margin-left: 1px; }
.fn-menu {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 200;
  width: 318px; max-height: min(88vh, 820px); overflow-y: auto;
  padding: 7px; background: var(--card); border: 1px solid var(--line);
  border-radius: 15px; box-shadow: 0 24px 70px rgba(20,24,40,.2), 0 4px 12px rgba(20,24,40,.08);
  text-align: left; scrollbar-width: thin;
}
.fn-menu[hidden] { display: none !important; }
.fn-menu-head { padding: 9px 9px 8px; border-bottom: 1px solid var(--line); }
.fn-menu-head b { display: block; color: var(--ink); font-size: 12px; line-height: 1.3; }
.fn-menu-head small { display: block; color: var(--muted); font-size: 9.5px; line-height: 1.4; margin-top: 3px; }
.fn-group { border-bottom: 1px solid var(--line); }
.fn-group:last-child { border-bottom: 0; }
.fn-group summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 8px 9px; color: var(--muted); font-size: 10px; letter-spacing: .35px;
  display: flex; align-items: center; justify-content: space-between;
}
.fn-group summary::-webkit-details-marker { display: none; }
.fn-group summary::after { content: '＋'; color: var(--muted); font-size: 12px; }
.fn-group[open] summary::after { content: '−'; }
.fn-group summary:hover { color: var(--ink); }
.fn-body { padding: 0 3px 5px; }
.fn-item {
  appearance: none; border: 0; background: transparent; color: var(--ink);
  width: 100%; min-height: 31px; border-radius: 8px; padding: 5px 9px;
  display: flex; align-items: center; gap: 8px; font-size: 11.5px; line-height: 1.35;
  text-align: left; cursor: pointer;
}
.fn-item:hover { background: var(--soft); }
.fn-item .fn-item-ico { width: 16px; flex: 0 0 16px; text-align: center; color: var(--muted); font-size: 12px; }
.fn-item .fn-item-label { flex: 1 1 auto; min-width: 0; }
.fn-item small { color: var(--faint); font-size: 9px; white-space: nowrap; }
.fn-item.active { background: var(--accent-soft); color: var(--accent-deep); }
.fn-item.active .fn-item-ico { color: var(--accent); }
.fn-item.active small { color: var(--accent-deep); }
.fn-item.danger { color: var(--muted); }
.fn-help {
  padding: 8px 9px 9px; color: var(--muted); font-size: 9.5px; line-height: 1.55;
  border-top: 1px solid var(--line);
}
.fn-help b { color: var(--ink); }
.fn-help-overlay {
  position: fixed; inset: 0; z-index: 500; background: rgba(18,20,28,.38);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.fn-help-card {
  width: min(430px, 100%); max-height: 80vh; overflow-y: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px; box-shadow: 0 24px 70px rgba(20,24,40,.25);
}
.fn-help-title { font-size: 15px; font-weight: 700; margin-bottom: 9px; }
.fn-help-text { color: var(--muted); font-size: 12px; line-height: 1.7; }
.fn-help-text p { margin: 0 0 8px; }
.fn-help-text b { color: var(--ink); }
.fn-help-close {
  margin-top: 13px; border: 1px solid var(--line); background: var(--soft);
  color: var(--ink); border-radius: 8px; min-height: 33px; padding: 0 13px;
  font-size: 11px; cursor: pointer;
}
.fn-help-close:hover { border-color: var(--line-strong); }
.pv-v3 .fn-help-card { background: #111116; border-color: #2a2932; }
.pv-v3 .fn-help-text { color: #a49c8d; }
.pv-v3 .fn-help-text b { color: #f3f0e8; }
.pv-v3 .fn-help-close { background: #1a1a22; color: #f3f0e8; border-color: #2e2d37; }
@media (max-width: 680px) {
  .fn-menu { position: fixed; left: 12px; right: 12px; top: calc(58px + env(safe-area-inset-top)); width: auto; max-height: min(80vh, 700px); border-radius: 14px; }
  .fn-btn { min-height: 30px; padding: 0 7px; font-size: 10px; }
  .fn-caret { display: none; }
  .fn-item { min-height: 36px; font-size: 12px; }
  .fn-menu-head { padding-top: 7px; }
}
.pv-preview-tag { font-size: 8px; font-weight: 800; letter-spacing: 1.2px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; }
.pv-v3 .pv-logo { color: #f3f0e8; }
.pv-v3 .pv-switch a.active { background: #e6bd66; color: #161208; }

/* page */
.pv-main { width: min(1240px, 100%); margin: 0 auto; padding: 0 30px 44px; }
.hero { min-height: calc(100vh - 155px); min-height: calc(100dvh - 155px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 28px 0 12px; }
.hero-copy { width: 100%; max-width: 1000px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 10.5px; line-height: 1.2; box-shadow: 0 3px 12px rgba(20,22,30,.035); }
.eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 0 3px rgba(76,195,138,.12); }
.hero h1 { margin: 25px 0 17px; color: var(--ink); font-size: clamp(42px, 6.3vw, 78px); line-height: 1.03; letter-spacing: -.052em; font-weight: 620; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero h1 .thin { color: var(--muted); font-weight: 430; }
.hero-sub { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.75; letter-spacing: -.005em; text-wrap: pretty; }
.hero-panel { width: min(860px, 100%); margin-top: 26px; }
.composer-card {
  width: 100%; margin: 0; padding: 17px 17px 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(20,24,40,.08), 0 3px 10px rgba(20,24,40,.035);
  text-align: left;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.composer-card:focus-within { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); box-shadow: 0 26px 74px rgba(20,24,40,.11), 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.composer-card textarea {
  display: block; width: 100%; min-height: 58px; max-height: 170px;
  margin: 0; padding: 2px 4px 7px;
  border: 0; outline: 0; resize: none; background: transparent;
  color: var(--ink); font: inherit; font-size: 15.5px; line-height: 1.65;
  overflow-y: auto;
}
.composer-card textarea::placeholder { color: var(--faint); }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.composer-toggles { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.toggle {
  appearance: none; border: 1px solid var(--line); background: transparent;
  color: var(--muted); border-radius: 999px; min-height: 30px; padding: 0 9px;
  font-size: 10.5px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.toggle.active { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); background: var(--accent-soft); color: var(--accent-deep); }
.toggle-ico { font-size: 12px; line-height: 1; }
.send {
  width: 42px; height: 42px; flex: 0 0 42px; padding: 0;
  border: 0; border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 21px; line-height: 1; cursor: pointer;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 26%, transparent);
  transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.send:hover { background: var(--accent-deep); transform: translateY(-1px); }
.send:active { transform: scale(.96); }
.send:disabled { opacity: .52; cursor: default; transform: none; box-shadow: none; }
.hero-chips { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,.56);
  color: var(--muted); border-radius: 999px; min-height: 30px; padding: 0 11px;
  font-size: 10.5px; line-height: 1; cursor: pointer;
  transition: color .17s ease, border-color .17s ease, background .17s ease;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); background: var(--card); }
.hero-note { margin: 9px 0 0; color: #858992; font-size: 10px; line-height: 1.5; text-align: center; }
.hero-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 17px; margin-top: 21px; }
.hero-link { appearance: none; border: 0; background: none; padding: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.hero-link b { font-weight: 500; font-size: 12px; color: var(--faint); transition: color .16s ease, transform .16s ease; }
.hero-link:hover { color: var(--ink); }
.hero-link:hover b { color: var(--accent); transform: translate(1px,-1px); }

/* chat */
.chat { display: block; padding: 14px 0 16px; }
.chat-shell { width: min(980px, 100%); margin: 0 auto; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0 14px; border-bottom: 1px solid var(--line); }
.chat-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chat-mark { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 800; }
.chat-identity b { display: block; font-size: 13px; line-height: 1.2; }
.chat-identity small { display: block; color: var(--muted); font-size: 9.5px; margin-top: 3px; }
.chat-head-actions { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.chat-act { appearance: none; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 8px; min-height: 30px; padding: 0 7px; font-size: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chat-act:hover { color: var(--ink); background: var(--soft); }
.chat-status { display: flex; align-items: center; gap: 6px; padding: 10px 1px 0; color: var(--faint); font-size: 10px; }
.status-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 0 3px rgba(76,195,138,.11); }
.chat-list { display: flex; flex-direction: column; gap: 15px; min-height: 260px; padding: 22px 0 23px; }
.msg { display: flex; width: 100%; }
.msg.user { justify-content: flex-end; }
.msg .bubble { position: relative; max-width: 88%; padding: 11px 15px; border-radius: 17px; font-size: 13.5px; line-height: 1.72; overflow-wrap: anywhere; }
.msg.user .bubble { max-width: 78%; background: var(--accent-soft); color: var(--accent-deep); border-bottom-right-radius: 5px; }
.msg.assistant .bubble { max-width: 100%; width: 100%; padding: 1px 0 0; color: var(--ink); }
.msg.assistant .bubble p { margin: 0 0 9px; }
.msg.assistant .bubble p:last-child { margin-bottom: 0; }
.msg.assistant .bubble h3, .msg.assistant .bubble h4 { margin: 16px 0 7px; font-size: 14px; color: var(--ink); line-height: 1.45; }
.msg.assistant .bubble h3:first-child, .msg.assistant .bubble h4:first-child { margin-top: 0; }
.msg.assistant .bubble strong { font-weight: 700; color: var(--ink); }
.msg.assistant .bubble ul, .msg.assistant .bubble ol { margin: 7px 0; padding-left: 20px; }
.msg.assistant .bubble li { margin: 3px 0; }
.msg.assistant .bubble code { font-family: var(--mono); font-size: 11.5px; background: var(--soft); border-radius: 4px; padding: 1px 4px; }
.msg.assistant .bubble blockquote { margin: 9px 0; padding: 7px 11px; border-left: 2px solid var(--accent); background: var(--soft); border-radius: 0 6px 6px 0; color: var(--muted); }
.msg.assistant .bubble table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 10px 0; font-size: 11.5px; border: 1px solid var(--line); border-radius: 8px; }
.msg.assistant .bubble th, .msg.assistant .bubble td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.msg.assistant .bubble th { background: var(--soft); font-weight: 700; }
.msg.assistant .bubble tr:last-child td { border-bottom: 0; }
.msg.assistant .bubble a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
.copy-btn { position: absolute; top: -2px; right: 0; border: 0; background: transparent; color: var(--faint); font-size: 12px; cursor: pointer; opacity: 0; border-radius: 4px; padding: 2px 4px; }
.msg.assistant:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--ink); }
.sources { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.sources summary { color: var(--muted); font-size: 10.5px; cursor: pointer; user-select: none; }
.sources summary:hover { color: var(--ink); }
.sources-list { display: flex; flex-direction: column; gap: 4px; margin: 7px 0 0; padding: 0; list-style: none; }
.sources-list li { color: var(--muted); font-size: 10px; line-height: 1.5; }
.sources-list a { color: var(--muted); text-decoration: none; }
.sources-list a:hover { color: var(--accent-deep); text-decoration: underline; }
.thinking .bubble { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dots span { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin-left: 2px; animation: dot 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .17s; }.dots span:nth-child(3) { animation-delay: .34s; }
@keyframes dot { 0%,70%,100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.error .bubble { color: var(--danger); font-size: 12px; }
.chat-composer { margin-top: 0; }
.chat-composer .composer-card { padding: 11px 12px 8px; border-radius: 17px; box-shadow: 0 12px 34px rgba(20,24,40,.07); }
.chat-composer textarea { min-height: 24px; max-height: 130px; font-size: 14px; padding: 4px 4px 3px; }
.chat-composer .composer-bottom { min-height: 38px; }
.chat-composer .send { width: 36px; height: 36px; flex-basis: 36px; font-size: 18px; }
.chat-note { color: var(--faint); font-size: 9.5px; line-height: 1.5; text-align: center; margin-top: 7px; }

/* footer / toast */
.pv-footer { width: min(1240px, 100%); margin: 0 auto; padding: 0 30px 24px; color: #858992; font-size: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pv-foot-right { display: inline-flex; gap: 6px; align-items: center; }
.pv-footer a { color: var(--faint); text-decoration: none; }
.pv-footer a:hover { color: var(--ink); }
.foot-sep { opacity: .5; }
.pv-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translateX(-50%) translateY(6px); padding: 8px 13px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; white-space: nowrap; }
.pv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* V2: editorial split */
.pv-v2 .pv-top { min-height: 72px; }
.pv-v2 .pv-main { width: min(1320px, 100%); padding: 0 36px 42px; }
.pv-v2 .hero {
  min-height: calc(100vh - 155px); min-height: calc(100dvh - 155px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 500px);
  align-items: center; gap: 54px; text-align: left; padding: 22px 0 16px;
}
.pv-v2 .hero-copy { max-width: none; text-align: left; }
.pv-v2 .eyebrow { box-shadow: none; background: #f4f0e7; border-color: #dbd4c7; color: #756d5e; }
.pv-v2 .hero h1 { font-size: clamp(40px, 4.8vw, 67px); margin-top: 22px; color: #171510; }
.pv-v2 .hero h1 em { color: #9b6b28; }
.pv-v2 .hero-sub { margin: 0; max-width: 530px; color: #6d6558; font-size: 15px; }
.pv-v2 .hero-panel { width: 100%; margin: 0; }
.pv-v2 .composer-card {
  background: #11151d; border-color: #252b37;
  box-shadow: 0 30px 76px rgba(20,18,12,.25);
  border-radius: 25px;
}
.pv-v2 .composer-card textarea { color: #f4efe3; font-size: 15px; }
.pv-v2 .composer-card textarea::placeholder { color: #827d70; }
.pv-v2 .toggle { border-color: #2d3340; color: #a7a294; }
.pv-v2 .toggle:hover { border-color: #485162; color: #f4efe3; }
.pv-v2 .toggle.active { background: #25220f; border-color: #6c5920; color: #e6c674; }
.pv-v2 .send { background: #e4bc61; color: #1a1408; box-shadow: 0 7px 18px rgba(228,188,97,.18); }
.pv-v2 .send:hover { background: #f1ce7c; }
.pv-v2 .hero-chips { justify-content: flex-start; }
.pv-v2 .chip { background: rgba(255,255,255,.55); border-color: #d7d0c3; color: #6d6558; }
.pv-v2 .chip:hover { background: #fff; color: #171510; }
.pv-v2 .hero-note { text-align: left; color: #81786a; }
.pv-v2 .hero-actions { justify-content: flex-start; grid-column: 1 / -1; margin-top: 2px; color: #6d6558; }
.pv-v2 .hero-link { color: #6d6558; }
.pv-v2 .hero-link:hover { color: #171510; }
.pv-v2 .chat-shell { width: min(1080px,100%); }
.pv-v2 .chat-head { border-bottom-color: #d7d0c3; }
.pv-v2 .chat-act:hover { background: #f1ece1; color: #171510; }
.pv-v2 .chat-list { min-height: 340px; }
.pv-v2 .chat-composer .composer-card { background: #fff; border-color: #d7d0c3; box-shadow: 0 14px 40px rgba(20,18,12,.08); }
.pv-v2 .chat-composer .composer-card textarea { color: #171510; }
.pv-v2 .chat-composer .toggle { border-color: #d7d0c3; color: #6d6558; }
.pv-v2 .chat-composer .toggle.active { background: #f6efdf; border-color: #cdbb96; color: #7a5a23; }
.pv-v2 .chat-composer .send { background: #1f1a12; color: #f5dfac; box-shadow: none; }
.pv-v2 .chat-composer .send:hover { background: #000; }
.pv-v2 .pv-footer { color: #81786a; }.pv-v2 .pv-footer a { color: #81786a; }
.pv-v2 .pv-preview-tag { color: #8b8375; border-color: #d7d0c3; }

/* V3: dark focus */
.pv-v3 .pv-top { min-height: 74px; }
.pv-v3 .pv-main { width: min(1220px, 100%); }
.pv-v3 .hero { min-height: calc(100vh - 152px); min-height: calc(100dvh - 152px); }
.pv-v3 .hero h1 { color: #f4f0e6; }
.pv-v3 .hero h1 em { color: #e6bd66; }
.pv-v3 .hero h1 .thin { color: #8c877c; }
.pv-v3 .hero-sub { color: #989184; }
.pv-v3 .eyebrow { background: #111116; border-color: #2a2932; color: #a89f8c; box-shadow: none; }
.pv-v3 .composer-card { background: #101015; border-color: #2a2933; box-shadow: 0 28px 80px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.025) inset; }
.pv-v3 .composer-card:focus-within { border-color: #6e5a28; box-shadow: 0 28px 80px rgba(0,0,0,.44), 0 0 0 3px rgba(230,189,102,.07); }
.pv-v3 .composer-card textarea { color: #f0ece2; }
.pv-v3 .composer-card textarea::placeholder { color: #6f6a60; }
.pv-v3 .toggle { border-color: #2e2d37; color: #979082; }
.pv-v3 .toggle:hover { border-color: #4a4550; color: #f0ece2; }
.pv-v3 .toggle.active { background: #28210e; border-color: #665321; color: #e8c879; }
.pv-v3 .send { background: #e6bd66; color: #171207; box-shadow: 0 8px 22px rgba(230,189,102,.16); }
.pv-v3 .send:hover { background: #f0cc7b; }
.pv-v3 .chip { background: #0f0f15; border-color: #2a2932; color: #989184; }
.pv-v3 .chip:hover { background: #17171f; border-color: #4a4550; color: #f0ece2; }
.pv-v3 .hero-note { color: #8c8375; }
.pv-v3 .hero-link { color: #989184; }
.pv-v3 .hero-link:hover { color: #e8d8ae; }
.pv-v3 .chat-head { border-bottom-color: #2a2932; }
.pv-v3 .chat-mark { background: #e6bd66; color: #171207; }
.pv-v3 .chat-act { color: #918a7d; }.pv-v3 .chat-act:hover { background: #17171e; color: #f0ece2; }
.pv-v3 .chat-status { color: #6f695f; }
.pv-v3 .msg.user .bubble { background: #242015; color: #e8d8ae; }
.pv-v3 .msg.assistant .bubble strong { color: #f4e6bd; }
.pv-v3 .msg.assistant .bubble code { background: #1c1b24; }
.pv-v3 .sources { border-top-color: #2a2932; }
.pv-v3 .sources summary { color: #8d8578; }
.pv-v3 .sources-list a { color: #a99a79; }
.pv-v3 .chat-composer .composer-card { box-shadow: 0 18px 46px rgba(0,0,0,.3); }
.pv-v3 .pv-footer { color: #8c8375; }.pv-v3 .pv-footer a { color: #615b51; }
.pv-v3 .pv-preview-tag { color: #756e62; border-color: #2a2932; }

/* small screens */
@media (max-width: 1000px) {
  .pv-top { padding: 0 22px; }
  .pv-main { padding-left: 22px; padding-right: 22px; }
  .pv-footer { padding-left: 22px; padding-right: 22px; }
  .pv-v2 .hero { grid-template-columns: 1fr; gap: 27px; text-align: left; }
  .pv-v2 .hero-copy { text-align: left; }
  .pv-v2 .hero h1 { max-width: 720px; }
  .pv-v2 .hero-panel { width: min(680px,100%); }
  .pv-v2 .hero-actions { margin-top: 2px; }
}
@media (max-width: 680px) {
  .pv-top { min-height: 60px; padding: 0 15px; gap: 8px; }
  .pv-logo { width: 29px; height: 29px; flex-basis: 29px; }
  .pv-brandtext b { font-size: 14px; }
  .pv-brandtext small { display: none; }
  .pv-top-link { display: none; }
  .pv-preview-tag { display: none; }
  .pv-switch { border-radius: 8px; padding: 2px; }
  .pv-switch a { padding: 4px 5px; font-size: 9px; }
  .pv-lang { min-height: 30px; padding: 0 7px; font-size: 10px; }
  .pv-main { padding: 0 15px 31px; }
  .hero { min-height: auto; padding: 22px 0 7px; }
  .hero h1 { margin: 20px 0 13px; font-size: clamp(35px, 10.5vw, 49px); line-height: 1.08; letter-spacing: -.055em; }
  .hero-sub { font-size: 13px; line-height: 1.7; }
  .eyebrow { font-size: 9.5px; padding: 5px 9px; }
  .hero-panel { margin-top: 19px; }
  .composer-card { padding: 12px 11px 9px; border-radius: 18px; }
  .composer-card textarea { min-height: 49px; font-size: 16px; } /* 16px avoids iOS zoom */
  .toggle { min-height: 28px; padding: 0 8px; font-size: 10px; }
  .send { width: 39px; height: 39px; flex-basis: 39px; font-size: 19px; }
  .hero-chips { gap: 5px; margin-top: 10px; justify-content: flex-start; }
  .chip { min-height: 28px; padding: 0 9px; font-size: 9.8px; }
  .hero-note { text-align: left; font-size: 9px; }
  .hero-actions { justify-content: flex-start; gap: 13px; margin-top: 15px; }
  .hero-link { font-size: 10.5px; }
  .pv-v2 .hero { padding-top: 12px; }
  .pv-v2 .hero h1 { font-size: clamp(35px, 10vw, 47px); }
  .pv-v2 .hero-panel { width: 100%; }
  .pv-v2 .hero-actions { margin-top: 0; }
  .chat { padding-top: 4px; }
  .chat-head { padding-top: 2px; padding-bottom: 10px; align-items: flex-start; }
  .chat-head-actions { gap: 0; }
  .chat-act { min-height: 28px; padding: 0 5px; font-size: 9px; }
  .chat-act span[aria-hidden] { display: none; }
  .chat-list { min-height: 220px; padding: 17px 0 16px; gap: 13px; }
  .msg .bubble { font-size: 13px; line-height: 1.7; }
  .msg.user .bubble { max-width: 88%; }
  .chat-composer .composer-card { border-radius: 15px; }
  .chat-note { font-size: 8.5px; }
  .pv-footer { padding: 0 15px 18px; font-size: 9px; }
}
@media (max-width: 370px) {
  .pv-switch { display: none; }
  .hero h1 { font-size: 33px; }
  .toggle { font-size: 9.3px; }
}
@media (prefers-reduced-motion: reduce) {
  .composer-card, .send, .chip, .toggle, .pv-toast { transition: none !important; }
  .spinner, .dots span { animation: none !important; }
}
