/* /ask (views/ask.js), the AI settings dialog (ai/settings.js) and the home page ask box. */

.ask-page { max-width: 860px; margin: 0 auto; }
.ask-box { padding: 14px; margin-top: 8px; box-shadow: var(--shadow-1, none); }
.ask-box:focus-within { border-color: var(--accent-line, var(--accent)); }
.ask-input { width: 100%; box-sizing: border-box; min-height: 92px; resize: vertical; border: 0; background: transparent; color: var(--text); font: 500 18px/1.45 var(--body); padding: 4px 2px; outline: none; }
.ask-input::placeholder { color: var(--muted); }
.ask-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.ask-spacer { flex: 1; }
.ask-snap svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.ask-chip { font: 500 13px/1.35 var(--body); text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill, 999px); padding: 6px 12px; cursor: pointer; max-width: 100%; }
.ask-chip:hover { border-color: var(--accent); color: var(--accent); }

.ask-progress { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.ask-progress li { display: flex; align-items: center; gap: 8px; }
.ask-progress li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong, var(--line)); }
.ask-progress li.now { color: var(--text); font-weight: 600; }
.ask-progress li.now::before { border-color: var(--accent); border-right-color: transparent; animation: ask-spin 0.8s linear infinite; }
.ask-progress li.done::before { background: var(--good); border-color: var(--good); }
.ask-progress li.bad::before { background: var(--bad); border-color: var(--bad); animation: none; }
@keyframes ask-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ask-progress li.now::before { animation: none; } }

.ask-photo { margin: 0 0 16px; }
.ask-photo img { max-width: 100%; max-height: 260px; border-radius: var(--r-m, 10px); border: 1px solid var(--line); }

.ask-result { display: grid; gap: 12px; }
.ask-result > * { margin: 0; }
.ask-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ask-head h2 { margin: 2px 0; }
.ask-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 12px 14px; border-radius: var(--r-m, 10px); background: var(--surface-2); border: 1px solid var(--line); }
.ask-answer.ok { background: var(--good-soft, var(--surface-2)); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.ask-answer.warn { background: var(--warn-soft, var(--surface-2)); }
.ask-answer-label { font-size: 13px; color: var(--muted); }
.ask-answer-value { font: 700 22px var(--mono); }
.ask-badge { font: 700 12px var(--body); padding: 3px 9px; border-radius: var(--r-pill, 999px); }
.ask-badge.ok { background: var(--good); color: #fff; }
.ask-badge.warn { background: var(--surface); border: 1px solid var(--line-strong, var(--line)); color: var(--text); }
.ask-options { margin: 0; padding-left: 26px; }
.ask-options li.hit { font-weight: 700; color: var(--good); }
.ask-engine { font-size: 14.5px; }
.ask-explain p:first-child { font-size: 16px; line-height: 1.55; }
.ask-inputs summary { cursor: pointer; font-weight: 600; }
.ask-inputs dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 0; }
.ask-inputs dt { font: 700 13px var(--mono); color: var(--muted); }
.ask-inputs dd { margin: 0; overflow-wrap: anywhere; font-size: 13.5px; }
.ask-error p { margin: 0 0 6px; }
.ask-privacy { margin-top: 18px; }

/* AI settings dialog */
dialog.ai-set { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--r-l, 14px); background: var(--surface); color: var(--text); padding: 22px; box-shadow: var(--shadow-3, 0 20px 50px rgba(0, 0, 0, 0.25)); }
dialog.ai-set::backdrop { background: rgba(0, 0, 0, 0.45); }
.ai-set h2 { margin-bottom: 6px; }
.ai-set-choices { display: grid; gap: 8px; margin: 14px 0; }
.ai-set-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m, 10px); cursor: pointer; }
.ai-set-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, var(--surface-2)); }
.ai-set-choice > span { display: grid; gap: 2px; }
.ai-set-own { display: grid; gap: 6px; margin-bottom: 12px; }
.ai-set-own label { font-weight: 600; font-size: 14px; margin-top: 6px; }
.ai-set-own input, .ai-set-own select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.ai-set-privacy { background: var(--surface-2); border-radius: var(--r-s, 8px); padding: 10px 12px; }
.ai-set-status { min-height: 1.2em; color: var(--good); font-size: 14px; }
.ai-set-actions { justify-content: flex-end; gap: 8px; }
.foot-col button.linkish { color: inherit; text-decoration: none; }
.foot-col button.linkish:hover { text-decoration: underline; }

/* Home page ask box */
.home-ask { display: flex; gap: 8px; margin-top: 16px; max-width: 520px; }
.home-ask input { flex: 1; min-width: 0; font: inherit; font-size: 14.5px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.home-ask input:focus { outline: 2px solid var(--ring, var(--accent)); outline-offset: 1px; }

@media (max-width: 600px) {
  .ask-input { font-size: 16px; }
  .ask-bar .muted.small { display: none; }
  .ask-head .btn { width: 100%; }
}
