/* Chat page design: page-level rules from the approved preview (m4.html). */
/* Version 2: crisp navy outlines, hard offset shadows, one yellow highlight. Light theme only. */
:root { --v-ink: var(--tdtu-blue-800); --v-yellow: #FFD84D; --v-yellow-strong: #FFCB1F; --v-cream: #FFF6D1;
  /* Colours with no design-system token: the document page of the drafting tool, the danger button's hover. */
  --v-paper-text: #111; --v-paper-hint: #5b5b5b; --v-red-hover: #A30409; }
.top { gap: 12px; background: var(--primary-soft); border-bottom: 2px solid var(--v-ink); }

/* Header: actions next to the brand, language and account far right. Every hover is yellow. */
.nav-left { display: flex; align-items: center; gap: 6px; flex: none; margin-left: 12px; }
.tools { display: flex; align-items: center; gap: 18px; flex: none; }
.tb { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background var(--duration-fast), color var(--duration-fast); }
.tb-plain { color: var(--v-ink); }
.tb-ic { width: 40px; padding: 0; }   /* icon-only top-bar buttons (dark theme, download the conversation) */
@media (min-width: 481px) { .foot-links .side-phone { display: none; } }   /* their phone twins in the drawer */
.tb-plain:hover { background: var(--v-yellow); }
.tb-outline { border: 2px solid var(--v-ink); background: var(--paper); color: var(--v-ink); box-shadow: 2px 2px 0 var(--v-ink); }
.tb-outline:hover { background: var(--v-yellow); }
.tb-solid { border: 2px solid var(--v-ink); background: var(--primary); color: var(--text-inverse); font-weight: 700; padding: 0 18px; box-shadow: 2px 2px 0 var(--v-ink); }
.tb-solid:hover { background: var(--v-yellow); color: var(--tdtu-blue-800); }
/* Language: one plain link to the other language, same look as Lịch sử. */
.lang-opt[aria-pressed="true"] { display: none; }
.lang-short { display: none; }
.avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--text-inverse); font-size: 11.5px; font-weight: 700; }
.caret { width: 14px !important; height: 14px !important; transform: rotate(90deg); }
[data-auth="in"] .guest-only, [data-auth="out"] .auth-only { display: none !important; }
[data-auth="in"] .hist-empty p, [data-auth="in"] .hist-empty .ghost, [data-auth="in"] .hist-head span { display: none; }

/* Welcome */
.lead h2 mark { padding: 0 .14em; border-radius: var(--radius-xs); background: var(--v-yellow); color: var(--tdtu-blue-800); white-space: nowrap; }
/* An assistant's name may be long: it wraps, the yellow band follows each line, and a long one is set smaller. */
.lead h2.is-bot mark { white-space: normal; overflow-wrap: break-word; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
#welcomeTitle.is-long { font-size: clamp(28px, 2.6vw, 40px); }
/* personas.css makes the title's last span a block; the name's bracketed part stays inline in the band. */
.lead h2.is-bot mark .nw { display: inline; }
/* A yellow band sits under the text of the line above it: a band on a wrapped line covered the dot of "ạ" in "bạn,"
   and the tail of "y" in "What would you / like to know?". Welcome title and the terms dialog title. */
.lead h2, .rm-head h2 { position: relative; z-index: 0; }
.lead h2 mark, .rm-head h2 mark { position: relative; z-index: -1; }
.composer { padding: 10px 10px 10px 16px; border: 2px solid var(--v-ink); border-radius: var(--radius-md); background: var(--paper); }
[data-dock="welcome"] .composer { box-shadow: 6px 6px 0 var(--primary); }
.modes { gap: 4px; }
.mode { border-radius: var(--radius-sm); }
.mode[aria-checked="true"] { background: var(--v-yellow); color: var(--tdtu-blue-800); font-weight: 700; }
/* The outline and offset are one shadow, so no seam shows between them on the red fill. */
.send { height: 40px; margin: 2px 4px 2px 2px; padding: 0 18px; border-radius: 9px; background: var(--tdtu-red-600); color: var(--text-inverse); box-shadow: 0 0 0 2px var(--v-ink), 2px 2px 0 2px var(--v-ink); transition: background var(--duration-fast), color var(--duration-fast); }
.send:hover { background: var(--v-yellow); color: var(--tdtu-blue-800); }
.send-text { display: inline; font-family: var(--font-heading); font-size: 14px; font-weight: 700; }

.lede { max-width: 60ch; }
.lede-q { display: block; font-weight: 700; color: var(--gray-900); }
.lede-a { display: block; margin-top: 4px; }

/* Sign-in card */
.signin { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--v-cream); }
.signin-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 2px solid var(--v-ink); border-radius: var(--radius-md); background: var(--paper); color: var(--tdtu-blue-800); box-shadow: 2px 2px 0 var(--v-ink); }
.signin-ic .ic { width: 24px; height: 24px; }
.signin-text { flex: 1; min-width: 0; }
.signin-text strong { display: block; font-family: var(--font-heading); font-size: 15px; line-height: 21px; color: var(--tdtu-blue-800); }
.signin-text span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 20px; color: var(--gray-700); }
.signin-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 42px; padding: 0 18px; border: 2px solid var(--v-ink); border-radius: var(--radius-sm); background: var(--primary); color: var(--text-inverse); font-size: 14.5px; font-weight: 700; white-space: nowrap; box-shadow: 3px 3px 0 var(--v-ink); transition: transform var(--duration-fast), box-shadow var(--duration-fast); }
.signin-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--v-ink); }

/* Suggestions */
.panel-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-family: var(--font-heading); font-size: 24px; line-height: 32px; font-weight: 800; letter-spacing: -.01em; color: var(--heading); white-space: nowrap; }
.panel-title::before { content: ''; flex: none; width: 7px; height: 26px; border-radius: 2px; background: var(--tdtu-red-500); }
.panel-title::after { content: ''; flex: 1; height: 2px; background: var(--v-ink); }
.sugs { display: grid; gap: 12px; counter-reset: q; }
.sugs li { counter-increment: q; }
.sug { position: relative; padding: 12px 14px 12px 62px; border: 2px solid var(--v-ink); border-radius: var(--radius-md); background: var(--paper); box-shadow: 3px 3px 0 var(--v-ink); transition: transform var(--duration-fast), box-shadow var(--duration-fast); }
.sug::before { content: counter(q); position: absolute; left: 14px; top: 14px; width: 34px; height: 34px; box-sizing: border-box; border: 2px solid var(--v-ink); border-radius: var(--radius-sm); background: var(--tdtu-blue-600); color: var(--text-inverse); font-family: var(--font-heading); font-size: 15px; font-weight: 800; line-height: 30px; text-align: center; box-shadow: 2px 2px 0 var(--v-ink); }
.sugs li:nth-child(even) .sug::before { background: var(--tdtu-red-600); }
.sug:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--primary); }
.sug-topic { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.sug-q { margin-top: 2px; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text); }

/* Conversation */
.msg.user { justify-self: end; max-width: 76%; }
.bubble { padding: 12px 16px; border: 2px solid var(--v-ink); border-radius: var(--radius-md); background: var(--v-yellow); color: var(--tdtu-blue-800); font-size: 15.5px; font-weight: 500; box-shadow: 3px 3px 0 var(--v-ink); }
.msg.bot { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 24px; align-items: start; }
.answer, .actions { grid-column: 1; }
.sources { grid-column: 2; grid-row: 1 / span 2; margin: 0; padding: 14px; border: 2px solid var(--v-ink); border-radius: var(--radius-md); box-shadow: 3px 3px 0 var(--primary); }
.source { padding: 0; border: 0; background: none; }
.dock-chat { border-top: 2px solid var(--v-ink); }
.dock-chat .composer { box-shadow: none; }

@media (min-width: 641px) { .btn-login .ic { display: none; } }
@media (max-width: 960px) {
  .msg.bot { grid-template-columns: minmax(0, 1fr); }
  .sources { grid-column: 1; grid-row: auto; margin-top: 12px; }
}
@media (max-width: 640px) {
  .top { gap: 8px; }
  .tb, .tb-solid { padding: 0; width: 40px; }
  .tools { gap: 6px; }
  .nav-left { margin-left: 0; }
  .acct-name, .caret, .lang-long, .lang-opt .ic { display: none; }
  .lang-short { display: inline; }
  .brand { flex: none; }
  .nav-text { display: none; }
  [data-dock="welcome"] .composer { box-shadow: 4px 4px 0 var(--primary); }
  .signin { flex-wrap: wrap; }
  .signin-text { flex-basis: calc(100% - 60px); }
  .signin-btn { width: 100%; justify-content: center; }
}
@media (max-width: 360px) {
  .tile { width: 56px; height: 32px; }
  .tb, .tb-solid { width: 36px; }
  .tools, .nav-left { gap: 4px; }
  .top { gap: 4px; }
}
