/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[2].use[1]!./node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[14].oneOf[2].use[2]!./node_modules/next/font/google/target.css?{"path":"src/app/layout.tsx","import":"Inter","arguments":[{"subsets":["latin","vietnamese"],"variable":"--font-inter","display":"swap"}],"variableName":"inter"} ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* cyrillic-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/ba9851c3c22cd980-s.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/21350d82a1f187e9-s.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/c5fe6dc8356a8c31-s.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/19cfc7226ec3afaa-s.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/df0a9ae256c0569c-s.p.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/8e9860b6e62d6359-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/_next/static/media/e4af272ccee01ff0-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}@font-face {font-family: 'Inter Fallback';src: local("Arial");ascent-override: 90.44%;descent-override: 22.52%;line-gap-override: 0.00%;size-adjust: 107.12%
}.__className_75b79f {font-family: 'Inter', 'Inter Fallback';font-style: normal
}.__variable_75b79f {--font-inter: 'Inter', 'Inter Fallback'
}

/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[2].use[1]!./node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[14].oneOf[2].use[2]!./node_modules/next/font/google/target.css?{"path":"src/app/layout.tsx","import":"Space_Grotesk","arguments":[{"subsets":["latin","vietnamese"],"weight":["500","600","700"],"variable":"--font-grotesk","display":"swap"}],"variableName":"grotesk"} ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* vietnamese */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/_next/static/media/e1aab0933260df4d-s.p.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/_next/static/media/b7387a63dd068245-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/_next/static/media/36966cca54120369-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/_next/static/media/e1aab0933260df4d-s.p.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/_next/static/media/b7387a63dd068245-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/_next/static/media/36966cca54120369-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/_next/static/media/e1aab0933260df4d-s.p.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/_next/static/media/b7387a63dd068245-s.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/_next/static/media/36966cca54120369-s.p.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}@font-face {font-family: 'Space Grotesk Fallback';src: local("Arial");ascent-override: 89.71%;descent-override: 26.62%;line-gap-override: 0.00%;size-adjust: 109.69%
}.__className_ed7724 {font-family: 'Space Grotesk', 'Space Grotesk Fallback';font-style: normal
}.__variable_ed7724 {--font-grotesk: 'Space Grotesk', 'Space Grotesk Fallback'
}

/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
/* =========================================================
   24gioBDS global design system
   Source of truth: tokens (:root) → base → primitives → layout
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* color */
  --bg: #0a0e16;
  --side: #0d111a;
  --elev: #141a26;
  --elev2: #1a2030;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef0f3;
  --dim: #8d96a3;
  --gold: #c9a876;
  --gold2: #eecf9c;
  --violet: #7c6ff0;
  --bubble-user: #1a2030;
  --shadow: rgba(0, 0, 0, 0.45);
  --danger: #ef6b6b;
  --success: #5fc48f;
  --on-accent: #191307;
  --grad-brand: linear-gradient(135deg, var(--gold2), var(--violet));
  --grad-gold: linear-gradient(135deg, var(--gold2), var(--gold));

  /* type */
  --font-body: var(--font-inter), system-ui, sans-serif;
  --font-disp: var(--font-grotesk), system-ui, sans-serif;

  /* shape / motion */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 264px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5f2; --side: #efeee9; --elev: #ffffff; --elev2: #f1f0eb;
    --line: rgba(20, 18, 14, 0.1); --text: #1b1a17; --dim: #6b6a63;
    --gold: #a9824f; --gold2: #8a6a3e; --violet: #5b4fd1;
    --bubble-user: #ece9e1; --shadow: rgba(20, 18, 14, 0.08);
    --danger: #c94a4a; --success: #2f8f5f; --on-accent: #fff8ec;
    --grad-brand: linear-gradient(135deg, #d9b98a, var(--violet));
    --grad-gold: linear-gradient(135deg, #c39a63, var(--gold2));
  }
}
:root[data-theme="light"] {
  --bg: #f6f5f2; --side: #efeee9; --elev: #ffffff; --elev2: #f1f0eb;
  --line: rgba(20, 18, 14, 0.1); --text: #1b1a17; --dim: #6b6a63;
  --gold: #a9824f; --gold2: #8a6a3e; --violet: #5b4fd1;
  --bubble-user: #ece9e1; --shadow: rgba(20, 18, 14, 0.08);
  --danger: #c94a4a; --success: #2f8f5f; --on-accent: #fff8ec;
  --grad-brand: linear-gradient(135deg, #d9b98a, var(--violet));
  --grad-gold: linear-gradient(135deg, #c39a63, var(--gold2));
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; overflow: hidden; position: relative;
  transition: background 0.3s, color 0.3s;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 900px 520px at 78% -6%, rgba(124, 111, 240, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 480px at 10% 100%, rgba(201, 168, 118, 0.11), transparent 60%);
}
h1, h2, h3, .disp { font-family: var(--font-disp); letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dim { color: var(--dim); }
.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* Public legal pages intentionally sit outside the authenticated app shell. */
.legal-page { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; overflow-y: auto; padding: clamp(28px, 7vw, 88px) 20px; }
.legal-document { width: min(100%, 760px); margin: 0 auto; padding: clamp(28px, 6vw, 56px); background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: 0 24px 64px var(--shadow); }
.legal-brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-disp); font-weight: 700; }
.legal-brand span { width: 9px; height: 9px; border-radius: 50%; background: var(--grad-brand); }
.legal-eyebrow { margin-top: 44px; color: var(--gold2); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; }
.legal-document h1 { margin-top: 10px; font-size: clamp(1.8rem, 5vw, 2.65rem); line-height: 1.12; }
.legal-updated { margin-top: 10px; color: var(--dim); font-size: 0.86rem; }
.legal-lead { margin: 30px 0 38px; color: var(--text); font-size: 1.03rem; line-height: 1.7; }
.legal-document section { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.legal-document h2 { font-size: 1.08rem; margin-bottom: 10px; }
.legal-document p { color: var(--dim); line-height: 1.72; }
.legal-document a:not(.legal-brand) { color: var(--gold2); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .legal-page { padding: 0; } .legal-document { min-height: 100dvh; border-radius: 0; border-width: 0; padding: 32px 22px 48px; } .legal-eyebrow { margin-top: 36px; } }

/* ---------- 3. Primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-md); font-size: 0.88rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--elev2);
  transition: transform 0.15s, border-color 0.2s, background 0.2s, opacity 0.2s;
}
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--grad-gold); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-flex;
  align-items: center; justify-content: center; color: var(--dim); transition: background 0.2s, color 0.2s;
}
.icon-btn:hover:not(:disabled) { background: var(--elev2); color: var(--text); }
.icon-btn.on { color: var(--gold2); }

.card { background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 1rem; font-weight: 600; }
.card .card-sub { color: var(--dim); font-size: 0.83rem; margin-top: 4px; line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font-size: 0.78rem; color: var(--dim); }
.input {
  width: 100%; background: var(--elev2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: var(--gold); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; border: 1px solid var(--line); background: var(--elev2); color: var(--dim);
}
.chip.gold { color: var(--gold2); border-color: var(--gold); }
.chip.ok { color: var(--success); }

.switch { position: relative; width: 40px; height: 23px; border-radius: 999px; background: var(--elev2); border: 1px solid var(--line); flex-shrink: 0; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--dim); transition: transform 0.25s var(--ease), background 0.2s; }
.switch[aria-checked="true"] { background: var(--grad-brand); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(17px); background: #fff; }

.segmented { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--elev2); border: 1px solid var(--line); }
.segmented button { padding: 6px 14px; border-radius: 7px; font-size: 0.82rem; color: var(--dim); transition: background 0.2s, color 0.2s; }
.segmented button[aria-pressed="true"] { background: var(--elev); color: var(--text); box-shadow: 0 1px 6px var(--shadow); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; padding-bottom: 0; }
.row .row-title { font-size: 0.9rem; font-weight: 500; }
.row .row-sub { font-size: 0.78rem; color: var(--dim); margin-top: 2px; }

.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; color: #12111c; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }

.meter { height: 6px; border-radius: 999px; background: var(--elev2); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width 0.6s var(--ease); }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--elev2), var(--elev), var(--elev2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold2); animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* popover menu */
.menu { position: absolute; z-index: 60; min-width: 200px; padding: 6px; border-radius: var(--r-lg); background: var(--elev); border: 1px solid var(--line); box-shadow: 0 18px 50px var(--shadow); animation: pop 0.16s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 0.85rem; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--elev2); }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .danger { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(0.98); } }

/* modal */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(4, 6, 10, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.2s; }
.modal { width: 100%; max-width: 440px; background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 24px; box-shadow: 0 30px 80px var(--shadow); animation: pop 0.22s var(--ease); }
.modal h2 { font-size: 1.1rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }

/* toast */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: var(--r-md); background: var(--elev); border: 1px solid var(--line); box-shadow: 0 14px 40px var(--shadow); font-size: 0.85rem; animation: rise-sm 0.3s var(--ease); }
.toast.error { border-color: var(--danger); }
.toast.success .dot-s { background: var(--success); }
.toast .dot-s { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.toast.error .dot-s { background: var(--danger); }
.toast .grow { flex: 1 1; }
.toast button.act { color: var(--gold2); font-weight: 600; font-size: 0.82rem; }
@keyframes rise-sm { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 4. Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; height: 100dvh; position: relative; z-index: 1; }
.app-loading { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--bg); }
.app-loading .spinner { width: 22px; height: 22px; }
.scrim { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: 0 1fr; }
  .sidebar { position: fixed; z-index: 40; height: 100dvh; width: var(--sidebar-w); transform: translateX(-100%); transition: transform 0.3s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(4, 6, 10, 0.5); }
}

.sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 9px; padding: 8px 6px 18px; font-family: var(--font-disp); font-weight: 700; font-size: 1.05rem; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grad-brand); flex-shrink: 0; }
.newchat { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--elev2); font-size: 0.88rem; font-weight: 500; width: 100%; transition: border-color 0.2s, transform 0.15s; }
.newchat:hover { border-color: var(--gold); }
.newchat:active { transform: scale(0.98); }
.group-label { font-size: 0.72rem; color: var(--dim); padding: 20px 12px 6px; }
.empty-note { padding: 9px 12px; font-size: 0.83rem; color: var(--dim); line-height: 1.5; }
.convo-list { flex: 1 1; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.convo { position: relative; display: flex; align-items: center; border-radius: var(--r-md); transition: background 0.15s, opacity 0.2s; }
.convo:hover, .convo.active { background: var(--elev2); }
.convo a { flex: 1 1; min-width: 0; padding: 9px 12px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.convo.pending { opacity: 0.55; }
.convo .more { opacity: 0; margin-right: 2px; }
.convo:hover .more, .convo .more:focus-visible, .convo.menu-open .more { opacity: 1; }
@media (hover: none) { .convo .more { opacity: 1; } }
.convo input { flex: 1 1; margin: 4px 6px; padding: 5px 8px; font-size: 0.85rem; background: var(--bg); border: 1px solid var(--gold); border-radius: 6px; outline: none; }
.sidebar-footer { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); position: relative; }
.profile { display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: var(--r-md); font-size: 0.86rem; width: 100%; text-align: left; transition: background 0.15s; }
.profile:hover { background: var(--elev2); }
.profile .grow { flex: 1 1; min-width: 0; }
.profile .plan { font-size: 0.72rem; color: var(--dim); }
.sidebar-footer .menu { bottom: calc(100% - 4px); left: 0; right: 0; }

.main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; min-width: 0; }
.topbar { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 22px; flex-shrink: 0; }
.topbar .title { font-family: var(--font-disp); font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
@media (max-width: 820px) { .menu-btn { display: inline-flex; } .topbar { padding: 0 14px; } }
.scroll { flex: 1 1; overflow-y: auto; min-height: 0; }
.page { max-width: 820px; margin: 0 auto; padding: 8px 24px 64px; animation: rise-sm 0.4s var(--ease); }
.page-head h1 { font-size: 1.55rem; font-weight: 600; }
.page-head p { color: var(--dim); margin-top: 6px; font-size: 0.92rem; }
.page-head { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 12px; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 14px; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 14px; gap: 14px; }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .page { padding: 8px 16px 48px; } }

/* ---------- 5. Home / composer ---------- */
.home { flex: 1 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; min-height: 0; overflow-y: auto; }
.home-inner { width: 100%; max-width: 680px; text-align: center; opacity: 0; transform: translateY(10px); animation: rise 0.7s 0.1s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.mark { width: 44px; height: 44px; margin: 0 auto 22px; border-radius: 12px; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; }
.mark svg { width: 20px; height: 20px; color: #12111c; }
.home h1 { font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 600; line-height: 1.3; }
.home p.sub { margin-top: 10px; color: var(--dim); font-size: 1rem; }

.composer-shell { position: relative; margin-top: 32px; border-radius: var(--r-xl); }
.composer-shell::before {
  content: ""; position: absolute; inset: -1px; border-radius: var(--r-xl); padding: 1px;
  background: conic-gradient(from 180deg, rgba(201,168,118,.55), rgba(124,111,240,.55), rgba(201,168,118,.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.55; pointer-events: none;
}
.composer-shell.compact { margin-top: 0; }
.composer { position: relative; border-radius: var(--r-xl); background: var(--elev); box-shadow: 0 24px 60px var(--shadow); display: flex; flex-direction: column; padding: 10px 12px 10px 10px; text-align: left; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 0.98rem; line-height: 1.55; resize: none; max-height: 160px; padding: 8px 0; }
.composer textarea::placeholder { color: var(--dim); }
.send, .attach-btn { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send { background: var(--grad-gold); transition: transform 0.2s, opacity 0.2s; }
.send:hover:not(:disabled) { transform: scale(1.05); }
.send svg { width: 17px; height: 17px; color: var(--on-accent); }
.send.stop { background: var(--elev2); border: 1px solid var(--line); }
.send.stop svg { color: var(--text); }
.attach-btn { color: var(--dim); transition: background 0.2s, color 0.2s; }
.attach-btn svg { width: 19px; height: 19px; }
.attach-btn:hover, .attach-btn.open { background: var(--elev2); color: var(--gold2); }
.composer-shell.dragging::before { opacity: 1; }
.drop-overlay { position: absolute; inset: 0; z-index: 5; border-radius: var(--r-xl); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.92rem; font-weight: 500; color: var(--gold2); background: color-mix(in srgb, var(--elev) 88%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); border: 1.5px dashed var(--gold); pointer-events: none; animation: fade 0.15s; }

.attach-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 10px; }
.attach { position: relative; display: flex; align-items: center; gap: 9px; height: 52px; padding: 0 12px 0 8px; border-radius: 10px; background: var(--elev2); border: 1px solid var(--line); max-width: 200px; animation: pop 0.18s var(--ease); }
.attach.thumb { padding: 0; width: 52px; overflow: visible; }
.attach.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.attach-ic { width: 34px; height: 34px; border-radius: 8px; background: var(--elev); display: flex; align-items: center; justify-content: center; color: var(--gold2); flex-shrink: 0; }
.attach-meta { min-width: 0; display: flex; flex-direction: column; font-size: 0.78rem; line-height: 1.3; }
.attach-meta b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-meta small { color: var(--dim); font-size: 0.7rem; }
.attach-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; box-shadow: 0 2px 6px var(--shadow); }
.attach:hover .attach-x, .attach-x:focus-visible { opacity: 1; }
@media (hover: none) { .attach-x { opacity: 1; } }
.attach-menu { bottom: calc(100% + 8px); left: 0; min-width: 270px; text-align: left; }
.attach-menu .menu-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--elev2); display: flex; align-items: center; justify-content: center; color: var(--gold2); flex-shrink: 0; }
.attach-menu .menu-sub { font-size: 0.72rem; color: var(--dim); margin-top: 1px; }
.attach-menu button { padding: 7px 8px; }

.suggestions { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; gap: 10px; text-align: left; }
@media (max-width: 560px) { .suggestions { grid-template-columns: 1fr; } }
.sugg { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px 16px; background: var(--elev); transition: border-color 0.25s, transform 0.25s; text-align: left; }
.sugg:hover { border-color: var(--gold); transform: translateY(-2px); }
.sugg:active { transform: scale(0.99); }
.sugg .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--elev2); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.sugg .ic svg { width: 15px; height: 15px; color: var(--gold2); }
.sugg h3 { font-size: 0.9rem; font-weight: 600; }
.sugg p { margin-top: 4px; font-size: 0.8rem; color: var(--dim); line-height: 1.45; }
.hint { margin-top: 16px; text-align: center; font-size: 0.76rem; color: var(--dim); }

/* ---------- 6. Chat ---------- */
.chat-scroll { flex: 1 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.thread { max-width: 760px; margin: 0 auto; padding: 12px 24px 24px; display: flex; flex-direction: column; gap: 22px; }
.msg { display: flex; gap: 12px; animation: rise-sm 0.3s var(--ease); }
.msg.user { flex-direction: row-reverse; }
.msg .body { max-width: min(600px, 88%); min-width: 0; }
.msg.user .body { display: flex; flex-direction: column; align-items: flex-end; }
.bubble { padding: 11px 15px; border-radius: 16px; font-size: 0.94rem; line-height: 1.6; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--bubble-user); border: 1px solid var(--line); border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.ai .bubble { padding-left: 0; padding-top: 4px; }
.msg.ai .bubble p + p, .msg.ai .bubble ul, .msg.ai .bubble ol { margin-top: 8px; }
.msg.ai .bubble ul, .msg.ai .bubble ol { padding-left: 20px; }
.msg.ai .bubble li { margin: 3px 0; }
.msg.ai .bubble li::marker { color: var(--dim); }
.msg.ai .bubble h1, .msg.ai .bubble h2, .msg.ai .bubble h3 { font-weight: 600; line-height: 1.35; margin: 14px 0 6px; }
.msg.ai .bubble h1 { font-size: 1.15rem; } .msg.ai .bubble h2 { font-size: 1.07rem; } .msg.ai .bubble h3 { font-size: 1rem; }
.msg.ai .bubble > :first-child { margin-top: 0; }
.msg.ai .bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
  background: var(--elev2); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em; }
.msg.ai .bubble pre { background: var(--elev2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.msg.ai .bubble pre code { background: none; border: 0; padding: 0; font-size: .86em; line-height: 1.5; }
.msg.ai .bubble blockquote { margin: 8px 0; padding-left: 10px; border-left: 2px solid var(--line); color: var(--dim); }
.msg.ai .bubble hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.msg.ai .bubble a { color: var(--gold, currentColor); text-decoration: underline; text-underline-offset: 2px; }

/* Ẩn scrollbar mặc định (Windows hay nhấp nháy), vẫn cuộn bình thường */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
.msg.ai .bubble strong { font-weight: 600; color: var(--gold2); }
.msg.sending .bubble { opacity: 0.6; }
.msg.failed .bubble { border-color: var(--danger); }
.ai-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.ai-mark svg { width: 14px; height: 14px; color: #12111c; }
.msg-actions { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity 0.15s; }
.msg:hover .msg-actions, .msg-actions:focus-within, .msg.last .msg-actions { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.msg-status { font-size: 0.74rem; color: var(--dim); margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.msg-status .err { color: var(--danger); }
.msg-status button { color: var(--gold2); font-weight: 500; }
.typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.caret::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: var(--gold); animation: blink2 0.9s steps(1) infinite; }
@keyframes blink2 { 50% { opacity: 0; } }
.edit-box { width: 100%; min-width: min(480px, 80vw); }
.edit-box textarea { min-height: 70px; }
.edit-box .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.dock { padding: 8px 24px calc(18px + env(safe-area-inset-bottom, 0px)); }
.dock-inner { max-width: 760px; margin: 0 auto; }
.dock .hint { margin-top: 8px; }
.scroll-down { position: absolute; right: 24px; bottom: 120px; box-shadow: 0 8px 24px var(--shadow); background: var(--elev); border: 1px solid var(--line); }

/* ---------- 7. Settings-ish screens ---------- */
.plan-card { display: flex; flex-direction: column; position: relative; }
.plan-card.current { border-color: var(--gold); }
.plan-card .price { font-family: var(--font-disp); font-size: 1.8rem; font-weight: 600; margin-top: 10px; }
.plan-card .price small { font-size: 0.8rem; color: var(--dim); font-weight: 400; }
.plan-card ul { list-style: none; margin: 14px 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.83rem; color: var(--dim); flex: 1 1; }
.plan-card li::before { content: "✓"; color: var(--gold2); margin-right: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 0.92rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--gold2); font-size: 1.1rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--dim); font-size: 0.87rem; line-height: 1.6; }

/* auth */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-card .card { text-align: left; margin-top: 28px; padding: 24px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--dim); font-size: 0.75rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1 1; height: 1px; background: var(--line); }
.auth-divider span { padding: 0 2px; }
.auth-facebook { background: #1877f2; border-color: #1877f2; color: #fff; font-weight: 600; }
.auth-facebook:hover:not(:disabled) { background: #166fe5; border-color: #166fe5; }
.auth-facebook svg { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .home-inner { opacity: 1; transform: none; }
}

/* upgrade dialog */
.upgrade { text-align: center; max-width: 420px; }
.upgrade .up-ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-gold); color: var(--on-accent); }
.upgrade .up-ic svg { width: 24px; height: 24px; }
.upgrade p { color: var(--dim); font-size: 0.87rem; line-height: 1.55; margin-top: 8px; }
.upgrade .up-usage { margin-top: 16px; text-align: left; }
.upgrade .up-usage .top { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--dim); }
.upgrade .up-next { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: var(--r-md); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-size: 0.85rem; }
.upgrade .up-next b { font-family: var(--font-disp); font-size: 1rem; }
.upgrade .up-next small { display: block; color: var(--dim); margin-top: 2px; }
.upgrade .actions { justify-content: center; flex-wrap: wrap; }

/* ── VELA: nhân vật tung tăng trên cạnh trên ô nhập ───────────────────
   Đứng NGOÀI hộp, bàn chân đặt đúng đường viền trên (.mascot cao bằng nhân vật,
   đáy ghim vào bottom:100% của .composer-shell). Chỉ transform + left của một
   phần tử nhỏ nằm ngoài luồng, không ảnh hưởng layout xung quanh. */
.mascot {
  position: absolute; left: 14px; right: 14px; bottom: 100%; height: 39px;
  pointer-events: none; z-index: 3;
}

.mascot-walker {
  position: absolute; bottom: -4px; left: 0; width: 34px; height: 39px;
  animation: vela-wander 52s infinite;   /* thong thả; .excited rút xuống 22s */
}

/* Lang thang trên cạnh trên: chạy hụt, khựng lại ngó nghiêng, lùi vài bước
   rồi phóng đi. Mỗi chặng một kiểu tăng tốc riêng nên không ra nhịp đều. */
@keyframes vela-wander {
  0%   { left: 0; animation-timing-function: cubic-bezier(.25,.8,.35,1); }
  7%   { left: 14%; animation-timing-function: ease; }
  12%  { left: 14%; animation-timing-function: ease-in; }        /* đứng ngó quanh */
  17%  { left: 8%;  animation-timing-function: ease-out; }       /* lùi lại */
  23%  { left: 8%;  animation-timing-function: cubic-bezier(.16,.9,.3,1); }
  33%  { left: 42%; animation-timing-function: ease-in-out; }    /* phóng một mạch */
  38%  { left: 42%; animation-timing-function: ease-out; }
  45%  { left: 57%; animation-timing-function: cubic-bezier(.25,.7,.2,1); }
  50%  { left: 51%; animation-timing-function: ease-in-out; }    /* lùi lại ngó tiếp */
  58%  { left: calc(100% - 34px); animation-timing-function: ease-in-out; }
  64%  { left: calc(100% - 34px); animation-timing-function: cubic-bezier(.2,.85,.35,1); }
  72%  { left: 66%; animation-timing-function: ease-out; }
  77%  { left: 71%; animation-timing-function: cubic-bezier(.18,.9,.3,1); }
  86%  { left: 28%; animation-timing-function: ease; }
  91%  { left: 28%; animation-timing-function: ease-in-out; }    /* nghỉ lấy hơi */
  100% { left: 0; }
}

/* Quay mặt theo hướng đi; snap tức thì đúng lúc đổi chiều */
.mascot-face { animation: vela-face 52s steps(1, end) infinite; }
@keyframes vela-face {
  0%, 12% { transform: scaleX(1); }
  12.01%, 23% { transform: scaleX(-1); }
  23.01%, 45% { transform: scaleX(1); }
  45.01%, 50% { transform: scaleX(-1); }
  50.01%, 64% { transform: scaleX(1); }
  64.01%, 91% { transform: scaleX(-1); }
  91.01%, 100% { transform: scaleX(1); }
}

/* Nhảy: cao thấp lẫn lộn, xen một nhịp đứng thở. Chu kỳ lẻ so với đường đi
   nên hai lớp phải rất lâu mới trùng lại điểm xuất phát. */
.mascot-hop { animation: vela-hop 5.9s infinite; transform-origin: 50% 100%; pointer-events: auto; }
@keyframes vela-hop {
  0%   { transform: translateY(0) scale(1.06,.94) rotate(0deg); animation-timing-function: cubic-bezier(.2,.9,.4,1); }
  7%   { transform: translateY(-11px) scale(.94,1.06) rotate(-6deg); animation-timing-function: ease-in; }
  15%  { transform: translateY(0) scale(1.08,.92) rotate(0deg); animation-timing-function: cubic-bezier(.2,.9,.4,1); }
  22%  { transform: translateY(-6px) scale(.97,1.03) rotate(4deg); animation-timing-function: ease-in; }
  29%  { transform: translateY(0) scale(1.05,.95) rotate(0deg); animation-timing-function: cubic-bezier(.15,.95,.35,1); }
  38%  { transform: translateY(-17px) scale(.9,1.1) rotate(-9deg); animation-timing-function: ease-in; }   /* cú nhảy to */
  48%  { transform: translateY(0) scale(1.12,.88) rotate(0deg); animation-timing-function: ease-in-out; }
  57%  { transform: translateY(-2px) scale(1,1) rotate(2deg); animation-timing-function: ease-in-out; }    /* đứng thở */
  66%  { transform: translateY(0) scale(1.02,.98) rotate(-2deg); animation-timing-function: cubic-bezier(.2,.9,.4,1); }
  74%  { transform: translateY(-9px) scale(.95,1.05) rotate(5deg); animation-timing-function: ease-in; }
  82%  { transform: translateY(0) scale(1.07,.93) rotate(0deg); animation-timing-function: cubic-bezier(.2,.9,.4,1); }
  90%  { transform: translateY(-13px) scale(.93,1.07) rotate(-4deg); animation-timing-function: ease-in; }
  100% { transform: translateY(0) scale(1.06,.94) rotate(0deg); }
}

.mascot-svg { display: block; filter: drop-shadow(0 3px 6px var(--shadow)); }
.mascot-svg g, .mascot-svg ellipse, .mascot-svg rect { transform-box: fill-box; transform-origin: center; }

/* Chân bước tung tăng: nhấc cao, hất ra sau rồi đạp xuống, hai chân lệch pha */
.m-foot { animation: vela-step 1.18s ease-in-out infinite; }
.m-foot-r { animation-delay: .59s; }
@keyframes vela-step {
  0%   { transform: translate(0, 0) rotate(0deg) scaleX(1); }
  25%  { transform: translate(2px, -5px) rotate(-16deg) scaleX(.8); }   /* nhấc lên */
  50%  { transform: translate(3.5px, -2px) rotate(8deg) scaleX(.9); }   /* vươn tới */
  75%  { transform: translate(-1.5px, 0) rotate(4deg) scaleX(1.08); }   /* đạp xuống */
  100% { transform: translate(0, 0) rotate(0deg) scaleX(1); }
}

.m-arm { animation: vela-arm 1.57s ease-in-out infinite; transition: transform .26s cubic-bezier(.3,.8,.3,1); }
.m-arm-r { animation-delay: .41s; }
@keyframes vela-arm { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(18deg); } }

.m-antenna { animation: vela-antenna 2.1s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes vela-antenna { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }

.m-eyes { animation: vela-blink 5.1s infinite; transition: transform .2s ease; }
@keyframes vela-blink { 0%, 89%, 100% { transform: scaleY(1); } 92% { transform: scaleY(.12); } 96% { transform: scaleY(1); } 98% { transform: scaleY(.12); } }

.m-body { animation: vela-breathe 2.9s ease-in-out infinite; }
@keyframes vela-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }

.m-cheek { transition: opacity .26s ease; }

/* Rê chuột vào: đứng khựng, hai tay đưa lên che mặt, nhắm tịt, má ửng đỏ */
.mascot-hop:hover .m-arm { animation: none; }
.mascot-hop:hover .m-arm-l { transform: translate(6.5px, -5.5px) rotate(-62deg); }
.mascot-hop:hover .m-arm-r { transform: translate(-6.5px, -5.5px) rotate(62deg); }
.mascot-hop:hover .m-eyes { animation: none; transform: scaleY(.14); }
.mascot-hop:hover .m-cheek { opacity: .85; }
/* Dừng cả bước chân và đường đi khi bị nhìn (trình duyệt chưa có :has thì chỉ che mặt) */
.mascot-hop:hover .m-foot, .mascot-hop:hover .m-antenna { animation-play-state: paused; }
.mascot:has(.mascot-hop:hover) .mascot-walker,
.mascot:has(.mascot-hop:hover) .mascot-hop,
.mascot:has(.mascot-hop:hover) .mascot-face { animation-play-state: paused; }

/* AI đang trả lời: cùng chuyển động, chỉ chạy nhanh hơn — không cần keyframe riêng */
.mascot.excited .mascot-walker, .mascot.excited .mascot-face { animation-duration: 22s; }
.mascot.excited .mascot-hop { animation-duration: 2.6s; }
.mascot.excited .m-arm { animation-duration: .68s; }
.mascot.excited .m-foot { animation-duration: .5s; }
.mascot.excited .m-antenna { animation-duration: .9s; }

/* Tôn trọng người tắt hiệu ứng: đứng yên bên phải, chỉ còn chớp mắt (và vẫn biết bẽn lẽn) */
@media (prefers-reduced-motion: reduce) {
  .mascot-walker { animation: none; left: auto; right: 6px; }
  .mascot-face, .mascot-hop, .m-arm, .m-foot, .m-antenna, .m-body { animation: none; }
  .m-eyes { animation-duration: 9s; }
}

