/* Website assistant chat (GitHub #8): a small dark card in the corner, a bottom sheet on phones. */
.cn-help { --h-bg: #0f2630; --h-panel: #173341; --h-ink: #f5f3eb; --h-muted: #b8c7cb; --h-mint: #91e4ca; --h-line: #ffffff1f;
  position: fixed; right: 20px; bottom: 20px; z-index: 60; font: 15px/1.55 Manrope, system-ui, sans-serif; color: var(--h-ink); }
.cn-help-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px 0 8px; border: 0; border-radius: 999px;
  background: var(--h-mint); color: #0b1d26; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 12px 30px #0006; }
.cn-help-toggle span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #0b1d26; color: var(--h-mint); font-weight: 800; }
.cn-help-toggle:focus-visible, .cn-help button:focus-visible, .cn-help textarea:focus-visible { outline: 3px solid #f5f3eb; outline-offset: 2px; }
.cn-help[data-open] .cn-help-toggle { display: none; }
.cn-help-panel { width: min(380px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--h-bg); border: 1px solid var(--h-line); border-radius: 18px; box-shadow: 0 24px 70px #000a; overflow: hidden; }
.cn-help-panel[hidden] { display: none; }
.cn-help-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.cn-help-head h2 { margin: 0; font-size: 17px; line-height: 1.3; color: var(--h-ink); }
.cn-help-close { width: 34px; height: 34px; border: 1px solid var(--h-line); border-radius: 50%; background: transparent; color: var(--h-ink); font-size: 20px; line-height: 1; cursor: pointer; }
.cn-help-note { margin: 0 16px 8px; font-size: 12.5px; line-height: 1.5; color: var(--h-muted); }
.cn-help-note a, .cn-help-msg a { color: var(--h-mint); text-decoration: underline; text-underline-offset: 2px; }
.cn-help-log { list-style: none; margin: 0; padding: 6px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.cn-help-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; white-space: normal; overflow-wrap: anywhere; }
.cn-help-msg.is-user { align-self: flex-end; background: var(--h-mint); color: #0b1d26; border-bottom-right-radius: 4px; }
.cn-help-msg.is-user a { color: #0b1d26; }
.cn-help-msg.is-assistant { align-self: flex-start; background: var(--h-panel); border-bottom-left-radius: 4px; }
.cn-help-msg.is-pending { color: var(--h-muted); font-style: italic; }
.cn-help-msg.is-error, .cn-help-msg.is-limit { background: #3a2f22; color: #f6e2bf; }
.cn-help-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 8px; }
.cn-help-chips[hidden] { display: none; }
.cn-help-chips button { border: 1px solid #91e4ca66; border-radius: 999px; background: transparent; color: var(--h-ink); padding: 5px 11px; font-size: 13px; cursor: pointer; }
.cn-help-chips button:hover { background: #91e4ca1f; }
.cn-help-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--h-line); }
.cn-help-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cn-help-form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: vertical; padding: 9px 11px; border: 1px solid var(--h-line); border-radius: 12px;
  background: #0b1d26; color: var(--h-ink); font: inherit; font-size: 15px; }
.cn-help-form textarea::placeholder { color: #8fa4aa; }
.cn-help-form button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--h-mint); color: #0b1d26; font-weight: 700; cursor: pointer; }
.cn-help-form button:disabled { opacity: .55; cursor: default; }
.cn-help-form[aria-busy='true'] button { cursor: progress; }
@media (max-width: 560px) {
  .cn-help { right: 12px; bottom: 12px; }
  /* Phones (#123): only the round ? button, and room at the page end, so it never hides a date or a form field for good. */
  .cn-help:not([data-open]) .cn-help-toggle { width: 52px; min-height: 52px; padding: 0; justify-content: center; font-size: 0; }
  .cn-help-toggle span { font-size: 18px; }
  body:has(.cn-help) { padding-bottom: 76px; }
  .cn-help[data-open] { left: 0; right: 0; bottom: 0; }
  .cn-help-panel { width: 100%; max-height: 82vh; border-radius: 18px 18px 0 0; }
  .cn-help-form textarea { font-size: 16px; }
}
/* make.cutnook.ai (#226): the email for a reply; on a computer the chat sits left of the paybar card, on a phone a small
   „Questions?“ pill above the sticky „Make mine“ bar, never over the leaving question. */
.cn-help-mail form { display: flex; gap: 6px; }
.cn-help-mail input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 10px; border: 1px solid var(--h-line); border-radius: 10px; background: #0b1d26; color: var(--h-ink); font: inherit; font-size: 16px; }
.cn-help-mail button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--h-mint); color: #0b1d26; font-weight: 700; cursor: pointer; }
.cn-help.on-make { left: 20px; right: auto; }
body:has(.why:not([hidden])) .cn-help.on-make:not([data-open]) { display: none; }
@media (max-width: 560px) {
  .cn-help.on-make { left: auto; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.has-paybar .cn-help.on-make:not([data-open]) { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  /* #700: only the round „?“, as on cutnook.ai – the 121 px pill lay over the email hint and the money-back line – and
     out of the way while the buyer types in the form. */
  .cn-help.on-make:not([data-open]) .cn-help-toggle { width: 44px; min-height: 44px; padding: 0; gap: 0; justify-content: center; font-size: 0; box-shadow: 0 8px 20px #0005; }
  .cn-help.on-make:not([data-open]) .cn-help-toggle span { width: 30px; height: 30px; font-size: 16px; }
  body:has(main :is(input, textarea, select):focus) .cn-help.on-make:not([data-open]) { display: none; }
  body:has(.cn-help.on-make) { padding-bottom: 0; }
  .cn-help.on-make[data-open] { left: 0; right: 0; bottom: 0; z-index: 70; }
  /* #315: on a skill page's first screen the price line and „Add a photo“ sit at the bottom – the pill waits until the
     visitor scrolls (support.js sets .past-top). */
  .cn-help.on-make:not([data-open]):not(.past-top) { visibility: hidden; opacity: 0; }
  .cn-help.on-make:not([data-open]) { transition: opacity .2s; }
}
@media (prefers-reduced-motion: no-preference) { .cn-help-panel { animation: cn-help-in .18s ease-out; } }
@keyframes cn-help-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media print { .cn-help { display: none; } }
