/* The main agent's Work tab (public/main-agent-world.js): goals, waiting,
   ideas, people and the overnight line. Rows reuse the agent sheet's .as-row;
   only what is new lives here. Untinted grays; red only for a blocked dot. */
.mw-view { display:flex; flex-direction:column; gap:6px; }
.mw-section .as-rows { gap:1px; }
.mw-row .as-row-time { max-width:9.5em; overflow:hidden; text-overflow:ellipsis; }
.mw-idea { position:relative; display:flex; align-items:center; }
.mw-idea > .as-row { flex:1; min-width:0; padding-right:44px; }
.mw-dismiss { position:absolute; right:2px; top:50%; transform:translateY(-50%); width:36px; height:36px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; color:var(--ink-3); cursor:pointer; }
.mw-dismiss:hover { background:var(--hover); color:var(--ink); }
.mw-dismiss:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.mw-dismiss svg { width:16px; height:16px; }
.mw-idea .as-row-time { margin-right:2px; }
.mw-empty { color:var(--ink-3); }

/* the dialogs */
.mw-dialog { display:flex; flex-direction:column; gap:10px; overflow:auto; min-height:0; }
.mw-line { margin:0; color:var(--ink-3); font-size:var(--text-sm); }
.mw-h { margin:6px 0 0; font-size:var(--text-sm); font-weight:600; color:var(--ink-2); }
.mw-brief { padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius-box, 16px); background:var(--panel-2); }
.mw-brief h3 { margin:0 0 6px; font-size:var(--text-sm); font-weight:600; color:var(--ink-2); }
.mw-brief p { margin:4px 0 0; font-size:var(--text-md); line-height:1.45; }
.mw-dev a { color:var(--ink); text-decoration:underline; }
.mw-items, .mw-log { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.mw-item { display:flex; flex-wrap:wrap; align-items:center; gap:2px 10px; }
.mw-item-title { flex:1 1 60%; font-size:var(--text-md); font-weight:500; }
.mw-item-sub { flex:1 1 100%; font-size:var(--text-sm); color:var(--ink-3); }
.mw-item .btn { flex:none; }
.mw-log li { display:flex; justify-content:space-between; gap:10px; font-size:var(--text-sm); }
.mw-log time { flex:none; color:var(--ink-3); }
.mw-plan summary { cursor:pointer; font-size:var(--text-sm); font-weight:600; color:var(--ink-2); }
.mw-plan pre { margin:8px 0 0; white-space:pre-wrap; font-family:var(--font); font-size:var(--text-sm); }
.mw-switch { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; font-size:var(--text-md); }

@media (max-width: 900px) {
  .mw-dismiss { width:44px; height:44px; }
  .mw-idea > .as-row { padding-right:52px; }
  .mw-line, .mw-log li, .mw-item-sub, .mw-h { font-size:15px; }
  .mw-item-title, .mw-brief p, .mw-switch { font-size:17px; }
}

/* a chat's scope: the pill under the agent's name (only while set) and the picker */
.mw-scope-pill { display:inline-flex; align-items:center; gap:6px; height:28px; margin-top:4px; padding:0 12px; border:1px solid var(--line); border-radius:999px; background:var(--panel-2); color:var(--ink); font:inherit; font-size:var(--text-sm); cursor:pointer; }
.mw-scope-pill[hidden] { display:none; }
.mw-scope-pill svg { width:14px; height:14px; }
.mw-scope-pill:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.mw-choices { display:flex; flex-wrap:wrap; gap:8px; }
.mw-choice { display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 16px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink); font:inherit; font-size:var(--text-md); cursor:pointer; }
.mw-choice:hover { background:var(--hover); }
.mw-choice.is-on { background:var(--ink); color:var(--bg); border-color:var(--ink); }
.mw-choice-kind { font-size:var(--text-xs); color:inherit; opacity:.7; }
.mw-new-scope { display:flex; flex-direction:column; gap:8px; }
@media (max-width: 900px) {
  .mw-scope-pill { height:36px; font-size:15px; }
  .mw-choice { min-height:44px; font-size:16px; }
}
/* In the chat header: under the agent's name, like the status pill (which
   takes its place while a turn runs); the conversation starts below it. */
.thread-agent-float > .mw-scope-pill { position:absolute; top:calc(100% + 8px); left:50%; transform:translateX(-50%); margin:0; pointer-events:auto; white-space:nowrap;
  max-width:min(260px, calc(100cqw - 32px)); overflow:hidden; text-overflow:ellipsis; box-shadow:0 2px 10px rgba(0,0,0,.28); }
:root[data-theme="light"] .thread-agent-float > .mw-scope-pill { box-shadow:0 2px 10px rgba(0,0,0,.08); }
.thread-top:has(.thread-status:not([hidden])) .mw-scope-pill { display:none; }
.thread-top:has(.mw-scope-pill:not([hidden])) ~ .chat-scroll > .chat-msgs { padding-top:calc(var(--thread-top-h) + 48px); }
