/* MSP building blocks: page header, buttons, forms, lists, table, states, toasts. Colours only from tokens.css. */

/* ---- page ---- */

/* the page fills main, the full width and height beside the sidebar (main > .loader on the first load) */
main > .loader { flex: 1; display: flex; flex-direction: column; }
.page { flex: 1; display: flex; flex-direction: column; gap: 20px; width: 100%; min-width: 0; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-sub { color: var(--c-muted); }
.crumbs { display: flex; gap: 8px; font-size: .85rem; color: var(--c-muted); }
.crumbs a { text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group h2 { display: flex; align-items: center; gap: 10px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* ---- buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--c-line-strong); background: transparent; color: var(--c-text);
  cursor: pointer; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--c-highlight); color: var(--c-highlight); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--c-primary); border-color: var(--c-line-strong); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--c-highlight); border-color: var(--c-highlight); color: var(--c-on-highlight); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--c-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--c-hover-tint); color: var(--c-text); }
.htmx-request.btn, .htmx-request .btn-primary { opacity: .7; cursor: progress; }

/* ---- forms ---- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.field > span { color: var(--c-muted); }
.field input, .field select, .field textarea {
  min-height: 38px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--c-line-strong); background: var(--c-well);
}
.field input:focus { border-color: var(--c-highlight); outline: none; box-shadow: 0 0 0 2px var(--c-highlight-tint); }
.field input[aria-invalid="true"] { border-color: var(--c-highlight); }
.field-inline input { min-width: 260px; }
.field-error, .form-error { color: var(--c-highlight); font-size: .85rem; }
.field-error:empty, .form-error:empty { display: none; }

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

.card { padding: 20px; border-radius: var(--radius); background: var(--c-primary); border: 1px solid var(--c-line); }
.count {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--c-well); border: 1px solid var(--c-line);
  font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tag { padding: 1px 8px; border-radius: 10px; border: 1px solid var(--c-line); font-size: .75rem; color: var(--c-muted); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.details dt { color: var(--c-muted); }
.details dd { margin: 0; }

/* ---- lists ---- */

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list > li { border-radius: var(--radius); background: var(--c-primary); border: 1px solid var(--c-line); }
.list-links a, .flow summary {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; cursor: pointer;
}
.list-links a:hover, .flow summary:hover { color: var(--c-text); background: var(--c-hover-tint); border-radius: var(--radius); }
.flow-name { font-weight: 600; }
.list .count { margin-left: auto; }
.list-links .tag { margin-left: auto; }
.flow summary { list-style: none; }
.flow summary::-webkit-details-marker { display: none; }
.flow summary::before { content: '▸'; color: var(--c-muted); transition: transform .15s; }
.flow[open] summary::before { transform: rotate(90deg); }
.steps { list-style: none; margin: 0; padding: 4px 14px 12px 38px; display: flex; flex-direction: column; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--c-line); }
.steps li:last-child { border-bottom: 0; }
.steps .count { margin-left: 0; } /* right next to the step's name */
.steps a { flex: 1; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.steps a:hover { color: var(--c-text); text-decoration: underline; }

/* ---- table ---- */

.grid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--c-line); background: var(--c-primary); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table th { position: sticky; top: 0; background: var(--c-primary); font-weight: 600; color: var(--c-muted); }
.table th a { text-decoration: none; }
.table th[aria-sort] { color: var(--c-text); }
.table tbody tr:hover { background: var(--c-hover-tint); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-hidden { display: none; }
/* columns sized from Midbase's DefaultWidth (th[data-width], applied by msp.js): fixed, longer text cut with … */
.table-fixed { table-layout: fixed; width: 0; } /* as wide as its columns add up to */
.table-fixed th, .table-fixed td { overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.pager + .table-wrap { margin-top: 12px; } /* a pager above the table (a flow list) */
.grid-head + .pager { margin-top: 0; }
.toolbar > .pager { flex: 1; margin-top: 0; } /* a list paged in the browser: its pager beside the filter */
/* a flow list's first columns (FlowNumber, Assigned, Move) stay in view when it scrolls sideways */
.table .col-sticky { position: sticky; z-index: 1; background: var(--c-primary); }
.table th.col-sticky { z-index: 3; }
.table th { z-index: 2; }
.table tbody tr:hover .col-sticky { background: linear-gradient(var(--c-hover-tint), var(--c-hover-tint)), var(--c-primary); }
/* a Critical instance's FlowNumber: its step colour (data-color, set by msp.js) or the accent */
.table td.prio-critical, .table tbody tr:hover td.prio-critical { background: var(--c-highlight); color: var(--c-on-highlight); font-weight: 600; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-pages .btn { min-width: 36px; justify-content: center; }
.pager-current {
  display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; padding: 0 8px; border-radius: 8px;
  background: var(--c-highlight); color: var(--c-on-highlight); font-weight: 600;
}
.pager-size { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pager-size select { padding: 6px 8px; border-radius: 8px; background: var(--c-secondary); border: 1px solid var(--c-line); color: var(--c-text); }

/* ---- loading and empty states ---- */

.loader { min-height: 80px; }
.loader[aria-busy="true"] { display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--c-skeleton-hi); border-top-color: var(--c-highlight);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.state {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 28px; border-radius: var(--radius); border: 1px dashed var(--c-line-strong); color: var(--c-muted);
}
.state-title { font-weight: 600; color: var(--c-text); }
.state-error { border-style: solid; border-color: var(--c-highlight); color: var(--c-text); }

/* ---- toasts ---- */

.toasts { position: fixed; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  padding: 12px 16px; border-radius: var(--radius); background: var(--c-primary);
  border: 1px solid var(--c-line-strong); box-shadow: 0 8px 24px var(--c-shadow);
  transition: opacity .3s, transform .3s;
}
.toast-error { border-color: var(--c-highlight); box-shadow: inset 4px 0 0 var(--c-highlight), 0 8px 24px var(--c-shadow); }
.toast-out { opacity: 0; transform: translateY(-8px); }

/* ---- record page: tabs, the form, documents, notes ---- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-line); overflow-x: auto; }
.tabs [role="tab"] {
  padding: 9px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--c-muted); cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"]:hover:not(:disabled) { color: var(--c-text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--c-text); border-bottom-color: var(--c-highlight); font-weight: 600; }
.tabs [role="tab"]:disabled { opacity: .45; cursor: default; }
.tab-body { padding-top: 16px; }
.tab-body.htmx-request { opacity: .6; transition: opacity .2s; }
.record-form { display: flex; flex-direction: column; gap: 16px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field-wide { grid-column: 1 / -1; }
.field select, .field textarea { font: inherit; }
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: .7; }
.field-check { justify-content: flex-end; }
.field-check label { display: flex; align-items: center; gap: 8px; color: var(--c-text); }
.field-check input { width: 18px; height: 18px; accent-color: var(--c-highlight); }
.req { color: var(--c-highlight); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-danger:hover:not(:disabled) { border-color: var(--c-highlight); background: var(--c-highlight); color: var(--c-on-highlight); }
.btn-small { min-height: 28px; padding: 0 10px; font-size: .85rem; }
.table .row-open { cursor: pointer; user-select: none; } /* double-click opens the record */
.row-open .row-link { color: inherit; text-decoration: none; cursor: inherit; } /* its text as a link: right-click opens it in a new tab */
.table .row-open:focus-visible { outline: 2px solid var(--c-highlight); outline-offset: -2px; }

/* ---- a flow: toolbar, kanban ---- */

.flow-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.flow-toolbar .field-inline { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.flow-toolbar select, .flow-search input {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-secondary); color: var(--c-text);
}
.flow-toolbar select { max-width: 260px; }
.flow-toolbar select:disabled { opacity: .55; cursor: not-allowed; }
/* a checkbox in a toolbar ("My customers"): the box and its words side by side, not a field's text input */
.toolbar-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--c-text); white-space: nowrap; cursor: pointer; }
.toolbar-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-highlight); cursor: pointer; }
.flow-search input { min-width: 220px; }
.segmented { display: inline-flex; margin-left: auto; border: 1px solid var(--c-line-strong); border-radius: 8px; overflow: hidden; }
.segmented a { padding: 8px 14px; text-decoration: none; color: var(--c-muted); }
.segmented a + a { border-left: 1px solid var(--c-line-strong); }
.segmented a:hover { color: var(--c-text); background: var(--c-hover-tint); }
.segmented a[aria-pressed="true"] { background: var(--c-highlight); color: var(--c-on-highlight); font-weight: 600; }

/* a flow's list and kanban take the rest of the window's height: the list scrolls inside its frame (header and
   first columns sticky), the kanban's steps sit in two rows (1 above 2, 3 above 4, ...) and scroll inside */
.page > #flow-content, .page > #object-content, .page > #delta-content { flex: 0 0 auto; display: flex; flex-direction: column; height: calc(100vh - 245px - var(--topbar-h)); min-height: 420px; }
/* on a desktop a page with such a list is exactly the window's height and the list takes all that is left, whatever
   is above it: no page scroll, no gap below (the table scrolls inside its frame). Phones keep the fixed height above. */
@media (min-width: 761px) {
  main:has(#flow-content, #object-content, #delta-content) { height: calc(100vh - var(--topbar-h)); min-height: 0; padding-bottom: 20px; }
  main:has(#flow-content, #object-content, #delta-content) > .loader,
  main:has(#flow-content, #object-content, #delta-content) .page { min-height: 0; }
  .page > #flow-content, .page > #object-content, .page > #delta-content { flex: 1 1 auto; height: auto; min-height: 320px; }
  /* more room for the list: the toolbar sits on the title's row (right), the rows count and the pager share a row */
  .page:has(> .flow-toolbar) {
    display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    column-gap: 24px; align-items: end;
  }
  .page:has(> .flow-toolbar) > .flow-toolbar { justify-content: flex-end; margin-bottom: 0; }
  .page:has(> .flow-toolbar) > .loader { grid-column: 1 / -1; align-self: stretch; }
  .page:has(> .flow-toolbar) > #dash-content { grid-column: 1 / -1; align-self: stretch; margin-top: 16px; }
  :is(#flow-content, #object-content, #delta-content):has(> .pager) {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 24px;
  }
  :is(#flow-content, #object-content, #delta-content) > .grid-head:has(+ .pager) { margin: 0; align-self: center; }
  :is(#flow-content, #object-content, #delta-content) > .grid-head + .pager { margin: 0; align-self: center; }
  :is(#flow-content, #object-content, #delta-content) > .pager + .table-wrap { grid-column: 1 / -1; }
}
.table-fill { flex: 1; min-height: 0; overflow: auto; }
.kanban {
  flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-flow: column;
  grid-auto-columns: 280px; gap: 12px; overflow-x: auto; padding-bottom: 8px;
}
.kanban-col {
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
  padding: 10px; border-radius: var(--radius); background: var(--c-primary); border: 1px solid var(--c-line);
}
.kanban-col > .loader { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.kanban-head { margin: 0; font-size: .95rem; }
.kanban-count { margin: 0; font-size: .8rem; }
.kanban-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  padding: 10px 12px; border-radius: 8px; background: var(--c-secondary); border: 1px solid var(--c-line);
}
.kanban-card.row-open { cursor: pointer; user-select: none; }
.kanban-card.row-open:hover { border-color: var(--c-line-strong); }
.kanban-card:focus-visible { outline: 2px solid var(--c-highlight); outline-offset: 1px; }
.kanban-title { margin: 0; font-weight: 600; }
.kanban-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kanban-assigned { font-size: .82rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kanban-assigned.is-none { font-style: italic; }
/* the ticket's description: three lines at most, the whole text on hover */
.kanban-desc { margin: 6px 0 0; font-size: .86rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.kanban-card dl { margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; }
.kanban-card dl div { display: flex; gap: 6px; }
.kanban-card dt { color: var(--c-muted); }
.kanban-card dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-pager { display: flex; gap: 6px; }

/* dragging a card: the columns it may go to light up, the rest dim */
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.is-dragging { opacity: .5; }
.kanban-col.drop-ok { border-color: var(--c-highlight); box-shadow: inset 0 0 0 1px var(--c-highlight); }
.kanban-col.drop-over { background: var(--c-highlight-tint); }
.kanban-col.drop-no { opacity: .45; }
.move-dialog {
  min-width: 280px; max-width: calc(100vw - 32px); padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--c-line-strong); background: var(--c-primary); color: var(--c-text);
}
.move-dialog::backdrop { background: rgba(0, 0, 0, .5); }
.move-dialog h2 { margin: 0 0 12px; font-size: 1rem; }
.move-dialog .btn { display: flex; width: 100%; margin-top: 8px; }

/* a flow instance: the header (facts, Assign, Move) and the Input tab */
.instance { display: flex; flex-direction: column; gap: 16px; }
.instance-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 32px; }
.instance-facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0; }
.instance-facts div { display: flex; flex-direction: column; gap: 2px; }
.instance-facts dt { color: var(--c-muted); font-size: .8rem; }
.instance-facts dd { margin: 0; font-weight: 600; }
.pill-step { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--c-highlight); color: var(--c-on-highlight); }
.instance-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.instance-actions .field-inline { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.instance-actions select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-secondary); color: var(--c-text); max-width: 260px;
}
.instance-input { display: flex; flex-direction: column; gap: 16px; }
.step-note p { margin: 0; }
.step-note p + p { margin-top: 6px; }
.input-group { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--c-line); border-radius: var(--radius); }
.input-group legend { padding: 0 6px; font-weight: 600; }
.raw-reply pre { max-height: 360px; overflow: auto; padding: 12px; border-radius: 8px; background: var(--c-primary); border: 1px solid var(--c-line); font-size: .8rem; }

/* a flow list's Assigned and Move cells */
.table td.no-open select {
  width: 100%; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--c-line); background: var(--c-secondary); color: var(--c-text);
}
.table td.no-open select:disabled { opacity: .55; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note { display: flex; flex-direction: column; gap: 6px; }
.note-meta { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.note-text { white-space: pre-wrap; }
.note-edit summary { cursor: pointer; color: var(--c-muted); font-size: .85rem; }
.note-edit[open] summary { margin-bottom: 8px; }
.grid-head .btn { margin-left: auto; }

@media (max-width: 760px) {
  .field-grid { grid-template-columns: 1fr; }
}

/* ---- dashboards ---- */

/* charts and tables take the whole row, one under the other (their text is drawn at a fixed size); tiles and donuts
   between them sit side by side in a .dash-grid (board.php groups them) */
.dash-board { display: flex; flex-direction: column; gap: 16px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.dash-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-card-head h2 { font-size: 1rem; }
.dash-card .table-wrap { background: transparent; }
/* on a tablet or desktop the dashboard is exactly the window's height, as a flow's list: a table that ends it takes
   all that is left and scrolls inside its frame (header sticky); a table above another item is at most a window
   high; a dashboard taller than the window scrolls below the picker */
@media (min-width: 761px) {
  main:has(#dash-content) { height: calc(100vh - var(--topbar-h)); min-height: 0; padding-bottom: 20px; }
  main:has(#dash-content) > .loader, main:has(#dash-content) .page { min-height: 0; }
  .page:has(> .flow-toolbar) > #dash-content { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  .dash-board { flex: 1 0 auto; }
  .dash-board > .dash-table:last-child { flex: 1 1 0; min-height: 320px; }
  .dash-table > .loader:not([aria-busy="true"]) { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  .dash-table .table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
  .dash-board > .dash-table:not(:last-child) .table-wrap { max-height: calc(100vh - var(--topbar-h) - 200px); }
}
.tiles { display: flex; flex-direction: column; gap: 6px; }
.tile-label { color: var(--c-muted); font-size: .85rem; }
.tile-values { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.tile-value { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.as-table summary { cursor: pointer; color: var(--c-muted); font-size: .85rem; }
.as-table[open] summary { margin-bottom: 8px; }

/* ---- charts (framework/Chart.php draws them; these give the marks their colours) ---- */

.chart { display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.chart-donut { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; overflow-x: visible; }
/* never scaled below legible: on a narrow screen the chart scrolls inside its card instead */
.chart-svg { display: block; width: 100%; min-width: 520px; max-width: 960px; height: auto; overflow: visible; }
.chart-svg.donut { width: 200px; min-width: 0; max-width: 60%; }
.chart-svg text { fill: var(--c-muted); font: 11px var(--font-sans); }
.chart-svg .value { fill: var(--c-text); font-weight: 600; }
.chart-svg .total { font-size: 22px; }
.chart-svg .axis-title { fill: var(--c-muted); font-size: 12px; }
.chart-svg .grid { stroke: var(--c-grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--c-axis); stroke-width: 1; }
.chart-svg .trend { fill: none; stroke: var(--c-highlight); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .dot { stroke: var(--c-primary); stroke-width: 2; }
.chart-svg .hit { fill: transparent; }
.chart-svg .slice { stroke: var(--c-primary); stroke-width: 2; }
.chart-svg .mark { cursor: default; outline: none; }
.chart-svg path.mark:hover, .chart-svg path.mark:focus-visible { opacity: .8; stroke: var(--c-text); stroke-width: 1.5; }
.chart-svg .hit:hover, .chart-svg .hit:focus-visible { fill: var(--c-hover-tint); }
.s0 { fill: var(--c-highlight); }
.s1 { fill: var(--c-series-1); } .s2 { fill: var(--c-series-2); } .s3 { fill: var(--c-series-3); } .s4 { fill: var(--c-series-4); }
.s5 { fill: var(--c-series-5); } .s6 { fill: var(--c-series-6); } .s7 { fill: var(--c-series-7); } .s8 { fill: var(--c-series-8); }
.so { fill: var(--c-series-other); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; }
.chart-donut .legend { flex-direction: column; flex: 1; min-width: 180px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend strong { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.swatch.s0 { background: var(--c-highlight); } .swatch.s1 { background: var(--c-series-1); } .swatch.s2 { background: var(--c-series-2); }
.swatch.s3 { background: var(--c-series-3); } .swatch.s4 { background: var(--c-series-4); } .swatch.s5 { background: var(--c-series-5); }
.swatch.s6 { background: var(--c-series-6); } .swatch.s7 { background: var(--c-series-7); } .swatch.s8 { background: var(--c-series-8); }
.swatch.so { background: var(--c-series-other); }

/* the one tooltip msp.js moves to the hovered or focused mark: value first, then the label */
.tip {
  position: fixed; z-index: 30; pointer-events: none; max-width: 280px;
  padding: 8px 10px; border-radius: 8px; background: var(--c-primary); border: 1px solid var(--c-line-strong);
  box-shadow: 0 6px 18px var(--c-shadow); font-size: .85rem;
}
.tip strong { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.tip span { color: var(--c-muted); }

/* ---- login ---- */

/* ---- project setup ---- */

.setup { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 20px; align-items: start; }
.setup-types { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.setup-types-head, .setup-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setup-types h2, .setup-list h3 { margin: 0; font-size: 1rem; }
.setup-types .setup-shared-head { margin-top: 8px; font-size: .85rem; color: var(--c-muted); }
.setup-type-list, .setup-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.setup-type-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--c-text); }
.setup-type-list a:hover { background: var(--c-hover-tint); }
.setup-type-list a[aria-current="page"] { background: var(--c-hover-tint); box-shadow: inset 3px 0 0 var(--c-highlight); }
.setup-type-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.setup-main, .setup-type { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.setup-form:empty { display: none; }
.setup-edit h2 { margin: 0; font-size: 1rem; }
.setup-type-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.setup-type-title { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.setup-type-title h2 { margin: 0; font-size: 1.15rem; }
.setup-type-title p { margin: 4px 0 0; }
.setup-actions, .setup-row-actions { display: flex; gap: 8px; flex: none; }
.setup-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.setup-list { display: flex; flex-direction: column; gap: 10px; }
.setup-rows li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--c-line); }
.setup-rows li:last-child { border-bottom: 0; }
.setup-row-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.color-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-field input[type="color"] { width: 56px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-secondary); cursor: pointer; }
.color-none { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--c-muted); cursor: pointer; }
.swatch-lg { width: 22px; height: 22px; border-radius: 6px; margin-top: 3px; }
.swatch-none { border: 1px dashed var(--c-line-strong); }
.state-error-text { margin: 0; color: var(--c-highlight); }
@media (max-width: 760px) {
  .setup { grid-template-columns: 1fr; }
  .setup-types { position: static; }
}

/* ---- projects ---- */

.project-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.project-group-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.projects-table td { white-space: nowrap; }
.projects-table td:nth-child(2) { white-space: normal; min-width: 220px; }
/* a requirement's parts, indented under it (tab-requirements.php: tree-1 .. tree-4) */
.projects-table .tree-1 { padding-left: 28px; }
.projects-table .tree-2 { padding-left: 46px; }
.projects-table .tree-3 { padding-left: 64px; }
.projects-table .tree-4 { padding-left: 82px; }
.tree-mark { color: var(--c-muted); margin-right: 4px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--c-secondary); color: var(--c-text); font-size: .85rem; }
.pill-unknown { background: transparent; border: 1px dashed var(--c-line-strong); color: var(--c-muted); }
.progress { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 3px; background: var(--c-secondary); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--c-highlight); }
.project-commercial summary { cursor: pointer; color: var(--c-muted); padding: 4px 0; }
.project-commercial[open] summary { margin-bottom: 12px; }
.project-description { margin: 0; }
.toolbar-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* a project's Overview and its record pages */
.project-overview, .record-page { display: flex; flex-direction: column; gap: 16px; }
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.kpi p { margin: 0; }
.kpi-label { color: var(--c-muted); font-size: .8rem; }
.kpi-value { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: .8rem; }
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.check-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.check-list label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-list input { width: 16px; height: 16px; accent-color: var(--c-highlight); flex: none; }
.tag-warn { border-color: var(--c-highlight); color: var(--c-highlight); }
.setup-rows .progress { flex: none; }

/* ---- agents ---- */

.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.agents { display: flex; flex-direction: column; gap: 16px; }
.agent-new h2 { margin: 0 0 12px; font-size: 1rem; }
.agent-new-fields { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.agent-new-fields .field { flex: 1 1 240px; min-width: 0; margin: 0; }
.agent-new-fields .field :is(input, select) { width: 100%; min-width: 0; text-overflow: ellipsis; }
.agent-new-fields .form-actions { margin: 0; }
.agent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 16px; }
.agent { display: flex; flex-direction: column; gap: 12px; }
.agent-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.agent-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.agent-title h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.agent-actions { display: flex; gap: 8px; }
.key-slot:empty { display: none; }
.key-panel { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--c-line); }
.key-panel p { margin: 0; font-size: .8rem; }
.key-line { display: flex; gap: 8px; }
.key-line input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--c-line); background: var(--c-secondary); color: var(--c-text); }

.login-body { display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.login .brand { justify-content: center; }
.login .version { text-align: center; color: var(--c-muted); font-size: .8rem; }

@media (max-width: 760px) {
  .field-inline input { min-width: 0; width: 100%; }
  .field-inline { flex: 1; }
  .flow-toolbar select { max-width: none; flex: 1; }
  .segmented { margin-left: 0; }
  .kanban { grid-auto-columns: 85vw; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 10px; }
}

/* ---- a project's quick add (projectrecords/quick.php) and plan (projects/plan.php, plan.js) ---- */

.setup-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-form { border-color: var(--c-highlight); box-shadow: 0 0 0 3px var(--c-highlight-tint); gap: 12px; }
.quick-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.quick-head h3 { margin: 0; font-size: 1rem; }
.quick-head .muted { font-size: .85rem; }
.quick-grid { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
.plan-side .quick-form { border: 0; box-shadow: none; padding: 0; }
.plan-side .quick-grid { grid-template-columns: minmax(0, 1fr); }

.plan-page { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.plan-bar-gap { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--c-line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--c-muted); padding: 7px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--c-line); }
.seg button:hover { color: var(--c-text); }
.seg button[aria-pressed="true"] { background: var(--c-highlight-tint); color: var(--c-text); font-weight: 600; }
.plan-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .82rem; }
.plan-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.plan-key-milestone { width: 0; height: 14px; border-left: 2px dashed var(--c-highlight); }
.plan-key-today { width: 0; height: 14px; border-left: 2px solid var(--c-text); }
.plan { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; flex: 1; min-height: 0; }
.plan-frame { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.plan-empty { margin: 0; padding: 20px; }
.plan-gantt { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.plan-gantt .gantt-container { flex: 1 1 auto; height: auto; min-height: 0; } /* fills the frame; scrolls inside it */
.plan-unscheduled { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--c-line); font-size: .88rem; }
.plan-side { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.plan-side:empty::before { content: "Click a bar to see its task."; color: var(--c-muted); }
.plan-task { display: flex; flex-direction: column; gap: 14px; }
.plan-task-head { display: flex; flex-direction: column; gap: 6px; }
.plan-task-head h2 { margin: 0; font-size: 1.1rem; }
.plan-task-code { color: var(--c-highlight); }
.plan-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
.plan-facts dt { color: var(--c-muted); }
.plan-facts dd { margin: 0; }
.plan-task section { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--c-line); }
.plan-task h3 { margin: 0; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.plan-task p { margin: 0; }
.plan-req { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 8px; background: var(--c-well); border: 1px solid var(--c-line); }
.plan-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-people li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.plan-remove { width: 28px; height: 28px; flex: none; font-size: 1.1rem; }
.plan-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-add select {
  flex: 1 1 160px; min-width: 0; min-height: 28px; padding: 3px 8px; border-radius: 8px; font: inherit; font-size: .85rem;
  border: 1px solid var(--c-line-strong); background: var(--c-well); color: var(--c-text);
}
.plan-add select:focus { border-color: var(--c-highlight); outline: none; box-shadow: 0 0 0 2px var(--c-highlight-tint); }
.plan-add .field-error { flex-basis: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--c-line); background: var(--c-well); color: var(--c-text); font-size: .84rem;
}
.chip:hover { border-color: var(--c-highlight); }
.chip .mono { color: var(--c-muted); }
@media (min-width: 761px) {
  main:has(#plan-content) { height: calc(100vh - var(--topbar-h)); min-height: 0; padding-bottom: 20px; }
  main:has(#plan-content) > .loader, main:has(#plan-content) .page { min-height: 0; }
}
@media (max-width: 1100px) {
  .plan { grid-template-columns: minmax(0, 1fr); }
  .plan-frame { min-height: 420px; }
}

/* Frappe Gantt (css/frappe-gantt.css, loaded before this file) in the MSP tokens; .plan-gantt makes these win */
.plan-gantt .gantt-container {
  --g-arrow-color: var(--c-muted); --g-bar-color: var(--c-series-other); --g-bar-border: var(--c-line); --g-tick-color-thick: var(--c-axis);
  --g-tick-color: var(--c-grid); --g-actions-background: var(--c-well); --g-border-color: var(--c-line); --g-text-muted: var(--c-muted);
  --g-text-light: var(--c-text); --g-text-dark: var(--c-text); --g-progress-color: var(--c-series-other); --g-handle-color: var(--c-text);
  --g-weekend-label-color: var(--c-well); --g-expected-progress: var(--c-line); --g-header-background: var(--c-primary);
  --g-row-color: var(--c-primary); --g-row-border-color: var(--c-line); --g-today-highlight: var(--c-text); --g-popup-actions: var(--c-well);
  --g-weekend-highlight-color: var(--c-well);
  border-radius: 0; font-family: var(--font-sans);
}
.plan-gantt .gantt-container .current-upper { background: var(--c-primary); }
.plan-gantt .gantt-container .current-date-highlight { color: var(--c-primary); }
.plan-gantt .gantt-container .popup-wrapper, .plan-gantt .gantt-container .side-header, .plan-gantt .gantt-container .extras .adjust { display: none; }
.plan-gantt .gantt .bar-label { font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; }
.plan-gantt .gantt .bar-wrapper .bar { outline: 0; fill-opacity: .45; }
.plan-gantt .gantt .bar-wrapper.is-done .bar { fill-opacity: .3; }
.plan-gantt .gantt .bar-wrapper.is-selected .bar { stroke: var(--c-highlight); stroke-width: 2.5; }
.plan-gantt .gantt .bar-wrapper.is-linked .bar { stroke: var(--c-text); stroke-width: 1.2; stroke-dasharray: 3 3; }
.plan-gantt .gantt .ignored-bar { fill: url(#diagonalHatch); }
.plan-gantt .gantt .hatch-line { stroke: var(--c-line-strong); stroke-width: .3; }
.plan-gantt .gantt .ms-line { stroke: var(--c-highlight); stroke-width: 1.6; stroke-dasharray: 6 4; }
.plan-gantt .gantt .ms-flag { fill: var(--c-highlight); }
.plan-gantt .gantt .ms-code { fill: var(--c-on-highlight); font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.plan-gantt .gantt .ms-name { fill: var(--c-highlight); font-family: var(--font-sans); font-size: 11px; }

/* ---- knowledge: View Knowledge, search, Create Knowledge ---- */

.kb-entry, .kb-edit, .kb-search { display: flex; flex-direction: column; gap: 16px; }
.kb-search .kb-toolbar { margin-bottom: 0; }
.kb-search .kb-toolbar .flow-search { flex: 1 1 260px; }
.kb-search .kb-toolbar .flow-search input { width: 100%; }
.kb-count { margin: 0; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.tag-quiet { border-style: dashed; }
.kb-head-actions, .kb-rate-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 16px; align-items: start; }
.kb-sections, .kb-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kb-section h2, .kb-side h2, .kb-related h2 { margin: 0 0 8px; font-size: 1rem; }
.kb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-links { list-style: none; margin: 0 -8px; padding: 0; }
.kb-links a { padding: 6px 8px; }
.kb-links a[aria-current] { color: var(--c-text); box-shadow: inset 3px 0 0 var(--c-highlight); }
.kb-links .count { margin-left: auto; }
.kb-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.kb-change textarea { width: 100%; }
.kb-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-remove { text-decoration: none; color: var(--c-text); }
.kb-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kb-card { display: flex; flex-direction: column; gap: 8px; height: 100%; min-width: 0; text-decoration: none; color: var(--c-text); }
.kb-card:hover { border-color: var(--c-line-strong); color: var(--c-text); }
/* the code and the name as one line ("KBE-3 Accounting"); a long name is cut off, the whole of it in the tooltip */
.kb-card-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-hit-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-snippet { color: var(--c-muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.kb-form { gap: 16px; }
.kb-note { margin: 0; padding: 12px 16px; border-left: 3px solid var(--c-highlight); }
/* Knowledge > Publishing */
.kp { display: flex; flex-direction: column; gap: 16px; }
.kp-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kp-card h2 { margin: 0; font-size: 1rem; }
.kp-card > p { margin: 0; }
.kp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kp-form { display: flex; flex-direction: column; gap: 12px; }
.kp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.kp-fields .field { margin: 0; }
.kp-fields .kp-wide { grid-column: 1 / -1; }
.kp-fields textarea { width: 100%; min-height: 96px; resize: vertical; }
.kp-note { margin: 0; font-size: .85rem; }
.kp-groups { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.kp-groups legend { padding: 0 6px; font-weight: 600; }
.kp-groups label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.kp-groups input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-highlight); }
.kp-busy { display: none; align-self: center; }
.kp-form.htmx-request .kp-busy { display: inline; }
.kp-result { display: flex; flex-direction: column; gap: 10px; }
.kp-result > p { margin: 0; }
.kb-fieldset { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.kb-fieldset legend { padding: 0 6px; font-weight: 600; }
.kb-check-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kb-checks { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 8px 18px; }
.kb-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.kb-checks input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-highlight); }
.kb-related-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.kb-related-add .field { flex: 1; min-width: 220px; }

.kb-md { overflow-wrap: anywhere; }
.kb-md > * + * { margin-top: 10px; }
.kb-md h3, .kb-md h4, .kb-md h5, .kb-md h6 { margin: 16px 0 6px; font-size: 1rem; }
.kb-md h3 { font-size: 1.05rem; }
.kb-md p, .kb-md ul, .kb-md ol, .kb-md blockquote, .kb-md pre { margin: 0; }
.kb-md ul, .kb-md ol { padding-left: 22px; }
.kb-md li + li { margin-top: 4px; }
.kb-md a { color: var(--c-highlight); }
.kb-md code { font-family: var(--font-mono); font-size: .9em; padding: 1px 5px; border-radius: 4px; background: var(--c-hover-tint); }
.kb-md pre { padding: 10px 12px; border-radius: var(--radius); background: var(--c-secondary); border: 1px solid var(--c-line); overflow-x: auto; }
.kb-md pre code { padding: 0; background: none; }
.kb-md blockquote { padding-left: 12px; border-left: 3px solid var(--c-line-strong); color: var(--c-muted); }
.kb-md hr { border: 0; border-top: 1px solid var(--c-line); }

.md-editor { display: flex; flex-direction: column; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.md-editor:focus-within { border-color: var(--c-highlight); }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--c-line); background: var(--c-primary); }
.md-btn { min-width: 32px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--c-muted); cursor: pointer; font-size: .85rem; }
.md-btn:hover:not(:disabled) { background: var(--c-hover-tint); color: var(--c-text); }
.md-btn:disabled { opacity: .4; cursor: default; }
.md-bold { font-weight: 700; }
.md-italic { font-style: italic; }
.md-code { font-family: var(--font-mono); }
.md-preview-toggle { margin-left: auto; }
.md-preview-toggle[aria-pressed="true"] { color: var(--c-text); background: var(--c-hover-tint); }
.field .md-editor textarea { border: 0; border-radius: 0; resize: vertical; min-height: 9em; box-shadow: none; }
.md-preview { min-height: 9em; padding: 10px 12px; }

@media (max-width: 760px) {
  .kb-layout, .kb-check-groups, .kp-pair, .kp-fields { grid-template-columns: 1fr; }
}
