/* ============================================================================
   FORMAK Studio — design reference shell
   - Tokens live in colors_and_type.css (--ink, --line, --fg, --pulse, --font-*).
   - This file owns the app bar, settings popover, workbench, console,
     capture panel, sport chips, search, capture cards, and EmptyState.
   ========================================================================== */

/* Override landing.css smooth-scroll: instant scroll only on studio so
   back-navigation doesn't animate while content is still hydrating. */
html {
  scroll-behavior: auto;
  background: var(--ink-900);
}

/* Boot gate: hide only the stage (not app bar / tabdock). Hiding the whole
   body caused multi-frame black flashes on Profiles → Studio in Chrome mobile
   while the long studio.js script chain ran. */
body[data-booting] #studio-stage {
  visibility: hidden;
}

/* ============================================================================
   FOUNDATION — small, reusable tokens
   ========================================================================== */

body { background: var(--ink-900); }
.fk-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--pulse-500); color: #04222C;
  padding: 8px 14px; border-radius: 0 0 6px 6px;
  font-family: var(--font-mono); font-size: 12px;
  z-index: 1000;
}
.fk-skip:focus { left: 12px; }

/* scrollbars (also matches design) */
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   APP BAR
   ========================================================================== */
.fk-appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 17, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.fk-appbar__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}
.fk-appbar__spacer { flex: 1 1 auto; min-width: 0; }
.fk-appbar--start .fk-appbar__in {
  display: flex;
}
.fk-appbar--start .fk-brand--studio {
  justify-self: auto;
}
.fk-appbar__left,
.fk-appbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fk-appbar__left { justify-self: start; }
.fk-appbar__actions { justify-self: end; }
.fk-appbar__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.035);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-appbar__back:hover {
  background: var(--pulse-tint);
  border-color: rgba(63, 127, 221, .38);
  color: var(--pulse-300);
}
.fk-appbar__back .fk-ic { width: 15px; height: 15px; }
.fk-appbar__capture { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.fk-appbar__capture .fk-ic { width: 17px; height: 17px; }

.fk-brand--studio {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  justify-self: center;
  text-decoration: none;
  color: inherit;
}
.fk-brand--studio .fk-brand__logo { height: 32px; width: auto; display: block; flex: none; }
.fk-brand--studio .fk-brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.3px;
  color: var(--fg-1);
}
/* ============================================================================
   ICON BUTTONS / AVATAR / SWITCH
   ========================================================================== */
.fk-iconbtn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  color: var(--fg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
  flex: none;
}
.fk-iconbtn:hover { background: var(--ink-800); border-color: var(--line-strong); color: var(--fg-1); }
.fk-iconbtn[aria-pressed="true"],
.fk-iconbtn[aria-expanded="true"] {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.4);
}
.fk-iconbtn .fk-ic { width: 18px; height: 18px; }

.fk-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pulse-500), var(--pulse-700));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  color: #04222C;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  flex: none;
  letter-spacing: 0;
  padding: 0;
  transition: transform var(--t-fast) var(--ease-out);
}
.fk-avatar:hover { transform: scale(1.05); }
.fk-avatar--sm { width: 32px; height: 32px; font-size: 11px; }

@media (min-width:1081px) and (pointer:fine) {
  .fk-appbar {
    gap: 18px;
    padding: 17px clamp(21px, 4.5vw, 42px);
  }
  .fk-appbar__in {
    gap: 18px;
  }
  .fk-appbar__left,
  .fk-appbar__actions {
    gap: 15px;
  }
  .fk-appbar__back {
    min-height: 54px;
    padding: 0 19px;
    font-size: 14px;
    gap: 11px;
  }
  .fk-appbar__back .fk-ic {
    width: 20px;
    height: 20px;
  }
  .fk-brand--studio {
    gap: 17px;
  }
  .fk-brand--studio .fk-brand__logo {
    height: 48px;
  }
  .fk-brand--studio .fk-brand__name {
    font-size: 29px;
  }
  .fk-iconbtn {
    width: 54px;
    height: 54px;
  }
  .fk-iconbtn .fk-ic {
    width: 27px;
    height: 27px;
  }
  .fk-avatar {
    width: 54px;
    height: 54px;
    font-size: 18px;
  }
  .fk-appbar__capture {
    gap: 12px;
  }
  .fk-appbar__capture .fk-ic {
    width: 26px;
    height: 26px;
  }
}

/* switch (used in settings popover + console ref row) */
.fk-switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--ink-650);
  position: relative;
  flex: none;
  transition: background var(--t-fast) var(--ease-out);
}
.fk-switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left var(--t-fast) var(--ease-out);
}
[aria-pressed="true"] > .fk-switch,
.is-on > .fk-switch {
  background: var(--pulse-500);
}
[aria-pressed="true"] > .fk-switch .fk-switch__knob,
.is-on > .fk-switch .fk-switch__knob {
  left: 16px;
}

/* reference pill / dot */
.fk-ref-pill,
.fk-ref-dot-host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  background: var(--ink-700);
  color: var(--fg-2);
  border: 1px solid var(--line);
}
.fk-ref-pill[aria-pressed="true"] {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.4);
}
.fk-ref-pill .fk-ic { width: 14px; height: 14px; }
.fk-ref-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-disabled);
  flex: none;
  transition: background var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.fk-ref-pill[aria-pressed="true"] .fk-ref-dot,
.fk-btn[aria-pressed="true"] .fk-ref-dot {
  background: var(--pulse-400);
  box-shadow: 0 0 8px var(--pulse-glow);
}

.fk-wb__capture-row--presets {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding-bottom: 2px;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fk-wb__capture-row--presets::-webkit-scrollbar { width: 0; height: 0; display: none; -webkit-appearance: none; }
.fk-wb__capture-row--presets::-webkit-scrollbar { height: 4px; }
.fk-wb__capture-row--presets::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.fk-wb__capture-providers {
  display: flex;
  gap: 6px;
}
.fk-wb__provider-chip {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-700);
  color: var(--fg-2);
  padding: 6px 11px;
  font: 600 11px/1 var(--font-sans);
  cursor: pointer;
}
.fk-wb__provider-chip[aria-pressed="true"] {
  border-color: rgba(63, 127, 221, 0.55);
  background: var(--pulse-tint);
  color: var(--pulse-300);
}
.fk-preset {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px 8px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-preset .fk-ic { width: 15px; height: 15px; }
.fk-preset__label { white-space: nowrap; }
.fk-preset:hover { border-color: var(--line-strong); color: var(--fg-1); }
.fk-preset.is-active,
.fk-preset[aria-selected="true"] {
  background: var(--pulse-tint);
  border-color: rgba(63, 127, 221, 0.45);
  color: var(--pulse-300);
}
.fk-preset.is-active .fk-ic,
.fk-preset[aria-selected="true"] .fk-ic { color: var(--pulse-300); }

.fk-wb__capture-ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(63, 127, 221, 0.04), rgba(63, 127, 221, 0.01));
  border: 1px solid rgba(63, 127, 221, 0.18);
}
.fk-wb__capture-ref-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fk-wb__capture-ref-title { font-size: 12px; font-weight: 600; color: var(--fg-1); }
.fk-wb__capture-ref-sub { font-size: 10.5px; color: var(--fg-3); line-height: 1.3; }
.fk-wb__capture-ref-controls { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.fk-ref-gear-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  color: var(--fg-3);
  border: 1px solid var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-ref-gear-btn:hover { background: var(--ink-800); border-color: var(--line-strong); color: var(--fg-1); }
.fk-ref-gear-btn[aria-expanded="true"] { background: var(--pulse-tint); color: var(--pulse-300); border-color: rgba(63, 127, 221, 0.4); }
.fk-ref-gear-btn.is-configured { color: var(--pulse-300); border-color: rgba(63, 127, 221, 0.35); background: var(--pulse-tint); }
.fk-ref-gear-btn .fk-ic { width: 14px; height: 14px; }

.fk-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-switch-btn__knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fg-disabled);
  transition: background var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.fk-switch-btn[aria-pressed="true"] {
  background: var(--pulse-tint);
  border-color: rgba(63, 127, 221, 0.4);
  color: var(--pulse-300);
}
.fk-switch-btn[aria-pressed="true"] .fk-switch-btn__knob {
  background: var(--pulse-400);
  box-shadow: 0 0 6px var(--pulse-glow);
}

.fk-btn--block { width: 100%; justify-content: center; }

/* ============================================================================
   SETTINGS POPOVER
   ========================================================================== */
.fk-settings { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.fk-settings[data-open="true"] { pointer-events: auto; }
.fk-settings[hidden] { display: none; }
.fk-settings__scrim {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.45);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
  z-index: 40;
}
.fk-settings[data-open="true"] .fk-settings__scrim { opacity: 1; }
.fk-settings__panel {
  position: fixed;
  top: 62px;
  right: var(--fk-pop-right, clamp(12px, 3vw, 28px));
  z-index: 50;
  width: min(330px, calc(100vw - 24px));
  background: var(--ink-800);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--elev-3);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.fk-settings[data-open="true"] .fk-settings__panel { opacity: 1; transform: none; }
.fk-settings__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.fk-settings__title { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--fg-1); }
.fk-settings__body { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.fk-settings__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: block;
  margin-bottom: 9px;
}
.fk-settings__hint {
  font-size: 12.5px;
  color: var(--fg-3);
  line-height: 1.5;
  margin: 9px 0 0;
}

.fk-seg {
  display: flex;
  gap: 8px;
}
.fk-seg__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  background: var(--ink-700);
  color: var(--fg-2);
  border: 1px solid var(--line);
}
.fk-seg__btn:hover { border-color: var(--line-strong); color: var(--fg-1); }
.fk-seg__btn.is-active {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.4);
}
.fk-seg__btn .fk-ic { width: 16px; height: 16px; }

.fk-settings__ref {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: border-color var(--t-fast) var(--ease-out);
}
.fk-settings__ref:hover { border-color: var(--line-strong); }
.fk-settings__ref-ico { color: var(--pulse-300); flex: none; display: inline-flex; }
.fk-settings__ref-ico .fk-ic { width: 18px; height: 18px; }
.fk-settings__ref-text { flex: 1; min-width: 0; }
.fk-settings__ref-title { font-size: 13.5px; color: var(--fg-1); font-weight: 500; display: block; }
.fk-settings__ref-sub { font-size: 12px; color: var(--fg-3); line-height: 1.45; margin-top: 2px; display: block; }

/* ============================================================================
   REFERENCE POSE POPOVER
   ========================================================================== */
.fk-ref-popover { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.fk-ref-popover[data-open="true"] { pointer-events: auto; }
.fk-ref-popover[hidden] { display: none; }
.fk-ref-popover__scrim {
  position: fixed; inset: 0; background: rgba(6, 8, 12, 0.6); opacity: 0;
  transition: opacity var(--t-med) var(--ease-out); z-index: 50;
}
.fk-ref-popover[data-open="true"] .fk-ref-popover__scrim { opacity: 1; }
.fk-ref-popover__panel {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  z-index: 60;
  width: min(960px, 92vw);
  max-height: 88vh;
  background: var(--ink-800); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--elev-3); overflow: hidden;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
  display: flex; flex-direction: column;
}
.fk-ref-popover[data-open="true"] .fk-ref-popover__panel { opacity: 1; transform: translate(-50%, -50%); }
.fk-ref-popover__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none;
}
.fk-ref-popover__title { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--fg-1); }
.fk-ref-popover__body { padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; overflow: auto; flex: 1; }
.fk-ref-popover__hint { font-size: 13px; color: var(--fg-3); line-height: 1.45; margin: 0; max-width: 60ch; }
.fk-ref-popover__dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 36px 16px; min-height: 220px;
  border-radius: var(--r-md); border: 1px dashed var(--line-strong);
  background: var(--ink-700); color: var(--fg-3);
  cursor: pointer; text-align: center; position: relative; overflow: hidden;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-ref-popover__dropzone:hover,
.fk-ref-popover__dropzone:focus-visible,
.fk-ref-popover__dropzone.is-drag {
  border-color: var(--pulse-400); background: var(--ink-800); color: var(--fg-1);
}
.fk-ref-popover__dropzone .fk-ic { width: 32px; height: 32px; }
.fk-ref-popover__placeholder-main { font-size: 14px; font-weight: 600; color: var(--fg-2); }
.fk-ref-popover__placeholder-sub { font-size: 12px; color: var(--fg-3); }
.fk-ref-popover__placeholder[hidden] { display: none; }
.fk-ref-popover__preview { display: block; width: 100%; max-height: 56vh; object-fit: contain; border-radius: var(--r-md); }
.fk-ref-popover__preview[hidden] { display: none; }
.fk-ref-popover__status {
  font-size: 13px; color: var(--fg-2); line-height: 1.45;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--ink-700); border: 1px solid var(--line);
}
.fk-ref-popover__status[hidden] { display: none; }
.fk-ref-popover__status.is-error {
  color: #f87171; border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.06);
}
.fk-ref-popover__status.is-success {
  color: #34dd92; border-color: rgba(52, 221, 146, 0.3); background: rgba(52, 221, 146, 0.06);
}
.fk-ref-popover__status.is-working {
  color: var(--pulse-300); border-color: rgba(63, 127, 221, 0.3); background: var(--pulse-tint);
}

.fk-ref-popover__canvas {
  display: block; width: 100%; height: auto;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--ink-700);
}
.fk-ref-popover__canvas[hidden] { display: none; }

/* ============================================================================
   STAGE
   ========================================================================== */
.fk-stage {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) clamp(14px, 3vw, 28px) 80px;
}

@media (min-width:1081px) and (pointer:fine) {
  .fk-stage { zoom: 1.5; }
}

/* ============================================================================
   WORKBENCH LAYOUT
   ========================================================================== */
.fk-wb { display: block; }
.fk-wb[hidden] { display: none; }

.fk-wb__capture {
  position: relative;
  overflow: hidden;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--elev-1);
  padding: 16px clamp(16px, 2.2vw, 22px);
  flex: 2 1 360px;
  min-width: 0;
}
.fk-wb__hero {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}
.fk-wb__capture-grid {
  position: absolute; inset: 0;
  background-image: none;
  -webkit-mask-image: radial-gradient(circle at 22% 24%, #000, transparent 70%);
          mask-image: radial-gradient(circle at 22% 24%, #000, transparent 70%);
  pointer-events: none;
}
.fk-wb__capture-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}
.fk-wb__capture-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 0;
  width: 100%;
  padding: 4px 0;
  box-sizing: border-box;
}
.fk-wb__capture-empty[hidden] { display: none; }
.fk-wb__capture-form { display: contents; }
.fk-wb__capture-form[hidden] { display: none; }
.fk-wb__capture-ico {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--pulse-tint);
  color: var(--pulse-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fk-wb__capture-ico .fk-ic { width: 25px; height: 25px; }
.fk-wb__capture-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--fg-1);
}
.fk-wb__capture-sub {
  color: var(--fg-2);
  font-size: 14.5px;
  margin: 0;
  max-width: 430px;
  line-height: 1.55;
}
.fk-wb__capture-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fk-wb__capture-actions .fk-ic { width: 16px; height: 16px; }

.fk-wb__capture-form {
  display: grid;
  grid-template-columns: minmax(0, min(340px, 44%)) minmax(0, 1fr);
  grid-template-areas:
    "options stage"
    "actions actions";
  gap: 14px;
  align-items: start;
  width: 100%;
  min-width: 0;
}
.fk-wb__capture-options { grid-area: options; }
.fk-wb__capture-stage {
  grid-area: stage;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}
.fk-wb__capture-form-actions { grid-area: actions; }
.fk-wb__capture-camera {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 140px;
  max-height: 200px;
  padding: 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(6, 8, 12, 0.35);
  box-sizing: border-box;
  cursor: pointer;
  color: var(--pulse-300);
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-wb__capture-camera:hover {
  border-color: var(--pulse-400);
  background: var(--pulse-tint);
  color: var(--pulse-300);
}
.fk-wb__capture-camera .fk-ic {
  width: 40px;
  height: 40px;
  pointer-events: none;
}
.fk-wb__capture-camera-guide {
  display: none !important;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 2px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--fg-2);
}
.fk-wb__capture-camera-guide[hidden] { display: none !important; }
.fk-protocol {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 8px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  border: 1px dashed rgba(63, 127, 221, 0.35);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.fk-protocol .fk-ic { width: 15px; height: 15px; }
.fk-protocol:hover { border-color: rgba(63, 127, 221, 0.55); color: var(--fg-1); }
.fk-protocol.is-active,
.fk-protocol[aria-selected="true"] {
  background: var(--pulse-tint);
  border-style: solid;
  border-color: rgba(63, 127, 221, 0.55);
  color: var(--pulse-300);
}
.fk-protocol.is-active .fk-ic,
.fk-protocol[aria-selected="true"] .fk-ic { color: var(--pulse-300); }
.fk-capcard__protocol,
.fk-caprow__protocol {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--pulse-300);
}
.fk-wb__capture-dropzone { min-height: 130px; }
.fk-wb__capture-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.fk-wb__capture-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 0;
}
.fk-wb__capture-form-actions .fk-btn {
  width: 100%;
  min-width: 0;
  padding: 10px 20px;
  font-size: 14px;
  justify-content: center;
}

.fk-wb__capture-dropzone {
  position: relative;
  min-height: 140px;
  max-height: 200px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(6, 8, 12, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
  width: 100%;
  align-self: stretch;
}
.fk-wb__capture-dropzone:hover,
.fk-wb__capture-dropzone.is-drag { border-color: var(--pulse-400); background: var(--pulse-tint); }
.fk-wb__capture-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--fg-2);
  font-size: 12.5px;
  pointer-events: none;
  text-align: center;
  padding: 12px;
}
.fk-wb__capture-placeholder .fk-ic { width: 26px; height: 26px; color: var(--pulse-300); }
.fk-wb__capture-placeholder-main { color: var(--fg-1); font-weight: 500; font-size: 12.5px; }
.fk-wb__capture-placeholder-sub {
  font-size: 10.5px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.fk-wb__capture-preview {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: var(--r-md);
  pointer-events: none;
}
.fk-wb__capture-preview img,
.fk-wb__capture-preview video,
.fk-wb__capture-preview .fk-capture-poster {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.fk-wb__capture-preview video {
  min-height: 96px;
  width: 100%;
  background: #000;
}
.fk-capture-filechip {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: rgba(8, 12, 18, 0.78);
  color: #e8eef8;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.fk-wb__capture-options { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.fk-wb__capture-meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); }
.fk-wb__capture-meta:empty { display: none; }
.fk-wb__capture-error {
  font-size: 13px;
  color: var(--risk);
  background: rgba(255, 93, 93, 0.1);
  border: 1px solid rgba(255, 93, 93, 0.25);
  border-radius: var(--r-sm);
  padding: 8px 11px;
}
.fk-wb__capture-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: stretch;
  padding-top: 0;
  width: 100%;
}
.fk-wb__capture-form-actions .fk-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

/* resume last (right) */
.fk-wb__resume {
  flex: 1 1 240px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--elev-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
}
.fk-wb__resume:hover { border-color: var(--line-strong); }
.fk-wb__resume-thumb {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: radial-gradient(130% 120% at 50% 12%, #0f1622, #06080C 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fk-wb__resume-thumb-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 8%, #000 64%);
          mask-image: linear-gradient(to bottom, transparent 8%, #000 64%);
}
.fk-wb__resume-thumb-pose {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.fk-wb__resume-thumb-pose svg { width: 62%; height: 78%; display: block; }
.fk-wb__resume-thumb-pose img { width: 72%; height: 82%; display: block; object-fit: contain; }
.fk-wb__resume-play {
  position: absolute;
  left: 11px;
  bottom: 11px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(63, 127, 221, 0.18);
  border: 1px solid var(--pulse-500);
  color: var(--pulse-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
}
.fk-wb__resume-play .fk-ic { width: 13px; height: 13px; }
.fk-wb__resume-body { padding: 11px 14px; flex: 0 0 auto; }
.fk-wb__resume-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: block;
}
.fk-wb__resume-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  margin: 5px 0 3px;
  color: var(--fg-1);
  display: block;
}
.fk-wb__resume-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pulse-300);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* filters row */
.fk-wb__filters {
  margin-top: 26px;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
}
.fk-wb__chips-row {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fk-wb__chips {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fk-wb__chips::-webkit-scrollbar { width: 0; height: 0; display: none; -webkit-appearance: none; }

/* sport chip (shared by wb + cl) */
.fk-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  background: var(--ink-700);
  color: var(--fg-2);
  border: 1px solid var(--line);
}
.fk-chip:hover { border-color: var(--line-strong); color: var(--fg-1); }
.fk-chip.is-active {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.4);
}
.fk-chip[disabled] {
  background: var(--ink-800);
  color: var(--fg-disabled);
  border: 1px solid var(--line);
  cursor: not-allowed;
  opacity: 0.65;
}
.fk-chip[aria-pressed="true"] {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.4);
}
.fk-chip[aria-pressed="true"]:hover {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.55);
}
.fk-chip .fk-ic { width: 15px; height: 15px; }
.fk-chip__soon { font-size: 10px; opacity: 0.7; }

/* collapse-to-selected sport filters */
.fk-wb__chips[data-collapsed="true"] {
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
.fk-wb__chips[data-collapsed="true"] .fk-chip:not(.is-active) { display: none; }

/* sport filter toggle */
.fk-chip-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-700);
  color: var(--fg-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.fk-chip-toggle:hover { border-color: var(--line-strong); color: var(--fg-1); }
.fk-chip-toggle[aria-expanded="true"] { display: none; }
.fk-chip-toggle .fk-ic { width: 15px; height: 15px; }
.fk-chip-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* search input */
.fk-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  flex: 0 0 200px;
  min-width: 0;
  transition: border-color var(--t-fast) var(--ease-out);
}
.fk-search:focus-within { border-color: var(--pulse-500); }
.fk-search .fk-ic { color: var(--fg-3); width: 15px; height: 15px; flex: none; }
.fk-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 13.5px;
}
.fk-search input::placeholder { color: var(--fg-3); }

/* library toolbar (scope sits beside sports; trash + search stay end-aligned) */
.fk-library__toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
.fk-library__delete,
.fk-library__confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  color: var(--fg-1);
  border: 1px solid var(--line);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  flex: none;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.fk-library__delete:hover { border-color: var(--line-strong); color: var(--fg-1); }
.fk-library__delete .fk-ic { width: 15px; height: 15px; color: var(--fg-3); }
.fk-library__delete:hover .fk-ic { color: var(--risk); }
.fk-library__confirm { display: none; width: auto; padding: 0 12px; }
.fk-library__confirm:hover { border-color: var(--risk); color: var(--risk); }
.fk-library__confirm:disabled,
.fk-library__confirm[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--fg-3);
  border-color: var(--line);
}
.fk-library__confirm:disabled:hover,
.fk-library__confirm[aria-disabled="true"]:hover {
  color: var(--fg-3);
  border-color: var(--line);
}

/* selection checkbox overlay on capture cards / rows */
.fk-capture__select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(6, 8, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.fk-capcard { position: relative; }
.fk-caprow { position: relative; }
.fk-caprow .fk-capture__select {
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
}
.fk-capture__select .fk-capture__checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--pulse-400);
  cursor: pointer;
  pointer-events: none;
}
.fk-capture__select:hover { border-color: rgba(63, 127, 221, 0.55); }

.fk-library--delete .fk-capture__select { display: inline-flex; }
.fk-capcard.is-selected { border-color: rgba(63, 127, 221, 0.55); box-shadow: 0 0 0 1px rgba(63, 127, 221, 0.35) inset; }
.fk-caprow.is-selected  { border-color: rgba(63, 127, 221, 0.55); }

/* shift card content to make room for the delete checkbox */
.fk-library--delete .fk-capcard__thumb-date,
.fk-library--delete .fk-capcard__thumb-badge {
  top: 9px;
}
.fk-library--delete .fk-capcard__thumb-date { left: 42px; }
.fk-library--delete .fk-caprow__thumb { margin-left: 34px; }

/* captures section — label/count hidden; search + chips carry the section */
.fk-wb__captures-label,
.fk-wb__captures-count {
  display: none !important;
}

/* capture grid */
.fk-wb__captures {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
}

/* ============================================================================
   CONSOLE LAYOUT
   ========================================================================== */
.fk-cl { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.fk-cl[hidden] { display: none; }

.fk-cl__side {
  flex: 1 1 210px;
  max-width: 282px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fk-cl__side .fk-search { width: 100%; flex: 0 0 auto; }

.fk-cl__sports-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: block;
  margin: 2px 0 8px;
}
.fk-cl__sport-list { display: flex; flex-direction: column; gap: 3px; }

.fk-sportrow {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-2);
  text-align: left;
}
.fk-sportrow:hover { background: var(--ink-800); color: var(--fg-1); }
.fk-sportrow.is-active {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.35);
}
.fk-sportrow[disabled] {
  color: var(--fg-disabled);
  cursor: not-allowed;
  opacity: 0.65;
}
.fk-sportrow .fk-ic { width: 15px; height: 15px; flex: none; }
.fk-sportrow__label { flex: 1; }
.fk-sportrow__count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

.fk-cl__ref {
  padding: 12px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: border-color var(--t-fast) var(--ease-out);
}
.fk-cl__ref:hover { border-color: var(--line-strong); }
.fk-cl__ref-ico { color: var(--pulse-300); flex: none; display: inline-flex; }
.fk-cl__ref-ico .fk-ic { width: 16px; height: 16px; }
.fk-cl__ref-text { flex: 1; min-width: 0; }
.fk-cl__ref-title { font-size: 13px; color: var(--fg-1); font-weight: 500; display: block; }
.fk-cl__ref-sub { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); margin-top: 1px; display: block; }

.fk-cl__main { flex: 999 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 13px; }
.fk-cl__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.fk-cl__head-left { display: flex; align-items: baseline; gap: 10px; }
.fk-cl__head-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.fk-cl__head-count { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }

.fk-cl__view { display: flex; gap: 6px; }
.fk-viewbtn {
  width: 32px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  color: var(--fg-2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.fk-viewbtn:hover { border-color: var(--line-strong); color: var(--fg-1); }
.fk-viewbtn.is-active {
  background: var(--pulse-tint);
  color: var(--pulse-300);
  border-color: rgba(63, 127, 221, 0.4);
}
.fk-viewbtn .fk-ic { width: 16px; height: 16px; }

.fk-cl__list { display: flex; flex-direction: column; gap: 8px; }
.fk-cl__list.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* ============================================================================
   CAPTURE CARD
   ========================================================================== */
.fk-capcard {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--elev-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  padding: 0;
}
.fk-capcard:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.fk-capcard__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: radial-gradient(130% 120% at 50% 12%, #0f1622, #06080C 78%);
  overflow: hidden;
}
.fk-capcard__thumb-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 6%, #000 62%);
          mask-image: linear-gradient(to bottom, transparent 6%, #000 62%);
}
.fk-capcard__thumb-pose {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
  .fk-capcard__thumb-pose svg { width: 82%; height: 82%; max-width: 100%; max-height: 100%; display: block; }
  .fk-capcard__thumb-pose img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.fk-capcard__thumb-date {
  position: absolute;
  top: 9px;
  left: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--fg-2);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 9px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
}
.fk-capcard__thumb-badge {
  position: absolute;
  top: 9px;
  right: 9px;
}
.fk-capcard__body { padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.fk-capcard__title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0;
}
.fk-capcard__headline {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.45;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 0;
}
.fk-capcard__headline-ico { flex: none; margin-top: 1px; }
.fk-capcard__headline-ico .fk-ic { width: 14px; height: 14px; }
.fk-capcard__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 1px;
}
.fk-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 4px 8px;
}
.fk-metric__k { color: var(--fg-3); letter-spacing: 0.03em; }
.fk-metric__v { color: var(--fg-1); font-variant-numeric: tabular-nums; }
.fk-metric__u { color: var(--fg-3); }
.fk-capcard__foot {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
 .fk-capcard__dq {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: 30px;
  min-height: 30px;
}
.fk-capcard__dq-flat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.fk-capcard__dq-normal,
.fk-capcard__dq-metrics-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 220ms var(--ease-out);
  will-change: transform;
}
.fk-capcard__dq-normal { transform: translateY(0); }
.fk-capcard__dq-metrics-wrap { transform: translateY(100%); }
/* Hover-intent: 300ms wait before the reveal so crossing the cursor over a
   card does not fire every animation. Reverse uses base 0ms delay. */
.fk-capcard:hover .fk-capcard__dq-normal,
.fk-capcard:focus .fk-capcard__dq-normal {
  transform: translateY(-100%);
  transition-delay: 300ms;
}
.fk-capcard:hover .fk-capcard__dq-metrics-wrap,
.fk-capcard:focus .fk-capcard__dq-metrics-wrap {
  transform: translateY(0);
  transition-delay: 300ms;
}
.fk-capcard__dq-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.fk-capcard__dq-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}
.fk-capcard__dq-text {
  font-family: var(--font-mono);
  font-size: 11px;
}
.fk-capcard__dq-bar {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.fk-capcard__dq-step {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--ink-650);
}
.fk-capcard__dq-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 1px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
}
.fk-capcard__dq-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.fk-capcard__dq-metric dt {
  color: var(--fg-3);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: none;
}
.fk-capcard__dq-metric dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fk-capcard__open {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  border: 1px solid var(--line);
  flex: none;
}
.fk-capcard__open .fk-ic { width: 14px; height: 14px; }

/* row variant */
.fk-caprow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.fk-caprow:hover { border-color: var(--line-strong); }
.fk-caprow__thumb {
  position: relative;
  width: 72px;
  height: 46px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: radial-gradient(130% 120% at 50% 14%, #0f1622, #06080C 82%);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
  .fk-caprow__thumb svg { width: 78%; height: 78%; display: block; }
  .fk-caprow__thumb img { width: 78%; height: 78%; display: block; object-fit: contain; }
.fk-caprow__main { flex: 1 1 150px; min-width: 0; }
.fk-caprow__title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.fk-caprow__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 2px;
  display: block;
}
.fk-caprow__metrics { display: flex; flex-wrap: wrap; gap: 7px; }
.fk-caprow__dq {
  font-family: var(--font-mono);
  font-size: 11px;
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.fk-caprow__dq-text { font-weight: 600; }
.fk-caprow__dq-metrics {
  color: var(--fg-3);
  font-size: 10px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 400;
}
.fk-caprow__dq-metrics span:not(:first-child)::before {
  content: '·';
  margin-right: 6px;
  opacity: 0.4;
}
.fk-caprow__open { color: var(--fg-3); flex: none; }
.fk-caprow__open .fk-ic { width: 14px; height: 14px; }

/* status badge */
.fk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.fk-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.fk-badge--optimal    { background: rgba(52, 221, 146, 0.14); border-color: rgba(52, 221, 146, 0.3);  color: #7DEEBB; }
.fk-badge--optimal .fk-badge__dot    { background: var(--optimal); }
.fk-badge--acceptable { background: rgba(143, 214, 166, 0.12); border-color: rgba(143, 214, 166, 0.3); color: #B6E6C4; }
.fk-badge--acceptable .fk-badge__dot { background: var(--acceptable); }
.fk-badge--suboptimal { background: rgba(246, 169, 43, 0.14); border-color: rgba(246, 169, 43, 0.3);  color: #F8C46E; }
.fk-badge--suboptimal .fk-badge__dot { background: var(--suboptimal); }
.fk-badge--risk       { background: rgba(255, 93, 93, 0.14);  border-color: rgba(255, 93, 93, 0.32);  color: #FF9B9B; }
.fk-badge--risk .fk-badge__dot       { background: var(--risk); }

/* ============================================================================
   EMPTY STATE
   ========================================================================== */
.fk-empty {
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--ink-850);
  padding: clamp(28px, 5vw, 44px) 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  grid-column: 1 / -1;
}
.fk-cl__list .fk-empty { margin-top: 0; grid-column: auto; width: 100%; }
.fk-empty[hidden] { display: none; }
.fk-empty__ico {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--ink-700);
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fk-empty__ico .fk-ic { width: 22px; height: 22px; }
.fk-empty__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--fg-1);
}
.fk-empty__sub {
  color: var(--fg-3);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 6px 0 0;
  max-width: 340px;
}

/* ============================================================================
   BUTTONS
   ========================================================================== */
.fk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
  border: 1px solid transparent;
  background: var(--ink-700);
  color: var(--fg-1);
  text-decoration: none;
  line-height: 1.2;
}
.fk-btn:hover { border-color: var(--line-strong); }
.fk-btn--primary { background: var(--pulse-500); color: #04222C; border-color: transparent; }
.fk-btn--primary:hover { background: var(--pulse-400); }
.fk-btn--secondary { background: var(--ink-700); color: var(--fg-1); border-color: var(--line); }
.fk-btn--secondary:hover { border-color: var(--line-strong); }
.fk-btn--small { font-size: 12.5px; padding: 8px 13px; }
.fk-btn:disabled,
.fk-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.fk-btn .fk-ic { width: 16px; height: 16px; }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .fk-wb__capture-form {
    grid-template-columns: minmax(0, min(300px, 40%)) minmax(0, 1fr);
  }
  .fk-preset {
    padding: 8px 11px 7px;
    font-size: 11px;
  }
  .fk-wb__capture-placeholder-main { font-size: 11.5px; }
  .fk-wb__capture-placeholder-sub { font-size: 10.5px; }
}

@media (max-width: 860px) {
  /* Soft compact: stack options → stage → analyze */
  .fk-wb__capture-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "options"
      "stage"
      "actions";
  }
  .fk-wb__capture-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

@media (max-width: 720px) {
  .fk-appbar__in { gap: 8px; }
  .fk-appbar__back { width: 36px; padding: 0; justify-content: center; }
  .fk-appbar__back span:not(.fk-ic) { display: none; }
  .fk-brand--studio .fk-brand__logo { height: 28px; }
  .fk-appbar__capture span:not(.fk-ic) { display: none; }
  .fk-appbar__capture { padding: 9px 10px; }

  /* Phone stack: optional protocol panel → capture cards → search/filters → capture panel.
     display:contents lifts hero + library children into .fk-wb flex so order works.
     Resume Last stays desktop-only; mobile uses #fk-session-ribbon as the protocol panel
     when a Profiles session is active (.fk-wb.is-protocol-active). */
  .fk-wb {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .fk-wb__hero,
  .fk-wb__library {
    display: contents;
  }
  .fk-wb__resume {
    display: none !important;
  }
  /* Protocol panel (session ribbon) — top slot; hidden host collapses to 0. */
  #fk-session-ribbon {
    order: 0;
    flex: 0 0 auto;
    margin: 0 0 12px;
  }
  #fk-session-ribbon:not([hidden]) {
    /* Fixed outer budget so tall cards ≈ protocol + compact cards (72px). */
    height: 60px;
    box-sizing: border-box;
  }
  #fk-session-ribbon .fk-ribbon {
    margin: 0;
    height: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    gap: 6px;
    overflow: hidden;
  }
  #fk-session-ribbon .fk-ribbon__exit-label {
    display: none;
  }
  /* Phone stack: search first (high), then cards, then capture panel.
     Keep search in normal flow — sticky + backdrop fade made capture look
     like it was sliding under a translucent bar. */
  .fk-wb__filters {
    order: 1;
    position: static;
    top: auto;
    z-index: auto;
    padding: 0;
    margin-top: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .fk-wb__captures {
    order: 2;
    margin-top: 12px;
    margin-bottom: 0;
  }
  .fk-wb__capture {
    order: 3;
    width: 100%;
    flex: 0 0 auto;
    padding: 14px 14px 16px;
    margin-top: 16px;
    margin-bottom: 10px;
  }
  .fk-wb__capture-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "options"
      "stage"
      "actions";
    gap: 10px;
  }
  .fk-wb__capture-options { gap: 8px; }
  .fk-wb__capture-ref { padding: 8px 10px; gap: 8px; }
  .fk-wb__capture-ref-sub { display: none; }
  .fk-wb__capture-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .fk-wb__capture-dropzone,
  .fk-wb__capture-camera {
    min-height: 96px;
    max-height: 120px;
  }
  .fk-wb__capture-dropzone { min-height: 96px; max-height: 120px; }
  .fk-wb__capture-camera .fk-ic { width: 32px; height: 32px; }
  .fk-wb__capture-placeholder-main { font-size: 11px; }
  .fk-wb__capture-placeholder-sub { display: none; }
  .fk-wb__capture-form-actions .fk-btn {
    width: 100%;
    min-height: 48px;
    padding: 14px 20px;
    font-size: 15px;
  }

  /* Filters: search(+scope)+trash, then sports badge on the SAME row (to the right). */
  .fk-wb__filters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .fk-library__toolbar {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
    display: flex;
    margin-left: 0;
  }
  .fk-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    gap: 6px;
    padding-right: 6px;
  }
  .fk-wb__chips-row {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    max-width: 42%;
    order: 2;
    z-index: 15;
  }
  /* Scope badges compressed inside the search shell (JS moves #wb-scope-row here). */
  .fk-search .fk-wb__scope {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(52%, 12rem);
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
    margin: 0;
  }
  .fk-search .fk-wb__scope::-webkit-scrollbar { display: none; }
  .fk-search .fk-wb__scope:not([hidden])::before {
    display: none;
  }
  .fk-search .fk-scope__btn {
    padding: 2px 7px;
    font-size: 10px;
    gap: 0;
    flex: none;
  }
  .fk-search .fk-scope__label {
    max-width: 4.8em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .fk-chip-toggle { display: none !important; }
  .fk-wb__chips {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .fk-wb__chips[data-collapsed="true"] .fk-chip:not(.is-active) { display: none; }
  .fk-wb__chips[data-collapsed="false"] {
    position: absolute;
    top: 0;
    right: 0;
    width: max-content;
    min-width: 0;
    max-width: none;
    padding: 4px;
    border-radius: 12px;
    background: rgba(16, 20, 28, 0.96);
    border: 1px solid rgba(150, 170, 200, 0.22);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
  }
  .fk-wb__chips[data-collapsed="false"] .fk-chip {
    display: inline-flex;
    width: auto;
    max-width: 128px;
    justify-content: flex-start;
    padding: 7px 10px;
    gap: 6px;
  }
  .fk-wb__chips .fk-chip > span:not(.fk-ic):not(.fk-chip__soon) {
    overflow: hidden;
    white-space: nowrap;
    max-width: 5.6em;
    -webkit-mask-image: linear-gradient(to right, #000 62%, transparent 95%);
            mask-image: linear-gradient(to right, #000 62%, transparent 95%);
  }
  .fk-wb__chips[data-collapsed="true"] .fk-chip > span:not(.fk-ic):not(.fk-chip__soon) {
    -webkit-mask-image: none;
            mask-image: none;
    max-width: none;
  }

  /* Captures: horizontal scroll strip.
     Default (no protocol): taller cards reclaim the old Resume Last vertical slot.
     Protocol active: compact 198px cards + top ribbon ≈ same bottom edge → search/capture stay put.
     --fk-capcard-h is shared by cards and the empty-state panel so they stay in sync. */
  .fk-wb__captures {
    --fk-capcard-h: 270px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Room under the strip for a hairline between cards and capture panel
       (must not live inside .fk-wb__capture — that ate sports-band space). */
    padding-bottom: 17px;
    background-image: linear-gradient(
      90deg,
      transparent 0%,
      rgba(150, 170, 200, 0.18) 16%,
      rgba(150, 170, 200, 0.28) 50%,
      rgba(150, 170, 200, 0.18) 84%,
      transparent 100%
    );
    background-size: calc(100% - 8px) 1px;
    background-position: center bottom;
    background-repeat: no-repeat;
  }
  .fk-wb.is-protocol-active .fk-wb__captures {
    --fk-capcard-h: 198px;
  }
  .fk-wb__captures::-webkit-scrollbar { display: none; }
  .fk-wb__captures .fk-capcard {
    flex: 0 0 min(70vw, 220px);
    width: min(70vw, 220px);
    max-width: min(70vw, 220px);
    height: var(--fk-capcard-h);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
  }
  .fk-wb__captures .fk-capcard__thumb {
    min-height: 148px;
    height: 148px;
    max-height: 148px;
    flex: 0 0 148px;
  }
  .fk-wb.is-protocol-active .fk-wb__captures .fk-capcard__thumb {
    min-height: 88px;
    height: 88px;
    max-height: 88px;
    flex: 0 0 88px;
  }
  .fk-wb__captures .fk-capcard__body {
    padding: 10px 12px 10px;
    gap: 5px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .fk-wb__captures .fk-capcard__title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fk-wb__captures .fk-capcard__protocol {
    display: block;
    height: 14px;
    line-height: 14px;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
  }
  .fk-wb__captures .fk-capcard__protocol.is-empty {
    visibility: hidden;
  }
  .fk-wb__captures .fk-capcard__headline {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .fk-wb__captures .fk-capcard__metrics,
  .fk-wb__captures .fk-capcard__foot {
    display: none !important;
  }
  .fk-wb__captures .fk-empty {
    flex: 0 0 auto;
    width: 100%;
    height: var(--fk-capcard-h);
    margin-top: 0;
    justify-content: center;
    padding: 16px 20px;
  }

  .fk-wb__captures {
    scroll-margin-top: 12px;
  }
  /* Count pills on scope / secondary capture badges — hide on phone */
  .fk-scope__count,
  .fk-wb__scope .fk-scope__count {
    display: none !important;
  }
  .fk-capcard__thumb-badge {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fk-iconbtn, .fk-chip, .fk-btn, .fk-seg__btn, .fk-settings__panel, .fk-settings__scrim, .fk-switch, .fk-switch__knob, .fk-ref-pill, .fk-ref-dot, .fk-capcard, .fk-caprow,
  .fk-capcard__dq-normal, .fk-capcard__dq-metrics-wrap { transition: none; }
  /* With motion removed, show the metrics panel instantly so the data stays
     accessible. The row variant already shows metrics inline. */
  .fk-capcard__dq-normal { transform: translateY(-100%); }
  .fk-capcard__dq-metrics-wrap { transform: translateY(0); }
}

/* Touch devices have no hover; show the metrics panel by default. */
@media (hover: none), (pointer: coarse) {
  .fk-capcard__dq-normal { transform: translateY(-100%); }
  .fk-capcard__dq-metrics-wrap { transform: translateY(0); }
  .fk-capcard:hover .fk-capcard__dq-normal,
  .fk-capcard:focus .fk-capcard__dq-normal,
  .fk-capcard:hover .fk-capcard__dq-metrics-wrap,
  .fk-capcard:focus .fk-capcard__dq-metrics-wrap {
    transition-delay: 0ms;
    transform: none;
  }
}

/* ============================================================================
   CAMERA OVERLAY — camera-app chrome (shutter, not a text-button row)
   ========================================================================== */
body.is-camera-open { overflow: hidden; }

.fk-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  min-height: 100dvh;
  min-height: 100svh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #05070b;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.fk-camera-overlay[hidden] { display: none !important; }
.fk-camera-overlay__shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}
.fk-camera-overlay__topbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}
.fk-camera-overlay__top-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.fk-camera-overlay__top-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  color: #fff;
}
.fk-camera-overlay__hint {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: rgba(211, 220, 234, 0.72);
  line-height: 1.35;
}
.fk-camera-overlay__iconbtn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fk-camera-overlay__iconbtn .fk-ic { width: 18px; height: 18px; }

.fk-camera-overlay__timer-opt {
  flex: none;
  margin-left: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fk-camera-overlay__timer-opt .fk-ic {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.9;
}
.fk-camera-overlay__timer-opt.is-recording {
  border-color: rgba(255, 77, 77, 0.55);
  background: rgba(40, 0, 0, 0.45);
}
.fk-camera-overlay__timer-opt.is-off {
  color: rgba(211, 220, 234, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
}
.fk-camera-overlay__timer-opt:not(.is-off) {
  color: #fff;
  border-color: rgba(120, 180, 255, 0.45);
}
.fk-camera-overlay__timer-opt[aria-pressed="true"] .fk-ic {
  opacity: 1;
}
.fk-camera-overlay__rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.25);
}
.fk-camera-overlay__rec-dot[hidden] { display: none !important; }

.fk-camera-overlay__viewfinder {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  margin: 0 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
}
.fk-camera-overlay__viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.fk-camera-overlay__viewfinder video.is-review {
  object-fit: contain;
  background: #000;
}
.fk-camera-overlay__frame {
  pointer-events: none;
  position: absolute;
  inset: 4% 5%;
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
}
.fk-camera-overlay[data-state="review"] .fk-camera-overlay__frame { display: none; }

.fk-camera-overlay__silhouette {
  pointer-events: none;
  position: absolute;
  /* Bias lower so mid-torso (~below ribs) sits near frame center for STS. */
  inset: 20% 8% 14%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  z-index: 1;
  opacity: 0.48;
}
.fk-camera-overlay__silhouette[hidden] { display: none !important; }
.fk-camera-overlay__silhouette-img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 92%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.65));
}
.fk-camera-overlay[data-state="review"] .fk-camera-overlay__silhouette { display: none !important; }

.fk-camera-overlay__checklist {
  pointer-events: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  margin: 0;
  padding: 10px 12px;
  list-style: none;
  counter-reset: fk-check;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.fk-camera-overlay__checklist[hidden] { display: none !important; }
.fk-camera-overlay__check {
  counter-increment: fk-check;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11.5px;
  line-height: 1.35;
  font-weight: 500;
}
.fk-camera-overlay__check::before {
  content: counter(fk-check);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #061018;
  background: rgba(150, 210, 255, 0.9);
}
.fk-camera-overlay[data-state="review"] .fk-camera-overlay__checklist { display: none !important; }

.fk-camera-overlay__countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: clamp(64px, 18vw, 120px);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.22);
}
.fk-camera-overlay__countdown[hidden] { display: none !important; }

.fk-camera-overlay__horizon {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 0;
  /* No transform on the container — child rotate() must stay screen-true. */
  pointer-events: none;
  z-index: 2;
}
.fk-camera-overlay__horizon[hidden] { display: none !important; }

/* Locked to the phone: short wings + center notch. */
.fk-camera-overlay__horizon-ref {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fk-camera-overlay__horizon-wing {
  display: block;
  width: 18%;
  max-width: 56px;
  height: 2px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.fk-camera-overlay__horizon-notch {
  position: absolute;
  left: 50%;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-sizing: border-box;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.fk-camera-overlay__horizon.is-level .fk-camera-overlay__horizon-notch {
  border-color: rgba(90, 230, 150, 0.95);
}
.fk-camera-overlay__horizon.is-level .fk-camera-overlay__horizon-wing {
  background: rgba(90, 230, 150, 0.9);
}

/* Rotates around the viewfinder center — parallel to true horizon. */
.fk-camera-overlay__horizon-bar {
  position: absolute;
  left: 22%;
  right: 22%;
  top: 0;
  height: 2px;
  margin-top: -1px;
  background: rgba(255, 90, 90, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  transform-origin: 50% 50%;
  transform: rotate(0deg);
  will-change: transform;
}
.fk-camera-overlay__horizon.is-level .fk-camera-overlay__horizon-bar {
  background: rgba(90, 230, 150, 0.95);
}
.fk-camera-overlay__horizon.is-unstable .fk-camera-overlay__horizon-bar {
  opacity: 0.35;
}

.fk-camera-overlay__error {
  margin: 8px 14px 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: rgba(180, 40, 40, 0.18);
  color: #ffb4b4;
  font-size: 13px;
}

.fk-camera-overlay__controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 18px max(18px, env(safe-area-inset-bottom));
}
.fk-camera-overlay__textbtn {
  grid-column: 1;
  justify-self: start;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(211, 220, 234, 0.85);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 4px;
  min-height: 44px;
  cursor: pointer;
}
.fk-camera-overlay__textbtn[hidden] { display: none !important; }

.fk-camera-overlay__shutters {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
}
.fk-camera-overlay__shutters[hidden] { display: none !important; }

.fk-camera-overlay__shutter {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.fk-camera-overlay__shutter[hidden] { display: none !important; }
.fk-camera-overlay__shutter:disabled { opacity: 0.4; cursor: not-allowed; }
.fk-camera-overlay__shutter-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
}
.fk-camera-overlay__shutter-core {
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: #ff4d4d;
  transition: inset 0.15s ease, border-radius 0.15s ease, background 0.15s ease;
}
.fk-camera-overlay__shutter.is-recording .fk-camera-overlay__shutter-core {
  inset: 18px;
  border-radius: 6px;
  background: #ff4d4d;
}

.fk-camera-overlay__photo {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fk-camera-overlay__photo[hidden] { display: none !important; }
.fk-camera-overlay__photo:disabled { opacity: 0.4; cursor: not-allowed; }
.fk-camera-overlay__photo .fk-ic {
  width: 20px;
  height: 20px;
}

.fk-camera-overlay__use {
  grid-column: 3;
  justify-self: end;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--pulse-500);
  color: #04222C;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  min-height: 44px;
  cursor: pointer;
}
.fk-camera-overlay__use[hidden] { display: none !important; }

.fk-camera-overlay[data-state="review"] .fk-camera-overlay__controls {
  grid-template-columns: 1fr 1fr;
}
.fk-camera-overlay[data-state="review"] .fk-camera-overlay__textbtn {
  grid-column: 1;
  justify-self: start;
}
.fk-camera-overlay[data-state="review"] .fk-camera-overlay__use {
  grid-column: 2;
  justify-self: end;
}
.fk-camera-overlay[data-state="review"] .fk-camera-overlay__shutters {
  display: none !important;
}

/* ---- app-bar section nav (Studio | Profiles) ----------------------------- */
.fk-appnav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-right: var(--s-4);
}
.fk-appnav__link {
  position: relative;
  padding: var(--s-1) 0;
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: var(--fs-md, 15px);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease-out);
}
.fk-appnav__link:hover { color: var(--fg-1); }
.fk-appnav__link.is-active { color: var(--fg-1); }
.fk-appnav__link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--s-1));
  height: 2px;
  border-radius: 2px;
  background: var(--pulse-400);
}
@media (max-width: 560px) {
  .fk-appnav { gap: var(--s-3); margin-right: var(--s-2); }
  .fk-appnav__link { font-size: var(--fs-sm); }
}

/* ---- phone section dock (Studio | Profiles floating pill) ---------------- */
.fk-tabdock {
  display: none;
  z-index: 40;
  justify-content: center;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.fk-tabdock__pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.92);
  border: 1px solid rgba(150, 170, 200, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
  -webkit-tap-highlight-color: transparent;
}
.fk-tabdock__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 118px;
  padding: 13px 20px;
  border-radius: 999px;
  color: var(--fg-3);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    color 0.2s var(--ease-out, ease),
    background 0.2s var(--ease-out, ease),
    box-shadow 0.2s var(--ease-out, ease);
}
.fk-tabdock__item:hover { color: var(--fg-1); }
.fk-tabdock__item:focus,
.fk-tabdock__item:focus-visible,
.fk-tabdock__item:active {
  outline: none;
  box-shadow: none;
}
.fk-tabdock__item.is-active {
  color: var(--fg-0);
  background: rgba(120, 169, 242, 0.18);
  box-shadow: inset 0 0 0 1px rgba(120, 169, 242, 0.22);
}
.fk-tabdock__item.is-active:focus,
.fk-tabdock__item.is-active:focus-visible,
.fk-tabdock__item.is-active:active {
  box-shadow: inset 0 0 0 1px rgba(120, 169, 242, 0.22);
}
.fk-tabdock__item .fk-ic {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  pointer-events: none;
}
.fk-tabdock__item .fk-ic svg {
  width: 17px;
  height: 17px;
  display: block;
}
.fk-tabdock__label {
  display: block;
}
.fk-i18n-loading .fk-tabdock [data-i18n] {
  visibility: visible;
}
@media (max-width: 720px) {
  html.fk-phone-shell,
  body.fk-phone-shell {
    height: var(--fk-shell-h, 100svh);
    max-height: var(--fk-shell-h, 100svh);
    overflow: hidden;
  }
  body.fk-phone-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  body.fk-phone-shell .fk-stage {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Clearance under floating pill (page scrolls behind the transparent dock). */
    padding-bottom: calc(96px + var(--fk-safe-bottom, 0px));
  }
  .fk-appnav { display: none; }
  .fk-tabdock {
    /* Overlay stage — transparent so page shows around the pill (no opaque bar). */
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    /* 28px ≈ the ~1cm lift vs flush bottom; --fk-safe-bottom adds notch inset when present */
    padding: 8px 16px calc(28px + var(--fk-safe-bottom, 0px));
    background: transparent;
  }
  body.fk-phone-shell .fk-footer { display: none !important; }
}


/* ============================================================================
   F2 Stage 4 — session integration
   ========================================================================== */

/* ---- pinned protocol (4.2): fixed bar, not a tab -------------------------- */
.fk-protocol--pinned {
  cursor: default;
  border-style: solid;
  border-color: rgba(63, 127, 221, 0.45);
  background: var(--pulse-tint);
  color: var(--pulse-300);
}
.fk-protocol--pinned .fk-ic { width: 13px; height: 13px; color: var(--pulse-300); }

/* ---- library scope chips (4.4): beside sports, light spacer, not by trash -- */
.fk-wb__scope {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  margin: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}
.fk-wb__scope[hidden] { display: none; }
.fk-wb__scope:not([hidden])::before {
  content: '';
  width: 1px;
  height: 1.15em;
  margin-right: 4px;
  background: rgba(150, 170, 200, 0.22);
  flex: none;
}
.fk-scope__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.fk-scope__btn:hover { color: var(--fg-1); border-color: var(--line-strong); }
.fk-scope__btn.is-active {
  color: var(--fg-1);
  border-color: var(--line-strong);
  background: var(--ink-700);
}
.fk-scope__count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
}
.fk-scope__btn.is-active .fk-scope__count { color: var(--fg-2); }
.fk-scope__btn--unassigned { color: var(--suboptimal); }
.fk-scope__btn--unassigned .fk-scope__count { color: var(--suboptimal); }
.fk-scope__btn--unassigned:hover { color: var(--suboptimal); border-color: var(--suboptimal); }
.fk-scope__btn--unassigned.is-active { color: var(--suboptimal); border-color: var(--suboptimal); }

/* ---- per-card affordances (4.5): kebab + sealed lock ---------------------- */
.fk-capture__menu,
.fk-capture__sealed {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}
.fk-capture__menu {
  cursor: pointer;
  color: var(--fg-2);
  background: rgba(6, 8, 12, 0.55);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.fk-capcard:hover .fk-capture__menu,
.fk-caprow:hover .fk-capture__menu,
.fk-capture__menu:focus-visible { opacity: 1; }
.fk-capture__menu:hover { color: var(--fg-1); border-color: var(--line-strong); }
.fk-capture__menu .fk-ic { width: 15px; height: 15px; }
.fk-capture__sealed {
  color: var(--fg-3);
  background: transparent;
  pointer-events: none;
}
.fk-capture__sealed .fk-ic { width: 14px; height: 14px; }
/* Row variants sit inline, not absolute. */
.fk-caprow .fk-capture__menu,
.fk-caprow .fk-capture__sealed {
  position: static;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}
.fk-caprow .fk-capture__menu { opacity: 1; background: transparent; border-color: transparent; }
.fk-caprow .fk-capture__menu:hover { border-color: var(--line-strong); }
/* Sealed cards read as frozen: dimmed, lock accent (the DB-lock boundary). */
.fk-capcard.is-sealed .fk-capcard__thumb,
.fk-caprow.is-sealed .fk-caprow__thumb { opacity: 0.72; }
.fk-capcard.is-sealed .fk-capcard__title,
.fk-caprow.is-sealed .fk-caprow__title { color: var(--fg-2); }

/* ---- capture promotion menu (4.5): settings-popover-style ----------------- */
.fk-cardmenu { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.fk-cardmenu[data-open="true"] { pointer-events: auto; }
.fk-cardmenu[hidden] { display: none; }
.fk-cardmenu__scrim {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.5);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
  z-index: 55;
}
.fk-cardmenu[data-open="true"] .fk-cardmenu__scrim { opacity: 1; }
.fk-cardmenu__panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--ink-800);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--elev-3);
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.98);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.fk-cardmenu[data-open="true"] .fk-cardmenu__panel { opacity: 1; transform: translate(-50%, -50%); }
.fk-cardmenu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.fk-cardmenu__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fk-cardmenu__body { padding: 14px 15px; display: flex; flex-direction: column; gap: 10px; }
.fk-cardmenu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.fk-cardmenu__item:hover { border-color: var(--line-strong); }
.fk-cardmenu__item .fk-ic { width: 16px; height: 16px; color: var(--fg-2); }
.fk-cardmenu__item--danger { color: var(--suboptimal); }
.fk-cardmenu__item--danger .fk-ic { color: var(--suboptimal); }
.fk-cardmenu__back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
}
.fk-cardmenu__back:hover { color: var(--fg-1); }
.fk-cardmenu__back .fk-ic { width: 15px; height: 15px; }
.fk-cardmenu__hint,
.fk-cardmenu__reason {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
}
.fk-cardmenu__reason {
  color: var(--suboptimal);
  padding: 10px 12px;
  border: 1px solid rgba(248, 196, 110, 0.35);
  border-radius: var(--r-sm);
  background: rgba(248, 196, 110, 0.08);
}
.fk-cardmenu__list { display: flex; flex-direction: column; gap: 7px; }
.fk-cardmenu__pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
}
.fk-cardmenu__pick:hover { border-color: var(--line-strong); }
.fk-cardmenu__pick-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #06080c;
  background: var(--fk-av-hue, var(--fg-3));
}
.fk-cardmenu__fixed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  border: 1px solid var(--line);
}
.fk-cardmenu__fixed-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--fg-1);
}
.fk-cardmenu__fixed-row .fk-ic { width: 14px; height: 14px; color: var(--fg-3); }
.fk-cardmenu__target {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
  margin: 0;
}
.fk-cardmenu__confirm { display: flex; flex-direction: column; gap: 6px; }
.fk-cardmenu__confirm-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-2);
}
.fk-cardmenu__confirm-input {
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--ink-900, #06080c);
  border: 1px solid var(--line-strong);
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.fk-cardmenu__confirm-input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
