/* ✨ Ask the CRM (mockups 03a/03b): the top-bar button + ask box, and the /ask results page.
   Scoped to .ask-wrap / .ask-page so no existing screen changes. --ai* variables come from whats_next.css. */

/* marketing.css styles bare <details>; the ask page's popovers are plain disclosure widgets */
.ask-page details { background:none; border:0; border-radius:0; padding:0; margin:0; box-shadow:none; }
.ask-page details > summary { list-style:none; display:inline-block; cursor:pointer; }
.ask-page details > summary::-webkit-details-marker { display:none; }

/* top bar: button and the ask box it opens */
.ask-wrap { position:relative; display:inline-flex; }
.ask-top .kbd { font-size:.66rem; font-weight:600; opacity:.8; border:1px solid rgba(255,255,255,.45); border-radius:4px; padding:0 .3rem; }
.ask-pop { position:absolute; top:calc(100% + 10px); right:0; width:min(560px, 92vw); z-index:60; background:#fff; color:#1f2937; border:1px solid var(--ai-line); border-radius:10px;
  box-shadow:0 10px 30px rgba(76,29,149,.18); padding:.6rem .7rem .5rem; text-align:left; }
.ask-pop[hidden] { display:none; }
.ask-pop::before { content:""; position:absolute; top:-8px; right:40px; width:14px; height:14px; background:#fff; border-left:1px solid var(--ai-line); border-top:1px solid var(--ai-line); transform:rotate(45deg); }
.ask-bar { display:flex; align-items:center; gap:.4rem; background:#fff; border-radius:6px; padding:.18rem .25rem .18rem .55rem; box-shadow:0 0 0 3px #c4b5fd; margin:0; }
.ask-bar .spark { color:var(--ai); font-size:1rem; }
.ask-bar input[type=text] { flex:1; border:0; outline:0; font:inherit; font-size:.92rem; padding:.3rem 0; color:#1f2937; background:transparent; min-width:0; box-shadow:none; }
.ask-bar .go { background:var(--ai); color:#fff; border:0; border-radius:4px; font:inherit; font-size:.82rem; font-weight:600; padding:.3rem .75rem; cursor:pointer; }
.ask-bar .go:disabled { opacity:.75; cursor:progress; }
.ask-tips { margin:.5rem .1rem 0; display:flex; flex-wrap:wrap; gap:.25rem .7rem; line-height:1.35; }
.topbar .ask-tips a, .ask-tips a { color:var(--ai-ink); font-size:.8rem; font-weight:500; text-decoration:underline; }

/* results page */
.ask-page .crumbs { color:var(--muted); margin:.1rem 0 .3rem; }
.ask-page .ask-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin:.2rem 0 .6rem; }
.ask-page .ask-q { font-size:1.35rem; font-weight:700; margin:.1rem 0; }
.ask-page .ask-q .qm { color:var(--ai); }
.ask-page .ask-actions { display:flex; gap:.45rem; align-items:flex-start; position:relative; }
.ask-page .ask-actions .btn { white-space:nowrap; }
.ask-page details > summary { list-style:none; cursor:pointer; }
.ask-page details > summary::-webkit-details-marker { display:none; }
.ask-page .ask-save-pop { position:absolute; top:calc(100% + 8px); right:0; width:320px; z-index:20; background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.14); padding:.7rem .8rem; }
.ask-page .ask-save-pop h4 { margin:0 0 .4rem; font-size:.95rem; }
.ask-page .ask-save-pop label { display:block; margin:.35rem 0 .15rem; }
.ask-page .ask-save-pop input[type=text], .ask-page .ask-save-pop select { width:100%; box-sizing:border-box; }
.ask-page .btnrow { display:flex; justify-content:flex-end; gap:.4rem; margin-top:.4rem; }

.ask-page .interp { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; background:#fff; border:1px solid var(--ai-line); border-radius:8px; padding:.5rem .7rem; margin:0 0 .8rem; }
.ask-page .interp .lbl { font-size:.75rem; font-weight:700; color:var(--ai-ink); text-transform:uppercase; letter-spacing:.05em; margin-right:.2rem; }
.ask-page .interp .sp { flex:1; }
.ask-page .ichip { position:relative; display:inline-flex; align-items:center; gap:.2rem; font-size:.84rem; background:var(--ai-soft); border:1px solid #c4b5fd; color:#312e81; border-radius:999px; padding:.12rem .35rem .12rem .6rem; white-space:nowrap; }
.ask-page .ichip b { font-weight:700; }
.ask-page .ichip .x { color:#7c3aed; font-size:.95rem; padding:0 .2rem; text-decoration:none; line-height:1; }
.ask-page .ichip .x:hover { color:#4c1d95; }
.ask-page .ichip.dflt { border-style:dashed; }
.ask-page .ichip.mod { background:var(--brand); color:#fff; border-color:var(--brand); padding-right:.6rem; }
.ask-page .ichip.add { background:#fff; border-style:dashed; color:var(--muted); padding-right:.6rem; }
.ask-page .ichip-edit { position:relative; display:inline-block; }
.ask-page .ichip-edit[open] > summary { text-decoration:underline; }
.ask-page .ichip-form { position:absolute; top:calc(100% + 8px); left:-.6rem; z-index:20; width:280px; display:grid; gap:.35rem; background:#fff; border:1px solid var(--ai-line); border-radius:8px;
  box-shadow:0 8px 24px rgba(76,29,149,.15); padding:.6rem .7rem; white-space:normal; color:#1f2937; }
.ask-page .ichip-form select, .ask-page .ichip-form input[type=text] { width:100%; box-sizing:border-box; font-size:.85rem; }
.ask-page .add-filter .ichip-form { width:320px; }

.ask-page .ask-grid { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:1rem; align-items:start; }
.ask-page .tbl-card { background:#fff; border:1px solid var(--line); border-radius:8px; overflow:auto; }
.ask-page .restbl { width:100%; border-collapse:collapse; background:#fff; font-size:.88rem; }
.ask-page .restbl th { text-align:left; font-size:.75rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:2px solid var(--line); padding:.45rem .5rem; white-space:nowrap; }
.ask-page .restbl th .sortlink { color:inherit; text-decoration:none; }
.ask-page .restbl th .sortlink:hover { text-decoration:underline; }
.ask-page .restbl td { border-bottom:1px solid var(--line); padding:.42rem .5rem; vertical-align:middle; }
.ask-page .restbl td.nowrap { white-space:nowrap; }
.ask-page .restbl td:first-child { min-width:11rem; }
.ask-page .restbl tr:last-child td { border-bottom:0; }
.ask-page .restbl td.hl, .ask-page .restbl th.hl { background:#faf5ff; }
.ask-page .restbl td.hl { font-weight:600; }
.ask-page .tbl-foot { display:flex; justify-content:space-between; gap:1rem; padding:.45rem .7rem; font-size:.8rem; color:var(--muted); border-top:1px solid var(--line); background:#fafbfc; }
.ask-page .ask-empty { padding:1.2rem .9rem; margin:0; }
.ask-page .ask-note { margin-top:.7rem; font-size:.86rem; background:#fff; border:1px solid var(--line); border-left:4px solid var(--brand); border-radius:4px; padding:.5rem .75rem; }
.ask-page .ask-side { background:#fff; border:1px solid var(--line); border-radius:6px; padding:.7rem .9rem .6rem; margin:0 0 1rem; }
.ask-page .ask-side h2 { font-size:1rem; margin:0 0 .45rem; }
.ask-page .ask-side table.mini { width:100%; font-size:.84rem; border-collapse:collapse; }
.ask-page .ask-side table.mini td { padding:.25rem .3rem .25rem 0; vertical-align:top; border-bottom:1px solid #eef0f3; }
.ask-page .ask-perm { display:flex; gap:.6rem; align-items:flex-start; background:#fff7ed; border:1px solid #fdba74; border-radius:6px; padding:.5rem .75rem; font-size:.8rem; color:#7c2d12; }
.ask-page .suggest { list-style:none; margin:0; padding:0; }
.ask-page .suggest li { padding:.32rem 0; border-bottom:1px solid #eef0f3; font-size:.88rem; }
.ask-page .suggest li:last-child { border-bottom:0; }
.ask-page .suggest li::before { content:"✨ "; color:var(--ai); }
.ask-page .suggest .link { background:none; border:0; padding:0; color:var(--brand); text-decoration:underline; cursor:pointer; font:inherit; }
.ask-page .ask-bar-page { max-width:640px; margin:.6rem 0 1.2rem; }
.ask-page > .ask-side { max-width:640px; }
@media (max-width: 900px) { .ask-page .ask-grid { grid-template-columns:1fr; } .ask-page .ask-head { flex-direction:column; } }
