/* PropertiesPanel — the Obsidian-style metadata table under the title. A quiet
   key → value grid: muted small keys with a leading icon on the left, values on the
   right. No heavy card; a top+bottom hairline frames it like Obsidian's Properties.
   Token-only. */
.properties {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: var(--space-sm) 0 var(--space-lg);
  padding: var(--space-xs) 0;
}

.properties-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: start;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

/* Left column — muted key with icon, Obsidian's "property name" look. */
.properties-key {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--font-size-label);
  line-height: var(--line-height-body);
  padding-top: 3px;
}

.properties-key > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right column — the value, room for chips + a trailing compact affordance. */
.properties-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--hit-min-height);
  font-size: var(--font-size-body);
  color: var(--color-text);
}

.properties-value-tags {
  gap: var(--space-sm);
}

.properties-text {
  line-height: var(--line-height-body);
  padding-top: 3px;
}

.properties-empty {
  color: var(--color-faint);
  font-size: var(--font-size-label);
  padding-top: 3px;
}

/* Inline value input — borderless until hover/focus so the row reads as data, not
   a form field (Obsidian parity). */
.properties-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 32px;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-family-ui);
  font-size: var(--font-size-body);
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.properties-input::placeholder {
  color: var(--color-faint);
}

.properties-input:hover {
  border-color: var(--color-border);
}

.properties-input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg);
}

/* The compact ✨/✕ affordances stay quiet until the row is hovered/focused. */
.properties-row .properties-remove,
.properties-value .tagsuggest .icon-btn,
.properties-value .descgen .icon-btn {
  opacity: 0.55;
}

.properties-row:hover .properties-remove,
.properties-row:focus-within .properties-remove,
.properties-value:hover .tagsuggest .icon-btn,
.properties-value:focus-within .tagsuggest .icon-btn,
.properties-value:hover .descgen .icon-btn,
.properties-value:focus-within .descgen .icon-btn {
  opacity: 1;
}

/* The compact LLM slots must not add their own block margins inside the row. */
.properties-value .tagsuggest,
.properties-value .descgen {
  display: inline-flex;
}

/* Add-property row — three cells, mirrors a value row's rhythm. */
.properties-add {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.properties-add-key {
  color: var(--color-text-muted);
}

/* Tag chips — accent text on a faint accent fill, echoing the in-editor
   `.cm-hashtag` badge (theme.ts). Folded in from the retired TagBadgeBar; raw px
   replaced with tokens per the styling contract. */
.tag-badge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px var(--space-sm);
  font-size: var(--font-size-label);
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: var(--radius-sm);
  line-height: var(--line-height-label);
  white-space: nowrap;
}

/* Inline-origin tags are managed in the body — no pointer affordance. */
.tag-badge-inline {
  cursor: default;
}

.tag-badge-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0;
  opacity: 0.6;
}

.tag-badge-x:hover {
  opacity: 1;
  background: var(--color-accent-soft);
}
