/* shell.lsh.dev: the studio (a conversation with LOG beside the live workspace, yours.js) and the panels around
   the stage. Colours come from the kit's tokens only, so light, dark and a person's own theme all apply. */

/* The workspace: rail, panels and stage. On every page of the frame it fills the body as before. */
#work { flex: 1; min-width: 0; min-height: 0; display: flex; }
.panel { flex: none; position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0 8px 8px 0; min-width: 0; min-height: 0; }
#panel-bottom { margin: 0 8px 8px 0; }
#rail[hidden] ~ #center > #panel-bottom { margin-left: 8px; }
.panel > iframe, .panel > .out { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 14px; background: var(--bg-1); box-shadow: var(--glass-shadow); }
#panel-bottom { flex-direction: row; }
iframe.probe { position: fixed; left: -10000px; top: 0; width: 420px; height: 600px; border: 0; }
.yours-card { margin-bottom: 26px; box-shadow: var(--glass-shadow), 0 0 0 1px var(--accent-glow); }
.linkish { all: unset; cursor: pointer; color: var(--accent-text); }
.linkish:hover { text-decoration: underline; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* A layout of the person may add panels: they take room from the stage, never from the conversation. */
body.studio #panel-left, body.studio #panel-right { max-width: 40%; }
body.studio #panel-bottom { max-height: 50%; }
body.studio #rail .rail-end { margin-top: auto; }

/* ---- the conversation ---- */
#chat { flex: none; width: clamp(320px, 34vw, 460px); min-height: 0; display: flex; flex-direction: column; margin: 0 0 8px 8px; border-radius: 14px; background: var(--surface); box-shadow: var(--glass-shadow); overflow: hidden; }
.chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
.repo-entry { flex: none; color: var(--ink-2); font-size: var(--text-sm); text-decoration: none; }
.repo-entry:hover, .repo-entry:focus-visible { color: var(--ink); text-decoration: underline; }
.chat-title { font-weight: 600; }
.chat-status { flex: 1; min-width: 0; color: var(--ink-3); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu { position: relative; flex: none; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink-2); font-size: var(--text-sm); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { border-color: var(--border-strong); color: var(--ink); }
.menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-list { position: absolute; right: 0; top: 36px; z-index: 5; width: 280px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; padding: 6px; border-radius: 12px; background: var(--surface-strong); box-shadow: var(--glass-shadow); }
.menu-list > a, .menu-list > button { all: unset; box-sizing: border-box; cursor: pointer; padding: 8px 10px; border-radius: 8px; font-weight: 500; color: var(--ink); }
.menu-list > a:hover, .menu-list > button:hover { background: var(--bg-2); }
.menu-list > a:focus-visible, .menu-list > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-list .d { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--text-sm); }

.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.intro { margin: auto 0 12px; padding: 0 6px; color: var(--ink-1); }
.intro h1 { max-width: 16em; margin: 0 0 8px; color: var(--ink); font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -.035em; line-height: 1.18; }
.intro p { max-width: 40ch; margin: 0 0 16px; line-height: 1.55; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: transparent; color: var(--ink-2); border-radius: 7px; padding: 6px 10px; font-size: var(--text-sm); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--border-strong); color: var(--ink); }

.msg { min-width: 0; }
.msg .who { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font: 500 var(--text-mono) var(--font-mono); letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--ink-3); }
.msg.log .who > span:first-child { color: var(--accent-text); }
.msg.you .text { padding: 8px 12px; border-radius: 12px; background: var(--bg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .x { all: unset; cursor: pointer; margin-left: auto; padding: 0 4px; font-size: 16px; line-height: 1; color: var(--ink-3); border-radius: 4px; }
.msg .x:hover { color: var(--ink); }
.msg .x:focus-visible { outline: 2px solid var(--accent); }
.msg .answer { margin: 6px 0 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .answer.error { color: var(--neg); }
.msg ol { list-style: none; margin: 4px 0 0; padding: 0; }
.msg li { display: flex; gap: 8px; color: var(--ink-3); font-size: var(--text-sm); padding: 2px 0; overflow-wrap: anywhere; }
.msg li::before { content: "✓"; color: var(--pos); width: 12px; flex: none; }
.msg li.now { color: var(--ink-2); }
.msg li.now::before { content: "•"; color: var(--accent-text); }
.msg .more { all: unset; cursor: pointer; color: var(--ink-3); font-size: var(--text-sm); padding: 2px 0; }
.msg .more:hover { color: var(--ink); }
.msg .more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.note { margin: 0; padding: 6px 0; border-top: 1px solid var(--border); color: var(--ink-3); font-size: var(--text-sm); overflow-wrap: anywhere; }

.changes { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 2px; }
.changes-head { color: var(--ink-2); font-size: var(--text-sm); margin-bottom: 2px; }
.change { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 8px; padding: 2px 4px; border-radius: 6px; font: var(--text-sm) var(--font-mono); color: var(--ink-1); overflow-wrap: anywhere; }
.change:hover:not(:disabled) { background: var(--bg-2); }
.change:disabled { cursor: default; color: var(--ink-3); }
.change:focus-visible { outline: 2px solid var(--accent); }
.change .sign { width: 10px; flex: none; text-align: center; }
.change.added .sign { color: var(--pos); }
.change.changed .sign { color: var(--accent-text); }
.change.removed .sign { color: var(--neg); }
.changes.back .change { text-decoration: line-through; color: var(--ink-3); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.acts .ghost { height: 28px; padding: 0 10px; font-size: var(--text-sm); }

.y-pill { font-size: var(--text-sm); font-weight: 500; padding: 2px 10px; border-radius: 999px; white-space: nowrap; background: var(--bg-2); color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }
.y-pill.working { color: var(--accent-text); }
.y-pill.done { color: var(--pos); }
.y-pill.error { color: var(--neg); }
.y-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.y-pill.working .dot, .msg li.now::before { animation: y-pulse 1s ease-in-out infinite; }
@keyframes y-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .y-pill.working .dot, .msg li.now::before { animation: none; } }

.y-problems { flex: none; max-height: 30%; overflow-y: auto; padding: 10px 16px 0; border-top: 1px solid var(--border); }
#y-problems div { font: var(--text-sm) var(--font-mono); color: var(--neg); padding: 2px 0; overflow-wrap: anywhere; }

/* Signing in and the person's own Claude: shown when a message needs them. */
#y-who:empty { display: none; }
#y-who { flex: none; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.connect { display: flex; flex-direction: column; gap: 8px; }
.connect-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.connect-row b { flex: 1; min-width: 160px; font-weight: 600; }
.connect-row .field { flex: 1; margin: 0; min-width: 160px; }
.connect .muted { margin: 0; }

.composer { flex: none; margin: 10px 12px 12px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-1); transition: border-color .15s; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { display: block; width: 100%; min-height: 64px; max-height: 40vh; resize: none; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); font: inherit; }
.composer textarea:focus { outline: none; }
.composer .bar { display: flex; gap: 8px; align-items: center; padding: 4px 4px 4px 12px; }
.composer .hint { flex: 1; min-width: 0; color: var(--ink-3); font-size: var(--text-sm); }

/* ---- the files of the workspace, on the stage ---- */
#files { display: flex; flex-direction: column; overflow: hidden; }
.files-head { flex: none; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.files-head h2 { margin: 0 0 4px; }
.files-head .muted { margin: 0; max-width: 70ch; }
.files-head .actions { flex-wrap: wrap; margin-top: 10px; }
.files-head .actions .muted { margin: 0; }
.files-body { flex: 1; min-height: 0; display: flex; }
#f-list { width: 240px; flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--border); }
#f-list button { all: unset; box-sizing: border-box; cursor: pointer; padding: 6px 8px; border-radius: 8px; font: var(--text-sm) var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
#f-list button:hover { color: var(--ink); }
#f-list button[aria-current="true"] { background: var(--bg-2); color: var(--ink); }
#f-list button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.files-view { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.files-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
#f-path { flex: 1; min-width: 0; font: var(--text-sm) var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
#f-text { flex: 1; min-height: 0; overflow: auto; margin: 0 12px 12px; }

/* ---- a phone: one of the two on screen, the switch in the bar ---- */
.seg { display: none; padding: 2px; border: 1px solid var(--border); border-radius: 10px; }
.seg button { all: unset; cursor: pointer; height: 28px; line-height: 28px; padding: 0 12px; border-radius: 8px; font-size: var(--text-sm); color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 780px) {
  #panel-left, #panel-right { display: none !important; }
  body.studio .seg { display: flex; }
  body.studio #shell-name { display: none; }
  body.studio #chat { flex: 1; width: auto; margin-right: 8px; }
  body.studio[data-pane="chat"] #work { display: none; }
  body.studio[data-pane="preview"] #chat { display: none; }
  .files-body { flex-direction: column; }
  #f-list { width: auto; max-height: 32%; border-right: 0; border-bottom: 1px solid var(--border); }
}
