/* SnowaOS — project Labels (design prototype, SNO-725).
   Composed from existing pms2 pieces:
   - Labels tab: .panel (pms2-workflow-config.html → Full editor tabs)
   - Swatches: .typ-sw geometry (pms2-workflow-config.html → Issue types)
   - Chip: .pill-tag geometry (pms2-ticket.html) + the board filter's colour dot
   - Picker: .pu-pop container + .lm-search/.lm-opt rows (pms2-ticket.html) */

/* ===== Chip ===== */
.plb-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 7px; border-radius: 99px; background: var(--paper-2); border: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; max-width: 100%; font-family: inherit; line-height: 1.3; }
.plb-chip__dot { width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0; }
.plb-chip__t { overflow: hidden; text-overflow: ellipsis; }
.plb-chip__g { color: var(--ink-3); }
.plb-chip--sm { font-size: 10.5px; padding: 1px 7px 1px 6px; }
.plb-chip--sm .plb-chip__dot { width: 6px; height: 6px; }
.plb-chip--more { font-family: var(--font-mono); color: var(--ink-3); }
button.plb-chip { cursor: pointer; }
button.plb-chip:hover { border-color: var(--ink-4); color: var(--ink); }
.plb-chip__x { color: var(--ink-4); display: inline-flex; margin-left: 1px; }
button.plb-chip:hover .plb-chip__x { color: var(--ink-2); }
.plb-row { display: flex; gap: 4px; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.plb-row--wrap { flex-wrap: wrap; }
.bcard .plb-row { margin-top: 8px; }
.plb-add { font-size: 12.5px; color: var(--ink-4); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border: 0; background: transparent; padding: 3px 0; font-family: inherit; }
.plb-add:hover { color: var(--ink-2); }

/* ===== Full editor → Labels tab ===== */
.plb-head__acts { display: flex; gap: 6px; flex-shrink: 0; }
.plb-locked { display: flex; gap: 12px; align-items: center; padding: 12px 20px; color: var(--ink-3); font-size: 12px; line-height: 1.5; border-bottom: 1px solid var(--line-2); background: var(--paper-2); }
.plb-locked svg { flex-shrink: 0; }
.plb-locked[hidden], .plb-head__acts[hidden] { display: none; }
.plb-tools { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.plb-tools .search { flex: 1; max-width: 320px; }
.plb-tools__n { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-4); white-space: nowrap; }
.plb-th, .plb-tr { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px 30px; gap: 12px; align-items: center; padding: 0 20px; }
.plb-th { height: 32px; background: var(--paper-2); border-bottom: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); }
.plb-th span:nth-child(3) { text-align: right; }
.plb-tr { min-height: 52px; border-bottom: 1px solid var(--line-2); }
.plb-tr:last-child { border-bottom: 0; }
.plb-tr:hover { background: var(--paper-2); }
.plb-tr--child { padding-left: 50px; }
.plb-sw { width: 16px; height: 16px; border-radius: 5px; border: 0; padding: 0; cursor: pointer; }
.plb-sw:disabled { cursor: default; }
.plb-sw:not(:disabled):hover { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink-4); }
.plb-caret { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; }
.plb-caret:hover { background: var(--paper-3); color: var(--ink); }
.plb-caret svg { transition: transform .12s; }
.plb-tr[aria-expanded="false"] .plb-caret svg { transform: rotate(-90deg); }
.plb-main { min-width: 0; padding: 8px 0; }
.plb-name { border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink); padding: 3px 6px; margin-left: -7px; border-radius: var(--r-sm); font-family: inherit; width: 100%; max-width: 340px; text-overflow: ellipsis; }
.plb-tr--group .plb-name { font-weight: 600; }
.plb-name:not([readonly]):hover { border-color: var(--line); }
.plb-name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--paper); }
.plb-name[readonly] { cursor: default; }
.plb-desc { font-size: 11px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plb-desc .tag { font-size: 9px; margin-right: 6px; vertical-align: 1px; }
.plb-err { font-size: var(--t-xs); color: var(--bad-ink); margin-top: 2px; }
.plb-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.plb-menu { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; }
.plb-menu:hover { background: var(--paper-3); color: var(--ink); }
.plb-empty { padding: 40px 24px; text-align: center; }
.plb-empty__t { font-size: 14px; font-weight: 600; color: var(--ink); }
.plb-empty__d { font-size: 12.5px; color: var(--ink-3); margin: 4px auto 14px; max-width: 46ch; line-height: 1.5; }
.plb-none { padding: 14px 8px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* Swatches */
.plb-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.plb-swatch { width: 22px; height: 22px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; padding: 0; }
.plb-swatch[aria-pressed="true"] { border-color: var(--ink); }

/* ===== Floating panels: colour popover + label picker ===== */
.plb-float { position: fixed; z-index: 95; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; }
.plb-float--sw { padding: 10px; }
.plb-pick { width: 290px; }
.plb-pick .search { width: 100%; margin-bottom: 6px; }
.plb-pick__list { max-height: 300px; overflow-y: auto; }
.plb-pick__grp { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 8px 8px 4px; display: flex; justify-content: space-between; }
.plb-pick__grp i { font-style: normal; color: var(--ink-4); letter-spacing: 0; text-transform: none; font-family: var(--font-base); font-size: 10px; }
.plb-opt { display: grid; grid-template-columns: auto auto 1fr; gap: 9px; align-items: center; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; color: var(--ink-2); }
.plb-opt:hover { background: var(--paper-2); color: var(--ink); }
.plb-opt input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.plb-opt:has(input:checked) { color: var(--ink); font-weight: 500; }
.plb-opt--child { padding-left: 16px; }
.plb-opt .plb-chip__dot { width: 8px; height: 8px; }
.plb-pick__create { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--accent-ink); text-align: left; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.plb-pick__create:hover { background: var(--accent-soft); }
.plb-pick__sep { height: 1px; background: var(--line-2); margin: 5px 2px; }
.plb-pick__foot { font-size: 11px; color: var(--ink-4); padding: 7px 8px 2px; line-height: 1.45; border-top: 1px solid var(--line-2); margin-top: 4px; }
.plb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin: 2px 2px 8px; }
.plb-seg button { padding: 5px 13px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--paper); border: 0; cursor: pointer; font-family: inherit; }
.plb-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Label dialogs use Shell.modal (overlay > .modal__panel). pms2-project.html styles
   its own `.modal` as the centred panel itself, so restore the Shell overlay there. */
body .modal:has(> .modal__panel) {
  inset: 0; top: 0; left: 0; transform: none;
  width: auto; max-width: none; max-height: none; overflow: visible;
  display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px;
  background: oklch(0.18 0.01 260 / 0.42); border: 0; border-radius: 0; box-shadow: none;
  z-index: 70; /* above the page's own modals (61), below dropdown menus (.cselect__menu: 80) */
}

@media (max-width: 767px) {
  .plb-head { flex-direction: column; }
  .plb-head__acts { width: 100%; }
  .plb-head__acts .btn { flex: 1; }
  .plb-tools .search { max-width: none; }
  .plb-tools__n { display: none; }
  .plb-th { display: none; }
  .plb-tr { grid-template-columns: 22px minmax(0, 1fr) auto 30px; padding: 0 14px; gap: 10px; }
  .plb-tr--child { padding-left: 40px; }
  .plb-count::after { content: ' tickets'; font-family: var(--font-base); font-size: 10px; color: var(--ink-4); }
  /* Inside the bottom sheet the picker fills the sheet. */
  .modal .plb-pick { position: static; width: auto; box-shadow: none; border: 0; padding: 0; }
}
