/* ===== COPILOT PAGE ===== */
.copilot-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.copilot-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.copilot-page {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: linear-gradient(153deg, #f8f4f2 0%, #fcf3ea 50%, #fdedde 100%);
  border-radius: 32px 32px 0 0;
  font-family: var(--font-ui-sans);
  box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 -8px 16px rgba(0,0,0,0.14);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2,0.9,0.3,1), opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.copilot-page.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.copilot-page.half-mode {
  left: 8px;
  right: 8px;
  bottom: 8px;
  border-radius: 32px;
}
.copilot-page.dragging {
  transition: none !important;
}
.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  flex-shrink: 0;
  position: relative;
}
.copilot-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 1;
}
.copilot-header-btn {
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
.copilot-header-btn:active {
  opacity: 0.6;
}
.copilot-header-btn svg {
  width: 24px;
  height: 24px;
}
.copilot-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}
.copilot-header-center svg {
  height: 20px;
  width: auto;
}
.copilot-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.copilot-user-bubble {
  align-self: flex-end;
  background: #FDE5CD;
  border-radius: 24px;
  padding: 16px 20px;
  margin: 0 24px;
  font-size: 15px;
  color: #282523;
  line-height: 1.4;
  max-width: 80%;
}
.copilot-ai-card {
  padding: 0;
  margin: 0 20px;
  font-size: 15px;
  color: #33302E;
  line-height: 1.55;
}
.copilot-ai-card > *:first-child { margin-top: 0; }
.copilot-ai-card > *:last-child { margin-bottom: 0; }
.copilot-ai-card p { margin: 0 0 10px; }
.copilot-ai-card h1,
.copilot-ai-card h2,
.copilot-ai-card h3,
.copilot-ai-card h4 {
  margin: 14px 0 6px;
  font-weight: 600;
  line-height: 1.3;
  color: #201c19;
}
.copilot-ai-card h1 { font-size: 18px; }
.copilot-ai-card h2 { font-size: 17px; }
.copilot-ai-card h3 { font-size: 16px; }
.copilot-ai-card h4 { font-size: 15px; }
.copilot-ai-card ul,
.copilot-ai-card ol {
  margin: 4px 0 10px;
  padding-left: 22px;
}
.copilot-ai-card li { margin: 3px 0; }
.copilot-ai-card li > ul,
.copilot-ai-card li > ol { margin: 2px 0 0; }
.copilot-ai-card strong { font-weight: 600; color: #201c19; }
.copilot-ai-card em { font-style: italic; }
.copilot-ai-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: rgba(120, 100, 80, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}
.copilot-ai-card pre {
  margin: 8px 0;
  padding: 10px 12px;
  background: #f6f1ec;
  border-radius: 10px;
  overflow-x: auto;
}
.copilot-ai-card pre code {
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #2b2622;
}
.copilot-ai-card blockquote {
  margin: 6px 0;
  padding: 2px 12px;
  border-left: 3px solid #e5d8ca;
  color: #5a5248;
}
.copilot-ai-card a {
  color: #b35c1e;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.copilot-ai-card hr {
  border: none;
  border-top: 1px solid #ece3d9;
  margin: 12px 0;
}
.copilot-input-wrap {
  margin: 0 18px 8px;
  background: #fff;
  border-radius: 26px;
  box-shadow: 4px 4px 16px 2px rgba(48,43,37,0.1);
  flex-shrink: 0;
}
.copilot-input-row {
  border-radius: 32px;
  padding: 8px;
  display: flex;
  align-items: center;
}
.copilot-input-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.copilot-input-btn:active {
  opacity: 0.6;
}
.copilot-input-btn svg {
  width: 24px;
  height: 24px;
}
.copilot-input-row .copilot-input-btn:last-child svg {
  width: 19px;
  height: 19px;
}
.copilot-input-field {
  flex: 1;
  padding: 4px 8px;
  font-size: 16px;
  color: #635C57;
  opacity: 0.9;
}
.copilot-input-expanded {
  display: none;
  padding: 0;
}
.copilot-page.composer-active .copilot-input-row {
  display: none;
}
.copilot-page.composer-active .copilot-input-expanded {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.copilot-input-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 17px;
  color: #272320;
  resize: none;
  min-height: 28px;
  max-height: 80px;
  padding: 14px 16px;
  outline: none;
  font-family: inherit;
  line-height: 1.294em;
  letter-spacing: -0.025em;
  box-sizing: border-box;
}
.copilot-input-textarea::placeholder {
  color: #635C57;
  opacity: 0.9;
}
.copilot-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 8px 12px;
}
.copilot-controls-left,
.copilot-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.copilot-controls-right-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.copilot-smart-tag {
  background: #fff;
  border: 0.5px solid #efeae7;
  border-radius: 9999px;
  padding: 0 12px;
  height: 36px;
  font-size: 12px;
  font-weight: 480;
  color: #272320;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.copilot-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0.5px solid #efeae7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
}
.copilot-add-btn:active {
  opacity: 0.6;
}
.copilot-smart-tag:active {
  opacity: 0.6;
}
.copilot-send-btn {
  width: 36px;
  height: 36px;
  background: #322d29;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.copilot-send-btn:active {
  opacity: 0.8;
}
.copilot-send-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.copilot-tool-chip {
  align-self: flex-start;
  margin: 2px 20px;
  padding: 6px 12px;
  background: rgba(253, 229, 205, 0.4);
  border: 0.5px solid #efe2d3;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #5e554d;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copilot-tool-chip .copilot-tool-name {
  font-weight: 500;
  color: #3a332d;
}
.copilot-tool-chip .copilot-tool-args {
  opacity: 0.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.copilot-tool-chip .copilot-tool-status {
  margin-left: auto;
  padding-left: 4px;
}
.copilot-tool-chip.running .copilot-tool-status {
  color: #8a7f74;
}
.copilot-tool-chip.ok .copilot-tool-status { color: #3a7a3a; }
.copilot-tool-chip.err {
  background: rgba(255, 220, 220, 0.5);
  border-color: #ffcaca;
}
.copilot-tool-chip.err .copilot-tool-status { color: #a33; }
.copilot-keyboard {
  display: none;
  flex-shrink: 0;
}
.copilot-keyboard img {
  width: 100%;
  display: block;
}
.copilot-page.composer-active .copilot-keyboard {
  display: block;
}
.copilot-page.composer-active .copilot-input-wrap {
  margin: 0 8px 8px;
  padding: 6px;
  border-radius: 32px;
  border: 0.5px solid #e2ddd9;
  box-shadow: 4px 4px 16px 2px rgba(48,43,37,0.1);
}
.copilot-page.composer-active .home-indicator {
  display: none;
}
.copilot-suggestions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 0 18px 12px;
  flex-shrink: 0;
}
.copilot-chip {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 400;
  color: #635c57;
  line-height: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.copilot-chip:active {
  opacity: 0.6;
}
.copilot-chip.skeleton {
  color: transparent;
  background: linear-gradient(90deg, #f3ece5 0%, #faf5ef 50%, #f3ece5 100%);
  background-size: 200% 100%;
  animation: copilot-chip-shimmer 1.4s ease-in-out infinite;
  border-color: rgba(0,0,0,0.04);
  pointer-events: none;
  user-select: none;
}
@keyframes copilot-chip-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Search Instead Button (inside header, next to menu btn) === */
#searchInsteadBar {
  display: none;
  align-items: center;
}
#searchInsteadBar.visible {
  display: flex;
}
.search-instead-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #322D29;
  border: none;
  border-radius: 16px;
  padding: 4px 8px 4px 4px;
  height: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: padding 0.3s ease, gap 0.3s ease, width 0.3s ease, border-radius 0.3s ease;
  overflow: hidden;
  box-sizing: border-box;
}
.search-instead-btn:active {
  opacity: 0.7;
}
.search-instead-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.search-instead-btn span {
  font-size: 14px;
  font-weight: 500;
  color: #F8F4F1;
  white-space: nowrap;
  overflow: hidden;
  max-width: 120px;
  transition: max-width 0.3s ease, opacity 0.3s ease;
}
.search-instead-btn.collapsed {
  padding: 4px;
  gap: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.search-instead-btn.collapsed span {
  max-width: 0;
  opacity: 0;
}

/* Header center hidden in UC mode */
.copilot-header-center.uc-hidden {
  visibility: hidden;
}
