/* Work (shared/chat/work/view.js; docs/work-extension-contract.md §6.2): the
   timeline's steps, approvals, notices and divider, the plan card above the
   composer, the gates (the Plus lock, Add Lumio to Chrome, access: a card in
   a new task, a bar in the composer's place under a task), the approval-mode
   menu, the larger screenshot and the confirmation (docs/design-system.md
   §6.8, §6.9, §6.12–§6.14). A new task is centered like a new chat (chat.css's
   .lc-fresh and .lc-ideas-slot). The view
   is built from chat.css's classes (lc-root, lc-thread, lc-composer, lc-chip,
   lc-send, lc-md, lc-bubble, lc-notice, lc-empty…); these are its own. Every
   class is lc-, every color a theme.css token. Loaded by /chat and Lumio for
   Chrome's side panel. */

/* the view: chat.css's root, thread and composer */
.lc-work { height: 100%; }
.lc-work-loading { margin: 0; padding-top: min(12vh, 110px); text-align: center; font-size: var(--fs-sm, 12.5px); color: var(--label); }
.lc-work-empty .lc-work-gate { margin-top: 16px; }
/* What came in while you watch slides up (§3.7); a whole timeline drawn at once doesn't. */
.lc-work-fresh { animation: lc-work-in 320ms var(--ease-out); }
@keyframes lc-work-in { from { opacity: 0; transform: translateY(6px); } }

/* steps (§6.8): a card a line high, its tool's icon, the label, the summary,
   the screenshot's thumbnail and the state at the right; 6 px apart in a row */
.lc-work-step {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 11px;
  border-radius: var(--r-card, 12px); background: var(--card); border: 1px solid var(--line);
  color: var(--dim); font-size: var(--fs-sm, 12.5px); line-height: var(--lh-ui, 1.45);
}
.lc-work-step + .lc-work-step { margin-top: -14px; }
.lc-work-step-icon { color: var(--label); }
.lc-work-step-icon svg, .lc-work-state svg { width: 14px; height: 14px; }
.lc-work-step-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.lc-work-step-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-work-step-summary { flex: 0 1 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label); }
.lc-work-state { flex: none; display: grid; place-items: center; width: 14px; height: 14px; }
.lc-work-state-running { color: var(--text); }
.lc-work-state-running svg { width: 12px; height: 12px; }
.lc-work-ring { stroke: var(--overlay-6); }
.lc-work-state-ok { color: var(--ok); }
.lc-work-state-error, .lc-work-state-denied { color: var(--danger); }
.lc-work-state-blocked { color: var(--warn); }
.lc-work-state-stopped { color: var(--label); }
.lc-work-fresh .lc-work-state-ok svg { animation: lc-work-pop var(--dur-4) var(--ease-spring, var(--ease-out)); }
@keyframes lc-work-pop { from { transform: scale(.6); } }
.lc-work-thumb {
  flex: none; display: block; width: 56px; height: 36px; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--r-control, 8px); background: var(--bg);
  transition: border-color var(--dur-1) var(--ease-out);
}
.lc-work-thumb:hover { border-color: var(--line-strong); }
.lc-work-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.lc-work-thumb:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
/* a thumbnail with nothing larger to show (a saved task's) */
.lc-work-thumb-still { cursor: default; }
.lc-work-thumb-still:hover { border-color: var(--line); }

/* Lumio's text; "Thinking…" (or the planner's "Checking the plan") while the model works */
.lc-work-text { min-width: 0; overflow-wrap: anywhere; }
.lc-work-after { display: flex; flex-direction: column; gap: 8px; }
.lc-work-after:empty { display: none; }
.lc-work-thinking {
  margin: 0; font: 500 13px/1.45 var(--font); color: var(--muted);
  background: linear-gradient(90deg, var(--muted), var(--text), var(--muted)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: lc-shimmer 2s linear infinite;
}

/* approvals (§6.9): the shield and the question, the detail, a warning, the
   buttons (Allow once · Allow for this task · Deny) or where Lumio for Chrome
   asks (Show me); answered, dimmed with the decision */
.lc-work-approval {
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
  border-radius: var(--r-pop, 16px); background: var(--card);
  border: 1px solid color-mix(in srgb, var(--accent) 33%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 6%, transparent);
}
.lc-work-approval-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lc-work-approval-tile { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: var(--r-tag, 6px); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.lc-work-approval-tile svg { width: 14px; height: 14px; }
.lc-work-approval-title { min-width: 0; font: 600 14px/1.35 var(--font); color: var(--text); overflow-wrap: anywhere; }
.lc-work-approval-detail { margin: 0; font-size: var(--fs-sm, 12.5px); line-height: var(--lh-ui, 1.45); color: var(--dim); overflow-wrap: anywhere; }
.lc-work-approval-warn {
  margin: 0; padding: 7px 10px; border-radius: var(--r-control, 8px);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent);
  font: 500 var(--fs-sm, 12.5px)/1.45 var(--font); color: var(--danger-text);
}
.lc-work-approval-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.lc-work-approval-wait { min-width: 0; font-size: 13px; color: var(--text-soft); }
.lc-work-approval-stop { align-self: flex-start; padding: 0; font-size: var(--fs-sm, 12.5px); }
.lc-work-approval-said { margin: 0; font: 500 var(--fs-sm, 12.5px) var(--font); color: var(--dim); }
.lc-work-approval-done { opacity: .6; border-color: var(--line); box-shadow: none; }
/* Deny: danger-quiet (§6.1) */
.lc-btn.lc-work-btn-deny { background: none; border-color: color-mix(in srgb, var(--danger-fill) 25%, transparent); color: var(--danger-text); }
.lc-btn.lc-work-btn-deny:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-fill) 8%, transparent); }
/* ghost: Check again */
.lc-btn.lc-work-btn-ghost { background: none; border-color: transparent; color: var(--dim); }
.lc-btn.lc-work-btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }

/* notices (§6.8): chat.css's error and info, and the warning (the limits, stuck) */
.lc-work-notice { line-height: 1.45; }
.lc-work-notice-warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--card)); color: var(--warn-text); }
.lc-work-notice-icon svg { width: 15px; height: 15px; }
.lc-work-notice-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

/* "Continued" (a new run of the task) */
.lc-work-divider { display: flex; align-items: center; gap: 10px; margin: 8px 0; font: 500 var(--fs-2xs, 11.5px)/1 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--label); }
.lc-work-divider::before, .lc-work-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* the plan card above the composer (§6.8) */
.lc-work-plan { max-width: var(--lc-measure, 780px); margin: 0 auto 8px; overflow: hidden; border-radius: var(--r-pop, 16px); background: var(--card); border: 1px solid var(--line); }
.lc-work-plan-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.lc-work-plan-head:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: var(--r-pop, 16px); }
.lc-work-plan-list { color: var(--dim); }
.lc-work-plan-list svg { width: 14px; height: 14px; }
.lc-work-plan-name { flex: none; font: 600 13px var(--font); }
.lc-work-plan-now { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs, 12px); color: var(--label); }
.lc-work-plan-count { flex: none; margin-left: auto; font-size: var(--fs-xs, 12px); color: var(--label); font-variant-numeric: tabular-nums; }
.lc-work-plan-chev { color: var(--label); transition: transform var(--dur-2) var(--ease-out); }
.lc-work-plan-head[aria-expanded="true"] .lc-work-plan-chev { transform: rotate(180deg); }
.lc-work-plan-steps { list-style: none; margin: 0; padding: 0 14px 12px; display: flex; flex-direction: column; gap: 9px; max-height: 260px; overflow-y: auto; font-size: 13px; line-height: 1.4; }
.lc-work-plan-step { display: flex; align-items: flex-start; gap: 9px; color: var(--text); }
.lc-work-plan-icon { margin-top: 0; color: var(--label); }
.lc-work-plan-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.lc-work-plan-tick { stroke: var(--card); }
.lc-work-plan-done .lc-work-plan-title { color: var(--label); text-decoration: line-through; }
.lc-work-plan-in_progress .lc-work-plan-icon { color: var(--amber); }
.lc-work-plan-in_progress .lc-work-plan-title { font-weight: 500; }
.lc-work-plan-blocked .lc-work-plan-icon { color: var(--warn); }
.lc-work-plan-reason { font-size: var(--fs-xs, 12px); color: var(--warn-text); }
/* on a phone the card leaves the thread room: its list scrolls sooner */
@media (max-width: 640px) { .lc-work-plan-steps { max-height: 128px; } }

/* the gates: a new task's card (the Plus lock, Add Lumio to Chrome, access), and under a task's
   timeline one bar where the composer goes, at its width and in its pill's shape (r28) */
.lc-work-gate-slot { width: 100%; max-width: var(--lc-measure, 780px); margin: 0 auto; }
.lc-work-gate-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 10px 10px 16px;
  border-radius: 28px; background: var(--card); border: 1px solid var(--line);
}
.lc-work-gate-bar-text { flex: 1 1 220px; min-width: 0; margin: 0; font-size: var(--fs-ui, 13.5px); line-height: 1.45; color: var(--dim); }
.lc-work-gate-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.lc-work-gate-bar a.lc-btn { text-decoration: none; }
.lc-work-gate {
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 480px; margin: 0 auto; padding: 22px 20px 20px;
  border-radius: var(--r-pop, 16px); background: var(--card); border: 1px solid var(--line); text-align: center;
}
.lc-work-gate-tile { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: var(--r-pop, 16px); background: var(--overlay-3); color: var(--text); }
.lc-work-gate-tile svg { width: 20px; height: 20px; }
.lc-work-gate-title { margin: 0; font: 600 var(--fs-title, 17px)/1.3 var(--font); color: var(--text); }
.lc-work-gate-text { margin: 0; max-width: 420px; font-size: var(--fs-ui, 13.5px); line-height: 1.55; color: var(--dim); }
.lc-work-gate-note { margin: 6px 0 0; font: 500 13px/1.45 var(--font); color: var(--text-soft); }
.lc-work-gate-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.lc-work-gate a.lc-btn { text-decoration: none; }
/* a new task behind a gate: the shell's Chat | Work switch under the card */
.lc-work-empty > .lc-work-gate + .lc-modes { margin-top: 18px; }
/* a finger's targets: the gates' small buttons (Check again) */
@media (pointer: coarse) { :is(.lc-work-gate, .lc-work-gate-bar) .lc-btn-small { height: 32px; } }

/* the approval mode: a chip in the composer's row, its menu (§6.7, without Bypass) */
.lc-work-mode-menu { width: min(320px, calc(100vw - 32px)); }
.lc-chip.lc-work-mode-auto > .lc-icon:first-child { color: var(--accent); }
.lc-menu-tile.lc-work-tile-auto { color: var(--accent); }
@container lc-composer (max-width: 479px) {
  .lc-chip.lc-work-mode { width: 34px; padding: 0; justify-content: center; }
  .lc-chip.lc-work-mode > :is(.lc-chip-label, .lc-chev) { display: none; }
  .lc-chip.lc-work-model { max-width: 150px; }
}

/* the model: a chip at the row's right like Chat's (its name and a chevron), its menu (Auto, then GET /v1/work's
   models; one the plan doesn't have shows its plan) with Extra thinking at the bottom (chat.css .lc-think-row) */
.lc-chip.lc-work-model { max-width: 210px; }
.lc-chip.lc-work-model > .lc-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lc-work-model-menu { width: min(300px, calc(100vw - 32px)); max-height: min(440px, 62vh); overflow-y: auto; }
.lc-work-model-menu > .lc-think-row { margin: 4px 0 0; padding: 10px 10px 4px; }
.lc-work-model-tile { display: inline-grid; place-items: center; }
.lc-work-model-tile > .lc-maker-logo { width: 18px; height: 18px; color: var(--text); }
.lc-work-model-tile > .lc-maker-logo svg { width: 16px; height: 16px; }
.lc-work-model-menu .lc-locked .lc-menu-text > b, .lc-work-model-menu .lc-locked .lc-maker-logo { color: var(--dim); }

/* a step's screenshot, larger */
.lc-work-lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: var(--scrim); animation: lc-work-fade var(--dur-3) var(--ease-out); }
.lc-work-lightbox:focus { outline: none; }
.lc-work-lightbox-figure { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: min(1280px, 100%); max-height: 100%; margin: 0; }
.lc-work-lightbox-figure img { display: block; max-width: 100%; max-height: calc(100vh - 140px); border-radius: var(--r-card, 12px); background: var(--card); box-shadow: var(--shadow-dialog); }
.lc-work-lightbox-figure figcaption { max-width: 100%; padding: 6px 12px; border-radius: var(--r-pill, 999px); background: var(--popover); border: 1px solid var(--line-strong); color: var(--text); font-size: var(--fs-sm, 12.5px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-icon-btn.lc-work-lightbox-close { position: absolute; top: 16px; right: 16px; background: var(--popover); border: 1px solid var(--line-strong); color: var(--text); }
@keyframes lc-work-fade { from { opacity: 0; } }

/* the confirmation (§6.14): Continue a run that hit its budget */
.lc-work-scrim { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--scrim); animation: lc-work-fade var(--dur-3) var(--ease-out); }
.lc-work-dialog { width: min(420px, 100%); padding: 20px; border-radius: var(--r-pop, 16px); background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow-dialog); animation: lc-work-rise var(--dur-4) var(--ease-out); }
.lc-work-dialog-title { margin: 0 0 8px; font: 600 var(--fs-title, 17px)/1.3 var(--font); color: var(--text); }
.lc-work-dialog-body { margin: 0; font-size: 14px; line-height: 1.5; color: var(--dim); }
.lc-work-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@keyframes lc-work-rise { from { opacity: 0; transform: translateY(8px) scale(.97); } }

/* How Work works: the first-time window (view.js showIntro), and its link under the greeting */
.lc-work-dialog.lc-work-intro { width: min(460px, 100%); max-height: calc(100% - 8px); overflow-y: auto; padding: 24px; }
.lc-work-intro > svg, .lc-work-intro > .lc-work-mark { display: block; margin-bottom: 12px; }
.lc-work-intro-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.lc-work-intro-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 13.5px; line-height: 1.5; color: var(--dim); }
.lc-work-intro-steps b { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 1px; }
.lc-icon.lc-work-intro-icon { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.lc-work-intro .lc-work-dialog-actions { margin-top: 22px; }
.lc-work-how { margin-top: 10px; padding: 4px 8px; border: 0; background: none; color: var(--accent); font: 500 13px var(--font); cursor: pointer; border-radius: 8px; }
.lc-work-how:hover { text-decoration: underline; text-underline-offset: 3px; }
.lc-work-how:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* a task in Chat's list: its glyph before the title */
.lc-chat-task { color: var(--label); }
.lc-chat-task svg { display: block; width: 14px; height: 14px; }
.lc-current .lc-chat-task, .lc-chat-row:hover .lc-chat-task { color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  .lc-work-fresh, .lc-work-lightbox, .lc-work-scrim, .lc-work-dialog { animation: none; }
  .lc-work-thinking { animation: none; }
}
