
    :root {
      --sec: #d4a843;
      --sec2: #b7153a;
      --bg: #0a0a0f;
      --txt: #f5e6d0;
      --muted: #8888aa;
      --border: rgba(212, 168, 67, 0.18);
      --rad: 14px;
      --glass-bg: rgba(20, 20, 25, 0.6);
      --glass-border: rgba(255, 255, 255, 0.1);
    }
    
    * { box-sizing: border-box; margin: 0; padding: 0; }
    
    body {
      background: #000;
      color: var(--txt);
      font-family: 'Inter', sans-serif;
      overflow: hidden;
      width: 100vw;
      height: 100vh;
      position: relative;
    }
    
    .tv {
      width: 1080px;
      height: 1920px;
      position: absolute;
      left: 50%;
      top: 0;
      transform-origin: top center;
      background: var(--bg);
      overflow: hidden;
      box-shadow: 0 0 50px rgba(0,0,0,0.5);
    }
    
    /* Background */
    .char-bg {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    #char-placeholder {
      font-size: 120px;
      opacity: 0.15;
      z-index: 1;
    }
    
    #char-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      z-index: 2;
    }
    
    #char-video, #char-video-b {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: opacity 0.6s ease;
      z-index: 3;
    }
    
    .char-bg__overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 30%, transparent 80%, rgba(0,0,0,0.4) 100%);
      z-index: 4;
      pointer-events: none;
    }
    
    /* Top Bar */
    .top-bar {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      padding: 60px 40px;
      z-index: 10;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      pointer-events: none;
    }
    
    .top-bar__left {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    
    #char-name {
      font-family: 'Playfair Display', serif;
      font-size: 36px;
      font-weight: 700;
      text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }
    
    .status-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    
    #status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--muted);
    }
    
    #status-dot.live {
      background: #4ade80;
      box-shadow: 0 0 10px #4ade80;
      animation: pulse-dot 1.5s infinite;
    }
    
    #status-text {
      font-size: 18px;
      font-weight: 500;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 1px;
    }
    
    #config-select {
      pointer-events: auto;
      background: var(--glass-bg);
      border: 1px solid var(--border);
      color: var(--txt);
      padding: 12px 24px;
      border-radius: 30px;
      font-size: 18px;
      font-family: 'Inter', sans-serif;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      outline: none;
      appearance: none;
      cursor: pointer;
    }
    
    /* Pose Tag */
    .pose-tag {
      position: absolute;
      top: 100px;
      right: 40px;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 14px;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      z-index: 10;
      text-transform: uppercase;
      letter-spacing: 1px;
    }
    
    /* PiP Camera */
    .pip-camera {
      position: absolute;
      top: 100px;
      left: 40px;
      width: 200px;
      height: 260px;
      border-radius: 16px;
      border: 2px solid rgba(255,255,255,0.15);
      background: #000;
      overflow: hidden;
      z-index: 15;
      box-shadow: 0 10px 30px rgba(0,0,0,0.5);
      touch-action: none;
    }
    
    .pip-camera__header {
      position: absolute;
      top: 0; left: 0; right: 0;
      padding: 8px 12px;
      background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
      display: flex;
      justify-content: space-between;
      align-items: center;
      z-index: 2;
    }
    
    .pip-camera__close {
      background: none;
      border: none;
      color: white;
      font-size: 20px;
      cursor: pointer;
    }
    
    #user-video {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    /* Subtitle */
    .subtitle {
      position: absolute;
      bottom: 300px;
      left: 60px;
      right: 60px;
      text-align: center;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.3s ease;
      z-index: 10;
      display: flex;
      justify-content: center;
    }
    
    .subtitle.visible {
      opacity: 1;
    }
    
    .subtitle__text {
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      padding: 20px 40px;
      border-radius: 24px;
      font-size: 28px;
      line-height: 1.4;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      max-height: 200px;
      overflow: hidden;
      display: inline-block;
      text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }
    
    /* Bottom Panel */
    .bottom-panel {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      padding: 0 40px 48px;
      z-index: 10;
    }
    
    .ctrl-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 20px;
      margin-bottom: 24px;
    }
    
    .ctrl-btn {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      color: white;
      font-size: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      transition: all 0.2s ease;
    }
    
    .ctrl-btn:hover {
      background: rgba(40, 40, 50, 0.8);
      transform: scale(1.05);
    }
    
    .ctrl-btn.active {
      background: rgba(212, 168, 67, 0.2);
      border-color: var(--sec);
      box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
    }
    
    .ctrl-btn--connect {
      width: auto;
      padding: 0 40px;
      height: 80px;
      border-radius: 40px;
      background: linear-gradient(135deg, var(--sec2), var(--sec));
      border: none;
      color: white;
      font-family: 'Playfair Display', serif;
      font-size: 24px;
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 10px 20px rgba(183, 21, 58, 0.3);
      transition: transform 0.2s;
    }
    
    .ctrl-btn--connect:hover {
      transform: translateY(-2px);
    }
    
    .ctrl-btn--end {
      width: auto;
      padding: 0 40px;
      height: 80px;
      border-radius: 40px;
      background: crimson;
      border: none;
      color: white;
      font-size: 24px;
      font-weight: 600;
      cursor: pointer;
      display: none;
      align-items: center;
      justify-content: center;
      line-height: 1;
      box-shadow: 0 10px 20px rgba(220, 20, 60, 0.3);
    }
    
    .text-row {
      display: flex;
      gap: 12px;
    }
    
    #text-input {
      flex: 1;
      height: 68px;
      border-radius: 34px;
      background: var(--glass-bg);
      border: 1px solid var(--border);
      padding: 0 30px;
      font-size: 22px;
      color: var(--txt);
      font-family: 'Inter', sans-serif;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      outline: none;
    }
    
    #text-input::placeholder {
      color: var(--muted);
    }
    
    #btn-send {
      width: 68px;
      height: 68px;
      border-radius: 50%;
      background: var(--sec);
      border: none;
      color: #000;
      font-size: 24px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    /* Transcript Panel */
    .transcript-panel {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 600px;
      background: rgba(10, 10, 15, 0.85);
      border-top: 1px solid var(--border);
      border-radius: 30px 30px 0 0;
      z-index: 20;
      transform: translateY(100%);
      transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      display: flex;
      flex-direction: column;
      padding: 20px 40px 40px;
    }
    
    .transcript-panel.open {
      transform: translateY(0);
    }
    
    .transcript-panel__handle {
      width: 60px;
      height: 6px;
      background: var(--muted);
      border-radius: 3px;
      margin: 0 auto 20px;
      opacity: 0.5;
    }
    
    .transcript-panel__title {
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 20px;
      color: var(--sec);
    }
    
    #transcript-scroll {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 16px;
      padding-right: 10px;
    }
    
    .t-entry {
      display: flex;
      gap: 16px;
      animation: fadeIn 0.3s ease-out forwards;
    }
    
    .t-entry__icon {
      font-size: 32px;
    }
    
    .t-entry__body {
      flex: 1;
      background: rgba(255,255,255,0.05);
      padding: 16px 20px;
      border-radius: 16px;
    }
    
    .t-entry--user .t-entry__body {
      background: rgba(212, 168, 67, 0.1);
      border: 1px solid rgba(212, 168, 67, 0.2);
    }
    
    .t-entry__name {
      font-size: 14px;
      color: var(--muted);
      margin-bottom: 4px;
      font-weight: 500;
    }
    
    .t-entry__text {
      font-size: 20px;
      line-height: 1.5;
    }
    
    /* Debug Panel */
    .debug-toggle {
      position: fixed;
      top: 10px;
      right: 10px;
      z-index: 101;
      background: rgba(0,0,0,0.5);
      border: 1px solid #333;
      color: white;
      padding: 8px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 20px;
    }
    
    .debug-panel {
      position: fixed;
      top: 0;
      right: -360px;
      width: 360px;
      height: 100vh;
      background: rgba(13, 17, 23, 0.95);
      border-left: 1px solid #30363d;
      z-index: 100;
      transition: right 0.3s;
      font-family: 'Consolas', 'Courier New', monospace;
      font-size: 12px;
      display: flex;
      flex-direction: column;
      color: #c9d1d9;
    }
    
    .debug-panel.open {
      right: 0;
    }
    
    .debug-panel__header {
      padding: 12px;
      border-bottom: 1px solid #30363d;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: bold;
    }
    
    .debug-panel__header button {
      background: #21262d;
      border: 1px solid #363b42;
      color: #c9d1d9;
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
    }
    
    #debug-stats {
      padding: 8px 12px;
      background: #0d1117;
      border-bottom: 1px solid #30363d;
      display: flex;
      justify-content: space-between;
    }
    
    #debug-scroll {
      flex: 1;
      overflow-y: auto;
      padding: 12px;
    }
    
    .debug-entry { margin-bottom: 4px; word-break: break-all; }
    .de-time { color: #8b949e; margin-right: 8px; }
    .debug-entry.de-pose { color: #3fb950; }
    .debug-entry.de-tool { color: #f0883e; }
    .debug-entry.de-conn { color: #58a6ff; }
    .debug-entry.de-audio { color: #bc8cff; }
    .debug-entry.de-system { color: #8b949e; }
    .debug-entry.de-error { color: #f85149; }
    
    /* Animations & Scrollbar */
    @keyframes pulse-dot {
      0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
      70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
      100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
    }
    
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    ::-webkit-scrollbar { width: 3px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--sec); border-radius: 3px; }
    
    .vol-ring.speaking {
      border: 2px solid var(--sec);
      box-shadow: 0 0 15px rgba(212, 168, 67, 0.5);
    }
  
    /* ================= Brand tokens (Hộp Trân Bảo / BTMH 2026) ================= */
    :root {
      --brand: #A31D1D;
      --brand-deep: #680E0E;
      --gold: #E8C872;
      --gold-light: #F5E0A3;
      --gold-dark: #B89332;
      --warm-white: #FDFBF7;
      --charcoal: #1E2022;
    }
    .char-bg { z-index: 1; }

    /* ================= Overlay stage: glass widgets over the video ================= */
    #overlay-root { position: absolute; inset: 0; z-index: 6; pointer-events: none; transition: opacity .4s ease; }
    #overlay-root.lc-dim .lc-widget { opacity: .45; }
    .lc-widget {
      position: absolute; pointer-events: auto;
      padding: 26px 30px 20px; border-radius: 28px;
      background: linear-gradient(145deg, rgba(30, 32, 34, 0.55), rgba(104, 14, 14, 0.35));
      border: 1.5px solid rgba(232, 200, 114, 0.55);
      box-shadow: 0 0 0 1px rgba(245, 224, 163, 0.08) inset, 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(232, 200, 114, 0.18);
      backdrop-filter: blur(18px) saturate(140%);
      -webkit-backdrop-filter: blur(18px) saturate(140%);
      color: var(--warm-white);
      font-family: 'Montserrat', 'Inter', sans-serif;
      transition: opacity .4s ease, transform .4s ease;
    }
    .lc-pulse { box-shadow: 0 0 0 2px var(--gold), 0 0 60px rgba(232, 200, 114, .55); }
    @keyframes lc-summon {
      0% { opacity: 0; transform: scale(.15) translateY(120px); filter: blur(12px); }
      60% { opacity: 1; filter: blur(0); }
      100% { transform: scale(1) translateY(0); }
    }
    @keyframes lc-fade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
    .lc-w-title { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 700; color: var(--gold-light); margin-bottom: 10px; }
    .lc-w-value { font-size: 64px; font-weight: 800; letter-spacing: -1px; line-height: 1.1;
      background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
    .lc-size-s .lc-w-value { font-size: 52px; }
    .lc-w-unit { font-size: 24px; font-weight: 600; color: var(--gold-light); -webkit-text-fill-color: var(--gold-light); }
    .lc-w-label { font-size: 22px; color: rgba(253, 251, 247, .85); margin-top: 6px; }
    .lc-w-sub { font-size: 20px; color: rgba(253, 251, 247, .75); margin-top: 8px; }
    .lc-w-chart { width: 100%; height: 160px; }
    .lc-w-line { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2000; animation: lc-draw 2.2s ease forwards; }
    @keyframes lc-draw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
    .lc-w-table { width: 100%; border-collapse: collapse; font-size: 24px; }
    .lc-w-table th { text-align: left; color: var(--gold-light); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid rgba(232,200,114,.4); }
    .lc-w-table td { padding: 8px 4px; border-bottom: 1px solid rgba(253,251,247,.08); }
    .lc-w-days { display: flex; gap: 12px; margin-top: 12px; }
    .lc-w-day { flex: 1; display: flex; flex-direction: column; font-size: 18px; background: rgba(253,251,247,.06); border-radius: 14px; padding: 8px 10px; }
    .lc-w-text { font-size: 26px; line-height: 1.4; }
    .lc-w-url { margin-top: 12px; font-size: 20px; color: var(--gold-light); }
    .lc-w-foot { margin-top: 12px; font-size: 15px; color: rgba(253,251,247,.55); }
    .lc-w-demo { color: #ffb4a2; font-weight: 700; }
    .lc-ticker { position: absolute; left: 0; right: 0; bottom: 250px; height: 46px; overflow: hidden; pointer-events: none;
      background: linear-gradient(90deg, rgba(163,29,29,.85), rgba(104,14,14,.85)); border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
    .lc-ticker-track { white-space: nowrap; font-size: 24px; line-height: 46px; color: var(--warm-white); animation: lc-ticker 28s linear infinite; padding-left: 100%; }
    @keyframes lc-ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }

    /* ================= CTA, banner, modes ================= */
    .cta { position: absolute; left: 50%; bottom: 330px; transform: translateX(-50%); z-index: 9; padding: 22px 48px; border-radius: 48px;
      font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; color: var(--charcoal); cursor: pointer; border: none;
      background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark)); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
    .cta.hidden { display: none; }
    .cta.pulse { animation: cta-pulse 1.6s ease-in-out infinite; }
    @keyframes cta-pulse { 50% { transform: translateX(-50%) scale(1.07); box-shadow: 0 0 60px rgba(232,200,114,.7); } }
    .banner { display: none; position: absolute; top: 220px; left: 60px; right: 60px; z-index: 30; padding: 18px 26px; border-radius: 18px; font-size: 22px; }
    .banner.error { background: rgba(163, 29, 29, .9); color: #fff; }
    .banner.warn { background: rgba(232, 200, 114, .92); color: var(--charcoal); }
    .ctrl-btn--connect { background: linear-gradient(135deg, var(--brand), var(--gold-dark)); }
    body.mode-kiosk .debug-toggle, body.mode-kiosk #config-select, body.mode-kiosk:not(.chat-open) .text-row { display: none; }
    .ctrl-btn.off { opacity: .45; text-decoration: line-through; }
    #char-video, #char-video-b { z-index: 3; }
