/* Panoul de cod Liquid din editorul vizual (I1-T-7, E-G). Intră singur în stylesheet_link_tag :app; totul e sub .te și folosește variabilele
   --te-* din admin-theme-editor.css. Panoul ia locul setărilor secțiunii (același loc în grilă) și lărgește coloana cât timp e deschis. */

/* JetBrains Mono, aceleași fișiere ca vitrina (cale logică Propshaft din packs/storefront/app/assets). */
@font-face { font-family: "JetBrains Mono"; src: url("/assets/storefront/theme/v6/fonts/jetbrains-mono/JetBrainsMono-Regular-310ed802.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/storefront/theme/v6/fonts/jetbrains-mono/JetBrainsMono-SemiBold-36667725.woff2") format("woff2"); font-weight: 600; font-display: swap; }

.te .te-settings[hidden], .te .te-liquid[hidden] { display: none; }

/* Cât timp panoul de cod e deschis, coloana din dreapta e mai lată (codul are nevoie de rânduri lungi). */
@media (min-width: 900.02px) {
  .te .te-panes:has(.te-liquid:not([hidden])) { grid-template-columns: 280px minmax(0, 1fr) minmax(340px, 44%); }
}

.te .te-liquid {
  overflow-y: auto;
  padding: 1rem;
  background: var(--te-surface);
  min-width: 0;
  border-left: 1px solid var(--te-border-strong);
}
.te .te-liquid .te-pane-title { font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--te-text); }

.te .te-lq-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.te .te-lq-head .te-pane-title { margin: 0; }
.te .te-lq-tools { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.te .te-lq-tools .btn { min-height: 24px; }

/* Starea salvării: textul spune tot (semnul din față e doar un ajutor), culoarea întărește. */
.te .te-lq-state { margin: 0 0 0.5rem; min-height: 1.25rem; font-size: 0.875rem; font-weight: 600; color: var(--te-muted); overflow-wrap: anywhere; }
.te .te-lq-state[data-state="error"] { color: var(--te-danger); }
.te .te-lq-state[data-state="saved"] { color: var(--te-accent); }
.te .te-lq-retry { margin: 0 0 0.5rem; }
.te .te-lq-state:not(:empty)::before { margin-right: 0.375rem; }
.te .te-lq-state[data-state="dirty"]::before { content: "\25CF"; }
.te .te-lq-state[data-state="saving"]::before { content: "\2026"; }
.te .te-lq-state[data-state="saved"]::before { content: "\2713"; }
.te .te-lq-state[data-state="error"]::before { content: "!"; font-weight: 700; }

.te .te-lq-errors, .te .te-lq-conflict, .te .te-lq-warnings { display: grid; gap: 0.5rem; margin: 0.25rem 0 0.75rem; }
.te .te-lq-errors[hidden], .te .te-lq-conflict[hidden], .te .te-lq-warnings[hidden], .te .te-lq-body[hidden], .te [data-lq="loading"][hidden], .te [data-lq="used"][hidden] { display: none; }
.te .te-lq-problem-title, .te .te-lq-problem-text { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.te .te-lq-list { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.25rem; font-size: 0.875rem; overflow-wrap: anywhere; }
.te .te-lq-error-btn {
  display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left;
  text-decoration: underline; cursor: pointer; overflow-wrap: anywhere; min-height: 24px;
}
.te .te-lq-error-btn:hover { text-decoration-thickness: 2px; }
.te .te-lq-conflict-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.te .te-lq-body { min-width: 0; }
.te .te-lq-field { margin: 0 0 0.75rem; min-width: 0; }
.te .te-lq-field > label { display: block; margin-bottom: 0.25rem; font-weight: 600; font-size: 0.875rem; }
.te .te-lq-field input[type="text"] { width: 100%; max-width: 100%; }
.te .te-lq-launcher { margin: 0.75rem 0; }

/* Zona de cod: numerele rândurilor într-o coloană alături de textarea, cu aceeași înălțime a rândului (fixă, în px) și fără răsfrângere. */
.te .te-lq-code {
  --lq-line: 20px;
  display: flex; min-height: 14rem; height: 22rem; max-height: 80vh; resize: vertical; overflow: hidden;
  border: 1px solid var(--te-border-strong); border-radius: 6px; background: #fff;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: var(--lq-line);
}
.te .te-lq-code:focus-within { outline: 2px solid var(--te-accent); outline-offset: 1px; }
.te .te-lq-gutter {
  flex: 0 0 auto; min-width: 3.25rem; overflow: hidden; padding: 8px 0.5rem 28px 0.25rem; text-align: right;
  background: #eef0ed; color: #4a534c; border-right: 1px solid var(--te-border); user-select: none;
}
.te .te-lq-ln { display: block; height: var(--lq-line); white-space: pre; }
.te .te-lq-ln-error { background: #fbe3e0; color: #8f1d17; font-weight: 600; }
.te .te-lq-ln-error::before { content: "!"; margin-right: 0.25rem; }

.te .te-lq-source, .te .te-lq-schema {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--te-text);
  white-space: pre; overflow-wrap: normal; tab-size: 2;
}
.te .te-lq-source {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 8px 0.5rem; border: 0; border-radius: 0; resize: none; background: transparent;
  line-height: var(--lq-line); overflow: auto;
}
/* Focusul îl arată chenarul zonei (:focus-within), nu un al doilea contur în interior. */
.te .te-lq-source:focus-visible { outline: none; box-shadow: none; }
.te .te-lq-schema { width: 100%; max-width: 100%; line-height: 1.5; padding: 0.5rem; }

.te .te-lq-size { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--te-muted); }
.te .te-lq-size-over { color: var(--te-danger); font-weight: 700; }
.te .te-lq-size-over::before { content: "! "; }
.te .te-lq-help .te-note { margin: 0.25rem 0 0; }
.te .te-lq-help code, .te .te-lq-field code { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 0.8125rem; }

.te .te-lq-group { margin: 0 0 0.75rem; padding: 0 0 0.75rem; border-top: 1px solid var(--te-border); }
.te .te-lq-group > summary { cursor: pointer; padding: 0.5rem 0; font-weight: 700; font-size: 0.9375rem; }

@media (max-width: 900px) {
  .te .te-liquid { border-left: 0; border-top: 1px solid var(--te-border-strong); }
  .te .te-lq-code { height: 18rem; }
  .te .te-lq-gutter { min-width: 2.75rem; }
}

/* `.callout` are `display` propriu, care ar câștiga peste atributul `hidden`: o casetă goală ar rămâne pe ecran. */
.te .te-liquid [hidden] { display: none !important; }

/* Starea panoului e text, nu mesajul verde al adminului: `:is(body.admin, body.platform) [role=status]` are specificitate mai mare. */
body.te-body .te .te-lq-state { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
body.te-body .te .te-lq-state[data-state="error"] { color: var(--te-danger); }
