/* Ask SIKASEM: the assistant's panel, down the right of the window. */
.ask-btn { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--t), border-color var(--t); }
.ask-btn:hover { background: var(--hover); border-color: var(--blue); }
.ask-btn .cowry { width: 24px; height: 24px; flex-shrink: 0; }
.ask[hidden] { display: none; }
.ask { position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 50; width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); animation: pop .24s var(--spring) both; }
.ask > header { display: flex; align-items: center; gap: 9px; padding: 13px 14px 13px 16px; color: #fff; background: var(--navy); }
.ask > header .cowry { width: 28px; height: 28px; fill: #fff; }
.ask > header b { font-size: 15px; }
.ask-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--ice); font-size: 17px; cursor: pointer; }
.ask-x:hover { background: rgba(202, 240, 248, .16); color: #fff; }
.ask-list { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ask-msg { max-width: 92%; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ask-msg.bot { align-self: flex-start; padding: 10px 13px; border-radius: 4px 16px 16px 16px; background: var(--hover); color: var(--ink); }
.ask-msg.me { align-self: flex-end; padding: 10px 13px; border-radius: 16px 16px 4px 16px; background: var(--blue); color: #fff; }
.ask-msg.err { border-left: 3px solid var(--bad); }
.ask-msg.eg { max-width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.ask-msg.eg button { border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; text-align: left; }
.ask-msg.eg button:hover { background: var(--hover); border-color: var(--blue); }
.ask-msg.hits { max-width: 100%; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.ask-msg.hits small { color: var(--muted); padding: 2px 6px; }
.ask-hit { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; cursor: pointer; }
.ask-hit:hover { background: var(--hover); border-color: var(--blue); }
.ask-hit b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-hit span { grid-row: 2; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-hit i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.ask-draft { padding: 11px 13px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #023E8A, var(--blue)); }
.ask-draft b, .ask-draft span { display: block; }
.ask-draft small { display: block; color: var(--ice) !important; padding: 4px 0 0 !important; }
.ask-msg.setup p { margin: 6px 0; font-size: 12.5px; color: var(--muted); }
.ask-msg.setup input { width: 100%; margin: 4px 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); }
.ask-msg.setup > div { display: flex; gap: 6px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.ask-form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--ink); font-size: 13.5px; }
@media (min-width: 1101px) { .ask { top: 84px; } body.ask-open main { margin-right: 436px; } }
@media (max-width: 1100px) {
  .ask-btn { height: auto; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: var(--ice); font-size: 14px; font-weight: 400; justify-content: flex-start; }
  .ask-btn .cowry { fill: #fff; width: 20px; height: 20px; }
  .ask-btn:hover { background: rgba(202, 240, 248, .14); }
}

@media (max-width: 760px) {
  .ask { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .ask-list { padding: 16px 14px; }
}

/* On phones it floats above every page, in place of the menu's link */
.ask-fab { display: none; }
@media (max-width: 760px) {
  .side .ask-btn { display: none; }
  .ask-fab { position: fixed; z-index: 45; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 5px; height: 44px; padding: 0 15px 0 9px; border-radius: 99px; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; background: linear-gradient(135deg, var(--navy), var(--blue)); box-shadow: 0 6px 16px rgba(3, 4, 94, .32); transition: transform .15s var(--ease); }
  .ask-fab:active { transform: scale(.96); }
  .ask-fab .cowry { width: 25px; height: 25px; fill: #fff; flex-shrink: 0; }
  /* The editor's Preview button keeps the corner, and this sits just above it */
  body:has(.editor) .ask-fab { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body:has(.editor.show-prev) .ask-fab { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  /* Out of the way of whatever is open */
  body.ask-open .ask-fab, body.nav-open .ask-fab, body.no-business .ask-fab, body:has(.modal-bg) .ask-fab, body:has(.tools:not([hidden])) .ask-fab { display: none; }
}
