/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* Design statuses (designStatus.ts), the same in every area */

.design-status-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.design-status {
  display: inline-block;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.design-status-select {
  cursor: pointer;
  padding-right: 4px;
}

.design-status-new {
  background: #fff4d6;
  color: #7a5200;
  border-color: #f1d48a;
}

.design-status-imported {
  background: #eef0f2;
  color: #4a5862;
  border-color: #d4d9de;
}

.design-status-in-progress {
  background: #fff1e0;
  color: #8a4b00;
  border-color: #f4c98f;
}

.design-status-ready {
  background: #e3f4e8;
  color: #1d6b35;
  border-color: #a8d8b5;
}

.design-status-implemented {
  background: #e6f0fb;
  color: #1659a8;
  border-color: #a9c9ee;
}

/* The start page of each area: what's being worked on, as a table */
.area-home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.area-home > h2 {
  margin: 0 0 4px;
}

.area-home-intro {
  margin: 0 0 16px;
}

.area-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 0 0 20px;
}

.area-home-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 6px);
  overflow: hidden;
}

.area-home-table th,
.area-home-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.area-home-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-bg);
}

.area-home-table tr:last-child td {
  border-bottom: none;
}

.area-home-table td.area-home-open {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.area-home-name {
  font-weight: 600;
}

.area-home-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.area-home-filter button {
  font: inherit;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
}

.area-home-filter button.active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Back to an area's start page */
.area-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Each area opened stays as it was left: shown as if it weren't wrapped, or hidden */
.area-pane {
  display: contents;
}

.area-pane[hidden] {
  display: none;
}

/* Forms, with a helpline open: the way back to the start page */
.area-back-bar {
  padding: 8px 24px 0;
}

/* The filters above a start page table: helpline, then status */
.area-home-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
}

.area-home-filters .area-home-filter {
  margin: 0;
}

.area-home-helpline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.area-home-helpline select {
  font: inherit;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

/* Which branch an import reads (BranchPicker) */
.branch-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.branch-picker input {
  font: inherit;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 6px);
  width: 260px;
}

.branch-picker-warning {
  color: #8a4b00;
  font-weight: 600;
}

.branch-imported-from {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  font-size: 12px;
  color: #4527a0;
}

.branch-link {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  color: inherit;
}

/* In the workspace's bar, right before its main button */
.branch-imported-from-inline {
  display: inline-flex;
  margin: 0 0 0 auto;
  white-space: nowrap;
}

.action-bar .branch-imported-from-inline + .primary-button {
  margin-left: 0;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/*
 * The look of Aselo's contact form, copied from plugin-hrm-form:
 *   styles/HrmTheme.ts, styles/HrmStyles.tsx, styles/layout.tsx, styles/buttons.tsx,
 *   components/forms/components/** /styles.tsx, components/tabbedForms/styles.tsx
 * Everything is scoped under .aselo so it can't leak into the configurator's own UI.
 * When the plugin's styles change, update the matching rule here.
 */

.aselo-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aselo-preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.aselo-preview-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.aselo-preview-controls select {
  font: inherit;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.aselo-preview-invalid {
  color: #cb3232;
  margin: 0;
}

.aselo {
  /* Flex's CRM area behind the tabs (HrmTheme colors.base2) */
  background: #f6f6f6;
  font-family: 'Open Sans', sans-serif;
  color: #222222;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.aselo *,
.aselo *::before,
.aselo *::after {
  box-sizing: border-box;
}

/* TabbedFormsTabs header (HeaderControlButtons): back button, then the contact's number and queue */
.aselo-contact-header {
  margin: 10px 0 5px;
  padding-left: 20px;
  flex-shrink: 0;
}

/* SearchResultsBackButton / BackText */
.aselo-back-button {
  display: flex;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #192b33;
  cursor: pointer;
}

.aselo-back-button span {
  margin-left: 15px;
}

.aselo-back-button:hover {
  background-color: #f2f2f2;
}

/* FontOpenSans with Bold, then OpaqueText */
.aselo-contact-id {
  margin: 0;
  padding: 3px 0 0 9px;
  color: #000000;
  font-size: 14px;
}

.aselo-queue-name {
  font-style: italic;
  font-size: 12px;
  opacity: 0.7;
}

/* StyledTabs / StyledTab / StyledSearchTab */
.aselo-tabs {
  display: flex;
  height: 35px;
  padding: 0 7%;
  flex-shrink: 0;
}

/* Tabs' scroller: scrolls without showing a scrollbar */
.aselo-tabs-scroller {
  display: flex;
  flex: 1 1 auto;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.aselo-tabs-scroller::-webkit-scrollbar {
  display: none;
}

/* TabScrollButton */
.aselo-tab-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
}

.aselo-tab-scroll.disabled {
  opacity: 0;
  pointer-events: none;
}

.aselo-tab {
  height: 35px;
  min-width: 120px;
  width: 120px;
  margin: 0 5px 0 0;
  padding: 0;
  border: none;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  background-color: #ecedf1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.87);
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aselo-tab:hover {
  background-color: #c9c9c9;
}

.aselo-tab.selected {
  background-color: #ffffff;
  font-weight: 600;
  opacity: 1;
}

.aselo-search-tab {
  min-width: 40px;
  width: 40px;
  background-color: transparent;
  color: #606471;
}

/* FormTab: the Material error icon in red above the label */
.aselo-tab-error {
  display: inline-flex;
  height: 10px;
  color: red;
}

/* TabbedFormTabContainer */
.aselo-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 20px 12px 20px;
  background-color: #ffffff;
  min-height: 300px;
}

/* TwoColumnLayout / ColumnarBlock / ColumnarContent */
.aselo-two-columns {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding-bottom: 55px;
}

.aselo-columnar-block {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-basis: 0;
  gap: 10px;
}

.aselo-columnar-content {
  width: 217px;
}

/* createInput wraps every field in a Column with 8px above and below */
.aselo-field {
  display: flex;
  flex-direction: column;
  margin: 8px 0;
}

/* FormLabel */
.aselo-form-label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  letter-spacing: 0;
  min-height: 18px;
  color: #000000;
}

.aselo-label-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 8px;
}

.aselo-required {
  color: red;
}

/* FormInputBase (inputs, dates, times) */
.aselo-input {
  display: flex;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  line-height: 1.33;
  width: 217px;
  height: 36px;
  border-radius: 4px;
  background-color: rgba(236, 237, 241, 0.37);
  color: #222222;
  border: none;
  box-shadow: none;
  padding: 0 8px;
}

.aselo-input.has-error,
.aselo-select.has-error,
.aselo-textarea.has-error {
  border: 1px solid #cb3232;
  box-shadow: 0px 0px 0px 2px rgba(234, 16, 16, 0.2);
}

.aselo-input:focus,
.aselo-input.has-error:focus {
  outline: none;
  border: 1px solid rgba(0, 59, 129, 0.37);
  box-shadow: none;
}

/* DateInput / TimeInput */
.aselo-input[type='date'],
.aselo-input[type='time'] {
  display: block;
}

.aselo-input[type='date']::-webkit-calendar-picker-indicator,
.aselo-input[type='time']::-webkit-calendar-picker-indicator {
  font-size: 20px;
  opacity: 0.8;
}

/* FormError */
.aselo-error {
  text-transform: none;
  color: #cb3232;
  font-size: 10px;
  line-height: 1.5;
}

/* FormSelectWrapper / FormSelect / FormOption */
.aselo-select-wrapper {
  position: relative;
  display: block;
  width: 217px;
  height: 36px;
}

.aselo-select-wrapper::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #666;
  position: absolute;
  right: 10px;
  top: 50%;
  pointer-events: none;
}

.aselo-select {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  width: 217px;
  height: 36px;
  line-height: 22px;
  background-color: rgba(236, 237, 241, 0.37);
  color: #222222;
  border: none;
  border-radius: 4px;
  padding: 0 7px;
  -webkit-appearance: none;
  appearance: none;
}

.aselo-option-empty {
  color: #616161;
}

/* FormTextArea */
.aselo-textarea {
  display: flex;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  line-height: 15px;
  width: 217px;
  border-radius: 4px;
  background-color: #f6f6f6;
  color: #222222;
  border: none;
  padding: 5px;
  resize: vertical;
}

.aselo-textarea:focus,
.aselo-textarea.has-error:focus {
  outline: none;
  background-color: rgba(236, 237, 241, 0.37);
  border: 1px solid rgba(0, 59, 129, 0.37);
}

/* FormCheckBoxWrapper / CheckboxBase / FormCheckbox / FormMixedCheckbox */
.aselo-checkbox-wrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-height: 36px;
  border-radius: 4px;
  font-size: 14px;
  color: #000000;
  cursor: default;
}

.aselo-checkbox-wrapper.has-error {
  border: 1px solid #cb3232;
  box-shadow: 0px 0px 0px 2px rgba(234, 16, 16, 0.2);
}

.aselo-checkbox-box {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin: 3px 10px 0 2px;
  border: 1px solid hsl(0, 0%, 66%);
  border-radius: 0.2em;
  background-image: linear-gradient(to bottom, hsl(300, 3%, 93%), #fff 30%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.aselo-checkbox-box.is-yes {
  border-color: #1976d2;
  background: #1976d2;
}

.aselo-checkbox-box.is-no {
  border-color: #d13821;
  background: #d13821;
}

.aselo-mixed-button {
  padding: 0;
  border: none;
  background: none;
  cursor: default;
  display: inline-flex;
}

.aselo-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* FormListboxMultiselect */
.aselo-listbox {
  display: flex;
  flex-direction: column;
  border-radius: 4px;
}

.aselo-listbox.has-error .aselo-listbox-options {
  border-color: #cb3232;
}

.aselo-listbox .aselo-label-row {
  font-size: 14px;
  color: #000000;
}

.aselo-listbox-options {
  display: flex;
  flex-direction: column;
  padding-left: 10px;
  padding-top: 10px;
  overflow-y: scroll;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  flex: 1;
}

.aselo-listbox-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  font-size: 14px;
  color: #000000;
  margin-bottom: 5px;
}

/* FormFieldset / FormRadioInput */
.aselo-fieldset {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 4px;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: #000000;
}

.aselo-fieldset.has-error {
  border: 1px solid #cb3232;
}

.aselo-radio-option {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.aselo-radio {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: content-box !important;
  padding: 0;
  margin: 0 7px 0 0;
  width: 12px;
  height: 12px;
  border: 2px solid #080808;
  background-color: rgba(236, 237, 241, 0.37);
  border-radius: 50%;
  display: grid;
  place-content: center;
}

.aselo-radio:checked::after {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  content: '';
  background-color: #080808;
}

/* SearchInput */
.aselo-search {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
}

/* FormInputDescription */
.aselo-description {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: #fffeef;
  width: 217px;
  padding: 16px;
  margin: 24px 0 8px 0;
  color: #192b33;
  font-size: 13px;
}

.aselo-description-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aselo-link {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: #1874e1;
  font: inherit;
  cursor: pointer;
}

.aselo-custom-component {
  font-size: 12px;
  color: #606471;
  border: 1px dashed #c6cad7;
  border-radius: 4px;
  padding: 8px;
  width: 217px;
}

/* Buttons (AseloBaseButton) and BottomButtonBar */
.aselo-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 55px;
  flex-shrink: 0;
  padding: 5px 20px;
  /* A divider line inset from the panel edges, as in Aselo */
  background: linear-gradient(#e1e3ea, #e1e3ea) 20px 0 / calc(100% - 40px) 1px no-repeat, #ffffff;
}

.aselo-button {
  display: inline-flex;
  align-items: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25rem;
  /* Flex's MuiButton-contained padding wins over the plugin's 4px 10px */
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.aselo-button-primary {
  background-color: #192b33;
  color: #ffffff;
}

.aselo-button-primary:hover {
  background-color: #2a4551;
}

.aselo-button-secondary {
  background-color: #ecedf1;
  color: #111111;
}

.aselo-button-destructive {
  background-color: #d61f1f;
  color: #ffffff;
}

.aselo-button-destructive:hover {
  background-color: #b41c1c;
}

.aselo-add-case {
  position: relative;
  margin-right: 7px;
}

.aselo-add-case .aselo-button {
  padding: 2px 8px;
  height: 36px;
}

.aselo-add-case-label {
  margin: 0 10px;
}

.aselo-add-case-menu {
  position: absolute;
  right: -12%;
  bottom: 110%;
  z-index: 10;
  width: 164px;
  margin: 0 20px 0 0;
  padding: 10px 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #e1e3ea;
  border-radius: 8px;
  box-shadow: 0px 4px 16px 0px rgba(18, 28, 45, 0.2);
}

.aselo-add-case-menu button {
  display: flex;
  width: 100%;
  padding: 7px 0 7px 18px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}

.aselo-add-case-menu button:hover {
  background-color: #f2f2f2;
}

.aselo-file-button {
  align-self: flex-start;
  cursor: default;
}

/* Issue categorization (IssueCategorizationSectionForm, Section, CategoryCheckboxes) */
.aselo-categories {
  padding-bottom: 55px;
}

.aselo-category-title {
  margin: 0 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.aselo-category-subtitle {
  display: flex;
  align-items: center;
  margin: 6px 0;
  gap: 4px;
}

.aselo-category-required {
  flex-grow: 1;
  font-size: 12px;
  color: #222222;
  margin-left: 10px;
}

.aselo-category-required::before {
  content: '* ';
  color: #cb3232;
}

.aselo-toggle-view {
  display: inline-flex;
  width: 37px;
  height: 37px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 1px;
  font-size: 18px;
  background-color: #a0a8bdcc;
  opacity: 0.2;
  cursor: pointer;
}

.aselo-toggle-view.active {
  border: 1px solid #a0a8bd33;
  color: #000000cc;
  background-color: initial;
  opacity: 1;
}

.aselo-category {
  margin-bottom: 6px;
}

.aselo-section-title {
  background-color: #ecedf1;
  padding: 8px 25px 8px;
  margin: 2px 0;
}

.aselo-section-button {
  align-items: center;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 13px;
  color: #192b33;
  cursor: pointer;
}

.aselo-subcategories {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  padding: 10px 0 10px 6px;
}

.aselo-subcategories.grid {
  flex-direction: row;
}

.aselo-category-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 4px 4px 4px 0;
  width: fit-content;
  height: 34px;
  border: 1px solid;
  border-radius: 2px;
  padding-right: 15px;
  font-size: 12px;
  color: #192b33;
  cursor: pointer;
}

.aselo-category-chip.disabled {
  border-color: #a0a8bd14;
  background-color: #a0a8bd14;
  cursor: initial;
}

.aselo-chip-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin: 0 10px;
  border: 1px solid hsl(0, 0%, 66%);
  border-radius: 0.2em;
  background-image: linear-gradient(to bottom, hsl(300, 3%, 93%), #fff 30%);
  color: #000000;
  font-size: 9px;
  font-weight: 900;
}

/* Call type screen (components/callTypeButtons/styles.tsx) */
.aselo-call-types {
  width: 300px;
  margin: 75px auto auto auto;
}

.aselo-call-types-group {
  margin-bottom: 29px;
}

.aselo-call-types-label {
  text-transform: uppercase;
  margin: 0 0 10px;
  font-weight: 700;
  color: #192b33;
  font-size: 10px;
  letter-spacing: 1.25px;
  line-height: 12px;
}

.aselo-data-call-type {
  display: flex;
  align-items: center;
  width: 300px;
  height: 44px;
  margin: 0 0 10px 0;
  padding: 0 0 0 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: #1d2e36;
  border-radius: 4px;
  background-color: #d1e3f6;
  border: none;
  cursor: pointer;
}

.aselo-data-call-type:hover {
  background-color: #7fa3cb;
}

.aselo-call-type-icon {
  display: inline-flex;
  justify-content: center;
  width: 50px;
  margin-right: 5px;
}

.aselo-call-type-face-overlap {
  display: inline-flex;
  margin-right: -5px;
}

/* SilentText */
.aselo-silent-text {
  background-color: #f0f1f4;
  color: #404c52;
  padding: 2px 10px;
  border-radius: 2px;
}

.aselo-non-data-call-type {
  width: 140px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: #1d2e36;
  border-radius: 4px;
  background-color: #ecedf1;
  border: none;
  cursor: pointer;
}

.aselo-non-data-call-type.left {
  margin-right: 20px;
}

.aselo-non-data-call-type:hover {
  background-color: #b1b6c0;
}

.aselo-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Material UI's Dialog paper, 360px wide (CloseTaskDialog), and NonDataCallTypeDialogContainer */
.aselo-dialog {
  width: 360px;
  padding: 5px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14),
    0px 9px 46px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Open Sans', sans-serif;
}

/* CloseButton: Material UI's IconButton with the clear icon */
.aselo-dialog-close {
  display: inline-flex;
  margin-left: auto;
  padding: 12px;
  border: none;
  border-radius: 50%;
  background: none;
  color: rgba(0, 0, 0, 0.54);
  cursor: pointer;
}

.aselo-dialog-close:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

/* CloseTaskDialogText */
.aselo-dialog-text {
  margin: 14px 0 36px;
  font-size: 14px;
  font-weight: 700;
}

.aselo-dialog-buttons {
  display: flex;
  margin-bottom: 32px;
}

/* CloseDialogButton, ConfirmButton and CancelButton */
.aselo-dialog-button {
  height: 28px;
  padding: 0 16px;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.aselo-dialog-confirm {
  color: #ffffff;
  background: #d32f2f;
}

.aselo-dialog-confirm:hover {
  background: #d32f2fcc;
}

.aselo-dialog-cancel {
  margin-left: 30px;
  color: #000000;
  background: #ffffff;
}

.aselo-dialog-cancel:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* FormSelectWrapper / FormSelect with fullWidth */
.aselo-select-wrapper.aselo-select-full,
.aselo-select.aselo-select-full {
  width: 100%;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/*
 * The Flex agent desktop around the contact form, modelled on a saved copy of the Aselo
 * agent desktop (Flex UI 2 with plugin-hrm-form's global-overrides.css).
 */

.flex-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #f6f6f6;
}

/* The configurator's own controls, above the mock-up */
.flex-preview-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 16px;
  background: var(--color-header);
  color: var(--color-header-text);
  font-size: 13px;
}

.flex-preview-note {
  opacity: 0.75;
}

.flex-preview-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flex-preview-bar select {
  font: inherit;
  padding: 3px 6px;
  border-radius: 4px;
}

.flex-preview-ok {
  color: #7be0a0;
  font-weight: 600;
}

.flex-preview-invalid {
  color: #ffb4a8;
  font-weight: 600;
}

.flex-preview-close {
  margin-left: auto;
  font: inherit;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  background: #ffffff;
  color: var(--color-header);
  cursor: pointer;
}

/* Flex itself */
.flex-desktop {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Open Sans', sans-serif;
  color: #121c2d;
  background: #f6f6f6;
}

.flex-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  flex-shrink: 0;
  padding: 0 16px;
  margin-bottom: 5px;
  background: #f6f6f6;
}

.flex-header-icon {
  display: inline-flex;
  color: #121c2d;
}

.flex-logo {
  height: 40px;
}

.flex-header-spacer {
  flex: 1;
}

.flex-activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 4px;
  background: #ffffff;
  font-size: 15px;
}

.flex-activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #14b053;
}

.flex-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #cacdd8;
  color: #121c2d;
  font-size: 14px;
  font-weight: 600;
}

.flex-main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.flex-sidenav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 60px;
  flex-shrink: 0;
  padding-top: 8px;
  margin-right: 5px;
  background: #f6f6f6;
}

.flex-sidenav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  color: #121c2d;
}

.flex-sidenav-link.active {
  background: #e4e6e7;
}

/* "Contacts waiting" (the plugin's queues panel) */
.flex-queues {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #f6f6f6;
}

.flex-queues-title {
  margin: 0;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 400;
}

.flex-queues-list {
  background: #ffffff;
  padding: 8px 0;
}

.flex-queue {
  padding: 12px 16px;
}

.flex-queue-name {
  margin: 0 0 6px;
  font-size: 13px;
}

.flex-channel-boxes {
  display: flex;
  gap: 2px;
}

.flex-channel-box {
  text-align: center;
}

.flex-channel-box p {
  margin: 4px 0 0;
  font-size: 11px;
}

.flex-channel-count {
  width: 38px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #606b85;
}

.flex-channel-calls {
  background: #e7e9ee;
}

.flex-channel-sms {
  background: #f8dbe3;
}

.flex-channel-chat {
  background: #d9eaf2;
}

.flex-wait {
  margin: 10px 0 0;
  font-size: 13px;
}

.flex-wait strong {
  margin-left: 12px;
  font-weight: 600;
}

.flex-task {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 4px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 13px;
}

.flex-task span:last-child {
  display: flex;
  flex-direction: column;
}

.flex-task small {
  color: #606b85;
}

/* TaskList SelectedContainer in the plugin's theme */
.flex-task.selected {
  border: 2px solid #56a6f6;
}

.flex-task.disabled {
  opacity: 0.3;
}

.flex-task-icon {
  display: inline-flex;
  color: #159af8;
}

/* Splitter: conversation | contact form */
.flex-splitter {
  flex: 1;
  min-width: 0;
  display: flex;
}

.flex-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flex-task-canvas {
  flex-grow: 0;
  flex-shrink: 0;
  background: #ffffff;
  min-width: 280px;
}

.flex-crm {
  flex: 1;
  min-width: 520px;
  background: #f6f6f6;
}

.flex-separator {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: #f6f6f6;
  border-left: 1px solid #e1e3ea;
}

.flex-separator:hover {
  background: #e1e3ea;
}

/* Task canvas */
.flex-canvas-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e1e3ea;
}

.flex-canvas-icon {
  display: inline-flex;
  color: #159af8;
}

.flex-canvas-title {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.flex-canvas-title small {
  color: #606b85;
  font-size: 12px;
}

.flex-end-button {
  margin-left: auto;
  padding: 3px 16px;
  border-radius: 4px;
  background: rgb(214, 31, 31);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.flex-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flex-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  gap: 4px;
}

.flex-message-counselor {
  align-self: flex-end;
  align-items: flex-end;
}

.flex-message-meta {
  font-size: 12px;
  color: #606b85;
}

.flex-message-meta strong {
  color: #121c2d;
  margin-right: 4px;
}

.flex-message-bubble {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.flex-message-contact .flex-message-bubble {
  background: #f4f4f6;
}

.flex-message-counselor .flex-message-bubble {
  background: #ebf4ff;
}

.flex-message-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 16px 16px;
  padding: 8px 8px 8px 12px;
  border: 1px solid #8891aa;
  border-radius: 4px;
}

.flex-message-placeholder {
  flex: 1;
  color: #8891aa;
  font-size: 14px;
}

/* global-overrides.css: button.Twilio-MessageInput-SendButton */
.flex-send-button {
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(216, 27, 96, 0.8);
  color: #f6f6f6;
  font-size: 13px;
  font-weight: 600;
}

.flex-call {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.flex-call-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #f4f4f6;
  color: #606b85;
}

.flex-call-name {
  font-size: 18px;
  font-weight: 600;
}

.flex-call-status {
  font-size: 13px;
  color: #606b85;
}

.flex-call-actions {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.flex-call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #8891aa;
  color: #121c2d;
}

.flex-call-hangup {
  border-color: rgb(214, 31, 31);
  background: rgb(214, 31, 31);
  color: #ffffff;
}

.flex-canned-responses {
  margin: 8px 16px 0;
}

.flex-message-draft {
  flex: 1;
  font-size: 14px;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* Translations (Aselo staff) */
.translation-languages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.translation-add-language,
.translation-add-string {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.translation-add-language input,
.translation-add-string input,
.translation-find-fields input[type='text'],
.translation-edit textarea {
  font: inherit;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.translation-add-language input {
  width: 190px;
}

.translation-toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.translation-import {
  cursor: pointer;
}

.translations-table td:first-child code {
  font-size: 12px;
}

.translation-text {
  white-space: pre-wrap;
}

.translation-badge-english {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

.translation-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.translation-edit textarea {
  width: 100%;
  resize: vertical;
}

.translation-aselo-text {
  white-space: pre-wrap;
}

.translation-edit-actions {
  display: flex;
  gap: 16px;
}

.translation-more {
  margin-top: 12px;
}

.translation-find-replace {
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.translation-find-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.translation-find-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.translation-find-fields .checkbox-label {
  flex-direction: row;
  align-items: center;
  font-weight: normal;
  font-size: 13px;
  padding-bottom: 6px;
}

.translation-replacements {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.translation-replacements li {
  display: grid;
  grid-template-columns: minmax(180px, 30%) 1fr;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.translation-replacements li:last-child {
  border-bottom: none;
}

.translation-replacements label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow-wrap: anywhere;
}

.translation-replacement-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.translation-before {
  color: var(--color-muted);
  text-decoration: line-through;
}

.translation-add-string {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.translation-add-string h3 {
  flex-basis: 100%;
  font-size: 14px;
  margin: 0;
}

.translation-add-string .field-hint {
  flex-basis: 100%;
  margin: 0;
}

.translations-panel .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* Operating hours (Aselo staff) */
.operating-hours h3 {
  font-size: 15px;
  margin: 16px 0 8px;
}

.operating-hours section > h3:first-child {
  margin-top: 0;
}

.operating-add,
.operating-timezone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.operating-hours input[type='text'],
.operating-hours input[type='date'],
.operating-hours input[type='time'],
.operating-hours select {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.operating-timezone input[type='text'] {
  width: 240px;
}

.operating-schedules {
  margin-bottom: 4px;
}

.operating-week-table th:first-child {
  width: 110px;
}

.operating-week-table th:last-child {
  width: 220px;
}

.operating-shift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.operating-overnight {
  font-size: 12px;
  color: var(--color-warning, #9a6700);
}

.operating-day-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.operating-week-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.operating-holidays {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}

.operating-holidays li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.operating-holidays li input {
  width: 280px;
}

.operating-holiday-date {
  width: 100px;
  font-variant-numeric: tabular-nums;
}

.operating-past {
  opacity: 0.55;
}

.operating-public-holidays {
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.operating-issues {
  margin: 0 0 16px;
  padding: 10px 14px 10px 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.operating-issues .issue-error {
  color: var(--color-danger, #b42318);
}

.operating-issues .issue-warning {
  color: var(--color-warning, #9a6700);
}

.operating-check-result {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-weight: 600;
  background: var(--color-bg);
}

.operating-check-result.operating-open {
  color: var(--color-success, #1a7f37);
}

.operating-check-result.operating-closed,
.operating-check-result.operating-holiday,
.operating-check-result.operating-error {
  color: var(--color-danger, #b42318);
}

/* What changes the hours: disabled (but readable) for helpline staff */
.operating-changes {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.operating-changes:disabled .operating-add,
.operating-changes:disabled .operating-day-actions,
.operating-changes:disabled .operating-week-actions,
.operating-changes:disabled .operating-public-holidays {
  display: none;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* Permissions (Aselo staff change them; helpline staff see them) */
.permissions .alert-warning {
  background: var(--color-warning-bg, #fff8e1);
  color: var(--color-warning-text, #7a5a00);
}

.permission-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.permission-issues,
.permission-changes {
  margin: 0 0 16px;
  padding: 10px 14px 10px 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.permission-changes {
  margin: 0;
}

.permission-issues .issue-error {
  color: var(--color-danger, #b42318);
}

.permission-issues .issue-warning {
  color: var(--color-warning, #9a6700);
}

.permission-group h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.permission-actions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.permission-action {
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}

.permission-action-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.permission-summary {
  margin: 4px 0;
}

.permission-ways {
  list-style: none;
  margin: 4px 0;
  padding: 0;
}

.permission-way {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.permission-or,
.permission-and {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-text-muted, #666);
}

.permission-condition {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.permission-condition.unknown {
  border-color: var(--color-danger, #b42318);
}

.permission-condition input[type='number'] {
  width: 60px;
}

.permission-way input,
.permission-way select {
  font: inherit;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.permission-action-buttons {
  display: flex;
  gap: 16px;
}

.permission-folded {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* What changes the permissions: disabled (but readable) for helpline staff */
.permission-changes-allowed {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.permission-changes-allowed:disabled .permission-edit {
  display: none;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* Helpline terms */
.term-card h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.term-hint {
  margin: 0 0 12px;
}

.term-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.term-choice {
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.term-choice:hover {
  border-color: var(--color-accent);
}

.term-choice.active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

.term-choice.active .muted {
  color: inherit;
  font-weight: normal;
}

.term-words {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.term-words label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.term-words input {
  font: inherit;
  font-weight: normal;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  width: 200px;
}

.term-words-hint {
  flex-basis: 100%;
  margin: 0;
}

.term-samples {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--color-bg);
}

.term-samples-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.term-samples ul {
  margin: 0;
  padding-left: 18px;
}

.term-samples li {
  margin: 3px 0;
}

.term-sample-new {
  font-weight: 600;
}

.term-sample-was {
  margin-left: 8px;
  font-size: 12px;
}

.term-hand-written {
  margin: 10px 0 0;
}

.term-guessed p {
  margin: 0 0 6px;
}

.term-guessed ul {
  margin: 0 0 10px;
}

/* Where else the words appear (Aselo staff) */
.words-elsewhere h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.words-elsewhere-draft {
  margin: 8px 0 12px;
}

.words-elsewhere-group h4 {
  font-size: 13px;
  margin: 16px 0 6px;
}

.words-elsewhere details {
  margin: 4px 0;
}

.words-elsewhere details ul {
  margin: 6px 0 10px;
  padding-left: 18px;
  font-size: 12px;
}

.words-elsewhere details li {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

.words-elsewhere mark {
  background: var(--color-accent-soft);
  color: inherit;
  font-weight: 600;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/*
 * The webchat's look: Twilio Paste's default light theme, as used by aselo-webchat-react-app
 * (components/styles/*.styles.ts name the Paste tokens; their values are below).
 */
.webchat-window {
  --webchat-primary: rgb(2, 99, 224); /* colorBackgroundPrimary */
  --webchat-primary-stronger: rgb(3, 11, 93);
  --webchat-text: rgb(18, 28, 45); /* colorText */
  --webchat-text-weak: rgb(96, 107, 133);
  --webchat-border: rgb(136, 145, 170); /* colorBorder */
  --webchat-error: rgb(214, 31, 31); /* colorBorderError */
  display: flex;
  flex-direction: column;
  width: 350px;
  height: 590px;
  max-width: 100%;
  border-radius: 8px; /* borderRadius30 */
  background: #fff;
  color: var(--webchat-text);
  box-shadow: 0 16px 24px 4px rgba(18, 28, 45, 0.2); /* shadow */
  font-family: 'Inter var', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  text-align: left;
}

.webchat-header {
  display: flex;
  align-items: center;
  background: var(--webchat-primary);
  padding: 12px 4px;
  border-radius: 4px 4px 0 0;
}

.webchat-header h2 {
  margin: 0;
  padding-left: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
}

.webchat-form,
.webchat-started {
  flex: 1;
  overflow: auto;
  padding: 32px 12px 12px;
}

.webchat-title {
  margin: 0 0 20px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 400;
}

.webchat-description {
  margin: 0 0 8px;
}

.webchat-fields {
  margin-bottom: 24px;
}

.webchat-field {
  margin-bottom: 20px;
}

.webchat-label {
  display: block;
  font-weight: 600;
}

.webchat-label-text {
  display: block;
  margin-bottom: 10px;
}

.webchat-input,
.webchat-select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--webchat-border);
  background: #fff;
  color: var(--webchat-text);
  font: inherit;
  font-weight: 400;
}

.webchat-input:focus,
.webchat-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--webchat-primary);
}

.webchat-input.has-error,
.webchat-select.has-error {
  box-shadow: 0 0 0 1px var(--webchat-error);
}

.webchat-select:disabled {
  background: rgb(244, 244, 246);
  color: var(--webchat-text-weak);
}

.webchat-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.webchat-checkbox input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--webchat-primary);
}

.webchat-checkbox input.has-error {
  outline: 1px solid var(--webchat-error);
}

.webchat-checkbox a {
  color: var(--webchat-primary);
}

.webchat-error {
  display: block;
  margin-top: 4px;
  color: rgb(203, 50, 50);
}

.webchat-button {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: var(--webchat-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.webchat-button:hover:not(:disabled) {
  background: var(--webchat-primary-stronger);
}

.webchat-button:disabled {
  background: rgb(225, 227, 234);
  color: rgb(136, 145, 170);
  cursor: not-allowed;
}

.webchat-started ul {
  padding-left: 20px;
}

/* this gets exported as style.css and can be used for the default theming */
/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */
.react-flow {
  direction: ltr;

  --xy-edge-stroke-default: #b1b1b7;
  --xy-edge-stroke-width-default: 1;
  --xy-edge-stroke-selected-default: #555;

  --xy-connectionline-stroke-default: #b1b1b7;
  --xy-connectionline-stroke-width-default: 1;

  --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);

  --xy-minimap-background-color-default: #fff;
  --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
  --xy-minimap-mask-stroke-color-default: transparent;
  --xy-minimap-mask-stroke-width-default: 1;
  --xy-minimap-node-background-color-default: #e2e2e2;
  --xy-minimap-node-stroke-color-default: transparent;
  --xy-minimap-node-stroke-width-default: 2;

  --xy-background-color-default: transparent;
  --xy-background-pattern-dots-color-default: #91919a;
  --xy-background-pattern-lines-color-default: #eee;
  --xy-background-pattern-cross-color-default: #e2e2e2;
  background-color: var(--xy-background-color, var(--xy-background-color-default));
  --xy-node-color-default: inherit;
  --xy-node-border-default: 1px solid #1a192b;
  --xy-node-background-color-default: #fff;
  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;
  --xy-node-border-radius-default: 3px;

  --xy-handle-background-color-default: #1a192b;
  --xy-handle-border-color-default: #fff;

  --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);
  --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);

  --xy-controls-button-background-color-default: #fefefe;
  --xy-controls-button-background-color-hover-default: #f4f4f4;
  --xy-controls-button-color-default: inherit;
  --xy-controls-button-color-hover-default: inherit;
  --xy-controls-button-border-color-default: #eee;
  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);

  --xy-edge-label-background-color-default: #ffffff;
  --xy-edge-label-color-default: inherit;
  --xy-resize-background-color-default: #3367d9;
}
.react-flow.dark {
  --xy-edge-stroke-default: #3e3e3e;
  --xy-edge-stroke-width-default: 1;
  --xy-edge-stroke-selected-default: #727272;

  --xy-connectionline-stroke-default: #b1b1b7;
  --xy-connectionline-stroke-width-default: 1;

  --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);

  --xy-minimap-background-color-default: #141414;
  --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);
  --xy-minimap-mask-stroke-color-default: transparent;
  --xy-minimap-mask-stroke-width-default: 1;
  --xy-minimap-node-background-color-default: #2b2b2b;
  --xy-minimap-node-stroke-color-default: transparent;
  --xy-minimap-node-stroke-width-default: 2;

  --xy-background-color-default: #141414;
  --xy-background-pattern-dots-color-default: #555;
  --xy-background-pattern-lines-color-default: #333;
  --xy-background-pattern-cross-color-default: #333;
  --xy-node-color-default: #f8f8f8;
  --xy-node-border-default: 1px solid #3c3c3c;
  --xy-node-background-color-default: #1e1e1e;
  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);
  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;

  --xy-handle-background-color-default: #bebebe;
  --xy-handle-border-color-default: #1e1e1e;

  --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);
  --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);

  --xy-controls-button-background-color-default: #2b2b2b;
  --xy-controls-button-background-color-hover-default: #3e3e3e;
  --xy-controls-button-color-default: #f8f8f8;
  --xy-controls-button-color-hover-default: #fff;
  --xy-controls-button-border-color-default: #5b5b5b;
  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);

  --xy-edge-label-background-color-default: #141414;
  --xy-edge-label-color-default: #f8f8f8;
}
.react-flow__background {
  background-color: var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));
  pointer-events: none;
  z-index: -1;
}
.react-flow__container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.react-flow__pane {
  z-index: 1;
  touch-action: none;
}
.react-flow__pane.draggable {
    cursor: grab;
  }
.react-flow__pane.dragging {
    cursor: grabbing;
  }
.react-flow__pane.selection {
    cursor: pointer;
  }
.react-flow__viewport {
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
}
.react-flow__renderer {
  z-index: 4;
}
.react-flow__selection {
  z-index: 6;
}
.react-flow__nodesselection-rect:focus,
.react-flow__nodesselection-rect:focus-visible {
  outline: none;
}
.react-flow__edge-path {
  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
  stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));
  fill: none;
}
.react-flow__connection-path {
  stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));
  stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));
  fill: none;
}
.react-flow .react-flow__edges {
  position: absolute;
}
.react-flow .react-flow__edges svg {
    overflow: visible;
    position: absolute;
    pointer-events: none;
  }
.react-flow__edge {
  pointer-events: visibleStroke;
}
.react-flow__edge.selectable {
    cursor: pointer;
  }
.react-flow__edge.animated path {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }
.react-flow__edge.animated path.react-flow__edge-interaction {
    stroke-dasharray: none;
    animation: none;
  }
.react-flow__edge.inactive {
    pointer-events: none;
  }
.react-flow__edge.selected,
  .react-flow__edge:focus,
  .react-flow__edge:focus-visible {
    outline: none;
  }
.react-flow__edge.selected .react-flow__edge-path,
  .react-flow__edge.selectable:focus .react-flow__edge-path,
  .react-flow__edge.selectable:focus-visible .react-flow__edge-path {
    stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));
  }
.react-flow__edge-textwrapper {
    pointer-events: all;
  }
.react-flow__edge .react-flow__edge-text {
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
/* Arrowhead marker styles - use CSS custom properties as default */
.react-flow__arrowhead polyline {
  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.react-flow__arrowhead polyline.arrowclosed {
  fill: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.react-flow__connection {
  pointer-events: none;
}
.react-flow__connection .animated {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }
svg.react-flow__connectionline {
  z-index: 1001;
  overflow: visible;
  position: absolute;
}
.react-flow__nodes {
  pointer-events: none;
  transform-origin: 0 0;
}
.react-flow__node {
  position: absolute;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: all;
  transform-origin: 0 0;
  box-sizing: border-box;
  cursor: default;
}
.react-flow__node.selectable {
    cursor: pointer;
  }
.react-flow__node.draggable {
    cursor: grab;
    pointer-events: all;
  }
.react-flow__node.draggable.dragging {
      cursor: grabbing;
    }
.react-flow__nodesselection {
  z-index: 3;
  transform-origin: left top;
  pointer-events: none;
}
.react-flow__nodesselection-rect {
    position: absolute;
    pointer-events: all;
    cursor: grab;
  }
.react-flow__handle {
  position: absolute;
  pointer-events: none;
  min-width: 5px;
  min-height: 5px;
  width: 6px;
  height: 6px;
  background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));
  border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));
  border-radius: 100%;
}
.react-flow__handle.connectingfrom {
    pointer-events: all;
  }
.react-flow__handle.connectionindicator {
    pointer-events: all;
    cursor: crosshair;
  }
.react-flow__handle-bottom {
    top: auto;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
  }
.react-flow__handle-top {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
  }
.react-flow__handle-left {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
  }
.react-flow__handle-right {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
  }
.react-flow__edgeupdater {
  cursor: move;
  pointer-events: all;
}
.react-flow__pane.selection .react-flow__panel {
  pointer-events: none;
}
.react-flow__panel {
  position: absolute;
  z-index: 5;
  margin: 15px;
}
.react-flow__panel.top {
    top: 0;
  }
.react-flow__panel.bottom {
    bottom: 0;
  }
.react-flow__panel.top.center, .react-flow__panel.bottom.center {
      left: 50%;
      transform: translateX(-15px) translateX(-50%);
    }
.react-flow__panel.left {
    left: 0;
  }
.react-flow__panel.right {
    right: 0;
  }
.react-flow__panel.left.center, .react-flow__panel.right.center {
      top: 50%;
      transform: translateY(-15px) translateY(-50%);
    }
.react-flow__attribution {
  font-size: 10px;
  background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));
  padding: 2px 3px;
  margin: 0;
}
.react-flow__attribution a {
    text-decoration: none;
    color: #999;
  }
@keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
.react-flow__edgelabel-renderer {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  left: 0;
  top: 0;
}
.react-flow__viewport-portal {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-flow__minimap {
  background: var(
    --xy-minimap-background-color-props,
    var(--xy-minimap-background-color, var(--xy-minimap-background-color-default))
  );
}
.react-flow__minimap-svg {
    display: block;
  }
.react-flow__minimap-mask {
    fill: var(
      --xy-minimap-mask-background-color-props,
      var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))
    );
    stroke: var(
      --xy-minimap-mask-stroke-color-props,
      var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))
    );
    stroke-width: var(
      --xy-minimap-mask-stroke-width-props,
      var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default))
    );
  }
.react-flow__minimap-node {
    fill: var(
      --xy-minimap-node-background-color-props,
      var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))
    );
    stroke: var(
      --xy-minimap-node-stroke-color-props,
      var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))
    );
    stroke-width: var(
      --xy-minimap-node-stroke-width-props,
      var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default))
    );
  }
.react-flow__background-pattern.dots {
    fill: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default))
    );
  }
.react-flow__background-pattern.lines {
    stroke: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default))
    );
  }
.react-flow__background-pattern.cross {
    stroke: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default))
    );
  }
.react-flow__controls {
  display: flex;
  flex-direction: column;
  box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));
}
.react-flow__controls.horizontal {
    flex-direction: row;
  }
.react-flow__controls-button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 26px;
    width: 26px;
    padding: 4px;
    border: none;
    background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));
    border-bottom: 1px solid
      var(
        --xy-controls-button-border-color-props,
        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))
      );
    color: var(
      --xy-controls-button-color-props,
      var(--xy-controls-button-color, var(--xy-controls-button-color-default))
    );
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
.react-flow__controls-button svg {
      width: 100%;
      max-width: 12px;
      max-height: 12px;
      fill: currentColor;
    }
.react-flow__edge.updating .react-flow__edge-path {
      stroke: #777;
    }
.react-flow__edge-text {
    font-size: 10px;
  }
.react-flow__node.selectable:focus,
  .react-flow__node.selectable:focus-visible {
    outline: none;
  }
.react-flow__node-input,
.react-flow__node-default,
.react-flow__node-output,
.react-flow__node-group {
  padding: 10px;
  border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));
  width: 150px;
  font-size: 12px;
  color: var(--xy-node-color, var(--xy-node-color-default));
  text-align: center;
  border: var(--xy-node-border, var(--xy-node-border-default));
  background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));
}
.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {
      box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));
    }
.react-flow__node-input.selectable.selected,
    .react-flow__node-input.selectable:focus,
    .react-flow__node-input.selectable:focus-visible,
    .react-flow__node-default.selectable.selected,
    .react-flow__node-default.selectable:focus,
    .react-flow__node-default.selectable:focus-visible,
    .react-flow__node-output.selectable.selected,
    .react-flow__node-output.selectable:focus,
    .react-flow__node-output.selectable:focus-visible,
    .react-flow__node-group.selectable.selected,
    .react-flow__node-group.selectable:focus,
    .react-flow__node-group.selectable:focus-visible {
      box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));
    }
.react-flow__node-group {
  background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default));
}
.react-flow__nodesselection-rect,
.react-flow__selection {
  background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));
  border: var(--xy-selection-border, var(--xy-selection-border-default));
}
.react-flow__nodesselection-rect:focus,
  .react-flow__nodesselection-rect:focus-visible,
  .react-flow__selection:focus,
  .react-flow__selection:focus-visible {
    outline: none;
  }
.react-flow__controls-button:hover {
      background: var(
        --xy-controls-button-background-color-hover-props,
        var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default))
      );
      color: var(
        --xy-controls-button-color-hover-props,
        var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default))
      );
    }
.react-flow__controls-button:disabled {
      pointer-events: none;
    }
.react-flow__controls-button:disabled svg {
        fill-opacity: 0.4;
      }
.react-flow__controls-button:last-child {
    border-bottom: none;
  }
.react-flow__controls.horizontal .react-flow__controls-button {
    border-bottom: none;
    border-right: 1px solid
      var(
        --xy-controls-button-border-color-props,
        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))
      );
  }
.react-flow__controls.horizontal .react-flow__controls-button:last-child {
    border-right: none;
  }
.react-flow__resize-control {
  position: absolute;
}
.react-flow__resize-control.left,
.react-flow__resize-control.right {
  cursor: ew-resize;
}
.react-flow__resize-control.top,
.react-flow__resize-control.bottom {
  cursor: ns-resize;
}
.react-flow__resize-control.top.left,
.react-flow__resize-control.bottom.right {
  cursor: nwse-resize;
}
.react-flow__resize-control.bottom.left,
.react-flow__resize-control.top.right {
  cursor: nesw-resize;
}
/* handle styles */
.react-flow__resize-control.handle {
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  border-radius: 1px;
  background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
  translate: -50% -50%;
}
.react-flow__resize-control.handle.left {
  left: 0;
  top: 50%;
}
.react-flow__resize-control.handle.right {
  left: 100%;
  top: 50%;
}
.react-flow__resize-control.handle.top {
  left: 50%;
  top: 0;
}
.react-flow__resize-control.handle.bottom {
  left: 50%;
  top: 100%;
}
.react-flow__resize-control.handle.top.left {
  left: 0;
}
.react-flow__resize-control.handle.bottom.left {
  left: 0;
}
.react-flow__resize-control.handle.top.right {
  left: 100%;
}
.react-flow__resize-control.handle.bottom.right {
  left: 100%;
}
/* line styles */
.react-flow__resize-control.line {
  border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
  border-width: 0;
  border-style: solid;
}
.react-flow__resize-control.line.left,
.react-flow__resize-control.line.right {
  width: 1px;
  transform: translate(-50%, 0);
  top: 0;
  height: 100%;
}
.react-flow__resize-control.line.left {
  left: 0;
  border-left-width: 1px;
}
.react-flow__resize-control.line.right {
  left: 100%;
  border-right-width: 1px;
}
.react-flow__resize-control.line.top,
.react-flow__resize-control.line.bottom {
  height: 1px;
  transform: translate(0, -50%);
  left: 0;
  width: 100%;
}
.react-flow__resize-control.line.top {
  top: 0;
  border-top-width: 1px;
}
.react-flow__resize-control.line.bottom {
  border-bottom-width: 1px;
  top: 100%;
}
.react-flow__edge-textbg {
  fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));
}
.react-flow__edge-text {
  fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* The flow designer. The board fills the window below the top bar. */
.app-flows {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.app-flows main.flows-home {
  overflow: auto;
}

.danger {
  color: #c62828;
}

/* Start page: the area-home layout (designStatus.css), with the new board form and the import side by side */
.flows-home {
  flex: 1;
  width: 100%;
}

.area-home-actions > .flows-new,
.area-home-actions > .flows-import {
  flex: 1 1 400px;
  align-self: stretch;
  margin: 0;
}

.flows-new {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: flex-start;
  gap: 12px 16px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flows-new h3 {
  width: 100%;
  margin: 0;
  font-size: 15px;
}

.flows-new .field {
  margin: 0;
  min-width: 200px;
}

.flows-templates {
  margin-top: 28px;
}

.flows-templates h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.flows-templates .field-hint {
  margin: 0 0 10px;
}

.flows-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flows-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 14px;
}

.flows-list li + li {
  border-top: 1px solid var(--color-border);
}

.flows-open {
  font-weight: 600;
  text-decoration: none;
}

.flows-list .danger {
  margin-left: auto;
}

/* Editor layout */
.flow-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.flow-editor:focus {
  outline: none;
}

.flow-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.flow-toolbar h2 {
  font-size: 16px;
  margin: 0;
}

.flow-board-code {
  font-size: 12px;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1px 8px;
}

/* As wide whatever it says ("Saving…", "All changes saved"), so the toolbar and the board below
   don't move with every save */
.flow-save-state {
  display: inline-block;
  min-width: 9.5em;
  white-space: nowrap;
  font-size: 13px;
  color: var(--color-muted);
}

.flow-save-state.conflict,
.flow-save-state.error {
  color: var(--color-error-text);
  font-weight: 600;
}

.flow-toolbar-buttons {
  margin-left: auto;
  display: flex;
  gap: 2px;
}

.flow-toolbar-buttons .icon-button:hover:not(:disabled) {
  color: var(--color-accent);
}

.flow-toolbar-buttons .icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.flow-editor > .alert {
  margin: 8px 16px 0;
}

.flow-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
}

.flow-canvas {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #fafbfc;
}

/* Palette */
.flow-palette {
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 10px 10px 24px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.flow-palette .field-hint {
  margin: 0 0 8px;
}

.flow-palette-group h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin: 12px 0 4px;
}

.flow-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-size: 13px;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 6px;
  cursor: grab;
}

.flow-palette-item:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-border);
}

.flow-palette-preview {
  position: relative;
  width: 40px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #37474f;
}

.flow-palette-preview .flow-shape {
  position: absolute;
  inset: 0;
}

.flow-palette-preview svg:not(.flow-shape) {
  position: relative;
}

/* Side panel: settings and tasks; its width is set by SidebarResizer (300px at least) */
.flow-sidebar {
  position: relative;
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
}

/* Its left edge: drag to make the panel wider */
.flow-sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 8px;
  cursor: col-resize;
  z-index: 5;
  touch-action: none;
}

.flow-sidebar-resizer:hover,
.flow-sidebar-resizer:focus-visible {
  background: var(--color-accent-soft);
  outline: none;
  box-shadow: inset 2px 0 0 var(--color-accent);
}

/* While dragging: no text selection, and the resize cursor everywhere */
body.flow-resizing {
  cursor: col-resize;
  user-select: none;
}

.flow-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}

.flow-sidebar-tabs button {
  flex: 1;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 8px 8px;
  color: var(--color-muted);
  cursor: pointer;
}

.flow-sidebar-tabs button[aria-selected='true'] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.flow-inspector,
.flow-tasks,
.flow-check {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 24px;
}

.flow-problems {
  margin: 6px 0 0;
  padding: 6px 8px 6px 24px;
  font-size: 12.5px;
  color: #8a3b00;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: var(--radius);
}

.flow-problems li + li {
  margin-top: 4px;
}

/* Tasks */
.flow-tasks-filter {
  display: flex;
  gap: 4px;
  margin: 10px 0;
}

.flow-tasks-filter button {
  font: inherit;
  font-size: 12.5px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2px 10px;
  cursor: pointer;
}

.flow-tasks-filter button.active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.flow-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow-task {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.flow-task.done {
  opacity: 0.5;
}

.flow-task.done .flow-task-title {
  text-decoration: line-through;
}

.flow-task-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.flow-task-title {
  text-align: left;
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.flow-task-check {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #37474f;
  display: flex;
}

.flow-task-check:disabled {
  cursor: default;
}

.flow-inspector-section {
  padding: 10px 0;
}

.flow-inspector-section + .flow-inspector-section {
  border-top: 1px solid var(--color-border);
}

.flow-inspector-section h3 {
  font-size: 13px;
  margin: 0 0 8px;
}

.flow-inspector textarea {
  width: 100%;
  font: inherit;
}

.flow-inspector-actions {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

.flow-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.flow-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #90a4ae;
  cursor: pointer;
  padding: 0;
}

.flow-swatch.selected {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.flow-exits {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.flow-exits li {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.flow-exits .flow-exit-operator {
  flex: 0 0 auto;
  max-width: 45%;
  font: inherit;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flow-exits input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flow-comments {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.flow-comments li {
  padding: 6px 0;
}

.flow-comments p {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.flow-comment-author {
  font-weight: 600;
  font-size: 13px;
}

.flow-resolved {
  font-weight: normal;
  color: var(--color-muted);
}

.flow-frame-list,
.flow-tips {
  margin: 0;
  padding-left: 18px;
}

.flow-tips li {
  margin-bottom: 4px;
}

/* Objects on the canvas */
.flow-object {
  position: relative;
  width: 100%;
  height: 100%;
}

.flow-object > .flow-shape {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.flow-object-body {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 18px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.25;
  color: #1c2b33;
  overflow: hidden;
}

/* Leave room for the slanted, double or pointed sides */
.flow-shape-diamond .flow-object-body {
  padding: 14px 22%;
}

.flow-shape-parallelogram .flow-object-body {
  padding: 6px 28px;
}

.flow-shape-predefined .flow-object-body {
  padding: 6px 20px;
}

.flow-shape-manualInput .flow-object-body {
  padding-top: 18px;
}

.flow-shape-cylinder .flow-object-body {
  padding-top: 18px;
}

.flow-shape-document .flow-object-body {
  padding-bottom: 14px;
}

.flow-shape-offPage .flow-object-body {
  padding-right: 28px;
}

.flow-shape-none .flow-object-body {
  font-size: 16px;
  font-weight: 600;
}

.flow-shape-none.selected .flow-object-body {
  outline: 1px dashed #1565c0;
}

.flow-object-icon {
  color: #37474f;
  display: flex;
}

.flow-shape-none .flow-object-icon {
  display: none;
}

.flow-object-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-object-caption {
  font-size: 9.5px;
  color: #546e7a;
  font-family: ui-monospace, Consolas, monospace;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-placeholder {
  color: #90a4ae;
}

.flow-inline-input {
  width: 100%;
  min-height: 2.6em;
  font: inherit;
  text-align: center;
  resize: none;
  border: 1px solid #1565c0;
  border-radius: 3px;
  background: #ffffff;
  padding: 2px 4px;
}

.flow-comment-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  background: #ff8f00;
  color: #ffffff;
  border-radius: 10px;
  padding: 1px 6px;
}

/* Connection points: shown on hover, or while connecting */
.flow-handle.react-flow__handle {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #1565c0;
  opacity: 0;
  transition: opacity 0.1s;
}

.react-flow__node:hover .flow-handle,
.react-flow__node.selected .flow-handle,
.react-flow.connecting .flow-handle,
.flow-handle.connectingfrom,
.flow-handle.connectingto {
  opacity: 1;
}

/* Frames */
.flow-frame {
  width: 100%;
  height: 100%;
  border: 1.5px solid #b0bec5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.flow-frame.selected {
  border-color: #1565c0;
}

.flow-frame-title {
  position: absolute;
  top: -30px;
  left: 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 15px;
  font-weight: 600;
  color: #37474f;
  cursor: grab;
  white-space: nowrap;
  padding: 2px 4px;
}

.flow-frame-title .flow-inline-input {
  text-align: left;
  min-width: 240px;
}

.flow-frame-tags {
  font-size: 12px;
  font-weight: normal;
  color: var(--color-muted);
}

/* Stickies */
.flow-sticky {
  width: 100%;
  height: 100%;
  padding: 10px;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.flow-sticky.selected {
  outline: 2px solid #1565c0;
}

.flow-sticky-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  height: 100%;
}

.flow-sticky .flow-inline-input {
  height: 100%;
  text-align: left;
  background: transparent;
}

/* Connections */
.flow-edge {
  stroke: #37474f !important;
  stroke-width: 1.6 !important;
}

.flow-edge.selected {
  stroke: #1565c0 !important;
  stroke-width: 2.4 !important;
}

.flow-edge-label {
  position: absolute;
  pointer-events: all;
  font-size: 11.5px;
  background: #ffffff;
  border: 1px solid #b0bec5;
  border-radius: 10px;
  padding: 1px 7px;
  color: #37474f;
}

.flow-edge-label.selected {
  border-color: #1565c0;
  color: #1565c0;
}

/* Problems on objects */
.flow-problem-badge {
  position: absolute;
  top: -9px;
  left: -9px;
  display: flex;
  background: #e65100;
  color: #ffffff;
  border-radius: 50%;
  padding: 3px;
}

/* While connecting, the object under the pointer shows it will take the connection */
.flow-canvas.connecting .react-flow__node-object:hover .flow-shape {
  filter: drop-shadow(0 0 5px rgba(21, 101, 192, 0.85));
}

.flow-canvas.connecting .react-flow__node-object:hover .flow-shape-none .flow-object-body {
  outline: 2px solid #1565c0;
}

/* Why a connection wasn't made */
.flow-notice {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 520px;
  background: #263238;
  color: #ffffff;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

/* Sticky notes that are tasks */
.flow-sticky-task {
  display: flex;
  flex-direction: column;
}

.flow-sticky-task-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 11.5px;
  font-weight: 600;
}

.flow-sticky-assignee {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-sticky-task.done {
  filter: grayscale(0.85);
  opacity: 0.6;
}

.flow-sticky-task.done .flow-sticky-text {
  text-decoration: line-through;
}

/* People lists */
.flows-people {
  margin-top: 32px;
}

.flows-people h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.flows-people .field {
  max-width: 260px;
  margin: 12px 0;
}

.flows-people-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.flows-people-add input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* Its script or recording is approved: a green check in the top right corner (left of comments) */
.flow-approved-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  display: flex;
  background: #2e7d32;
  color: #ffffff;
  border-radius: 50%;
  padding: 3px;
}

.flow-approved-badge.beside-comments {
  right: 30px;
}

.flow-problem-badge.error {
  background: #c62828;
}

.flow-problems li.error {
  color: var(--color-error-text);
  font-weight: 600;
}

.flow-inspector > .flow-problems {
  margin-top: 10px;
}

.flow-sidebar-tabs button.has-errors {
  color: #c62828;
}

/* Check panel */
.flow-check-summary {
  font-weight: 600;
  margin: 8px 0;
}

.flow-issue-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.flow-issue {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.flow-issue-icon {
  flex-shrink: 0;
  display: flex;
  padding-top: 1px;
}

.flow-issue.error .flow-issue-icon {
  color: #c62828;
}

.flow-issue.warning .flow-issue-icon {
  color: #e65100;
}

.flow-issue-message {
  text-align: left;
  text-decoration: none;
  color: inherit;
}

.flow-issue-message:hover {
  text-decoration: underline;
}

.flow-issue-fix {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

/* Where each way out goes */
.flow-exit-targets {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.flow-exit-targets li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
}

.flow-exit-name {
  font-weight: 600;
  min-width: 70px;
}

.flow-exit-targets .field-checkbox {
  margin: 0;
  font-size: 12.5px;
}

/* Export menu */
.flow-export {
  position: relative;
  margin-left: auto;
}

.flow-export .secondary-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 13px;
}

.flow-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
}

.flow-export-menu button {
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
}

.flow-export-menu button:hover {
  background: var(--color-accent-soft);
}

.flow-export + .flow-toolbar-buttons {
  margin-left: 0;
}

/* Message and recording statuses */
.flow-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
  background: #eceff1;
  color: #455a64;
}

.flow-status-script-ready {
  background: #fff3e0;
  color: #8a4b00;
}

.flow-status-recorded {
  background: #e3f2fd;
  color: #0d47a1;
}

.flow-status-approved {
  background: #ede7f6;
  color: #4527a0;
}

.flow-status-published {
  background: #e8f5e9;
  color: #1b5e20;
}

.flow-recording-player {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}

.flow-recording-player audio,
.flow-recording-list audio {
  width: 100%;
  height: 32px;
}

.flow-recording-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-recording-buttons .primary-button,
.flow-recording-buttons .secondary-button,
.flow-recordings .secondary-button,
.flow-recordings .primary-button {
  padding: 5px 10px;
  font-size: 13px;
}

/* Recordings tab */
.flow-recordings {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 24px;
}

.flow-recordings h3 {
  font-size: 13px;
  margin: 16px 0 6px;
}

.flow-publish-all {
  margin-top: 10px;
}

.flow-upload-report {
  font-size: 12.5px;
  padding-left: 18px;
}

.flow-recording-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow-recording-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.flow-recording-list code {
  overflow-wrap: anywhere;
}

/* Refresh recordings */
.flow-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 13px;
  margin-left: auto;
}

.flow-refresh + .flow-export {
  margin-left: 0;
}

/* Import a live helpline */
.flows-import {
  margin-top: 32px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flows-import h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.flows-import h4 {
  font-size: 13px;
  margin: 14px 0 6px;
}

.flows-import-pick {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.flows-import-pick select {
  font: inherit;
  padding: 6px 8px;
}

.flows-import-preview ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
}

.flows-import-notes li + li {
  margin-top: 4px;
}

.flow-studio-properties {
  font-size: 11.5px;
  background: #f5f7f8;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.flows-import ul.flows-import-flows {
  list-style: none;
  padding: 0;
}

.flows-import-flows li + li {
  margin-top: 4px;
}

/* Where an importable flow is live */
.flow-env-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 0 7px;
  margin-right: 4px;
  vertical-align: middle;
}

.flow-env-badge.staging {
  background: #e3f2fd;
  color: #0d47a1;
}

.flow-env-badge.production {
  background: #e8f5e9;
  color: #1b5e20;
}

.flow-env-channels {
  display: block;
}

/* An importable flow: [its channels] · its template */
.flow-import-channels {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: #6a1b9a;
}

.flow-import-name {
  color: #0d47a1;
}

/* A "Send to queue" object's task attributes */
.flow-task-attributes {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  resize: vertical;
  white-space: pre;
}

.flow-task-attributes-problem {
  color: #b71c1c;
}

.flow-task-attribute-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}

.flow-task-attribute {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.flow-task-attribute.routing {
  background: #e3f2fd;
  border-color: #90caf9;
}

.flow-task-attributes-other summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--color-muted);
}

.flow-task-attributes-other pre {
  font-size: 11px;
  overflow: auto;
  max-height: 240px;
  background: var(--color-surface);
  padding: 6px 8px;
  border-radius: var(--radius);
}

/* Check: fixes and ignoring a warning that doesn't apply to this board */
.flow-issue-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: 8px;
}

.flow-issue-actions .flow-issue-fix,
.flow-issue.ignored .flow-issue-fix {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.flow-check-ignored {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.flow-issue.ignored {
  opacity: 0.65;
}

/* Which Studio flow the board is (imported boards, whose objects aren't in a frame) */
.flow-board-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.flow-board-source code {
  font-size: 11px;
}

.flow-board-channel {
  font-size: 11px;
  font-weight: 600;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* Call settings: addresses and JSON bodies */
.flow-field-json,
.flow-field-url {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.flow-field-json {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  line-height: 1.45;
}

.flow-field-json[aria-invalid='true'],
.flow-field-url[aria-invalid='true'] {
  border-color: var(--color-error-text);
}

.flow-field-problem {
  font-size: 12px;
  color: var(--color-error-text);
}

/* The helpline's skills (its routing design), added to a skills list with a click */
.flow-field-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.flow-field-choice {
  padding: 1px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 12px;
  cursor: pointer;
}

.flow-field-choice:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* Set variable: a key and its value per row */
.flow-variable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.flow-variable-row input {
  min-width: 0;
  font-family: inherit;
  font-size: inherit;
}

.flow-variable-row input[aria-invalid='true'] {
  border-color: var(--color-error-text);
}

.flow-variable-row .flow-field-problem {
  grid-column: 1 / -1;
}

/* A message's name by parts: the prefix (fixed), the flow's channel, language and service, what it is */
.flow-name-parts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.flow-name-parts select,
.flow-name-parts input {
  font-family: inherit;
  font-size: inherit;
  width: auto;
  min-width: 0;
}

.flow-name-parts input {
  flex: 1 1 120px;
}

.flow-name-prefix,
.flow-name-part {
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flow-name-prefix {
  background: var(--color-surface);
  color: var(--color-muted);
}

.flow-name-part {
  background: var(--color-accent-soft);
}

.flow-name-full {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  word-break: break-all;
}

/* Flows sharing a template (variants): a bar under the toolbar, a tab per flow */
.flow-variant-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 16px;
  background: var(--color-accent-soft);
  border-bottom: 1px solid var(--color-border);
}

.flow-variant-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}

.flow-variants {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-surface);
}

.flow-variants button {
  font: inherit;
  font-size: 14px;
  padding: 4px 18px;
  border: none;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
}

.flow-variants button + button {
  border-left: 1px solid var(--color-accent);
}

.flow-variants button[aria-selected='true'] {
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
}

.flow-variant-bar-hint {
  font-size: 12px;
}

.flow-variant-add {
  font: inherit;
  font-size: 13px;
  padding: 3px 6px;
  border: 1px dashed var(--color-accent);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-accent);
}

.flow-variant-split {
  margin-left: auto;
  white-space: nowrap;
}

.flow-variant-hint {
  margin: 4px 0 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-accent-soft);
}

/* A template other helplines use too: where changes to its widgets go */
.flow-shared-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #f1d48a;
  font-size: 13px;
}

.flow-shared-bar.everyone {
  background: var(--color-error-bg);
  border-bottom-color: #f2b8b5;
}

.flow-shared-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #7a5200;
  white-space: nowrap;
}

.flow-shared-bar.everyone .flow-shared-label {
  color: var(--color-error-text);
}

.flow-shared-switch {
  margin-left: auto;
  white-space: nowrap;
}

/* Design / Test mode */
.flow-mode button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
}

/* Test mode on the canvas: the run's way (blue, the current widget pulsing), tested paths (green),
   the rest faded while a run is shown */
.flow-object.sim-dimmed,
.flow-edge.sim-dimmed,
.flow-edge-label.sim-dimmed {
  opacity: 0.35;
}

.flow-object.sim-current .flow-shape {
  animation: flow-sim-pulse 1.4s ease-in-out infinite;
}

@keyframes flow-sim-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 2px rgba(21, 101, 192, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(21, 101, 192, 0.95));
  }
}

.flow-object.sim-dead-end .flow-shape {
  filter: drop-shadow(0 0 8px rgba(198, 40, 40, 0.85));
}

.flow-object.sim-tested .flow-shape {
  filter: drop-shadow(0 0 4px rgba(46, 125, 50, 0.55));
}

.flow-sim-badge {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 2;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #1565c0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.flow-edge.sim-visited {
  stroke: #1565c0 !important;
  stroke-width: 2.6 !important;
}

.flow-edge.sim-tested {
  stroke: #2e7d32 !important;
  stroke-width: 2.4 !important;
}

.flow-edge.sim-active {
  stroke-dasharray: 8 6;
  animation: flow-sim-dash 0.6s linear infinite;
}

@keyframes flow-sim-dash {
  to {
    stroke-dashoffset: -14;
  }
}

.flow-edge-label.sim-visited {
  border-color: #1565c0;
  color: #1565c0;
  font-weight: 600;
}

.flow-edge-label.sim-tested {
  border-color: #2e7d32;
  color: #2e7d32;
}

@media (prefers-reduced-motion: reduce) {
  .flow-object.sim-current .flow-shape,
  .flow-edge.sim-active {
    animation: none;
  }
}

/* The Test panel */
.flow-simulator {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-simulator h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.flow-sim-controls,
.flow-sim-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.flow-sim-controls .primary-button,
.flow-sim-controls .secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.flow-sim-choices .secondary-button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-sim-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.flow-sim-steps li + li {
  border-top: 1px solid var(--color-border);
}

.flow-sim-steps li.current {
  background: var(--color-accent-soft);
}

.flow-sim-execution {
  display: block;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #6a1b9a;
  background: #f3e5f5;
}

.flow-sim-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.flow-sim-step:hover {
  background: var(--color-accent-soft);
}

.flow-sim-step-number {
  flex-shrink: 0;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 10px;
  background: #1565c0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.flow-sim-step-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.flow-sim-step-name {
  font-weight: 600;
}

.flow-sim-step-body code,
.flow-sim-note {
  font-size: 11.5px;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.flow-sim-exit {
  flex-shrink: 0;
  max-width: 40%;
  padding: 1px 7px;
  border: 1px solid #1565c0;
  border-radius: 10px;
  color: #1565c0;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-sim-prompt {
  padding: 10px;
  border: 2px solid #1565c0;
  border-radius: var(--radius);
  background: var(--color-accent-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-sim-chat {
  display: flex;
  gap: 6px;
}

.flow-sim-chat input {
  flex: 1;
  min-width: 0;
}

.flow-sim-dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 200px;
}

.flow-sim-dialpad button {
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  padding: 8px 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  aspect-ratio: 1;
  background: var(--color-surface);
  cursor: pointer;
}

.flow-sim-dialpad button:hover {
  border-color: #1565c0;
  color: #1565c0;
}

.flow-sim-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  font-size: 13px;
}

.flow-sim-end.end {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.flow-sim-end.deadEnd,
.flow-sim-end.loop {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid #ef9a9a;
}

.flow-sim-state dl {
  margin: 6px 0 0;
  font-size: 12px;
}

.flow-sim-state dt {
  font-weight: 600;
  margin-top: 4px;
}

.flow-sim-state dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.flow-sim-coverage {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.flow-sim-untested,
.flow-sim-paths {
  margin: 4px 0;
  padding-left: 18px;
  font-size: 12.5px;
}

.flow-sim-paths li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.flow-sim-widget {
  font-size: 11.5px;
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.flow-sim-message blockquote {
  margin: 0 0 6px;
  padding: 6px 10px;
  border-left: 3px solid #1565c0;
  background: var(--color-surface);
  font-size: 13px;
  white-space: pre-wrap;
}

.flow-sim-message audio {
  width: 100%;
  height: 32px;
}

.flow-sim-choices .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Sketch mode: the flow's shape only, lighter and quieter (dashed outlines, faded icons) */
.flow-editor.sketch .flow-object-icon {
  opacity: 0.5;
}

.flow-editor.sketch .flow-object-text {
  font-weight: 500;
}

.flow-editor.sketch .flow-object-caption {
  opacity: 0.7;
}

.flow-editor.sketch .flow-edge:not(.selected) {
  stroke: #90a4ae !important;
}

.flow-editor.sketch .flow-edge-label:not(.selected) {
  border-color: #cfd8dc;
  color: #546e7a;
}

/* Names: channels and languages chosen from a list (MultiSelect) */
.flow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-accent-soft);
  font-size: 13px;
}

.flow-chip .link-button {
  padding: 0 2px;
  line-height: 1;
}

/* A flow per language sharing the board: each with its studio_flows key */
.flow-language-flows {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: grid;
  gap: 4px;
}

.flow-language-flows li {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.flow-language-flows input {
  flex: 1;
  min-width: 0;
}

.flow-language-mode {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 6px 8px;
  display: grid;
  gap: 4px;
}

.flow-language-mode label {
  font-size: 13px;
}

/* A step's help: a card beside a step in the left menu (hover), or under its (i) on the board */
.step-help-card {
  position: fixed;
  z-index: 1000;
  width: 300px;
  max-width: calc(100vw - 24px);
  padding: 12px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(25, 43, 51, 0.18), 0 2px 6px rgba(25, 43, 51, 0.08);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
}

.step-help-card.shown {
  opacity: 1;
  pointer-events: auto;
  animation: step-help-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.step-help-right {
  transform-origin: left center;
}

.step-help-below {
  transform-origin: top center;
}

.step-help-below.flipped {
  transform-origin: bottom center;
}

@keyframes step-help-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(var(--step-help-shift, 0));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step-help-below {
  --step-help-shift: -4px;
}

.step-help-below.flipped {
  --step-help-shift: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .step-help-card.shown {
    animation: none;
  }
}

/* The arrow pointing at what it's about */
.step-help-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.step-help-right .step-help-arrow {
  left: -7px;
  margin-top: -6px;
  border-top-color: transparent;
  border-right-color: transparent;
}

.step-help-below .step-help-arrow {
  top: -7px;
  margin-left: -6px;
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.step-help-below.flipped .step-help-arrow {
  top: auto;
  bottom: -7px;
  border: 1px solid var(--color-border);
  border-top-color: transparent;
  border-left-color: transparent;
}

.step-help-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.step-help-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  flex-shrink: 0;
}

.step-help-close {
  margin-left: auto;
  display: flex;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.step-help-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.step-help-card p {
  margin: 0 0 8px;
}

.step-help-card p:last-child {
  margin-bottom: 0;
}

.step-help-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.step-help-paths {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.step-help-paths li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: baseline;
}

.step-help-exit {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.step-help-tip {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-accent-soft);
  font-size: 12px;
}

/* The (i) on a step: faint until the step is hovered or selected */
.step-info-button {
  position: absolute;
  right: -8px;
  bottom: -8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-accent);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 120ms, transform 120ms, box-shadow 120ms;
}

.react-flow__node:hover .step-info-button,
.flow-object.selected .step-info-button,
.step-info-button.open,
.step-info-button:focus-visible {
  opacity: 1;
}

.step-info-button:hover,
.step-info-button.open {
  transform: scale(1.12);
  box-shadow: 0 2px 6px rgba(25, 43, 51, 0.2);
}

/* The card's content scrolls when it's taller than the window (the arrow stays outside it) */
.step-help-scroll {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

/* Its "More info": a fuller explanation and an example */
.step-help-more {
  margin: 4px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  animation: step-help-more-in 180ms ease-out;
}

@keyframes step-help-more-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-help-more {
    animation: none;
  }
}

.step-help-card .step-help-more p:last-child {
  margin-bottom: 0;
}

.step-help-example {
  padding: 8px 10px;
  border-left: 3px solid #ffb300;
  border-radius: 0 8px 8px 0;
  background: #fff8e1;
  font-size: 12px;
}

.step-help-example span {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a6100;
}

.step-help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.step-help-toggle:hover {
  background: var(--color-accent-soft);
}

.step-help-toggle svg {
  transition: transform 160ms;
}

.step-help-toggle.expanded svg {
  transform: rotate(180deg);
}

.step-help-footnote {
  font-size: 12px;
  color: var(--color-muted);
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* The routing designer: conditions are blue, skills purple, queues pink (as in the Miro boards) */
.app-routing {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.routing-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.routing-pick {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.routing-pick select {
  font: inherit;
  padding: 4px 8px;
}

.routing-intro,
.routing-empty {
  padding: 24px 32px;
}

.routing-empty {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.routing-area > .flows-import-preview {
  margin: 16px 32px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.routing-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.routing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.routing-tabs button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px 8px;
  color: var(--color-muted);
  cursor: pointer;
}

.routing-tabs button[aria-selected='true'] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.routing-tabs button.has-errors {
  color: #c62828;
}

/* A workflow: cards on the left, the diagram on the right */
.routing-workflow {
  flex: 1;
  min-height: 0;
  display: flex;
}

.routing-cards {
  width: 46%;
  min-width: 420px;
  overflow-y: auto;
  padding: 12px 16px 40px;
  border-right: 1px solid var(--color-border);
}

.routing-diagram {
  flex: 1;
  min-width: 0;
  background: #fafbfc;
}

.routing-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 40px;
  max-width: 980px;
}

.routing-workflow-settings {
  max-width: 340px;
}

.routing-rule-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.routing-rule-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid #1976d2;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.routing-rule-card.selected {
  box-shadow: 0 0 0 2px #90caf9;
}

.routing-rule-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.routing-rule-number,
.routing-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #1976d2;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.routing-step {
  background: #ad1457;
}

.routing-rule-name {
  flex: 1;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 6px;
}

.routing-rule-name:hover,
.routing-rule-name:focus {
  border-color: var(--color-border);
}

.routing-section {
  margin-top: 8px;
}

.routing-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin: 6px 0;
}

.routing-section h4 .field-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 6px;
}

/* Rule / JSON tabs on a rule card */
.routing-rule-tabs {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.routing-rule-tabs button {
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--color-muted);
}

.routing-rule-tabs button.active {
  background: #1976d2;
  color: #ffffff;
}

.routing-json {
  margin: 0;
  padding: 10px 12px;
  max-height: 420px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* Alternative groups of task conditions */
.routing-group-card {
  border: 1px dashed #90caf9;
  border-radius: var(--radius);
  padding: 4px 10px 6px;
}

.routing-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #1565c0;
  font-weight: 600;
}

.routing-or-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1565c0;
}

.routing-or-divider::before,
.routing-or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid #bbdefb;
}

.routing-attribute-input {
  font-family: ui-monospace, Consolas, monospace;
}

.routing-warning {
  color: #8a4b00;
  background: #fff4e5;
  border-radius: var(--radius);
  padding: 2px 6px;
}

.routing-conditions,
.routing-targets {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}

/* One row: the values wrap within their own space, and the remove button stays at the end */
.routing-condition {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
}

.routing-condition > select,
.routing-condition > .routing-attribute-input {
  flex-shrink: 0;
}

.routing-condition .routing-values {
  flex: 1;
  min-width: 0;
}

.routing-condition > .icon-button {
  flex-shrink: 0;
  margin-left: auto;
}

.routing-condition select,
.routing-condition input,
.routing-who select,
.routing-target-foot input,
.routing-target-foot select,
.routing-target-head select,
.routing-queue-groups select,
.routing-queue-head input,
.routing-skill-list input,
.routing-add input,
.routing-who input {
  font: inherit;
  font-size: 13px;
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.routing-condition.custom input {
  flex: 1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.routing-values {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.routing-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 12px;
  padding: 2px 9px;
}

.routing-chip button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  line-height: 1;
}

.routing-chip.value {
  background: #e3f2fd;
  color: #0d47a1;
}

.routing-chip.skill {
  background: #ede7f6;
  color: #4527a0;
}

.routing-skills-bar .routing-chip.skill {
  cursor: grab;
}

.routing-chip.custom {
  background: #fff3e0;
  color: #8a4b00;
}

.routing-skills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #f7f5fb;
  border: 1px dashed #b39ddb;
  border-radius: var(--radius);
}

.routing-target-row {
  border: 1px solid #f8bbd0;
  background: #fff8fb;
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 8px;
}

.routing-target-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.routing-target-actions {
  margin-left: auto;
  display: flex;
}

.routing-target-actions .icon-button:disabled {
  opacity: 0.3;
}

.routing-who {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 8px 0 4px;
  font-size: 13px;
}

.routing-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12.5px;
}

.routing-switches .field-checkbox {
  margin: 0;
}

.routing-custom {
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.routing-target-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
}

.routing-target-foot input[type='number'] {
  width: 76px;
}

/* Queues */
.routing-queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.routing-queue-list > li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid #ec407a;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.routing-queue-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.routing-queue-head input {
  font-weight: 600;
  min-width: 260px;
}

.routing-queue-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 8px 0 4px;
  font-size: 13px;
}

.routing-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.routing-group-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px dashed #b39ddb;
  border-radius: 14px;
}

.routing-and,
.routing-or {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-muted);
}

.routing-or {
  margin-right: 2px;
}

.routing-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Skills */
.routing-skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.routing-skill-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.routing-skill-list li input:first-child {
  font-weight: 600;
  color: #4527a0;
  width: 160px;
}

.routing-skill-list li input + input {
  flex: 1;
}

.routing-panel h3 {
  margin: 18px 0 4px;
  font-size: 15px;
}

/* Test a task */
.routing-test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 5px 0;
}

.routing-test-label {
  min-width: 140px;
  font-size: 13px;
  font-weight: 600;
}

.routing-test-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.routing-test-choice {
  font: inherit;
  font-size: 13px;
  padding: 3px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.routing-test-choice.active {
  background: #1976d2;
  border-color: #1976d2;
  color: #ffffff;
}

.routing-test-more {
  margin: 6px 0;
}

.routing-test-more summary,
.routing-test-result summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--color-muted);
}

.routing-test-contact {
  font-weight: 600;
  margin: 0 0 4px;
}

.routing-test-timeline {
  margin: 6px 0 10px;
  padding-left: 22px;
}

.routing-test-timeline li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.routing-test-result {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.routing-test-steps {
  list-style: none;
  padding: 0;
  font-size: 13px;
}

.routing-test-steps .match {
  color: #1b5e20;
  font-weight: 600;
}

.routing-test-steps .no {
  color: var(--color-muted);
}

.routing-test-steps .unknown {
  color: #8a4b00;
}

/* The diagram */
.routing-node {
  font-size: 12px;
  line-height: 1.3;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.routing-start {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  background: #c8efd4;
  border: 1.5px solid #2e7d32;
  border-radius: 20px;
}

.routing-rule {
  width: 300px;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #1976d2;
  border-left-width: 5px;
}

.routing-target {
  width: 250px;
  gap: 4px;
  background: #ffffff;
  border: 1.5px solid #ad1457;
  border-left-width: 5px;
}

.routing-node-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.routing-node-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.routing-node-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.routing-node-or {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 999px;
  padding: 1px 8px;
}

.routing-node-who {
  display: flex;
  align-items: center;
  gap: 4px;
}

.routing-priority {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  background: #ad1457;
  border-radius: 999px;
  padding: 1px 6px;
}

.routing-node-move {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #546e7a;
  border-top: 1px dashed #e0e0e0;
  padding-top: 4px;
}

.routing-node-move.wait {
  color: #2e7d32;
}

/* Task conditions by kind: the same colours in the diagram, the legend and the rule cards */
.routing-cond-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routing-cond-chip.channel {
  background: #e0f2f1;
  border-color: #4db6ac;
  color: #00695c;
}

.routing-cond-chip.service {
  background: #ede7f6;
  border-color: #9575cd;
  color: #4527a0;
}

.routing-cond-chip.language {
  background: #fff8e1;
  border-color: #ffb300;
  color: #8a5a00;
}

.routing-cond-chip.transfer {
  background: #fce4ec;
  border-color: #f06292;
  color: #ad1457;
}

.routing-cond-chip.offline {
  background: #eceff1;
  border-color: #90a4ae;
  color: #37474f;
}

.routing-cond-chip.other {
  background: #f5f5f5;
  border-color: #bdbdbd;
  color: #424242;
  font-family: ui-monospace, Consolas, monospace;
}

.routing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 360px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* A condition row in a rule card carries its kind's colour */
.routing-condition[data-family] {
  border-left: 3px solid transparent;
  padding-left: 6px;
}

.routing-condition[data-family='channel'] {
  border-left-color: #4db6ac;
}

.routing-condition[data-family='service'] {
  border-left-color: #9575cd;
}

.routing-condition[data-family='language'] {
  border-left-color: #ffb300;
}

.routing-condition[data-family='transfer'] {
  border-left-color: #f06292;
}

.routing-condition[data-family='offline'] {
  border-left-color: #90a4ae;
}

.routing-condition[data-family='other'] {
  border-left-color: #bdbdbd;
}

.routing-node.selected {
  box-shadow: 0 0 0 3px #ffb300;
}

.routing-target-queue {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #880e4f;
}

.routing-node-hint {
  color: #546e7a;
  font-size: 11px;
}

/* Common rules, added in one click */
.routing-common-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #f1f8e9;
  border: 1px dashed #9ccc65;
  border-radius: 8px;
}

.routing-chip.common-rule {
  border: 1px solid #9ccc65;
  background: #fff;
  color: #33691e;
  cursor: pointer;
}

.routing-chip.common-rule:disabled {
  border-color: #c5e1a5;
  color: #7c9a5e;
  cursor: default;
}

.routing-rules-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.routing-rules-head .field-hint {
  flex: 1;
}

.routing-rules-head .link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* A collapsed card: its name and what it does in one line */
.routing-rule-summary {
  margin: 4px 0 0 32px;
  color: var(--color-muted, #607080);
  font-size: 13px;
}

.routing-test-other {
  width: 110px;
  font-size: 12.5px;
  padding: 2px 8px;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* The chatbot designer: the chatbot speaks in indigo, the contact in teal, retries in amber, the
   goodbye in green (the same as the phone preview) */
.app-chatbots {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.chatbot-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chatbot-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
}

/* The chatbots, on the left */
.chatbot-list {
  border-right: 1px solid var(--color-border);
  padding: 10px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chatbot-list-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  font: inherit;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.chatbot-list-item:hover {
  border-color: #9fa8da;
}

.chatbot-list-item.active {
  border-color: #3949ab;
  background: #f3f4ff;
  box-shadow: 0 0 0 2px #c5cae9;
}

.chatbot-list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3949ab;
  color: #ffffff;
  flex-shrink: 0;
}

.chatbot-list-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 0;
}

.chatbot-list-text > span {
  color: var(--color-muted);
  font-size: 12px;
}

.chatbot-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.chatbot-list-error {
  color: #c62828;
}

.chatbot-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.chatbot-script {
  overflow-y: auto;
  padding: 12px 20px 40px;
}

.chatbot-preview {
  border-left: 1px solid var(--color-border);
  background: #f5f6fb;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.chatbot-panel {
  overflow-y: auto;
  padding: 12px 20px 40px;
}

.chatbot-intents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chatbot-intents button {
  font: inherit;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chatbot-intents button[aria-selected='true'] {
  background: #3949ab;
  border-color: #3949ab;
  color: #ffffff;
}

/* The conversation, as a timeline */
.chatbot-conversation {
  position: relative;
  max-width: 760px;
}

.chatbot-conversation::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: 16px;
  border-left: 2px dashed #c5cae9;
}

.chatbot-start,
.chatbot-step,
.chatbot-question {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.chatbot-step-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3949ab;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
}

.chatbot-step-icon.start {
  background: #00897b;
}

.chatbot-step-icon.greet {
  background: #5c6bc0;
}

.chatbot-step-icon.end {
  background: #2e7d32;
}

.chatbot-start h4,
.chatbot-step h4 {
  margin: 6px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.chatbot-questions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chatbot-question-body {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-question-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.chatbot-slot input {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 170px;
}

.chatbot-question-actions {
  margin-left: auto;
  display: inline-flex;
}

/* Speech bubbles */
.chatbot-bubble {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chatbot-bubble-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8eaf6;
  color: #3949ab;
  flex-shrink: 0;
  margin-top: 4px;
}

.chatbot-bubble textarea {
  flex: 1;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 8px 12px;
  border: 1px solid #c5cae9;
  border-radius: 4px 14px 14px 14px;
  background: #eef0fb;
  resize: vertical;
}

.chatbot-bubble textarea:focus {
  outline: 2px solid #7986cb;
  background: #ffffff;
}

.chatbot-bubble.retry .chatbot-bubble-avatar {
  background: #fff3e0;
  color: #e65100;
}

.chatbot-bubble.retry textarea {
  background: #fff8e1;
  border-color: #ffcc80;
  font-size: 13px;
}

.chatbot-bubble.end .chatbot-bubble-avatar {
  background: #e8f5e9;
  color: #2e7d32;
}

.chatbot-bubble.end textarea {
  background: #edf7ee;
  border-color: #a5d6a7;
}

.chatbot-answers,
.chatbot-retry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 32px;
}

.chatbot-answers-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.chatbot-answers-label select,
.chatbot-answers-label input {
  font: inherit;
  font-weight: 400;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.chatbot-answers-label input[type='number'] {
  width: 48px;
}

.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.chatbot-chips input {
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px dashed var(--color-border);
  border-radius: 999px;
  min-width: 140px;
}

.chatbot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.chatbot-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 0 0 2px;
  font-size: 13px;
  color: inherit;
}

.chatbot-chip.said {
  background: #e0f2f1;
  border-color: #80cbc4;
  color: #00695c;
}

.chatbot-chip.answer {
  background: #e0f2f1;
  border-color: #4db6ac;
  color: #004d40;
}

.chatbot-chip.any {
  background: #f3e5f5;
  border-color: #ce93d8;
  color: #6a1b9a;
}

.chatbot-chip.more {
  color: var(--color-muted);
}

.chatbot-chip-count {
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.chatbot-add {
  margin: 0 0 16px 44px;
}

.chatbot-issues {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.chatbot-issues .error {
  color: #b71c1c;
}

.chatbot-issues .warning {
  color: #8a4b00;
}

/* The phone preview */
.chatbot-phone {
  width: 300px;
  height: 560px;
  border: 10px solid #1f2430;
  border-radius: 34px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(31, 36, 48, 0.25);
  position: sticky;
  top: 0;
}

.chatbot-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #3949ab;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.chatbot-phone-head .icon-button {
  color: #ffffff;
}

.chatbot-phone-screen {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f4f5fa;
}

.chatbot-message {
  max-width: 85%;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 12px;
  white-space: pre-wrap;
  animation: chatbot-pop 0.2s ease-out;
}

@keyframes chatbot-pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chatbot-message.bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #dfe2f3;
  border-top-left-radius: 4px;
}

.chatbot-message.bot.retry {
  background: #fff8e1;
  border-color: #ffe0b2;
}

.chatbot-message.bot.end {
  background: #edf7ee;
  border-color: #c8e6c9;
}

.chatbot-message.contact {
  align-self: flex-end;
  background: #00897b;
  color: #ffffff;
  border-top-right-radius: 4px;
}

.chatbot-message.system {
  align-self: center;
  max-width: 100%;
  font-size: 11px;
  color: var(--color-muted);
  background: transparent;
  text-align: center;
}

.chatbot-saved {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px dashed #9fa8da;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chatbot-saved code {
  font-size: 11px;
  color: #3949ab;
  margin-right: 4px;
}

.chatbot-phone-answers {
  border-top: 1px solid var(--color-border);
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 170px;
  overflow-y: auto;
}

.chatbot-quick {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #00897b;
  background: #ffffff;
  color: #00695c;
  cursor: pointer;
}

.chatbot-quick:hover {
  background: #e0f2f1;
}

.chatbot-quick.not-understood {
  border-color: #ffb74d;
  color: #8a4b00;
}

.chatbot-type {
  width: 100%;
}

.chatbot-type input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

/* Answers */
.chatbot-type-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-type-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.chatbot-type-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.chatbot-values {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 13px;
}

.chatbot-values th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  padding: 4px;
}

.chatbot-values td {
  padding: 3px 4px;
  vertical-align: top;
}

.chatbot-values td:first-child {
  width: 30%;
}

.chatbot-values input,
.chatbot-values textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.chatbot-values input {
  font-weight: 600;
  color: #004d40;
  background: #f1faf9;
}

@media (max-width: 1100px) {
  .chatbot-workspace {
    grid-template-columns: 1fr;
  }

  .chatbot-preview {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }
}

/* Texts grow with the paragraph (AutoTextarea) */
.chatbot-bubble textarea {
  resize: none;
  overflow: hidden;
}

/* The chatbot's name, status, notes and comments */
.chatbot-bot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chatbot-bot-head h3 {
  margin: 0;
  font-size: 18px;
}

.chatbot-notes {
  border: 1px solid #f1d48a;
  background: #fffbea;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.chatbot-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-notes-head h4 {
  margin: 0;
  font-size: 12px;
  color: #7a5200;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chatbot-notes textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.chatbot-notes textarea:hover,
.chatbot-notes textarea:focus {
  border-color: #f1d48a;
  background: #ffffff;
}

.chatbot-notes-text {
  margin: 6px 0 0;
  font-size: 13px;
  white-space: pre-wrap;
}

/* Comments */
.chatbot-comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.chatbot-comments-toggle:hover,
.chatbot-comments-toggle.open {
  border-color: var(--color-border);
  background: #ffffff;
}

.chatbot-comments-toggle.has-comments {
  background: #fff4d6;
  border-color: #f1d48a;
  color: #7a5200;
}

.chatbot-thread {
  border-left: 3px solid #f1d48a;
  background: #fffdf3;
  border-radius: 0 8px 8px 0;
  padding: 6px 10px;
  font-size: 13px;
}

.chatbot-thread ul {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-thread li.resolved {
  opacity: 0.6;
}

.chatbot-thread-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.chatbot-thread-head strong {
  color: var(--color-text);
}

.chatbot-thread-resolved {
  font-size: 10px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 999px;
  background: #e3f4e8;
  color: #1d6b35;
}

.chatbot-thread-actions {
  margin-left: auto;
  display: inline-flex;
}

.chatbot-thread p {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.chatbot-thread-more {
  font-size: 12px;
}

.chatbot-thread-add {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin-top: 4px;
}

.chatbot-thread-add textarea {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.chatbot-chip-commented {
  color: #b07800;
}

/* Choosing the answers a question takes */
.chatbot-answer-picker {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chatbot-answer-new {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.chatbot-chip code {
  font-size: 11px;
}

/* The contact form fields an answer fills in */
.chatbot-form-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 32px;
}

.chatbot-form-target {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-chip.field {
  background: #e6f0fb;
  border-color: #a9c9ee;
  color: #1659a8;
}

.chatbot-chip.field code {
  font-size: 10px;
  opacity: 0.75;
}

.chatbot-form-warning {
  font-size: 11px;
  color: #8a4b00;
  padding-left: 10px;
}

.chatbot-form-fields select {
  font: inherit;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px dashed var(--color-border);
  border-radius: 999px;
  max-width: 320px;
}

/* Kinds of answers */
.chatbot-kind {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 7px;
  border-radius: 999px;
}

.chatbot-kind.list {
  background: #e0f2f1;
  color: #00695c;
}

.chatbot-kind.pattern {
  background: #ede7f6;
  color: #4527a0;
}

.chatbot-kind.builtin {
  background: #f3e5f5;
  color: #6a1b9a;
}

.chatbot-type-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
}

.chatbot-builtins {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.chatbot-builtins li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chatbot-values-actions {
  white-space: nowrap;
}

.chatbot-values-comments td {
  padding-top: 0;
}

/* Patterns */
.chatbot-pattern {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chatbot-pattern-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chatbot-pattern-input {
  font-family: ui-monospace, Consolas, monospace;
  min-width: 220px;
}

.chatbot-pattern-problem {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: var(--color-error-text);
}

.chatbot-pattern-try {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.chatbot-pattern-try input {
  font: inherit;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.chatbot-pattern-yes,
.chatbot-pattern-no {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.chatbot-pattern-yes {
  color: #1d6b35;
}

.chatbot-pattern-no {
  color: #8a4b00;
}

/* New chatbot */
.chatbot-list-add {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

.chatbot-list-text .design-status-group {
  margin-top: 3px;
}

.chatbot-new {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
}

.chatbot-new h3 {
  margin: 0;
}

.chatbot-new-actions,
.chatbot-start-options {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Contact form fields: plain field names; "first of" groups */
.chatbot-info {
  display: inline-flex;
  cursor: help;
}

.chatbot-first-of {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.chatbot-field-name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.chatbot-chip.field .chatbot-field-name code {
  font-size: 12px;
  opacity: 1;
}

.chatbot-field-or {
  margin: 0 4px;
  opacity: 0.6;
}

.chatbot-chip .chatbot-field-or-select {
  font: inherit;
  font-size: 11px;
  border: 1px dashed #a9c9ee;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  padding: 0 4px;
  max-width: 64px;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

/* The help panel: beside the configurator on the right, open while working */
.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: 100vw;
  background: var(--color-surface);
  color: var(--color-text);
  border-left: 1px solid var(--color-border);
  box-shadow: -12px 0 32px rgba(25, 43, 51, 0.14);
  animation: help-panel-in 200ms ease-out;
}

@keyframes help-panel-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-panel {
    animation: none;
  }
}

.help-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--color-header);
  color: var(--color-header-text);
}

.help-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.help-area {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
}

.help-close {
  margin-left: auto;
  display: flex;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: inherit;
  cursor: pointer;
}

.help-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.help-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 16px 6px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-muted);
}

.help-search:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.help-search input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
}

.help-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 24px;
  font-size: 14px;
  line-height: 1.5;
}

.help-section-title {
  margin: 16px 0 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.help-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-article-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
}

.help-article-link svg {
  flex-shrink: 0;
  color: var(--color-accent);
}

.help-article-link:hover {
  background: var(--color-accent-soft);
}

/* A guide with a "Show me" tour */
.help-badge-tour {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.help-badge + .help-badge {
  margin-left: 4px;
}

.help-badge {
  display: inline-block;
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}

.help-best {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 10px;
  background: var(--color-surface);
}

.help-best .help-section-title {
  margin-top: 0;
}

.help-best h3,
.help-article h3 {
  margin: 4px 0 8px;
  font-size: 16px;
}

.help-unanswered {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--color-bg);
}

.help-unanswered .secondary-button,
.help-best .secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 4px;
}

.help-markdown h4 {
  margin: 16px 0 6px;
  font-size: 14px;
}

.help-markdown h5 {
  margin: 12px 0 4px;
  font-size: 13px;
}

.help-markdown p,
.help-markdown ul,
.help-markdown ol {
  margin: 0 0 10px;
}

.help-markdown ul,
.help-markdown ol {
  padding-left: 20px;
}

.help-markdown li {
  margin-bottom: 4px;
}

.help-markdown code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--color-bg);
  font-size: 12px;
}

/* A guide's numbered steps: numbered circles joined by a line */
.help-markdown ol.help-steps {
  list-style: none;
  padding-left: 0;
  counter-reset: help-step;
}

.help-markdown ol.help-steps li {
  position: relative;
  margin: 0;
  padding: 0 0 14px 36px;
  counter-increment: help-step;
}

.help-markdown ol.help-steps li::before {
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.help-markdown ol.help-steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 26px;
  bottom: 2px;
  width: 2px;
  background: var(--color-accent-soft);
}

.help-tip {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-accent-soft);
  font-size: 13px;
}

.help-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
}

.help-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-muted);
}

.help-feedback .help-unanswered {
  width: 100%;
  color: var(--color-text);
}

.help-feedback-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font: inherit;
  font-size: 12px;
  color: var(--color-text);
  cursor: pointer;
}

.help-feedback-button:hover {
  background: var(--color-accent-soft);
}

.help-staff-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
}

.help-questions ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-questions li {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

/* "Help" in the top bar */
.top-bar-help {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: none;
  color: var(--color-header-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.top-bar-help:hover,
.top-bar-help[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.14);
}

.top-bar-help + .top-bar-user {
  margin-left: 0;
}

/* While it's open, the configurator makes room for it (on wide screens; on narrow ones it's on top) */
@media (min-width: 1100px) {
  .app.help-open {
    margin-right: 400px;
  }
}

/* A section's title, with "Need help?" to its right */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.panel .section-title-row h2 {
  margin: 0;
}

.need-help {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.need-help:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

/* A guide's "Show me": what to look at, ringed, the rest of the page a little dimmer (still usable) */
.tour-spotlight {
  position: fixed;
  z-index: 2000;
  border-radius: 10px;
  outline: 3px solid var(--color-accent);
  box-shadow: 0 0 0 9999px rgba(15, 25, 35, 0.35);
  pointer-events: none;
  transition: left 200ms ease, top 200ms ease, width 200ms ease, height 200ms ease;
  animation: tour-pulse 1.6s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%,
  100% {
    outline-offset: 0;
  }
  50% {
    outline-offset: 3px;
  }
}

.tour-card {
  position: fixed;
  z-index: 2001;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 12px 32px rgba(25, 43, 51, 0.24), 0 2px 6px rgba(25, 43, 51, 0.1);
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
}

.tour-card.shown {
  opacity: 1;
  animation: step-help-in 160ms ease-out;
  transition: left 200ms ease, top 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight,
  .tour-card.shown {
    animation: none;
    transition: none;
  }
}

.tour-card-head {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.tour-progress {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.tour-close {
  margin-left: auto;
  display: flex;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.tour-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.tour-missing {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8e1;
  font-size: 13px;
}

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.tour-actions .link-button,
.tour-next {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.help-best-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.help-show-me {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 10px;
  padding: 5px 12px;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.help-best-actions .help-show-me {
  margin: 0;
}

.help-show-me:hover {
  background: var(--color-surface);
}

/* Aselo staff: the questions sent, grouped */
.help-sent-questions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help-sent-questions li {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.help-sent-question {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.help-count {
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 10px;
  background: #ef6c00;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.help-sent-question .help-count {
  margin-left: auto;
}

.help-sent-closest {
  font-size: 13px;
}

.help-copy {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
}

/**
 * Copyright (C) 2021-2026 Technology Matters
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/.
 */

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-text: #192b33;
  --color-muted: #6b7a85;
  --color-border: #d4d9de;
  --color-accent: #1876d2;
  --color-accent-soft: #e6f0fb;
  --color-header: #192b33;
  --color-header-text: #ffffff;
  --color-error-bg: #fdecea;
  --color-error-text: #8a1c12;
  --color-pii-bg: #fff4e5;
  --color-pii-text: #8a4b00;
  --radius: 6px;
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--color-text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--color-header);
  color: var(--color-header-text);
  flex-wrap: wrap;
}

.top-bar h1 {
  font-size: 18px;
  margin: 0;
}

/* The Aselo Configurator logo: the mark, then the name */
.aselo-configurator-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.aselo-configurator-logo svg {
  display: block;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.aselo-configurator-name {
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.8);
}

.aselo-configurator-name strong {
  font-weight: 700;
  color: #ffffff;
}

.top-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar select {
  padding: 4px 8px;
  border-radius: var(--radius);
}

/* Forms / Contact flows */
.area-switch {
  display: flex;
  gap: 4px;
}

.area-switch button {
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 12px;
  cursor: pointer;
  opacity: 0.75;
}

.area-switch button:hover {
  opacity: 1;
}

.area-switch button.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.staff-toggle {
  margin-left: auto;
  font-size: 13px;
}

.staff-toggle input {
  margin: 0;
}

.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 16px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.sidebar h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin: 16px 0 8px;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--color-bg);
}

.nav-item.active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

/* A section the draft changes */
.nav-edited {
  float: right;
  margin-left: 6px;
}

.nav-item.active .nav-edited {
  background: var(--color-surface);
}

.main {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-muted);
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.panel h2 {
  font-size: 16px;
  margin: 0 0 16px;
}

.muted {
  color: var(--color-muted);
}

.count {
  font-size: 13px;
  font-weight: normal;
  margin-left: 8px;
}

.alert {
  margin: 16px 24px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
}

.main .alert {
  margin: 0 0 16px;
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

/* Form preview - two columns, like the contact and case forms in Aselo */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  border: none;
}

.field-label {
  font-weight: 600;
  font-size: 13px;
}

.field-required {
  font-weight: 400;
  color: var(--color-muted, #666);
}

.required {
  color: #c62828;
  margin-left: 2px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge-pii {
  background: var(--color-pii-bg);
  color: var(--color-pii-text);
}

.field input[type='text'],
.field input[type='search'],
.field input[type='email'],
.field input[type='number'],
.field input[type='date'],
.field input[type='time'],
.field select,
.field textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: inherit;
  width: 100%;
}

/* Box and text stay on one line; long text wraps beside the box, hints go underneath */
.field-checkbox {
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 2px;
}

.field-checkbox input[type='checkbox'] {
  flex-shrink: 0;
  margin: 2px 0 0;
}

.field-checkbox > span:not(.field-hint) {
  flex: 1 1 0;
  min-width: 0;
}

.field-checkbox > .field-hint {
  flex-basis: 100%;
  padding-left: 21px;
}

.field-hint {
  font-size: 12px;
  color: var(--color-muted);
}

.inline-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  padding: 2px 0;
}

.listbox {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  max-height: 180px;
  overflow: auto;
}

.custom-component {
  padding: 10px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-size: 13px;
}

.call-type-button {
  padding: 8px 16px;
  margin: 0 8px 8px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

/* Issue categories */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.category {
  border: 1px solid var(--color-border);
  border-top: 4px solid;
  border-radius: var(--radius);
  padding: 12px;
}

.category h3 {
  font-size: 14px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Case statuses */
.status-table {
  border-collapse: collapse;
  width: 100%;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
}

/* Buttons */
.primary-button,
.secondary-button,
.danger-button {
  font: inherit;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-button {
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
}

.secondary-button {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: inherit;
}

.danger-button {
  background: var(--color-surface);
  border-color: #c62828;
  color: #c62828;
}

.primary-button:disabled,
.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link-button {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
}

.top-bar .link-button {
  color: inherit;
}

.icon-button {
  font-size: 18px;
  line-height: 1;
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.icon-button:hover {
  color: #c62828;
}

/* Draft / action bar */
.action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.action-bar .primary-button {
  margin-left: auto;
}

.change-count {
  color: var(--color-muted);
}

.change-count.has-changes {
  color: var(--color-text);
  font-weight: 600;
}

.alert-info {
  background: var(--color-accent-soft);
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-error-count {
  float: right;
  background: #c62828;
  color: #ffffff;
  border-radius: 10px;
  font-size: 11px;
  padding: 0 7px;
}

/* Reviewing forms (formReviews.ts): a check per side, a grey dot once what was approved
   changed, and an icon per kind of flag; the same in the menu, on field cards and in threads */
.review-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: -2px;
  margin-right: 4px;
}

.approval-helpline.approval-approved {
  color: #1565c0;
}

.approval-aselo.approval-approved {
  color: #2e7d32;
}

.approval-changed {
  color: var(--color-muted);
  font-size: 10px;
}

.flag-question {
  color: #1565c0;
}

.flag-attention {
  color: #b28704;
}

.flag-changes {
  color: #ef6c00;
}

.flag-note {
  color: var(--color-muted);
}

.flag-answered {
  opacity: 0.55;
}

.nav-review {
  margin-right: 4px;
}

.review-progress {
  color: var(--color-muted);
}

.review-panel {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

.review-panel h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.review-approvals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.review-approval {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.review-threads {
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-thread {
  padding: 6px 0;
  border-top: 1px solid var(--color-border);
}

.review-thread.resolved {
  opacity: 0.6;
}

.review-thread p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.review-thread-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.review-thread-for {
  background: var(--color-accent-soft);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 12px;
}

.review-thread-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.review-reply {
  margin: 6px 0 0 18px;
  padding-left: 8px;
  border-left: 2px solid var(--color-border);
}

.review-reply-add,
.review-flag-add {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.review-reply-add textarea,
.review-flag-add textarea {
  flex: 1 1 220px;
}

.review-flag-field {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.review-flag-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.try-it-out-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.mode-switch button {
  font: inherit;
  padding: 6px 16px;
  border: none;
  background: var(--color-surface);
  cursor: pointer;
}

.mode-switch button.active {
  background: var(--color-accent);
  color: #ffffff;
}

/* Editor: canvas + settings panel */
.editor {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.editor-canvas {
  flex: 1;
  min-width: 0;
}

.editor-hint {
  margin-top: -8px;
}

.editor-settings {
  width: 340px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

@media (max-width: 1100px) {
  .editor {
    flex-direction: column;
  }
  .editor-settings {
    width: 100%;
    position: static;
    max-height: none;
  }
}

.editor-column {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-card {
  position: relative;
  padding: 10px 12px 2px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: grab;
  touch-action: none;
}

.field-card:hover {
  border-color: var(--color-border);
  background: #fafbfc;
}

.field-card:focus-visible {
  outline: 2px solid var(--color-accent);
}

.field-card.selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.field-card.has-error {
  border-color: #c62828;
}

.field-card.dragging {
  opacity: 0.35;
}

.field-card.drag-overlay {
  cursor: grabbing;
  border-color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(25, 43, 51, 0.18);
}

.field-card-preview {
  pointer-events: none;
}

.field-card-badges {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.field-card-badges .badge {
  margin-left: 0;
}

.badge-new {
  background: #e3f4e8;
  color: #1d6b35;
}

.badge-edited {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.add-field-button {
  font: inherit;
  padding: 10px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: none;
  color: var(--color-accent);
  cursor: pointer;
}

.add-field-button:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.add-field-menu {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--color-surface);
}

.add-field-menu-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.add-field-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.field-type-option {
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-type-option:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.field-type-option .muted {
  font-size: 12px;
}

.field-type-name {
  font-weight: 600;
}

/* Field settings */
.field-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.field-settings-header h3,
.settings-empty h3 {
  margin: 0;
  font-size: 15px;
}

.read-only-value {
  padding: 8px 0;
}

.staff-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 16px;
}

.staff-section summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.references {
  margin-bottom: 16px;
}

.references ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--color-muted);
}

.field-settings-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.issue-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue {
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
}

.issue-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.issue-warning {
  background: var(--color-pii-bg);
  color: var(--color-pii-text);
}

/* Answers editor */
.option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  background: var(--color-surface);
}

.option-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-inputs input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100%;
}

.drag-handle {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: grab;
  padding: 6px 4px;
  touch-action: none;
  letter-spacing: -3px;
}

.option-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.bulk-add {
  margin-top: 8px;
}

/* Review dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 43, 51, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow: auto;
  z-index: 10;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.review-section {
  margin-top: 20px;
}

.review-section h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.review-section ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-section summary {
  cursor: pointer;
  font-weight: 600;
}

.review-section .badge {
  margin: 0 6px 0 0;
}

.modal-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-footer p {
  flex: 1;
  margin: 0;
}

.success-text {
  color: #1d6b35;
}

/* Linked dropdowns: menu entry, field settings, wizard */
.add-field-menu .field-type-wide {
  grid-column: 1 / -1;
}

.linked-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--color-accent-soft);
}

.linked-chain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wizard-start {
  margin-top: 16px;
}

.wizard-start .field-checkbox {
  display: flex;
}

.wizard-levels {
  margin: 16px 0;
  padding-left: 0;
  list-style: none;
}

.wizard-levels li {
  margin-bottom: 4px;
}

/* Linked answers editor: one column per level */
.modal-wide {
  max-width: 1200px;
}

.linked-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}

.linked-toolbar p {
  flex: 1;
  margin: 0;
  min-width: 240px;
}

.answer-columns {
  display: grid;
  gap: 12px;
  overflow-x: auto;
}

.answer-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 320px;
  max-height: 60vh;
  overflow: hidden;
}

.answer-column-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.answer-column-header .link-button {
  margin-left: auto;
  font-size: 12px;
}

.answer-column-empty {
  margin: auto 0;
  text-align: center;
}

.answer-search,
.answer-add input,
.answer-edit,
.bulk-add textarea {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100%;
}

.answer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
}

.answer-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius);
  background: var(--color-surface);
}

.answer-row.selected {
  background: var(--color-accent-soft);
}

.answer-label {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  text-align: left;
  padding: 6px 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

.answer-row.selected .answer-label {
  color: var(--color-accent);
  font-weight: 600;
}

.answer-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-child-count {
  color: var(--color-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.answer-add {
  display: flex;
  gap: 6px;
}

.answer-paste {
  align-self: flex-start;
  font-size: 13px;
}

/* Spreadsheet import */
.spreadsheet-import {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.import-example,
.import-preview table {
  border-collapse: collapse;
  font-size: 13px;
}

.import-example th,
.import-example td,
.import-preview th,
.import-preview td {
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  text-align: left;
}

.import-example th,
.import-preview th {
  background: var(--color-bg);
}

.import-preview {
  overflow-x: auto;
}

.import-summary {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-button {
  position: relative;
  display: inline-block;
}

.file-button input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Section editors (call types, canned responses, messages): editor + live preview */
.section-editor {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.section-editor-main {
  flex: 1;
  min-width: 0;
}

.section-preview {
  width: 440px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 1200px) {
  .section-editor {
    flex-direction: column;
  }
  .section-preview {
    width: 100%;
    position: static;
  }
}

.section-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-preview-frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #ffffff;
  max-height: calc(100vh - 200px);
  overflow: auto;
}

.section-preview-frame .aselo-tab-content {
  min-height: 0;
  padding-bottom: 32px;
}

.section-preview-frame .aselo-call-types {
  margin-top: 16px;
}

.section-preview-hint {
  padding: 0 16px 12px;
}

.section-heading {
  font-size: 14px;
  margin: 24px 0 8px;
}

.sortable-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sortable-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  background: var(--color-surface);
}

.sortable-row-content {
  flex: 1;
  min-width: 0;
}

.row-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-inline input,
.canned-response-row textarea,
.message-card textarea,
.language-add input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100%;
}

.row-inline input:disabled {
  background: var(--color-bg);
  color: var(--color-muted);
}

.canned-response-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

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

.language-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.language-tabs button {
  font: inherit;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
}

.language-tabs button.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

.language-add input {
  width: 190px;
}

.top-bar-user {
  margin-left: auto;
  font-size: 13px;
  opacity: 0.85;
}

.top-bar .staff-toggle {
  margin-left: 0;
}

.draft-status {
  margin-left: 0;
}

.draft-updated {
  font-size: 12px;
}

.drafts-list {
  max-width: 900px;
  margin: 24px auto 0;
  text-align: left;
}

/* Webchat form */
.webchat-question {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.webchat-question.selected {
  border-color: var(--color-accent);
}

.webchat-question-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.webchat-question-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.webchat-field-settings {
  padding: 4px 10px 10px;
  border-top: 1px solid var(--color-border);
}

/* The frame wraps the webchat window, so only the window's form scrolls (as in the real webchat) */
.section-preview-frame.webchat-preview-frame {
  display: flex;
  justify-content: center;
  padding: 24px 12px;
  background: var(--color-bg);
  max-height: none;
  overflow: visible;
}

.webchat-preview-frame .webchat-window {
  height: min(590px, calc(100vh - 260px));
  min-height: 360px;
}

.prepopulate-targets {
  list-style: none;
  margin: 4px 0;
  padding: 0;
}

.prepopulate-targets li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.prepopulate-warning {
  flex-basis: 100%;
  color: var(--color-pii-text);
}

/* Issue categories */
.category-row {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.category-row.selected {
  border-color: var(--color-accent);
}

.category-row input[type='color'] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  flex-shrink: 0;
}

.category-row .row-inline input[type='text'] {
  flex: 1;
  min-width: 0;
}

.subcategories-editor {
  margin: 8px 0 4px 36px;
}

.subcategory-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subcategory-row .row-inline input {
  flex: 1;
  min-width: 0;
}

.toolkit-url {
  font-size: 12px;
}

.narrow-input {
  width: 80px;
}

.issue-error-text {
  color: var(--color-error-text);
}

/* Case statuses */
.status-row {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.status-row .row-inline input[type='text'] {
  flex: 1;
  min-width: 0;
}

.status-row .status-pill:empty {
  display: inline-block;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
}

.status-transitions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 0;
  padding: 0;
  border: none;
}

.status-transitions legend {
  float: left;
  margin-right: 8px;
  color: var(--color-muted);
}

.missing-status span {
  color: var(--color-error-text);
}

.case-status-preview {
  padding: 16px;
}

.case-status-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Case sections */
.case-section-row {
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.case-section-row .row-inline > input[type='text'] {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.case-section-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0 12px;
  margin-top: 6px;
}

.case-page-preview {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-page-timeline,
.case-page-section {
  padding: 10px 12px;
  border-radius: 4px;
  background: #f6f6f6;
}

.case-page-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.case-page-section-title {
  flex: 1;
  font-weight: 700;
}

.case-page-add {
  border: none;
  background: none;
  color: var(--color-accent);
  font: inherit;
  font-weight: 600;
  cursor: default;
}

.case-page-preview-row {
  flex-basis: 100%;
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--color-muted);
}

/* Helpline features */
.features-panel {
  max-width: 760px;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.feature-switch input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
}

.feature-switch .badge {
  margin-left: 8px;
}

.feature-switch .field-hint {
  display: block;
}

.feature-fixed {
  width: 18px;
  text-align: center;
  color: var(--color-muted);
}

/* Client profiles */
.profile-section-row {
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.profile-section-row .row-inline > input[type='text'],
.flag-duration-row > input[type='text'] {
  flex: 1;
  min-width: 0;
}

.profile-section-row .row-inline > input[type='text'] {
  font-weight: 600;
}

.duration-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.duration-input input {
  width: 70px;
}

.profile-preview {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-preview-flags ul {
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
}

.profile-preview-flags li {
  padding: 4px 12px;
}

.profile-preview-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-preview-box {
  min-height: 60px;
  margin-top: 4px;
  padding: 8px;
  border-radius: 4px;
  background: #f6f6f6;
  color: var(--color-muted);
}

.badge-help {
  background: #fffeef;
  color: #6b5a00;
  border: 1px solid #e8e2a8;
}

/* Service configuration */
.service-config-panel {
  max-width: 1100px;
}

.config-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.config-toolbar input[type='search'] {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-width: 260px;
}

.config-toolbar select,
.config-files-table select,
.config-input-row input,
.config-json textarea,
.config-file-json textarea {
  font: inherit;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.config-group h3,
.config-add h3 {
  font-size: 14px;
  margin: 20px 0 8px;
}

.config-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

.config-table th,
.config-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  overflow-wrap: anywhere;
}

.config-table th {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 600;
}

.config-table th:first-child {
  width: 45%;
}

.config-table .field-hint {
  display: block;
}

.config-row-open > td {
  background: var(--color-accent-soft);
  border-bottom: none;
}

.config-row-editor > td {
  background: var(--color-accent-soft);
}

.config-setting-name {
  font: inherit;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-accent);
  cursor: pointer;
  text-align: left;
}

.config-setting-name code {
  font-size: 13px;
}

.badge-env {
  background: #ede7f6;
  color: #4527a0;
}

.config-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
}

.config-on {
  background: #e3f4e8;
  color: #1b6b35;
}

.config-off {
  background: #eceff1;
  color: #4f5e6a;
}

.config-value {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
}

.config-source {
  display: block;
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
}

.config-setting-editor .issue {
  margin: 0 0 8px;
}

.config-files-table {
  border-collapse: collapse;
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius);
}

.config-files-table th,
.config-files-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.config-files-table th {
  width: 220px;
  font-weight: 600;
}

.config-files-table .field-hint {
  display: block;
  font-weight: normal;
}

.config-not-set,
.config-input-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.config-input-row input[type='text'] {
  min-width: 360px;
}

.config-json {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.config-json textarea,
.config-file-json textarea {
  width: 100%;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
}

.config-add {
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
}

.config-add-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.config-add-fields .field {
  margin-bottom: 0;
}

.config-add-fields .field:first-child input {
  min-width: 320px;
}

/* Sign-in (auth.ts) */
.sign-in-error {
  margin: 48px auto;
  max-width: 480px;
  text-align: center;
}

/* Saved values of answers (OptionsEditor) */
.option-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-value .field-hint {
  white-space: nowrap;
}

.option-inputs .option-value input {
  padding: 3px 6px;
  font-size: 0.9em;
}

.option-value-locked {
  font-size: 0.9em;
  color: var(--color-muted);
}

.options-editor .option-actions .field-hint {
  flex: 1;
}

.bulk-add code {
  font-size: 0.95em;
}

/* Filling in the contact (formSelector) */
.form-selector-summary {
  font-weight: 600;
}

.form-selector-steps {
  margin: 0.5rem 0 1rem;
}

.form-selector-diagram {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-selector-outcome {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) auto minmax(12rem, 2fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.form-selector-when {
  font-weight: 600;
}

.form-selector-arrow {
  color: var(--color-muted);
  font-size: 1.25rem;
}

.form-selector-tab {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  margin-right: 0.25rem;
}

.form-selector-kind,
.form-selector-tabs {
  border: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

.form-selector-choices {
  padding-left: 1.25rem;
}

.form-selector-choices li {
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.form-selector-choices label {
  display: flex;
  flex-direction: column;
  font-size: 0.9em;
}

.form-selector-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 20rem;
}

/* formSelector, edited as written (FormSelectorEditor) */
.form-selector-file {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-muted);
  margin-left: 8px;
}

.form-selector-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.form-selector-row-block {
  flex-direction: column;
  align-items: flex-start;
}

.form-selector-key {
  font-weight: 600;
  min-width: 170px;
}

.form-selector-info {
  display: inline-flex;
  color: var(--color-muted);
  cursor: help;
  vertical-align: middle;
}

.form-selector-checks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-selector-table {
  border-collapse: collapse;
  font-size: 13px;
}

.form-selector-table th,
.form-selector-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.form-selector-table th {
  font-weight: 600;
  white-space: nowrap;
}

.form-selector-table input,
.form-selector-table select {
  font: inherit;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.form-selector-actions {
  white-space: nowrap;
}

.form-selector-tab-key {
  display: inline-block;
  margin-right: 6px;
}

.form-selector-json {
  font-size: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  overflow-x: auto;
}

/* Post-call surveys (postStudioFlows) in the service configuration */
.config-post-flows {
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
}

.config-post-flows h3 {
  font-size: 14px;
  margin: 20px 0 8px;
}

.config-post-flows-table select {
  max-width: 100%;
}

.config-post-flows-warning {
  color: var(--color-pii-text);
}

/* One line each, the size of the status above them */
.drafts-changes-needed {
  margin-top: 4px;
  color: #ef6c00;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

/* The branch a version was imported from, under its name, linking to it on GitHub */
.drafts-branch {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 11px;
  font-weight: 400;
  color: var(--color-muted);
  text-decoration: none;
}

.drafts-branch:hover {
  text-decoration: underline;
}

/* Something is loading: a spinner and what it is */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--color-muted);
}

.loading-inline {
  display: inline-flex;
  justify-content: flex-start;
  padding: 0;
  font-size: 0.85em;
  gap: 6px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.loading-inline .loading-spinner {
  width: 12px;
  height: 12px;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 2.4s;
  }
}

