/* Melola SEM Studio (ADR 0044): on top of stat.css, which gives the page, panel, table and form styles. */
.sem-list { list-style: none; padding: 0; margin: 0; }
.sem-list li { padding: 0.4rem 0; border-bottom: 1px solid #e5e7eb; display: flex; gap: 0.75rem; flex-wrap: wrap;
  align-items: baseline; }
.sem-syntax { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9rem; white-space: pre;
  overflow-x: auto; }
pre.sem-syntax { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.75rem; margin: 0.5rem 0; }
textarea.sem-syntax { width: 100%; }
.sem-consent { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.92rem; margin: 0.5rem 0; }
.sem-consent input { margin-top: 0.2rem; }
.sem-model { border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.sem-model summary { cursor: pointer; font-weight: 600; }
.sem-run .stat-table { margin-bottom: 0.75rem; }
.sem-run h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
/* Below a rule of thumb: marked by weight and a left rule, never by colour alone (ADR 0044 butir 6). */
.sem-below th, .sem-below td { font-weight: 600; }
.sem-below th { box-shadow: inset 3px 0 0 #6b7280; }
details.stat-panel > summary { cursor: pointer; font-weight: 600; }
/* The project page stacks data, model and analysis: each holds a table or a long form. */
.sem-project .stat-steps { grid-template-columns: 1fr; }
.sem-project .stat-table { width: 100%; }
/* Forms here are label-above-field, one per line (stat-fields lays short fields side by side). */
.sem .stat-fields { flex-direction: column; flex-wrap: nowrap; gap: 6px; max-width: 40rem; }
.sem .stat-fields input, .sem .stat-fields select, .sem .stat-fields textarea { width: 100%; box-sizing: border-box; }
.sem .stat-fields .sem-consent input { width: auto; }
.sem .stat-fields .btn { align-self: flex-start; margin-top: 6px; }
/* Path diagram (static/sem/js/diagram.js). */
.sem-editor { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px; margin: 10px 0; }
.sem-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sem-toolbar__new input { padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.9rem; width: 12rem; }
.sem-toolbar [aria-pressed="true"] { outline: 3px solid #0f766e; outline-offset: 1px; }
.sem-status { min-height: 1.4em; margin: 6px 0; font-size: 0.9rem; }
.sem-editor__body { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 10px; }
@media (max-width: 760px) { .sem-editor__body { grid-template-columns: 1fr; } }
.sem-canvas { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-height: 70vh; }
.sem-canvas svg { display: block; touch-action: none; max-width: 100%; min-width: 520px; height: auto; }
/* On a phone the diagram keeps a readable size and scrolls sideways inside its frame. */
.sem-canvas svg [data-construct]:focus { outline: none; }
.sem-canvas svg [data-construct]:focus-visible ellipse { stroke: #0f766e; stroke-width: 3; }
.sem-panel { font-size: 0.9rem; display: grid; gap: 8px; align-content: start; }
.sem-panel label { display: grid; gap: 4px; font-weight: 500; }
.sem-panel input[type=text], .sem-panel select { padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.sem-panel__title { font-weight: 700; margin: 0; }
.sem-items { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin: 0; }
.sem-items__list { max-height: 14rem; overflow: auto; display: grid; gap: 2px; margin-top: 6px; }
.sem-items__list label { display: flex; gap: 6px; font-weight: 400; }
.sem-list form { display: inline; }
/* Printing the result page gives the PDF (ADR 0044 butir 7): no navigation, no buttons, panels kept whole. */
@media print {
  .topbar, .stat-footer, .stat-actions, .stat-crumbs, .sem-canvas + .stat-hint + .stat-actions { display: none !important; }
  .stat-panel { break-inside: avoid; border: none; padding: 0; }
  details.stat-panel > *:not(summary) { display: block; }
}
