  html { scroll-behavior: smooth; }
  button, .chip, .mode, select, summary, label[for] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  button:focus-visible, .chip:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* Chuyển màu, viền, đổ bóng mềm cho mọi điều khiển */
  body, .top, .side, .work, .stage, .fpanel, .empty, .combolist, textarea, input, select, button, .chip, .ghost, .primary, .mode {
    transition: background-color 0.25s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.22s ease, transform 0.16s ease, opacity 0.2s ease;
  }
  .primary:hover:not(:disabled), .ghost:hover:not(:disabled), .chip:hover:not(:disabled) { transform: translateY(-1px); }
  .primary:hover:not(:disabled) { box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
  .primary:active:not(:disabled), .ghost:active:not(:disabled), .chip:active:not(:disabled) { transform: translateY(0) scale(0.98); }
  textarea:focus, input:focus, select:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

  /* Ô nhập tự giãn theo nội dung (trình duyệt nào chưa hỗ trợ thì giữ nguyên) */
  #prompt { field-sizing: content; max-height: 45vh; }

  /* Đổi tab: khung làm việc và các tuỳ chọn hiện dần thay vì nhảy cục */
  @keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes textSwap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  #videoPane:not([hidden]), #filmPane:not([hidden]), #chatPane:not([hidden]), #imagePane:not([hidden]), #codePane:not([hidden]),
  #chatOpts:not([hidden]), #imageOpts:not([hidden]), #codeOpts:not([hidden]), #videoOpts:not([hidden]), #vstyleBox:not([hidden]),
  .empty:not([hidden]), #codeView:not([hidden]), .toolbar:not([hidden]), details[open] > pre { animation: paneIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .combolist:not([hidden]) { animation: paneIn 0.16s ease both; }
  #heading.swap, #lead.swap, #promptLabel.swap { animation: textSwap 0.28s ease both; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    #videoPane, #filmPane, #chatPane, #imagePane, #codePane, #chatOpts, #imageOpts, #codeOpts, #videoOpts, #vstyleBox, .empty, #codeView, .toolbar, details > pre, .combolist,
    #heading, #lead, #promptLabel { animation: none !important; }
    .primary, .ghost, .chip { transition-duration: 0.01ms; }
    .primary:hover:not(:disabled), .ghost:hover:not(:disabled), .chip:hover:not(:disabled) { transform: none; }
  }
