/* pmg-prompt-coach.css — Phase 2 (coach-2)
   Hidden by default. Shown only when body.pmg-coach-on (set by JS
   once #goal has 2+ chars). De-boxed: blends directly under the
   textarea with no card/border/background — just a thin bar, a
   word, the token line, and chips. */

#pmg-coach-root {
  display: none;
}
html.pmg-chassis-v3 body.pmg-coach-on #pmg-coach-root {
  display: block;
  margin: 8px 2px 4px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  animation: pmg-coach-fade 220ms ease-out;
}

@keyframes pmg-coach-fade {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pmg-coach__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pmg-coach__row--meter { margin-bottom: 6px; }
.pmg-coach__row--info  {
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 6px;
}

/* ----- strength bar (slimmer, borderless) ----- */
.pmg-coach__bar {
  flex: 1 1 auto;
  height: 4px;
  background: color-mix(in srgb, var(--color-text, #e8f3ec) 10%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.pmg-coach__fill {
  height: 100%;
  width: 0;
  background: #ff9f43;
  border-radius: 999px;
  transition: width 260ms ease, background-color 260ms ease;
}
.pmg-coach__fill[data-band="weak"] { background: #ff7a59; }
.pmg-coach__fill[data-band="ok"]   { background: #f7c948; }
.pmg-coach__fill[data-band="good"] { background: #3ee0a0; }

.pmg-coach__meta {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 100px;
  justify-content: flex-end;
}
.pmg-coach__score {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text, #e8f3ec);
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.pmg-coach__label {
  font-size: 12px;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-text, #e8f3ec) 65%, transparent);
}

/* ----- token + cost line (whisper-quiet) ----- */
.pmg-coach__tokens {
  font-size: 11px;
  color: color-mix(in srgb, var(--color-text, #e8f3ec) 50%, transparent);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* ----- adaptive chips (small, ghost-style so they read as hints) ----- */
.pmg-coach__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.pmg-coach__chip {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--color-primary, #3ee0a0) 90%, white);
  border: 1px solid color-mix(in srgb, var(--color-primary, #3ee0a0) 35%, transparent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease, transform 120ms ease;
}
.pmg-coach__chip:hover,
.pmg-coach__chip:focus-visible {
  background: color-mix(in srgb, var(--color-primary, #3ee0a0) 14%, transparent);
  outline: none;
}
/* a11y-focus-1: paired keyboard-visible focus ring (chip outline:none
   above strips the browser default; this restores it for keyboard nav). */
.pmg-coach__chip:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #3ee0a0) 30%, transparent);
}
.pmg-coach__chip:active { transform: scale(0.97); }

/* ----- mini-picker (coach-4) ----- */
.pmg-coach__picker {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: pmg-coach-fade 180ms ease-out;
}
.pmg-coach__picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pmg-coach__picker-back {
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--color-text, #e8f3ec) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-text, #e8f3ec) 18%, transparent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pmg-coach__picker-back:hover { color: var(--color-text, #e8f3ec); }
.pmg-coach__picker-q {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text, #e8f3ec);
}
.pmg-coach__picker-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pmg-coach__chip--opt,
.pmg-coach__chip--type {
  font-size: 12px;
  padding: 4px 10px;
}
.pmg-coach__chip--type {
  border-style: dashed;
  color: color-mix(in srgb, var(--color-text, #e8f3ec) 75%, transparent);
  border-color: color-mix(in srgb, var(--color-text, #e8f3ec) 30%, transparent);
}
.pmg-coach__picker-input {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.pmg-coach__input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--color-text, #e8f3ec);
  background: color-mix(in srgb, var(--color-text, #e8f3ec) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary, #3ee0a0) 35%, transparent);
  outline: none;
}
.pmg-coach__input:focus {
  border-color: color-mix(in srgb, var(--color-primary, #3ee0a0) 70%, transparent);
}
/* a11y-focus-1: paired keyboard-visible focus ring (input outline:none
   above strips the browser default; this restores it for keyboard nav). */
.pmg-coach__input:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #3ee0a0) 25%, transparent);
}
.pmg-coach__input-go {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--color-primary, #3ee0a0);
  color: #0a1714;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pmg-coach__input-go:active { transform: scale(0.97); }

/* Retire legacy v1 strength pill — pmg-prompt-coach supersedes it. */
html.pmg-chassis-v3 #pmg-strength-pill { display: none !important; }
