/* The bot (docs/bot.md): its marks in the inbox, its lines in the thread, its reply for approval, the thumbs on its
   replies, Remembered, and its settings pages. app.css tokens only. */
.bot-grow { flex: 1; }

/* the list: Needs you and For approval */
.bot-mark { grid-column: 1 / -1; justify-self: start; font: 500 11px/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; white-space: nowrap; }
.bot-mark.needs { background: #fdf0e1; color: #8a4b0f; }
.bot-mark.wait { background: var(--p200); color: var(--p900); }

/* the head: Done and the Bot switch */
.bot-switch .i { color: var(--n700); }
.bot-switch.on .i { color: var(--p700); }
.bot-switch:disabled { opacity: .45; cursor: default; }
.bot-done .i { color: var(--p700); }

/* the thread's bot lines */
.bot-line { align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; color: var(--n700); margin: 0; text-decoration: none; }
.bot-line.flag { color: #8a4b0f; }
.bot-line.learnt .i, .bot-line .i { flex: none; }
.bot-line.learnt { color: var(--p800); }
.bot-line.missed { text-decoration: line-through; }
.bot-wait { color: var(--p700); font-weight: 500; }
.ib-thread:has(.bot-draft) .bot-wait { display: none; }

/* thumbs on its replies, beside the time */
.bot-rate { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.bot-rate-b { background: none; border: 0; padding: 2px; color: var(--n300); cursor: pointer; line-height: 0; }
.bot-rate-b:hover { color: var(--n700); }
.bot-rate-b.on { color: var(--p700); }
.bot-rate-b.on.bad { color: var(--err); }

/* its reply for approval, in place of the reply box */
.ib-thread:has(.bot-draft) .ib-reply { display: none; }
.bot-draft { margin: 0; padding: 12px 20px 16px; background: var(--p100); border-top: 1px solid var(--p300); }
.bot-draft-h { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font: 600 15px var(--f-head); color: var(--p900); min-width: 0; }
.bot-draft-h .sub { font: 400 13px var(--f-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-draft textarea { width: 100%; min-height: 72px; max-height: 40vh; background: var(--card); }
.bot-draft-f { margin-top: 10px; gap: 10px; }
.bot-draft-f .check { margin: 0; }
.bot-steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.bot-steps li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bot-steps li span:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.bot-steps li.looked { color: var(--n700); }
.bot-steps li.done { color: var(--n700); text-decoration: line-through; }
.bot-step-x { display: inline-flex; cursor: pointer; color: var(--n700); margin-left: auto; }
.bot-step-x input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bot-step-x:has(input:checked) { color: var(--err); }
.bot-steps li:has(.bot-step-x input:checked) > span { text-decoration: line-through; color: var(--n700); }

/* the reply box's bot button */
.bot-write { padding: 11px 12px; }
.bot-write-msg { align-self: center; }

/* Remembered, in the contact panel */
.bot-about { margin: 14px 0 0; font-size: 14px; }
.bot-about summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.bot-about p { margin: 8px 0 0; color: var(--n700); }

/* dialogs: closed only by their buttons (bot.js) */
dialog.bot-dlg { border: 1px solid var(--rule); padding: 22px; max-width: 460px; width: calc(100% - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; color: var(--ink); }
dialog.bot-dlg::backdrop { background: rgba(18,61,47,.35); }
dialog.bot-dlg form { margin: 0; }
dialog.bot-dlg h2 { margin: 0 0 16px; }
.bot-foot { gap: 10px; margin-top: 8px; }

/* settings */
.bot-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--rule); }
.bot-tabs a { padding: 9px 12px; color: var(--n700); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.bot-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--p700); }
.bot-tabs b { font: 600 13px var(--f-head); color: var(--p700); margin-left: 4px; }
.bot-card-h { margin: 0 0 14px; }
.bot-card-h h2 { margin: 0; }
.bot-modes { width: 100%; border-collapse: collapse; font-size: 15px; }
.bot-modes th { text-align: left; font: 500 13px var(--f-body); color: var(--n700); padding: 0 8px 8px; white-space: nowrap; }
.bot-modes td { padding: 8px; border-top: 1px solid var(--rule); white-space: nowrap; }
.bot-modes td:first-child { padding-left: 0; }
.bot-modes td:last-child { width: 45%; padding-right: 0; }
.bot-modes td:last-child input { width: 100%; min-width: 0; }
.bot-modes .i { margin-bottom: -3px; color: var(--p700); }
.bot-box td:first-child { padding-left: 22px; color: var(--n700); font-size: 14px; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.bot-acts { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.bot-acts .check { margin: 0; }
.bot-link { background: none; border: 0; padding: 0; color: var(--p700); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bot-trig.off { opacity: .55; }
.bot-trig .list-main { display: flex; flex-direction: column; gap: 2px; flex: 0 1 220px; }
.bot-trig .list-main .sub { font-weight: 400; }
.bot-do { flex: 1 1 auto; }
.bot-copy { display: flex; gap: 8px; }
.bot-copy input { flex: 1; min-width: 0; }
.bot-eg { margin: 6px 0 0; color: var(--n700); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bot-q { padding: 12px 0; border-top: 1px solid var(--rule); margin: 0; }
.bot-q:first-of-type { border-top: 0; }
.bot-q label { display: block; font-weight: 500; margin: 0 0 6px; }
.bot-q input[name=question] { width: 100%; margin: 0 0 6px; }
.bot-q-row { display: flex; gap: 10px; align-items: flex-start; }
.bot-q-row textarea { flex: 1; min-width: 0; }
.bot-known { margin-top: 14px; }
.bot-known summary { cursor: pointer; padding: 6px 0; }
.bot-week b { margin-left: auto; white-space: nowrap; }

@media (max-width: 760px) {
  .bot-draft { padding: 10px 16px 14px; }
  .bot-draft .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bot-modes td:last-child { width: auto; }
  .bot-modes td:last-child input { width: 120px; }
  .bot-q-row { flex-wrap: wrap; }
  .bot-q-row textarea { flex: 1 1 100%; }
  .bot-trig .list-main { flex: 1 1 100%; }
}
