/* Prompt labs — shared shell (no decorative scenes) */

.pl-main { padding-top: 48px; padding-bottom: 72px; }

.pl-howto {
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
}
.pl-howto-lead { margin-bottom: 16px; max-width: 68ch; }
.pl-howto-what {
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
}
.pl-howto-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px) {
  .pl-howto-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .pl-howto-steps { grid-template-columns: 1fr; }
}
.pl-howto-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.18);
}
.pl-howto-num {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 2px;
}
.pl-howto-steps strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.pl-howto-steps p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

.pl-actions-hint,
.pl-flags-hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  line-height: 1.4;
}
.pl-flags-hint { margin-top: 14px; margin-bottom: 0; }
.pl-coach-tip { margin-top: 12px; }
.pl-coach-tip strong { color: var(--ink); font-weight: 600; }

.pl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 980px) {
  .pl-layout { grid-template-columns: 1fr; }
}

.pl-stack { display: grid; gap: 18px; min-width: 0; }
.pl-side { display: grid; gap: 18px; position: sticky; top: 88px; }
@media (max-width: 980px) { .pl-side { position: static; } }

.bl-panel {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
}
.bl-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bl-panel-note {
  color: var(--ink-dim);
  font-size: 0.88rem;
  margin-bottom: 12px;
  max-width: 62ch;
}

.pl-meter { margin-top: 12px; display: grid; gap: 8px; }
.pl-meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.pl-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--grad);
  transition: width 0.45s var(--ease);
}
.pl-meter.is-clear .pl-meter-fill {
  background: var(--accent-3);
  box-shadow: 0 0 18px rgba(126,232,199,0.35);
}
.pl-meter-label {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.pl-meter.is-clear .pl-meter-label { color: var(--accent-3); }

.bl-score {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}
.bl-score.is-clear { color: var(--accent-3); }

/* Instructions box: textarea + small Enhance control (bottom-right) */
.pl-instr-field {
  position: relative;
  margin: 14px 0 4px;
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.pl-instr-field:focus-within {
  border-color: rgba(138, 180, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 255, 0.12);
}
.pl-instr-field .bl-textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.pl-instr-field .bl-textarea:focus {
  border-color: transparent;
  box-shadow: none;
}
.pl-instr-enhance {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.14);
}
.pl-enhance-btn {
  flex: 0 0 auto;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  opacity: 0.85;
  border-color: rgba(10, 11, 15, 0.12);
  background: #fff;
  color: #3a3f4d;
}
.pl-enhance-btn:hover,
.pl-enhance-btn:focus-visible {
  opacity: 1;
  color: #0a0b0f;
  border-color: rgba(10, 11, 15, 0.22);
  background: #fff;
}
.pl-enhance-btn.is-busy {
  opacity: 0.7;
  cursor: wait;
}
.pl-enhance-status {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ink-faint);
  text-align: left;
}
.pl-enhance-status:empty { display: none; }

@media (max-width: 560px) {
  .pl-instr-enhance {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .pl-enhance-status {
    flex: 1 1 100%;
    order: 1;
    text-align: right;
  }
}

.pl-enhance-stage {
  margin: 0 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(138, 180, 255, 0.07), rgba(126, 232, 199, 0.05)),
    rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.pl-instr-field .pl-enhance-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
}
.pl-enhance-stage[hidden] { display: none !important; }
.pl-enhance-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 22px 18px 18px;
  text-align: center;
}
.pl-enhance-orb {
  position: relative;
  width: 52px;
  height: 52px;
}
.pl-enhance-orb span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--accent);
  border-right-color: rgba(126, 232, 199, 0.55);
  animation: pl-enhance-spin 1.1s linear infinite;
  opacity: 0.9;
}
.pl-enhance-orb span:nth-child(2) {
  inset: 8px;
  animation-duration: 1.6s;
  animation-direction: reverse;
  border-top-color: var(--accent-3);
  border-right-color: rgba(138, 180, 255, 0.4);
}
.pl-enhance-orb span:nth-child(3) {
  inset: 16px;
  animation-duration: 0.85s;
  border-top-color: rgba(244, 244, 240, 0.55);
  border-right-color: transparent;
}
@keyframes pl-enhance-spin {
  to { transform: rotate(360deg); }
}
.pl-enhance-phase {
  margin: 0;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.pl-enhance-bar {
  width: min(220px, 70%);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.pl-enhance-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--grad);
  animation: pl-enhance-slide 1.4s var(--ease) infinite;
}
@keyframes pl-enhance-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

.bl-textarea {
  width: 100%;
  min-height: 140px;
  height: auto;
  resize: none;
  overflow: hidden;
  field-sizing: content;
  background: rgba(0,0,0,0.28);
  color: var(--ink);
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  box-sizing: border-box;
}
.bl-textarea:focus {
  outline: none;
  border-color: rgba(138, 180, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 255, 0.12);
}
.bl-textarea.is-enhancing {
  opacity: 0.45;
  pointer-events: none;
}

.bl-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.bl-actions .btn { padding: 11px 20px; font-size: 0.86rem; }
#bl-run.is-inviting { animation: pl-breathe 2.4s ease-out infinite; }
@keyframes pl-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.22); }
  50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

.bl-flags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}
.bl-flags li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--ink-faint);
}
.bl-flags li.is-on {
  color: var(--ink);
  border-color: rgba(126, 232, 199, 0.35);
  background: rgba(126, 232, 199, 0.08);
}
.bl-flags li.is-on .bl-flag-dot { background: var(--accent-3); }
.bl-flags li.is-off .bl-flag-dot { background: var(--ink-faint); }
.bl-flag-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* Controls */
.pl-control-grid { display: grid; gap: 14px; margin: 14px 0 4px; }
.pl-control-block {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.18);
}
.pl-control-label {
  display: block;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.pl-control-hint {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin: 0 0 10px;
  line-height: 1.4;
}
/* Dataset picker — radio option cards; synthetic sample only when selected */
.pl-pack-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}
.pl-pack-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pl-pack-page-ind {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  min-width: 2.6em;
  text-align: center;
  user-select: none;
}
.pl-pack-list {
  display: grid;
  gap: 8px;
}
.pl-pack-item {
  display: grid;
  gap: 0;
}
.pl-pack-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.pl-pack-item:has(.pl-pack-option.is-on) .pl-pack-option,
.pl-pack-item:has(input:checked) .pl-pack-option {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.pl-pack-option:hover {
  border-color: rgba(138, 180, 255, 0.42);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.pl-pack-option:active {
  transform: translateY(0);
}
.pl-pack-option:has(input:focus-visible) {
  border-color: rgba(138, 180, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 255, 0.16);
}
.pl-pack-option.is-on,
.pl-pack-option:has(input:checked) {
  border-color: rgba(138, 180, 255, 0.5);
  background: rgba(138, 180, 255, 0.1);
}
.pl-pack-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.pl-pack-ui {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--stroke-strong);
  background: rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  flex-shrink: 0;
}
.pl-pack-option:hover .pl-pack-ui {
  border-color: rgba(138, 180, 255, 0.55);
}
.pl-pack-option.is-on .pl-pack-ui,
.pl-pack-option:has(input:checked) .pl-pack-ui {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent);
  background: #0a0b0f;
}
.pl-pack-text {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.35;
}
.pl-pack-text strong {
  font-weight: 600;
}
.pl-pack-sample {
  margin-top: 0;
  padding: 12px 14px 12px;
  border-radius: 0 0 14px 14px;
  border: 1px solid rgba(138, 180, 255, 0.5);
  border-top: 0;
  background: rgba(138, 180, 255, 0.06);
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto auto auto;
  gap: 0;
  min-height: 300px;
}
.pl-pack-mounted {
  margin-top: 10px;
}
.pl-pack-mounted .pl-pack-sample {
  border-radius: 14px;
  border-top: 1px solid rgba(138, 180, 255, 0.5);
}
.pl-pack-mounted-note {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.pl-pack-mounted-note span {
  color: var(--ink-faint);
}
/* Sample fills the preview; footer + Score with AI stay pinned below */
.pl-pack-sample-scroll {
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 171, 184, 0.45) rgba(255, 255, 255, 0.06);
}
.pl-pack-sample-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.pl-pack-sample-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.pl-pack-sample-scroll::-webkit-scrollbar-thumb {
  background: rgba(167, 171, 184, 0.45);
  border-radius: 8px;
}
.pl-pack-sample-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 171, 184, 0.65);
}
.pl-pack-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--ink-dim);
}
.pl-pack-table th,
.pl-pack-table td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}
.pl-pack-table th:last-child,
.pl-pack-table td:last-child {
  border-right: 0;
}
.pl-pack-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: #12151f;
  border-bottom: 1px solid rgba(138, 180, 255, 0.28);
}
.pl-pack-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}
.pl-pack-table tbody tr:hover td {
  background: rgba(138, 180, 255, 0.08);
  color: var(--ink);
}
/* Legacy monospace dump (if a pack still ships only a string sample) */
.pl-pack-sample-body {
  margin: 0;
  padding: 8px 10px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--ink-dim);
  white-space: pre;
  overflow-x: auto;
  tab-size: 4;
}
.pl-pack-sample-foot {
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex-shrink: 0;
}
/* Compact Score with AI row — same scale as Enhance with AI */
.pl-pack-sample-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 6px 0 0;
  flex-shrink: 0;
}
.pl-score-btn {
  flex: 0 0 auto;
}
.pl-score-status {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ink-faint);
  text-align: left;
  order: -1;
}
.pl-score-result {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}
.pl-score-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.pl-score-verdict {
  margin: 0;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pl-score-verdict.is-pass { color: var(--mint, #7ee8c7); }
.pl-score-verdict.is-fail { color: #ffb4a8; }
.pl-score-summary {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--ink);
}
.pl-score-metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.pl-score-metrics li {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.pl-score-metrics span {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.pl-score-metrics strong {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
}
.pl-score-notes {
  margin: 0;
  padding: 0 0 0 1.05em;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--ink-dim);
}
.pl-score-notes li { margin: 0 0 2px; }

@media (max-width: 560px) {
  .pl-pack-sample-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .pl-score-status {
    flex: 1 1 100%;
    order: 1;
    text-align: right;
  }
  .pl-score-metrics {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Legacy select (unused by pack UI; kept for any stray markup) */
.pl-select {
  width: 100%;
  appearance: none;
  cursor: pointer;
  background:
    #0c0e16
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a8b0c4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    right 14px center / 12px 8px no-repeat;
  color: var(--ink);
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  padding: 12px 40px 12px 14px;
  font: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.pl-select:hover {
  border-color: rgba(138, 180, 255, 0.42);
  background-color: #10131c;
}
.pl-select:focus {
  outline: none;
  border-color: rgba(138,180,255,0.55);
  box-shadow: 0 0 0 3px rgba(138,180,255,0.12);
}
.pl-toggle-list, .pl-check-list { display: grid; gap: 8px; }
.pl-toggle, .pl-checkline {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.pl-toggle:hover, .pl-checkline:hover {
  border-color: var(--stroke);
  background: rgba(255,255,255,0.03);
}
.pl-toggle.is-on, .pl-checkline.is-on {
  border-color: rgba(126,232,199,0.28);
  background: rgba(126,232,199,0.06);
}
.pl-toggle input, .pl-checkline input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pl-toggle-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  position: relative;
  margin-top: 2px;
}
.pl-toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #f4f4f0;
  transition: transform 0.25s var(--ease);
}
.pl-toggle.is-on .pl-toggle-ui { background: rgba(126,232,199,0.55); }
.pl-toggle.is-on .pl-toggle-ui::after { transform: translateX(18px); }
.pl-toggle-text {
  display: grid;
  gap: 2px;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.35;
}
.pl-toggle-text small { font-size: 0.76rem; color: var(--ink-faint); }
.pl-checkline {
  grid-template-columns: 22px 1fr;
  align-items: center;
  font-size: 0.86rem;
  color: var(--ink-dim);
}
.pl-checkline::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--stroke-strong);
  background: rgba(0,0,0,0.25);
}
.pl-checkline.is-on::before {
  background: var(--accent-3);
  border-color: var(--accent-3);
  box-shadow: inset 0 0 0 2px #0a0b0f;
}
.pl-checkline.is-on { color: var(--ink); }

/* Chat — one stream, one bot reply */
.pl-chat { min-height: 180px; }
.pl-chat-empty {
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 8px 4px;
  max-width: 42ch;
}
.pl-chat-stream { display: grid; gap: 12px; }
.pl-bubble {
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.03);
}
.pl-bubble-who {
  display: block;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.pl-bubble p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }
.pl-bubble-user {
  border-color: rgba(138, 180, 255, 0.28);
  background: rgba(138, 180, 255, 0.07);
}
.pl-bubble-bot.is-pass { border-color: rgba(126, 232, 199, 0.4); }
.pl-bubble-bot.is-fail { border-color: rgba(255, 111, 111, 0.4); }
.pl-bubble.is-enter { animation: pl-pop 0.4s var(--ease); }
@keyframes pl-pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.pl-dots { display: inline-flex; gap: 4px; margin-right: 6px; vertical-align: middle; }
.pl-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-faint);
  animation: pl-dot 1s ease-in-out infinite;
}
.pl-dots i:nth-child(2) { animation-delay: 0.15s; }
.pl-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pl-dot {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.bl-probes { display: grid; gap: 12px; }
.pl-probe-card {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.pl-probe-card.is-active {
  border-color: rgba(138, 180, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(138, 180, 255, 0.2);
}
.pl-probe-card.is-pass { border-color: rgba(126, 232, 199, 0.4); }
.pl-probe-card.is-fail { border-color: rgba(255, 111, 111, 0.35); }
.pl-probe-card.is-locked {
  opacity: 0.48;
  border-style: dashed;
  background: rgba(0, 0, 0, 0.12);
}
.pl-probe-btn {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.pl-probe-btn:hover:not(:disabled) { background: rgba(255,255,255,0.03); }
.pl-probe-btn:disabled,
.pl-probe-btn.is-locked {
  cursor: not-allowed;
  pointer-events: none;
}
.bl-probe-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}
.bl-probe-num {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.pl-probe-index { color: var(--ink-faint); margin-right: 4px; }
.bl-probe-status { font-size: 0.76rem; color: var(--ink-faint); }
.pl-probe-card.is-pass .bl-probe-status { color: var(--accent-3); }
.pl-probe-card.is-fail .bl-probe-status { color: #ff8f8f; }
.pl-probe-card.is-locked .bl-probe-status { color: var(--ink-faint); }
.bl-intent { font-size: 0.8rem; color: var(--ink-faint); margin: 0 0 10px; }
.pl-probe-cta {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.pl-probe-card.is-locked .pl-probe-cta { color: var(--ink-faint); }
.pl-probe-reply {
  padding: 0 14px 14px;
  border-top: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.16);
}
.pl-probe-reply .pl-chat-stream { gap: 10px; padding-top: 12px; }
.pl-probe-reply .pl-bubble { padding: 10px 12px; border-radius: 14px; }
.pl-probe-reply .pl-bubble p { font-size: 0.86rem; }

.bl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bl-chip {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
}
.bl-chip.is-pass { color: var(--accent-3); border-color: rgba(126,232,199,0.35); }
.bl-chip.is-fail { color: #ff8f8f; border-color: rgba(255,111,111,0.35); }

/* Always-visible why-line under a probe reply (pass + fail).
   The one-line summary must never live inside <details> / depend on [open]. */
.pl-probe-why {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pl-probe-why.is-fail {
  border-top-color: rgba(255, 111, 111, 0.22);
}
.pl-probe-why.is-pass {
  border-top-color: rgba(126, 232, 199, 0.22);
}
.pl-probe-why-sum,
.pl-bubble .pl-probe-why-sum,
.pl-fail-why-sum {
  display: block !important;
  visibility: visible !important;
  margin: 0;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  line-height: 1.45;
  white-space: normal;
  color: var(--ink-dim);
}
.pl-probe-why.is-fail .pl-probe-why-sum,
.pl-fail-why .pl-fail-why-sum { color: #ff8f8f; }
.pl-probe-why.is-pass .pl-probe-why-sum { color: var(--accent-3); }
/* Extra detail only — never gate the one-line summary on [open] */
.pl-probe-why-more,
.pl-fail-why {
  margin-top: 4px;
}
.pl-probe-why-more summary,
.pl-fail-why > summary {
  cursor: pointer;
  list-style: none;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--ink-faint);
  user-select: none;
}
.pl-probe-why-more summary::-webkit-details-marker,
.pl-fail-why > summary::-webkit-details-marker { display: none; }
.pl-probe-why-more summary::before,
.pl-fail-why > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 5px;
  transition: transform 0.15s ease;
  opacity: 0.75;
}
.pl-probe-why-more[open] summary::before,
.pl-fail-why[open] > summary::before { transform: rotate(90deg); }
.pl-probe-why-more summary:hover,
.pl-probe-why-more summary:focus-visible,
.pl-fail-why > summary:hover,
.pl-fail-why > summary:focus-visible {
  color: var(--ink-dim);
  outline: none;
}
.pl-probe-why-more > p,
.pl-fail-why > p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-dim);
  white-space: normal;
}

.bl-coach-body {
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 48ch;
}
#bl-coach.is-win {
  border-color: rgba(126, 232, 199, 0.45);
  box-shadow: 0 0 36px rgba(126, 232, 199, 0.08);
}
.bl-transfer { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.bl-transfer .btn { padding: 11px 18px; font-size: 0.84rem; }
.bl-takeaway { margin-top: 40px; }
.bl-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Layout variants */
.pl-layout--queue-first {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.15fr);
}
.pl-layout--queue-first .pl-side { order: -1; }
@media (max-width: 980px) {
  .pl-layout--queue-first { grid-template-columns: 1fr; }
  .pl-layout--queue-first .pl-side { order: 0; }
}

/* Hint / Bugbot modal shell — header + actions pinned; body scrolls */
body.pl-modal-open { overflow: hidden; }
.pl-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
}
.pl-modal[hidden] { display: none !important; }
.pl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}
.pl-modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  max-height: min(85vh, 560px);
  max-height: min(85dvh, 560px);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: pl-pop 0.35s var(--ease);
  box-sizing: border-box;
}
.pl-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.pl-modal-head .h3 { margin: 4px 0 0; font-size: 1.15rem; }
.pl-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.pl-modal-close:hover { border-color: rgba(255, 255, 255, 0.28); }
.pl-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: var(--ink-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.pl-modal-body p { margin: 0 0 12px; }
.pl-modal-body p:last-child { margin-bottom: 0; }
.pl-hint-snippet {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-x: auto;
}
.pl-hint-end {
  margin-top: 14px !important;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
  color: var(--ink-faint);
  font-size: 0.86rem;
}
.pl-modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 2px;
}
.pl-modal-foot .btn { padding: 9px 16px; font-size: 0.84rem; }
.pl-modal-foot .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Bugbot — subtle footer cheat (bottom-right of simulator), not primary toolbar */
.pl-bugbot-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 0;
}
.pl-bugbot-btn {
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  opacity: 0.85;
  border-color: rgba(10, 11, 15, 0.12);
  background: #fff;
  color: #3a3f4d;
}
.pl-bugbot-btn:hover,
.pl-bugbot-btn:focus-visible {
  opacity: 1;
  color: #0a0b0f;
  border-color: rgba(10, 11, 15, 0.22);
  background: #fff;
}
.pl-bugbot-btn.is-busy {
  opacity: 0.7;
  cursor: wait;
}

/* Bugbot audit modal — wider; body fills box and scrolls */
.pl-bugbot-dialog {
  width: min(540px, 100%);
  max-height: min(78vh, 560px);
  max-height: min(78dvh, 560px);
  padding: 10px 10px 8px;
}
.pl-bugbot-dialog .pl-modal-head {
  margin-bottom: 6px;
  gap: 8px;
}
.pl-bugbot-dialog .pl-modal-head .h3 {
  font-size: 1.05rem;
  margin-top: 2px;
}
.pl-bugbot-dialog .pl-modal-body {
  margin: 0;
  padding: 0 2px 2px 0;
  /* Themed scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: var(--stroke-strong) rgba(0, 0, 0, 0.35);
}
/* Themed scrollbar (WebKit) */
.pl-bugbot-dialog .pl-modal-body::-webkit-scrollbar {
  width: 8px;
}
.pl-bugbot-dialog .pl-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
}
.pl-bugbot-dialog .pl-modal-body::-webkit-scrollbar-thumb {
  background: var(--stroke-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.pl-bugbot-dialog .pl-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
  background-clip: padding-box;
  border: 2px solid transparent;
}
.pl-bugbot-dialog .pl-modal-foot {
  margin-top: 8px;
  padding-top: 0;
}
.pl-bugbot-dialog .pl-modal-foot .btn {
  padding: 7px 12px;
  font-size: 0.78rem;
}
/* Fix with AI lives at end of scrollable audit body (not sticky footer) */
.pl-bugbot-fix-wrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: flex-end;
}
.pl-bugbot-fix-wrap .btn {
  padding: 7px 12px;
  font-size: 0.78rem;
}
.pl-bugbot-fix-wrap .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pl-bugbot-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 4px;
}
.pl-bugbot-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  align-items: start;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.2);
}
.pl-bugbot-list li.is-ok {
  border-color: rgba(126, 232, 199, 0.28);
  background: rgba(126, 232, 199, 0.07);
}
.pl-bugbot-list li.is-bad {
  border-color: rgba(255, 111, 111, 0.3);
  background: rgba(255, 111, 111, 0.07);
}
.pl-bugbot-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}
.pl-bugbot-list li.is-ok .pl-bugbot-mark {
  color: #0a0b0f;
  background: var(--accent-3);
}
.pl-bugbot-list li.is-bad .pl-bugbot-mark {
  color: #0a0b0f;
  background: #ff8f8f;
}
.pl-bugbot-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.pl-bugbot-text strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}
.pl-bugbot-text small {
  color: var(--ink-dim);
  font-size: 0.72rem;
  line-height: 1.35;
}
.pl-bugbot-suggest {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(138, 180, 255, 0.06);
}
.pl-bugbot-suggest .eyebrow { display: block; margin-bottom: 3px; }
.pl-bugbot-suggest p {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
}
.pl-bugbot-cheat {
  margin: 8px 0 0 !important;
  font-size: 0.74rem !important;
  color: var(--ink-faint) !important;
  line-height: 1.4;
}
.pl-bugbot-banner {
  margin: 0 0 8px !important;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--ink);
}
.pl-bugbot-banner.is-fixed,
.pl-bugbot-banner.is-ok {
  border: 1px solid rgba(126, 232, 199, 0.35);
  background: rgba(126, 232, 199, 0.1);
  color: var(--accent-3);
}
.pl-bugbot-wait {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 8px 8px 2px;
  text-align: center;
}

@media (max-width: 1024px), (max-height: 820px) {
  .pl-modal { padding: 10px; }
  .pl-modal-dialog {
    width: min(440px, 100%);
    max-height: min(82vh, 100%);
    max-height: min(82dvh, 100%);
    padding: 12px 12px 10px;
  }
  .pl-bugbot-dialog {
    width: min(540px, 100%);
    max-height: min(78vh, 100%);
    max-height: min(78dvh, 100%);
    padding: 8px 8px 6px;
  }
  .pl-modal-head .h3 { font-size: 1.05rem; }
  .pl-bugbot-dialog .pl-modal-head .h3 { font-size: 1rem; }
  .pl-bugbot-list li { padding: 6px 8px; }
  .pl-bugbot-text strong { font-size: 0.8rem; }
  .pl-bugbot-text small { font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-bubble.is-enter, #bl-run.is-inviting, .pl-dots i, .pl-modal-dialog,
  .pl-enhance-orb span, .pl-enhance-bar i, .pl-pack-option { animation: none !important; }
  .pl-pack-option:hover { transform: none; }
}
