.sidebar-toggle { display: inline-flex; }
.chat-sidebar { max-height: 45vh; overflow: auto; }
.message-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.message-actions button { font-size: .82rem; padding: .45rem .6rem; }
.markdown { overflow-wrap: anywhere; }
.markdown pre { overflow-x: auto; white-space: pre; }
.markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.markdown table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
.markdown td, .markdown th { border: 1px solid #879487; padding: .4rem .55rem; text-align: left; }
.markdown a.external::after { content: " (extern)"; font-size: .82em; }
.copy-code { float: right; margin: .2rem; }
.feedback-reasons { display: flex; flex-wrap: wrap; gap: .35rem; }
.chat-header { align-items: flex-start; }
.chat-header > div:first-child { min-width: 0; }
.chat-header h1 { overflow-wrap: anywhere; white-space: normal; }
.chat-sidebar #metadata-button { display: none; }
.conversation-row { align-items: center; display: grid; grid-template-columns: minmax(0, 1fr) auto; position: relative; }
.conversation-row .conversation { min-width: 0; }
.conversation-menu { position: relative; }
.conversation-menu summary { align-items: center; border-radius: .45rem; cursor: pointer; display: flex; font-weight: 700; height: 2.4rem; justify-content: center; list-style: none; width: 2.4rem; }
.conversation-menu summary::-webkit-details-marker { display: none; }
.conversation-menu summary:focus-visible { outline: 3px solid #e3aa3c; outline-offset: 2px; }
.conversation-menu-actions { background: #fff; border: 1px solid #b7c5b8; border-radius: .5rem; box-shadow: 0 .5rem 1rem #22302026; display: grid; gap: .35rem; padding: .35rem; position: absolute; right: 0; top: calc(100% + .2rem); width: max-content; z-index: 2; }
.conversation-menu-actions button { text-align: left; }
@media (max-width: 63.99rem) {
  main { margin: 0; width: 100%; }
  .chat-header { align-items: start; display: block; padding: calc(env(safe-area-inset-top) + .45rem) .75rem .45rem 3.35rem; }
  .chat-header > div { min-width: 0; }
  .chat-header h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-header .hint, .context-usage { font-size: .8rem; line-height: 1.3; }
  .sidebar-toggle { align-items: center; display: inline-flex; height: 2.15rem; justify-content: center; left: calc(env(safe-area-inset-left) + .45rem); padding: 0; position: fixed; top: calc(env(safe-area-inset-top) + .45rem); width: 2.15rem; z-index: 4; }
  .sidebar-toggle::before { content: "\2630"; font-size: 1.1rem; line-height: 1; }
  .chat-sidebar { box-shadow: .5rem 0 1.5rem #22302026; height: 100dvh; left: 0; max-height: none; overflow-y: auto; position: fixed; top: 0; transform: translateX(-105%); transition: transform .2s ease; width: min(20rem, 82vw); z-index: 3; }
  .chat-layout.sidebar-open .chat-sidebar { transform: translateX(0); }
  .sidebar-backdrop { background: #17221866; border: 0; inset: 0; opacity: 0; padding: 0; pointer-events: none; position: fixed; transition: opacity .2s ease; z-index: 2; }
  .chat-layout.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .chat-sidebar .brand { gap: .4rem; }
  .chat-sidebar #new-chat, .chat-sidebar .chat-nav button, .chat-sidebar > .actions button { font-size: .84rem; padding: .45rem .6rem; }
  .chat-sidebar .chat-nav { gap: .35rem; }
  .messages { min-height: 45vh; padding: .55rem .75rem .75rem; }
  .conversation-menu-actions { max-width: min(18rem, calc(100vw - 2rem)); }
}
@media (min-width: 64rem) {
  .sidebar-toggle { display: none; }
  .sidebar-backdrop { display: none !important; }
  .chat-sidebar { display: block !important; max-height: none; }
}
