@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');
:root {
  color-scheme: light;
  --paper: #f9f6ef;
  --white: #fffdf9;
  --ink: #352637;
  --muted: #776c77;
  --line: #e0d6dc;
  --rose: #efdfdb;
  --mint: #c5dece;
  --coral: #f27d65;
  --butter: #f4d66f;
  --sans: 'Manrope', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -80px; left: 20px; background: var(--ink); color: var(--paper); padding: 12px 16px; }
.skip:focus { top: 52px; }
.portfolio-nav { background: var(--ink); border: 0; }
.portfolio-nav .portfolio-context { color: #ddd1dc; }
.portfolio-nav .portfolio-context span { color: #c9bac8; }
.workspace-app { max-width: 1600px; margin: auto; }
.masthead { height: 94px; padding: 0 42px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 5px; }
.brand-mascot { display: block; width: 52px; height: 52px; object-fit: contain; }
.brand-logo { display: block; width: 77px; height: 48px; }
.header-tools { display: flex; align-items: center; gap: 25px; }
.sources-toggle { background: none; border: 0; padding: 8px 0; font-size: 15px; color: var(--muted); }
.sources-toggle:hover { color: var(--ink); }
.new-chat { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: none; }
.new-chat:hover { background: var(--mint); }
.shell { padding: 0 24px; }
.chat { max-width: 720px; margin: 0 auto; min-height: calc(100svh - 160px); display: flex; flex-direction: column; }
.thread { display: flex; flex-direction: column; gap: 28px; overflow: auto; scroll-behavior: smooth; padding: 0 0 29px; }
.chat:not(.started) { padding-top: clamp(45px, 9vh, 96px); }
.empty h1 { font-size: 40px; line-height: 1.3; font-weight: 500; letter-spacing: -1.1px; }
.empty-sub { font-size: 16px; color: var(--muted); margin-top: 13px; }
.dock { padding-bottom: 24px; }
.businesses { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 15px; }
.business-tab { border: 1px solid transparent; border-radius: 7px; background: none; padding: 7px 12px; font-size: 14px; color: var(--muted); }
.business-tab:hover { background: #ede8e1; color: var(--ink); }
.business-tab[aria-pressed=true] { background: var(--rose); color: var(--ink); }
.business-tab[data-workspace=coffee][aria-pressed=true] { background: var(--mint); }
.business-tab[data-workspace=rental][aria-pressed=true] { background: var(--butter); }
.business-tab[data-workspace=flowers][aria-pressed=true] { background: #f9d5cb; }
.composer { background: var(--white); border: 1px solid #cdbfc9; border-radius: 12px; padding: 20px 18px 13px; }
.composer:focus-within { border-color: var(--ink); }
.composer textarea { display: block; width: 100%; border: 0; background: none; resize: none; outline: 0; font-size: 17px; line-height: 1.65; max-height: 180px; min-height: 61px; padding: 0; }
.composer textarea::placeholder { color: #948792; }
.composer-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.send { min-height: 40px; border-radius: 6px; border: 0; background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 13px; font-size: 14px; }
.send:hover { background: #554057; }
.send.stop { background: var(--coral); color: var(--ink); }
.send.stop svg, .send.stop span { display: none; }
.send.stop:before { content: 'Dừng'; }
.send.stop:after { content: ''; width: 8px; height: 8px; background: var(--ink); border-radius: 1px; }
.suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 23px; }
.suggestion { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; color: var(--muted); padding: 8px 0; font-size: 15px; }
.suggestion:hover { color: var(--ink); }
.suggestion-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); flex: none; }
.suggestion:nth-child(2) .suggestion-dot { background: var(--coral); }
.suggestion:nth-child(3) .suggestion-dot { background: var(--butter); }
.chat.started { height: calc(100svh - 154px); min-height: 420px; padding-top: 20px; }
.chat.started .thread { flex: 1; min-height: 0; padding-top: 10px; }
.chat.started .dock { padding-top: 16px; }
.chat.started .suggestions { display: none; }
.chat.started .businesses { display: none; }
.inline-suggestions { display: grid; margin-top: 15px; }
.message { animation: rise .2s ease both; }
.message.user { align-self: flex-end; max-width: 85%; background: var(--rose); padding: 12px 16px; border-radius: 10px 10px 2px 10px; font-size: 16px; }
.message.assistant { min-width: 0; }
.assistant-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.assistant-avatar { display: block; width: 38px; height: 38px; object-fit: contain; flex: none; transform-origin: 50% 85%; }
.assistant-name { display: block; font-size: 14px; font-weight: 600; }
.message[aria-busy="true"] .assistant-avatar { animation: pip-think 1.6s ease-in-out infinite; }
.answer-progress { font-size: 13px; color: var(--muted); margin-top: 1px; }
.answer { font-size: 17px; line-height: 1.9; }
.answer > * + * { margin-top: 15px; }
.answer ul { padding-left: 20px; margin-bottom: 0; }
.answer li + li { margin-top: 9px; }
.answer blockquote { margin: 16px 0 0; padding: 16px 19px; border-left: 3px solid var(--mint); background: var(--white); }
.answer.streaming > :last-child:after, .answer.streaming li:last-child:after { content: ''; display: inline-block; width: 2px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--ink); }
.answer.streaming ul:last-child:after, .answer.streaming .table-scroll:after { display: none !important; }
.stopped { font-size: 13px; color: var(--muted); }
.cite { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; margin: 0 2px; vertical-align: 1px; border: 0; border-radius: 4px; background: var(--butter); color: var(--ink); font: 500 12px var(--mono); }
.cite:hover { background: var(--ink); color: var(--paper); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font-weight: 500; background: var(--mint); }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.actions button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; border-radius: 5px; color: var(--muted); }
.actions button:hover { color: var(--ink); background: var(--mint); }
.cite-pop { position: fixed; z-index: 60; width: min(300px, calc(100% - 24px)); background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; box-shadow: 0 10px 30px #35263714; font-size: 14px; pointer-events: none; }
.cite-pop small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.cite-pop strong { display: block; font-weight: 500; margin-bottom: 7px; }
.cite-pop p { color: var(--muted); line-height: 1.7; }
.sources { position: fixed; top: 58px; right: 16px; bottom: 16px; width: 370px; max-width: calc(100% - 32px); z-index: 40; overflow: auto; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 25px; box-shadow: 0 12px 60px #3526371c; }
.sources-head { display: flex; justify-content: space-between; align-items: center; }
.sources h2 { font-size: 24px; font-weight: 500; letter-spacing: -.7px; }
.sources h2 span { font-size: 13px; color: var(--muted); margin-left: 6px; }
.sources-close { width: 34px; height: 34px; border: 0; background: none; font-size: 25px; line-height: 1; color: var(--muted); }
.sources-intro { font-size: 14px; color: var(--muted); margin-top: 7px; }
.source-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 22px 0 10px; }
.source-tabs button { border: 0; background: none; color: var(--muted); position: relative; padding: 8px 0 12px; font-size: 14px; }
.source-tabs button[aria-pressed=true] { color: var(--ink); }
.source-tabs button[aria-pressed=true]:after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--coral); }
.source-tabs button span { font-size: 12px; margin-left: 4px; }
.library-list, .source-list { list-style: none; padding: 0; margin: 0; }
.library-doc { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 13px 0; min-height: 62px; }
.library-doc:hover { color: #8a4b50; }
.library-icon { width: 27px; height: 32px; display: grid; place-items: center; background: var(--mint); border-radius: 4px; flex: none; }
.library-icon svg { width: 13px; height: 13px; }
.library-copy { min-width: 0; flex: 1; }
.library-copy strong { display: block; font-size: 14px; font-weight: 500; line-height: 1.5; }
.library-copy small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.source-empty { font-size: 14px; color: var(--muted); line-height: 1.8; padding: 20px 0; }
.source button { width: 100%; display: flex; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 12px; margin-top: 10px; }
.source small { display: block; font-size: 12px; color: var(--muted); }
.source strong { display: block; font-size: 14px; font-weight: 500; margin-top: 4px; }
.num { width: 24px; height: 24px; display: grid; place-items: center; flex: none; background: var(--butter); border-radius: 3px; font: 12px var(--mono); }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: min(580px, calc(100% - 32px)); max-height: calc(100svh - 48px); background: var(--paper); color: var(--ink); box-shadow: 0 20px 70px #35263733; }
dialog::backdrop { background: #35263766; }
.eyebrow { font-size: 13px; color: var(--muted); }
dialog h2 { font-size: 28px; font-weight: 500; line-height: 1.3; letter-spacing: -.8px; margin: 12px 0; padding-right: 10px; }
.doc-meta { font-size: 13px; color: var(--muted); padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.doc-body { padding: 20px 0; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.9; }
mark { background: var(--butter); color: var(--ink); padding: 1px 3px; }
.close-dialog { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@keyframes pip-think { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-2px); } }
@media (max-width: 760px) {
  .masthead { padding: 0 24px; height: 80px; }
  .header-tools { gap: 18px; }
  .chat { max-width: 620px; }
  .chat:not(.started) { padding-top: 55px; }
  .empty h1 { font-size: 38px; }
  .chat.started { height: calc(100svh - 130px); }
}
@media (max-width: 480px) {
  .masthead { padding: 0 22px; height: 80px; gap: 15px; }
  .brand-logo { width: 69px; height: 43px; }
  .brand-mascot { width: 44px; height: 44px; }
  .header-tools { gap: 18px; }
  .sources-toggle { font-size: 14px; }
  .new-chat { width: 28px; height: 28px; border: 0; }
  .shell { padding: 0 22px; }
  .chat:not(.started) { padding-top: 46px; }
  .empty h1 { font-size: 34px; letter-spacing: -.8px; }
  .empty-sub { font-size: 15px; line-height: 1.8; max-width: 300px; margin-top: 14px; }
  .thread { padding-bottom: 25px; }
  .businesses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .business-tab { padding: 7px 10px; text-align: left; }
  .composer { padding: 17px 13px 12px; }
  .composer textarea { font-size: 16px; min-height: 78px; }
  .composer-bar { gap: 6px; }
  .send { padding: 7px 10px; gap: 7px; }
  .suggestions { gap: 5px; margin-top: 20px; }
  .chat.started { height: calc(100svh - 126px); min-height: 450px; padding-top: 0; }
  .chat.started .dock { padding-bottom: 15px; }
  .message.user { max-width: 95%; }
  .answer { font-size: 16px; }
  .sources { right: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 23px; }
  dialog { padding: 29px 24px; }
  dialog h2 { font-size: 25px; }
}
@media (max-width: 350px) {
  .masthead { padding: 0 18px; }
  .shell { padding: 0 18px; }
  .empty h1 { font-size: 32px; }
  .businesses { gap: 2px; }
  .business-tab { padding: 7px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
