.sidebar {
  width: 360px;
  min-width: 360px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
}
.sidebar-header .logo-icon { font-size: 1.6rem; }
.sidebar-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.sidebar-header p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 0.5rem;
  padding: 0.85rem;
}
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
.kv-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.kv-grid .v {
  color: var(--text-main);
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 0.78rem;
  text-align: right;
}
.row-group {
  border-top: 1px solid var(--border-glass);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}
.row-group:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.row-label {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.row-label .count {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
}
.slot-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
}
.slot-chip {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-glass);
  border-radius: 0.3rem;
  padding: 0.3rem;
  text-align: center;
  font-size: 0.7rem;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  cursor: pointer;
  transition: all 0.15s;
}
.slot-chip:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,0.1);
}
.slot-chip.selected {
  border-color: var(--accent);
  background: rgba(99,102,241,0.25);
  color: var(--text-main);
}
.slot-chip.occupied {
  color: var(--accent-hover);
}
/* Inactive (not-selected-group) rows: still editable, just visually subdued
   so the selected engraving target stands out. */
.row-group.inactive-group .slot-chip {
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.45);
  border-color: rgba(255,255,255,0.06);
}
.row-group.inactive-group .slot-chip.occupied { color: rgba(129,140,248,0.7); }
.row-group.inactive-group .row-label { color: rgba(255,255,255,0.55); }
.row-group.inactive-group .row-label .count { color: rgba(255,255,255,0.35); }
.row-group .inactive-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-glass);
  padding: 1px 6px;
  border-radius: 0.3rem;
  margin-left: 0.4rem;
}
.muted {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
