/* Feedback layer over the prototype: context menu, form, pins, list. */
:root {
  --fb-bg: #ffffff;
  --fb-fg: #09090b;
  --fb-muted: #f4f4f5;
  --fb-mfg: #63636b;
  --fb-border: #e4e4e7;
  --fb-accent: #0a7551;
  --fb-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  --fb-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fb-bg: #1f2126;
    --fb-fg: #e8e9eb;
    --fb-muted: #2b2e34;
    --fb-mfg: #a3a9b0;
    --fb-border: #3a3d44;
    --fb-accent: #15803d;
    --fb-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

.fb-layer, .fb-layer * { box-sizing: border-box; font-family: var(--fb-font); }
.fb-layer button { font: inherit; }

.fb-menu, .fb-form, .fb-pop {
  position: fixed; z-index: 1002; background: var(--fb-bg); color: var(--fb-fg);
  border: 1px solid var(--fb-border); border-radius: 12px; box-shadow: var(--fb-shadow);
  font-size: 14px; line-height: 1.4;
}
.fb-menu { width: 272px; padding: 6px; }
.fb-menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--fb-mfg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--fb-fg); cursor: pointer; text-align: left;
}
.fb-item:hover, .fb-item:focus-visible { background: var(--fb-muted); outline: none; }
.fb-item small { display: block; color: var(--fb-mfg); font-size: 12px; }
.fb-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fb-sep { height: 1px; background: var(--fb-border); margin: 6px 4px; }
.fb-note { padding: 4px 10px 6px; font-size: 12px; color: var(--fb-mfg); }

.fb-form { width: 360px; max-width: calc(100vw - 24px); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fb-form h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.fb-ctx { font-size: 12.5px; color: var(--fb-mfg); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fb-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 500; }
.fb-input {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--fb-border); border-radius: 8px;
  background: var(--fb-bg); color: var(--fb-fg); font: 400 14px var(--fb-font);
}
textarea.fb-input { min-height: 96px; resize: vertical; }
.fb-input:focus { outline: 2px solid var(--fb-accent); outline-offset: -1px; }
.fb-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-row.end { justify-content: flex-end; }
.fb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--fb-border); border-radius: 8px; background: var(--fb-bg); color: var(--fb-fg); cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.fb-btn:hover { background: var(--fb-muted); }
.fb-btn.primary { background: var(--fb-accent); border-color: var(--fb-accent); color: #ffffff; }
.fb-btn.ghost { border-color: transparent; background: transparent; color: var(--fb-mfg); }
.fb-btn.ghost:hover { color: var(--fb-fg); background: var(--fb-muted); }
.fb-btn.sm { min-height: 30px; padding: 0 9px; font-size: 12.5px; }
.fb-btn[disabled] { opacity: 0.55; cursor: default; }
.fb-err { color: #b91c1c; font-size: 12.5px; }
@media (prefers-color-scheme: dark) { .fb-err { color: #f87171; } }

.fb-hl {
  position: fixed; z-index: 1001; pointer-events: none; border-radius: 6px;
  outline: 2px solid var(--fb-accent); outline-offset: 2px; background: rgba(10, 117, 81, 0.08);
  transition: all 0.08s ease-out;
}
.fb-hl.flash { animation: fb-flash 1.6s ease-out 1; }
@keyframes fb-flash { 0%, 60% { background: rgba(245, 158, 11, 0.25); outline-color: #f59e0b; } 100% { background: transparent; } }

.fb-pins { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 900; }
.fb-pin {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50% 50% 50% 4px;
  border: 2px solid #ffffff; color: #ffffff; font: 700 11px/18px var(--fb-font); text-align: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); padding: 0;
}
.fb-pin:hover, .fb-pin:focus-visible { transform: scale(1.15); outline: none; }

.fb-pop { width: 320px; max-width: calc(100vw - 24px); padding: 14px; display: flex; flex-direction: column; gap: 8px; }

.fb-bar {
  position: fixed; left: 16px; bottom: 16px; z-index: 950; display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--fb-bg); color: var(--fb-fg); border: 1px solid var(--fb-border); border-radius: 12px; box-shadow: var(--fb-shadow);
  font-size: 13px; max-width: calc(100vw - 32px);
}
.fb-bar-hint { padding: 0 6px; color: var(--fb-mfg); white-space: nowrap; }
.fb-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--fb-accent); color: #ffffff; font-size: 12px; line-height: 20px; text-align: center; }
.fb-switch[aria-pressed='false'] { color: var(--fb-mfg); }

.fb-mode-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1003; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px; padding: 10px 16px; background: #f59e0b; color: #1c1917; font-weight: 600; font-size: 14px;
}
body.fb-picking, body.fb-picking * { cursor: crosshair !important; }

.fb-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001; width: 420px; max-width: 100vw; display: flex; flex-direction: column;
  background: var(--fb-bg); color: var(--fb-fg); border-left: 1px solid var(--fb-border); box-shadow: var(--fb-shadow); font-size: 14px;
}
.fb-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--fb-border); }
.fb-panel-head h2 { margin: 0; font-size: 17px; }
.fb-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--fb-border); }
.fb-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--fb-border); background: var(--fb-bg); color: var(--fb-fg); cursor: pointer; font-size: 12.5px; font-weight: 500;
}
.fb-chip[aria-pressed='true'] { background: var(--fb-fg); border-color: var(--fb-fg); color: var(--fb-bg); }
.fb-list { flex: 1 1 auto; overflow-y: auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.fb-card { border: 1px solid var(--fb-border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.fb-card-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.fb-where { font-size: 12.5px; color: var(--fb-mfg); }
.fb-text { white-space: pre-wrap; word-break: break-word; }
.fb-meta { font-size: 12px; color: var(--fb-mfg); }
.fb-empty { color: var(--fb-mfg); padding: 24px 0; text-align: center; }
.fb-panel-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--fb-border); }

.fb-toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%); z-index: 1004; padding: 10px 16px; border-radius: 10px;
  background: var(--fb-fg); color: var(--fb-bg); font-weight: 500; font-size: 14px; box-shadow: var(--fb-shadow); max-width: calc(100vw - 32px);
}

@media (max-width: 760px) {
  .fb-bar { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; }
  .fb-bar-hint { display: none; }
  .fb-menu { width: min(300px, calc(100vw - 16px)); }
  .fb-item { min-height: 44px; }
  .fb-btn { min-height: 44px; }
}
@media (hover: hover) and (min-width: 761px) { .fb-only-touch { display: none; } }
@media (hover: none), (max-width: 760px) {
  .fb-only-mouse { display: none; }
  /* The support chat takes the whole bottom of a phone: the bar would cover its input. */
  body:has(#app .chatpanel) .fb-bar { display: none; }
}
