/* Founder extras: the Ask side panel.  Same tokens as shell.css. */
.nav-item[hidden], .nav-sec[hidden] { display:none !important; }

/* ── Ask side panel: a third column on a laptop ── */
.layout.has-rail { grid-template-columns:var(--sb-w) minmax(0,1fr) var(--ask-w, 340px); }
.ask-rail { position:sticky; top:0; height:100vh; background:var(--surface); border-left:1px solid var(--border);
  display:flex; flex-direction:column; min-width:0; }
.ask-rail[hidden] { display:none; }
.ask-grip { position:absolute; left:-4px; top:0; bottom:0; width:8px; cursor:col-resize; z-index:5; }
.ask-grip:hover, body.ask-resizing .ask-grip { background:linear-gradient(90deg, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
body.ask-resizing { cursor:col-resize; user-select:none; }
#ask-wide-btn.on i { transform:rotate(180deg); }

/* ── replies: readable type, rendered Markdown ── */
.ask-msg.bot { white-space:normal; font-size:14px; line-height:1.6; max-width:100%; padding:12px 14px; }
.ask-msg.bot .md-p { margin:0 0 8px; }
.ask-msg.bot > :last-child { margin-bottom:0; }
.ask-msg.bot .md-h { font-weight:700; color:var(--t1); margin:10px 0 6px; }
.ask-msg.bot .md-h1, .ask-msg.bot .md-h2 { font-size:15px; }
.ask-msg.bot .md-h3, .ask-msg.bot .md-h4 { font-size:14px; }
.ask-msg.bot > .md-h:first-child { margin-top:0; }
.ask-msg.bot .md-list { margin:0 0 8px; padding-left:20px; }
.ask-msg.bot .md-list li { margin:2px 0; }
.ask-msg.bot .md-quote { margin:0 0 8px; padding:6px 10px; border-left:3px solid var(--accent); background:var(--surface2); border-radius:4px; }
.ask-msg.bot .md-hr { border:none; border-top:1px solid var(--border); margin:10px 0; }
.ask-msg.bot code { font-family:var(--mono, ui-monospace, monospace); font-size:12px; background:var(--surface2); padding:1px 4px; border-radius:4px; }
.ask-msg.bot .md-pre { font-family:var(--mono, ui-monospace, monospace); font-size:12px; background:var(--surface2); padding:8px 10px; border-radius:6px; overflow-x:auto; white-space:pre; margin:0 0 8px; }
.ask-msg.bot a { color:var(--accent); text-decoration:underline; }
.ask-msg.bot .md-table-wrap { overflow-x:auto; margin:0 0 8px; }
.ask-msg.bot .md-table { border-collapse:collapse; font-size:13px; width:100%; }
.ask-msg.bot .md-table th, .ask-msg.bot .md-table td { border:1px solid var(--border); padding:5px 8px; text-align:left; vertical-align:top; }
.ask-msg.bot .md-table th { background:var(--surface2); font-weight:600; }

/* ── steps: one quiet line per turn; open it to see what ran ── */
.ask-steps { align-self:flex-start; font-size:12px; color:var(--t3); }
.ask-steps-sum { cursor:pointer; list-style:none; display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border-radius:12px; }
.ask-steps-sum::-webkit-details-marker { display:none; }
.ask-steps-sum:hover { background:var(--surface2); color:var(--t2); }
.ask-steps-dot { width:7px; height:7px; border-radius:50%; background:#2e9d6a; }
.ask-steps.live .ask-steps-dot { background:var(--accent); animation:askPulse 1s ease-in-out infinite; }
@keyframes askPulse { 50% { opacity:.3; } }
.ask-steps-list { margin:4px 0 0; padding-left:22px; }
.ask-step { margin:2px 0; }
.ask-step.err .ask-step-name { color:#d64545; }
.ask-step-name { color:var(--t2); }
.ask-step-arg { margin-left:6px; font-family:var(--mono, ui-monospace, monospace); font-size:11px; color:var(--t3); word-break:break-all; }
.ask-head { display:flex; align-items:center; gap:10px; padding:18px 16px 14px; border-bottom:1px solid var(--border); }
.ask-av { width:30px; height:30px; border-radius:8px; background:var(--accent); color:#fff; display:flex;
  align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0; }
.ask-who { flex:1; min-width:0; }
.ask-name { font-size:14px; font-weight:600; color:var(--t1); }
.ask-role { font-size:11px; color:var(--t3); }
.ask-x { border:none; background:none; color:var(--t3); cursor:pointer; padding:6px; font-size:14px; }
.ask-x:hover { color:var(--accent); }
.ask-log { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }
.ask-msg { max-width:88%; padding:10px 12px; border-radius:14px; font-size:13px; line-height:1.5; white-space:pre-wrap; }
.ask-msg.user { align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
.ask-msg.bot { align-self:flex-start; background:var(--surface); border:1px solid var(--border); color:var(--t1);
  border-bottom-left-radius:4px; }
.ask-chips { display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 10px; }
.ask-chip { border:1px solid var(--border); background:var(--surface2); color:var(--t2); border-radius:20px;
  padding:5px 10px; font:500 11px var(--font); cursor:pointer; }
.ask-chip:hover { border-color:var(--accent); color:var(--accent); }
.ask-form { display:flex; gap:8px; padding:0 16px; align-items:flex-end; }
.ask-form textarea { flex:1; min-width:0; resize:none; padding:9px 11px; font-size:13px; }
.ask-form textarea:focus { outline:none; border-color:var(--accent); }
.ask-foot { font-size:11px; color:var(--t3); padding:10px 16px 16px; }
.ask-edge { position:fixed; right:0; top:50%; transform:translateY(-50%); writing-mode:vertical-rl;
  background:var(--accent); color:#fff; border:none; border-radius:10px 0 0 10px; padding:14px 8px;
  font:600 12px var(--font); cursor:pointer; display:flex; gap:8px; align-items:center; z-index:40; }
.ask-edge[hidden] { display:none; }
.ask-edge i { transform:rotate(90deg); }

/* ── Agent-only account (#239): the panel is the whole page; no tenant screens behind it ── */
body.agent-only main, body.agent-only #ask-close-btn, body.agent-only .ask-edge { display:none !important; }
body.agent-only .layout.has-rail { grid-template-columns:var(--sb-w) minmax(0,1fr); }
body.agent-only .ask-rail { border-left:none; }

/* ── Phone: the panel becomes a sheet over the page, opened from the tab bar ── */
@media (max-width:768px) {
  .layout.has-rail { display:block; }
  .ask-rail { position:fixed; left:0; right:0; top:56px; bottom:0; height:auto; z-index:150; border-left:none;
    border-top:1px solid var(--border); border-radius:16px 16px 0 0; box-shadow:0 -8px 30px rgba(10,15,40,.15);
    padding-bottom:76px; }
  .ask-edge { display:none !important; }
}

/* Phone: Today task rows wrap, the title gets its own full-width line (rows use inline styles in ops.js) */
@media (max-width:768px) {
  #su-body .card > div > div[style*="display:flex"] { flex-wrap:wrap; row-gap:4px; }
  #su-body [data-su-toggle] { flex:1 1 100% !important; order:-1; }
}

/* ── Ask session (#25): persona picker, work pane, tool rows, approval cards, viewer ── */
.ask-x.on { color:var(--accent); }
.ask-x[hidden] { display:none; }
.ask-personas { display:flex; align-items:center; gap:8px; padding:10px 16px; border-bottom:1px solid var(--border); }
.ask-personas[hidden] { display:none; }
.ask-plabel { font-size:11px; color:var(--t3); flex-shrink:0; }
.ask-personas select { flex:1; min-width:0; font:500 12px var(--font); padding:6px 8px; }
.ask-work { border-bottom:1px solid var(--border); padding:10px 16px; max-height:34vh; overflow-y:auto; }
.ask-work[hidden] { display:none; }
.ask-work-head { display:flex; align-items:center; justify-content:space-between; font-size:12px; font-weight:600;
  color:var(--t2); margin-bottom:8px; }
.ask-up { font-size:11px; padding:5px 10px; cursor:pointer; display:inline-flex; gap:6px; align-items:center; }
.ask-files { display:flex; flex-direction:column; gap:2px; }
.ask-file { display:flex; gap:8px; align-items:center; text-align:left; border:none; background:none; padding:5px 6px;
  border-radius:6px; font:12px var(--mono, ui-monospace, monospace); color:var(--t1); cursor:pointer; min-width:0; }
.ask-file span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ask-file i { color:var(--t3); font-size:10px; width:12px; flex-shrink:0; }
.ask-file.w i { color:var(--accent); }
.ask-file:hover { background:var(--surface2); }
.ask-empty { font-size:12px; color:var(--t3); padding:4px 0; }
.ask-tool { align-self:stretch; display:flex; gap:8px; align-items:baseline; font-size:11px; color:var(--t3);
  padding:4px 8px; border-left:2px solid var(--border); min-width:0; }
.ask-tool.sub { margin-left:12px; }
.ask-tool.ok { border-left-color:#2e9d6a; }
.ask-tool.err { border-left-color:#d64545; }
.ask-tool-name { font-weight:600; color:var(--t2); flex-shrink:0; }
.ask-tool-arg { font-family:var(--mono, ui-monospace, monospace); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ask-appr { align-self:stretch; border:1px solid var(--accent); border-radius:12px; padding:10px 12px; background:var(--surface); }
.ask-appr-title { font-size:12px; font-weight:600; color:var(--t1); margin-bottom:6px; }
.ask-appr-body { margin:0; font:11px/1.45 var(--mono, ui-monospace, monospace); background:var(--surface2); color:var(--t1);
  padding:8px; border-radius:8px; white-space:pre-wrap; word-break:break-word; max-height:220px; overflow:auto; }
.ask-appr-why { font-size:11px; color:var(--t3); margin-top:6px; }
.ask-appr-btns { display:flex; gap:8px; margin-top:8px; }
.ask-appr-btns .btn { padding:6px 12px; font-size:12px; }
.ask-appr-done { font-size:11px; font-weight:600; margin-top:8px; }
.ask-appr-done.ok, .ask-note.ok { color:#2e9d6a; }
.ask-appr-done.err, .ask-note.err { color:#d64545; }
.ask-note { align-self:center; font-size:11px; color:var(--t3); }
.ask-cost { align-self:flex-start; font-size:10px; color:var(--t3); }
.ask-status { display:flex; align-items:center; gap:8px; padding:0 16px 8px; font-size:11px; color:var(--t3); }
.ask-status[hidden] { display:none; }
.ask-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); animation:askPulse 1.2s infinite; }
@keyframes askPulse { 50% { opacity:.3; } }
.ask-stop { margin-left:auto; border:1px solid var(--border); background:var(--surface); color:var(--t2); border-radius:6px;
  font:500 11px var(--font); padding:4px 10px; cursor:pointer; }
.ask-stop:hover { border-color:#d64545; color:#d64545; }
.ask-form .btn:disabled { opacity:.5; cursor:default; }
.ask-viewer { position:fixed; inset:0; background:rgba(10,15,40,.45); z-index:300; display:flex; align-items:center;
  justify-content:center; padding:24px; }
.ask-viewer[hidden] { display:none; }
.ask-viewer-card { background:var(--surface); border-radius:14px; width:min(900px,100%); max-height:85vh; display:flex;
  flex-direction:column; overflow:hidden; box-shadow:0 20px 60px rgba(10,15,40,.3); }
.ask-viewer-head { display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--border);
  font:600 12px var(--mono, ui-monospace, monospace); color:var(--t1); }
.ask-viewer-head span:first-child { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ask-ro { font:500 10px var(--font); color:var(--t3); border:1px solid var(--border); border-radius:10px; padding:2px 8px; }
#ask-viewer-body { margin:0; padding:16px; overflow:auto; font:12px/1.5 var(--mono, ui-monospace, monospace); color:var(--t1);
  white-space:pre-wrap; word-break:break-word; }
@media (max-width:768px) {
  .ask-viewer { padding:0; align-items:stretch; }
  .ask-viewer-card { border-radius:0; max-height:none; }
}
@media (max-width:768px) {
  body.agent-only .ask-rail { top:56px; border-radius:0; box-shadow:none; }
}

/* ── Claude sign-in card (#36) ── */
.ask-claude { margin:10px 12px 0; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:var(--surface2); font-size:13px; }
.ask-claude-title { font-weight:700; color:var(--t1); margin-bottom:4px; }
.ask-claude-text { margin:0 0 10px; color:var(--t2); line-height:1.5; }
.ask-claude-steps { margin:0 0 10px; padding-left:20px; color:var(--t2); line-height:1.6; }
.ask-claude-steps a { color:var(--accent); text-decoration:underline; }
.ask-claude-row { display:flex; gap:6px; }
.ask-claude-row input { flex:1; min-width:0; padding:7px 9px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--t1); font-family:var(--mono, ui-monospace, monospace); font-size:12px; }
.ask-claude-err { margin-top:8px; color:#d64545; }
#ask-claude-btn.warn { color:#d98b1a; }
