/* =============================================================================
   mh-feedback.css  -  Feedback AI Agent (Phase 1): the global floating widget +
   the admin triage inbox. Uses the locked Matthew House tokens (so it flips with
   body.dark automatically). Plain hyphens only.

   z-index ladder (Phase 1 STEP 1, FINAL): the feedback stack tops the app so the
   CEO's rule holds - agent and toasts in front of everything. The full-screen 30-min
   alert is 100090; the FAB 100091 (clear of the whole wizard/modal band, which tops
   out at 100050: Client Detail, Household, Subsidy wizard + em-overlay, photo crop/cam,
   QR pass / archive); the panel scrim 100092; the panel 100093; the inbox delete-confirm
   100094; and the toast (mud-snackbar, in mh-theme.css) 100095 above them all, so a save
   / edit toast stays visible even over the open feedback panel AND over the alert.
   (Capture logic unchanged - it still snapshots the open overlay minus the widget.)
   ============================================================================= */

/* ---- the floating bubble ------------------------------------------------- */
.fb-root { position: static; }

.fb-fab {
  /* --fb-lift (set by MHfab in shell.js) glides the bubble UP off any control it would
     cover - e.g. the chat composer or an overlay's Edit footer - and back to 0 when clear.
     Uses `bottom` (not transform) so it never fights the hover/active transform. */
  position: fixed; right: 24px; bottom: calc(24px + var(--fb-lift, 0px)); z-index: 100091;
  width: 56px; height: 56px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--mh-sidebar); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(20, 34, 30, .34), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, bottom .22s ease;
}
.fb-fab:hover { transform: translateY(-2px); background: var(--mh-sidebar-2); box-shadow: 0 14px 32px rgba(20, 34, 30, .42); }
.fb-fab:active { transform: translateY(0); }
.fb-fab:focus-visible { outline: none; box-shadow: var(--mh-ctrl-focus-ring), 0 10px 26px rgba(20, 34, 30, .34); }
.fb-fab[disabled] { cursor: default; opacity: .85; }
.fb-fab img { width: 28px; height: 28px; object-fit: contain; display: block; }

/* spinner (capture + send busy states) */
.fb-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: fbspin .7s linear infinite;
}
.fb-spin.sm { width: 15px; height: 15px; border-width: 2px; }
.fb-btn.primary .fb-spin.sm { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
@keyframes fbspin { to { transform: rotate(360deg); } }

/* ---- the panel ----------------------------------------------------------- */
.fb-scrim {
  position: fixed; inset: 0; z-index: 100092;
  background: rgba(20, 32, 28, .42); animation: fbfade .18s ease both;
}
.fb-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 100093;
  width: min(404px, calc(calc(100 * var(--mh-vw)) - 32px)); max-height: calc(calc(100 * var(--mh-vh)) - 48px);
  display: flex; flex-direction: column;
  background: var(--mh-surface); color: var(--mh-ink);
  border: 1px solid var(--mh-line); border-radius: 20px;
  box-shadow: 0 28px 70px rgba(20, 32, 28, .42);
  overflow: hidden; animation: fbpop .2s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes fbfade { from { opacity: 0; } }
@keyframes fbpop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.fb-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--mh-line);
}
.fb-head-t { display: flex; align-items: center; gap: 12px; }
/* Real colored Matthew House mark on a white chip so it stays visible in light AND
   dark (the pine logo would otherwise wash out on the dark panel surface). */
.fb-mark { width: 38px; height: 38px; padding: 5px; border-radius: 11px; background: #fff; border: 1px solid var(--mh-line); object-fit: contain; flex: none; }
.fb-head h3 { margin: 0; font-size: 16.5px; font-weight: 800; color: var(--mh-ink); letter-spacing: -.01em; }
.fb-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--mh-muted); line-height: 1.35; }
.fb-x {
  flex: none; width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--mh-line); background: var(--mh-cream-2); color: var(--mh-ink);
  display: grid; place-items: center; transition: .15s;
}
.fb-x:hover { background: var(--mh-cream); }
.fb-x svg { width: 17px; height: 17px; }

.fb-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

/* screenshot preview */
.fb-shot { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--mh-line); background: var(--mh-cream-2); }
.fb-shot img { display: block; width: 100%; max-height: 188px; object-fit: cover; object-position: top center; }
.fb-shot-cap {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(20, 32, 28, .72); color: #fff; backdrop-filter: blur(2px);
}
.fb-shot-cap svg { width: 13px; height: 13px; }
.fb-shot-none {
  display: flex; align-items: center; gap: 10px; padding: 16px 14px;
  font-size: 12px; color: var(--mh-muted); line-height: 1.35;
}
.fb-shot-none svg { width: 22px; height: 22px; flex: none; color: var(--mh-ctrl-ico); }

/* fields */
.fb-field { display: flex; flex-direction: column; gap: 7px; }
.fb-lbl { font-size: 12.5px; font-weight: 700; color: var(--mh-ink); display: flex; align-items: center; gap: 8px; }
.fb-req { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--mh-clay); }
.fb-sel { width: 100%; }
.fb-sel select { width: 100%; }

.fb-text {
  width: 100%; resize: vertical; min-height: 92px; font: inherit; font-size: 13.5px; line-height: 1.5;
  padding: 11px 13px; border-radius: var(--mh-ctrl-r);
  background: var(--mh-ctrl-fill); color: var(--mh-ink);
  border: 1.5px solid var(--mh-ctrl-border); transition: .15s;
}
.fb-text::placeholder { color: var(--mh-ctrl-ico); }
.fb-text:focus { outline: none; background: var(--mh-surface); border-color: var(--mh-ctrl-focus-border); box-shadow: var(--mh-ctrl-focus-ring); }

/* auto-context block */
.fb-ctx { display: flex; flex-direction: column; gap: 7px; padding: 12px 13px; border-radius: 12px; background: var(--mh-cream-2); border: 1px solid var(--mh-line); }
.fb-ctx-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.fb-ctx-k { color: var(--mh-muted); font-weight: 700; flex: none; }
.fb-ctx-v { color: var(--mh-ink); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-ctx-v.mono { font-family: var(--mh-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace); font-size: 11.5px; }

/* footer */
.fb-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--mh-line); }
.fb-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: var(--mh-r-btn); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; transition: .15s;
}
.fb-btn svg { width: 16px; height: 16px; }
.fb-btn.ghost { background: var(--mh-cream-2); border-color: var(--mh-line); color: var(--mh-ink); flex: 0 0 auto; padding: 0 18px; }
.fb-btn.ghost:hover { background: var(--mh-cream); }
.fb-btn.primary { background: var(--mh-sidebar); color: #fff; }
.fb-btn.primary:hover { background: var(--mh-sidebar-2); }
.fb-btn[disabled] { opacity: .55; cursor: default; }

/* small screens: panel becomes a near-full sheet */
@media (max-width: 520px) {
  .fb-panel { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .fb-fab { right: 16px; bottom: calc(16px + var(--fb-lift, 0px)); }
}

/* =============================================================================
   Admin feedback inbox (/admin/feedback). Reuses the Administration .cl-* toolbar
   and .um-*/.up-* list+panel idiom; only feedback-specific bits live here.
   ============================================================================= */

/* Administration header: the Feedback + Approval Center entry buttons sit in a row. */
.ad-headrow .ad-headactions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Coming Soon (Administration dev-lock) ------------------------------- */
.cs-wrap { display: grid; place-items: center; min-height: calc(60 * var(--mh-vh)); padding: 40px 20px; }
.cs-card {
  max-width: 460px; text-align: center; padding: 40px 34px;
  background: var(--mh-surface); border: 1px solid var(--mh-line); border-radius: 20px; box-shadow: var(--mh-shadow);
}
.cs-ic {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--mh-sidebar) 12%, transparent); color: var(--mh-sidebar);
}
.cs-ic svg { width: 32px; height: 32px; }
.cs-card h2 { margin: 0 0 10px; font-size: 22px; font-weight: 800; color: var(--mh-ink); letter-spacing: -.01em; }
.cs-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--mh-muted); }

/* ---- SCHEDULED-OPENING COUNTDOWN (Aug 01 2026) ---------------------------------
   Shown only when the host passes an opening date. Four separate cells, because the
   numbers move at different rates and a single sentence forces the eye to re-read the
   whole line every second to find the part that changed.
   The digits are TABULAR and the cells fixed-width, so the row does not jitter as
   09 becomes 10 - a countdown that shifts sideways every tick reads as broken. */
.cs-count { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 18px 0 14px; }
.cs-unit { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 62px; }
.cs-unit .n { font-family: var(--mh-font-head); font-size: 30px; font-weight: 800; line-height: 1;
  color: var(--mh-green-d); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.cs-unit .l { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mh-muted); }
.cs-sep { font-family: var(--mh-font-head); font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--mh-line); }
.cs-card .cs-sub { margin-top: 4px; font-size: 12.5px; color: var(--mh-muted); }
body.dark .cs-unit .n { color: #9FC7BA; }
body.dark .cs-sep { color: #3A4A44; }

/* ---- delete confirm (Feedback detail, dev only) ------------------------- */
.fbi-confirm-scrim { position: fixed; inset: 0; z-index: 100094; background: rgba(20, 32, 28, .5); display: grid; place-items: center; padding: 24px; animation: fbfade .16s ease both; }
.fbi-confirm {
  width: min(380px, calc(94 * var(--mh-vw))); background: var(--mh-surface); color: var(--mh-ink);
  border: 1px solid var(--mh-line); border-radius: 18px; box-shadow: 0 28px 70px rgba(20, 32, 28, .44);
  padding: 24px 22px; text-align: center; animation: fbpop .18s cubic-bezier(.2, .9, .3, 1) both;
}
.fbi-confirm-ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--mh-danger) 14%, transparent); color: var(--mh-danger); }
.fbi-confirm-ic svg { width: 26px; height: 26px; }
.fbi-confirm h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--mh-ink); }
.fbi-confirm p { margin: 0 0 20px; font-size: 13px; color: var(--mh-muted); line-height: 1.5; }
.fbi-confirm-btns { display: flex; gap: 10px; }
.fbi-confirm-btns .fb-btn.danger { background: var(--mh-danger); color: #fff; }
.fbi-confirm-btns .fb-btn.danger:hover { filter: brightness(.94); }

/* Delete button in the detail status area */
.fbi-deletebtn {
  display: inline-flex; align-items: center; gap: 8px; height: auto; min-height: 40px; padding: 0 16px;
  border-radius: var(--mh-r-btn); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  background: color-mix(in srgb, var(--mh-danger) 10%, transparent); color: var(--mh-danger);
  border: 1.5px solid color-mix(in srgb, var(--mh-danger) 32%, transparent); transition: .15s;
}
.fbi-deletebtn:hover { background: color-mix(in srgb, var(--mh-danger) 18%, transparent); }
.fbi-deletebtn svg { width: 16px; height: 16px; }

/* status + category chips */
.fbi-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.6;
  border: 1px solid transparent;
}
.fbi-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fbi-chip.st-new        { color: #2E6E62; background: rgba(78, 124, 114, .14); border-color: rgba(78, 124, 114, .28); }
.fbi-chip.st-review     { color: var(--mh-warning-d); background: rgba(216, 155, 61, .16); border-color: rgba(216, 155, 61, .32); }
.fbi-chip.st-resolved   { color: #3D655D; background: rgba(61, 101, 93, .14); border-color: rgba(61, 101, 93, .3); }
.fbi-chip.st-dismissed  { color: var(--mh-muted); background: var(--mh-cream-2); border-color: var(--mh-line); }
.fbi-cat { color: var(--mh-info); background: rgba(94, 122, 131, .14); border: 1px solid rgba(94, 122, 131, .28); }

/* list rows */
.fbi-row {
  width: 100%; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--mh-line); border-radius: 14px; background: var(--mh-surface);
  transition: .15s; margin-bottom: 10px;
}
.fbi-row:hover { border-color: var(--mh-ctrl-focus-border); box-shadow: var(--mh-shadow-sm); }
.fbi-row .fbi-main { flex: 1; min-width: 0; }
.fbi-row .fbi-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.fbi-row .fbi-msg { font-size: 13.5px; color: var(--mh-ink); font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fbi-row .fbi-meta { font-size: 11.5px; color: var(--mh-muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fbi-row .fbi-thumb { flex: none; width: 64px; height: 48px; border-radius: 9px; object-fit: cover; border: 1px solid var(--mh-line); background: var(--mh-cream-2); }
.fbi-row .fbi-chev { flex: none; width: 18px; height: 18px; color: var(--mh-muted); }

/* detail panel screenshot */
.fbi-shot-full { width: 100%; border-radius: 12px; border: 1px solid var(--mh-line); display: block; background: var(--mh-cream-2); }

/* ---- SCREENSHOT: CLICK TO ENLARGE (CEO, Aug 14 2026) ---------------------------
   The panel is 440px wide, so a full-screen capture lands here at roughly a third of
   life size - enough to see that something is wrong, not enough to read the field the
   person is pointing at. The thumbnail is now a button that opens the shared .plb
   lightbox.

   The wrapper is a real <button>, so it carries a focus ring and reaches the keyboard;
   these resets only strip the chrome a button brings by default. */
.mh-app .fbi-shot-btn {
  display: block; width: 100%; padding: 0; border: none; background: none;
  border-radius: 12px; cursor: zoom-in; position: relative; overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.mh-app .fbi-shot-btn:hover { transform: scale(1.01); filter: brightness(1.03); box-shadow: 0 10px 26px rgba(28,39,51,.20); }
.mh-app .fbi-shot-btn:focus-visible { outline: 2px solid var(--mh-green, #4E7C72); outline-offset: 3px; }

/* The magnifier badge. It says "this enlarges" without a line of copy - and it only
   fades UP on hover, so it never sits on top of the thing it is describing. */
.mh-app .fbi-shot-zoom {
  position: absolute; right: 10px; bottom: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(18, 28, 33, .62); color: #fff;
  opacity: 0; transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.mh-app .fbi-shot-btn:hover .fbi-shot-zoom,
.mh-app .fbi-shot-btn:focus-visible .fbi-shot-zoom { opacity: 1; transform: translateY(0); }

/* The enlarged image. .plb-circle is the portrait inner and is round; a screenshot
   needs a rectangle that fits the viewport whatever its aspect ratio, hence contain
   rather than a fixed width. */
.mh-app .fbi-lb-img {
  display: block;
  max-width: min(94vw, 1600px);
  max-height: 88vh;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 30px 80px rgba(0,0,0,.6);
}
/* The backdrop is a click target for closing, so say so - but the image itself is not. */
.mh-app .plb.fbi-lb { cursor: zoom-out; }
.mh-app .plb.fbi-lb .plb-inner { cursor: default; }
.fbi-shot-none { padding: 20px; text-align: center; color: var(--mh-muted); font-size: 12.5px; border: 1px dashed var(--mh-line); border-radius: 12px; background: var(--mh-cream-2); }
.fbi-note { font-size: 13.5px; line-height: 1.55; color: var(--mh-ink); white-space: pre-wrap; }

/* status control in the detail panel */
.fbi-statusctl { display: flex; gap: 8px; flex-wrap: wrap; }
.fbi-statusctl .mh-sel { flex: 1; min-width: 150px; }
/* THE SELECT MUST FILL THE WRAPPER IT WAS STRETCHED INTO.
   (CEO, 14 Aug 2026: "the width of the field is too short and the arrow is on the
   right too far from the dropdown menu".)

   .mh-sel is an inline-flex wrapper that normally sizes to its content, and the
   chevron is positioned absolutely against IT (right: 14px). The line above gives
   the wrapper flex:1, so here it stretched to 263px - but the app's base rule
   `.mh-app .mh-sel select` sets no width, so the pill stayed at its content width
   of 118px while the chevron stayed pinned to the wrapper's right edge. A short
   pill with an arrow floating 130px away from it.

   Nothing was broken by the dropdown work; this shipped with the panel and only
   became obvious once the arrow mattered. The admin department editor hit the
   identical thing and fixed it the same way (mh-admin.css, .up-deptedit) - those
   are the ONLY two places in the app that stretch this wrapper, and now both
   carry the fix. Any future rule that gives .mh-sel a width owes its select one. */
.mh-app .fbi-statusctl .mh-sel select { width: 100%; }
