/* The modeler page, in applicationbuilder.frontend's look (tokens in style.css). */

/* ---- layout: a full-height tree panel beside the work area, as the app's project explorer ---- */

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}
.workspace.tree-hidden { grid-template-columns: 40px minmax(0, 1fr); }
.workspace.tree-hidden .sidebar { display: none; }

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--border);
}
.tree-rail {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  width: 40px;
  padding-top: 12px;
  align-items: flex-start;
  color: var(--muted-foreground);
  background: var(--card);
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}
.tree-rail:hover:not(:disabled) { background: var(--accent); color: var(--foreground); }

.editor { min-width: 0; padding: 16px 24px 24px; }

/* ---- the tree panel ------------------------------------------------------------------------ */

.tree-head { display: flex; align-items: center; gap: 2px; min-height: 48px; padding: 4px 8px 4px 16px; border-bottom: 1px solid var(--border); }
.tree-head h3 { flex: 1; font-size: 14px; }
.tree-tools { display: flex; align-items: center; gap: 2px; padding: 8px 8px 4px 12px; }
.tree-tools .spacer { flex: 1; }
#tree-where { margin: 0; padding: 0 16px 8px; color: var(--muted-foreground); border-bottom: 1px solid var(--accent); }
.tree { flex: 1; overflow: auto; padding: 6px 8px; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  outline: none;
  font-size: 14px;
  color: var(--foreground);
  transition: background var(--duration-fast) ease;
}
.tree-row:hover { background: var(--accent); }
.tree-row.selected { background: var(--secondary-hover); }
.tree-row:focus-visible { box-shadow: inset 0 0 0 2px var(--ring); }
.tree-row.open .tree-label { font-weight: 600; color: var(--primary); }
.tree-row.drop { background: var(--success-soft); box-shadow: inset 0 0 0 2px var(--success); }
.tree-row.root { color: var(--muted-foreground); font-weight: 500; }
.tree-twisty { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; padding: 0; color: var(--muted-foreground); background: none; border: 0; font-size: 16px; }
.tree-twisty:hover:not(:disabled) { background: none; color: var(--foreground); }
.tree-icon { display: inline-flex; flex: none; font-size: 18px; }
.tree-icon.folder, .tree-icon.root { color: var(--artifact-folder); }
.tree-icon.model { color: var(--artifact-model); }
.tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .badge { flex: none; }
.tree-empty { padding: 12px 8px; }
.tree-archived { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }

/* ---- the head of the work area: title, steps, actions, messages ------------------------------ */

.editor-head { padding: 16px 20px; }
.editor-head .title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.editor-head h2 { font-size: 20px; line-height: 28px; }
#model-meta { font-size: 13px; }

.steps { display: flex; list-style: none; padding: 0; margin: 16px 0; counter-reset: step; }
.steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted-foreground);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 50%;
}
.steps li + li::after { content: none; }
.steps li:not(:last-child)::after { content: ''; flex: 1; height: 2px; margin: 0 8px 0 0; background: var(--border); border-radius: 1px; }
.steps li.done { color: var(--foreground); font-weight: 500; }
.steps li.done::before { content: '\2713'; color: #fff; background: var(--success); border-color: var(--success); }
.steps li.done:not(:last-child)::after { background: var(--success-soft-border); }
.steps li.stale { color: var(--warning-soft-foreground); font-weight: 500; }
.steps li.stale::before { color: var(--warning-soft-foreground); background: var(--warning-soft); border-color: var(--warning); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions .divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

/* ---- diagram surfaces ------------------------------------------------------------------------ */

.canvas {
  height: 62vh;
  min-height: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.view { overflow: auto; padding: 24px; }
.view svg { max-width: none; }
.view > p { margin: 0; }
.view .bpmn-element.selected { filter: drop-shadow(0 0 4px var(--highlight)) drop-shadow(0 0 2px var(--highlight)); }

/* editing: canvas and properties panel side by side; the panel never covers the canvas */
.editor-area { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-bottom: 16px; }
.editor-area .canvas { margin-bottom: 0; }

/* ---- the properties panel -------------------------------------------------------------------- */

.properties { height: 62vh; min-height: 420px; overflow: auto; margin: 0; padding: 0; }
.pp-head { position: sticky; top: 0; z-index: 1; padding: 14px 16px 12px; background: var(--card); border-bottom: 1px solid var(--border); }
.pp-type { font-size: 11px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.06em; }
.pp-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; margin-top: 2px; }
.properties > p { padding: 16px; }
.pp-group { border-bottom: 1px solid var(--accent); padding: 4px 16px 10px; }
.pp-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--foreground); }
.pp-group > summary::-webkit-details-marker { display: none; }
.pp-group > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted-foreground); border-bottom: 1.5px solid var(--muted-foreground); transform: rotate(-45deg); transition: transform var(--duration-fast); margin: 0 4px 0 2px; }
.pp-group[open] > summary::before { transform: rotate(45deg); }
.pp-field { margin: 10px 0; }
.pp-label { display: block; font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 4px; }
.pp-check .pp-label { color: var(--foreground); font-size: 13px; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.pp-field input:not([type=checkbox]), .pp-field select, .pp-field textarea { width: 100%; padding: 6px 10px; font-size: 13px; }
.pp-code { font-family: var(--font-mono) !important; font-size: 12px !important; }
.pp-hint { font-size: 12px; line-height: 16px; color: var(--muted-foreground); margin-top: 4px; }
.pp-error { font-size: 12px; line-height: 16px; color: var(--destructive); margin-top: 4px; }
.pp-info { font-size: 12px; white-space: pre-wrap; margin: 0; max-height: 160px; }
.pp-lookup { position: relative; }
.pp-choices {
  position: absolute; z-index: 10; left: 0; right: 0; top: 100%;
  margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev-3); max-height: 240px; overflow: auto;
}
.pp-choices li { padding: 6px 8px; border-radius: var(--radius-md); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pp-choices li.active, .pp-choices li:hover { background: var(--secondary); }
.pp-detail { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- validation and revisions ---------------------------------------------------------------- */

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panels .card { margin: 0; }
.problems { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; }
.problems li { cursor: pointer; margin: 2px 0; }
.problems li:hover { color: var(--primary-40); text-decoration: underline; }
#revisions tr { cursor: pointer; }
#revisions tr:hover td { background: var(--secondary); }
#revision-view { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.revision-svg { overflow: auto; max-height: 360px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-top: 8px; background: var(--card); }

/* ---- testing: setup across the top, then instances | diagram | the selected instance ------------ */

.test { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.test .card { margin: 0; }

.te-setup { display: flex; align-items: flex-end; gap: 12px 20px; padding: 14px 16px; }
.te-setup-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.te-setup-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
.te-setup .row { display: flex; gap: 6px; align-items: center; }
.te-setup select { width: 210px; min-width: 0; font-size: 13px; padding: 6px 10px; }
.te-setup .te-setup-item { flex: 0 1 auto; }
.te-setup-sep { align-self: stretch; width: 1px; background: var(--border); }
.te-setup-status { flex: 1 1 0; min-width: 0; align-self: flex-end; padding-bottom: 8px; }
.te-status { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground); }
.te-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-status.ok { color: var(--success-soft-foreground); }
.te-status .icon { font-size: 16px; }
#te-start { flex: none; align-self: flex-end; padding: 8px 20px; }
@media (max-width: 1300px) { .te-setup { flex-wrap: wrap; } .te-setup-status { flex-basis: 100%; order: 5; padding: 0; } }

.te-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.te-col { padding: 0; display: flex; flex-direction: column; min-width: 0; }
.te-col-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--border); }
.te-col-head h3 { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the instance picker in the diagram's head */
.te-canvas-head { flex-wrap: wrap; gap: 6px 8px; }
.te-canvas-head .legend { margin-left: auto; }
.te-canvas-head .lg { margin-left: 6px; }
.te-pick { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.te-pick-label { font-size: 13px; font-weight: 600; color: var(--foreground); white-space: nowrap; }
#te-instances { width: 280px; max-width: 100%; font-size: 13px; padding: 5px 10px; }
.te-diagram-title { white-space: nowrap; }

.te-canvas-col .legend { margin-left: auto; }
.test-diagram { overflow: auto; height: calc(100vh - 360px); min-height: 480px; padding: 24px; background: var(--card); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
/* at its own size, centred while it fits and scrolled when it does not */
.test-diagram svg { display: block; max-width: none; margin: 0 auto; }
.test-diagram .te-done { filter: drop-shadow(0 0 3px var(--success)) drop-shadow(0 0 1px var(--success)); }
.test-diagram .te-waiting { filter: drop-shadow(0 0 4px var(--warning)) drop-shadow(0 0 2px var(--warning)); cursor: pointer; animation: te-pulse 1.6s ease-in-out infinite; }
.test-diagram .te-failed { filter: drop-shadow(0 0 4px var(--destructive)) drop-shadow(0 0 2px var(--destructive)); cursor: pointer; }
.test-diagram .te-mock-set:not(.te-waiting):not(.te-failed):not(.te-done) { filter: drop-shadow(0 0 3px #7c3aed); cursor: pointer; }
@keyframes te-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .test-diagram .te-waiting { animation: none; } }
.legend { font-size: 12px; color: var(--muted-foreground); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 2px 0 8px; }
.lg.done { background: var(--success); }
.lg.waiting { background: var(--warning); }
.lg.failed { background: var(--destructive); }
.lg.mock { background: #7c3aed; }

/* the selected instance: what it waits for first, then its variables and steps */
.te-inspector { max-height: calc(100vh - 360px + 45px); min-height: 525px; overflow: auto; }
#te-instance { padding-bottom: 12px; }
#te-instance .te-col-head { position: sticky; top: 0; background: var(--card); z-index: 1; }
.te-meta { padding: 8px 16px 0; }
.te-section { margin: 16px 16px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
#te-waiting, #te-vars, #te-steps { margin: 0 16px; }
.te-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 24px; }
.te-empty p { margin: 0; max-width: 260px; }
.te-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--primary); background: var(--secondary); font-size: 22px; margin-bottom: 4px; }
.te-done-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; color: var(--success-soft-foreground); background: var(--success-soft); border: 1px solid var(--success-soft-border); border-radius: var(--radius-lg); }
.te-done-box .icon { font-size: 18px; }

.te-step { border: 1px solid var(--warning-soft-border); background: var(--warning-soft); border-radius: var(--radius-lg); padding: 12px; margin-bottom: 8px; }
.te-step.failed { border-color: var(--destructive-soft-border); background: var(--destructive-soft); }
.te-step-head { display: flex; align-items: center; gap: 8px; }
.te-step-head strong { flex: 1; min-width: 0; font-size: 14px; }
.te-step label { display: block; margin: 0; font-size: 12px; color: var(--muted-foreground); }
.te-step .vars { margin-bottom: 4px; }
.te-step .vars-row input, .te-step .vars-row select { background: var(--card); }
.te-failure { margin: 8px 0; padding: 6px 10px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--destructive-soft-border); color: var(--destructive-soft-foreground); font-size: 13px; }
.te-row { display: flex; gap: 8px; align-items: end; margin-top: 8px; flex-wrap: wrap; }
.te-row label { flex: 1; min-width: 120px; }
.te-row input { width: 100%; font-size: 13px; padding: 5px 8px; margin-top: 4px; }
.te-row button:first-child { margin-right: auto; }
.te-sub { font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin: 10px 0 4px; }

/* steps so far: a small timeline */
.te-steps { list-style: none; padding: 0; font-size: 13px; }
.te-steps li { position: relative; padding: 2px 0 8px 18px; }
.te-steps li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.te-steps li:not(:last-child)::after { content: ''; position: absolute; left: 6.5px; top: 17px; bottom: -1px; width: 1px; background: var(--border); }
.te-steps li.waiting { font-weight: 600; color: var(--warning-soft-foreground); }
.te-steps li.waiting::before { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft-border); }
#te-vars .vars-table th { font-size: 13px; }

/* mocks, folded away underneath */
.te-mocks-box { padding: 0; }
.te-mocks-box > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; }
.te-mocks-box > summary::-webkit-details-marker { display: none; }
.te-mocks-box > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--muted-foreground); border-bottom: 1.5px solid var(--muted-foreground); transform: rotate(-45deg); transition: transform var(--duration-fast); flex: none; }
.te-mocks-box[open] > summary::before { transform: rotate(45deg); }
.te-mocks-box[open] > summary { border-bottom: 1px solid var(--border); }
.te-mocks-hint { font-weight: 400; flex: 1; text-align: right; }
.te-mocks { margin: 4px 0 8px; }
.te-mocks th:first-child, .te-mocks td:first-child { padding-left: 16px; }
.te-mocks th:last-child, .te-mocks td:last-child { padding-right: 16px; }
.te-mocks td { vertical-align: top; }
.te-mocks select, .te-mocks input { width: 100%; font-size: 13px; padding: 5px 8px; }
.te-mocks td:first-child { width: 20%; }
.te-mocks td:nth-child(2) { width: 18%; }
.te-mocks td:nth-child(3) { width: 30%; }

/* ---- variables: rows of name, type and value -------------------------------------------------- */

.vars-rows { display: flex; flex-direction: column; gap: 4px; }
.vars-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 84px minmax(0, 1fr) 24px; gap: 4px; align-items: center; }
.vars-row input, .vars-row select { width: 100%; min-width: 0; font-size: 13px !important; padding: 5px 7px !important; border-radius: var(--radius-md) !important; }
.vars-remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; font-size: 18px; font-weight: 400; color: var(--muted-foreground); background: none; border: 0; border-radius: var(--radius-sm); }
.vars-remove:hover:not(:disabled) { color: var(--destructive); background: var(--destructive-soft); }
.vars-add { margin-top: 6px; padding: 4px 10px !important; font-size: 12px !important; color: var(--primary) !important; background: var(--secondary) !important; border: 0 !important; }
.vars-add:hover { background: var(--secondary-hover) !important; }
.vars.compact .vars-row { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr) 22px; }
.vars-table { width: 100%; font-size: 13px; }
.vars-table th { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--foreground); padding: 4px 8px 4px 0; white-space: nowrap; border-bottom: 1px solid var(--accent); }
.vars-table td { padding: 4px 8px 4px 0; overflow-wrap: anywhere; border-bottom: 1px solid var(--accent); }

/* ---- popup forms: the design system's Dialog --------------------------------------------------- */

.dlg.wide { width: min(560px, calc(100vw - 32px)); }
.dlg-error { margin: 8px 0 0; padding: 8px 10px; font-size: 13px; color: var(--destructive-soft-foreground); background: var(--destructive-soft); border: 1px solid var(--destructive-soft-border); border-radius: var(--radius-md); }
div.dlg-field > span { display: block; font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 4px; }

.dlg { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-xl); background: var(--card); color: var(--foreground); box-shadow: var(--shadow-elev-5); }
.dlg::backdrop { background: rgba(23, 25, 28, 0.5); }
.dlg form { display: flex; flex-direction: column; }
.dlg-header { display: flex; align-items: center; gap: 8px; padding: 16px 16px 4px 20px; }
.dlg-header h3 { flex: 1; font-size: 18px; line-height: 24px; }
.dlg-body { padding: 4px 20px 8px; }
.dlg-text { color: var(--muted-foreground); font-size: 13px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.dlg-field { display: block; margin: 12px 0; }
.dlg-field span { display: block; font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 4px; }
.dlg-field input, .dlg-field select { width: 100%; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--accent); margin-top: 8px; }

@media (max-width: 1100px) {
  .editor-area { grid-template-columns: 1fr; }
  .te-body { grid-template-columns: 1fr; }
  .te-inspector { max-height: none; min-height: 0; }
  .test-diagram { height: auto; min-height: 420px; max-height: 70vh; }
  .properties { height: auto; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .panels { grid-template-columns: 1fr; }
}

/* ---- the drawing tools of bpmn-js: palette, context pad, menus and tooltips -------------------
   bpmn-js draws its tools from its own theme tokens (--bio-*, on .bio-theme-parent); they are
   mapped here onto the design system's, and the tools are given the shapes of our panels and
   buttons. This stylesheet loads after bpmn-js's, so the same selectors win. The bpmn.io
   watermark (.bjs-powered-by) is left exactly as bpmn-js draws it: its licence. */

.bio-theme-parent {
  --bio-surface: var(--card);
  --bio-surface-overlay: var(--card);
  --bio-surface-subtle: var(--card);
  --bio-surface-medium: var(--accent);
  --bio-surface-inverted: var(--neutral-10);
  --bio-surface-inverted-subtle: var(--foreground-subtle);
  --bio-text: var(--foreground);
  --bio-text-subtle: var(--foreground-subtle);
  --bio-text-subtlest: var(--muted-foreground);
  --bio-text-on-inverted: #fff;
  --bio-border: var(--border);
  --bio-border-disabled: var(--accent);
  --bio-primary: var(--primary);
  --bio-primary-surface: var(--secondary);
  --bio-danger: var(--destructive);
  --bio-danger-surface-subtle: var(--destructive-soft);
  --bio-selected-surface: var(--secondary-hover);
  --bio-selected-text: var(--primary);
  --bio-focus: var(--ring);
  --bio-focus-surface: var(--secondary);
  /* on the canvas the brighter step of the brand blue, so a selection reads against navy shapes */
  --bio-canvas-accent: var(--primary-40);
  --bio-canvas-accent-subtle: var(--primary-85);
  --bio-shadow: rgb(0 0 0 / 0.16);
  --bio-shadow-subtle: rgb(0 0 0 / 0.08);
  --bio-radius-sm: var(--radius-sm);
  --bio-radius-md: var(--radius-md);
  --bio-radius-lg: var(--radius-lg);
}
.djs-parent {
  --popup-font-family: var(--font-sans);
  --search-font-family: var(--font-sans);
  --hover-tooltip-font-family: var(--font-sans);
  --popup-header-font-weight: 600;
}

/* the palette: a floating white panel of tool buttons, as the app's toolbars */
.djs-palette {
  top: 16px;
  left: 16px;
  width: 52px; /* one 42px entry (40 + margins), padding 2 x 4, border 2 x 1 */
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev-2);
}
.djs-palette.two-column.open { width: 94px; }
.djs-palette .entry,
.djs-palette .djs-palette-toggle {
  width: 40px;
  height: 40px;
  line-height: 40px;
  margin: 1px;
  font-size: 24px;
  color: var(--foreground-subtle);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.djs-palette .entry:hover { color: var(--primary); background: var(--accent); }
.djs-palette .highlighted-entry { color: var(--primary) !important; background: var(--secondary-hover); }
.djs-palette .separator { margin: 4px 6px; padding-top: 4px; border-bottom-color: var(--border); }

/* the context pad beside a selected element: small white buttons */
.djs-context-pad { width: 92px; }
.djs-context-pad .entry {
  width: 26px;
  height: 26px;
  line-height: 26px;
  margin: 0 3px 3px 0;
  font-size: 20px;
  color: var(--foreground-subtle);
  background-color: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-elev-1);
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.djs-context-pad .entry:hover { color: var(--primary); background: var(--secondary); box-shadow: 0 0 0 1px var(--primary-85), var(--shadow-elev-1); }

/* menus (change type, append) and the search: the app's popover */
.djs-popup {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev-3);
}
.djs-popup-search input { font: 400 13px/20px var(--font-sans); padding: 5px 8px 5px 28px; border: 1px solid var(--input); border-radius: var(--radius-md); }
.djs-popup-search input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(0 46 92 / 0.2); outline: none; }
.djs-popup .entry { border-radius: var(--radius-md); }
.djs-popup .entry:hover, .djs-popup .entry.selected { background: var(--secondary); color: var(--primary); }
.djs-popup-header .entry.active { color: var(--primary); background: var(--secondary-hover); border-radius: var(--radius-sm); }
.djs-search-container { border: 1px solid var(--border); border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-elev-3); }

/* the tooltip naming a tool: dark, small, rounded */
.djs-hover-tooltip { border-radius: var(--radius-md); box-shadow: var(--shadow-elev-2); }

/* ---- the timer editor in the properties panel ------------------------------------------------- */

.tm { display: flex; flex-direction: column; gap: 8px; }
.tm-kinds { display: flex; padding: 2px; background: var(--accent); border-radius: var(--radius-md); }
.tm-kind { flex: 1; padding: 5px 4px; font-size: 12px; font-weight: 500; color: var(--foreground-subtle); background: transparent; border: 0; border-radius: var(--radius-sm); }
.tm-kind:hover:not(:disabled) { background: rgb(255 255 255 / 0.6); color: var(--foreground); }
.tm-kind.on, .tm-kind.on:hover:not(:disabled) { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-elev-1); }
.tm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tm-unit { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 11px; color: var(--muted-foreground); text-align: center; }
.pp-field .tm-unit input { padding: 5px 4px; text-align: center; }
.tm-sub { font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin-bottom: -2px; }
.tm-times { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--muted-foreground); }
.tm-times span { flex: 1; }
.pp-field .tm-times input { width: 96px; text-align: center; }
.tm-said { padding: 8px 10px; font-size: 13px; color: var(--info-soft-foreground); background: var(--info-soft); border: 1px solid var(--info-soft-border); border-radius: var(--radius-md); }
.tm-toggle { align-self: flex-start; padding: 0; font-size: 12px; font-weight: 500; color: var(--primary-40); background: none; border: 0; }
.tm-toggle:hover:not(:disabled) { background: none; text-decoration: underline; }
