/* The floating suggestion box (_feedback_widget.html), linked by the partial itself.
   Moved out of app/templates/_feedback_widget.html in Step 18b; served as /static/css/feedback.<hash>.css with a
   content hash (app/services/assets.py). Edit here. */

/* ---- _feedback_widget.html ---- */
  /* Declared on the root so both the launcher and the panel inherit them.
     Workspace name, then marketing name, then a literal — see the note above. */
  .fb-root {
    --fb-surface: var(--surface, var(--color-surface, #ffffff));
    --fb-ink: var(--ink, var(--color-text, #191c22));
    --fb-muted: var(--muted, var(--color-neutral-700, #5a5c5f));
    --fb-line: var(--line, var(--color-neutral-300, #d5d4d2));
    --fb-line-strong: var(--line-strong, var(--color-neutral-400, #b9b8b5));
    --fb-accent: var(--accent, var(--color-accent, #1c4e8a));
    --fb-accent-ink: var(--accent-ink, var(--color-accent-800, #123561));
    --fb-danger: var(--danger, #a13a2f);
    /* What goes *on* the accent. Not a media query: the answer depends on
       whether the accent is dark or light, which is a property of the page's
       palette rather than of the operating system. The widget used to flip this
       to near-black under `prefers-color-scheme: dark`, which was right in the
       workspace — its dark accent is a pale blue — and wrong on every marketing
       page, which is light-only and keeps its navy. A phone in dark mode
       therefore rendered a near-black icon on a navy circle. The page that owns
       the accent overrides this; nobody else has to think about it. */
    --fb-on-accent: var(--on-accent, #ffffff);
    --fb-sans: var(--sans, var(--font-body, system-ui, -apple-system, sans-serif, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC"));
    --fb-serif: var(--serif, var(--font-heading, Georgia, "Times New Roman", serif, "Songti SC", "Noto Serif SC", "Source Han Serif SC", SimSun));
  }

  .fb-launch {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
    width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--fb-accent); color: var(--fb-on-accent); border: none;
    box-shadow: 0 3px 14px rgba(0,0,0,.18);
    transition: transform .15s ease, background .15s ease;
  }
  .fb-launch:hover { background: var(--fb-accent-ink); transform: translateY(-1px); }
  .fb-launch:focus-visible { outline: 2px solid var(--focus, var(--fb-accent)); outline-offset: 3px; }
  .fb-launch::after { content: none; }

  .fb-panel {
    position: fixed; right: 1.25rem; bottom: 5rem; z-index: 61;
    width: min(21rem, calc(100vw - 2.5rem));
    background: var(--fb-surface); color: var(--fb-ink);
    border: 1px solid var(--fb-line); border-radius: 14px; padding: 1.1rem;
    box-shadow: 0 10px 34px rgba(0,0,0,.16);
    font-family: var(--fb-sans);
  }
  .fb-panel h2 {
    font-family: var(--fb-serif); font-size: 1.05rem; font-weight: 600;
    margin: 0 0 .2rem; color: var(--fb-ink);
  }
  .fb-panel .fb-sub { font-size: .82rem; color: var(--fb-muted); margin: 0 0 .8rem; }
  .fb-panel textarea, .fb-panel input[type=email] {
    width: 100%; font: inherit; font-size: .88rem; color: var(--fb-ink);
    padding: .55rem .65rem; border: 1px solid var(--fb-line-strong);
    border-radius: 8px; background: var(--fb-surface); box-sizing: border-box;
  }
  /* The placeholder is the one piece of text a UA colours for you, and its
     default is tuned to the browser's idea of the page — not to ours. Left
     alone it was the palest thing in the panel. */
  .fb-panel ::placeholder { color: var(--fb-muted); opacity: 1; }
  .fb-panel textarea { min-height: 6rem; resize: vertical; }
  .fb-panel input[type=email] { margin-top: .5rem; }
  .fb-panel textarea:focus-visible, .fb-panel input:focus-visible {
    outline: 2px solid var(--focus, var(--fb-accent)); outline-offset: 1px;
    border-color: var(--fb-accent);
  }
  .fb-row { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }
  .fb-send {
    font: inherit; font-size: .86rem; font-weight: 600; padding: .45rem 1rem;
    border-radius: 8px; cursor: pointer; border: 1px solid var(--fb-accent);
    background: var(--fb-accent); color: var(--fb-on-accent);
  }
  /* .5 was low enough on a light panel to read as absent rather than as "not
     yet" — which is what the screenshot of this bug shows. */
  .fb-send:disabled { opacity: .62; cursor: default; }
  .fb-send::after { content: none; }
  .fb-cancel {
    font: inherit; font-size: .82rem; color: var(--fb-muted);
    background: none; border: none; cursor: pointer; padding: .45rem .2rem;
  }
  .fb-cancel:hover { color: var(--fb-ink); }
  .fb-count { margin-left: auto; font-size: .74rem; color: var(--fb-muted); }
  .fb-count.over { color: var(--fb-danger); }
  .fb-error { color: var(--fb-danger); font-size: .8rem; margin: .55rem 0 0; }
  .fb-done { font-size: .88rem; color: var(--fb-ink); margin: .3rem 0 0; }
  /* The honeypot. Off-screen rather than display:none, because some bots skip
     fields they can tell are hidden. aria-hidden + tabindex keep it away from
     screen readers and the keyboard, so no real person can reach it. */
  .fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

  /* ⚠️ Lifted clear of the phone's bottom navigation bar.

     This rule lives here rather than in `_workspace.html`, and that is the
     whole point: it was written there first, at equal specificity, and lost —
     this stylesheet is included further down the document, so it won. A
     component's own position belongs in the component's own stylesheet, where
     nothing later can quietly undo it.

     Without it the launcher sits exactly on top of the account avatar at the
     right end of the bar: two fixed elements, same corner, one covering the
     other. 34rem is the phone breakpoint — see `_design_tokens.html`. */
  @media (max-width: 34rem) {
    .fb-launch { bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
    .fb-panel { bottom: calc(8.2rem + env(safe-area-inset-bottom, 0px)); }
  }
