/* AuCRA INSIGHT kit layer, the chips and the pickers: the rules of kit/chips.py,
   kit/name_chips.py, kit/fields_select.py and kit/pick_chips.py. Split from
   kit.css by concern and linked right after it (ui/styles.py), so the cascade
   runs in the order it was written. */

/* ---- kit/chips.py ---- */

.aucra-chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.aucra-chip-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.aucra-chip-toggle:hover {
  border-color: var(--line-strong);
}
.aucra-chip-toggle:active {
  border-color: var(--ink);
}
.aucra-chip-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.aucra-chip-toggle-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  font-weight: 500;
}
/* The hover above carries a pseudo class, so it outranks the plain on rule and
   would otherwise grey a picked chip's border under the pointer. */
.aucra-chip-toggle-on:hover {
  border-color: var(--ink);
}
.aucra-chip-toggle-on:active {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}
/* A row that carries nothing yet says so where the chips are, not in a panel
   somewhere else. */
.aucra-chip-missing {
  font-size: 12px;
  color: var(--gold-deep);
  padding-left: 6px;
}
/* ---- kit/name_chips.py ---- */

.aucra-name-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.aucra-name-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 13px;
}
/* The name field is as wide as the name in it, set in `ch` by kit/fields.py, so
   a row of chips and the Add button after them stay on one line. */
.aucra-name-chip .aucra-field {
  width: auto;
  min-width: 0;
}
/* The chip is the frame, so the name field inside it draws none of its own. */
.aucra-name-chip .aucra-control .q-field__control {
  min-height: 22px;
  height: 22px;
  padding: 0;
}
.aucra-name-chip .aucra-control .q-field__control:before,
.aucra-name-chip .aucra-control .q-field__control:after {
  border: none;
}
.aucra-name-chip .q-field__marginal {
  height: 22px;
}
.aucra-name-chip .q-btn.aucra-icon-btn {
  width: 22px;
  height: 22px;
  /* Quasar's own min-width on a dense round button is 31px, so the chip sets
     both ends of the box. */
  min-width: 22px;
  min-height: 22px;
}

/* ---- kit/fields_select.py ---- */

.aucra-select .q-field__control {
  min-height: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--panel);
}
.aucra-select .q-field__control:before {
  border: 1px solid var(--line);
  border-radius: 6px;
}
.aucra-select .q-field__native,
.aucra-select .q-field__native > span {
  font-size: 12.5px;
  color: var(--text);
}
.aucra-select-empty .q-field__native,
.aucra-select-empty .q-field__native > span {
  color: var(--placeholder);
}
/* Quasar paints a placeholder in the field's own colour at 0.7 opacity, which
   reads as faded text rather than the grey the drawings give it. One rule for
   every box the kit draws: the input and the textarea here, the editor's empty
   mark in content.css, all three on the one token (4.69:1 on the panel). The
   bare Quasar selectors reach a box drawn outside the kit; the header search
   keeps its own, stronger rule for the dark ground. */
.q-field__native::placeholder,
.q-field__input::placeholder,
.aucra-control .q-field__native::placeholder,
.aucra-control .q-field__input::placeholder,
.aucra-control textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}
.aucra-select .q-field__marginal {
  height: 34px;
}
.aucra-select .q-field__append .q-icon {
  font-size: 16px;
  color: var(--muted);
}

/* ---- kit/pick_chips.py ---- */

.aucra-pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}
/* The same height as a toggle chip from kit/chips.py, so a row that carries
   both reads as one line. */
.aucra-pick-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 12.5px;
  line-height: 18px;
}
.aucra-pick-tag {
  font-size: 11px;
  color: var(--muted);
}
.aucra-pick-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.aucra-pick-remove:hover {
  color: var(--text);
}
.aucra-pick-remove:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.aucra-pick-remove .q-icon {
  font-size: 14px;
}
/* The picker is a prompt, not a filled field: a dashed border in the gold the
   page's other prompts use, a plus before its words and a chevron after them. */
.aucra-pick-add {
  display: inline-flex;
  align-items: center;
  /* 3px against the control's 18px floor is the pick chip's 26px, so the
     picker and the chips beside it are one line of equal height. */
  padding: 3px 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: none;
}
.aucra-pick-add:hover {
  border-color: var(--gold);
}
/* Drawn off for a viewer: the prompt's shape in the placeholder grey. */
.aucra-pick-add.aucra-pick-add-off {
  gap: 4px;
  font: inherit;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--placeholder);
  cursor: default;
}
.aucra-pick-add.aucra-pick-add-off:hover {
  border-color: var(--line);
}
.aucra-pick-add-off .q-icon {
  font-size: 14px;
}
/* The focus ring its siblings get on :focus-visible. The focus lands on the
   select's own hidden input inside the field, so the ring is drawn from
   :focus-within on the field. */
.aucra-pick-add:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.aucra-pick-add .q-field__control {
  min-height: 18px;
  height: 18px;
  padding: 0;
}
.aucra-pick-add .q-field__native,
.aucra-pick-add .q-field__native > span {
  font-size: 12.5px;
  line-height: 18px;
  color: var(--gold-deep);
}
/* A select with a display value and no label is still an auto-height field to
   Quasar: it gives the native line a 40px floor and a top pad for the floating
   label that is not there, which dropped the words below the dashed border. */
.aucra-pick-add .q-field__native {
  min-height: 18px;
  padding: 0;
}
.aucra-pick-add .q-field__control-container {
  padding-top: 0;
}
.aucra-pick-add .q-field__inner {
  align-self: center;
}
.aucra-pick-add .q-field__marginal {
  height: 18px;
  padding: 0;
  color: var(--gold-deep);
}
.aucra-pick-add .q-field__prepend {
  padding-right: 4px;
}
.aucra-pick-add .q-icon {
  font-size: 13px;
  color: var(--gold-deep);
}
.aucra-pick-empty {
  font-size: 12px;
  color: var(--muted);
}
