/* Dojo Chat — model buttons, the work panel beside the chat, the Browser tab
   and the Sounds card. Same "Console" look as style.css. */

/* ───────── desktop top bar: the menu button is hidden there, so the picker
   takes the first column instead of being squeezed into 40px ───────── */
@media (min-width: 1024px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding-left: 14px; }
  .topbar .picker-pill { justify-self: start; }
}

/* the work-panel button in the top bar */
.dock-btn { position: relative; font-size: 16px; }
.dock-btn[aria-pressed="true"] { color: var(--accent-2); }
.dock-btn.dk-busy::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: dk-pulse 1.1s ease-in-out infinite;
}

/* ═════════════ model buttons above the message box ═════════════ */
.composer-wrap { position: relative; }
.model-bar {
  max-width: var(--col);
  margin: 0 auto 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 0;
}
.model-bar::-webkit-scrollbar { display: none; }
.mb-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 260px;
  padding: 3px 10px 3px 5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background-image: var(--sheen), var(--fill-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 8px rgba(0,0,0,0.45);
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease, transform .1s ease;
}
.mb-chip:hover, .mb-chip[aria-expanded="true"] { border-color: rgba(93,194,30,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), var(--glow); }
.mb-chip:active { transform: translateY(1px); }
.mb-chip.on { border-color: rgba(93,194,30,.55); }
.mb-chip.off { opacity: .62; }
.mb-chip.off:hover { opacity: 1; }
.mb-chip .badge { flex: none; }
.mb-mode { padding-left: 10px; }
.mb-ico { color: var(--accent-2); font-size: 13px; }
.mb-name { font-weight: 700; white-space: nowrap; }
.mb-model { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-chip.on .mb-model { color: var(--accent-2); }
.mb-caret { color: var(--muted); font-size: 10px; margin-left: 1px; }

.mb-pop {
  position: absolute;
  z-index: 60;
  max-height: min(430px, 60vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background-color: #0e130f;
  background-image: var(--sheen), var(--fill);
  box-shadow: 0 22px 50px rgba(0,0,0,.75), 0 0 0 1px rgba(93,194,30,.16);
  animation: mb-up .16s ease;
}
@keyframes mb-up { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
.mb-pop-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; font-size: 13px; }
.mb-pop-head strong { flex: 1; }
.mb-state { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.mb-state.yes { color: var(--accent-2); border-color: rgba(93,194,30,.45); background: rgba(93,194,30,.1); }
.mb-list { display: flex; flex-direction: column; gap: 3px; }
.mb-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 11px; background: none;
  color: var(--text); font: inherit; cursor: pointer;
}
.mb-opt:hover, .mb-opt:focus-visible { background: rgba(255,255,255,.06); border-color: var(--line); outline: none; }
.mb-opt.on { background: rgba(93,194,30,.13); border-color: rgba(93,194,30,.45); }
.mb-opt[disabled] { opacity: .45; cursor: default; }
.mb-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-opt-title { font-weight: 700; font-size: 14px; }
.mb-opt-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-opt-right { color: var(--muted); font-size: 11px; text-align: right; line-height: 1.25; font-variant-numeric: tabular-nums; }
.mb-opt-right small { display: block; font-size: 10px; }
.mb-tick { width: 16px; color: var(--accent-2); font-weight: 800; }
.mb-more { margin-top: 6px; }
.mb-more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 6px 8px; }
.mb-note { color: var(--muted); font-size: 12px; margin: 6px 6px; }
.mb-foot { margin-top: 8px; padding: 8px 6px 2px; border-top: 1px solid var(--line); }
.mb-link { margin: 6px 4px 2px; background: none; border: 0; color: var(--accent-2); font: inherit; font-size: 12.5px; cursor: pointer; }

@media (max-width: 520px) {
  .mb-name { display: none; }
  .mb-mode .mb-name { display: inline; }
  .mb-chip { max-width: 190px; }
}

/* ═════════════ the work panel ═════════════ */
:root { --dock-w: min(100vw, 440px); }
@media (min-width: 1100px) {
  :root { --dock-w: clamp(380px, 38vw, 680px); }
  body.dock-open .main { margin-right: var(--dock-w); transition: margin-right .26s ease; }
  /* keep pop-ups centred over the chat, not under the panel */
  body.dock-open .toast,
  body.dock-open .picker { left: calc((var(--nav) + 100vw - var(--dock-w)) / 2); }
}

.dk {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45;
  width: var(--dock-w);
  display: flex; flex-direction: column;
  background-color: #0b100c;
  background-image:
    radial-gradient(120% 50% at 50% -10%, rgba(93,194,30,.10), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(20,26,21,.97), rgba(7,10,8,.98));
  border-left: 1px solid rgba(93,194,30,.38);
  box-shadow: -14px 0 36px rgba(0,0,0,.5), inset 1px 0 0 rgba(255,255,255,.05);
  transform: translateX(105%); visibility: hidden;
  transition: transform .26s ease, visibility 0s linear .26s;
}
.dk.dk-shown { transform: none; visibility: visible; transition: transform .26s ease; }

.dk-bar {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; gap: 4px;
  height: calc(var(--bar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, rgba(26,32,27,0.95), rgba(10,14,11,0.95));
  overflow-x: auto; scrollbar-width: none;
}
.dk-bar::-webkit-scrollbar { display: none; }
.dk-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(93,194,30,0), rgba(93,194,30,.8), rgba(93,194,30,0));
  box-shadow: 0 0 12px rgba(93,194,30,.5);
}
.dk-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.dk-tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.dk-tab.on {
  color: var(--text); border-color: rgba(93,194,30,.5);
  background-image: var(--sheen), linear-gradient(180deg, rgba(93,194,30,.22), rgba(93,194,30,.08));
  box-shadow: 0 0 12px rgba(93,194,30,.25);
}
.dk-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; line-height: 18px; text-align: center;
  background: rgba(255,255,255,.12); color: var(--text);
}
.dk-badge.busy { background: var(--accent); color: var(--ink); box-shadow: 0 0 10px rgba(93,194,30,.6); }
.dk-badge.busy:empty { min-width: 9px; width: 9px; height: 9px; padding: 0; animation: dk-pulse 1.1s ease-in-out infinite; }
.dk-bar-gap { flex: 1; }
.dk-x {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--muted); font: inherit; cursor: pointer;
}
.dk-x:hover { color: var(--text); border-color: rgba(93,194,30,.5); }
.dk-grip { display: none; }

.dk-body { flex: 1 1 auto; min-height: 0; position: relative; }
.dk-view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dk-view.hidden { display: none; }

/* Projects and Files docked beside the chat */
.dk-view > .fullsheet.dk-docked {
  position: absolute; inset: 0; z-index: auto; left: 0;
  background: transparent; animation: none;
}
.dk-view > .fullsheet.dk-docked .sheet-head { height: 48px; padding-top: 0; }
.dk-view > .fullsheet.dk-docked .sheet-head::after { display: none; }
.dk-view > .fullsheet.dk-docked .sheet-body { max-width: none; padding: 12px 14px 28px; }
@media (min-width: 1100px) {
  .dk-view .proj-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* ── Activity ── */
.dk-activity { padding: 14px 14px 30px; }
.dk-now {
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background-image: var(--sheen), var(--fill); box-shadow: var(--panel-shadow);
  padding: 12px 12px 10px; margin-bottom: 16px;
}
.dk-now[data-state="working"] { border-color: rgba(93,194,30,.5); box-shadow: var(--panel-shadow), 0 0 22px rgba(93,194,30,.18); }
.dk-now[data-state="waiting"] { border-color: rgba(255,212,119,.6); box-shadow: var(--panel-shadow), 0 0 22px rgba(255,212,119,.18); }
.dk-now-head { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .02em; }
.dk-now-title { flex: 1; text-transform: uppercase; font-size: 12.5px; letter-spacing: .14em; }
.dk-now-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dk-dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6a58; flex: none; }
.dk-now[data-state="working"] .dk-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: dk-pulse 1.1s ease-in-out infinite; }
.dk-now[data-state="waiting"] .dk-dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: dk-pulse .8s ease-in-out infinite; }
.dk-now[data-state="done"] .dk-dot { background: var(--good); }
.dk-now[data-state="failed"] .dk-dot { background: var(--bad); }
@keyframes dk-pulse { 50% { opacity: .35; } }
.dk-ask {
  margin: 8px 0 10px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.45;
  background: rgba(0,0,0,.28); border: 1px solid var(--line); color: var(--text);
  overflow-wrap: anywhere;
}
.dk-wait {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between;
  margin: 0 0 10px; padding: 9px 11px; border-radius: 11px; font-size: 13px;
  background: rgba(255,212,119,.10); border: 1px solid rgba(255,212,119,.45);
}
.dk-wait.hidden, .dk-done-note.hidden, .dk-now.hidden, .dk-idle.hidden { display: none; }
.dk-live .live-panel { margin: 0; }
.dk-live .live-panel.dk-in { box-shadow: none; }
.dk-done-note { margin: 8px 2px 0; color: var(--good); font-size: 13px; }
.dk-idle { text-align: center; padding: 26px 18px 22px; color: var(--text); }
.dk-idle p { margin: 4px 0; }
.dk-idle .muted { font-size: 13px; line-height: 1.5; }
.dk-idle-ico { font-size: 30px; margin-bottom: 6px; filter: drop-shadow(0 0 10px rgba(93,194,30,.6)); }
.dk-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 8px; }
.dk-sec-head h4 { margin: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-2); }
.dk-tasks { display: flex; flex-direction: column; gap: 6px; }
.dk-tasks-empty { font-size: 13px; margin: 2px; }
.dk-task {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.035); color: var(--text); font: inherit; cursor: pointer;
}
.dk-task:hover { border-color: rgba(93,194,30,.45); background: rgba(93,194,30,.07); }
.dk-task-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a6a58; flex: none; }
.dk-task.working .dk-task-dot { background: var(--accent); box-shadow: 0 0 9px var(--accent); animation: dk-pulse 1.1s infinite; }
.dk-task.st-done .dk-task-dot { background: var(--good); }
.dk-task.st-paused .dk-task-dot, .dk-task.st-stopped .dk-task-dot { background: var(--warn); }
.dk-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dk-task-name { font-weight: 700; font-size: 13.5px; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-task-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-task-cost { color: var(--accent-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.web-ask.dk-flash { animation: dk-flash 1.6s ease; }
@keyframes dk-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(255,212,119,.7), 0 0 30px rgba(255,212,119,.5); } }

/* the little button on phones when the panel is closed */
.dk-pill {
  position: fixed; right: 14px; bottom: calc(132px + env(safe-area-inset-bottom)); z-index: 44;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--text);
  background-color: #0c110d; background-image: var(--sheen), var(--fill);
  border: 1px solid rgba(93,194,30,.45); box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.dk-pill.hidden { display: none; }
.dk-pill.dk-busy .dk-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: dk-pulse 1.1s infinite; }

/* phones and small windows: a sheet that slides up from the bottom */
@media (max-width: 1099px) {
  .dk {
    top: auto; left: 0; width: 100%; height: 66vh; max-height: calc(100% - 48px);
    border-left: 0; border-top: 1px solid rgba(93,194,30,.45); border-radius: 18px 18px 0 0;
    transform: translateY(105%); z-index: 65;
  }
  .dk.dk-shown { transform: none; }
  .dk.dk-tall { height: calc(100% - 48px); }
  .dk-grip { display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2;
    width: 80px; height: 16px; border: 0; background: transparent; cursor: pointer; padding: 0; }
  .dk-grip span { display: block; width: 42px; height: 5px; margin: 6px auto 0; border-radius: 3px; background: rgba(255,255,255,.3); }
  .dk-bar { height: 54px; padding-top: 12px; border-radius: 18px 18px 0 0; }
  .dk-sheet-tab { display: none; }
}

/* ═════════════ the Browser tab ═════════════ */
.bp { display: flex; flex-direction: column; }
.bp-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; font-size: 12.5px; color: var(--muted); }
.bp-status { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6a58; flex: none; }
.bp.bp-busy .bp-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: dk-pulse 1.1s ease-in-out infinite; }
.bp-btn { border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: inherit; font: inherit; font-size: 12px; border-radius: 9px; padding: 5px 10px; cursor: pointer; }
.bp-btn:hover { background: rgba(93,194,30,.18); }
.bp-btn.hidden { display: none; }
.bp-bar {
  display: flex; align-items: center; gap: 8px; margin: 10px 14px 6px; padding: 7px 11px;
  border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: 13px;
}
.bp-lock { flex: none; font-size: 12px; }
.bp-url { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.bp-ext { flex: none; color: var(--good); text-decoration: none; font-weight: 700; padding: 0 4px; }
.bp-ext.hidden, .bp-tabs.hidden { display: none; }
.bp-tabs { display: flex; gap: 6px; padding: 4px 14px 8px; overflow-x: auto; scrollbar-width: thin; flex: none; }
.bp-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; flex: none;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit;
  font: inherit; font-size: 12px; border-radius: 10px; padding: 5px 9px; cursor: pointer; }
.bp-tab.on { border-color: rgba(93,194,30,.6); background: rgba(93,194,30,.16); box-shadow: 0 0 10px rgba(93,194,30,.25); }
.bp-tab.st-failed { opacity: .7; }
.bp-tab-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-tab-ico { flex: none; display: inline-flex; }
.bp-view { flex: 1 1 auto; padding: 0 14px 10px; }
.bp-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #0b0f0c; }
.bp-shot { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .3s ease; }
.bp-shot.ready { opacity: 1; }
.bp-loading { min-height: 280px; padding: 16px; }
.bp-skel i { display: block; height: 14px; border-radius: 7px; margin: 0 0 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%; animation: bp-shimmer 1.3s linear infinite; }
.bp-skel i:nth-child(1) { width: 55%; height: 22px; }
.bp-skel i:nth-child(2) { width: 92%; }
.bp-skel i:nth-child(3) { width: 80%; }
.bp-skel i:nth-child(4) { width: 66%; height: 120px; }
@keyframes bp-shimmer { to { background-position: -200% 0; } }
.bp-loading-txt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bp-spin { width: 13px; height: 13px; border-radius: 50%; display: inline-block; flex: none;
  border: 2px solid rgba(93,194,30,.25); border-top-color: var(--accent); animation: bp-spin .8s linear infinite; }
@keyframes bp-spin { to { transform: rotate(360deg); } }
.bp-noshot { padding: 28px 16px; text-align: center; color: var(--muted); }
.bp-noshot > div { font-size: 28px; }
.bp-noshot a { color: var(--good); }
.bp-empty { text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.5; padding: 36px 20px; }
.bp-empty strong { color: var(--text); }
.bp-empty-ico { font-size: 30px; margin-bottom: 6px; filter: drop-shadow(0 0 10px rgba(93,194,30,.5)); }
.bp-results { display: flex; flex-direction: column; gap: 12px; }
.bp-summary { margin: 0; font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border-radius: 10px;
  background: rgba(93,194,30,.08); border: 1px solid rgba(93,194,30,.25); }
.bp-result { padding: 2px 2px 10px; border-bottom: 1px solid var(--line); }
.bp-r-host { font-size: 11.5px; color: var(--muted); }
.bp-r-title { display: block; font-weight: 650; color: var(--good); text-decoration: none; margin: 2px 0; }
.bp-r-title:hover { text-decoration: underline; }
.bp-r-snip { font-size: 12.5px; line-height: 1.45; opacity: .85; }
.bp-muted { color: var(--muted); }
.bp-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 14px 14px; font-size: 12px; color: var(--muted); }
.bp-foot:empty { display: none; }
.bp-step.ok { color: var(--good); }
.bp-step.bad { color: var(--bad); }
.bp-step.now::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; background: var(--accent); animation: dk-pulse 1.1s infinite; }

/* ═════════════ Sounds card ═════════════ */
.snd-card .snd-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.snd-card input[type="range"] { flex: 1; accent-color: var(--accent); }
.snd-card output { min-width: 42px; text-align: right; color: var(--accent-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.snd-tests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.snd-card.snd-off .snd-row-vol, .snd-card.snd-off .snd-clicks { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  .dk, .dk.dk-shown, body.dock-open .main { transition: none; }
  .dk-dot, .dk-badge, .bp-dot, .bp-spin, .bp-skel i { animation: none !important; }
}
