/* Lit Flow workspace toolbar and detail modal. Shared print tape styles are in darkpool.css. */

.legend-widget[data-type-id="lit_flow"] > .legend-widget-header {
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-height: 40px;
}

.legend-widget[data-type-id="lit_flow"] > .legend-widget-header .legend-lf-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  margin-left: 4px;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-mode-toggle {
  flex: 0 0 auto;
  border-color: color-mix(in srgb, #14b8a6 28%, var(--legend-border));
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-mode-btn.is-active {
  background: color-mix(in srgb, #14b8a6 22%, transparent);
  color: #ccfbf1;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters {
  flex: 0 0 auto;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--banana-radius);
  border: 1px solid var(--legend-border);
  background: var(--legend-bg-elevated);
  color: var(--legend-text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-btn:hover {
  color: var(--legend-text);
  border-color: color-mix(in srgb, #14b8a6 35%, var(--legend-border));
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-btn--active {
  color: #ccfbf1;
  border-color: color-mix(in srgb, #14b8a6 40%, var(--legend-border));
  background: color-mix(in srgb, #14b8a6 12%, var(--legend-bg-elevated));
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--banana-radius);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #042f2e;
  background: #14b8a6;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-badge[hidden] {
  display: none !important;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-caret {
  font-size: 9px;
  opacity: 0.75;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 8px;
  z-index: 200;
  width: min(300px, calc(100% - 16px));
  box-sizing: border-box;
  padding: 10px;
  border-radius: var(--banana-radius);
  border: 1px solid color-mix(in srgb, #14b8a6 22%, var(--legend-border));
  background: var(--legend-bg-widget, #141414);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-panel.is-open {
  display: block;
}

.legend-widget[data-type-id="lit_flow"] > .legend-widget-header:has(.legend-lf-filters-panel.is-open) {
  z-index: 50;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filter-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--legend-text-muted);
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filter {
  width: 100%;
  box-sizing: border-box;
  font-size: 11px;
  padding: 5px 7px;
  border-radius: var(--banana-radius);
  border: 1px solid var(--legend-border);
  background: var(--legend-bg-elevated);
  color: var(--legend-text);
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filter:focus {
  outline: none;
  border-color: color-mix(in srgb, #14b8a6 45%, var(--legend-border));
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--legend-border);
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-clear {
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--banana-radius);
  border: 1px solid var(--legend-border);
  background: transparent;
  color: var(--legend-text-muted);
  cursor: pointer;
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-filters-clear:hover {
  color: var(--legend-text);
  background: rgba(255, 255, 255, 0.06);
}

.legend-widget[data-type-id="lit_flow"] .legend-lf-ticker {
  flex: 0 1 auto;
  min-width: 0;
}

.legend-widget[data-type-id="lit_flow"][data-lit-flow-mode="recent"] .legend-lf-ticker {
  display: none;
}

.legend-widget[data-type-id="lit_flow"] .legend-widget-date {
  flex: 0 0 auto;
}

.legend-widget[data-type-id="lit_flow"] .legend-widget-header-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

/* Detail modal */
.lf-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lf-modal[hidden] {
  display: none !important;
}

.lf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.lf-modal__dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: 85vh;
  overflow: auto;
  border-radius: var(--banana-radius);
  border: 1px solid var(--legend-border);
  background: var(--legend-bg-widget, #141414);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lf-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--legend-border);
}

.lf-modal__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--legend-text, #f3f4f6);
}

.lf-modal__close {
  font: inherit;
  font-size: 22px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--legend-text-muted);
  cursor: pointer;
}

.lf-modal__body {
  padding: 12px 16px 16px;
}

.lf-detail-section {
  margin-bottom: 14px;
}

.lf-detail-section__title {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--legend-text-muted);
}

.lf-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 6px 12px;
  font-size: 11px;
}

.lf-detail-list dt {
  margin: 0;
  color: var(--legend-text-muted);
  font-weight: 600;
}

.lf-detail-list dd {
  margin: 0;
  word-break: break-all;
  color: var(--legend-text, #f3f4f6);
}

.lf-modal .dp-detail-section {
  margin-bottom: 14px;
}

.lf-modal .dp-detail-section__title {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--legend-text-muted);
}

.lf-modal .dp-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 6px 12px;
  font-size: 11px;
}

.lf-modal .dp-detail-list dt {
  margin: 0;
  color: var(--legend-text-muted);
  font-weight: 600;
}

.lf-modal .dp-detail-list dd {
  margin: 0;
  word-break: break-all;
  color: var(--legend-text, #f3f4f6);
}

body.litflow-modal-open {
  overflow: hidden;
}
