/* Constructorul de prompt (#/prompt): pași cu selectoare la stânga, textul la dreapta;
   pe ecran îngust, o bară lipită jos cu butonul de copiere. */
.pr-page { display: grid; gap: var(--s-4); min-width: 0; }
.pr-layout { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1180px) {
  .pr-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pr-layout .pr-out { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); max-height: calc(100vh - 104px); display: flex; flex-direction: column; }
  .pr-layout .pr-out .pr-text { flex: 1 1 auto; min-height: 0; max-height: none; }
  .pr-bar { display: none !important; }
}
.pr-step { display: grid; gap: var(--s-3); }
.pr-step h2 { font-size: var(--t-l); display: flex; align-items: center; gap: var(--s-2); margin: 0; }
.pr-n { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--f-body); font-size: var(--t-xs); font-weight: 700; }
.pr-x { font-family: var(--f-body); font-size: var(--t-xs); font-weight: 500; color: var(--muted); }
.pr-wait { margin: 0; }

.pr-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pr-sel { display: grid; }
.pr-sel select { font: inherit; font-size: var(--t-s); padding: .55rem 2rem .55rem .75rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 44px; width: 100%; max-width: 28rem; }
.pr-chip {
  font: inherit; font-size: var(--t-s); font-weight: 500; min-height: 40px; padding: .4rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
}
.pr-chip:hover { border-color: var(--accent); }
.pr-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pr-chip[aria-pressed="true"] .pr-x { color: inherit; }
.pr-grades .pr-chip { font-family: var(--f-mono); min-width: 48px; justify-content: center; }

.pr-list { display: grid; gap: 2px; }
.pr-item { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: var(--s-2); align-items: start; padding: .45rem .5rem; border-radius: 8px; cursor: pointer; font-size: var(--t-s); line-height: 1.45; }
.pr-item:hover { background: var(--surface-2); }
.pr-item input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.pr-item .code { margin-top: 1px; }
.pr-item .pr-t { min-width: 0; overflow-wrap: anywhere; }
.pr-item:has(input:checked) { background: var(--accent-soft); }
.pr-item.pr-toggle { grid-template-columns: auto minmax(0, 1fr); padding-inline: 0; }
.pr-item.pr-toggle:has(input:checked) { background: none; }
.pr-unit .pr-t b { display: block; font-weight: 600; }
.pr-meta { display: block; font-size: var(--t-xs); color: var(--muted); }
.pr-cs { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--accent); white-space: nowrap; }
.pr-dv { font-size: var(--t-xs); font-weight: 600; color: var(--warn); white-space: nowrap; }
.pr-sub { margin-left: 1.6rem; border-left: 2px solid var(--line); padding-left: var(--s-2); display: grid; gap: 2px; }

.pr-unitbox { border-top: 1px solid var(--line); padding-top: var(--s-3); display: grid; gap: var(--s-3); }
.pr-unitbox:first-of-type { border-top: 0; padding-top: 0; }
.pr-unitbox h3 { font-size: var(--t-m); font-family: var(--f-body); font-weight: 600; margin: 0; display: flex; gap: var(--s-2); align-items: baseline; }
details.pr-unitbox > summary { cursor: pointer; display: grid; gap: 2px; list-style: none; }
details.pr-unitbox > summary::-webkit-details-marker { display: none; }
details.pr-unitbox > summary h3::before { content: "▸"; color: var(--muted); font-size: var(--t-s); }
details.pr-unitbox[open] > summary h3::before { content: "▾"; }
.pr-al { margin: 0; border-left: 3px solid var(--gold); padding-left: var(--s-2); }
.pr-group { display: grid; gap: var(--s-1); }
.pr-gh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pr-gh h4 { margin: 0; font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pr-count { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: .3rem; }
.pr-all { display: inline-flex; gap: var(--s-1); }
.pr-mini { font: inherit; font-size: var(--t-xs); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .2rem .6rem; min-height: 30px; cursor: pointer; }
.pr-mini:hover { border-color: var(--accent); color: var(--accent); }

.pr-fields { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }

.pr-out { display: grid; gap: var(--s-3); min-width: 0; }
.pr-out-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-2); }
.pr-out-head h2 { font-size: var(--t-l); margin: 0; }
.pr-out-head p { margin: 2px 0 0; }
.pr-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pr-actions .btn:disabled, .pr-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.done { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.pr-status { margin: 0; min-height: 1.3em; color: var(--ok); font-weight: 500; }
.pr-text {
  margin: 0; padding: var(--s-3); border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--f-mono); font-size: var(--t-xs); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 70vh;
}
.pr-text.empty { font-family: var(--f-body); font-size: var(--t-s); color: var(--muted); }

.pr-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: var(--s-2); min-width: 0;
  padding: var(--s-2) var(--s-3) calc(env(safe-area-inset-bottom, 0px) + var(--s-2));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; box-shadow: var(--shadow);
}
/* WCAG 2.4.11: pe ecran îngust, derularea lasă loc barei lipite jos, ca butonul cu focus să nu ajungă sub ea */
@media (max-width: 1179.98px) { html:has(.pr-bar) { scroll-padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); } }
.pr-bar span { flex: 1 1 auto; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
