/* Identity drawn from the supplied gold, ivory and walnut emblem. */
:root {
  color-scheme: light;
  --cream: #fff8e9;
  --paper: #fffdf7;
  --ink: #351a10;
  --muted: #77604d;
  --accent: #8a440a;
  --on-accent: #fff;
  --accent-2: #6b462d;
  --chart-end: #a36b15;
  --warn: #79510b;
  --warn-bg: #ffedbf;
  --good: #286346;
  --bad: #a92b29;
  --ok-bg: #e3efe6;
  --glow: #b57b2644;
  --backdrop: #351a10aa;
  --coral: #f5b625;
  --peach: #ffedbf;
  --sage: #f7e7c7;
  --line: #dfc69c;
  --surface: #fffdf7;
  --wash: #f7e7c7;
  --ring: #b99560;
  --gold: #f5b625;
  --walnut: #351a10;
  --on-gold: #351a10;
  --radius: 22px;
  --shadow: 0 8px 0 #dfc69c33, 0 18px 44px #351a1009;
  --bg: var(--cream);
  --card: var(--paper);
  --acc: var(--accent);
}
body { background: var(--cream); color: var(--ink); }
h1,h2,h3 { letter-spacing: -.035em; line-height: 1.28; text-wrap: balance; }
input,textarea,select { accent-color: var(--accent); }
::selection { background: var(--gold); color: var(--walnut); }
.brand,.sidebar .brand { display: inline-flex; flex-shrink: 0; max-width: 100%; font-size: inherit; }
.brand-logo { display: block; max-width: 100%; width: 204px; height: auto; aspect-ratio: 5 / 2; object-fit: contain; }
.brand.auth-mobile-brand { display: none; }
.brand-avatar { display: block; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--gold); border-radius: 14px; }
.sidebar .brand-logo { width: 190px; }
.lp-header,.site-header { background: var(--walnut); color: #fff4dc; border-bottom: 2px solid var(--gold); }
.lp-header-inner { min-height: 102px; }
.lp-nav a:not(.button):hover { color: #ffdb79; }
.button,button[type=submit],.wrap button {
  color: var(--on-gold); background: var(--gold);
  border: 1px solid transparent; border-radius: 12px;
  box-shadow: none; min-height: 48px;
}
.button:hover:not(:disabled),button[type=submit]:hover:not(:disabled),.wrap button:hover:not(:disabled) {
  background: #ffc940; color: var(--on-gold); transform: none;
}
.button.secondary { color: var(--ink); background: var(--paper); border-color: var(--ring); box-shadow: none; }
.button.quiet { color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; }
.button.secondary:hover:not(:disabled),.button.quiet:hover:not(:disabled) { background: var(--sage); color: var(--ink); }
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
.lp-header :focus-visible,.site-header :focus-visible { outline-color: #ffdb79; }
.lp-hero { gap: clamp(24px,4vw,64px); }
.lp-hero h1 { color: var(--ink); line-height: 1.24; }
.advisor { background: var(--sage); border: 1px solid var(--line); border-radius: 36px 36px 24px 24px; padding: 24px; }
.advisor-char { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.advisor-logo { display: block; width: 100%; max-width: 560px; height: auto; object-fit: contain; animation: none; }
.advisor-char .memo { position: static; transform: none; width: 100%; max-width: 360px; background: var(--paper); border-color: var(--line); color: var(--ink); }
.convo,.chat-card { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); transform: none; }
.convo-head,.chat-header { background: var(--paper); border-color: var(--line); }
.say.qs,.bubble { background: var(--sage); color: var(--ink); }
.say.me,.bubble.mine { background: var(--peach); color: var(--ink); }
.pill-note,.memo,.tag { color: var(--accent); }
.pill-note { background: var(--peach); border-color: var(--line); }
.eyebrow,.chat-label { text-transform: none; letter-spacing: .01em; }
.auth-story { background: var(--walnut); color: #fff4dc; border-right: 2px solid var(--gold); }
.auth-story p,.auth-story .story-footer,.auth-story .story-steps { color: #ead5b3; }
.auth-story h1 em { color: #ffda78; }
.auth-story .brand-logo { width: min(340px,100%); }
.auth-panel,.sidebar,.panel,.setup-card,.kpi,.login-card,.pv-card { background: var(--paper); border-color: var(--line); }
.sidebar { border-right: 1px solid var(--line); }
.sidebar-nav a[aria-current=page] { color: var(--ink); background: var(--peach); box-shadow: inset 3px 0 0 var(--gold); }
.panel,.setup-card,.login-card { border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi { border-radius: 16px; border-top: 3px solid var(--gold); }
.field input,.field textarea,.field select,.password-field,.wrap input,.wrap textarea,.wrap select {
  background: var(--paper); color: var(--ink); border-color: var(--ring); border-radius: 12px;
}
.password-field input { border-radius: 0; }
.field input::placeholder,.field textarea::placeholder { color: var(--muted); }
.ai-btn,.ai-actions .button:last-child { color: var(--on-gold); background: var(--gold); }
.ai-btn:hover:not(:disabled) { color: var(--on-gold); background: #ffd467; }
.status-pill { color: var(--accent); border-color: var(--line); }
.status-details { color: var(--muted); }
.ai-bar { background: var(--peach); border-color: var(--line); }
.ai-after { background: var(--sage); border-color: var(--line); }
.setup-banner,.connect-note,.connection-result,.plan-banner { background: var(--sage); border-color: var(--line); }
.ov-hero > .advisor-logo { width: 200px; flex-shrink: 0; }
.begin-section { background: var(--walnut); color: #fff4dc; border-top: 2px solid var(--gold); }
.begin-inner p { color: #ead5b3; }
.site-footer { border-top: 1px solid var(--line); }
.wrap { font-family: "Be Vietnam Pro","Segoe UI",Arial,sans-serif; }
.wrap > .brand { margin-bottom: 28px; }
.wrap label { color: var(--ink); }
.wrap input,.wrap select { min-height: 48px; }
.wrap .err { color: var(--bad); }
@media(max-width:1000px) and (min-width:761px) {
  .sidebar .brand { width: 58px; }
  .sidebar .brand-logo { content: url('/static/quansuso-icon.png'); width: 58px; height: 58px; object-fit: contain; }
}
@media(max-width:760px) {
  .lp-header-inner { min-height: 84px; gap: 12px; }
  .lp-header .brand-logo { width: clamp(112px,28vw,160px); }
  .lp-nav { gap: 10px; }
  .lp-nav a { font-size: .78rem; }
  .lp-nav .button { padding: 10px 12px; min-height: 44px; }
  .advisor { padding: 18px; border-radius: 26px; }
  .sidebar .brand-logo { width: 158px; }
  .brand.auth-mobile-brand { display: inline-flex; margin-bottom: 26px; }
  .auth-mobile-brand .brand-logo { width: 230px; }
  .sidebar-nav a[aria-current=page] { box-shadow: inset 0 3px 0 var(--gold); }
  .ov-hero > .advisor-logo { width: 110px; }
  .stepper button { min-height: 56px; line-height: 1.5; }
  .wizard-actions,.save-row { flex-wrap: wrap; }
}
@media(max-width:380px) {
  .lp-header-inner { flex-wrap: wrap; justify-content: center; padding-block: 10px; }
  .lp-nav { justify-content: center; width: 100%; }
}

/* Cảnh quân sư nói chuyện (chỉ máy tính); điện thoại giữ khung chat tĩnh. */
.scene { display: none; }
.advisor-char { display: none; }
@media(min-width:761px) {
  .convo { display: none; }
  .scene { display: block; position: relative; overflow: hidden; border-radius: 24px; }
  .scene-chat { display: flex; flex-direction: column; gap: 22px; padding: 4px 4px 22px; }
  .sb { position: relative; margin: 0; width: fit-content; max-width: 78%; padding: 12px 16px; font-size: .95rem; line-height: 1.55; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); overflow-wrap: break-word; }
  .sb::after { content: ""; position: absolute; bottom: -8px; left: 34px; width: 14px; height: 14px; background: inherit; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
  .sb.cust { background: var(--peach); }
  .sb.cust.right { align-self: flex-end; }
  .sb.cust.right::after { left: auto; right: 34px; }
  .sb.qs2 { background: var(--paper); align-self: center; border-color: var(--gold); }
  .sb.qs2::after { left: calc(50% - 7px); border-color: var(--gold); }
  .scene-cast { display: flex; align-items: flex-end; justify-content: space-between; height: 210px; padding: 0 16px; border-bottom: 3px solid var(--line); }
  .cust-fig { width: 92px; height: auto; flex-shrink: 0; }
  .cust-fig.flip { transform: scaleX(-1); }
  .adv-turn { width: 150px; transform-origin: 50% 100%; }
  .adv-fig { display: block; width: 100%; height: auto; }
}
@media(min-width:761px) and (prefers-reduced-motion:no-preference) {
  .scene { height: 500px; }
  .scene-chat { position: absolute; inset: 0 0 226px; display: block; padding: 0; }
  .scene-cast { position: absolute; inset: auto 0 0 0; }
  .sb { position: absolute; bottom: 0; left: 0; width: max-content; max-width: 70%; }
  .sb.cust.right { left: auto; right: 0; }
  .sb.qs2 { left: 0; right: 0; margin-inline: auto; }
  .sb-1 { animation: sb-1 16s ease infinite both; }
  .sb-2 { animation: sb-2 16s ease infinite both; }
  .sb-3 { animation: sb-3 16s ease infinite both; }
  .sb-4 { animation: sb-4 16s ease infinite both; }
  .adv-turn { animation: adv-turn 16s ease-in-out infinite; }
  .adv-fig { animation: adv-bob 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
  .cust-fig { animation: adv-bob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
  .cust-fig.flip { animation: none; }
}
@keyframes sb-1 { 0%, 2% { opacity: 0; transform: translateY(10px); } 6%, 19% { opacity: 1; transform: none; } 22%, 100% { opacity: 0; transform: none; } }
@keyframes sb-2 { 0%, 23% { opacity: 0; transform: translateY(10px); } 27%, 43% { opacity: 1; transform: none; } 46%, 100% { opacity: 0; transform: none; } }
@keyframes sb-3 { 0%, 48% { opacity: 0; transform: translateY(10px); } 52%, 66% { opacity: 1; transform: none; } 69%, 100% { opacity: 0; transform: none; } }
@keyframes sb-4 { 0%, 70% { opacity: 0; transform: translateY(10px); } 74%, 92% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes adv-turn {
  0%, 44% { transform: scaleX(-1); }
  50% { transform: scaleX(0); }
  56%, 92% { transform: scaleX(1); }
  96% { transform: scaleX(0); }
  100% { transform: scaleX(-1); }
}
@keyframes adv-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(1deg); } }
@media(max-width:760px) {
  .lp-header .brand-logo { width: clamp(124px,36vw,170px); }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
