/* An agent's computer in view (FoundryWeb.ScreenLive, FoundryWeb.ComputerThumb;
   docs/plans/kit-computer.html). The stage is exactly the screen's 1280x800, so
   the click ring is placed in percent of it. */

.kc-bar { gap: 8px; flex-wrap: wrap; }
.kc-title { font-size: 13px; font-weight: 600; white-space: nowrap; }
.kc-grow { flex: 1; }
.kc-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--primary); white-space: nowrap; }
.kc-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: kc-pulse 1.4s ease-in-out infinite; }
.kc-live.kc-you { color: var(--foreground); }
.kc-live.kc-you::before { background: var(--success); animation: none; }
@keyframes kc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.kc-stage { position: relative; width: 100%; aspect-ratio: 1280 / 800; flex: none; border-radius: 10px; overflow: hidden; background: #111; border: 1px solid var(--border); }
.kc-stage.kc-driving { outline: 2px solid var(--success); outline-offset: 1px; }
.kc-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #111; }
.kc-overlay { position: absolute; inset: 0; pointer-events: none; }

.kc-ring { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 3px solid var(--primary); box-shadow: 0 0 0 4px hsl(18.5 100% 50% / .22); animation: kc-ring 1.2s ease-out forwards; }
@keyframes kc-ring {
  0% { transform: scale(.3); opacity: 1; }
  45% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: .6; }
}

.kc-caption { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); max-width: calc(100% - 20px);
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 999px;
  background: rgb(9 9 11 / .84); color: #fafafa; font-size: 12.5px; line-height: 1.3; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 14px rgb(0 0 0 / .25); }
.kc-caption > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.kc-av { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.kc-caption.kc-wait { background: hsl(160 60% 20% / .92); }

/* The floating thumbnail while the agent works and its screen isn't open. */
.kc-thumb { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 200px; display: block; text-decoration: none;
  border-radius: 12px; overflow: hidden; background: #111; border: 1px solid var(--border); box-shadow: 0 10px 30px rgb(0 0 0 / .28); }
.kc-thumb .kc-stage { border: 0; border-radius: 0; }
.kc-thumb .kc-shield { position: absolute; inset: 0; }
.kc-thumb .kc-thumb-cap { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--card); color: var(--foreground);
  font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.kc-thumb .kc-thumb-cap > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.kc-thumb .kc-av { width: 16px; height: 16px; font-size: 9.5px; }
.kc-thumb .kc-live { font-size: 11px; }
.frame:has(.screen-pane) .kc-thumb { display: none; }
@media (max-width: 900px) {
  .kc-thumb { width: 132px; right: 12px; bottom: calc(160px + env(safe-area-inset-bottom)); }
}
.kc-thumb-root { display: contents; }

/* The login card's live screen, and the ask card. */
.kc-card-stage { margin: 4px 0 2px; }
.kc-login { max-width: 560px; }

/* Sites, in the screen panel's header (docs/plans/kit-computer.html, idea 3). */
.kc-sites-btn { position: relative; }
.kc-sites-btn.on { background: var(--accent); }
.kc-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.kc-sites { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--card); flex: none; font-size: 12.5px; }
.kc-sites-head { margin: 0 0 6px; color: var(--muted-foreground); }
.kc-sites ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.kc-site { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kc-site.asking .kc-host { color: var(--primary); }
.kc-host { font-family: var(--font-mono); font-size: 12px; }
.kc-eff { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); }
.kc-eff.kc-deny { color: var(--danger-ink); border-color: hsl(0 72% 50% / .35); }
.kc-eff.kc-ask { color: var(--warning); border-color: hsl(35 92% 40% / .35); }
.kc-eff.kc-allow { color: var(--success-ink); border-color: hsl(160 60% 45% / .35); }
.kc-add-site { display: flex; gap: 6px; flex-wrap: wrap; }
.kc-add-site input { flex: 1; min-width: 160px; min-height: 32px; padding: 4px 10px; }
.kc-add-site select { width: auto; min-height: 32px; padding: 4px 8px; }

/* The settings page (FoundryWeb.AgentSettingsLive). */
.kc-sections { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; position: sticky; top: 0; background: var(--background); padding: 6px 0; z-index: 2; }
.kc-sec { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted-foreground); text-decoration: none; }
.kc-sec.on, .kc-sec:hover { color: var(--foreground); background: var(--accent); }
.kc-settings { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.kc-settings.in-pane { padding: 4px 2px 24px; max-width: none; overflow-y: auto; }
.kc-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--card); display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 56px; }
.kc-card h2 { font-size: 15px; margin: 0; }
.kc-card h3 { font-size: 13px; margin: 6px 0 2px; }
.kc-card.kc-focus { border-color: var(--primary); box-shadow: 0 0 0 3px hsl(18.5 100% 50% / .14); }
.kc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.kc-check { display: inline-flex; align-items: center; gap: 8px; }
.kc-check input { width: auto; min-height: 0; }
.kc-num { width: 80px; min-height: 32px; padding: 4px 8px; display: inline-block; margin: 0 4px; }
.kc-sel { width: auto; min-height: 30px; padding: 3px 8px; font-size: 12.5px; }
.kc-where { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.kc-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.kc-table th, .kc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.kc-table th { font-weight: 500; color: var(--muted-foreground); font-size: 12px; }
.kc-table form { margin: 0; }
.kc-rules ul, .kc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.kc-list li { display: flex; gap: 8px; align-items: center; }
.kc-gear { padding: 0 8px; }
@media (max-width: 600px) { .kc-table { font-size: 12px; } .kc-table th, .kc-table td { padding: 5px 4px; } }

/* A gear on each agent's sidebar row, shown on hover. */
.srow-gear { position: relative; display: block; height: 0; }
.srow-gear span { position: absolute; right: 8px; top: -31px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--muted-foreground); opacity: 0; transition: opacity .12s; background: var(--secondary); }
.srow-gear span svg { width: 14px; height: 14px; }
.srow.agent:hover + .srow-gear span, .srow-gear:hover span, .srow-gear:focus-visible span { opacity: 1; }
@media (hover: none) { .srow-gear span { opacity: .7; } }

/* Replay: a frame per step in the "Worked for" fold. */
.kc-film { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: thin; }
.kc-shot { flex: none; width: 128px; display: flex; flex-direction: column; gap: 3px; }
.kc-thumb-btn { position: relative; padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #111; cursor: zoom-in; aspect-ratio: 1280 / 800; width: 100%; }
.kc-thumb-btn img { width: 100%; height: 100%; display: block; object-fit: cover; }
.kc-ring.sm { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 2px; box-shadow: none; animation: none; opacity: .9; }
.kc-shot-cap { font-size: 11px; color: var(--muted-foreground); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kc-blocked-box { aspect-ratio: 1280 / 800; width: 100%; border: 1px dashed hsl(0 72% 50% / .45); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--danger-ink); }
.kc-frame-pop { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--card); color: var(--foreground); width: min(900px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
.kc-frame-pop::backdrop { background: rgb(0 0 0 / .45); }
.kc-frame-pop p { margin: 8px 0 0; font-size: 13px; }
.kc-frame-pop .btn { margin-top: 10px; }
.kc-pop-stage { position: relative; aspect-ratio: 1280 / 800; width: 100%; border-radius: 8px; overflow: hidden; background: #111; }
.kc-pop-stage img { width: 100%; height: 100%; display: block; }
.kc-pop-stage .kc-ring { animation: none; opacity: 1; }

/* Screen | Files in the screen panel (the work folder). */
.kc-panes { display: flex; gap: 4px; border-bottom: 1px solid var(--border); flex: none; }
.kc-pane { border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 10px; color: var(--muted-foreground); border-bottom: 2px solid transparent; cursor: pointer; }
.kc-pane.on { color: var(--foreground); border-bottom-color: var(--primary); }
.kc-files { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.kc-hidden { display: none; }
.cline.kc-settled { flex-wrap: nowrap; align-items: baseline; }
.cline.kc-settled > span:last-child { min-width: 0; }
