/* Replica of the Krayton desktop app at its real scale (1600×900 at 14px).
   The camera (js/demo-window.js) scales and pans it so small UI reads clearly. */
.cam {
  position: relative; width: 100%; aspect-ratio: 1600 / 900; overflow: hidden;
  max-width: 1240px; margin: 0 auto; border-radius: 14px;
  background: var(--a-frame);
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.7);
}
.app {
  position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: flex; flex-direction: column;
  transform-origin: 0 0; transition: transform 1.3s cubic-bezier(0.65, 0, 0.35, 1);
  background: var(--a-frame); color: var(--a-text); font: 400 14px/1.5 'Inter', system-ui, sans-serif;
  letter-spacing: 0; text-align: left; -webkit-font-smoothing: antialiased;
}
.app .ic { width: 16px; height: 16px; flex: none; }
.app .mark { flex: none; }
.app.no-anim { transition: none; }

/* Title bar */
.a-title { position: relative; display: flex; align-items: center; height: 54px; padding: 0 18px; flex: none; }
.a-title .left { display: flex; align-items: center; gap: 14px; color: var(--a-text-2); }
.a-title .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--a-heading); font-size: 15px; }
.a-tabs { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: #161616; }
.a-tabs span { padding: 6px 20px; border-radius: 9px; color: var(--a-text-2); font-size: 14.5px; }
.a-tabs .on { background: #262626; color: #fff; font-weight: 500; }
.a-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.a-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 10px; background: #181818; color: var(--a-text-2); font-size: 14px; }
.a-btn.sq { width: 34px; padding: 0; justify-content: center; }
.a-win { display: flex; gap: 20px; margin-left: 12px; color: var(--a-text-2); }

.a-body { flex: 1; display: flex; gap: 10px; padding: 0 10px 10px; min-height: 0; }

/* Sidebar */
.a-side { width: 262px; flex: none; display: flex; flex-direction: column; padding: 14px 10px 12px; border-radius: 14px; background: var(--a-side); color: var(--a-text-2); font-size: 14.5px; }
.a-side .lbl { padding: 4px 10px 8px; font-size: 13px; color: var(--a-text-3); }
.a-nav { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px; }
.a-nav .ic { color: var(--a-text-3); }
.a-side hr { border: 0; height: 1px; margin: 12px 4px; background: var(--a-border); }
.a-proj-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 8px; color: var(--a-text-3); font-size: 14px; }
.a-proj-h .ic { margin-left: 12px; }
.a-filter { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; padding: 8px 11px; border-radius: 9px; background: #1b1b1b; color: var(--a-text-3); font-size: 14px; }
.a-proj { display: flex; align-items: center; gap: 9px; padding: 6px 10px; color: var(--a-heading); font-weight: 500; }
.a-proj .plus { margin-left: auto; color: var(--a-text-3); }
.a-chat { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 0 4px; padding: 8px 12px; border-radius: 10px; background: #262626; color: #ececec; }
.a-chat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-chat em { flex: none; margin-left: 8px; font-style: normal; font-size: 12px; color: var(--a-text-3); }
.a-foot { margin-top: auto; padding: 0 6px; font-size: 13.5px; color: var(--a-text-3); }
.a-foot .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; padding: 0 8px; height: 20px; border-radius: 999px; font-size: 12px; background: rgba(255, 95, 87, 0.14); color: var(--a-danger); }
.pill.ok { background: rgba(52, 199, 89, 0.14); color: var(--a-ok); }
.a-clis { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-bottom: 12px; font-size: 13px; }
.a-clis i { font-style: normal; }
.a-clis i::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--a-ok); }
.a-user { display: flex; align-items: center; gap: 10px; }
.a-user .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2a2a2a; color: #ddd; font-weight: 600; }
.a-user b { display: block; color: var(--a-heading); font-weight: 500; line-height: 1.15; }
.a-user small { font-size: 11.5px; letter-spacing: 0.04em; }
.a-user .ic { margin-left: auto; }
.a-user .ic + .ic { margin-left: 12px; }

/* Main canvas */
.a-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 14px; background: var(--a-bg); overflow: hidden; }
.a-top { position: absolute; right: 22px; top: 14px; display: flex; gap: 14px; color: var(--a-text-3); z-index: 2; }
.a-thread { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 40px 0 8px; }
.a-thread::-webkit-scrollbar { display: none; }
.a-col { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 18px; display: flex; flex-direction: column; gap: 22px; }
.m-empty { margin: 140px auto 0; color: #4d4d4d; font-size: 17px; }

.m-user .bubble { width: 100%; padding: 10px 18px; border-radius: 16px; background: var(--a-panel-2); color: var(--a-text-2); font-size: 15px; line-height: 1.55; }
.m-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--a-heading); font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.m-head .meta { color: var(--a-text-3); font-weight: 400; font-size: 13px; letter-spacing: 0; }
.m-work { display: flex; justify-content: space-between; margin-bottom: 9px; color: #5f5f5f; font-size: 15px; }
.m-work.busy { color: var(--a-text-3); }
/* The app's own working line: the words shimmer, there is no status dot. */
.m-work.busy span {
  background: linear-gradient(90deg, #5f5f5f 0%, #5f5f5f 35%, #b4b4b4 50%, #5f5f5f 65%, #5f5f5f 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: work-shimmer 2s linear infinite;
}
@keyframes work-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .m-work.busy span { animation: none; background: none; -webkit-text-fill-color: currentColor; } }
.m-work span { flex: 1; }
.m-work small { color: #4a4a4a; font-size: 10px; align-self: center; }
.m-text { color: var(--a-text); font-size: 15px; line-height: 1.65; }
.m-text code, .cmp-input code { padding: 1px 6px; border-radius: 5px; background: #0a0a0a; font: 0.9em var(--a-mono); color: var(--a-code); }
.m-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; color: var(--a-text-3); font-size: 13px; }
.m-actions .ic { width: 15px; height: 15px; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* Finished split, posted back as a log line */
.split-summary { padding: 4px 0 4px 14px; border-left: 2px solid var(--a-ok); font-family: var(--a-mono); }
.split-summary .head { display: flex; gap: 8px; font-size: 12px; color: var(--a-text-3); text-transform: lowercase; }
.split-summary .head .tag { color: var(--a-ok); }
.split-summary .txt { margin-top: 4px; font: 400 14px/1.55 'Inter', sans-serif; color: var(--a-text-2); }

/* Split strip */
.a-splits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; max-width: 820px; margin: 0 auto; padding: 6px 18px 2px; font-family: var(--a-mono); }
.a-splits:empty { display: none; }
.split-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; padding: 4px 11px; background: #171717; border-radius: 6px; color: var(--a-text-3); font: 400 12px var(--a-mono); animation: chipIn 0.3s var(--ease); }
.split-chip .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-chip .time { opacity: 0.7; font-variant-numeric: tabular-nums; }
.split-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--a-ok); animation: pulse 1.4s ease-in-out infinite; }
.split-chip.is-done { background: rgba(52, 199, 89, 0.1); color: var(--a-ok); }
.split-chip.is-done .split-dot { animation: none; }
@keyframes chipIn { from { transform: scale(0.92); } }

/* Composer */
.a-comp { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 18px 16px; position: relative; }
.scope { display: flex; align-items: center; gap: 22px; padding: 8px 8px 10px; color: var(--a-text-2); font-size: 14.5px; }
.scope .it { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 3px 6px; margin: -3px -6px; border-radius: 7px; transition: background 0.2s; }
.scope .it.hot { background: #262626; color: #fff; }
.scope .ic { width: 13px; height: 13px; }
.scope .r { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--a-text-2); }
.ring { width: 15px; height: 15px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: #2c2c2c; }
.ring .fg { stroke: var(--a-text-2); stroke-linecap: round; stroke-dasharray: var(--p, 0) 100; transition: stroke-dasharray 0.9s var(--ease); }
.add { color: var(--a-ok); } .del { color: var(--a-danger); }
.cmp-box { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 12px 0 16px; border-radius: 16px; background: var(--a-composer); }
.cmp-box .clip { color: var(--a-text-2); }
.cmp-box .auto { display: inline-flex; align-items: center; gap: 7px; color: var(--a-text-2); font-size: 14.5px; }
.cmp-input { flex: 1; min-width: 0; font-size: 15px; color: #efefef; white-space: nowrap; overflow: hidden; }
.cmp-input:empty::before { content: 'Ask anything…'; color: #6b6b6b; }
.cmp-input.typing::after { content: ''; display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: #fff; animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cmp-box .opt { display: inline-flex; align-items: center; gap: 6px; color: var(--a-text-2); font-size: 14.5px; }
.cmp-box .opt .ic { width: 12px; height: 12px; }
.send { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #313131; color: #8b8b8b; transition: background 0.2s, color 0.2s; }
.send.ready { background: #f2f2f2; color: #111; }
.hint { padding-top: 10px; text-align: center; color: #6b6b6b; font-size: 13.5px; }

/* Slash-command popup */
.slash { position: absolute; left: 18px; bottom: calc(100% - 44px); width: 560px; padding: 6px; border-radius: 12px; background: #1d1d1d; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); z-index: 8; }
.slash[hidden] { display: none; }
.slash .row { display: flex; gap: 14px; padding: 8px 12px; border-radius: 8px; color: var(--a-text-3); font-size: 13.5px; }
.slash .row b { flex: none; width: 110px; font: 500 13px var(--a-mono); color: var(--a-text-2); }
.slash .row.on { background: #2a2a2a; color: var(--a-text-2); }
.slash .row.on b { color: #fff; }

/* Agent / model picker */
.picker { position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 9; display: flex; width: 430px; height: 330px; border-radius: 16px; background: #1c1c1c; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); text-align: left; overflow: hidden; }
.picker[hidden] { display: none; }
.picker.right { left: auto; right: 18px; }
.picker .mrow .st { margin-left: 4px; color: var(--a-text-3); }
.cmp-box .opt { padding: 4px 8px; margin: -4px -8px; border-radius: 8px; transition: background 0.2s; }
.cmp-box .opt.hot { background: #2b2b2b; color: #fff; }
.a-rail .it { transition: background 0.2s; }
.a-rail .it.hot { background: #262626; color: #fff; }
.ff .app, .ff .pointer, .ff .pointer .k { transition: none !important; }
.picker .rail { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: #181818; }
.picker .rail div { width: 44px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--a-text-3); }
.picker .rail div.on { background: #2c2c2c; }
.picker .rail .mark, .picker .rail .ic { width: 20px; height: 20px; }
.picker .list { flex: 1; padding: 12px; min-width: 0; }
.picker .flt { padding: 10px 14px; border-radius: 10px; background: #141414; color: #6b6b6b; font-size: 15px; margin-bottom: 8px; }
.picker .mrow { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 10px; color: #cfcfcf; font-size: 15px; }
.picker .mrow small { color: var(--a-text-3); font-size: 12.5px; align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker .mrow.on { background: #2c2c2c; }

/* Right rail */
.a-rail { width: 230px; flex: none; padding: 14px 10px; color: var(--a-text-2); font-size: 14.5px; }
.a-rail .h { padding: 2px 10px 12px; color: var(--a-text-3); }
.a-rail .it { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; }
.a-rail .it .ic { color: var(--a-text-3); }
.a-rail .it .n { margin-left: auto; font-size: 13.5px; }
.a-rail .gap { height: 14px; }

/* Cursor that performs the clicks; --k keeps it a constant size on screen */
.pointer { position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none; transform: translate(1700px, 950px); transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1); }
.pointer .k { transform-origin: 0 0; transition: transform 1.3s cubic-bezier(0.65, 0, 0.35, 1); filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7)); }
.pointer svg { display: block; transition: transform 0.15s; transform-origin: 3px 3px; }
.pointer.press svg { transform: scale(0.78); }

@media (max-width: 700px) { .cam { border-radius: 10px; aspect-ratio: 4 / 5; } }
