/* Trial-only layout adapters. Core component appearance lives in core-components.css. */
.trial-limit-workspace { display: grid; place-items: center; min-height: calc(100vh - var(--header-h) - 102px); }
.trial-limit-card { width: min(560px, 100%); padding: 48px; border: 1px solid var(--border-faint); border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgb(18 19 24 / 8%); text-align: center; }
.trial-limit-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 20px; border-radius: 50%; background: #fff7ed; color: #c2410c; }
.trial-limit-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.claimed-card .eyebrow { color: #047857; }
.claimed-icon { background: #ecfdf5; color: #047857; }
.trial-limit-card .eyebrow { margin: 0 0 8px; color: #c2410c; }
.trial-limit-card h1 { margin: 0 0 14px; font-size: 30px; letter-spacing: -.025em; }
.trial-limit-card > p:not(.eyebrow) { margin: 0 auto 12px; max-width: 460px; color: var(--text-muted); font-size: var(--text-small); line-height: 1.6; }
.trial-limit-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.trial-limit-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
@media (max-width: 600px) {
  .trial-limit-card { padding: 36px 24px; }
  .trial-limit-card h1 { font-size: 25px; }
  .trial-limit-actions { flex-direction: column; }
}
#label-panel { min-height: 0; width: 100%; }
#label-panel .labeling-workspace-progress { top: var(--header-h); z-index: 3; }
#label-panel .labeling-workspace-input-pane { z-index: 1; }
#label-panel .labeling-workspace-pane-header { z-index: 1; }
.labeling-workspace-progress-actions, .annotation-toolbar { flex-wrap: wrap; }
.labeling-workspace-input { font-family: var(--font-mono); min-height: 95px; }
.labeling-workspace-input.is-json-tree { white-space: normal; word-break: normal; }
.json-tree { display: flex; flex-direction: column; gap: .2rem; font-size: var(--text-small); line-height: 1.4; }
.json-tree + .json-tree { margin-top: .65rem; }
.json-tree-surrounding-text { white-space: pre-wrap; word-break: break-word; }
.json-tree-branch { margin-left: 0; }
.json-tree-summary { position: relative; padding-left: 1rem; cursor: pointer; user-select: none; list-style: none; }
.json-tree-summary::-webkit-details-marker { display: none; }
.json-tree-summary::before { content: "▸"; position: absolute; left: 0; top: 0; color: var(--grayscale-400); font-size: var(--text-tiny); }
.json-tree-branch[open] > .json-tree-summary::before { content: "▾"; }
.json-tree-children { display: flex; flex-direction: column; gap: .2rem; margin: .2rem 0 .2rem 1.15rem; padding-left: .35rem; border-left: 1px dashed rgb(148 163 184 / 35%); }
.json-tree-leaf { padding-left: 1.15rem; }
.json-tree-key { color: #0ea5e9; }
.json-tree-separator { color: var(--text-muted); }
.json-tree-collection-label { color: var(--grayscale-400); font-weight: 600; }
.json-tree-value--string { color: #22c55e; }
.json-tree-value--number { color: #f59e0b; }
.json-tree-value--boolean { color: #38bdf8; font-weight: 600; }
.json-tree-value--null { color: #fb7185; font-weight: 600; }
.label-choice-just-section { display: contents; }
.label-choice-checkbox-row { flex-wrap: wrap; }
.label-choice-label { text-transform: none; }
.label-choice-label > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.label-choice-summary:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.label-choice-summary[contenteditable="true"] { cursor: text; }
.label-choice-summary[contenteditable="false"] { cursor: default; }
.label-choice-card[aria-disabled="true"] { cursor: default; }
.labeling-workspace-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.labeling-workspace-actions .inline-status { flex-basis: 100%; margin: 0; }
.plg-annotation-continue { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-content: flex-end; gap: 18px; border-top: 1px solid var(--border-faint); padding-top: 20px; margin-top: 24px; }
.plg-annotation-continue.ready { padding: 16px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; }
.optimization-ready-copy { display: grid; gap: 3px; }
.optimization-ready-copy[hidden] { display: none; }
.optimization-ready-copy strong { color: #1e3a8a; font-size: var(--text-small); font-weight: 600; }
.optimization-ready-copy p { margin: 0; color: #475569; font-size: var(--text-x-small); line-height: 1.45; }
#start-gepa,
#start-gepa.ready {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--blue-action);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(37 99 235 / 20%);
}
#start-gepa:not(:disabled):hover { background: #1d4ed8; }
#start-gepa:not(:disabled):active { background: #1e40af; transform: translateY(1px); }
@media (max-width: 600px) {
  .plg-annotation-continue { grid-template-columns: 1fr; }
  #start-gepa { justify-self: start; }
}
#start-gepa:disabled { box-shadow: none; }
#setup-form { display: flex; flex-direction: column; gap: 16px; max-width: 880px; margin: auto; }
#setup-form > section, #setup-form > .create-actions { width: 100%; }
#setup-form > [data-setup-step="data"] { order: 1; }
#setup-form > [data-setup-step="decision"] { order: 2; }
#setup-form > [data-setup-step="answers"] { order: 3; }
#setup-form > .create-actions { order: 4; }
#setup-form > [data-setup-step="decision"]:not([hidden]),
#setup-form > [data-setup-step="answers"]:not([hidden]) { margin-top: 18px; padding-top: 28px; }
#setup-form .section-heading > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-default); color: var(--text-muted); font-size: 11px; }
#setup-form [data-setup-step="data"] .section-heading > span { background: #dbeafe; color: #1d4ed8; }
#setup-form [data-setup-step="decision"] .section-heading > span { background: #f3e8ff; color: #7e22ce; }
#setup-form [data-setup-step="answers"] .section-heading > span { background: #dcfce7; color: #15803d; }
#setup-form .section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
#setup-form .section-heading h2 { color: var(--text-loud); font-size: var(--text-medium); font-weight: 500; }
#setup-form .create-actions { justify-content: flex-end; border-top: 0; }
#setup-status:not(:empty) { margin-right: auto; }
#setup-form .output-config-row { gap: 10px; }
#setup-form #class-labels-row { margin-bottom: 0; }
#setup-form .class-label-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 6px 9px; border: 1px solid var(--border-faint); border-radius: 8px; background: #fff; transition: border-color 150ms ease, box-shadow 150ms ease; cursor: text; }
#setup-form .class-label-editor:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgb(59 130 246 / 12%); }
#setup-form .class-label-editor.class-labels-input-invalid { border-color: #fca5a5; box-shadow: 0 0 0 3px rgb(248 113 113 / 16%); }
#setup-form .class-labels-preview { display: contents; }
#setup-form .class-labels-preview.hidden { display: none; }
#setup-form .class-label-chip { gap: 5px; min-height: 26px; padding: 3px 5px 3px 9px; border-radius: 999px; background: #eff6ff; color: #1e3a8a; box-shadow: 0 0 0 1px #bfdbfe; }
#setup-form .class-label-chip.invalid { background: #fef2f2; color: #991b1b; box-shadow: 0 0 0 1px #fecaca; }
#setup-form .class-label-chip-remove { display: grid; place-items: center; width: 18px; min-width: 18px; height: 18px; min-height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #1e40af; font: 600 13px/1 var(--font-inter); cursor: pointer; }
#setup-form .class-label-chip-remove:hover { background: #dbeafe; }
#setup-form .class-label-editor #class-labels { flex: 1 1 150px; width: auto; min-width: 120px; min-height: 28px; padding: 0 3px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#setup-form .class-label-editor #class-labels:focus { border: 0; outline: 0; box-shadow: none; }
#setup-form .allow-multiple-labels { display: inline-flex; align-items: center; align-self: flex-start; gap: 8px; color: var(--text-muted); font-size: var(--text-tiny); cursor: pointer; user-select: none; }
#setup-form .allow-multiple-labels input { width: 15px; height: 15px; margin: 0; accent-color: var(--grayscale-900); cursor: pointer; }
#setup-form .input-data-source small, #setup-form .input-data-toolbar .dataset-meta { display: block; }
#setup-form #example-preview-content { height: 260px; overflow: auto; }
#setup-form #example-preview-content.is-json-tree { white-space: normal; word-break: normal; }
#setup-form #example-preview-content .json-tree { font-size: inherit; }
body[data-panel="run"] .app-shell,
body[data-panel="optimize"] .app-shell,
body[data-panel="compare"] .app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr);
  column-gap: 32px;
  align-items: start;
}
body[data-panel="run"] #journey-progress,
body[data-panel="optimize"] #journey-progress,
body[data-panel="compare"] #journey-progress,
body[data-panel="run"] #global-alert,
body[data-panel="optimize"] #global-alert,
body[data-panel="compare"] #global-alert { grid-column: 1 / -1; }
body[data-panel="run"] #run-panel,
body[data-panel="optimize"] #optimize-panel,
body[data-panel="compare"] #compare-panel { grid-column: 1; width: 100%; margin: 0; }
#context-rail {
  grid-column: 2;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow: auto;
}
@media (max-width: 800px) {
  body[data-panel="run"] .app-shell,
  body[data-panel="optimize"] .app-shell,
  body[data-panel="compare"] .app-shell { grid-template-columns: 1fr; row-gap: 28px; }
  #context-rail { grid-column: 1; position: static; max-height: none; }
  .context-metrics-row { grid-template-columns: 1fr; }
  .labeling-workspace-body { grid-template-columns: 1fr; }
  .labeling-workspace-input-pane { position: static; max-height: none; }
  .labeling-workspace-progress-row { flex-wrap: wrap; }
}
.labeling-workspace-header-copy p { font-size: var(--text-small); color: var(--text-muted); margin: 4px 0 0; }
.labeling-workspace-tab .labeling-tab-badge.is-complete { width: 17px; height: 17px; margin-left: 6px; padding: 0; border-radius: 50%; background: #dcfce7; color: #15803d; }
.labeling-workspace-tab .labeling-tab-badge.is-complete svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.labeling-workspace-pane-header h3 { font-size: var(--text-small); font-weight: 600; }
.labeling-workspace-input-pane mark { background: #fef3c7; color: #121318; }
.labeling-workspace-pane-header-actions { display: flex; align-items: center; gap: .5rem; }
.labeling-workspace-pane-header-actions input { min-width: 0; width: 140px; }
.evidence-toggle.is-active { border-color: rgb(251 146 60 / 38%); background: rgb(251 146 60 / 13%); color: #9a3412; }
.evidence-toggle[hidden] { display: none; }
.evidence-highlight { border-radius: 2px; background: rgb(251 146 60 / 32%); color: inherit; box-shadow: 0 0 0 1px rgb(251 146 60 / 28%); cursor: pointer; }
.evidence-highlight.is-active { background: rgb(251 191 36 / 50%); box-shadow: 0 0 0 2px rgb(251 191 36 / 75%); }
.optimize-progress { display: grid; gap: 9px; margin-top: 18px; }
.optimize-progress-track { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: var(--bg-default); }
.optimize-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue-action); transition: width 300ms ease; }
.optimize-progress.is-indeterminate .optimize-progress-track i { width: 34%; animation: optimize-progress-scan 1.35s ease-in-out infinite; }
.optimize-progress-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--text-muted); font-size: var(--text-tiny); font-variant-numeric: tabular-nums; }
.optimize-progress-meta strong { color: var(--text-loud); }
.optimize-status-column { display: grid; gap: 18px; }
.gepa-tree-card { min-width: 0; overflow: hidden; border: 1px solid var(--border-faint); border-radius: 12px; background: #fff; }
.gepa-tree-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border-faint); }
.gepa-tree-heading h2 { margin: 0; color: var(--text-loud); font-size: var(--text-small); font-weight: 600; }
.gepa-tree-heading p, .gepa-tree-heading span { margin: 3px 0 0; color: var(--text-muted); font-size: var(--text-tiny); }
.gepa-tree-heading span { flex: none; margin: 0; font-variant-numeric: tabular-nums; }
#gepa-tree-frame { display: block; width: 100%; height: 430px; border: 0; background: #f8f9fa; }
#gepa-tree-frame[hidden] { display: none; }
@keyframes optimize-progress-scan { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) {
  .optimize-progress-track i { transition: none; }
  .optimize-progress.is-indeterminate .optimize-progress-track i { animation: none; width: 100%; opacity: .35; }
}

#setup-form .prompt-card { min-height: 0; }
