/* SkipBoard v2 — Fill screen. Scoped to .screen-fill (sheets use unique .fill-* names). */

/* ------------------------------- Frame ---------------------------------- */
.screen-fill .fill-flow {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.screen-fill .fill-head {
  flex: 0 0 auto;
  position: relative;
  z-index: 12;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
}

.screen-fill .fill-bar {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr) 46px var(--tap);
  align-items: center;
  gap: 2px;
  padding: 4px 8px 8px;
}

.screen-fill .fill-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding-left: 4px;
}

.screen-fill .fill-form {
  font-family: var(--font-display);
  font-size: var(--t-16);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-fill .fill-sub {
  font-size: var(--t-13);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.screen-fill .fill-ring {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}

.screen-fill .fill-thread {
  height: 3px;
  margin: 0 var(--gutter);
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.screen-fill .fill-thread span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width var(--dur-3) var(--ease);
}

/* -------------------------------- Body ---------------------------------- */
.screen-fill .fill-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px var(--gutter) 18px;
}

.screen-fill .fill-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 620px;
  margin: 0 auto;
}

.screen-fill .fill-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* -------------------------------- Peek ---------------------------------- */
.screen-fill .fill-peek {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(164px, 24dvh, 220px);
  padding: 6px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--e-2);
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-1) var(--ease);
}

.screen-fill .fill-peek:hover { border-color: var(--accent-line); }
.screen-fill .fill-peek:active { transform: scale(0.995); }

.screen-fill .fill-peek canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: #fff;
}

.screen-fill .fill-peek .fit-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 10px;
  box-shadow: var(--e-1);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--accent);
}
.screen-fill .fill-peek .fit-pill.is-bad {
  background: color-mix(in srgb, var(--warn-bg) 94%, transparent);
  color: var(--warn);
}

.screen-fill .fill-peek-hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--muted);
  font-size: var(--t-11);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.screen-fill .fill-peek-note {
  margin: 0;
  padding: 0 4px;
}

/* ------------------------------ Question -------------------------------- */
.screen-fill .fill-ask {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.screen-fill .fill-qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.screen-fill .fill-qhead .eyebrow { flex: 1; min-width: 0; }

.screen-fill .fill-qhead-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.screen-fill .fill-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--t-11);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.screen-fill .fill-save::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.screen-fill .fill-save.is-saving::before {
  background: var(--warn);
  animation: fill-save-pulse 1s ease-in-out infinite;
}

.screen-fill .fill-save.is-error {
  color: var(--danger);
  background: var(--danger-bg);
  box-shadow: inset 0 0 0 1px var(--danger-line);
}

.screen-fill .fill-save.is-error::before { background: var(--danger); }
.screen-fill .fill-save.is-offline { color: var(--warn); }
.screen-fill .fill-save.is-offline::before { background: var(--warn); }

@keyframes fill-save-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.screen-fill .fill-question {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 34px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
  outline: none;
}

.screen-fill .fill-question label { cursor: text; }
.screen-fill .fill-question:focus-visible { outline: none; }

.screen-fill .fill-context {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: var(--t-13);
  line-height: 1.45;
}

/* ------------------------------- Answer --------------------------------- */
.screen-fill .answer-wrap {
  align-items: center;
  padding: 8px 8px 8px 16px;
}

.screen-fill .answer-input {
  font-size: var(--t-20);
  min-width: 0;
}

.screen-fill textarea.answer-input {
  min-height: 72px;
  padding: 8px 0;
}

.screen-fill .answer-wrap .mic-btn { align-self: center; }

/* -------------------------------- Tools --------------------------------- */
.screen-fill .fill-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
}

.screen-fill .fill-tools .chip {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 14px;
  font-size: var(--t-13);
  background: var(--surface);
}
.screen-fill .fill-tools .chip svg { color: var(--accent); }
.screen-fill .fill-tools .chip:disabled { opacity: 0.45; cursor: default; }

/* -------------------------------- Chips --------------------------------- */
.screen-fill .fill-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}

.screen-fill .fill-chips .chip-row {
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
}
.screen-fill .fill-chips .chip { flex-shrink: 0; max-width: 100%; }
.screen-fill .fill-chips .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------- Checkbox flow ---------------------------- */
.screen-fill .fill-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.screen-fill .fill-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 128px;
  padding: 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--e-1);
  color: var(--text);
  text-align: left;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.screen-fill .fill-choice:hover { border-color: var(--accent-line); }
.screen-fill .fill-choice:active { transform: scale(0.99); }
.screen-fill .fill-choice svg { color: var(--muted); }
.screen-fill .fill-choice span { display: flex; flex-direction: column; gap: 2px; }
.screen-fill .fill-choice strong { font-size: var(--t-16); font-weight: 650; letter-spacing: -0.01em; }
.screen-fill .fill-choice small { font-size: var(--t-13); color: var(--muted); }

.screen-fill .fill-choice.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.screen-fill .fill-choice.is-on svg,
.screen-fill .fill-choice.is-on strong { color: var(--accent); }
.screen-fill .fill-choice.is-on small { color: var(--accent); opacity: 0.85; }

/* -------------------------------- Footer -------------------------------- */
.screen-fill .fill-foot {
  flex: 0 0 auto;
  position: relative;
  z-index: 14;
}

.screen-fill .fill-foot .btn-primary { min-width: 0; }

.screen-fill .fill-foot .btn-hands-free {
  min-height: var(--tap);
  min-width: 56px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.screen-fill .fill-foot .btn-hands-free.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-line);
}

/* --------------------------- Desktop / wide ----------------------------- */
@media (min-width: 760px) {
  .screen-fill .fill-body {
    display: flex;
    padding: 22px 24px 20px;
  }

  .screen-fill .fill-stage {
    display: grid;
    grid-template-columns: minmax(250px, 312px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    width: 100%;
    max-width: 720px;
    margin: auto;
  }

  .screen-fill .fill-side { position: sticky; top: 4px; }

  .screen-fill .fill-peek { height: clamp(240px, 33dvh, 330px); }

  .screen-fill .fill-question { font-size: clamp(30px, 3vw, 34px); }

  .screen-fill .fill-tools { flex-wrap: wrap; overflow: visible; }

  .screen-fill .fill-choice { min-height: 148px; }
}

@media (min-width: 900px) {
  .screen-fill .fill-flow { height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .screen-fill .fill-save.is-saving::before { animation: none; }
  .screen-fill .fill-thread span { transition: none; }
  .screen-fill .mic-btn.is-listening { animation: none; }
}

/* ============================ Sheet content ============================== */
/* Queued from dom.openSheet(), so these live outside .screen-fill and use unique names. */

/* All boxes / jump list */
.fill-jump { display: flex; flex-direction: column; gap: 14px; }

.fill-jump-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fill-jump-actions .btn { width: 100%; justify-content: flex-start; }

.fill-jump > .hint { margin: 0; }

.fill-jump-page { display: flex; flex-direction: column; gap: 4px; }

.fill-jump-page h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 2px 2px;
  font-family: var(--font-display);
  font-size: var(--t-15);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.fill-jump-page h3 small { font-family: var(--font-body); font-size: var(--t-11); font-weight: 600; color: var(--muted); }

.fill-jump-list { display: flex; flex-direction: column; gap: 2px; }

.fill-jump-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background var(--dur-1) var(--ease);
}
.fill-jump-row:hover { background: var(--surface-2); }
.fill-jump-row.is-current {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.fill-jump-row .row-text small { color: var(--muted); }

/* Vault picker */
.fill-vault { display: flex; flex-direction: column; gap: 12px; }
.fill-vault .search { min-height: 52px; }
.fill-vault .link-btn { align-self: flex-start; }
.fill-vault .sheet-menu button { min-height: 56px; }

/* AI assist */
.fill-ai { display: flex; flex-direction: column; gap: 12px; }

.fill-ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.fill-ai-grid .btn {
  min-height: 56px;
  padding: 0 12px;
  font-size: var(--t-13);
  white-space: normal;
  text-align: left;
  justify-content: flex-start;
  line-height: 1.25;
}

.fill-ai-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-field);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  min-height: 56px;
}
.fill-ai-result:empty { display: none; }
.fill-ai-result .btn-row { margin-top: 4px; }

.fill-ai-text {
  font-family: var(--font-display);
  font-size: var(--t-20);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) {
  .fill-ai-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Signature pad */
.screen-fill .sig-wrap {
  position: relative;
  width: 100%;
  border: 2px dashed var(--line);
  border-radius: var(--r-lg, 16px);
  background: var(--surface);
  overflow: hidden;
}
.screen-fill .sig-pad {
  display: block;
  width: 100%;
  height: clamp(140px, 22vh, 260px);
  touch-action: none;
  cursor: crosshair;
}
.screen-fill .sig-line {
  position: absolute;
  left: 16px;
  bottom: 44px;
  color: var(--faint);
  pointer-events: none;
}
.screen-fill .sig-wrap::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 40px;
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}
.screen-fill .sig-actions .btn { min-height: 56px; }

/* Briefing fill (audit #14/15): one briefing, proposed answers to tick before they go in. */
.fill-brief { display: grid; gap: 12px; }
.fill-brief-text { min-height: 140px; resize: vertical; }
.fill-brief-result { display: grid; gap: 10px; }
.fill-brief-list { display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; }
.fill-brief-list .data-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.fill-brief-list .row-text { display: grid; flex: 1; min-width: 0; }
.fill-brief-list .row-text small { color: var(--muted); overflow-wrap: anywhere; }
.fill-brief-check { width: 26px; height: 26px; flex-shrink: 0; accent-color: var(--accent); }
/* Profile pill badge near top */
.screen-fill .fill-title-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.screen-fill .profile-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  margin: -14px -8px;
  padding: 0 var(--s-2);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.screen-fill .profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: var(--t-11);
  font-weight: 550;
  color: var(--text);
  line-height: 1.2;
}

.screen-fill .profile-pill-hint {
  color: var(--faint);
  font-weight: 700;
}

/* Quick phrases stamps */
.screen-fill .fill-stamps {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

/* Check all OK */
.screen-fill .fill-check-all-wrap {
  display: flex;
  margin-top: var(--s-3);
}

.screen-fill .fill-check-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-15);
  font-weight: 600;
}
