/*
  marmot-suggest.css: 💡 Suggest a feature in the 💬 Help chat (marmot-suggest.js). The Marmot kit: the same bytes in
  every Boy app. Every class is prefixed msug-. It uses the family's own variables (--accent, --accent-soft,
  --accent-text, --text, --text-2, --text-3, --surface, --surface-2, --border, --bad, --radius, --font, --shadow-lg),
  which every app sets for light and dark, with a fallback for each; the buttons are the app's own .btn.primary and
  .btn.ghost.
  The card is a sheet inside the help panel (the panel is fixed, so it holds it): over the chat, from the bottom,
  as tall as it needs and scrolling inside when the panel is short (a phone with its keyboard up).
*/

/* The header's 💡 Suggest button, beside ↺ New. */
.msug-open {
  display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0;
  padding: .3rem .65rem; min-height: 32px;
  font: 650 .82rem/1.2 var(--font, system-ui, sans-serif); letter-spacing: 0; text-transform: none; white-space: nowrap;
  color: var(--accent-text, #017f2b); background: var(--accent-soft, #e6faec);
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.msug-open:hover { border-color: var(--accent, #02cd46); }
.msug-open:focus-visible { outline: 2px solid var(--accent-text, #017f2b); outline-offset: 2px; }

/* The empty chat's chip. */
.msug-chip {
  display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; max-width: 100%;
  margin: .35rem 0 0; padding: .5rem .85rem;
  font: 650 .9rem/1.3 var(--font, system-ui, sans-serif); text-align: left; text-transform: none; letter-spacing: 0;
  color: var(--accent-text, #017f2b); background: var(--accent-soft, #e6faec);
  border: 1px dashed color-mix(in srgb, var(--accent-text, #017f2b) 45%, transparent); border-radius: 999px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.msug-chip:hover { border-style: solid; border-color: var(--accent, #02cd46); }
.msug-chip:focus-visible { outline: 2px solid var(--accent-text, #017f2b); outline-offset: 2px; }

/* "💡 Send this to the Flying Marmot team?" under an answer. */
.msug-offer {
  align-self: stretch; margin: .1rem 0 .2rem; padding: .7rem .85rem .8rem;
  font: 400 .9rem/1.45 var(--font, system-ui, sans-serif); color: var(--text, #101828);
  background: var(--accent-soft, #e6faec);
  border: 1px solid color-mix(in srgb, var(--accent, #02cd46) 40%, transparent); border-radius: var(--radius, 10px);
}
.msug-offer-h { margin: 0 0 .25rem; font-weight: 700; }
.msug-offer-text { margin: 0 0 .6rem; color: var(--text-2, #475467); overflow-wrap: anywhere; white-space: pre-wrap; }
.msug-offer.is-sent { font-weight: 600; color: var(--accent-text, #017f2b); }

/* The card's layer: a dim over the chat, and the card from the bottom. */
.msug-layer { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; }
.msug-layer[hidden] { display: none; }
.msug-scrim { position: absolute; inset: 0; background: rgba(16, 24, 40, .38); }
.msug-card {
  position: relative; display: block; margin: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  font: 400 .95rem/1.45 var(--font, system-ui, sans-serif); color: var(--text, #101828);
  background: var(--surface, #ffffff); border-top: 1px solid var(--border, #e4e7ec);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg, 0 12px 32px rgba(16, 24, 40, .16));
  animation: msug-up .18s ease-out;
}
@keyframes msug-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.msug-head { display: flex; align-items: flex-start; gap: .5rem; }
.msug-title { flex: 1; margin: 0; font: 750 1.05rem/1.35 var(--font, system-ui, sans-serif); color: var(--text, #101828); text-transform: none; letter-spacing: 0; }
.msug-title:focus { outline: none; }
.msug-x {
  flex-shrink: 0; width: 36px; height: 36px; margin: -.35rem -.35rem 0 0; padding: 0;
  font: 400 1rem/1 var(--font, system-ui, sans-serif); color: var(--text-2, #475467);
  background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.msug-x:hover { background: var(--surface-2, #f2f4f7); }
.msug-x:focus-visible { outline: 2px solid var(--accent-text, #017f2b); outline-offset: 1px; }
.msug-lead { margin: .35rem 0 .75rem; font-size: .88rem; color: var(--text-2, #475467); }

.msug-types { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .6rem; padding: 0; border: 0; min-width: 0; }
.msug-type {
  position: relative; display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .7rem; min-height: 34px;
  font: 600 .84rem/1.2 var(--font, system-ui, sans-serif); color: var(--text, #101828);
  background: var(--surface, #ffffff); border: 1px solid var(--border, #e4e7ec); border-radius: 999px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.msug-type input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.msug-type:hover { border-color: var(--accent, #02cd46); }
.msug-type.is-on { color: var(--accent-text, #017f2b); background: var(--accent-soft, #e6faec); border-color: var(--accent-text, #017f2b); }
.msug-type:has(input:focus-visible) { outline: 2px solid var(--accent-text, #017f2b); outline-offset: 2px; }

.msug-text {
  display: block; box-sizing: border-box; width: 100%; min-height: 7.5rem; max-height: 40vh; resize: vertical; margin: 0;
  padding: .65rem .75rem; font: 400 1rem/1.45 var(--font, system-ui, sans-serif); color: var(--text, #101828);
  background: var(--surface, #ffffff); border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius, 10px);
}
.msug-text:focus { outline: none; border-color: var(--accent-text, #017f2b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #02cd46) 25%, transparent); }
.msug-text[readonly] { opacity: .7; }
.msug-meta { display: flex; justify-content: flex-end; margin: .2rem 0 .1rem; }
.msug-count { font-size: .74rem; color: var(--text-3, #667085); font-variant-numeric: tabular-nums; }
.msug-count.is-near { color: var(--bad, #c01048); font-weight: 650; }
.msug-what { margin: .2rem 0 .6rem; font-size: .78rem; line-height: 1.4; color: var(--text-3, #667085); }
.msug-err { margin: 0 0 .6rem; padding: .5rem .7rem; font-size: .86rem; font-weight: 600; color: var(--bad, #c01048); background: color-mix(in srgb, var(--bad, #c01048) 9%, var(--surface, #ffffff)); border-radius: 8px; }
.msug-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.msug-actions .btn { min-height: 40px; }

.msug-done { padding: .4rem 0 .2rem; text-align: center; }
.msug-done-ico { font-size: 2.2rem; line-height: 1; margin-bottom: .4rem; }
.msug-done .msug-title { text-align: center; }
.msug-done .msug-actions { justify-content: center; margin-top: .3rem; }

.msug-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* A narrow phone: the header's button is just 💡. */
@media (max-width: 360px) { .msug-open-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; } .msug-open { padding: .3rem .5rem; } }

@media (prefers-reduced-motion: reduce) { .msug-card { animation: none; } }
@media print { .msug-layer, .msug-open, .msug-chip, .msug-offer { display: none !important; } }
