/* Keep Safari's nested flex/grid scrollers inside the visible browser viewport. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: auto;
  grid-template-columns: 280px minmax(0, 1fr);
}

aside {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.side-top,
.new-chat,
.history-label,
.user-panel {
  flex: 0 0 auto;
}

#chat-list {
  min-height: 0;
  flex: 1 1 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.user-panel {
  position: relative;
  z-index: 1;
}

main {
  height: 100%;
}

.conversation {
  -webkit-overflow-scrolling: touch;
}

.message.assistant .assistant-response {
  min-width: 0;
  border: 2px solid rgba(45, 102, 216, .55);
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(45, 102, 216, .035);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.message.assistant.codex-supervising .assistant-response {
  border-color: #d93025;
  background: rgba(217, 48, 37, .055);
  animation: codex-correction-flash .9s ease-in-out infinite;
}

.codex-supervision {
  display: flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid rgba(217, 48, 37, .65);
  border-radius: 8px;
  color: #a51f18;
  background: #fff4f3;
  font-size: 12px;
  font-weight: 700;
}

.codex-supervision span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #d93025;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, .13);
}

@keyframes codex-correction-flash {
  50% { border-color: #ff6b60; box-shadow: 0 0 0 4px rgba(217, 48, 37, .15), 0 0 18px rgba(217, 48, 37, .18); }
}

@media (prefers-reduced-motion: reduce) {
  .message.assistant.codex-supervising .assistant-response { animation: none; }
}

footer {
  position: relative;
  z-index: 2;
  min-height: 0;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
}
