@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .header-bar {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    height: 50px;
    padding: 0 10px;
  }

  .mobile-sidebar-btn {
    justify-self: start;
  }

  .header-model-picker {
    justify-self: start;
    min-width: 0;
    max-width: 44vw;
  }

  .header-model-picker .model-picker-btn {
    height: 32px;
    max-width: 100%;
    padding: 0 2px;
    font-size: 0.94rem !important;
    font-weight: 385 !important;
    overflow: hidden;
  }

  .header-model-picker #selectedModelLabel {
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-model-picker .model-picker-menu {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    bottom: auto;
    width: min(272px, calc(100vw - 20px)) !important;
    min-width: min(272px, calc(100vw - 20px)) !important;
    max-width: min(272px, calc(100vw - 20px)) !important;
    max-height: min(420px, calc(100dvh - 78px));
    transform-origin: top left;
  }

  .header-model-picker .model-picker-wrap.menu-up .model-picker-menu {
    top: calc(100% + 8px);
    bottom: auto;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top left;
  }

  .header-model-picker .model-picker-wrap.menu-up .model-picker-menu.show {
    transform: translateY(0) scale(1);
  }

  .header-actions {
    justify-self: end;
    flex: 0 0 auto;
    gap: 6px;
  }

  #auth-section {
    gap: 6px;
  }

  #auth-section .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  #auth-section .btn-primary {
    display: none;
  }

  .input-region {
    left: 0;
    right: 0;
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    align-items: center !important;
  }

  body.composer-centered .input-region {
    top: calc(64% - 10px);
  }

  .composer {
    width: min(366px, calc(100vw - 24px)) !important;
    max-width: min(366px, calc(100vw - 24px)) !important;
    min-height: 50px;
    max-height: none;
    border-radius: 25px;
    overflow: visible;
  }

  body.composer-centered:not(.chat-has-user-turn) .composer {
    height: 50px !important;
    max-height: 50px !important;
  }

  .composer-body {
    min-height: 50px;
    padding: 0 10px;
  }

  body.composer-centered:not(.chat-has-user-turn) .composer-body {
    height: 50px;
    min-height: 50px;
  }

  #userInput {
    height: 34px !important;
    min-height: 34px;
    max-height: 118px;
    padding: 6px 128px 6px 36px !important;
    font-size: 0.9rem;
    line-height: 22px;
  }

  body.composer-centered:not(.chat-has-user-turn) #userInput {
    max-height: 36px;
    overflow: hidden;
  }

  .composer-right-actions {
    right: 9px;
    gap: 6px;
    max-width: 126px;
  }

  .mic-btn {
    width: 30px !important;
    height: 30px !important;
  }

  #sendBtn,
  #sendBtn.record-idle,
  #sendBtn.ready,
  #sendBtn.streaming {
    height: 32px !important;
  }

  #sendBtn.record-idle {
    width: 86px !important;
    height: 32px !important;
    padding: 0 12px 0 10px;
    border-radius: 16px !important;
    gap: 6px;
  }

  #sendBtn.ready,
  #sendBtn.streaming {
    width: 32px !important;
  }

  body.guest-auth-shell .history-label,
  body.guest-auth-shell .sidebar-history-scroll {
    display: none !important;
  }

  .sidebar-login-box {
    margin: 0;
    padding: 18px 20px 16px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    gap: 14px;
  }

  .sidebar-login-copy {
    gap: 8px;
    font-size: 0.95rem;
    line-height: 1.25;
    color: #8a8f98;
  }

  .sidebar-login-copy .emphasis {
    font-size: 1rem;
    font-weight: 650;
    color: #050505;
  }

  .sidebar-login-actions {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .sidebar-auth-slot.guest-auth-slot .sidebar-login-actions .sidebar-login-btn,
  .sidebar-auth-slot.guest-auth-slot .sidebar-signup-btn {
    width: 100% !important;
    min-width: 0;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 0.94rem;
    font-weight: 560;
    border: 1px solid #d9d9d9;
    cursor: pointer;
  }

  .sidebar-auth-slot.guest-auth-slot .sidebar-login-actions .sidebar-login-btn {
    background: #ffffff;
    color: #050505;
  }

  .sidebar-auth-slot.guest-auth-slot .sidebar-signup-btn {
    display: none !important;
    min-width: 0;
    background: #ffffff;
    color: #050505;
  }

  body.guest-auth-shell #sendBtn.record-idle {
    width: 84px !important;
  }

  body.member-auth-shell .composer {
    min-height: 50px;
  }

  body.member-auth-shell .composer-body {
    min-height: 50px;
  }

  body.member-auth-shell #userInput {
    padding-right: 178px !important;
  }

  body.member-auth-shell #sendBtn.record-idle {
    width: 34px !important;
    height: 34px !important;
  }

  .workspace-sheet-panel {
    width: min(392px, calc(100vw - 24px));
  }

  .workspace-welcome-back-panel {
    display: grid;
    gap: 14px;
  }

  .workspace-welcome-back-panel[hidden] {
    display: none;
  }

  .workspace-welcome-back-panel h3 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    font-weight: 380;
    letter-spacing: 0;
  }

  .workspace-welcome-back-panel p {
    margin: 0 0 20px;
    text-align: center;
    font-size: 1rem;
    color: #1d1d1f;
  }

  .workspace-remembered-account,
  .workspace-auth-choice-btn {
    width: 100%;
    min-height: 58px;
    border: 1px solid #dedede;
    border-radius: 24px;
    background: #ffffff;
    color: #111111;
  }

  .workspace-remembered-account {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 28px;
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    text-align: left;
  }

  .workspace-remembered-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #b99652;
    color: #ffffff;
    font-size: 1.05rem;
  }

  .workspace-remembered-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  .workspace-remembered-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.96rem;
    font-weight: 540;
  }

  .workspace-remembered-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666666;
    font-size: 0.86rem;
  }

  .workspace-remembered-remove {
    display: grid;
    place-items: center;
    color: #111111;
  }

  .workspace-remembered-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    color: #111111;
    font-weight: 650;
  }

  .workspace-remembered-divider::before,
  .workspace-remembered-divider::after {
    content: "";
    height: 1px;
    background: #dddddd;
  }

  .workspace-auth-choice-btn {
    min-height: 52px;
    font-size: 0.94rem;
    font-weight: 560;
  }
}
