/* ============================================================================
   AgentOS AI DESK — shared "Ask the AI" bar (top-of-app placement).
   Self-contained: every class is osdesk- prefixed so it never collides with
   an app's own styles. Navy #0a1f44 / gold #c9a227, Archivo headlines /
   Inter body (the apps already self-host both fonts).
   The bar is IN NORMAL FLOW (position: static) directly under the app's
   header — it can never cover a fixed tab bar or the update pill.
   ============================================================================ */
.osdesk-top {
  box-sizing: border-box;
  width: auto;
  max-width: 680px; /* v2.41 shelf: align with the hero/shelf column */
  margin: 0 auto 6px;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.osdesk-top *, .osdesk-top *::before, .osdesk-top *::after { box-sizing: border-box; }

/* Dropdown pattern (Steven, 2026-10-24 ~18:30): ONE slim closed row;
   tap drops the job list; a pick drops the panel under it. Replaces the
   always-open bar + label. */
.osdesk-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(245, 184, 61, 0.55);
  border-radius: 14px;
  background: #101c33;
  color: #eef2f7;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  cursor: pointer;
  min-height: 44px;
  text-align: left;
}
.osdesk-toggle-main { font-weight: 800; white-space: nowrap; }
.osdesk-toggle-hint {
  font-weight: 500;
  color: #9fb0c3;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.osdesk-chev { margin-left: auto; color: #f5b83d; font-size: 18px; flex: 0 0 auto; }

.osdesk-menu {
  margin-top: 8px;
  background: #101c33;
  border: 1px solid rgba(245, 184, 61, 0.55);
  border-radius: 14px;
  overflow: hidden;
}
.osdesk-menu[hidden] { display: none; }
.osdesk-job {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: #101c33;
  color: #eef2f7;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  min-height: 48px;
  cursor: pointer;
}
.osdesk-job:last-child { border-bottom: 0; }
.osdesk-job:active { background: rgba(245, 184, 61, 0.14); }

.osdesk-jobrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.osdesk-jobrow[hidden] { display: none; }
.osdesk-jobname {
  color: #8a6a00;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.osdesk-back {
  border: 0;
  background: transparent;
  color: #0a1f44;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  min-height: 32px;
}
.osdesk-panel .osdesk-controls { margin-bottom: 10px; }

/* The useful next tap under an answer: Open a tool, or Copy the draft. */
.osdesk-actions { align-self: flex-start; }
.osdesk-open {
  display: inline-block;
  border: 1px solid #f5b83d;
  background: #f5b83d;
  color: #0a1f44;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  min-height: 38px;
  line-height: 20px;
  text-decoration: none;
}
.osdesk-copy {
  border: 1px solid #0a1f44;
  background: #fff;
  color: #0a1f44;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  min-height: 38px;
  cursor: pointer;
}

.osdesk-controls { display: flex; gap: 8px; align-items: stretch; }
.osdesk-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #c9a227;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  color: #0a1f44;
  background: #fff;
}
.osdesk-input:focus { outline: 2px solid #c9a227; outline-offset: 1px; }
.osdesk-ask {
  flex: 0 0 auto;
  border: 1px solid #f5b83d;
  border-radius: 10px;
  background: #f5b83d;
  color: #0a1f44;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 9px 18px;
  cursor: pointer;
}
.osdesk-ask:disabled { opacity: .55; cursor: default; }

.osdesk-panel {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #0a1f44;
  border-radius: 14px;
  padding: 12px;
}
.osdesk-panel[hidden] { display: none; }
.osdesk-thread {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.osdesk-msg {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.osdesk-u { align-self: flex-end; background: #0a1f44; color: #fff; border-bottom-right-radius: 4px; }
.osdesk-a { align-self: flex-start; background: #f2f4f8; color: #0a1f44; border: 1px solid #d8dee9; border-bottom-left-radius: 4px; }
.osdesk-typing { color: #5a6a86; font-size: 13.5px; margin-top: 8px; }
.osdesk-typing[hidden] { display: none; }
.osdesk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.osdesk-chips[hidden] { display: none; }
.osdesk-chips-hint {
  font-size: 13px;
  font-weight: 600;
  color: #0a1f44;
  width: 100%;
}
.osdesk-chip {
  border: 1px solid #c9a227;
  background: #fdf6dd;
  color: #0a1f44;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  min-height: 38px;
  text-align: left;
}

.osdesk-close {
  margin-top: 10px;
  border: 1px solid #0a1f44;
  background: #fff;
  color: #0a1f44;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 6px 16px;
  cursor: pointer;
  min-height: 36px;
}

@media (max-width: 480px) {
  .osdesk-top { margin: 0 auto 6px; padding: 0; }
  .osdesk-ask { padding: 9px 14px; }
  .osdesk-thread { max-height: 46vh; }
}

/* v2.59/v1.13 looks pass: on small phones the hint drops instead of clipping */
@media (max-width: 400px) {
  .osdesk-toggle-hint { display: none; }
}

@media (min-width: 1024px) {
  .osdesk-top { max-width: 940px; }
}
