/* L1b: approval chip, effort picker and approval card (public/composer-approval.js).
   The chips follow the Mac access chip in the chat box; the card follows the
   thread's agent messages. Grayscale, with amber only for Full access and
   destructive changes, as the Mac chip uses it. */
.composer-approval-slot, .composer-effort-slot { display:inline-flex; min-width:0; flex:none; }
.composer-approval-slot:empty, .composer-effort-slot:empty { display:none; }
.approval-chip, .effort-chip { position:relative; display:inline-flex; min-width:0; }
.approval-chip-btn { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 10px 0 8px; border:1px solid transparent; border-radius:99px; background:transparent; color:var(--ink-2); font:inherit; font-size:12.5px; font-weight:600; white-space:nowrap; cursor:pointer; }
.approval-chip-btn:hover, .approval-chip.open .approval-chip-btn, .effort-chip.open .approval-chip-btn { background:var(--hover); color:var(--ink); }
.approval-chip-btn:focus-visible { outline:2px solid var(--accent-line); outline-offset:1px; }
.approval-chip-btn svg { width:15px; height:15px; flex:none; }
.approval-chip.full .approval-chip-btn { color:var(--amber); }
.approval-menu { position:absolute; bottom:calc(100% + 8px); left:0; z-index:45; width:360px; max-width:calc(100vw - 32px); display:none; padding:8px; background:var(--menu); border:1px solid var(--line-2); border-radius:16px; box-shadow:var(--shadow-pop); }
.approval-menu.down { bottom:auto; top:calc(100% + 8px); }
.effort-menu { width:280px; left:auto; right:0; }
.approval-chip.open .approval-menu, .effort-chip.open .approval-menu { display:block; }
.approval-menu-head { padding:6px 10px 8px; color:var(--ink-3); font-size:12.5px; font-weight:600; }
.approval-item { width:100%; display:grid; grid-template-columns:22px minmax(0,1fr) 22px; align-items:center; gap:10px; border:0; border-radius:10px; padding:8px 10px; background:transparent; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.effort-menu .approval-item { grid-template-columns:minmax(0,1fr) 22px; }
.approval-item:hover, .approval-item:focus-visible { background:var(--hover); outline:none; }
.approval-item-icon { display:inline-flex; justify-content:center; color:var(--ink-2); }
.approval-item-icon svg { width:18px; height:18px; }
.approval-item-text { min-width:0; }
.approval-item-name { display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:600; line-height:1.3; }
.approval-item-detail { display:block; margin-top:2px; color:var(--ink-3); font-size:12px; line-height:1.35; }
.approval-item.full, .approval-item.full .approval-item-icon, .approval-item.full .approval-item-detail, .approval-item.full .approval-item-check { color:var(--amber); }
.approval-item-check { display:inline-flex; justify-content:center; color:var(--ink); }
.approval-item-check svg { width:16px; height:16px; }
.effort-default { color:var(--ink-3); font-size:11px; font-weight:500; }
/* In the thread's chat box the effort chip sits beside the model, compact like it. */
.composer-dock .effort-chip-btn { font-size:11px; padding:0 8px 0 6px; }
.composer-dock .effort-chip-btn svg { width:13px; height:13px; }

/* The batch of changes waiting for approval, at the end of the thread. */
.approval-card-msg .msg-body { width:100%; max-width:640px; }
.approval-card { width:100%; border:1px solid var(--line-2); border-radius:18px; background:var(--panel-2); padding:14px 16px; }
.approval-card-head { display:flex; align-items:flex-start; gap:10px; }
.approval-card-icon { display:inline-flex; color:var(--ink-2); margin-top:1px; }
.approval-card-icon svg { width:18px; height:18px; }
.approval-card-head strong { display:block; font-size:14px; font-weight:600; color:var(--ink); }
.approval-card-head span { display:block; margin-top:2px; font-size:12.5px; color:var(--ink-3); }
.approval-writes { list-style:none; margin:12px 0 0; padding:0; display:grid; gap:2px; }
.approval-write { display:grid; grid-template-columns:22px minmax(0,1fr); gap:10px; padding:8px 0; border-top:1px solid var(--line); }
.approval-write-icon { display:inline-flex; justify-content:center; color:var(--ink-2); padding-top:1px; }
.approval-write-icon svg { width:16px; height:16px; }
.approval-write.destructive .approval-write-icon, .approval-write.destructive .approval-write-name { color:var(--amber); }
.approval-write-body { min-width:0; }
.approval-write-name { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; font-size:13.5px; font-weight:600; color:var(--ink); overflow-wrap:anywhere; }
.approval-write-app { color:var(--ink-3); font-size:12px; font-weight:500; }
.approval-write-flag { display:inline-flex; align-items:center; height:18px; padding:0 7px; border-radius:99px; border:1px solid currentColor; color:var(--amber); font-size:11px; font-weight:600; }
.approval-write-task { margin-top:2px; color:var(--ink-2); font-size:12.5px; line-height:1.4; overflow-wrap:anywhere; }
.approval-write-details { margin-top:4px; }
.approval-write-details summary { cursor:pointer; color:var(--ink-3); font-size:12px; width:max-content; }
.approval-write-details summary:hover { color:var(--ink); }
.approval-write-details pre { margin:6px 0 0; max-height:240px; overflow:auto; padding:10px; border-radius:10px; background:var(--bg); border:1px solid var(--line); font-size:11.5px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
.approval-card-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }

@media (max-width:560px) {
  .approval-chip-btn { padding:0 8px; }
  .approval-chip .approval-chip-btn span { display:none; }
  /* The menus span the chat box instead of hanging off the chip. */
  .composer-tools:has(.approval-chip), .composer-tools:has(.effort-chip) { position:relative; }
  .approval-chip, .effort-chip { position:static; }
  .approval-menu, .effort-menu { left:0; right:0; width:auto; max-width:none; }
  /* The model menu too: anchored to its chip it ran off the screen's edge. */
  .composer-tools:has(.model-pick) { position:relative; }
  .composer-dock #thread-model .model-pick, .chat-empty-inner .composer-model-slot .model-pick { position:static; }
  .composer-dock #thread-model .model-pick-menu, .chat-empty-inner .composer-model-slot .model-pick-menu { left:0; right:0; width:auto; max-width:none; }
  /* Home's agent picker shrinks to its avatar here; keep its caret inside it
     so it never lies over the approval chip beside it. */
  .chat-empty-inner .composer-tools .agent-pick-btn { overflow:hidden; }
  /* The thread's chat box: the model chip gives up width to the two chips
     (its name and route ellipsize as before) instead of spilling over them. */
  .composer-dock #thread-model { display:flex; min-width:0; flex:0 1 auto; }
  .composer-dock #thread-model #thread-model-picker, .composer-dock #thread-model .model-pick { display:flex; min-width:0; max-width:100%; }
  .composer-dock #thread-model .model-pick-btn { min-width:0; max-width:min(190px, 100%); }
  /* The model name stays whole and its funding route sits under it, so both
     stay readable beside the two chips (the route must stay visible). */
  .composer-dock #thread-model .model-pick-labels { flex-direction:column; align-items:flex-start; gap:0; line-height:1.15; }
  .composer-dock #thread-model .model-pick-name { flex:none; max-width:100%; }
  .composer-dock #thread-model .model-pick-funding { max-width:100%; font-size:10px; }
  .composer-dock #thread-model .model-pick-funding::before { content:none; }
  /* No approved models: the model's name sits over "Approve models", as the
     name sits over its route, so the link stays clear of the send button. */
  .composer-dock #thread-model:has(> .composer-model-admin) { flex-direction:column; align-items:flex-start; justify-content:center; }
  .composer-dock #thread-model > .model-pill { max-width:100%; padding:0; line-height:1.15; }
  .composer-dock .effort-chip-btn, .chat-empty-inner .effort-chip-btn { padding:0 6px; }
  .composer-dock .effort-chip-btn svg, .chat-empty-inner .effort-chip-btn svg { display:none; }
  /* While a turn runs, the Activity chip keeps its count ("● 1") so the model
     keeps its name beside the effort chip instead of collapsing to "⌄ High". */
  .composer-dock .agents-chip { padding:0 9px; gap:6px; }
  .composer-dock .agents-chip-word { display:none; }
  .composer-dock #thread-model .model-pick-name { min-width:4.4em; }
  .composer-dock .composer-tools:has(.agents-chip) #thread-model .model-pick-caret { display:none; }
  /* Home: the agent picker is its avatar (the line above names the agent, as
     before) and the model chip takes the rest, so the effort chip stays on its row. */
  .chat-empty-inner .composer-tools, .chat-empty-inner .composer-tools-right { gap:6px; }
  .chat-empty-inner .composer-tools .agent-pick { flex:none; }
  .chat-empty-inner .composer-tools .agent-pick-btn .nm { display:none; }
  .chat-empty-inner .composer-tools .composer-model-slot { flex:1 1 0; min-width:0; }
  .chat-empty-inner .composer-tools .composer-model-slot .model-pick,
  .chat-empty-inner .composer-tools .composer-model-slot .model-pick-btn { min-width:0; max-width:100%; }
  .chat-empty-inner .composer-tools .composer-model-slot .model-pick-labels { flex-direction:column; align-items:flex-start; gap:0; line-height:1.15; }
  .chat-empty-inner .composer-tools .composer-model-slot .model-pick-name { flex:none; max-width:100%; }
  .chat-empty-inner .composer-tools .composer-model-slot .model-pick-funding { max-width:100%; font-size:11px; }
  .chat-empty-inner .composer-tools .composer-model-slot .model-pick-funding::before { content:none; }
  .approval-card { padding:12px; }
  .approval-card-actions .btn { flex:1; justify-content:center; }
}
