/* Help & Feedback button and modal. Moved out of base.html on 2026-11-30.
   Served versioned (static_url, web/static_assets.py): edit freely, the URL changes with the content. */
#feedback-fab {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--green-dark); color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  cursor: pointer; z-index: 120; box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  display: flex; align-items: center; gap: 5px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s; width:auto;
}
#feedback-fab:hover { background: var(--green); transform: none; }
/* Icon-only circle on mobile, anchored near bottom-right above safe area */
@media (max-width: 768px) {
  #feedback-fab .fb-label { display: none; }
  #feedback-fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    right: 12px;
    padding: 10px; border-radius: 50%; width: 40px; height: 40px; justify-content: center;
    opacity: 0.7;
  }
  #feedback-fab svg { width: 16px; height: 16px; }
}
#feedback-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(17,24,17,0.45); z-index: 300;
}
/* The sheet speaks the board's design language (2026-10-04): same type,
   the same outlined/filled pill for the category choice, and the gate
   card's button. It used to be a native <select> (the OS's own popup,
   which no CSS reaches), an all-caps button and system Arial on pages
   that don't load Space Grotesk. Barlow first, so pages that self-host
   it (board, team, account) match their own content; everywhere else
   the stack lands on the site's Space Grotesk. */
#feedback-modal {
  --fb-font: 'Barlow', 'Barlow Fallback', 'Space Grotesk', 'Space Grotesk Fallback', -apple-system, sans-serif;
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 1.6rem 1.25rem 1.5rem;
  /* Bottom sheet sits flush to the screen edge — clear the iOS home
     indicator in edge-to-edge webviews (env() is 0 elsewhere) */
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 301; flex-direction: column; gap: 1rem;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
  max-width: 520px; margin: 0 auto;
  font-family: var(--fb-font); color: var(--text);
}
/* Grab handle: reads as a sheet, not a dialog that slid too far. */
#feedback-modal::before {
  content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 2px; background: #d9ded9;
}
@media (min-width: 520px) {
  #feedback-modal {
    border-radius: 14px;
    bottom: auto; top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 440px;
    /* Centered dialog — no screen-edge contact, no inset needed */
    padding-bottom: 1.5rem;
  }
  #feedback-modal::before { display: none; }
}
#feedback-modal h4 { margin: 0; padding-right: 40px; font-family: var(--fb-font);
                     font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--text); }
#feedback-form { display: flex; flex-direction: column; gap: 0.85rem; }
.fb-cats { border: none; margin: 0; padding: 0; min-width: 0; }
.fb-cats legend { padding: 0; margin: 0 0 8px; font-size: 13px; font-weight: 600;
                  color: var(--text-light); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 10px 6px; }
.fb-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer;
           -webkit-tap-highlight-color: transparent; }
.fb-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
/* Same pill as the board's .bd-pill: outlined, filled when chosen, with
   an invisible 44px hit zone so the visible pill can stay compact. */
.fb-chip span { display: inline-block; padding: 7px 13px; border-radius: 999px;
                border: 1px solid var(--green-dark); color: var(--green-dark); background: #fff;
                font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
                transition: background 0.15s, color 0.15s; }
.fb-chip span::after { content: ''; position: absolute; left: 0; right: 0; top: 50%;
                       height: 44px; transform: translateY(-50%); }
.fb-chip input:checked + span { background: var(--green-dark); color: #fff; }
.fb-chip input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
/* 16px prevents iOS Safari auto-zoom on input focus */
#feedback-modal textarea,
#feedback-modal input[type="email"] {
  display: block; width: 100%; padding: 11px 13px; box-sizing: border-box;
  font-family: var(--fb-font); font-size: 16px; line-height: 1.4; color: var(--text);
  background: #fff; border: 1px solid #cfd6cf; border-radius: 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#feedback-modal textarea { min-height: 96px; resize: vertical; }
#feedback-modal textarea::placeholder,
#feedback-modal input[type="email"]::placeholder { color: #8a948a; }
#feedback-modal textarea:focus,
#feedback-modal input[type="email"]:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,46,0.15);
}
/* The gate card's button (.bd-gate-btn): sentence case, no tracking. */
#feedback-submit {
  width: 100%; min-height: 48px; padding: 13px; margin-top: 2px;
  background: var(--green-dark); color: #fff; border: none; border-radius: 10px;
  font-family: var(--fb-font); font-size: 16px; font-weight: 700;
  letter-spacing: 0; text-transform: none; cursor: pointer;
}
#feedback-submit:hover { background: var(--green); transform: none; }
#feedback-submit:disabled { opacity: 0.7; cursor: default; }
#feedback-submit:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.fb-foot { font-size: 13px; color: var(--text-light); text-align: center; }
.fb-foot a { color: var(--green-dark); font-weight: 600; }
#feedback-success { display: none; text-align: center; padding: 1.25rem 0 0.5rem; }
.fb-ok { width: 48px; height: 48px; margin: 0 auto 0.75rem; border-radius: 50%;
         background: #e8f2e6; color: var(--green-dark);
         display: flex; align-items: center; justify-content: center; }
.fb-ok-h { display: block; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.fb-ok-p { display: block; font-size: 14px; color: var(--text-light); line-height: 1.45; }
.fb-close {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  background: none; color: var(--text-light); cursor: pointer;
}
.fb-close:hover { background: #f1f4f1; color: var(--text); transform: none; }
.fb-close:focus-visible { outline: 2px solid var(--green); outline-offset: 0; }
